Router Authority Enforcement Runbook
This runbook documents operational semantics for gateway-enforced authorization and signed user-identity propagation in Stella Router deployments.
Scope
- Router gateway as centralized policy decision point (PDP).
- Authority-driven effective claims.
- Signed identity envelope propagation to webservices using Router trust mode.
Required Configuration
Gateway-side:
Gateway__Auth__Authority__IssuerGateway__Auth__Authority__RequireHttpsMetadataRouter__OnMissingAuthorization
Service-side (per service Router section):
Router__EnabledRouter__AuthorizationTrustModeRouter__IdentityEnvelopeSigningKeyRouter__IdentityEnvelopeClockSkewSecondsRouter__Frame__Envelope__ActiveKeyIdRouter__Frame__Envelope__Keys__<key-id>
Gateway-side frame protection uses the same Router__Frame__Envelope__* key map. The canonical compose maps primary to STELLAOPS_IDENTITY_ENVELOPE_SIGNING_KEY on the gateway and every Router microservice. A partially configured frame-envelope section fails startup; an omitted section retains bootstrap verifier-disabled mode and is not an acceptable production posture.
Identity transport headers emitted by gateway:
X-StellaOps-Identity-EnvelopeX-StellaOps-Identity-Envelope-SignatureX-StellaOps-Identity-Envelope-AlgX-StellaOps-Identity-Envelope-KidX-StellaOps-Identity-Envelope-IatX-StellaOps-Identity-Envelope-Exp
Trust Modes
ServiceEnforced
- Service enforces its local policies.
- Gateway envelope is optional for service authorization.
Hybrid
- Service accepts gateway envelope when present.
- Service can fall back to local checks for compatibility.
GatewayEnforced
- Service requires valid signed gateway envelope.
- Missing/invalid envelope is fail-closed (
403/401based on service policy). - Use for centralized authorization rollout after verification.
Key Rotation Procedure
- Drain Router messaging queues before first enabling frame protection; unsigned in-flight frames are rejected/dead-lettered after the verifier activates.
- Rotate Authority/gateway signing material using the Authority key-rotation SOP:
docs/modules/authority/operations/key-rotation.md
- Add the new frame key id/material to every gateway and service verifier map.
- Restart services, verify the new key is accepted, then flip
Router__Frame__Envelope__ActiveKeyIdon frame producers. - Restart gateway and services in wave order and remove the previous key only after the old-frame replay window and queue leases have expired.
- Validate with targeted tests, route smoke, and zero unexpected
router_frame_envelope_verify_failed_total{reason}growth.
Authority Outage and Fallback
If Authority is degraded/unreachable:
- Keep gateway running with last known effective claim cache.
- For critical service continuity, temporarily switch affected services:
Router__AuthorizationTrustMode=Hybrid
- If envelope verification is disrupted by key mismatch, switch to
ServiceEnforcedonly as emergency fallback. - Record incident window and restore target mode (
GatewayEnforcedorHybrid) after recovery.
Compose Toggle Examples
Global gateway mode:
$env:ROUTER_GATEWAY_CONFIG = "./router-gateway-local.json"
docker compose -f devops/compose/docker-compose.stella-ops.yml up -d
Emergency compatibility fallback (example service):
$env:SCANNER_ROUTER_ENABLED = "true"
$env:Router__AuthorizationTrustMode = "Hybrid"
docker compose -f devops/compose/docker-compose.stella-ops.yml up -d scanner-web
Verification Checklist
- Gateway route smoke has
500=0. - OpenAPI operations expose
x-stellaops-gateway-auth. - Envelope spoofing tests pass (
IdentityHeaderPolicyMiddlewareTests). - Authority refresh tests pass (
AuthorityClaimsRefreshServiceTests).
