Skip to content

feat(egress): a ceiling no answer can exceed, and a diff of what a policy change opens - #4

Closed
praxagent wants to merge 3 commits into
mainfrom
feat/policy-ceiling
Closed

praxagent wants to merge 3 commits into
mainfrom
feat/policy-ceiling

Conversation

@praxagent

@praxagent praxagent commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Idea credit: NVIDIA OpenShell's policy prover (policies must stay within an allowed access boundary; flag proposed rules that add risky access).

Ceiling — PROXY_EGRESS_CEILING (opt-in)

  • The ceiling is an outer boundary, written in the same format as the policy.
  • It is checked before the policy on every request.
  • Anything outside it is denied outright and never asked about, so no person's answer, timed grant or later policy edit can exceed it.
  • At startup the proxy logs every policy rule that reaches past it.
  • Unset means no change.
  • Compose mounts ${PROXY_EGRESS_CEILING_FILE:-./egress-ceiling.example.json}.

Diff — python -m secrets_proxy.egress_policy diff OLD NEW [--ceiling C] [--forward-map M]

  • It lists every request the new policy treats more permissively than the old one.
  • It marks the ones that would carry an injected credential, and the ones the ceiling refuses anyway.
  • It exits 1 if anything opened, so it can gate a deploy.
  • Not a proof: it compares the two policies only over the vocabulary their own rules use (hosts, methods, ports and paths, each clean and tainted) plus "any other host".

Tests

  • 8 new tests in tests/test_policy_ceiling.py, including: the ceiling beats an allow rule and a remembered answer; the diff finds new allows and credential-bearing opens; the CLI exit codes.
  • Full suite: 71 passed; ruff clean; docker compose config valid.
  • Not exercised live against mitmproxy in this PR.

…licy change opens

Idea credit: NVIDIA OpenShell's policy prover.

- PROXY_EGRESS_CEILING: an outer boundary in the policy format, checked
  before the policy on every request. Outside it is denied outright and never
  asked about, so no person's answer, timed grant or policy edit can exceed
  it. Startup logs every policy rule that reaches past it.
- python -m secrets_proxy.egress_policy diff OLD NEW [--ceiling] [--forward-map]:
  every request shape the new policy treats more permissively, marking
  credential-bearing ones and ones beyond the ceiling; exits 1 when anything
  opened. An honest comparison over the rules' own vocabulary, not a proof.
@praxagent

Copy link
Copy Markdown
Owner Author

Folded into #8 (stacked PRs re-conflict after every squash merge). Every commit from this branch is in #8 — merge that one.

@praxagent praxagent closed this Oct 2, 2026
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