Skip to main content

AWS Chaos Engineering Framework

AWS Chaos Engineering: Bound. Observe. Rollback.

Break AWS safely before reality does.

CI CodeQL Python 3.12-3.14 License: Apache 2.0

An enterprise-minded, one-file chaos engineering orchestrator for AWS Fault Injection Service and carefully guarded service extensions. It combines read-only AWS FIS template planning, strict blast-radius controls, exact account binding, automatic rollback, emergency stops, and privacy-conscious evidence reports in a tool that remains easy to inspect and deploy.

Guarded AWS chaos experiment flow

Version 2.0.5 is the current release version of this source tree. Plan mode is the default evaluation path. Live support is declared per extension, and live AWS FIS starts remain disabled because the public API cannot bind the reviewed template version immutably.

Why this framework exists

AWS FIS can supply managed faults, but this framework currently permits only read-only template planning because StartExperiment cannot bind an immutable reviewed template. Guarded extensions retain their individually declared live support.

  • Explicit live-support declarations for each guarded extension, plus read-only FIS template planning
  • GovCloud-aware region and ARN validation
  • Plan mode by default, with no AWS mutations
  • Exact account, region, suite, and target binding for live runs
  • CloudWatch alarm gates and continuous runtime safety checks
  • Cooperative emergency stop and automatic recovery for reversible actions
  • Dual approval for irreversible actions and safety bypasses
  • Tag-scoped VPC discovery with exact target allowlisting
  • Local, atomic JSON evidence reports with identifiers redacted by default
  • A single Python application file with no framework or database

The framework does not replace AWS FIS. It makes FIS easier to govern and supplies a guarded extension layer for additional AWS services.

What this adds around AWS FIS

Native AWS FIS concern Framework contribution
Target and action selection Exact account, region, suite, target, tag, and aggregate blast-radius validation before an extension can run.
Stop conditions Required CloudWatch alarm review for live extensions and read-only validation of FIS template stop conditions.
Approval evidence A plan-bound confirmation digest plus stronger dual approval for irreversible actions and safety bypasses.
Recovery Declared rollback contracts, captured prior state, verification, and explicit recovery-failure reporting for supported extensions.
Audit record Atomic, privacy-conscious local evidence that separates plans, attempted writes, outcomes, and recovery state.

AWS FIS remains the managed fault-injection service. This project does not claim to make mutable FIS templates immutable, and it refuses to start them live until that boundary can be enforced.

Use the hash-locked Quick start or the provenance-verified release assets for authenticated downloads. A non-verified convenience install, python -m pip install aws-chaos-engineering-framework, uses the configured package index without hash verification. The exact-version command, python -m pip install aws-chaos-engineering-framework==2.0.5, is also non-verified without hashes and works once that version appears in the PyPI release history. The read-only aws-chaos-framework --list-experiments command lists supported experiments offline.

Safety model

Guardrail Enforced behavior
Default mode Plans and validates. It does not issue mutating AWS requests.
Identity binding Live mode requires the active account, configured account, region, partition, and caller identity to agree.
Credentials Temporary credentials are required by default. Long-term credentials need configuration and CLI approval. Plan and live runs, framework client creation and credential pinning refuse a non-default IMDS endpoint or a container credential URL outside the documented link-local addresses and numeric loopback literals (host names such as localhost are refused) before any credential request. Plain HTTP loopback container credential URLs are also refused when an authorization token or token file is configured.
Targets Live extensions require exact allowlisting. Optional VPC discovery includes only resources with required safety tags.
Blast radius Per-run and per-experiment limits are enforced before execution.
Stop controls Extension runs require CloudWatch alarms by default. FIS template inspection checks alarm stop conditions; live FIS starts are disabled.
Confirmation Live execution requires an exact, non-secret token containing the account, region, and suite.
Irreversible actions Destructive actions require a stronger token plus two independent approvals.
Rollback Reversible changes capture prior state, track AWS write attempts, and report recovery failures honestly. Lambda configuration recovery is verified only from a single read that carries the expected revision, an explicit Successful status and the expected values. With no restore needed, that is the forward update's own response revision; only a forward update the client proved was never dispatched verifies from the original values alone. After a restore, it is the restore's own response revision, and the restore is sent only after an explicitly Successful read of the forward revision. A forward update dispatched without a new response revision is never verified from a read of the original values. Otherwise recovery fails and later live runs in the process are blocked.
Reports Account, identity, alarm, and resource identifiers are omitted or redacted unless explicitly requested.

Safety checks fail closed. Missing alarms, unresolved targets, mismatched identities, ambiguous target scopes, and unsupported experiment types stop live execution.

Requirements

  • Python 3.12 through 3.14. Python 3.10 reached end of life on October 1, 2026 and is no longer a supported runtime for repository source or future releases. The already-published v2.0.4 package metadata cannot be changed in place and still records its historical Python 3.10 compatibility.
  • An AWS identity with only the permissions needed by the selected experiments
  • AWS FIS experiment templates for FIS-managed actions
  • CloudWatch safety alarms for live extension runs
  • A separate, explicitly approved test account or isolated test environment

The tool supports standard AWS partitions and both AWS GovCloud regions. CloudFront experiments are rejected when a GovCloud region is configured because CloudFront is not available in GovCloud.

Quick start

Clone the repository, create an isolated Python environment and install only hash-verified wheels from the repository's lockfiles: first the pinned installer, then the pinned build tools and runtime dependencies. The local project is then built with exactly those tools, without build isolation or any further dependency resolution:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --require-hashes --only-binary :all: -r requirements-pip-lock.txt
python -m pip install --require-hashes --only-binary :all: -r requirements-build-lock.txt
python -m pip install --require-hashes --only-binary :all: -r requirements-runtime-lock.txt
python -m pip install --no-build-isolation --no-deps .

Create and validate a safe starter configuration:

aws-chaos-framework --create-sample-config chaos.yaml
aws-chaos-framework --validate-config chaos.yaml
aws-chaos-framework --list-experiments

Plan a suite. Plan mode is the default:

python .\aws_chaos_framework.py `
  --config .\chaos.yaml `
  --suite tagged_ec2_recovery `
  --vpc-id vpc-0123456789abcdef0 `
  --profile chaos-test

The included example configuration demonstrates tagged EC2 recovery and read-only FIS template planning. Replace all placeholders before use.

For a review meeting or sandbox rehearsal, follow the plan-only game-day walkthrough. It keeps mutation disabled while the team verifies identity, targets, alarms, blast-radius limits, evidence handling, and the exact boundary before live authorization.

Moving from plan to live execution

Live mode is intentionally inconvenient. Complete these steps before enabling it:

  1. Use an isolated test account or explicitly approved test environment.
  2. Configure the exact account ID and region.
  3. Use a dedicated, least-privilege role with temporary credentials.
  4. Configure required target tags and an exact target allowlist.
  5. Add CloudWatch safety alarms and verify their behavior.
  6. Run and review the plan.
  7. Print the exact confirmation token after reviewing the complete configuration. Any plan or safety change invalidates it.
python .\aws_chaos_framework.py `
  --config .\chaos.yaml `
  --suite tagged_ec2_recovery `
  --profile chaos-test `
  --expected-principal-arn arn:aws:iam::123456789012:role/ChaosOperator `
  --show-live-token

Materialize discovery placeholders into explicit resource IDs before generating this token. Add those IDs to the exact target allowlist. Use the same profile, role, VPC and seed options when generating the token and running the suite. For a profile-based run, supply the exact reviewed caller ARN with --expected-principal-arn both times. An explicit role supplies that identity automatically. Live startup checks the canonical STS caller against the principal bound into the token.

Then provide that exact token with --live:

python .\aws_chaos_framework.py `
  --config .\chaos.yaml `
  --suite tagged_ec2_recovery `
  --profile chaos-test `
  --expected-principal-arn arn:aws:iam::123456789012:role/ChaosOperator `
  --live `
  --confirm "<paste the complete token including its SHA256 digest>"

Irreversible suites require safety.allow_irreversible: true, --allow-irreversible, and a token beginning with LIVE-IRREVERSIBLE. Safety bypasses also require matching approval in both configuration and the CLI.

AWS FIS integration

Use fis_template for read-only template inspection and guardrail validation. Live FIS starts and confirmation tokens are disabled. AWS StartExperiment takes a mutable template ID and provides no conditional version or content digest. Re-reading the template narrows the race but cannot prove that the approved content is what AWS starts. A configuration assertion about an exclusive change window does not prove immutability.

Re-enabling live FIS requires an enforceable and independently verified immutable-template boundary or an AWS API that conditionally starts the reviewed version. The current public API cannot acquire live FIS or historical FIS recovery authority. Already-started experiments from older versions require operator reconciliation through separately approved AWS procedures. FIS planning still checks execution-role ownership, alarm scope, explicit resource allowlists, action support and bounded aggregate targets.

Useful AWS references:

Experiment catalog

The catalog covers AWS FIS plus extensions for EC2, EBS, EFS, VPC, RDS, Lambda, S3, SQS, SNS, Elastic Load Balancing, ECS, Kinesis, OpenSearch, CloudFront, WAF, KMS, IAM, Directory Service, AppStream, ECR, CodeCommit, and SES.

Every catalog entry declares its provider, risk, live support, rollback model, and whether FIS is preferred:

python .\aws_chaos_framework.py --list-experiments

The catalog intentionally includes some gated entries. An action is not live-supported when it cannot provide a real fault, bounded targeting, or an honest recovery contract. Host-level EC2 faults remain represented through read-only fis_template planning until an immutable start boundary is available.

EC2 termination is planning only: AWS cannot bind a termination request to the reviewed block-device relationships. The plan still identifies every volume marked for deletion. EBS detach and route deletion/restoration are planning only. Attachment tuples, observed single-attachment capability, route targets and terminal-state predicates remain read-only evidence; their APIs cannot condition writes on the reviewed mutable capability or captured route generation. Temporary policy, ingress, IOPS, cluster capacity, network, queue, key, credential, and trigger operations retain planning while live execution is refused because their current APIs provide no conditional ownership proof for safe recovery. EC2 stop, EFS throughput, RDS shared parameter groups, Lambda reserved concurrency, S3 key deletion/versioning, S3 lifecycle expiration (whose plans require a nonempty reviewed prefix and keep unrelated rules), ELB configuration, ECS updates, AppStream state/associations and Directory Service forwarders also retain planning with live execution disabled. Lambda identifiers must be unqualified local names or exact reviewed full ARNs; route and EBS terminal predicates do not authorize live recovery. SNS subscription deletion is also planning only: live unsubscribe and subscription recreation are unavailable. SQS queue purge and RDS reboot, cluster failover and backup-retention changes are planning only as well: PurgeQueue cannot be bounded to an exact message set, and the RDS requests have no conditional generation or lease against changes queued after admission. Kinesis retention decreases and SES configuration-set deletion are planning only for the same reason: both irreversible writes address a reusable name without a generation, condition or lease. ECR digest deletion and VPC endpoint deletion are planning only too: BatchDeleteImage also removes every tag alias on the digest, and DeleteVpcEndpoints also removes the endpoint's network interfaces and gateway routes, with no condition over that derived set. Historical unsupported recovery needs operator reconciliation. See runtime approval and recovery boundaries for the complete capability contract and compatibility changes.

Evidence and privacy

Each suite creates an atomic JSON report in chaos-reports/ unless another output directory is selected. Reports include mode, framework version, action status, duration, mutation attempts, rollback attempts, and recovery outcomes. On POSIX systems, report output requires a directory owned by the current user. Every ancestor must be owned by that user or root, with no writable non-sticky or symlinked component. Publication rechecks the named chain and the exact private report inode before returning its path. On Windows, reports are stored in a fresh private directory directly under the user's profile. The chosen --output-dir is not used as a publication path on Windows, because a previously shared directory may retain open writer handles even after its access list is narrowed. A requested directory equal to or containing the profile is refused because it would overlap the private publication anchor. The actual report path is returned and logged. The framework creates the private directory with a protected access list from inception, rejects reparse points in its path, and checks the temporary file's access list before publication.

By default, reports omit AWS identity and resource identifiers. These fields can be enabled separately:

reporting:
  include_identity: false
  include_resource_ids: false
  include_diagnostics: false

Reports and logs may still be operationally sensitive. Keep them out of source control and handle them according to your organization's data-classification rules. AWS API activity is recorded by CloudTrail when CloudTrail is configured for the account. The framework's local audit events are not a substitute for CloudTrail.

Disclosure flags affect the typed run-identity and affected-resource fields. Errors and diagnostics remain filtered under every flag combination. Live experiments execute serially through recovery; unverified recovery blocks later live execution in the process. Retention changes are irreversible, and EC2 termination and EBS detach do not create implicit backups. See the security boundaries before preparing approval.

Testing and release assurance

The release gate is fully offline and never contacts an AWS account. Deterministic fake clients exercise every advertised executable mode and fail immediately if plan mode attempts a write. Focused simulations also cover planning-only policy/scalar refusal, conditional Lambda/WAF recovery, route restoration and conflict refusal, WAF optimistic locking, IAM self-protection, FIS start guardrails, report no-overwrite behavior, redaction, configuration validation, and Botocore API request shapes.

Run the same checks locally. Use Python 3.12 or newer when running pip_audit; the CI audit environment uses Python 3.12.

python -m pip install --require-hashes --only-binary :all: -r requirements-pip-lock.txt
python -m pip install --require-hashes --only-binary :all: -r requirements-dev-lock.txt -r requirements-build-lock.txt
python -m ruff format --check .
python -m ruff check .
python -m pytest -q
python -m bandit -q -r .\aws_chaos_framework.py
python -m pip_audit -r .\requirements-runtime-lock.txt --require-hashes --disable-pip --progress-spinner off

Audit the committed, hashed runtime lock. requirements.txt lists direct dependencies and must not be used as an audit lock.

CI runs the test suite across supported Python versions and validates Python 3.12 on Windows and macOS. The release-candidate job builds normalized wheel and source archives twice, requires byte-identical results, installs each package independently, and preserves the exact six-file candidate as workflow evidence. CodeQL, Semgrep, Trivy, dependency auditing, secret scanning, and Dependabot are configured for the public repository.

See TESTING.md for the complete offline gate and RELEASING.md for the exact asset contract. Tag automation can create only a draft GitHub release and cannot publish to a package registry.

Design principles

  • FIS first when AWS supplies a managed action
  • No mutation without explicit live intent
  • No target without exact scope
  • No destructive action disguised as reversible
  • No swallowed rollback error
  • No secret or target inventory committed to the repository
  • No claim of success when no resource was affected

Contributing

Contributions are welcome. Start with CONTRIBUTING.md, keep the runtime application in the single aws_chaos_framework.py file, and add offline tests for every behavior change. Pull requests must not require access to a real AWS account.

Security vulnerabilities should be reported privately as described in SECURITY.md.

License

Licensed under the Apache License 2.0.

Disclaimer

This project is community software and is not affiliated with, sponsored by, or endorsed by Amazon Web Services. AWS, AWS GovCloud, and related service names are trademarks of Amazon.com, Inc. or its affiliates. You are responsible for authorization, configuration, cost, availability impact, regulatory obligations, and recovery planning.

Configuration and library migration

Live library execution requires a confirmed ChaosOrchestrator and its reviewed suite. Direct experiment constructors are planning only; dry_run=False without orchestrator authority raises SafetyViolation. The public handler accepts the exact approved arguments once, and run_rollback() admits only that handler's owned recovery after the handler completely returns. Each live object serializes its handler and recovery lifecycle; premature or reentrant recovery is refused. Raw client mutations are refused. Legacy EC2 SSM shell faults are disabled; FIS remains planning only.

Direct library use requires an origin-hardened session. Create the session and harden it before botocore initializes its credential or token providers, then pass it on: SafetyController(config, harden_session_origin(boto3.Session(profile_name=...)), region, False). SafetyController construction, origin_bound_client and every experiment constructor raise SafetyViolation for a boto3 session that harden_session_origin has not marked, before any credential or token is resolved, and harden_session_origin refuses a session whose credential or token provider was already initialized. A wrapper is admitted only when its client and credential methods are bound directly to the same hardened boto3 session. Test doubles use the internal provider-free class with a fixed client map and static credentials; it does not accept client factories.

Credential resolution refuses HTTP, HTTPS or all-protocol proxy settings, including system-discovered proxies and Botocore's default client configuration, before metadata or container token requests. Customer service models in AWS_DATA_PATH or ~/.aws/models are not used; reviewed read operations are bound to packaged Botocore wire metadata and rechecked when saved callables or paginator pages dispatch. KMS grant revocation requires approved grantee and retiring principal ARNs in the experiment configuration and refuses grants held by the operator or a recovery identity. Global recovery identities remain protected even when an experiment overrides their configuration fields.

Direct handler calls redact their own targets without the CLI. Each public handler call registers the identifiers bound by the experiment configuration and call arguments, and the experiment instance keeps an append-only set of every argument-bound target, so later run_rollback(), rollback(), run() and collect_metrics() calls on that instance stay protected too. The set is never shared with other instances. The aws_chaos_framework logger redacts every record before any handler sees it. Framework records therefore reach host handlers already rendered: args is empty, exc_info is cleared and the redacted traceback is in exc_text.

The former regex key safety.denied_target_patterns is rejected. Manually review and migrate every old expression to safety.denied_target_globs; do not merely rename the key. Globs match the whole target, case insensitively: * matches any sequence and ? one character, while dots are literal. For example, the regex ^test-.*$ deliberately migrates to the glob test-*. Fixed prod and production name-token denial remains active independently of configured globs. See security boundaries for bounds and peering scope.

Metadata

Release files for aws-chaos-engineering-framework 2.0.5

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

Source distribution (sdist)

Source distribution for aws-chaos-engineering-framework 2.0.5
File Size Uploaded Provenance Actions
aws_chaos_engineering_framework-2.0.5.tar.gz 2.2 MB With provenance Details for aws_chaos_engineering_framework-2.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-chaos-engineering-framework 2.0.5
File Interpreter ABI Platform Actions
aws_chaos_engineering_framework-2.0.5-py3-none-any.whl Python 3 none any Details for aws_chaos_engineering_framework-2.0.5-py3-none-any.whl

Total release size: 2.9 MB

Release files / aws_chaos_engineering_framework-2.0.5.tar.gz

Download URL aws_chaos_engineering_framework-2.0.5.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f85de3d735b4ea90c63ef6a9f5790ac87a8baa5258d693ae235a89d835a9baed
BLAKE2b-256 checksum
How to use checksums
27be5dfc8fcaca85cb1b3639d101f2814db7f7b463f8a23f0cfc801ce69754ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Release files / aws_chaos_engineering_framework-2.0.5-py3-none-any.whl

Download URL aws_chaos_engineering_framework-2.0.5-py3-none-any.whl
Size 693.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d000d13055f759941e64fc2a2cb4883dac2aea480f3bd18bdb7e9831afa8ccc3
BLAKE2b-256 checksum
How to use checksums
f87f6aff8baec0c65adc0c94cfb3b08feaf34a242749e156d2197f0e746be5ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Security for aws-chaos-engineering-framework 2.0.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aws_chaos_engineering_framework-2.0.5.tar.gz

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 Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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