nodemethod
ObservabilityFoundational

Network flow logs for detection and troubleshooting

Record who talked to whom, on which port, and whether it was allowed, across every network.

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.

VPCSNETprod VPCflow logsNETshared VPCflow logsHUBtransit hubflow logsDBObject storageParquet, hourlyOTELEnrichmenttags, threat intelNMNodeMethoddetect + correlateAPPQuery enginead hoc SQL
traffictunnel / replicationblocked

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

  1. Enable flow logs on every VPC and on the transit hub, with a custom format that includes the fields you need.
  2. Deliver to object storage in Parquet with hourly partitions for cheap, fast queries.
  3. Enrich each flow with the resource, owner and environment tags, and with threat intelligence on external addresses.
  4. 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
  }
}

Examples are starting points. Review provider limits, names and versions for your environment before applying.

What to monitor

SignalWhy it matters
Rejected flows by sourceA single source rejected on many ports is a scan.
Bytes out to new external destinationsLarge transfers to never-seen addresses are an exfiltration signal.
Flow log delivery gapsMissing intervals mean blind spots during an investigation.
Top talkers between zones and regionsCross-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.

Checklist

0 of 5 done
Was this pattern useful?

Run this pattern with NodeMethod watching it.

NodeMethod is onboarding early-access teams now. Tell us about your environment and we will be in touch.

esc
↑↓ to move↵ to open