Core KMS Concepts and Architecture
AWS Key Management Service (KMS) is a managed service that creates and controls customer master keys (CMKs) used to encrypt your data. KMS integrates with most AWS services and forms the foundation of encryption across your infrastructure. The service uses hardware security modules (HSMs) to protect cryptographic keys.
How KMS Keys Work
You work with two types of keys in KMS: customer master keys (CMKs) and data keys. CMKs encrypt data keys, which then encrypt your actual data. This approach, called envelope encryption, keeps your CMK from directly encrypting large datasets. Your CMK never needs to process massive encryption operations.
Regional Architecture and Automatic Rotation
KMS operates on a regional basis. Keys are stored and managed within specific AWS regions. The service automatically rotates customer-managed CMKs annually without requiring manual data reencryption. KMS maintains a complete audit trail through CloudTrail for all key usage, which is critical for compliance.
Key Types and Use Cases
You can create customer-managed CMKs or use AWS-managed keys that AWS creates automatically. Customer-managed keys give you full control over rotation policies, key policies, and costs per API call. AWS-managed keys require no management but offer less control. Understanding when to use each type and their cost implications is crucial for the exam.
Access Control with Key Policies and Grants
KMS supports key policies (resource-based policies) and grants (temporary permissions) for granular access control. Key policies determine who can perform encryption, decryption, and key management operations. The ability to design secure encryption architectures, understand KMS limitations, and select appropriate strategies is tested extensively.
Key Policies, Grants, and Access Control
Key policies are resource-based JSON documents that define who can perform which actions on a KMS key. Every CMK has a key policy. These policies determine permissions for operations like encrypt, decrypt, generate data key, and key management actions.
Key Policies vs IAM Policies
Unlike IAM policies alone, key policies can explicitly deny access and grant permissions across AWS accounts. This makes them essential for multi-account encryption strategies. Key policies also determine whether the account owner can modify the policy itself. A key policy always includes the account root principal with appropriate permissions.
Using Grants for Temporary Access
Grants provide flexible alternatives to key policies for temporary or programmatic access. Grants allow you to grant permissions to AWS principals for specific operations on a CMK with optional constraints. Grants are ideal for short-term access patterns. Key policies suit more permanent foundational access needs.
Cross-Account Encryption Design
A common exam scenario involves granting an IAM role in one AWS account permission to use a CMK in another account. You must modify the CMK's key policy to grant the external account access. Then ensure that role has appropriate IAM permissions in its own account. Both layers are required.
Access Control Best Practices
Follow the principle of least privilege when crafting key policies. Understanding when to use each mechanism, how they interact with IAM policies, and how to troubleshoot access denied errors is critical for certification preparation.
Encryption at Rest and in Transit Integration
KMS integrates seamlessly with major AWS services for encryption at rest. You can specify which CMK encrypts each object or resource. This provides customer control over encryption keys and generates audit trails.
Services Supporting KMS Encryption
- Amazon S3 uses KMS-managed keys (SSE-KMS) to encrypt objects
- EBS volumes encrypt transparently using KMS with excellent performance
- RDS databases support KMS encryption for storage, backups, and read replicas
- DynamoDB, ElastiCache, and other services also integrate with KMS
Comparing KMS and AWS-Managed Encryption
KMS encryption provides customer control, better compliance capabilities through audit trails, and the ability to implement custom key rotation policies. However, it introduces slight latency compared to AWS-managed encryption and costs per API call. AWS-managed encryption requires no key management but offers less control.
Encryption in Transit Considerations
KMS relates indirectly to encryption in transit. Many AWS services support TLS encryption by default for data in transit. KMS can manage keys used for TLS certificates and VPN connections. Understanding when to require encrypted connections and how to enforce encryption policies through service control policies (SCPs) matters for comprehensive security design.
Making Encryption Decisions
Architecture decisions depend on data sensitivity, compliance requirements, performance needs, and audit requirements. You must decide whether to encrypt specific data types, which CMKs to use, and how to manage key access across services.
Key Rotation, Backup, and Disaster Recovery
Key rotation is a critical security practice that minimizes the impact of potential key compromise. When you enable automatic rotation on a CMK, AWS rotates the key every 365 days automatically.
How Automatic Rotation Works
During rotation, the new key material becomes active for encrypting new data. Previous key material is retained indefinitely to decrypt existing data. The rotation process is completely transparent. You do not need to manually reencrypt data to complete rotation. AWS-managed keys rotate automatically every 90 days.
Manual Rotation and Key Aliases
Manual rotation is possible by creating a new key and updating applications to reference the alias to the new key. This approach requires more operational effort but gives you explicit control over timing. Understanding the implications of rotation for your systems is important.
Key Deletion and Recovery Windows
For disaster recovery, KMS keys don't require explicit backup because AWS secures the key material. If you need to recover from accidental deletion, enable a waiting period before deletion completes. The default is 7 days, with options from 7 to 30 days. During this period, the key is in pending deletion state and cannot encrypt or decrypt data.
Compliance and Monitoring
Automatic key rotation is essential in compliance frameworks like HIPAA, PCI-DSS, and SOC 2. Monitor key rotation status through CloudTrail logs. Design systems that tolerate brief key rotation events without impacting availability. Understanding key lifecycle and deletion implications for dependent systems is critical.
Common Exam Scenarios and Design Decisions
Solutions Architect exam questions test your ability to select appropriate KMS configurations for specific scenarios. You must quickly identify which encryption approach meets compliance requirements while minimizing cost and complexity.
Compliance and Encryption Selection
A typical scenario presents a compliance requirement like HIPAA and asks which encryption approach satisfies it while optimizing cost. Identify when customer-managed KMS encryption is necessary versus when simple AWS-managed encryption suffices. Understand the associated costs and complexity tradeoffs.
Multi-Account Architecture Challenges
Multi-account architectures frequently appear in exam questions. You must design CMK policies that allow cross-account encryption while maintaining security. Balance access requirements with the principle of least privilege.
KMS Versus Other Encryption Options
Choose between KMS, S3 bucket encryption, and application-level encryption. KMS provides strong key management but introduces API call overhead. Application-level encryption provides control but requires managing keys outside AWS. Understand these tradeoffs deeply.
Performance and Throttling Considerations
Performance questions test your understanding of KMS throttling limits and envelope encryption impact. High-throughput scenarios might require data key caching to minimize KMS API calls. Design efficient encryption architectures that meet both security and performance needs.
Disaster Recovery and Regional Limitations
Disaster recovery scenarios test whether encrypted data remains accessible after key rotation. Understand how cross-region replication of KMS-encrypted data works and recognize that KMS is a regional service. Know the implications for recovery architectures.
Complex Policy and Context-Specific Questions
Key policy questions require interpreting complex JSON and identifying permission gaps. The exam tests encryption in specific contexts: S3 objects with customer-provided keys versus KMS keys, RDS encryption implications for backups, and secure parameter storage using Systems Manager Parameter Store or Secrets Manager with KMS. Success requires understanding decision-making frameworks and tradeoffs.
