Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add policy for AWS KMS Key Confused Deputy Protection #1449

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

bcpenta
Copy link
Contributor

@bcpenta bcpenta commented Dec 12, 2024

Background

This policy ensures that AWS KMS Key policies with service principals include conditions to prevent cross-service confused deputy issues. Without these conditions (such as aws:SourceArn, aws:SourceAccount, aws:SourceOrgID, or aws:SourceOrgPaths), attackers may exploit the policy to misuse KMS keys by impersonating trusted services.
https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html

Changes

Added a new policy: AWS.KMS.ConfusedDeputyProtection to verify that AWS KMS Key policies containing service principals include at least one of the required conditions to prevent cross-service abuse.

Testing

KMS Key Policy Without Required Conditions:

A key policy with a service principal but no required conditions.
Expected Result: Fail.

KMS Key Policy With Required Conditions:

A key policy with a service principal and at least one valid condition.
Expected Result: Pass.

KMS Key Policy Without Service Principal:

A key policy without any service principal.
Expected Result: Pass.

@bcpenta bcpenta requested a review from a team as a code owner December 12, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant