---
title: VPC Flow Logs should be enabled for all VPC subnets
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > VPC Flow Logs should be enabled for all
  VPC subnets
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# VPC Flow Logs should be enabled for all VPC subnets
 
## Description{% #description %}

VPC Flow Logs should be enabled for every regular subnet (purpose `PRIVATE`, its legacy name `PRIVATE_RFC_1918`, or no purpose, which GCP treats as `PRIVATE`) to support network monitoring, forensics, and security analysis. Configure each subnet with:

- A five-second aggregation interval
- 100% sampling
- All metadata
- No exclusion filter (a filter expression of `true` is treated as no filter)

Subnets with any other [purpose](https://docs.cloud.google.com/vpc/docs/subnets#purpose), such as [proxy-only subnets](https://docs.cloud.google.com/load-balancing/docs/proxy-only-subnets), [Private Service Connect subnets](https://docs.cloud.google.com/vpc/docs/about-vpc-hosted-services), Private NAT subnets, and peer migration subnets, are not evaluated. Flow logs configured through the Network Management API are not collected, so a subnet that relies only on such a configuration is reported as noncompliant.

## Remediation{% #remediation %}

Follow [Enable VPC Flow Logs for a subnet (Compute Engine API)](https://docs.cloud.google.com/vpc/docs/using-flow-logs#compute-engine) to enable logging with the required aggregation, sampling, metadata, and filter settings.
