GCP Log Types Explained: Audit Logs, VPC Flow Logs, Firewall Logs, and Application Logs
GCP produces several distinct types of logs, and each one answers a different question. Cloud Audit Logs tell you who called which GCP API. VPC Flow Logs show you which VMs are talking to which IP addresses. Firewall Logs tell you whether a specific rule allowed or blocked a connection. Application logs show what your code is doing. If you rely on only one of these, you will always have blind spots. This page explains what each log type records, how they differ, and when to use them.
Simple explanation
Think of your GCP project as a building with several different camera systems installed:
Cloud Audit Logs are the entrance cameras. They record who came in, what they picked up, and what they changed. Admin Activity logs are the always-on cameras. Data Access logs are the cameras you choose to install in sensitive rooms.
VPC Flow Logs are the motion sensors. They track movement between rooms, recording who went where and how much they were carrying.
Firewall Rules Logging records which doors were tried and whether they opened, naming the specific door (rule) that was used.
Application logs are the internal cameras. They record what people are doing once inside, from your code’s point of view.
No single camera covers every angle. If someone entered through a side door you had no camera on, the entrance footage alone will not show how they got in. You need multiple angles to reconstruct what happened.
A service account reads a BigQuery table containing customer data at 3am from an unfamiliar IP address. The Data Access log records that the read happened. The VPC Flow Log records the network connection and bytes transferred. The Admin Activity log records the IAM policy change that gave the service account access two days earlier. None of those three sources alone tells the full story.
Why one log source is never enough
Each log type covers a specific visibility plane:
Control plane: Cloud Audit Logs record changes to your GCP resources and configuration. IAM changes, resource creation, API calls. This is the authoritative record of what was done to your environment at the API level.
Network plane: VPC Flow Logs and Firewall Logs record what is happening at the network level. Which connections are being made, how much data is moving, and whether rules are working as intended.
Workload plane: Application logs record what your code is doing. Authentication failures, errors, unusual data access patterns from inside the application itself.
Admin Activity logs capture configuration changes but not data reads. If someone is querying your BigQuery tables without modifying anything, that activity does not appear in Admin Activity logs. It only appears in Data Access logs, which are disabled by default for most services. VPC Flow Logs capture traffic patterns but cannot see which GCP API was called. Application logs record what your code does but cannot see direct GCP API calls made by an attacker who bypasses your application entirely.
A CCTV system covering the entrance, the car park, and the main corridor still has a blind spot if nothing watches the server room. Someone who walks in through the front door and goes straight to an unmonitored area is partially visible but not fully traced. GCP log types work the same way. Each one covers a specific area. The blind spots are predictable once you know what each camera is pointed at.
Cloud Audit Logs
Cloud Audit Logs record API calls against GCP services. Every time someone creates a resource, modifies an IAM policy, reads data from Cloud Storage, or calls any GCP service API, that call can generate an audit log entry. The entry records the identity, the action, the resource, and the outcome.
Security question answered: Who called which API on which resource, and did it succeed?
There are four sub-types:
Admin Activity logs
Records configuration changes: creating resources, modifying IAM policy bindings, enabling services, deleting buckets. Always enabled by default. Retained for 400 days at no charge.
This is the non-negotiable baseline. Every GCP environment has these, and they cover every configuration change across all services. If a resource was created or deleted, or if an IAM policy was changed, Admin Activity logs have the record.
Example events: SetIamPolicy, CreateFirewallRule,
DeleteBucket, CreateServiceAccount
Data Access logs
Records reads and writes of user data: reading a Cloud Storage object, querying a BigQuery table, accessing a Secret Manager secret version. Not enabled by default for most services. Retained for 30 days.
If someone reads your data, those reads are invisible unless Data Access logs are enabled for that service. Querying a BigQuery table, downloading a Cloud Storage object, accessing a Secret Manager secret version — none of that appears in Admin Activity logs. An environment without Data Access logs enabled has no record of data reads. You cannot enable them retroactively for events that already happened.
Data Access logs come in three sub-types, enabled separately per service: DATA_READ (reading user data), DATA_WRITE (writing user data), and ADMIN_READ (reading resource metadata such as listing buckets or checking IAM policies). Enable at minimum DATA_READ and DATA_WRITE for services that handle sensitive data. BigQuery is the only exception: Data Access logs are on by default for BigQuery.
Useful for: detecting data exfiltration, supporting compliance audits, tracking who accessed sensitive resources.
System Event logs
Records Google-initiated operations on your infrastructure: live VM migration, automatic scaling of managed instance groups, scheduled Cloud SQL maintenance. Always enabled. Retained for 400 days.
Useful for: operational troubleshooting. If a VM restarted unexpectedly, System Event logs confirm whether Google triggered the event and why. Less relevant for direct security detection.
Policy Denied logs
Records requests blocked by a VPC Service Controls perimeter. When a request comes from an untrusted context (wrong network, wrong project, or wrong access level), a Policy Denied entry is written automatically. Retained for 400 days.
Useful for: detecting access attempts from unexpected contexts, and debugging VPC-SC perimeters during dry-run mode before enforcement is switched on.
VPC Flow Logs
Records sampled network flows sent and received by VM network interfaces. Each record includes source and destination IP, port, protocol, bytes transferred, and whether the flow was accepted or denied. VPC Flow Logs are enabled at the subnet level. They are sampled, so they give statistical visibility rather than complete packet capture.
Security question answered: Which VMs are communicating with which IPs, on which ports, and how much data is moving?
Most useful for:
- Detecting unexpected outbound connections to unusual IP ranges
- Identifying large data transfers that could indicate exfiltration
- Spotting east-west traffic between VMs that should not be communicating
- Network security forensics and compliance requirements
Key limitation: Sampled, not full capture. Does not tell you which GCP API was called, only which IPs communicated and how much data moved. For understanding how subnets and network topology work in GCP, see VPC Networks Explained.
High-traffic subnets generate significant log volumes with VPC Flow Logs enabled. Enable selectively on subnets with internet-facing workloads or those requiring network-level compliance evidence, rather than everywhere by default.
Firewall Rules Logging
Records every connection attempt that matches a firewall rule where logging has been enabled. Unlike VPC Flow Logs (which are sampled), Firewall Rules Logging records every matching connection. Each entry includes the rule name, disposition (ALLOWED or DENIED), source and destination IP, port, and protocol.
You enable logging per firewall rule, not per subnet. This lets you be selective: enable logging on high-risk rules (rules allowing ingress from the internet, rules allowing access to sensitive services) without paying for logging on every rule in the network.
Security question answered: Are specific firewall rules being triggered, and is traffic being allowed or denied as intended?
Most useful for:
- Confirming that deny rules are actually blocking traffic
- Auditing which external IPs are reaching a specific service
- Identifying unexpected traffic hitting an allow rule
Key limitation: Only records connections matching rules where logging is explicitly enabled. A firewall rule with no logging enabled generates no entries, even if traffic hits it constantly.
Workload and application logs
Logs generated by your own applications, containers, and services. These arrive in Cloud Logging from several sources:
Cloud Run and App Engine: standard output (stdout/stderr) from containers is automatically collected. Structured JSON logs are parsed and queryable by individual field.
GKE: node-level system logs and container logs are collected via the GKE logging agent when Cloud Logging is enabled on the cluster.
Compute Engine: application and OS logs require the Cloud Ops Agent to be installed on the VM. Without it, application logs do not reach Cloud Logging automatically.
Security question answered: What is happening inside your application? Authentication failures, errors, unusual data access patterns from the application’s point of view.
Key limitation: Application logs record what your code does. An attacker calling the BigQuery API directly with stolen credentials will not appear in your application logs at all. They bypass your application entirely.
Other security-relevant log sources
Cloud Load Balancing access logs: records HTTP requests with URL, status code, latency, and client IP. Useful for detecting scraping, scanning, and anomalous traffic patterns at the application layer.
Cloud DNS logs: records DNS queries from VMs within your VPC. Useful for detecting communication with known malicious domains or unusual DNS query patterns that indicate malware or exfiltration via DNS tunnelling. See Cloud DNS Setup for how DNS is configured in GCP.
Cloud NAT logs: records NAT translation events for VMs without external IPs. Useful for tracking outbound internet connections from private VMs that should not be calling out. See Cloud NAT for how this fits into the network architecture.
Google Workspace audit logs: if your organisation uses Google Workspace, admin and user activity logs there are separate from GCP Cloud Audit Logs, but the same identities appear in both. Relevant when investigating credential compromise that spans both Workspace and GCP.
Log types comparison
Quick reference: what each log type records, where it is enabled, and what it does not cover.
| Log type | What it shows | Best for | Enabled where | On by default | Key limitation |
|---|---|---|---|---|---|
| Audit — Admin Activity | Config changes, IAM changes, resource creation/deletion | Compliance, change tracking, incident investigation | All GCP services automatically | Yes, always on | Does not record data reads or writes |
| Audit — Data Access | Data reads, data writes, metadata reads | Data access auditing, PII compliance, exfiltration detection | Per service (in IAM audit config) | No, opt-in per service. BigQuery is the exception. | High volume and cost; only 30-day default retention |
| Audit — System Event | Google-initiated infrastructure operations | Operational troubleshooting (unexpected VM restarts, migrations) | All GCP services automatically | Yes, always on | Limited security detection value |
| Audit — Policy Denied | VPC Service Controls perimeter violations | VPC-SC debugging, detecting access from unexpected contexts | All projects automatically | Yes, generated automatically on VPC-SC denials | Only captures VPC-SC denials, not IAM PERMISSION_DENIED |
| VPC Flow Logs | Sampled network flows: IPs, ports, bytes, protocol | Network forensics, exfiltration detection, compliance evidence | Per subnet | No, must enable on each subnet | Sampled, not full capture. No API-level visibility. |
| Firewall Rules Logging | Every connection matching a logged rule (ALLOWED/DENIED) | Firewall rule auditing, ingress/egress visibility per rule | Per firewall rule | No, must enable on each rule individually | Only covers rules where logging is explicitly enabled |
| Application / workload logs | Application output, errors, auth events from your code | Debugging, application-level security monitoring | Automatic for Cloud Run; agent required for Compute Engine | Auto (Cloud Run/GKE); must install Ops Agent (Compute Engine) | Cannot see direct GCP API calls that bypass the application |
How it works in practice
Real investigations almost always need more than one log source. Here is how the same attack scenario surfaces differently across log types:
IAM role granted to a new identity → Admin Activity logs, as a
SetIamPolicycallService account reads BigQuery tables → Data Access logs (only if enabled for BigQuery)
Unusual outbound connection to an external IP → VPC Flow Logs, as a flow record with destination IP and bytes transferred
Blocked ingress attempt from the internet → Firewall Rules Logging, if logging is enabled on the matching rule
Repeated failed logins in your application → application logs from Cloud Run, GKE, or Compute Engine
DNS lookup to a suspicious domain → Cloud DNS logs
The attacker who exfiltrated data via an authorised GCP API call appears in Data Access logs. Their unusual source IP appears in VPC Flow Logs. The IAM change that gave them access appears in Admin Activity logs. To detect this, you need all three sources. To detect it automatically and in real time, you need alerts built on those log sources.
Think of each log type as a different witness to the same event. The entrance guard (Audit Logs) saw the person come in with a valid badge. The motion sensor (VPC Flow Logs) tracked them moving toward the data centre. The door reader (Firewall Logs) recorded which door they used. The internal camera (Application logs) caught what they did once inside. No single witness has the full picture. The investigation is built by combining their accounts.
When to use each log type
Admin Activity audit logs are already on by default. Start there. Then enable Data Access logs for your most sensitive services. After that, add VPC Flow Logs on internet-facing subnets, then Firewall Logs on your highest-risk rules. Work outward from what you can actually act on.
Use Cloud Audit Logs when you need to know…
- Who changed an IAM policy, and when
- Whether a resource was created, modified, or deleted, and by which identity
- Which service accounts accessed a Cloud Storage bucket or BigQuery dataset (requires Data Access logs enabled)
- Whether a VPC Service Controls perimeter blocked a request
- Which credentials are being used to call your GCP services
- How to demonstrate access history to a compliance auditor
Use VPC Flow Logs when you need to know…
- Which VMs are communicating with which external IP addresses
- How much data is moving between your environment and the internet
- Whether VMs that should be isolated are actually communicating with each other
- Network-level evidence for a forensics investigation
Use Firewall Rules Logging when you need to know…
- Whether a specific deny rule is actually blocking traffic
- Which external IPs are hitting an allow rule for a public-facing service
- Whether a new firewall rule is producing the allow/deny behaviour you intended
Use application logs when you need to know…
- What errors your application is throwing and why
- Which users are failing authentication in your own auth system
- Application-specific data access patterns your code tracks directly
- Debugging a specific service using Logs Explorer
VPC Flow Logs vs Firewall Rules Logging
This is one of the most common points of confusion for beginners. Both involve network traffic, but they answer different questions and are enabled in different places.
| VPC Flow Logs | Firewall Rules Logging | |
|---|---|---|
| Enabled at | Subnet level | Per firewall rule |
| Coverage | All traffic through the subnet (sampled) | Only connections matching rules where logging is on |
| Sampling | Yes, not every packet is captured | No, every matching connection is logged |
| Shows the rule name | No | Yes |
| Shows ALLOWED vs DENIED | Included in the record, but not rule-specific | Yes, explicitly for each connection |
| Best for | Broad network visibility, traffic volumes, forensics | Confirming specific rules are working as intended |
VPC Flow Logs are like a highway traffic counter. It tallies every car passing a point on the road, recording speed, direction, and rough vehicle type. It does not know which specific road rule applied. Firewall Rules Logging is like a specific toll gate that records every vehicle that passed through gate 3, whether the barrier lifted or stayed down, and the plate number. The counter gives you volume. The gate gives you rule-level detail. Both are useful. Neither replaces the other.
Use VPC Flow Logs when you want broad visibility into traffic across a subnet. Use Firewall Rules Logging when you want to confirm that specific rules are being triggered. Enable both in environments where network visibility matters for security or compliance.
Common beginner mistakes
Relying only on application logs. Application logs record what your code does, but they cannot see direct GCP API calls, network traffic, or IAM changes. An attacker who exfiltrates data by calling the BigQuery or Cloud Storage API directly will not appear in your application logs at all. Cloud Audit Logs are the non-negotiable baseline.
Assuming Admin Activity logs cover data access. Admin Activity logs capture configuration changes, not data reads or writes. If someone is reading your Cloud Storage objects or querying BigQuery tables without modifying anything, that activity is invisible unless Data Access logs are enabled for those services. Enable Data Access logs during project setup, not after an incident is discovered.
Enabling everything without a cost plan. Data Access logs and VPC Flow Logs can generate millions of entries per day in busy environments. Enable them selectively where security value justifies the cost: Data Access on projects with sensitive data, VPC Flow Logs on subnets with internet-facing workloads. Use exclusion filters to suppress high-volume, low-value entries.
Confusing Firewall Rules Logging with VPC Flow Logs. These are separate features enabled in separate places. Firewall Rules Logging records connections matching rules you have flagged. VPC Flow Logs record sampled subnet-level traffic. Enabling one does not give you the other. Many environments need both.
Collecting logs without alerting or reviewing them. Log data has no security value if nothing is watching it. Every log type you enable should feed at least one alert or review process. Before enabling a log source, define the security question it answers and what action you would take on a suspicious entry. Use log-based metrics to build alerts on top of log patterns, then make sure someone owns those alerts.
How to query across log types
All log types land in Cloud Logging and are queryable via Logs Explorer or the gcloud CLI. Each log type uses a distinct log name. Scope your queries by log name to search the right source precisely.
# Find recent Admin Activity audit log entries for a project
# Good starting point for any investigation: who changed what?
gcloud logging read \
'logName="projects/my-app-prod/logs/cloudaudit.googleapis.com%2Factivity"' \
--project=my-app-prod \
--limit=20 \
--format='table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.methodName,protoPayload.resourceName)'
# Query Policy Denied logs to see what VPC Service Controls is blocking
# Useful when debugging a new VPC-SC perimeter in dry-run mode
gcloud logging read \
'logName="projects/my-app-prod/logs/cloudaudit.googleapis.com%2Fpolicy"
AND protoPayload.status.code=7' \
--project=my-app-prod \
--limit=20 \
--format='table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.resourceName,protoPayload.status.message)'
# Query Firewall Rules Logging for denied connections
# Useful for auditing which traffic your deny rules are actually blocking
gcloud logging read \
'logName="projects/my-app-prod/logs/compute.googleapis.com%2Ffirewall"
AND jsonPayload.disposition="DENIED"' \
--project=my-app-prod \
--limit=50 \
--format='table(timestamp,jsonPayload.connection.src_ip,jsonPayload.connection.dest_port,jsonPayload.rule_details.reference)'
# Query VPC Flow Logs for outbound flows from VMs in a project
# Look for large flows that could indicate data exfiltration
gcloud logging read \
'logName="projects/my-app-prod/logs/compute.googleapis.com%2Fvpc_flows"
AND jsonPayload.reporter="SRC"' \
--project=my-app-prod \
--limit=20 \
--format='table(timestamp,jsonPayload.connection.src_ip,jsonPayload.connection.dest_ip,jsonPayload.bytes_sent)'Log names use URL-encoded slashes. Admin Activity:
cloudaudit.googleapis.com%2Factivity. Data Access:
cloudaudit.googleapis.com%2Fdata_access. Policy Denied:
cloudaudit.googleapis.com%2Fpolicy. VPC Flow Logs:
compute.googleapis.com%2Fvpc_flows. Firewall logs:
compute.googleapis.com%2Ffirewall.
Summary
- GCP has four main log families: Cloud Audit Logs, VPC Flow Logs, Firewall Rules Logging, and application/workload logs. Each answers a different security question.
- Admin Activity and System Event audit logs are always on at no charge. Data Access logs must be enabled per service and are disabled by default for most services.
- VPC Flow Logs are sampled subnet-level traffic records. Firewall Rules Logging records every connection matching a rule with logging enabled. They are different tools, enabled in different places.
- Application logs record what your code does. They cannot see direct GCP API calls that bypass your application.
- Real investigations combine multiple log sources. The same attack surfaces different signals in Audit Logs, VPC Flow Logs, and application logs.
- Enable log types selectively based on the security question each answers, not everything at once.
- Every log source you enable should feed at least one alert or review process. Collecting logs without acting on them is cost without security value.
Frequently asked questions
What are the main log types in GCP?
The four main log families in GCP are: Cloud Audit Logs (who called which GCP API — Admin Activity, Data Access, System Event, Policy Denied), VPC Flow Logs (sampled network traffic at subnet level), Firewall Rules Logging (connections matching logged firewall rules), and application or workload logs (stdout/stderr from Cloud Run, GKE, Compute Engine). Additional sources include Load Balancer access logs, Cloud DNS logs, and Cloud NAT logs. Each family answers a different security question — none of them is a substitute for the others.
What is the difference between Cloud Audit Logs and VPC Flow Logs?
Cloud Audit Logs record GCP API calls — configuration changes, data reads, and IAM events. They answer "who did what to which GCP resource?" VPC Flow Logs record sampled network traffic between VM interfaces — source IP, destination IP, port, bytes, and protocol. They answer "which VMs are communicating with which IPs?" The two are complementary: an unusual outbound connection shows in VPC Flow Logs; the IAM policy change that enabled access shows in Audit Logs. Most real investigations need both.
Are Data Access logs enabled by default in GCP?
No. Data Access logs must be explicitly enabled per service. Admin Activity logs and System Event logs are always on. Data Access logs are disabled by default because they generate very high log volumes — enabling them everywhere would produce large costs. Enable them for services that handle sensitive data: Cloud Storage buckets with PII, Secret Manager, and BigQuery datasets with regulated data. BigQuery is the exception — Data Access logs are enabled by default for BigQuery only.
What is the difference between Firewall Rules Logging and VPC Flow Logs?
VPC Flow Logs record sampled traffic at the subnet level — all flows regardless of which firewall rule matched. Firewall Rules Logging records every connection that matches a firewall rule where logging is enabled — it shows the rule name and whether the connection was ALLOWED or DENIED. VPC Flow Logs give broad network visibility; Firewall Rules Logging tells you exactly which rules are being triggered. They are enabled in different places: Flow Logs at the subnet, Firewall Logs at the individual rule.
Which log types should beginners enable first in GCP?
Admin Activity audit logs are already on by default — start there. Then enable Data Access logs for your most sensitive services (Secret Manager, Cloud Storage buckets with PII, BigQuery datasets). Next, enable VPC Flow Logs on subnets with internet-facing workloads. Finally, enable Firewall Rules Logging on your highest-risk rules. Do not enable everything at once. Start with what you can actually act on, then expand from there.