Skip to main content

🧠 AWS ELB Application Load Balancer is not configured to redirect HTTP to HTTPS - prod.logic.yaml🟒

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-12-27T12:01:59.660496973Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ not(setOfText(['caAwsLoadBalancerApplication']).contains(RecordType.DeveloperName))βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ extract('CA10__type__c') != 'application'βœ”οΈ null
🟒test4βœ”οΈ 399βœ”οΈ CA10__AWS_EC2_Load_Balancer_Listeners__r.has(INCOMPLIANT)βœ”οΈ null
🟒test5βœ”οΈ 499βœ”οΈ CA10__AWS_EC2_Load_Balancer_Listeners__r.has(COMPLIANT)βœ”οΈ null
🟒test6βœ”οΈ 500βœ”οΈ otherwiseβœ”οΈ null
🟒test7βœ”οΈ 499βœ”οΈ CA10__AWS_EC2_Load_Balancer_Listeners__r.has(COMPLIANT)βœ”οΈ null

Generation Bundle​

FileMD5
Open/ce/ca/aws/elb/load-balancer-redirects-http-to-https/policy.yaml8221BADCB32049ABBF15717ED226D5EE
Open/ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml009F682F494F226379F25C07B12A989D
Open/ce/ca/aws/elb/load-balancer-redirects-http-to-https/test-data.jsonB18730B58C5394F24802342E2263F88B
Open/types/CA10__CaAwsLoadBalancerListenerRule__c/object.extracts.yaml8620B9052184EA9DCB295F50762E2F27
Open/types/CA10__CaAwsLoadBalancer__c/object.extracts.yaml08ABDD2ADB04C6F391A6E9FE1F0ACBBE
Open/types/CA10__CaAwsLoadBalancerListener__c/object.extracts.yaml242B81357463C0BA88DD9D030D4E1CFD

Available Commands​

repo-manager policies generate FULL /ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/elb/load-balancer-redirects-http-to-https/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsLoadBalancer__c"
importExtracts:
- file: "/types/CA10__CaAwsLoadBalancer__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsLoadBalancerListener__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsLoadBalancerListenerRule__c/object.extracts.yaml"
recordTypes:
- "caAwsLoadBalancerApplication"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is not an Application Load Balancer."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__type__c"
right:
TEXT: "application"
- status: "INCOMPLIANT"
currentStateMessage: "The ALB has an HTTP listener that is not configured to redirect to HTTPS."
remediationMessage: "Modify the HTTP listener to use a default action of Redirect to Port 443."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_EC2_Load_Balancer_Listeners__r"
- status: "COMPLIANT"
currentStateMessage: "The ALB correctly redirects HTTP traffic to HTTPS."
check:
RELATED_LIST_HAS:
status: "COMPLIANT"
relationshipName: "CA10__AWS_EC2_Load_Balancer_Listeners__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The ALB does not have an HTTP listener enabled."
relatedLists:
- relationshipName: "CA10__AWS_EC2_Load_Balancer_Listeners__r"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is not an HTTP listener."
check:
NOT_EQUAL:
left:
FIELD:
path: "CA10__protocol__c"
right:
TEXT: "HTTP"
- status: "COMPLIANT"
currentStateMessage: "The Load Balancer Listener's default action redirects HTTP to HTTPS."
check:
NOT_EQUAL:
left:
JSON_QUERY_NUMBER:
expression: "length([?type=='redirect' && redirectConfig.protocol=='HTTPS' && redirectConfig.port=='443'])"
arg:
EXTRACT: "caJsonFrom_defaultActionsJson__c"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return Number type."
right:
NUMBER: 0.0
- status: "COMPLIANT"
currentStateMessage: "The Load Balancer Listener's rule action redirects HTTP to HTTPS."
check:
RELATED_LIST_HAS:
status: "COMPLIANT"
relationshipName: "CA10__AWS_EC2_Load_Balancer_Listener_Rules__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This HTTP listener does not have a redirect action configured."
relatedLists:
- relationshipName: "CA10__AWS_EC2_Load_Balancer_Listener_Rules__r"
conditions:
- status: "COMPLIANT"
currentStateMessage: "The Load Balancer Listener Rule action redirects HTTP to HTTPS."
check:
NOT_EQUAL:
left:
JSON_QUERY_NUMBER:
expression: "length([?type=='redirect' && redirectConfig.protocol=='HTTPS' && redirectConfig.port=='443'])"
arg:
EXTRACT: "caJsonFrom_actionsJson__c"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return Number type."
right:
NUMBER: 0.0
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This HTTP listener rule does not have the required redirect action."