approval-engine/deploy/approval-engine.yaml
tegwick 6d18f62a90 Set the approval store tenant to exact tenant:platform
Operator decision 5ed3fb35-eca9-413a-82b9-95171ba85bf6 accepts tenant:platform
as the platform management, administration and services tenant, with no alias
to platform or tenant:coulomb and no implicit cross-tenant grant. This closes
the collision recorded in 5c87ba8, where the manifest served --tenant platform
while the requested registrations issued tenant:coulomb.

The store tenant is now exactly tenant:platform in the manifest, the CLI
default, and the Engine default, and the requested client registrations ask for
the same spelling. Exact JWT/store equality is retained: no mapping table, no
normalisation, no prefix handling.

Moving the defaults rather than only the manifest is deliberate. A default of
platform under a sanctioned value of tenant:platform is a trap, because a serve
that omits --tenant would come up healthy and then refuse every authenticated
call -- the exact failure this decision exists to prevent.

That default change broke ten tests whose identity fixtures hard-coded
platform. This is the hazard flex-auth reported as FLEX-DEC-2026-008: fixtures
that all carry one tenant prove nothing about the tenant field. Fixtures are
aligned to the exact spelling, and the field is now varied rather than merely
present. test_near_miss_tenant_spellings_are_forbidden refuses platform,
tenant:coulomb, case variants, whitespace variants and empty against a
tenant:platform store; test_exact_sanctioned_tenant_is_admitted pins the other
half so a reject-everything bug cannot pass it. 111 tests pass.

Also records the credential-independent half of the GLAS-WP-0015 image request:
the image builds non-root uid 10001 off the pinned base, carries schema v3 and
the new tenant default, migrates and verifies a fresh store to schema_version 3
with integrity ok, and refuses production without a persistent database or
authenticated audit delivery. No scan was run -- no scanner is installed here --
and no release digest exists, so T01 and T03 both stay open.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PM5HnEAhokxdfcPqBNpT7D

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 715850@bnt-lap001
Assistant-Session: eb557e93-7cb1-45d0-9e57-7d15b3edc60e
2026-09-06 22:33:50 +02:00

118 lines
3.4 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: approval-engine
labels:
kubernetes.io/metadata.name: approval-engine
railiance.io/workload-class: platform
---
apiVersion: v1
kind: Service
metadata:
name: approval-engine
namespace: approval-engine
spec:
selector:
app.kubernetes.io/name: approval-engine
ports:
- {name: http, port: 8080, targetPort: http, protocol: TCP}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: approval-engine
namespace: approval-engine
spec:
serviceName: approval-engine
replicas: 1
podManagementPolicy: OrderedReady
updateStrategy: {type: OnDelete}
selector:
matchLabels:
app.kubernetes.io/name: approval-engine
template:
metadata:
labels:
app.kubernetes.io/name: approval-engine
spec:
securityContext:
runAsNonRoot: true
runAsUser: 10001
fsGroup: 10001
seccompProfile: {type: RuntimeDefault}
initContainers:
- name: migrate
image: forgejo.coulomb.social/coulomb/approval-engine@sha256:REPLACE_WITH_RELEASE_DIGEST
args: ["migrate", "--db", "/data/approvals.sqlite"]
securityContext:
allowPrivilegeEscalation: false
capabilities: {drop: ["ALL"]}
readOnlyRootFilesystem: true
volumeMounts:
- {name: data, mountPath: /data}
- {name: tmp, mountPath: /tmp}
containers:
- name: approval-engine
image: forgejo.coulomb.social/coulomb/approval-engine@sha256:REPLACE_WITH_RELEASE_DIGEST
args:
- serve
- --production
- --db
- /data/approvals.sqlite
- --host
- 0.0.0.0
- --port
- "8080"
- --tenant
- tenant:platform
- --jwt-issuer
- https://kc.coulomb.social
- --jwt-audience
- approval-engine
- --jwks-url
- http://keycape.sso.svc.cluster.local:8080/jwks
- --audit-url
- http://audit-core.audit-core.svc.cluster.local:8080
- --audit-token-file
- /var/run/secrets/approval-engine/audit-token
ports:
- {name: http, containerPort: 8080}
resources:
requests: {cpu: 50m, memory: 64Mi}
limits: {cpu: 500m, memory: 256Mi}
securityContext:
allowPrivilegeEscalation: false
capabilities: {drop: ["ALL"]}
readOnlyRootFilesystem: true
startupProbe:
httpGet: {path: /healthz, port: http}
periodSeconds: 3
failureThreshold: 20
readinessProbe:
httpGet: {path: /readyz, port: http}
periodSeconds: 10
timeoutSeconds: 2
livenessProbe:
httpGet: {path: /healthz, port: http}
periodSeconds: 20
timeoutSeconds: 2
volumeMounts:
- {name: data, mountPath: /data}
- {name: tmp, mountPath: /tmp}
- name: audit-token
mountPath: /var/run/secrets/approval-engine
readOnly: true
volumes:
- name: tmp
emptyDir: {}
- name: audit-token
secret:
secretName: approval-engine-audit
defaultMode: 0440
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests: {storage: 1Gi}