-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yusuf Kanchwala
committed
Aug 15, 2020
1 parent
7959c9d
commit bb18e34
Showing
5 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...cies/aws_cloudfront_distribution/AWS.CloudFront.EncryptionandKeyManagement.High.0407.json
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,12 +1,12 @@ | ||
{ | ||
"name": "cloudfrontNoHTTPSTraffic", | ||
"file": "cloudfrontNoHTTPSTraffic.rego", | ||
"templateArgs": { | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "HIGH", | ||
"description": "Use encrypted connection between CloudFront and origin server", | ||
"referenceId": "AWS.CloudFront.EncryptionandKeyManagement.High.0407", | ||
"reference_id": "AWS.CloudFront.EncryptionandKeyManagement.High.0407", | ||
"category": "Encryption and Key Management", | ||
"version": 2 | ||
} |
4 changes: 2 additions & 2 deletions
4
...cies/aws_cloudfront_distribution/AWS.CloudFront.EncryptionandKeyManagement.High.0408.json
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,12 +1,12 @@ | ||
{ | ||
"name": "cloudfrontNoSecureCiphers", | ||
"file": "cloudfrontNoSecureCiphers.rego", | ||
"templateArgs": { | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "HIGH", | ||
"description": "Secure ciphers are not used in CloudFront distribution", | ||
"referenceId": "AWS.CloudFront.EncryptionandKeyManagement.High.0408", | ||
"reference_id": "AWS.CloudFront.EncryptionandKeyManagement.High.0408", | ||
"category": "Encryption and Key Management", | ||
"version": 2 | ||
} |
4 changes: 2 additions & 2 deletions
4
...testdata/testpolicies/aws_cloudfront_distribution/AWS.CloudFront.Logging.Medium.0567.json
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,12 +1,12 @@ | ||
{ | ||
"name": "cloudfrontNoLogging", | ||
"file": "cloudfrontNoLogging.rego", | ||
"templateArgs": { | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "MEDIUM", | ||
"description": "Ensure that your AWS Cloudfront distributions have the Logging feature enabled in order to track all viewer requests for the content delivered through the Content Delivery Network (CDN).", | ||
"referenceId": "AWS.CloudFront.Logging.Medium.0567", | ||
"reference_id": "AWS.CloudFront.Logging.Medium.0567", | ||
"category": "Logging", | ||
"version": 2 | ||
} |
12 changes: 12 additions & 0 deletions
12
...ta/testpolicies/aws_cloudfront_distribution/AWS.CloudFront.Network Security.Low.0568.json
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,12 @@ | ||
{ | ||
"name": "cloudfrontNoGeoRestriction", | ||
"file": "cloudfrontNoGeoRestriction.rego", | ||
"template_args": { | ||
"prefix": "" | ||
}, | ||
"severity": "LOW", | ||
"description": "Ensure that geo restriction is enabled for your Amazon CloudFront CDN distribution to whitelist or blacklist a country in order to allow or restrict users in specific locations from accessing web application content.", | ||
"reference_id": "AWS.CloudFront.Network Security.Low.0568", | ||
"category": "Network Security", | ||
"version": 2 | ||
} |
10 changes: 10 additions & 0 deletions
10
...-server/testdata/testpolicies/aws_cloudfront_distribution/cloudfrontNoGeoRestriction.rego
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,10 @@ | ||
package accurics | ||
|
||
{{.prefix}}cloudfrontNoGeoRestriction[retVal] { | ||
cloudfront = input.aws_cloudfront_distribution[_] | ||
some i | ||
restrict = cloudfront.config.restrictions[i] | ||
restrict.geo_restriction[j].restriction_type == "none" | ||
traverse := sprintf("restrictions[%d].geo_restriction[%d].restriction_type", [i]) | ||
retVal := { "Id": cloudfront.id, "ReplaceType": "edit", "CodeType": "attribute", "Traverse": traverse, "Attribute": "restrictions.geo_restriction.restriction_type", "AttributeDataType": "string", "Expected": "whitelist", "Actual": restrict.geo_restriction[_].restriction_type } | ||
} |