Skip to content

Incorrect conclusions on control "aws_compliance.control.kms_cmk_policy_prohibit_public_access" #866

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

Open
ramses999 opened this issue Feb 25, 2025 · 2 comments · May be fixed by #887
Open
Assignees
Labels
bug Something isn't working

Comments

@ramses999
Copy link
Contributor

In practice, I encountered the fact that the company has 20+ KMS CMK with the policy below:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": [
        "kms:Encrypt",
        "kms:Decrypt",
        "kms:ReEncrypt*",
        "kms:GenerateDataKey*",
        "kms:CreateGrant",
        "kms:ListGrants",
        "kms:DescribeKey"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "kms:ViaService": "rds.eu-north-1.amazonaws.com",
          "kms:CallerAccount": "11111111111111"
        }
      }
    }

Check "aws_compliance.control.kms_cmk_policy_prohibit_public_access" does not take into account Condition - which restricts access from the Internet and therefore the check status should be "PASS", not "alarm".

@ramses999 ramses999 added the bug Something isn't working label Feb 25, 2025
@misraved misraved self-assigned this Feb 26, 2025
@misraved
Copy link
Contributor

Thanks @ramses999 for raising the issue 👍!!

Overall we are reevaluating our queries that check for a resource's public access.

We will raise a PR with more refinements that will aim to resolve the issues pertaining to public access via IAM policies.

@Priyanka-Chatterjee-2000
Copy link
Contributor

Hi @ramses999, could you please take a moment to try out this PR and let me know if it works for you?

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