This rule ensures ELB application load balancers redirect HTTP requests to HTTPS for security compliance.
Rule | ELB application load balancers should redirect HTTP requests to HTTPS |
Framework | CISA-cyber-essentials |
Severity | ✔ Medium |
Rule Description
This rule ensures that all HTTP requests made to Elastic Load Balancers (ELB) application load balancers are automatically redirected to HTTPS. Enforcing HTTPS ensures secure communication and data transmission, which is essential for maintaining CISA Cyber Essentials compliance.
Troubleshooting Steps
Necessary Code
In order to redirect HTTP to HTTPS, you need to configure the listener rules for the ELB application load balancer. Here is an example of how to achieve this using the AWS Command Line Interface (CLI):
aws elbv2 create-rule \ --listener-arn <listener_arn> \ --priority 1 \ --conditions Field=host-header,Values=mydomain.com \ --actions Type=redirect,RedirectConfig="{Protocol=HTTPS,Port=443,Host=#{host},Path=/${path},Query=#{query},StatusCode=HTTP_301}"
Replace
<listener_arn>
with the ARN (Amazon Resource Name) of the ELB listener to which you want to add the redirect rule. Modify the --conditions
and --actions
parameters as per your specific requirements.Step-by-Step Guide for Remediation
Follow these steps to redirect HTTP requests to HTTPS for ELB application load balancers:
By following these steps, all incoming HTTP requests to the ELB application load balancer will be automatically redirected to HTTPS, ensuring compliance with CISA Cyber Essentials requirements.