Skip to main content

More Info:

Ensures that logging and log alerts exist for firewall rule changes.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS GCP
  • CIS GCP 2.0.0
  • Cloudanix Best Practice
  • HIPAA
  • HITRUST CSF
  • ISO 27001
  • NIST CSF
  • PCI
  • SOC2
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Firewall Change Log Alerts Should Be Enabled” for GCP using GCP console, follow the below steps:
  1. Login to your GCP console.
  2. Navigate to the Security Command Center.
  3. Click on the “Security Health Analytics” option from the left-hand menu.
  4. Click on the “Firewall rules” option.
  5. Select the project for which you want to enable Firewall Change Log Alerts.
  6. Click on the “Edit” button.
  7. Scroll down to the “Logging” section and enable the “Firewall Change Log” option.
  8. Click on the “Save” button to save the changes.
By following the above steps, you have successfully enabled the Firewall Change Log Alerts for the selected project in GCP. This will help you to track any changes made to the firewall rules and take necessary actions in case of any unauthorized changes.

To remediate the misconfiguration “Firewall Change Log Alerts Should Be Enabled” for GCP using GCP CLI, follow these steps:
  1. Open the Cloud Shell in the GCP Console.
  2. Run the following command to enable firewall log exports:
Replace [BUCKET_NAME] with the name of the GCS bucket where you want to store the logs, [ORGANIZATION_ID] with the ID of your GCP organization, and [PROJECT_ID] with the ID of the GCP project where you want to enable the firewall log exports.
  1. Run the following command to grant the Logs Writer role to the cloud-logs@google.com service account:
Replace [PROJECT_ID] with the ID of the GCP project where you enabled the firewall log exports.
  1. Run the following command to create a firewall rule to allow traffic from the cloud-logs@google.com service account:
  1. Run the following command to add the allow-cloud-logs tag to the instances where you want to allow traffic from the cloud-logs@google.com service account:
Replace [INSTANCE_NAME] with the name of the instance where you want to allow traffic from the cloud-logs@google.com service account, and [ZONE] with the zone where the instance is located.By following these steps, you will enable firewall log exports and allow the cloud-logs@google.com service account to access the logs.
To remediate the misconfiguration “Firewall Change Log Alerts Should Be Enabled” in GCP using Python, you can follow the below steps:Step 1: Install the necessary libraries
Step 2: Authenticate with GCP
Step 3: Create a log sink
Step 4: Verify the log sink
After running these steps, the log sink for Firewall Change Log Alerts will be created successfully in GCP using Python.
terraform plan should show creation of one google_logging_metric.firewall_change_metric and one google_monitoring_alert_policy.firewall_change_alert, with no destructive changes to existing resources.

Additional Reading: