More Info:

This rule checks if the inline policies attached to your IAM roles do not allow blocked actions on all AWS Key Management Service (KMS) keys. The rule is NON_COMPLIANT if any blocked action is allowed on all AWS KMS keys in an inline policy.

Risk Level

Medium

Address

Security

Compliance Standards

CBP

Triage and Remediation

How to Prevent

To prevent blocked KMS actions in inline policies in IAM using the AWS Management Console, follow these steps:

  1. Navigate to IAM Policies:

    • Open the AWS Management Console.
    • In the navigation pane, choose “Policies” under the “Access management” section.
  2. Create or Edit a Policy:

    • To create a new policy, click on the “Create policy” button.
    • To edit an existing policy, find the policy you want to modify and click on its name, then click the “Edit policy” button.
  3. Specify KMS Actions:

    • In the policy editor, switch to the “JSON” tab.
    • Ensure that the policy explicitly specifies the allowed KMS actions. For example:
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "kms:Encrypt",
              "kms:Decrypt",
              "kms:GenerateDataKey"
            ],
            "Resource": "*"
          }
        ]
      }
      
  4. Review and Save:

    • After specifying the allowed KMS actions, click on the “Review policy” button.
    • Provide a name and description for the policy if creating a new one.
    • Click on the “Create policy” or “Save changes” button to apply the policy.

By following these steps, you ensure that the inline policies in IAM explicitly allow the necessary KMS actions, preventing any misconfigurations related to blocked KMS actions.