Skip to content

Commit

Permalink
fixing http-server unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Kanchwala committed Aug 15, 2020
1 parent 7959c9d commit bb18e34
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
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
}
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
}
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
}
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
}
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 }
}

0 comments on commit bb18e34

Please sign in to comment.