Prepare receipt-bound audit E2 third attempt

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a02991-be07-7bb3-8b6d-e9701b5621de
This commit is contained in:
tegwick 2026-08-22 23:23:48 +02:00
parent 0525e632d7
commit 96d6781036
12 changed files with 440 additions and 27 deletions

View file

@ -0,0 +1,113 @@
# WH-ENG-20260822-AUDIT-E2-03 — attended invocation
This package is proposed for `22:00Z``22:15Z`; projection closes at `22:03Z`.
Do nothing live until the engagement and the exact WP-0025 contract are
approved and audit-core has acknowledged them.
Runtime value-safe artifacts are written beneath
`/tmp/WH-ENG-20260822-AUDIT-E2-03/`:
- `broker.json`
- `projection.json`
- `runner-report.json`
- `cleanup.json`
- `final-report.json`
The platform contract is
`/home/worsch/railiance-platform/docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json`.
## Broker gate, projection, and admission
From `railiance-platform`, after approval and before the window:
```bash
python3 scripts/wp0025-broker-readiness.py approve \
--contract docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json \
--consumer-root /home/worsch/whitehat-security \
--reviewer whitehat-owner \
--receipt-out /tmp/WH-ENG-20260822-AUDIT-E2-03/broker.json
python3 scripts/custody-projection.py preflight \
--contract docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json
```
At or after `22:00Z`, no later than `22:03Z`:
```bash
python3 scripts/custody-projection.py project \
--contract docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json \
--confirm WH-ENG-20260822-AUDIT-E2-03:attended \
--receipt-out /tmp/WH-ENG-20260822-AUDIT-E2-03/projection.json
```
From `whitehat-security`, admit before applying the runner:
```bash
PYTHONPATH=src python3 -m whitehat_security.cli admit-plane \
engagements/2026-08-22-audit-core-e2-03.json \
targets/audit-core-e2.json \
--receipt /tmp/WH-ENG-20260822-AUDIT-E2-03/projection.json \
--contract /home/worsch/railiance-platform/docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json \
--broker-receipt /tmp/WH-ENG-20260822-AUDIT-E2-03/broker.json
```
## Runner
Only after admission succeeds:
```bash
ssh -o BatchMode=yes railiance01 kubectl apply -f - \
< engagements/runtime/whitehat-e2-audit-20260822-03.yaml
ssh -o BatchMode=yes railiance01 kubectl -n whitehat wait \
--for=condition=Ready pod/whitehat-e2-audit-03 --timeout=60s
```
Stream `runners/audit_core_e2.py` to `python3 -` inside that pod with these
exact arguments:
```text
--base-url http://audit-core.audit-core.svc.cluster.local:8080
--engagement-id WH-ENG-20260822-AUDIT-E2-03
--authorization-id operator-session-2026-08-22-e2-03-approval
--target-revision sha256:c2fe39a0185b99be3fc0cb14d2de69772b8e66e20490097c9d11d90cc39719a6
--token-a-file /var/run/secrets/whitehat/token-a
--token-b-file /var/run/secrets/whitehat/token-b
--tenant-a tenant:trial:whitehat-a-20260822-03
--tenant-b tenant:trial:whitehat-b-20260822-03
--event-a whitehat-e2-event-a-20260822-03
--event-b whitehat-e2-event-b-20260822-03
--absent-event whitehat-e2-absent-20260822-03
--forged-event whitehat-e2-forged-b-20260822-03
--correlation whitehat-e2-correlation-20260822-03
--occurred-at 2026-08-22T22:00:00Z
--rate 10 --max-requests 30 --abort-p95-ms 500
```
The runner output is the sanitized `runner-report.json`. Delete the runner
immediately after execution, whether it passes, finds, or aborts.
## Cleanup and report finalization
From `railiance-platform`, before `22:15Z`:
```bash
python3 scripts/custody-projection.py cleanup \
--contract docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json \
--receipt /tmp/WH-ENG-20260822-AUDIT-E2-03/projection.json \
--confirm WH-ENG-20260822-AUDIT-E2-03:cleanup \
--receipt-out /tmp/WH-ENG-20260822-AUDIT-E2-03/cleanup.json
```
From `whitehat-security`, bind the report to the cleanup receipt and deliver it:
```bash
PYTHONPATH=src python3 -m whitehat_security.cli finalize-report \
/tmp/WH-ENG-20260822-AUDIT-E2-03/runner-report.json \
--contract /home/worsch/railiance-platform/docs/WH-ENG-20260822-AUDIT-E2-03-custody-contract.json \
--receipt /tmp/WH-ENG-20260822-AUDIT-E2-03/projection.json \
--cleanup-receipt /tmp/WH-ENG-20260822-AUDIT-E2-03/cleanup.json \
--output /tmp/WH-ENG-20260822-AUDIT-E2-03/final-report.json
PYTHONPATH=src python3 -m whitehat_security.cli deliver \
/tmp/WH-ENG-20260822-AUDIT-E2-03/final-report.json --outbox outbox
```

View file

@ -0,0 +1,51 @@
# CONTRACT ONLY. Do not apply until WP-0025 projection and admit-plane succeed.
apiVersion: v1
kind: Pod
metadata:
name: whitehat-e2-audit-03
namespace: whitehat
labels:
app.kubernetes.io/name: whitehat-security
app.kubernetes.io/component: whitehat-probe
whitehat.security/plane: "true"
whitehat.security/target: audit-core
whitehat.security/engagement: WH-ENG-20260822-AUDIT-E2-03
spec:
serviceAccountName: whitehat-runner
automountServiceAccountToken: false
activeDeadlineSeconds: 900
restartPolicy: Never
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: probe
image: forgejo.coulomb.social/coulomb/audit-core@sha256:c2fe39a0185b99be3fc0cb14d2de69772b8e66e20490097c9d11d90cc39719a6
imagePullPolicy: IfNotPresent
command: ["sleep", "900"]
resources:
requests: {cpu: 5m, memory: 16Mi}
limits: {cpu: 50m, memory: 64Mi}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
readOnlyRootFilesystem: true
volumeMounts:
- name: credentials
mountPath: /var/run/secrets/whitehat
readOnly: true
volumes:
- name: credentials
secret:
secretName: whitehat-e2-audit-credentials-03
defaultMode: 0440
items:
- key: token-a
path: token-a
- key: token-b
path: token-b