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.

License
MIT
Releases
None published · runs from main
Runs on
Python 3 · AWS CLI
Cost
Free · Athena and Glue usage in your account
SetupShell
# 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/
Works withAWS

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.

SourcesOutputsInvictus-AWSPython
Services
Configuration
Service logsCloudTrailJSON per service · local or S3Athena · one CSV per queryMerged workbook · XLSX

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.

  1. 01

    Enumerate

    Identifies the AWS services in use and their details, across one region or every enabled region.

  2. 02

    Collect configuration

    Retrieves the configuration of each active service.

  3. 03

    Extract logs

    Pulls the available logs for those services into one place.

  4. 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.

Read the docs
ServiceWhatStep
CloudTrailManagement and data events-s 3
GuardDutyFindings-s 3
VPCFlow logs-s 3
S3Access logs-s 3
CloudWatchLog groups-s 3
WAFv2Web ACL logs-s 3
Route 53Query logs-s 3
CloudTrailAthena 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

ServiceIncident response

Responding to an incident in an AWS account.

Open
ServiceCompromise Assessment

Checking an AWS environment for signs of compromise, as of a date.

AcademyIncident response in the AWS cloud

CloudTrail analysis with Athena, taught hands-on.

Releases

No tagged releases yet

Recent commits

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.