Useful scripts list query_cloudwatch_log.py : This is a quick script written in python that can query various fields in AWS VPC flow logs extracted from Cloudwatch. Cloudwatch doesnt support advanced querying where you will have to check src_ip against a known IP list. This scripts will allow you to load existing list of IPs from a CSV and match that against the src_ip in VPC Flow logs.
- Create an extract request to S3 using CloudWatch console.
- Download the logs from S3 using AWS CLI.
- Run the script on the log dir.
- Provide path for log dir.
- Provide allowed IP list path using file (CSV) path.