Flow logs capture metadata for each network flow: source and destination addresses and ports, protocol, bytes, packets and whether security rules accepted or rejected it. They answer "can these two things talk?" during an outage and "what did this host connect to?" during an investigation. Enriched with resource tags and threat intelligence, they become a strong detection source.
- Detect
- Analyze
- Resolve
When to use it
- Every production VPC or virtual network
- Investigating connectivity problems
- Detecting scanning, lateral movement and exfiltration
When to avoid it
- Collecting them with no retention plan: volumes are large, so store compressed and in columnar formats
How traffic flows
- Enable flow logs on every VPC and on the transit hub, with a custom format that includes the fields you need.
- Deliver to object storage in Parquet with hourly partitions for cheap, fast queries.
- Enrich each flow with the resource, owner and environment tags, and with threat intelligence on external addresses.
- Feed enriched flows into detection, and keep the raw data queryable for investigations.
Configuration examples
resource "aws_flow_log" "prod" {
vpc_id = module.prod.vpc_id
traffic_type = "ALL"
log_destination_type = "s3"
log_destination = aws_s3_bucket.flowlogs.arn
max_aggregation_interval = 60
log_format = "$${version} $${account-id} $${interface-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport} $${protocol} $${packets} $${bytes} $${start} $${end} $${action} $${tcp-flags} $${pkt-srcaddr} $${pkt-dstaddr} $${flow-direction}"
destination_options {
file_format = "parquet"
per_hour_partition = true
hive_compatible_partitions = true
}
}-- Who was rejected trying to reach the database subnet in the last hour?
SELECT srcaddr, dstaddr, dstport, count(*) AS attempts
FROM flow_logs
WHERE action = 'REJECT'
AND dstaddr LIKE '10.0.21.%'
AND "start" > to_unixtime(now() - interval '1' hour)
GROUP BY srcaddr, dstaddr, dstport
ORDER BY attempts DESC
LIMIT 20;Examples are starting points. Review provider limits, names and versions for your environment before applying.
What to monitor
| Signal | Why it matters |
|---|---|
| Rejected flows by source | A single source rejected on many ports is a scan. |
| Bytes out to new external destinations | Large transfers to never-seen addresses are an exfiltration signal. |
| Flow log delivery gaps | Missing intervals mean blind spots during an investigation. |
| Top talkers between zones and regions | Cross-zone traffic is a common hidden cost. |
Common failure modes
Logs only on some VPCs
The one VPC without flow logs is where the incident happens.
Sentinel audits flow log coverage across every account and region.
Default format misses packet addresses
Behind NAT or load balancers you only see the intermediate address.
Sentinel recommends the extended format with pkt-srcaddr and pkt-dstaddr.