Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Last active August 1, 2016 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryan-lane/9a9b164c53c91ff0790c48e87bab9ed8 to your computer and use it in GitHub Desktop.
Save ryan-lane/9a9b164c53c91ff0790c48e87bab9ed8 to your computer and use it in GitHub Desktop.
Extended KMS authentication encrypt policy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"lambda:Invoke*"
],
"Effect": "Allow",
"Resource": "arn:aws:lambda:us-east-1:12345:function:awseipext-production-iad"
},
{
"Action": [
"kms:Encrypt"
],
"Effect": "Allow",
"Resource": "arn:aws:kms:us-east-1:12345:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"Condition": {
"StringEquals": {
"kms:EncryptionContext:to": "awseipext-production-iad",
"kms:EncryptionContext:from": "myrole-production-iad",
"kms:EncryptionContext:user_type": "service"
},
"ForAnyValue:StringEquals": {
"kms:EncryptionContext:resource": [
"52.0.0.1"
],
"kms:EncryptionContext:action": [
"associate",
"disassociate"
]
},
"ForAllValues:StringEquals": {
"kms:EncryptionContextKeys": [
"to",
"from",
"user_type",
"action",
"resource"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment