In KMS there are the amazon aliased keys (e.g./alias/aws/s3
) and Customer Master Keys (CMKs).
For each development team, I have a few CMKs with aliases (e.g. /alias/team1/default
, /alias/team1/confidential
)
I'd like to allow access to the aws aliased keys to all IAM users/groups/roles, but provide team level access to team level keys
My issue comes when trying to allow access to aws managed keys
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"NotAction": [
"iam:*",
"kms:*"
],
"Resource": "*",
"Condition": {
"Null": {
"aws:MultiFactorAuthAge": "false"
}
}
},
{
"Effect": "Allow",
"Resource": "arn:aws:kms:us-east-1:111111111111:alias/aws/*",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Condition": {
"Null": {
"aws:MultiFactorAuthAge": "false"
}
}
}
]
}
To provide implicit deny to iam:*
and kms:*
, but allow access to aws aliased Keys
When working with the IAM policy simulator, it looks like I have to provide access to the full key arn (arn:aws:kms:us-east-1:111111111111:key/abcd123-acbd-1234-abcd-acbcd1234abcd
) rather than the alias (arn:aws:kms:us-east-1:111111111111:alias/aws/*
)
Is there a better way to manage this?
I know I can manage access to CMKs using key policies and not allow access from IAM, but you can't use groups as a Principal
in a KMS key policy