An architectural illustration of firewall rule logging in a cloud network environment

When you troubleshoot network traffic in Google Cloud, firewall rule logging gives you connection-level records for your Virtual Private Cloud (VPC) networks. However, default configuration choices often generate larger log payloads than your engineering team actually needs. In addition, network configurations tend to accumulate outdated rules that point to virtual machines that no longer exist. By checking how your rules capture metadata and verifying which rules actively match running workloads, you can clean up your network configuration and control your observability volume.

Key takeaways

  • Google Cloud charges $0.25 per GiB for vended network logs storage, which includes up to 30 days of retention in log buckets.
  • Setting a rule’s metadata option to EXCLUDE_ALL_METADATA strips out extra instance, VPC, and geographic details to make each log entry smaller.
  • A 3-step review process for both metadata settings and orphaned target tags prevents accidental disruption to active or planned workloads.

How firewall rule logging adds to the logging bill

Every time a rule with logging enabled allows or denies a connection, Google Cloud generates a connection record. Specifically, the platform treats these records as vended network logs. According to Google Cloud Observability pricing, vended network logs storage costs $0.25 per GiB when streamed into log buckets for indexing and analysis. If you retain those logs for more than the default 30 days, storage costs an additional $0.01 per GiB per month.

Furthermore, billing depends directly on the byte size of the ingested entries prior to indexing. When a rule logs every connection across busy services, the byte size of each individual record matters. A rule in a given project that logs connections with all metadata enabled writes a larger payload every time a new connection occurs.

You can spot rising ingestion volumes by checking your Google Cloud Billing export or viewing byte volume metrics in Cloud Monitoring. However, billing data only shows total GiB ingested by project and log bucket. It cannot prove whether your security or operations teams actually need the extra fields attached to those firewall connection logs.

Logging all metadata versus excluding it

When you turn on firewall rule logging for a VPC rule, Google Cloud includes all metadata by default. Consequently, each log entry contains the base connection details alongside supplemental fields like virtual machine instance names, VPC network details, and remote geographic location data.

What remains when you exclude metadata

You do not have to accept the default payload size. Instead, you can review whether your troubleshooting workflows genuinely require the full metadata. Excluding it makes each log entry smaller while keeping the core 5-tuple connection data intact. When you set the rule’s log metadata configuration to EXCLUDE_ALL_METADATA, Google Cloud still logs the source IP, destination IP, ports, protocol, timestamp, and reference to the rule.

Before making this change, follow two preparation steps:

  1. Check what the rule’s logs are currently used for across your engineering and security teams.
  2. Set the rule’s log metadata to EXCLUDE_ALL_METADATA only if those extra instance and location fields are not needed.

For example, if a SIEM dashboard or automated alert relies on the target instance name field inside the firewall log entry, stripping metadata will break that query. Therefore, investigating downstream log queries, sink exports, and monitoring dashboards is required before changing the setting.

Rules whose targets match no instance

While oversized log entries inflate your observability data directly, orphaned firewall rules create administrative clutter and security confusion. In Google Cloud, you frequently scope a firewall rule to specific workloads rather than the entire VPC network. You do this by specifying target network tags or target service accounts on the rule.

Over time, workloads change and teams decommission virtual machines. As a result, a specific firewall rule in a project may target network tags and service accounts that none of the current instances on its network carry.

Even though an orphaned rule with firewall rule logging enabled will not generate connection logs while zero instances match it, leaving it in place is risky. For example, if a developer later assigns an old network tag to a new VM by mistake, the dormant rule immediately takes effect. It will open or block ports unexpectedly and begin generating log entries again.

However, an unmatched rule is not automatically garbage. You must review whether the rule is still needed, because a future workload or a scheduled deployment may rely on it.

Confirm with the network owner before changing rules

You should never delete an unmatched firewall rule or alter log settings based purely on a static snapshot of current instances. Billing data and point-in-time inventory checks cannot prove intent. For instance, they cannot show if an instance group is temporarily scaled down to zero, or if an infrastructure-as-code pipeline is about to deploy a workload that needs those exact target tags.

Questions to ask before modifying a rule

To avoid breaking production or staging deployments, complete these verification steps first:

  1. Check with the network owner to identify which specific workloads the rule was originally made for.
  2. Ask whether any disaster recovery runbooks, seasonal batch jobs, or upcoming releases depend on those target tags or service accounts.
  3. Remove the rule, or correct its targets, only once its owner confirms the appropriate action.

Sometimes, the network owner will discover that a typo in a deployment script caused a mismatch between the instance tag and the firewall target tag. In that case, correcting the rule’s targets restores the intended network policy rather than deleting a needed control. Similarly, before changing a rule’s metadata setting to EXCLUDE_ALL_METADATA, confirm with the owner of your logging sinks that no compliance audits or alerting dependencies require the extra metadata fields.

Check that the change takes effect

After you update a rule’s metadata configuration or clean up an orphaned rule, verify that your adjustment works as expected in Google Cloud. A change in the console or via the CLI is only complete once you observe the result in your environment.

For metadata adjustments, open the Cloud Logging Logs Explorer and inspect fresh connection records for that rule. Confirm that the base connection data still arrives and that the extra metadata fields are omitted. Next, check your log ingestion metrics in Cloud Monitoring and your Google Cloud Billing export over the following days to see the effect on total ingested bytes.

For target tag updates or rule removals, inspect the VPC firewall configuration in your project. Verify that removed rules no longer appear in the policy list, or that corrected target tags and service accounts now properly associate with the active instances on the network. If you use an automated cloud cost visibility and optimization tool like Binadox to monitor your projects, check that the finding resolves after the next scan.

Conclusion

Managing firewall rule logging comes down to paying only for the diagnostic detail you actually read, while keeping your VPC rule list aligned with live infrastructure. Paying to store full instance and geographic metadata on millions of routine connections when you only ever grep for an IP address and a port is an expensive habit. Likewise, keeping firewall rules that point to zero instances is a quiet trap waiting for the next person who reuses an old network tag. Check what your log queries actually need, talk to the network owner before touching targets, and verify every change in your native logs and metrics.

To continuously track cloud costs and prevent logging bloat across your projects, you can start your free Binadox trial or book a demo with our technical team today.