Enable Logging for HTTP(S) Load Balancer Affecting Compute Engine service in Google


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Logging/ Logging

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
  • Snyk IDSNYK-CC-00717
  • creditSnyk Research Team

Description

Failure to enable logging for the HTTP(S) Load Balancer increases the risk of unauthorized access, denial of service attacks, and the inability to track and investigate security incidents. Enabling logging provides valuable insights into network traffic, helps with troubleshooting, and aids in meeting compliance requirements. It is recommended to configure logging for the HTTP(S) Load Balancer in Google Cloud Platform.

How to fix?

Set the log_config.enabled attribute to true.

Example Configuration

resource "google_compute_backend_service" "allowed" {
  name        = "backend"
  port_name   = "http"
  protocol    = "HTTP"
  timeout_sec = 10

  health_checks = [google_compute_http_health_check.default.id]
  log_config {
    enable = true
  }
}