2.16 Ensure Logging is enabled for HTTP(S) Load Balancer (Automated)
Profile Applicability
- Level 2
Description
Logging enabled on a HTTPS Load Balancer will show all network traffic and its destination.
Rationale
Logging will allow you to view HTTPS network traffic to your web applications.
Impact
On high use systems with a high percentage sample rate, the logging file may grow to high capacity in a short amount of time. Ensure that the sample rate is set appropriately so that storage costs are not exorbitant.
Audit
From Google Cloud Console
- From Google Cloud home open the Navigation Menu in the top left.
- Under the
Networkingheading selectNetwork services. - Select the HTTPS load-balancer you wish to audit.
- Select
EditthenBackend Configuration. - Select
Editon the corresponding backend service. - Ensure that
Enable Loggingis selected. Also ensure thatSample Rateis set to an appropriate level for your needs.
From Google Cloud CLI
- Run the following command:
gcloud compute backend-services describe <serviceName>
- Ensure that
enable-loggingis enabled andsample rateis set to your desired level.
Remediation
From Google Cloud Console
- From Google Cloud home open the Navigation Menu in the top left.
- Under the
Networkingheading selectNetwork services. - Select the HTTPS load-balancer you wish to audit.
- Select
EditthenBackend Configuration. - Select
Editon the corresponding backend service. - Click
Enable Logging. - Set
Sample Rateto a desired value. This is a percentage as a decimal point. 1.0 is 100%.
From Google Cloud CLI
- Run the following command:
gcloud compute backend-services update <serviceName> --region=REGION --enable-logging --logging-sample-rate=<percentageAsADecimal>
Default Value
By default logging for https load balancing is disabled. When logging is enabled it sets the default sample rate as 1.0 or 100%. Ensure this value fits the need of your organization to avoid high storage costs.
References
- https://cloud.google.com/load-balancing/
- https://cloud.google.com/load-balancing/docs/https/https-logging-monitoring#gcloud:-global-mode
- https://cloud.google.com/sdk/gcloud/reference/compute/backend-services/
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 8.2 Collect Audit Logs | x | x | x |
| v7 | 6.2 Activate audit logging | x | x | x |