KMS Key Context, IAM Conditions, and S3
At $work, I’ve been using KMS to encrypt s3 bucket contents for some time now.
It works rather well, but one thing that had been bugging me is that our IAM
policies granted both read permissions on bucket objects and encrypt/decrypt
on the relevant KMS key. That is, principals with the policies attached can
use the key to encrypt/decrypt anything they otherwise have permission to
access, not just objects in the bucket. It didn’t appear that there was a
reasonable way to tighten this until I ran across references to the IAM
kms:EncryptionContext: condition.

