This rule ensures that Application Load Balancer redirects HTTP requests to secure HTTPS for better security.
Rule | Application Load Balancer should be configured to redirect all HTTP requests to HTTPS |
Framework | PCI v3.2.1 |
Severity | ✔ Medium |
Application Load Balancer Configuration Rule for Redirecting HTTP to HTTPS for PCI v3 Compliance
Description:
To comply with PCI v3 standards, it is crucial to ensure that all HTTP requests are automatically redirected to HTTPS. This redirects traffic to a secure connection, encrypting sensitive information and preventing unauthorized access to personal or financial data.
Troubleshooting Steps:
Configuration Steps:
1. Create or Select an Existing Application Load Balancer
2. Configure Listener and Listener Rule
3. Verify SSL/TLS Certificate Installation
4. Verify Security Group Configuration
Remediation (CLI Commands):
AWS CLI Commands for Application Load Balancer Configuration:
# Create a new listener rule to redirect HTTP traffic to HTTPS aws elbv2 create-rule --listener-arn <listener-arn-of-http> --priority <priority> --conditions Field=path-pattern,Values='/' --actions Type=redirect,RedirectConfig="{Protocol='HTTPS',Port='443',StatusCode='HTTP_301'}" # Update an existing ALB listener to add a new listener rule aws elbv2 modify-listener --listener-arn <listener-arn> --default-actions Type=forward,TargetGroupArn=<target-group-arn> --certificates CertificateArn=<certificate-arn> # Verify SSL/TLS certificate installation aws acm describe-certificate --certificate-arn <certificate-arn> # Update security group rules to allow HTTP (port 80) and HTTPS (port 443) traffic aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 80 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 443
Note: Replace
<listener-arn-of-http>
, <priority>
, <listener-arn>
, <target-group-arn>
, <certificate-arn>
, and <security-group-id>
with the appropriate values specific to your environment.By following the above steps and executing the necessary CLI commands, you can configure your Application Load Balancer to redirect all HTTP requests to HTTPS, ensuring compliance with the PCI v3 standards.