원클릭으로
stave-write-your-first-control
Author, test, and verify a custom Stave control using the forge toolchain
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Author, test, and verify a custom Stave control using the forge toolchain
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Build Stave from source and verify the binary and control catalog work, adapting to what is already installed
Run Stave against a tiny example observation and read your first findings — no AWS account required
Deploy a known-vulnerable Bishop Fox IAM lab, evaluate it with Stave, and confirm findings match the documented attack paths — trust via an independent oracle
Export Stave observation facts to JSONL/SMT-LIB and derive compound cross-asset chains with Z3, Soufflé, or Prolog — detection CEL alone cannot express
Capture a read-only configuration snapshot of your real AWS account and evaluate it with Stave on a local, deterministic snapshot
Verify cloud infrastructure security using the Stave platform with machine-verifiable contracts at every step
| name | stave-write-your-first-control |
| description | Author, test, and verify a custom Stave control using the forge toolchain |
| triggers | ["write a control","author a control","custom detection","add a security policy to Stave","new control YAML","forge a control"] |
| requires | ["a built stave binary (run stave-setup first)"] |
Walks you through authoring a new control using the forge toolchain, then
proves it fires on the positive case and stays quiet on the negative case.
Time: ~20 minutes. No AWS needed.
Controls are YAML match rules (unsafe_predicate: with all:/any: groups of
field/op/value). CEL is the internal evaluation engine — you never write it.
The forge commands generate, test, and lint the YAML for you.
e.g. "An S3 bucket must have access logging enabled."
Point forge paths at an observation snapshot to see what fields exist:
./stave forge paths --snapshot examples/demo-s3-public-read/fixtures/writeup-config/observations/2026-01-10T000000Z.json \
--asset-type aws_s3_bucket
This lists every property path, its type, and values. Find the field for your property.
./stave forge preview --snapshot <same-snapshot> \
--field properties.storage.logging.enabled --op eq --value false
FAIL means the predicate catches the unsafe state. PASS means the asset is safe.
If nothing fires on a known-unsafe snapshot, revise the predicate before proceeding.
./stave forge new --non-interactive \
--id CTL.S3.LOG.CUSTOM.001 \
--name "S3 buckets must have access logging" \
--field properties.storage.logging.enabled \
--op eq --value false \
--severity high \
--domain exposure \
--remediation "Enable S3 server access logging" \
--out ~/my-controls/
This generates the control YAML AND pass/fail test fixtures in one step.
Open ~/my-controls/.../CTL.S3.LOG.CUSTOM.001.yaml and add:
classification: state_assertionapplicable_asset_types: [aws_s3_bucket]scope_tags: [aws, s3]observation_fields: listing every field the predicate readsdefect: / infection: / failure: narrative (what's wrong / how it spreads / what fails)tests: with VIOLATION and PASS inline fixturesUse an existing control as reference for the shape:
cat controls/s3/logging/CTL.S3.LOG.001.yaml
./stave forge test \
--control ~/my-controls/.../CTL.S3.LOG.CUSTOM.001.yaml \
--pass <pass-fixture>.json \
--fail <fail-fixture>.json
The fail fixture must produce VIOLATION. The pass fixture must not fire.
./stave forge lint --control ~/my-controls/ --semantic --strict
Must pass with 0 errors, 0 warnings. --semantic catches always-firing and never-firing predicates.
./stave apply --controls ~/my-controls --observations <obs-dir>/ \
--eval-time 2026-01-02T00:00:00Z
Your control fires alongside the built-in catalog.
You authored a control using the forge pipeline, gave it pass/fail tests, linted it, and watched it fire on the positive case only. You can now encode org-specific policy in Stave.
Drop the YAML under controls/<domain>/<aspect>/ and run make build to sync it into
the embedded catalog. See docs/https://www.systeminvariant.dev/docs/how-to/control-authoring for the full convention
(ID format, compliance mappings, evidence citations, the forge-to-PR pipeline).