Open source · Python
Invictus-AWS
Get an initial read on an unfamiliar AWS account: which services are active, how they are configured and which logs exist. Then query CloudTrail with Amazon Athena.
# Install the requirements, then configure the AWS CLI
pip3 install -r requirements.txt
aws configure
# Enumerate and extract logs in one region, written locally
python3 invictus-aws.py -r eu-west-3 -s 1,3 -w local
✓ JSON per service in ./results/What it does
An account in, an inventory out
Enumeration, configuration and log collection read the account. The CloudTrail step runs Athena queries inside it, so it is billed there.
How it works
Four steps, run together or on their own
Steps 1 to 3 run by default. Step 4 runs alone, over CloudTrail logs only.
- 01
Enumerate
Identifies the AWS services in use and their details, across one region or every enabled region.
- 02
Collect configuration
Retrieves the configuration of each active service.
- 03
Extract logs
Pulls the available logs for those services into one place.
- 04
Analyse CloudTrail
Runs Amazon Athena queries over CloudTrail logs. One CSV per query, merged into a single workbook.
What it collects
Logs, by service
The enumeration step covers more services than this. The docs list them all.
| Service | What | Step |
|---|---|---|
| CloudTrail | Management and data events | -s 3 |
| GuardDuty | Findings | -s 3 |
| VPC | Flow logs | -s 3 |
| S3 | Access logs | -s 3 |
| CloudWatch | Log groups | -s 3 |
| WAFv2 | Web ACL logs | -s 3 |
| Route 53 | Query logs | -s 3 |
| CloudTrail | Athena queries, merged to merged_file.xlsx | -s 4 |
Before you run it
Permissions, scope and clean-up
Permissions
The AWS managed ReadOnlyAccess policy plus the custom policy in the repository, which adds Athena, Glue and S3 actions on buckets named invictus-aws-*.
Where results go
An S3 bucket the tool creates (-w cloud, the default) or a local ./results/ folder (-w local).
Cost
The analysis step uses Athena and Glue in the target account, so it is billed there. Enumeration and extraction read only.
Scope
One region with -r, or every enabled region with -A. A profile can be set with -p.
Where it’s used
The same tool, three ways
Responding to an incident in an AWS account.
OpenChecking an AWS environment for signs of compromise, as of a date.
CloudTrail analysis with Athena, taught hands-on.
Releases
No tagged releases yet
The repository has no published releases. Install from the main branch, and check the commit history for recent changes.
More tools
The rest of the toolkit
Invictus-AWS
Have the account inventory and need a second read?
A responder can work through the output with you.

