π§ AWS S3 Bucket Policy is not set to deny HTTP requests - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
- Located in: π AWS S3 Bucket Policy is not set to deny HTTP requests π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS S3 Bucket | CA10__CaAwsBucket__c | 16 | 1 | 7 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:45:11.066914511Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
π’ | test2 | βοΈ 199 | βοΈ extract('CA10__policyDocument__c').isEmpty() | βοΈ null |
π’ | test3 | βοΈ 299 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') == number(0.0) && extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') == number(0.0) | βοΈ null |
π’ | test4 | βοΈ 299 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') == number(0.0) && extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') == number(0.0) | βοΈ null |
π’ | test5 | βοΈ 299 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') == number(0.0) && extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') == number(0.0) | βοΈ null |
π’ | test6 | βοΈ 299 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') == number(0.0) && extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') == number(0.0) | βοΈ null |
π’ | test7 | βοΈ 399 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') > number(0.0) || extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') > number(0.0) | βοΈ null |
π’ | test8 | βοΈ 399 | βοΈ extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.Bool."aws:SecureTransport" == \'false\'])') > number(0.0) || extract('caJsonFrom__policyDocument__c').jsonQueryText('length(Statement[? Effect == \'Deny\' && Condition.NumericLessThan."s3:TlsVersion" == \'1.2\'])') > number(0.0) | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/s3/bucket-policy-deny-http-requests/policy.yaml | 2BD1484D9DD5B93C00AAB474F49042C7 |
Open | /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml | 1763984FE618A6CD9AE7A8A107CC8A7C |
Open | /types/CA10__CaAwsBucket__c/object.extracts.yaml | D7F01723B629E0F1265F06B9CE2EDE1F |
Open | /ce/ca/aws/s3/bucket-policy-deny-http-requests/test-data.json | 31AD5B8DD97468C94B6DEB458D049CBD |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/aws/s3/bucket-policy-deny-http-requests/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsBucket__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaAwsBucket__c/object.extracts.yaml
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "The bucket policy hasn't been configured for this bucket and by default it's allowing both HTTP and HTTPS requests."
remediationMessage: "Consider configuring the bucket policy that will deny HTTP requests."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10__policyDocument__c"
- status: "INCOMPLIANT"
currentStateMessage: "The bucket policy hasn't been configured to deny HTTP requests."
remediationMessage: "Consider configuring the bucket policy that will deny HTTP requests."
check:
AND:
args:
- IS_EQUAL:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__policyDocument__c"
expression: "length(Statement[? Effect == 'Deny' && Condition.Bool.\"aws:SecureTransport\" == 'false'])"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return a number type."
right:
NUMBER: 0.0
- IS_EQUAL:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__policyDocument__c"
expression: "length(Statement[? Effect == 'Deny' && Condition.NumericLessThan.\"s3:TlsVersion\" == '1.2'])"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return a number type."
right:
NUMBER: 0.0
- status: "COMPLIANT"
currentStateMessage: "The bucket policy has been configured to deny HTTP requests."
check:
OR:
args:
- GREATER_THAN:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__policyDocument__c"
expression: "length(Statement[? Effect == 'Deny' && Condition.Bool.\"aws:SecureTransport\" == 'false'])"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return a number type."
right:
NUMBER: 0.0
- GREATER_THAN:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__policyDocument__c"
expression: "length(Statement[? Effect == 'Deny' && Condition.NumericLessThan.\"s3:TlsVersion\" == '1.2'])"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return a number type."
right:
NUMBER: 0.0
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the field."