Ensure logging is enabled for ELB application and classic load balancer.
Rule | ELB application and classic load balancer logging should be enabled |
Framework | SOC 2 |
Severity | ✔ High |
ELB Application and Classic Load Balancer Logging for SOC 2 Compliance
SOC 2 compliance is a framework for managing data that ensures the security, availability, processing integrity, confidentiality, and privacy of customer data. Enabling logging on Elastic Load Balancers (ELB) - both Application Load Balancers (ALBs) and Classic Load Balancers - is a key measure for meeting the monitoring and logging criteria.
Enabling Access Logs on Application Load Balancers (ALB)
Description:
Access logs for ALBs capture detailed information about requests sent to the load balancer. This includes the client’s IP address, request paths, server responses, and latencies. Enabling these logs helps organizations analyze traffic patterns and identify and troubleshoot security and operational issues.
Troubleshooting Steps:
If you encounter issues with ALB logs, the following steps may be helpful:
Necessary IAM Permissions:
The following IAM policy allows an ALB to write access logs to an S3 bucket:
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::bucket-name/prefix/AWSLogs/aws-account-id/*"
]
}
Step by Step Guide for Remediation:
Enable logging through AWS Management Console:
Enable logging using AWS CLI:
Execute the following AWS CLI command to enable ALB logging:
aws elbv2 modify-load-balancer-attributes \ --load-balancer-arn YOUR_LOAD_BALANCER_ARN \ --attributes Key=access_logs.s3.enabled,Value=true \ Key=access_logs.s3.bucket,Value=YOUR_S3_BUCKET_NAME \ Key=access_logs.s3.prefix,Value=YOUR_LOG_FILE_PREFIX
Enabling Access Logs on Classic Load Balancers
Description:
Classic Load Balancer logging is essential for capturing request information to help detect anomalies, troubleshoot issues, and improve security. Access logs contain details like client IP, request paths, and backend responses.
Troubleshooting Steps:
For troubleshooting Classic Load Balancer logs:
Necessary IAM Permissions:
The IAM permissions required are similar to those for ALBs.
Step by Step Guide for Remediation:
Enable logging through AWS Management Console:
Enable logging using AWS CLI:
To enable logging for a Classic Load Balancer, use the following AWS CLI command:
aws elb enable-access-logs --load-balancer-name YOUR_LOAD_BALANCER_NAME \ --access-log S3BucketName=YOUR_S3_BUCKET_NAME,S3BucketPrefix=YOUR_LOG_FILE_PREFIX,EmitInterval=60
In both cases, ensure that your logging strategy does not create unnecessary costs or manage logs in a way that might lead to sensitive data exposure. Regularly audit your logging policy and configurations.
By following these guidelines, you can effectively enable and manage logging for both Application and Classic Load Balancers within your infrastructure, ensuring your adherence to SOC 2 compliance requirements.