---
inputType: "CA10__CaAwsLoadBalancer__c"
importExtracts:
  - file: "/types/CA10__CaAwsLoadBalancer__c/object.extracts.yaml"
recordTypes:
  - "caAwsLoadBalancerApplication"
testData:
  - file: "test-data.json"
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "This policy only applies to Application Load Balancers."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__type__c"
        right:
          TEXT: "application"
  - status: "INCOMPLIANT"
    currentStateMessage: "The Application Load Balancer is not configured to drop invalid HTTP headers."
    remediationMessage: "Enable the 'routing.http.drop_invalid_header_fields.enabled' attribute for the Application Load Balancer."    
    check:
      CONTAINS:
        arg:
          EXTRACT: "caSetFrom_additionalAttributes__c"
        search:
          TEXT: "routing.http.drop_invalid_header_fields.enabled: false"
  - status: "COMPLIANT"
    currentStateMessage: "The Application Load Balancer is configured to drop invalid HTTP headers."
    check:
      CONTAINS:
        arg:
          EXTRACT: "caSetFrom_additionalAttributes__c"
        search:
          TEXT: "routing.http.drop_invalid_header_fields.enabled: true"
otherwise:
  status: "UNDETERMINED"
  currentStateMessage: "Unexpected values in the field."
