Skip to main content

Dredge - 1.1.3

CI License: MPL-2.0 Coverage

⚡ Cloud log collection, threat hunting, and rapid response... pa' la hinchada ⚡


Dredge is a cloud incident-response and threat-hunting toolkit — a Python library and a CLI — for AWS, Kubernetes, GitHub, and GCP. It's built for moving fast when you don't have all the plumbing ready at 3AM: collect logs, hunt through them, and contain — from one tool.

⭐ Hunt CloudTrail across every AWS region at once. LookupEvents is a regional API, so a normal search only sees one region. Dredge fans out to all your enabled regions concurrently and merges the results into one time-sorted timeline — one command, no scripting, no per-region loops. Jump to it ↓

  • AWS — a security review (per-service + org-wide posture, CSV + HTML), hunt (CloudTrail live + offline + all-region fan-out, GuardDuty, Security Hub, Config…), containment (IAM, EC2, RDS, ECS, S3, Lambda, KMS…), forensics (S3 log collection, snapshots, flow logs).
  • Kubernetes — hunt, containment (RBAC, pods, nodes, NetworkPolicy), and forensics against any cluster (EKS/GKE/AKS/self-managed).
  • GitHub — org/enterprise audit-log hunting and containment.
  • GCP — Cloud Logging hunting (in progress).

📚 Full documentation is in docs/.


Install

pip install dredge-ir

The distribution is dredge-ir (the bare dredge name is taken on PyPI); the command and import package are both dredge. Python 3.10+. See docs/installation.md for source and Docker.


Quickstart — collect AWS logs and hunt (60 seconds)

The fastest, lowest-risk way to get value: pull CloudTrail logs and hunt through them. All read-only.

# 1. Collect — pull the last 2 days of CloudTrail across every account/region
#    from an org / Control Tower S3 bucket. Date-aware: it only lists the dated
#    folders inside the window, not years of history.
dredge --aws-profile ir --region us-east-1 \
  aws forensics download-s3-logs \
  --bucket my-org-cloudtrail --prefix AWSLogs/ \
  --destination ./ct-logs --days-ago 2

# 2. Hunt offline over what you just pulled — no more AWS calls.
dredge aws hunt query-cloudtrail-logs \
  --path ./ct-logs --access-key-id AKIAIOSFODNN7EXAMPLE \
  --fields eventTime,eventName,sourceIPAddress,userIdentity.arn

# 3. Or hunt live via CloudTrail LookupEvents (last ~90 days).
dredge --aws-profile ir --region us-east-1 \
  aws hunt cloudtrail --user suspicious-user --week-ago 1

Baseline-deviation hunts, built in:

# One identity, each event tagged by whether its source IP is in an allowlist.
dredge --aws-profile ir --region us-east-1 \
  aws hunt user-activity-by-ip --user deploy-bot \
  --allowed-ip 10.0.0.0/8,203.0.113.10 --week-ago 1

👉 More: Getting started · AWS CLI reference


Hunt CloudTrail across every region at once

⭐ Dredge's killer feature. CloudTrail LookupEvents is a regional API — each region's endpoint only returns the events recorded in that region. So the usual way to answer "what did this access key do anywhere in my account?" is to loop over ~30 regions by hand (or miss activity in the regions you forgot). Attackers know this, and operate in regions you don't watch.

Dredge collapses that into one command. --all-regions queries every enabled region concurrently and merges everything into a single time-sorted timeline:

# Every enabled region, all queried in parallel, merged into one timeline
dredge --aws-profile ir --region us-east-1 \
  aws hunt cloudtrail --access-key-id AKIAIOSFODNN7EXAMPLE --all-regions

Or target a specific set of regions:

dredge --aws-profile ir --region us-east-1 \
  aws hunt cloudtrail --user suspicious-user \
  --regions us-east-1,eu-west-1,ap-southeast-2

--regions is comma-separated and/or repeatable (--regions us-east-1,us-east-2, or --regions us-east-1 --regions eu-west-1, or any mix).

What you get:

  • Concurrent fan-out — every regional endpoint is hit at the same time (tune with --max-workers), not one after another.
  • One merged, time-sorted timeline — events from all regions in a single ordered list; each event keeps its aws_region.
  • Automatic region discovery — --all-regions finds your enabled regions via EC2 DescribeRegions (opted-in only), so it doesn't waste calls on disabled ones.
  • Per-region visibility, no all-or-nothing — a by_region breakdown reports each region's event count and any error, so a region you can't reach is noted without failing the rest of the hunt.
  • All the same filters — --access-key-id, --user, --event-name, --source-ip, and the time flags apply identically in every region; --max-events becomes the per-region cap.

From Python:

res = d.aws_ir.hunt.lookup_events_multi_region(
    access_key_id="AKIAIOSFODNN7EXAMPLE",
    regions="all",                 # or ["us-east-1", "eu-west-1"]
)
res.details["events"]              # merged, time-sorted across regions
res.details["by_region"]           # per-region counts + any errors

The global --region sets the base session region; --all-regions / --regions control the fan-out. Full details in AWS CLI reference.


Command layout

Commands are nested provider → bucket → command, with help at every level:

dredge --help                      # everything, grouped by provider × bucket
dredge aws hunt --help             # commands under aws hunt
dredge aws hunt cloudtrail --help  # a command's options

Global flags (auth, region, --dry-run) go before the provider. Buckets are review (posture), hunt (read-only investigation), response (containment), forensics (evidence).


Tactical one-liners

# Security review — posture snapshot as CSV + HTML (where to dig deeper)
dredge --aws-profile ir --region us-east-1 \
  aws review full --incident-start 2026-04-01T00:00:00Z \
  --csv ./review.csv --html ./review.html

# Contain — always dry-run destructive actions first (global --dry-run)
dredge --aws-profile ir --region us-east-1 --dry-run \
  aws response disable-user --user compromised-user
dredge --aws-profile ir --region us-east-1 \
  aws response quarantine-s3-bucket suspicious-bucket

# GitHub — hunt the audit log (token from $GITHUB_TOKEN)
dredge --github-org dbnz-io github hunt audit --actor sabastante --today --include all

# Kubernetes — isolate a pod, hunt privileged pods
dredge --k8s-context prod-cluster --k8s-namespace default \
  k8s response quarantine-pod suspicious-pod
dredge --k8s-context prod-cluster k8s hunt privileged-pods

Use it from Python

from dredge import Dredge
from dredge.auth import AwsAuthConfig

d = Dredge(auth=AwsAuthConfig(profile_name="ir", region_name="us-east-1"))

# collect, then hunt
d.aws_ir.forensics.download_s3_logs("my-org-cloudtrail", prefix="AWSLogs/",
                                    destination="./ct-logs", days_ago=2)
res = d.aws_ir.hunt.lookup_events(access_key_id="AKIAIOSFODNN7EXAMPLE")
print(res.details["events"])

Every action returns an OperationResult (success, details, errors). 👉 Library docs.


Documentation

Getting started Install → collect → first hunt
Installation PyPI, source, Docker
Authentication AWS · GitHub · Kubernetes · GCP
CLI AWS · GitHub · Kubernetes
Library AWS · GitHub · Kubernetes
Command reference Every command, generated from the CLI
Roadmap · Contributing

License

MPL-2.0. Security issues: see SECURITY.md.

Release files for dredge-ir 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dredge-ir 1.1.3
File Size Uploaded
dredge_ir-1.1.3.tar.gz 204.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dredge-ir 1.1.3
File Interpreter ABI Platform
dredge_ir-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 345.6 kB

Release files / dredge_ir-1.1.3.tar.gz

Download URL dredge_ir-1.1.3.tar.gz
Size 204.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8b600f067db02b50ae4342f7f48da4444c9ea0af770c1dcc1ef465dbfc119037
BLAKE2b-256 checksum
How to use checksums
89a75af2ab827e4722e4eddbcc3ca9082e57099d90196b431ac864634e66097b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release files / dredge_ir-1.1.3-py3-none-any.whl

Download URL dredge_ir-1.1.3-py3-none-any.whl
Size 141.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d257cfd4d98a410f5debe250429682bb50e13f8239eb2d160f18fb057f0f3dcd
BLAKE2b-256 checksum
How to use checksums
5d55059d148e458af5412ea4c3ec8e32ed5b7b28b15797a8144b4073d1dc475b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.4

2 release files

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page