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

False positive: Publicly-accessible KMS keys #1579

Open
rdegraaf opened this issue Oct 13, 2023 · 1 comment
Open

False positive: Publicly-accessible KMS keys #1579

rdegraaf opened this issue Oct 13, 2023 · 1 comment
Labels
bug Something isn't working potential Unconfirmed issue

Comments

@rdegraaf
Copy link

Describe the bug

ScoutSuite reported a number of KMS CMKs in my account as being publicly accessible. Upon investigation, they are not. My best guess for why ScoutSuite thinks that they are is that the condition key "kms:callerAccount" was spelled with a lower-case 'c' rather than the nominal upper-case 'C':

{
    "Sid": "Allow all principals in this account to use this key",
    "Effect": "Allow",
    "Principal": {
        "AWS": "*"
    },
    "Action": [
        "kms:Decrypt",
        "kms:GenerateDataKey*"
    ],
    "Resource": "*",
    "Condition": {
        "StringEquals": {
            "kms:callerAccount": "123456789012"
        }
    }
}

As per https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html, condition key names are not case-sensitive so "kms:CallerAccount" and "kms:callerAccount" are equivalent.

If this is indeed a correct analysis of the problem, it likely applies to other findings as well.

To Reproduce

I have not tried to create a reproduction case for this flaw. Let me know if you're having difficulty and I will try to help. However, I will most likely no longer have access to the account where I encountered this flaw.

@rdegraaf rdegraaf added bug Something isn't working potential Unconfirmed issue labels Oct 13, 2023
@x64-latacora
Copy link

This is indeed a bug. #1515 addresses it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working potential Unconfirmed issue
Projects
None yet
Development

No branches or pull requests

2 participants