outcome:You have seen a protected system's manifests and policy evaluated offline, and a live flex-auth pin refuse callers with no credential, the wrong ServiceAccount, and the wrong audience. Expired-token refusal (negative N4) is not exercised here because it needs a ten-minute wait.
description:"A flex-auth checkout with Go, to run go run ./cmd/flex-auth (flex-auth); kubectl access to the cluster through the k3s-api tunnel (ops-bridge); the live pin runs with --caller-auth-mode enforce and its bound ServiceAccount exists (package owner, ADR-0015)."
idempotent:idempotent
verify:
done_when:All three prerequisites hold
expect:manual
- id:read-manifest
title:Read the protected-system manifest of the example
actor:operator
owner:flex-auth
requires:[prerequisites]
uses:[flexauth_home, example]
description:Resource types and the action vocabulary belong to the protected system. Note that a verb that is not a real gate (revoke) is deliberately not an action.
done_when:You can name the resource type, and three actions with their planes
expect:manual
- id:validate-policy
title:Validate the policy package offline
actor:operator
owner:flex-auth
requires:[read-manifest]
uses:[flexauth_home, example]
command:cd {{flexauth_home}} && go run ./cmd/flex-auth validate -kind policy -file {{example}}/policy_package.md
idempotent:idempotent
verify:
done_when:validate exits 0
command:cd {{flexauth_home}} && go run ./cmd/flex-auth validate -kind policy -file {{example}}/policy_package.md
expect:exit-0
- id:load-registry
title:Load the registry snapshot offline
actor:operator
owner:flex-auth
requires:[validate-policy]
uses:[flexauth_home, example]
command:cd {{flexauth_home}} && go run ./cmd/flex-auth load-registry -file {{example}}/registry_snapshot.json
idempotent:idempotent
verify:
done_when:load-registry exits 0
command:cd {{flexauth_home}} && go run ./cmd/flex-auth load-registry -file {{example}}/registry_snapshot.json
expect:exit-0
- id:check-allow
title:A permitted request is allowed
actor:operator
owner:flex-auth
requires:[load-registry]
uses:[flexauth_home, example]
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_allow_rotate.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
idempotent:idempotent
verify:
done_when:The decision is allow with reason catalog_lane_policy_matched
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_allow_rotate.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
expect:output-contains
contains:allow catalog_lane_policy_matched
- id:check-wrong-tenant
title:The wrong tenant is denied
actor:operator
owner:flex-auth
requires:[load-registry]
uses:[flexauth_home, example]
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_wrong_tenant.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
idempotent:idempotent
verify:
done_when:The decision is deny with reason wrong_tenant
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_wrong_tenant.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
expect:output-contains
contains:deny wrong_tenant
- id:check-unknown-action
title:A verb that is not an action is denied
actor:operator
owner:flex-auth
requires:[load-registry]
uses:[flexauth_home, example]
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_revoke_not_an_action.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
idempotent:idempotent
verify:
done_when:The decision is deny with reason unknown_action
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_revoke_not_an_action.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
expect:output-contains
contains:deny unknown_action
- id:check-unknown-subject
title:An unknown subject is denied
actor:operator
owner:flex-auth
requires:[load-registry]
uses:[flexauth_home, example]
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_unknown_subject.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
idempotent:idempotent
verify:
done_when:The decision is deny with reason unknown_subject
command:|
cd {{flexauth_home}} && go run ./cmd/flex-auth check -registry {{example}}/registry_snapshot.json -policy {{example}}/policy_package.md -request {{example}}/check_request_deny_unknown_subject.json | python3 -c "import sys,json;d=json.load(sys.stdin);print(d['effect'],d.get('reason'))"
expect:output-contains
contains:deny unknown_subject
gates:
- id:policy-sound
title:The policy evaluates as the vocabulary promises
goal:correct-authorization-decisions
blocking:true
downstream_risk:A policy that allows what it should deny, or denies for the wrong reason, makes the live caller tests meaningless.
checks:
- done_when:The policy package validates and the registry loads
command:cd {{flexauth_home}} && go run ./cmd/flex-auth validate -kind policy -file {{example}}/policy_package.md && go run ./cmd/flex-auth load-registry -file {{example}}/registry_snapshot.json
expect:exit-0
- done_when:One allow and three denials (wrong tenant, unknown action, unknown subject) each gave the expected decision and reason
expect:manual
- id:live
title:"Live: callers are authenticated"
goal:A live flex-auth pin accepts a short-lived token of the bound ServiceAccount and refuses every other caller before policy is evaluated.
requires:["gate:policy-sound"]
framing:
- A port-forward bypasses NetworkPolicy, so caller authentication is the only gate on this path.
- These steps use your own cluster access and mint short-lived tokens; auto-confirm never starts them.
steps:
- id:open-forward
title:Open a port-forward to the live pin
actor:operator
owner:flex-auth
auto_confirm:manual-only
uses:[pin_service, local_port]
description:"Run the command in a SECOND terminal and leave it running. A port-forward bypasses NetworkPolicy, so caller authentication is the only gate on this path."
description:The token is minted for one call, used, and never printed or stored. The decision may well be deny for this subject; what matters is that the call is authenticated (HTTP 200).
downstream_risk:A pin that accepts an unauthenticated or wrongly bound caller is not protecting the system it fronts.
checks:
- done_when:The bound ServiceAccount was accepted (200) and no credential (401), the wrong ServiceAccount (403) and the wrong audience (401) were each refused before policy
expect:manual
- id:own
title:Enforce it in your system
goal:Your own system enforces the decision it gets and fails closed.
requires:["gate:caller-auth-enforced"]
steps:
- id:enforce-in-your-system
title:Confirm your own system enforces the decision and fails closed
actor:system-owner
owner:the protected system's repo
auto_confirm:manual-only
description:"allow proceeds; deny blocks; redact and audit_only apply their obligations; an error or a missing decision fails closed; the decision id is stored with every deny, redaction, export and privileged action."
idempotent:idempotent
verify:
done_when:For your system, you have seen each of those behaviours in code or a test