Skip to main content

Stave Tutorial Demo

44 S3 security scenarios in Docker. No AWS credentials required.

Stave ships with 2662 controls across 74 domains and 10 compliance profiles. This Docker demo covers the S3 domain (122 controls) through 44 curated scenarios that progress from beginner to advanced.

Install

git clone https://github.com/sufield/stave.git
cd stave
docker compose build

Detect a misconfiguration

docker compose run --rm -T stave --scenario 1

The output shows:

  1. The observation — a bucket with public_read: true
  2. The stave command
  3. The violation — CTL.S3.PUBLIC.001 detected public read access

See the fix

docker compose run --rm -T stave --scenario 1 --fixed

The output shows:

  1. The observation — the same bucket with public_read: false
  2. The same stave command
  3. No violations — exit code 0

See all 44 scenarios

docker compose run --rm -T stave --list

Pick any number from 1 to 44.

HIPAA compliance profile

docker compose run --rm -T stave --hipaa

A PHI bucket with no Block Public Access, AWS-managed KMS key, no logging, no versioning, and a wildcard policy. Stave reports CRITICAL findings with HIPAA Security Rule citations and compound risks.

docker compose run --rm -T stave --hipaa --fixed

The same bucket with Block Public Access on, customer-managed CMK, server and object-level logging, versioning, COMPLIANCE Object Lock, VPC-only access, and ACLs disabled. All HIPAA-mapped S3 controls pass.

Compound risk detection (primary demo)

docker compose run --rm -T stave --compound-risks

Detects dangerous combinations that individual checks miss. The pattern that caused the $190M Capital One breach — public access + wildcard IAM policy — is COMPOUND.001. Each finding is medium individually. Together they're critical. No checklist tool can detect this because they evaluate settings in isolation.

Trusted Advisor blind spots

docker compose run --rm -T stave --blind-spots

Three S3 risks that AWS Trusted Advisor cannot detect.

Try with your own bucket

docker compose run --rm -T stave --try-your-own

Prints step-by-step instructions to capture a real S3 bucket with the AWS CLI and evaluate it.

Rebuild from scratch

docker compose down --rmi all
docker compose build

Scenario reference

Beginner (1-8)

#ControlSeverityName
1CTL.S3.PUBLIC.001criticalNo Public S3 Bucket Read
2CTL.S3.CONTROLS.001highPublic Access Block Must Be Enabled
3CTL.S3.ENCRYPT.001highEncryption at Rest Required
4CTL.S3.LOG.001mediumAccess Logging Required
5CTL.S3.VERSION.001mediumVersioning Required
6CTL.S3.VERSION.002mediumBackup Buckets Must Have MFA Delete Enabled
7CTL.S3.GOVERNANCE.001lowData Classification Tag Required
8CTL.S3.INCOMPLETE.001lowComplete Data Required for Safety Assessment

Intermediate (9-27)

#ControlSeverityName
9CTL.S3.ENCRYPT.002highTransport Encryption Required
10CTL.S3.PUBLIC.007criticalNo Public Read via Policy
11CTL.S3.PUBLIC.003criticalNo Public Write Access
12CTL.S3.ACCESS.002highNo Wildcard Action Policies
13CTL.S3.ACCESS.003highNo External Write Access
14CTL.S3.NETWORK.001highPublic-Principal Policies Must Have Network Conditions
15CTL.S3.PUBLIC.004mediumNo Public Read via ACL
16CTL.S3.ACL.FULLCONTROL.001criticalNo FULL_CONTROL ACL Grants to Public
17CTL.S3.ACL.RECON.001highNo Public ACL Readability
18CTL.S3.ACL.ESCALATION.001highNo Public ACL Modification
19CTL.S3.AUTH.READ.001highNo Authenticated-Users Read Access
20CTL.S3.AUTH.WRITE.001highNo Authenticated-Users Write Access
21CTL.S3.PUBLIC.LIST.001highNo Public S3 Bucket Listing
22CTL.S3.PUBLIC.LIST.002highAnonymous S3 Listing Must Be Explicitly Intended
23CTL.S3.PUBLIC.005mediumNo Latent Public Read Exposure
24CTL.S3.PUBLIC.006criticalNo Latent Public Bucket Listing
25CTL.S3.ACCESS.001highNo Unauthorized Cross-Account Access
26CTL.S3.PUBLIC.002criticalNo Public S3 Buckets With Sensitive Data
27CTL.S3.PUBLIC.PREFIX.001highProtected Prefixes Must Not Be Publicly Readable

Advanced (28-43)

#ControlSeverityName
28CTL.S3.ENCRYPT.003highPHI Buckets Must Use SSE-KMS with Customer-Managed Key
29CTL.S3.ENCRYPT.004highSensitive Data Requires KMS Encryption
30CTL.S3.LIFECYCLE.001mediumRetention-Tagged Buckets Must Have Lifecycle Rules
31CTL.S3.LIFECYCLE.002mediumPHI Buckets Must Not Expire Data Before Minimum Retention
32CTL.S3.LOCK.001mediumCompliance-Tagged Buckets Must Have Object Lock Enabled
33CTL.S3.LOCK.003mediumPHI Object Lock Retention Must Meet Minimum Period
34CTL.S3.LOCK.002mediumPHI Buckets Must Use COMPLIANCE Mode Object Lock
35CTL.S3.PUBLIC.008criticalNo Public List via Policy
36CTL.S3.WEBSITE.PUBLIC.001criticalNo Public Website Hosting with Public Read
37CTL.S3.REPO.ARTIFACT.001mediumPublic Buckets Must Not Expose VCS Artifacts
38CTL.S3.WRITE.SCOPE.001highS3 Signed Upload Must Bind To Exact Object Key
39CTL.S3.WRITE.CONTENT.001highS3 Signed Upload Must Restrict Content Types
40CTL.S3.TENANT.ISOLATION.001highShared-Bucket Tenant Isolation Must Enforce Prefix
41CTL.S3.BUCKET.TAKEOVER.001criticalReferenced S3 Buckets Must Exist And Be Owned
42CTL.S3.DANGLING.ORIGIN.001highCDN S3 Origins Must Not Be Dangling
43CTL.S3.ACL.WRITE.001criticalNo Public Write via ACL

Capstone (44)

#ControlSeverityName
44All 122 S3 controlsallFull S3 Hardening Audit

Beyond S3: the full catalog

This demo covers S3. Stave evaluates 2662 controls across 74 domains:

# Compliance profiles — same engine, different framework lens
stave apply --profile hipaa --input observations.json --include-all
stave apply --profile cis-aws-v3.0 --input observations.json --include-all
stave apply --profile soc2 --input observations.json --include-all
stave apply --profile pci-dss-v4.0 --input observations.json --include-all
# Also: nist-800-53, fedramp, gdpr, ffiec, iso-27001, nist-csf-2.0

Domains: S3, IAM, VPC, EC2, RDS, ELB, K8s, CloudTrail, CloudWatch, KMS, Config, Secrets Manager, DynamoDB, SQS, SNS, Backup, API Gateway, ElastiCache, Cognito, GuardDuty, Security Hub, CloudFormation, Auto Scaling, Route 53, GCS, DNS.

How stave works

graph LR
A[Observations<br/>infrastructure snapshots] --> C[stave apply]
B[Controls<br/>safety rules] --> C
C --> D[Findings<br/>violations + remediation]

What you now know

By working through these scenarios you have:

  • Seen what an observation looks like — a JSON snapshot of infrastructure configuration captured at a point in time (obs.v0.1)
  • Run stave apply — the evaluation engine that checks observations against safety controls and reports violations
  • Read a finding — control ID, severity, affected asset, evidence of the misconfiguration, and concrete remediation steps
  • Verified a fix — the same command on a remediated observation produces zero violations (exit code 0)
  • Understood exit codes — 0 means safe, 3 means violations found
  • Seen compound risks — how dangerous combinations of individually medium findings create critical attack paths
  • Used your own data — captured a real S3 bucket with the AWS CLI and evaluated it with stave
  • The same engine works across all 29 domains and 10 compliance frameworks — this demo is the S3 subset