Skip to content

Commit

Permalink
fix(cloud): Fix KMSKeyID check
Browse files Browse the repository at this point in the history
Fixes: aquasecurity/trivy#4628

Signed-off-by: Simar <[email protected]>
  • Loading branch information
simar7 committed Jun 30, 2023
1 parent 46eeeb0 commit 11d9cfa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/adapters/cloud/aws/rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,15 @@ func (a *adapter) adaptDBSnapshots(dbSnapshots types.DBSnapshot) (*rds.Snapshots
DBSnapshotIdentifier: defsecTypes.String(*dbSnapshots.DBSnapshotIdentifier, metadata),
DBSnapshotArn: defsecTypes.String(*dbSnapshots.DBSnapshotArn, metadata),
Encrypted: defsecTypes.Bool(dbSnapshots.Encrypted, metadata),
KmsKeyId: defsecTypes.String(*dbSnapshots.KmsKeyId, metadata),
KmsKeyId: defsecTypes.String("", metadata),
SnapshotAttributes: SnapshotAttributes,
}

// KMSKeyID is only set if Encryption is enabled
if snapshots.Encrypted.IsTrue() {
snapshots.KmsKeyId = defsecTypes.StringDefault(*dbSnapshots.KmsKeyId, metadata)
}

return snapshots, nil
}

Expand Down

0 comments on commit 11d9cfa

Please sign in to comment.