iac.htora.dev · security templates

Home/Refreshers/Keep network records long enough to be useful: refresher

Keep network records long enough to be useful

Traffic records stored cheaply for months, in a format you can query.

Remember

  1. Traffic crosses the network: between hosts and out to the internet.
  2. A flow record is written: who talked to whom, when, and how much.
  3. Stored cheaply for months: in a format you can query.
  4. A scoping question answered: months after the fact.
PlatformUsesThe part that catches people
AWSVPC flow logs to S3 in Parquet formatWith hour partitions on, files land under AWSLogs/aws-account-id=<id>/, and a bucket policy written for AWSLogs/<id>/ refuses them.
AzureVirtual network flow logs with traffic analyticsA flow log must be written by the Network Watcher in the network's own region.
Google CloudVPC flow logs to a log bucketFlow logs are a setting on each subnet, and this template does not manage your subnets.
Oracle CloudVCN flow logs to the Logging serviceLogging keeps records for 180 days at most.

Run the quick start

Download providersterraform init
Previewterraform plan
Applyterraform apply

Watch out

  • Flow logs answer the first questions of a network investigation: which hosts a compromised machine talked to, on which ports, and how much data left.
  • Keep them longer than your other logs if you can.
Check it worked

Ask for traffic from a host thirty days ago and get rows back.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.