Cross-Account AWS KMS Access: Best Practices for Secure Key Sharing
In modern cloud architectures, data and services often span multiple AWS accounts. Managing encryption keys across these accounts is a common requirement, yet it introduces a risk surface if not done carefully. Cross-account KMS access is the mechanism that allows trusted principals in one AWS account to perform cryptographic operations with keys stored in another account. When implemented correctly, it enables secure data sharing, centralized key governance, and streamlined operations. When done poorly, it can expose sensitive material, complicate audits, and increase blast radius. This article explores practical approaches to enable cross-account KMS access while preserving security, compliance, and operational efficiency.
Why cross-account KMS access matters
Encryption keys in AWS KMS are powerful assets. They protect data at rest, unlock business workflows, and support secure integration between teams and services. Cross-account access becomes necessary in several scenarios: shared data lakes, centralized key management with regional replicas, third-party access to specific datasets, and collaboration between product and security teams across separate AWS organizations. The goal is to grant the minimum privileges required for the intended operation, with clear boundaries, traceability, and the ability to revoke access quickly if needed.
Designing a secure cross-account key policy
The most common way to enable cross-account KMS access is through a carefully crafted key policy. A key policy is the primary access control mechanism for AWS KMS keys. When granting cross-account access, you typically update the key policy to allow a principal from the other account to perform the necessary actions, such as Encrypt, Decrypt, ReEncrypt, GenerateDataKey, and DescribeKey. The policy should also constrain actions to the specific key (or keys) and include conditions that limit usage to legitimate contexts (for example, requests that originate from a particular AWS service or resource).
Key policy design should follow these guidelines:
- Grant the least privilege necessary for the requested operation.
- Explicitly specify the cross-account principal using its ARN, not broad principals.
- Require essential IAM roles or services to assume a role in the requester account, if possible, to provide a traceable identity.
- Use conditions to restrict access by account, service, or source resource.
- Document the purpose of the cross-account access and the expected usage patterns for audits.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CrossAccountAccessForDataSharing",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111122223333:root" },
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "*",
"Condition": {
"StringEquals": { "aws:SourceAccount": "111111111111" }
}
}
]
}
In this example, the key policy authorizes an identity from account 111-111-111111 to perform common cryptographic operations on the key, but only if the request originates from the specified source account. Such conditioning helps prevent unauthorized cross-account usage and improves visibility for audits.
Roll in IAM roles and trust relationships
While a robust key policy is essential, integrating IAM roles and trust policies adds flexibility and accountability. A typical pattern is to let a role in the requester account assume a role in the key owner account. That role can then perform operations against the key in KMS. This approach provides a clear chain of responsibility and makes revocation straightforward by updating or deleting the role in the requester account.
- In the key owner account, grant the role from the requester account permission to use the key.
- In the requester account, require applications to assume the cross-account role before calling KMS.
- Audit role assumption activity with AWS CloudTrail to verify who accessed the key and when.
Example scenario: Account A hosts a data lake returning encrypted data to Account B’s analytics service. Account B assumes a role in Account A that has permissions to use the KMS key for decrypting the dataset. This pattern keeps cross-account interactions auditable and tightly scoped.
Grants for temporary access
AWS KMS Grants provide a way to delegate cryptographic permissions to other principals without modifying the key policy directly. Grants are well-suited for short-lived or highly dynamic access. They are issued by the key policy owner and can be rotated or revoked as needed. Grants can be used for cross-account operations such as temporary data processing in a partner environment, or for batch jobs that run on a separate schedule.
Important considerations for using grants:
- Grants have a limited lifetime. Set an appropriate TTL to minimize exposure.
- Ensure the grant recipient is identifiable and auditable.
- Use grant tokens or explicit grant parameters to convey intent in each API call.
When planning cross-account workloads, consider a hybrid approach: use IAM roles with a trusted cross-account relationship for ongoing access, and reserve grants for short-lived, tightly scoped tasks. This provides flexibility while maintaining strong control over cryptographic material.
Operational best practices and safeguards
Enabling cross-account KMS access should be paired with robust operational practices to maintain security and observability. The following recommendations help ensure that cross-account access remains manageable and auditable:
- Enable full visibility with CloudTrail for all KMS API calls. This helps you track who used the key, when, and for what purpose.
- Rotate keys according to your organization’s security policy. A rotation policy reduces the risk of key compromise and makes legacy usages easier to phase out.
- Implement strict data-handling controls in the receiving account. Ensure that only pre-approved services or roles can send or decrypt data with the cross-account KMS key.
- Use a separate KMS key for cross-account operations when possible. Keeping a dedicated key for shared workloads simplifies management and reduces blast radius.
- Limit the scope of key usage through conditions in the policy, such as restricting by source VPC, service name, or specific ARNs.
- Audit and test your cross-account access periodically. Run tabletop exercises to verify revocation and restore capabilities.
- Document all cross-account relationships and their intended use cases. Clear documentation helps security teams review and approve access when required.
Common pitfalls to avoid
Cross-account KMS access is powerful, so it is easy to slip into unsafe configurations if you rush a setup or rely on broad permissions. Watch out for these pitfalls:
- Granting broad IAM or KMS permissions to a root principal from another account. Narrow the scope to specific roles or users and limit actions to encryption-related operations unless decrypt is strictly needed.
- Neglecting to include source account restrictions or service context in the key policy. Without conditions, an attacker might exploit misconfigurations elsewhere to use the key.
- Failing to enable logging or to integrate with CloudTrail alerts. Without auditing, anomalous cross-account activity can go unnoticed.
- Allowing data to flow across accounts without an agreed data governance policy. Ensure data classification, retention, and access controls are aligned across organizations.
Practical example in a multi-account environment
Imagine a data analytics team in Account B needs to decrypt data stored in S3 buckets encrypted with a KMS key in Account A. A practical approach is to place a dedicated role in Account A that has permission to use the key, and grant the Account B analytics service the right to assume that role. The analytics service in Account B then requests temporary credentials, accesses the key via KMS, and decrypts the data as needed. All actions are logged in CloudTrail, and the team reviews access patterns monthly to ensure alignment with policy changes. This workflow demonstrates cross-account KMS access that is both secure and maintainable.
Conclusion
Cross-account KMS access is not just a technical configuration; it is a governance decision. The right combination of key policies, IAM roles, grants, and monitoring enables secure, auditable, and scalable cross-account encryption workflows. By starting with least privilege, layering roles and grants intelligently, and maintaining rigorous visibility through logging and compliance checks, organizations can enable cross-account KMS access without compromising security. With thoughtful design and disciplined operations, cross-account KMS access becomes a reliable asset rather than a risky choke point in your cloud architecture.