Skip to content

fix(security): restrict durable rule creation to Access credentials - #56

Merged
AndroxxTraxxon merged 4 commits into
mainfrom
security/mantis-rule-create-authority
Nov 15, 2026
Merged

AndroxxTraxxon merged 4 commits into
mainfrom
security/mantis-rule-create-authority

Conversation

@AndroxxTraxxon

@AndroxxTraxxon AndroxxTraxxon commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

A delegated Execution credential with Rules/Create could persist an ad hoc rule that later used its subject's broader Execute/configuration/Key authority when an event matched. Empty execution permission selections did not prevent that expansion.

Require Access credentials before rule creation effects. Canonical v1 rules retain a sponsor identity, without an originating credential ceiling; a one-time Execute/input check cannot constrain later sponsor grants. Access creation and trusted pack deployment remain supported. Existing behavioral-update, enabled-transition, scoped standard and recorded admission contracts remain unchanged.

Coverage:

  • Live delegated Create-only and broader credentials are rejected across default/empty/named/standard selections and config/Key templates, with exact403/body assertions and unchanged rule/enforcement/execution counts.
  • Existing successful mutation coverage now uses Access for rule creation and retains delegated deletion coverage.
  • access_created_rule_retains_sponsor_and_inputs_through_event_consumers creates the rule through the Access API route and drives real RabbitMQ EventProcessor/EnforcementProcessor consumers. It asserts exact resolved flat input, retained sponsor/standard refs, event/enforcement lineage and explicit delegated execution selection with executable/schema/grant bindings. Test-only executor dependency; no production consumer changes. This external-service case is explicitly ignored by default and was explicitly run against owned PostgreSQL18/RabbitMQ3.12.

Status: ready for human review and merge consideration at 70b0f2591e9c36f50a40c1b3d4eefb700f9f8e54. Coordinator verified all required merged-head CI complete (15 successes; Release Configuration Checks skipped), clean merge state, and the qualified owning and real-consumer evidence below. No implementation or validation work remains pending. Issue150 stays open until user merge/acceptance; no merge or deployment performed.

Validation:

  • At clean d3efd12: rustfmt and git diff --check passed; cargo check --locked -p attune-api --lib --test execution_mutation_authz_tests and corresponding Clippy with -- -D warnings passed. Ordinary mutation target:2 passed,1 explicitly ignored; separate explicit ignored selection of the real consumer positive:1 passed. Four test threads, unique run IDs, jobs2/debug0, one campaign lease and issue-owned target.
  • Reused clean b6fdb87 results: API library+three owning-target check/Clippy passed; rule_update_authz_tests15 and managed_component_readmission_tests4 passed on PG18. The later change only supplies the existing encryption config to the isolated external consumer fixture; production code, these tests, their helpers and dependencies are unchanged. The affected mutation target and positive were rerun at d3.
  • Source SHA/empty diff, target device/inode/ownership, toolchain, commands and executable hashes retained in /tmp/attune-150-create-d3efd12e-r6.* and preceding r2 receipts. Real consumers were stopped/joined before fixture cleanup. Owned PG/MQ containers and anonymous volumes were removed with absence proofs; issue150 target removed only after success and is absent. Failed fixture executable and failure logs retained. No background validation work remains.

Integration: git fetch origin main then git merge --no-edit origin/main created conflict-free merge70b0f2591e9c36f50a40c1b3d4eefb700f9f8e54, parents d3efd12 and8abbdea258c6b35c8b61a526b888ae4ca018e056. Draft verified before push; no history rewrite. r6 process reaped, own capture/waiter absent, resource cleanup receipts and target absence verified first. git diff --check origin/main HEAD passed and worktree clean. Diff against main contains exactly six intended remediation files; all main core4/native1.0.7/timer0.7.5/catalog4, mapping Permission/Manage bindings, expiry fixture and rustix1.1.6 changes are retained.

Protected input comparison against tested d3:205 files hashed; only common/value_schema/tests.rs changed (main core-catalog test anchors). Rule create/update/enable implementation, owning tests/helpers, event/enforcement consumers, authority production, schema compiler production and migrations compared unchanged. Proof retained in /tmp/attune-150-main-merge-proof.json, residual patch /tmp/attune-150-main-merge.diff, clean status and merge commit receipts alongside. Commands included git status/fetch/merge/show/diff, SHA256 comparisons, push and PR link. No new local build/test/reviewer was needed for mechanical integration. Prior local passes and Astra review remain qualified to their exact SHAs; new native/dependency inputs prevent claiming combined merged-head compilation/runtime validation from those old results. Normal exact merged-head CI subsequently passed, including Tests, Clippy, full-stack smoke, Windows CLI and web API generation checks. These results are separate from the qualified earlier local evidence.

Review: actual Codex GPT-6 Astra reviewed published a18bcc0 read-only, found no actionable implementation/security regression and traced the actual authority consumers. Its coverage objection is addressed by the subsequently added and now passing real-consumer test; Astra did not review that fixture. Subsequent source changes are tests/dependency wiring only.

Limits: exact merged-head CI passed; no local compiled validation was rerun on70b0f259. Prior real consumer positive covers rule-to-execution creation, not worker completion or downstream secret delivery; no dynamic exploit reproduction claimed. Earlier failed harness/fixture receipts are retained and were not counted as passes. Runtime shutdown logs included consumer stream/ack-close warnings; compiler/Clippy warnings were zero.

@AndroxxTraxxon
AndroxxTraxxon marked this pull request as ready for review November 15, 2026 06:24
@AndroxxTraxxon
AndroxxTraxxon merged commit ba26de4 into main Nov 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant