-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checks(aws): change the wording of AVD-AWS-0015
- Loading branch information
Showing
8 changed files
with
76 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
Enable encryption at rest | ||
Use Customer managed key | ||
|
||
```hcl | ||
resource "aws_cloudtrail" "good_example" { | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
|
||
Cloudtrail logs should be encrypted at rest to secure the sensitive data. Cloudtrail logs record all activity that occurs in the the account through API calls and would be one of the first places to look when reacting to a breach. | ||
Using Customer managed keys provides comprehensive control over cryptographic keys, enabling management of policies, permissions, and rotation, thus enhancing security and compliance measures for sensitive data and systems. | ||
|
||
### Impact | ||
Data can be freely read if compromised | ||
Using AWS managed keys does not allow for fine grained control | ||
|
||
<!-- DO NOT CHANGE --> | ||
{{ remediationActions }} | ||
|
||
### Links | ||
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html | ||
|
||
- https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-mgmt | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package cloudtrail | ||
|
||
import ( | ||
"github.com/aquasecurity/trivy-policies/pkg/rules" | ||
"github.com/aquasecurity/trivy/pkg/iac/providers" | ||
"github.com/aquasecurity/trivy/pkg/iac/scan" | ||
"github.com/aquasecurity/trivy/pkg/iac/severity" | ||
"github.com/aquasecurity/trivy/pkg/iac/state" | ||
) | ||
|
||
var EncryptionCustomerManagedKey = rules.Register( | ||
scan.Rule{ | ||
AVDID: "AVD-AWS-0015", | ||
Provider: providers.AWSProvider, | ||
Service: "cloudtrail", | ||
ShortCode: "encryption-customer-managed-key", | ||
Summary: "CloudTrail should use Customer managed keys to encrypt the logs", | ||
Impact: "Using AWS managed keys does not allow for fine grained control", | ||
Resolution: "Use Customer managed key", | ||
Explanation: `Using Customer managed keys provides comprehensive control over cryptographic keys, enabling management of policies, permissions, and rotation, thus enhancing security and compliance measures for sensitive data and systems.`, | ||
Links: []string{ | ||
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html", | ||
"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-mgmt", | ||
}, | ||
Terraform: &scan.EngineMetadata{ | ||
GoodExamples: terraformEncryptionCustomerManagedKeyGoodExamples, | ||
BadExamples: terraformEncryptionCustomerManagedKeyBadExamples, | ||
Links: terraformEncryptionCustomerManagedKeyLinks, | ||
RemediationMarkdown: ``, | ||
}, | ||
CloudFormation: &scan.EngineMetadata{ | ||
GoodExamples: cloudFormationEncryptionCustomerManagedKeyGoodExamples, | ||
BadExamples: cloudFormationEncryptionCustomerManagedKeyBadExamples, | ||
Links: cloudFormationEncryptionCustomerManagedKeyLinks, | ||
RemediationMarkdown: ``, | ||
}, | ||
Severity: severity.High, | ||
}, | ||
func(s *state.State) (results scan.Results) { | ||
for _, trail := range s.AWS.CloudTrail.Trails { | ||
if trail.KMSKeyID.IsEmpty() { | ||
results.Add( | ||
"CloudTrail does not use a customer managed key to encrypt the logs.", | ||
trail.KMSKeyID, | ||
) | ||
} else { | ||
results.AddPassed(&trail) | ||
} | ||
} | ||
return | ||
}, | ||
) |
This file contains 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
This file contains 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