fix: use a customer managed KMS key for RDS storage encryption - #3
Merged
Conversation
storage_encrypted = true alone falls back to the AWS-managed RDS key. Trivy's check for aws_db_instance doesn't require an explicit kms_key_id (unlike AVD-AWS-0079 for aws_rds_cluster, which caught this in the Aurora module), but the same gap exists here. Add a dedicated KMS key for parity and better key policy/rotation control.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
services-postgresql-aurora(ci: add PR validation checks and release automation services-postgresql-aurora#2), Trivy'sAVD-AWS-0079flagged that the Aurora cluster relies on the AWS-managed default key instead of a customer managed KMS key for storage encryption.aws_db_instance.mainhas the same gap (storage_encrypted = truewith nokms_key_id) — Trivy just doesn't flag it because its check foraws_db_instancedoesn't require an explicit key the way theaws_rds_clustercheck does.aws_kms_key/aws_kms_aliasand setskms_key_idon the instance, for parity with the Aurora fix and so nullplatform controls the key policy/rotation instead of relying on the AWS-managed default.Test plan
tofu fmt -checkandtofu validatepass onrds-postgres-server/deploymentterraform planon an existing instance to confirm this forces a new KMS key + in-placekms_key_idupdate, not a full instance replacement (AWS allows changing KMS key on an encrypted RDS instance without recreating it, but worth confirming against the actual plan)