Skip to main content

More Info:

Invalid HTTP Headers in ELB should be dropped.

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • GDPR
  • HIPAA
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, I can help you with that. Here are the step-by-step instructions to remediate the misconfiguration “ELBs Should Drop Invalid HTTP Header” in AWS using the AWS console:
  1. Open the AWS Management Console and navigate to the EC2 dashboard.
  2. Click on “Load Balancers” in the left-hand menu.
  3. Select the ELB for which you want to remediate this misconfiguration.
  4. Click on the “Listeners” tab in the bottom pane.
  5. Identify the listener that is using an invalid HTTP header and click on the “Edit” button for that listener.
  6. Scroll down to the “HTTP Headers” section and click on the “Add” button.
  7. In the “Name” field, enter the name of the invalid HTTP header that you want to drop.
  8. In the “Value” field, enter the value of the invalid HTTP header that you want to drop.
  9. Click on the “Save” button to save the changes.
  10. Repeat steps 5-9 for any other listeners that are using invalid HTTP headers.
  11. Once you have remediated all the invalid HTTP headers, click on the “Save” button to save the changes to the ELB.
That’s it! You have successfully remediated the misconfiguration “ELBs Should Drop Invalid HTTP Header” in AWS using the AWS console.

To remediate the “ELBs Should Drop Invalid HTTP Header” misconfiguration for AWS using AWS CLI, you can follow these steps:
  1. Open the AWS CLI and run the following command to list all the load balancers in your AWS account:
  2. Identify the ARN (Amazon Resource Name) of the load balancer that you want to remediate.
  3. Run the following command to update the load balancer attributes and drop invalid HTTP headers:
    Note: Replace <load_balancer_arn> with the ARN of the load balancer identified in step 2.
  4. Verify that the invalid HTTP headers are dropped by running the following command:
    Note: Replace <load_balancer_arn> with the ARN of the load balancer identified in step 2. This command will return the load balancer attributes, including the dropped HTTP headers.
By following these steps, you should be able to remediate the “ELBs Should Drop Invalid HTTP Header” misconfiguration for AWS using AWS CLI.
To remediate the misconfiguration “ELBs Should Drop Invalid HTTP Header” for AWS using python, follow these steps:
  1. Import the boto3 library to interact with AWS services using python.
  2. Create a boto3 client for the Elastic Load Balancing service.
  3. Get a list of all the load balancers in your AWS account.
  4. For each load balancer, check if the “http.headers” attribute is set to “drop.invalid.header.fields”. If it is not, update the attribute to “drop.invalid.header.fields”.
  5. Once the “http.headers” attribute is updated for all the load balancers, the misconfiguration “ELBs Should Drop Invalid HTTP Header” will be remediated.
Note: Make sure you have the necessary permissions to modify the attributes of the load balancers in your AWS account.
  • Replace APP_OR_NETWORK_LB with your Terraform resource name, YOUR_LB_NAME with the desired LB name, and the subnet / security group placeholders with real IDs or references.
  • This change is an in-place update for existing Application or Network Load Balancers (no forced replacement), but it is not supported for Classic LBs (aws_elb).
Verification with terraform plan should show, for the affected aws_lb resource, an update where drop_invalid_header_fields changes from false (or null) to true.

Additional Reading: