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

feat(kms): change default key policy to align with KMS best practices (under feature flag) #11918

Merged
merged 7 commits into from
Dec 9, 2020

Commits on Dec 7, 2020

  1. feat(kms): change default key policy to align with KMS best practices…

    … (under feature flag)
    
    In #5575, a new flag (`trustAccountIdentities`) was introduced which -- when set
    -- changes the default key policy from a custom key admin policy to one that
    grants all access to the key to the root account user. This key policy matches
    the default policy when a key is created via the KMS APIs or console.
    
    For backwards-compatibility reasons, the default for `trustAccountIdentities`
    had to be set to `false`. Without the flag explicitly set, the default key
    policy is one that (a) doesn't match the KMS-recommended admin policy and (b)
    doesn't explicitly enable IAM principal policies to acccess the key. This means
    that all usage operations (e.g., Encrypt, GenerateDataKey) must be added to both
    the key policy and to the principal policy.
    
    This change introduces a new feature flag to flip the default behavior of the
    `trustAccountIdentities` flag, so new keys created will have the sane defaults
    matching the KMS recommended best practices.
    
    As a related change, this feature flag also changes the behavior when a user
    passes in `policy` when creating a Key. Without the feature flag set, the policy
    is always appended to the default key policy. With the feature flag set, the
    policy will *override* the default key policy, enabling users to opt-out of the
    default key policy to introduce a more restrictive policy if desired. This also
    matches the KMS API behavior, where a policy provided by the user will override
    the defaults.
    
    Marking this PR as `requires-two-approvers` to ensure this PR gets an
    appropriately-critical review.
    
    BREAKING CHANGE: change the default value of trustAccountIdentities to true,
    which will result in the key getting the KMS-recommended default key
    policy. This is enabled through the '@aws-cdk/aws-kms:defaultKeyPolicies'
    feature flag.
    
    fixes #8977
    fixes #10575
    fixes #11309
    njlynch committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    d03c0b9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef7f64a View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2020

  1. Revert "Updated tests for new actions ordering"

    This reverts commit ef7f64a.
    njlynch committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    8e78738 View commit details
    Browse the repository at this point in the history
  2. First round of PR feedback

    njlynch committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    0307e64 View commit details
    Browse the repository at this point in the history
  3. addAdmin -> grantAdmin

    njlynch committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    be68121 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2020

  1. README updates

    njlynch committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    124362c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf36a36 View commit details
    Browse the repository at this point in the history