Right, let’s talk about the three flavors of keys in KMS. This isn’t just a menu of options; it’s a fundamental choice about who holds the keys to your kingdom—you, AWS, or a weird shared custody arrangement. Getting this wrong is a fantastic way to either create a management nightmare or accidentally lock yourself out of your own data. So pay attention.
The Quick ‘What Are They?’ Breakdown AWS Managed Keys (SSE-KMS): The key AWS creates and manages for you automatically when you select the “aws/kms” option in a service like S3 or EBS. You never see the key material, and its policy is entirely controlled by AWS. It’s the “just make it work” option. Customer Managed Keys (CMKs): These are the keys you create in your own account. You control their key policy, define who can use them, enable/disable them, and rotate them. This is where you go for any serious, application-level encryption. This is our main character. Customer Provided Keys (Import Your Own Key): This is the “hold my beer” option. You generate your own encryption key material externally and import it into KMS. KMS will then use your key material to perform its cryptographic operations. It’s for the ultra-paranoid (or those with specific compliance needs) who don’t trust AWS to even generate the key. Why You Should Almost Always Use Customer Managed Keys AWS Managed Keys are seductively easy. Click a dropdown, and boom, encryption. But they come with a massive, hilarious caveat: their permissions are often wildly over-permissive. The default key policy for an AWS-managed key often grants encryption/decryption permissions to the service itself across your entire account. If an IAM user in your account can access the S3 bucket, they can probably decrypt its contents, because the S3 service is allowed to use the key on their behalf. You’ve encrypted the data, but you haven’t really controlled access to the key.