Files
nvke/controller/docs/credential-audit.md
Tjark Rasche 62d22e7dbb feat(qualification): add credential rotation evidence collector (#1380)
* feat(qualification): add credential rotation demo and evidence collector

Redistribute the reviewed five-scenario collector and all evidence fixes from cff67ff5, 2bc9fd9c, 65a1b2d1, 568b1104, 2fafa32c and d9542b83 onto the finished native guides layer. Preserve fresh matching metrics, scheduled due-subset outcomes, required check aggregation, the bounded in-flight observer join and single-operation manual audit contract.

Reference the separate immutable #1050 runbook rather than resubmitting it. Document inherited qualified-build, Kubernetes 1.34+, loaded-config/process-start and external-writer prerequisites. Offline validation does not qualify a deployment.

Closes #1348

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): accept an alert resolution received after the mutation started

The alert lane required the resolved receipt at or after the
collector-observed completion. RenewK8sCertsV2 renews control planes one
at a time, so when the alert node renews before the last node, its
inspection can resolve the alert while later nodes are still renewing.
Alertmanager then delivers the single resolved notification before
completion, nothing re-fires, and the lane failed with
notification_delivery_incomplete after the forced renewal had consumed
the warning-window precondition.

Accept a resolved receipt at or after mutation_at, keep the receipt-ID
pairing, require no firing receipt between that resolution and
completion, and keep the final not-firing check. A test covers a
resolution between mutation and completion and a re-fire after it.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): accept per-step T1 operation IDs and reject duplicate events

The manual-T1 collector required every row to carry the single configured
manual_operation, which removed the only way to keep repeated identical
steps distinct: event_id hashes every field except the timestamp, so a
repeated failed renew on one node collapsed into one row on export, and
the collector also accepted duplicate event_ids.

Accept manual_operation itself or with a per-step suffix
/<action>-<n>, as the audit guide recommends, and reject a duplicate
event_id with audit_event_duplicate. Revert the doc waivers in the audit
guide and the credential lifecycle page that told operators to drop the
suffix. Both pages and the demo README now also state that --cluster
must be the exact kube-system namespace UID, which the collector already
required. Links from those navigated pages to the demo README are
absolute, like the other links to files outside the navigation. A test
covers a repeated identical step, a duplicate event and a foreign run.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): report the collector's reason code and release a rejected output

main reserved --output with O_EXCL and then reported every escaped error
as one generic line. A config rejected before run's own error handling,
or an aggregate error, lost its fixed reason code, and the empty 0600
file blocked a rerun to the same path with the same message.

Print the CheckError code (or collector_input_or_protocol_error for other
exceptions) to stderr, and remove the reserved file when nothing was
serialized. A file that already existed is still never touched. A test
reuses the path after a rejected config.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): fail when two control planes report the same node leaf

T1 attributes whatever the configured ssh destination returns to that
node, and validation only checks that ssh is non-empty. A copy-pasted
destination recorded cp-2's certificates as cp-3's and could pass. Every
certificate inventory now fails with node_certificate_attribution_ambiguous
when two control planes report the same apiserver, etcd-server or
etcd-peer fingerprint; shared CAs are unaffected. The existing manual
inventory test now gives each node its own leaves, and new tests cover a
duplicated leaf and a duplicated ssh destination.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): require the scheduled cycle to start after traffic started

The scheduled lane read the prior cycle ID before the baseline metrics
wait, and traffic started only afterwards, while scheduled() accepted any
new scheduler cycle. A cycle accepted in that window was credited with
continuous API traffic it never observed. Require the selected cycle's
certificateRenewal.startedAt to be at or after traffic start, and stop at
once with cycle_started_before_traffic otherwise. A test covers a cycle
that appears during the baseline phase.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): keep polling a partially written T1 completion marker

The documented cat > t1-completed.json <<'EOF' creates the marker before
writing it, so a two-second poll could read an empty or partial file.
read_json then raised ValueError, which wait_for does not retry, and the
run failed after the manual maintenance had finished. Map empty or
unparseable marker content to manual_completion_not_observed while
waiting, so polling continues until the deadline. A test starts with an
empty marker that becomes partial and then valid.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): validate kubelet serving inputs before any T2 mutation

T2 config validation never checked kubelet_ca_file or each node's
kubelet_address. Both are first read in serving_certificates, after the
production renewal or rotation, so a missing key failed as
collector_input_or_protocol_error only after the mutation ran. Require an
existing kubelet_ca_file and a kubelet_address for every node in T2
scenarios during validation; manual T1 still needs neither. The offline
config points kubelet_ca_file at an existing fixture file, and a test
covers each missing input without contacting the cluster.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): require one deployed build across passed T2 reports

The release index bound T2 reports only by checkout revision, cluster,
kube-system UID and profile, and never compared the observed
deployed_versions_before hashes. If the controller or agents were
redeployed between lanes and expected_versions was updated as the README
instructs, aggregate still passed scenarios that ran against different
builds. Require identical deployed-version sets across passed T2 reports;
manual T1 runs on another cluster and is excluded. A regression changes
only one version hash.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): require the firing alert receipt before the alert lane mutates

The collector accepts only the bundled receiver's nke.alert-receipt.v1
records and read them only after the forced renewal. Using the site's own
receiver, or starting the helper after the last firing notification,
failed the lane after the renewal had already consumed the warning-window
precondition. Before starting the renewal, require a matching firing
receipt in alert_receipts_file and fail with
firing_notification_not_received otherwise. A test with only a resolved
receipt fails before any mutation.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(qualification): state lane order, receiver, timeouts and T1 steps in the demo README

Review corrections to hack/rotation-demo/README.md:

- State the required T2 lane order (scheduled renewal before the forced
  and alert lanes) and the alert lane's staggered-expiry precondition
  before the first T2 command.
- The bundled alert receiver is required, and a matching firing receipt
  must already exist before the alert lane starts; describe the resolved
  receipt window after the collector change.
- Start the scheduled lane only when nextCertRenewalDue plus renewal and
  the next inspection fit inside timeout_seconds (at most eight hours).
- List openssl and base64 as node prerequisites and describe the
  kubectl config view --raw read of kubeconfigs under sudo.
- Show the one-time build before starting manual-t1 and the verify call
  separately, with a per-step operation ID.
- Add timeout_seconds, sized for the whole T1 runbook and post-checks, to
  the T1 configuration list.
- Link the in-tree site certificate renewal runbook instead of the pinned
  e76ea3db blob.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(operations): name the audit tool as the self-reported operator subject

The rotation-demo exception inserted before "Its operator subject is
self-reported" made "Its" read as the collector's. The exception now
follows that sentence, and the sentence says "The audit tool's operator
subject" explicitly.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* chore(qualification): ignore Python bytecode caches

Running the rotation demo's tests or the other hack/ Python scripts
outside the Makefile, which sets PYTHONDONTWRITEBYTECODE, leaves
__pycache__ directories behind. That bytecode is build output, and some
of it was nearly committed with the demo. Ignore it next to the other
per-checkout scratch and tool caches.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): stop waiting on a duplicate audit event

The T1 audit check runs inside wait_for, which retries every reason
outside its fatal set until the deadline. A duplicate event_id cannot
clear by waiting, because the guide forbids deleting ledger rows, so a
run with a duplicate polled for up to timeout_seconds, as long as eight
hours, before reporting audit_event_duplicate.

Add the reason to the fatal set. The new test fails with must not retry
when the reason is removed again.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(qualification): warn about an early scheduled cycle and redeploys in the demo README

The scheduled-renewal lane fails with cycle_started_before_traffic when
the scheduler accepts the cycle while the lane is still in its baseline
checks. That cycle has already renewed the due node, so the next one is
a no-op and the cluster cannot qualify until its certificates approach
expiry again. Tell operators to start the lane early enough that the
baseline checks finish before nextCertRenewalDue.

The release-index section also did not mention that passed T2 reports
must share the observed deployed versions, which aggregate enforces
with release_deployed_versions_mismatch.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(qualification): describe the rotation demo as a collector and name the NVKE controller

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): record an interrupted demo run as failed evidence

Ctrl-C raised KeyboardInterrupt past run and main, leaving an empty reserved
output file and losing the record that a workflow had started. run now
returns a failed report with reason interrupted, mutation_started and the
workflow hash.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(rotation-demo): require provenance and pin traffic to the approved cluster

Release aggregation now rejects reports without Boolean source cleanliness and passed reports without well-formed hashed deployed versions. Continuous API traffic pins the approved API server and checks the kube-system UID on every sample, so target drift fails independently of the outage budget.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(rotation-demo): accept zero audit counters at baseline

The controller creates every credential audit result series at zero and a
restart resets them, so a quiet site has no stored writes before the
mutation. The baseline now requires the stored series and no failure
increase only; positive stored evidence is required after the mutation. A
zero-series fixture covers both checks.

The README now shows the lanes in run order, keeps the alert node's leaves
between thresholdDays and warningDays with a different scheduled
candidate, and gates the scheduled lane on nextCertRenewalDue. The three
guides state the exact /<action>-<n> suffix form and its 1-99 bound.

Addresses review threads r4335395773, r4335396217, r4335396675,
r4335397034 and r4335397446.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(qualification): address rotation demo review findings

- N1: document that cwe_authorization_file holds "Bearer <token>" for the
  controller audience, is reread per request, and must stay valid until
  the lane ends.
- F3: release the reserved output only before writing starts, so an
  fsync failure keeps the written evidence.
- F4: time out a stalled alert webhook body.
- F5: compare deployed builds independent of node order.
- F11: require the node name as --node for demo-observed T1 rows in both
  guides.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(rotation-demo): address review comments on audit and metric checks

Compare the audit-write failure counter, including rate_limited, between
the baseline and the final sample instead of a trailing 10m window. Report
an absent CSR age series as csr_metric_missing, require cluster_name for
T2 lanes, drop the unreachable worker branch and the unrun PromQL sample
file, and run the offline tests from name-check so the merge gate runs them.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(rotation-demo): stop on past notification failures and pick receipts deterministically

Applies review suggestions: notification_order_invalid and notification_refired_before_completion describe past events that polling cannot clear, so wait_for stops on them; alert_receipts checks receipts in sorted order and keeps the first specific reason, so one invalid receipt no longer hides a valid one depending on set order; public-certificates.sh accepts only the control-plane role, the only one demo.py sends.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(rotation-demo): address review findings on receipts, audit resets and docs

Report a specific receipt failure only once no fired receipt still awaits
its resolution, fail the lane on any audit failure counter reset since the
baseline, document that a controller restart during a lane fails it, require
Temporal CLI 1.1.1, anchor the recovery link, and label the name-check job as
also running the rotation-demo tests.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

---------

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>
2026-10-27 18:29:08 +01:00

18 KiB

Credential lifecycle audit evidence

NVKE records OSS-alpha T2 credential lifecycle observations in the controller's PostgreSQL credential_audit_events table. Operators record manual T1 procedures with the same versioned schema using credential-audit. Neither path contains private keys, encryption keys, kubeconfigs, certificate PEM, command output, Secret names, or raw upstream error messages.

Schema: nke.credential-audit.v1

Field Contract
schema_version nke.credential-audit.v1
event_id SHA-256 semantic observation ID; timestamp excluded
timestamp Observation time in UTC, not certificate validity or mutation start time
action check, approve, renew, rotate, verify
credential_type kubeadm_leaf_bundle, kubelet_serving, etcd_encryption_key
plane t1 or t2
target Managed cluster_id/optional node_id UUIDs, or external T1 cluster_hash/optional node_hash
actor kind: automatic, operator_unattributed, or operator_reported; the last includes a subject_hash
outcome success, failure, no_op
reason_code Fixed codes listed below
phase Optional fixed lifecycle checkpoint; no free-form diagnostics
correlation operation_hash; Temporal observations also include workflow_hash, run_hash, activity_hash, and attempt
certificate_sha256 Optional public certificate DER SHA-256 fingerprints; absent for encryption keys

Reason codes are accepted, completed, unchanged, operation_failed, identity_not_approved, approval_update_failed, health_check_failed, verified, observed, observation_unavailable, and node_retired. Phases are preflight, renew-node, postflight, prepare, add_secondary, promote_primary, rewrite, remove_old_keys, and finalize. A reason describes the audited observation, not a replacement for the workflow or cluster's durable state.

Identifiers outside managed UUIDs are hashed as SHA-256 over the UTF-8 encoding of <domain>, a NUL byte, and the identifier. Domains are cluster, node, actor, operation, workflow, run, and activity. Hashing supports joining against known identifiers and prevents accidental inclusion of credential-like caller input. It does not anonymize predictable names against dictionary attacks. No caller-controlled field or raw error is used as a Prometheus label.

Constructors and sinks validate the allowlist. Fingerprints represent public certificate bytes only; encryption-key bytes and key fingerprints are excluded. The manual tool rejects mixed PEM bundles and private-key PEM blocks.

Recorded observations

  • T2 renewal acceptance and health checks, terminal node renewal results, postflight verification, aggregate renewal/no-op completion, and failure cleanup attempts are recorded from activities. Known unsuccessful legacy process exits are recorded before retry, including when a later attempt succeeds. Cleanup that observes a matching typed terminal result records that node's actual renewed, unchanged, or failed outcome independently of the workflow's result. Transport errors, cancellation, legacy receipt-only resolution, and an empty, unknown or outcome-less typed status do not by themselves establish a node renewal outcome and record no node renewal event. The cycle failure event is recorded only after the failure is persisted for the owning cycle. The retained V1 fallback is audited only from an explicit RENEWAL_OUTCOME marker (renewed or unchanged); markerless or unrecognized successful output records no node renewal event.

  • T2 etcd rotation acceptance, phase entry, completion, and failure observations correlate with the owning workflow. A phase check/accepted means that the checkpoint was entered; it does not prove that the phase's node mutations have completed. A final rotate/success follows successful completion persistence. Retiring a permanently lost control-plane node from a failed rotation records rotate/success with reason node_retired, the node and the failed phase; refusals record rotate/failure and repeats rotate/no_op.

  • The kubelet-serving CSR controller records these action/outcome/reason observations for CSRs whose requestor resolves to a managed node:

    Observation Meaning
    check/success/verified the CSR matches the managed node's identity
    check/no_op/identity_not_approved a CSR was rejected and not approved; this is how a rejected identity appears, not as failure. Recorded at most once per node per UTC hour
    approve/success/completed the approval was written to the CSR
    approve/failure/approval_update_failed writing the approval failed; the CSR is retried
    verify/success/observed the CSR carries NVKE's approval, has no Failed condition, and the leaf (first) certificate carries the request's public key; recorded with only that leaf's public fingerprint
    verify/failure/observation_unavailable the certificate on an NVKE-approved CSR could not be parsed or does not carry the request's public key

    To find rejected identities, filter on reason_code = 'identity_not_approved'; filtering on outcome = 'failure' misses them. CSRs from other requestors are logged at debug level but never written to the ledger. verify/success/observed proves only that the CSR has a public certificate for the request's key, not that the kubelet installed it. It does not authenticate the issuer: a tenant cluster-admin can write CSR status, including the approval condition and the certificate. Because a tenant cluster-admin can still create CSRs naming a managed node, CSR-derived writes are bounded per cluster and node: at most 12 events within any hour, counted in the ledger itself so a controller restart does not reset the bound. Rejections are recorded at most once per node per UTC hour: all rejected CSRs for that node in that hour share one event, which uses one slot of the bound, so repeated rejections cannot crowd out approvals. A valid CSR records three events, or four if an approval write fails and is retried, so the bound admits about four valid CSRs per node per hour, or three if their approvals are retried. Events beyond it are dropped and counted as nvke_controller_credential_audit_writes_total{result="rate_limited"}. A non-zero rate_limited means CSR-derived evidence for some node and hour, including approvals and issued certificates, may be missing from the ledger. Investigate it. The metric carries no node label: find nodes with 12 kubelet_serving CSR events within one hour in the ledger (any approve or verify event, and check events with reason_code verified or identity_not_approved), then reconcile that node's CSRs in the tenant cluster with the ledger.

  • Independent background certificate inspections record a control-plane leaf bundle check and a kubelet-serving check with available public fingerprints. These observations have no renewal workflow attribution. An observation that repeats the previous inspection's outcome, reason and fingerprints for the same node and credential is not recorded again once the previous observation was recorded, so an unchanged node adds no rows. That includes a probe that keeps failing the same way, such as a node agent without the inspection RPC: only its first failure is recorded. If the ledger write for an inspection fails, the next inspection is recorded even when unchanged. Changes, including a change of failure reason, are recorded. A failed probe emits unavailable evidence without claiming retained older fingerprints are fresh; a successful read does not prove renewal occurred or that a certificate is unexpired.

  • T1 events are explicit operator observations accompanying the site-management certificate renewal runbook. NVKE does not automatically run, approve, or renew management-plane credentials.

Effects occur in activities and reconcilers, never workflow replay code. Activity retry attempts remain separate observations because attempt contributes to event_id; repeated writes of an identical observation preserve the first row through ON CONFLICT DO NOTHING. Distinct outcome, phase, fingerprint or execution correlation produces a different ID. Replaying workflow history does not execute completed activities or emit their audit observations again. An activity that actually runs again after reset can emit another observation with a new run hash.

Actor attribution

CSR approval identifies the automatic NVKE controller. Renewal workflows matching the scheduler's exact due-cycle ID convention are classified as automatic; this is a source convention, not authenticated human attribution. A caller with permission to start Temporal workflows can choose that ID. Other renewal and rotation workflow invocations use operator_unattributed: direct Temporal invocation does not convey an authenticated operator subject to these activities. Correlate the run with the site's Temporal access logs when human attribution is required. No operator subject is inferred from a worker process identity or supplied workflow ID text.

The T1 tool hashes the operator subject provided with --actor and records operator_reported. This is self-report. Bind exported evidence to the site's operator authentication and change approval records; the tool itself does not verify them. An approve observation records a stated approval, not enforcement of the operator's permissions.

Sink and failure behavior

Committed T2 records are durable to the guarantees of the site's PostgreSQL and backups. They are retained independently of cluster deletion. There is no external exporter, delivery acknowledgement from a log collector, or automatic pruning. Structured controller logs report sink failure with a fixed code; they are not the durable audit sink.

Writes occur after lifecycle state changes and are bounded best effort with a separate two-second context, including during cancellation cleanup. Sink failure does not change a successful operation result, advance a failed operation's schedule, or release/reacquire its mutation lock. A database outage or process crash between state/mutation and audit insertion can leave an evidence gap. CSR approval and PostgreSQL insertion are separate transactions. Failed writes are not queued for background retry, and a successfully completed activity is not retried solely for missing audit evidence. Do not infer complete coverage or exactly-once delivery from this ledger.

nvke_controller_credential_audit_writes_total{result="stored"} counts successful write attempts, including duplicate inserts. result="sink_failed" counts sink failure; result="invalid_event" identifies rejected construction; result="rate_limited" counts CSR-derived events dropped by the per-node bound. All three mean that ledger evidence is missing. A useful site alert expression is:

sum(increase(nvke_controller_credential_audit_writes_total{result=~"sink_failed|invalid_event|rate_limited"}[10m])) > 0

When it fires for sink_failed or invalid_event, check controller database access, migration availability, and recent restarts. For rate_limited, find the node that reached the CSR bound, as described above. Reconcile workflow histories, cluster conditions and explicit operator evidence for the affected interval. Do not replay mutations merely to manufacture missing events. Each result series exists at zero from process start, so failures after the first scrape of a process are visible to increase(). A burst between process start and the first scrape, or a controller restart in the middle of a burst, can still be missed, as can controller or scrape outages; reconcile that interval as above and use the site's controller and scrape availability alerts.

Manual T1 evidence

Build the tool into a new private directory before entering the maintenance window. mktemp -d creates a directory only the current user can access, so no other user can pre-create the binary or the evidence file. The chain stops if the directory or the build fails. Reuse $evidence_dir for later observations in the same shell:

cd controller
evidence_dir="$(mktemp -d)" &&
  go build -o "$evidence_dir/credential-audit" ./cmd/credential-audit

Record each observation only after you performed that step. For example, after the pre-renewal checks of the first node passed:

"$evidence_dir/credential-audit" \
  --plane t1 --credential kubeadm_leaf_bundle --action check \
  --cluster example-management-cluster --node example-control-plane-1 \
  --operation example-maintenance-run/check-1 --actor example-operator \
  --outcome success --reason verified >> "$evidence_dir/credential-evidence.jsonl"

Use a stable run identifier with a per-step suffix and emit an observation after each check, operator approval, renewal, and verification. Use --outcome failure --reason operation_failed when a step fails, and --outcome no_op --reason unchanged when inspection proves there is no change. Use --action approve --outcome success --reason accepted to record a separate operator approval. Optional --timestamp accepts RFC3339 for recording an observed step time. Optional --phase selects a fixed checkpoint.

event_id excludes the timestamp so that a retried write of the same observation deduplicates. Two observations with identical flags, apart from --timestamp, therefore get the same event_id, and export deduplication merges them. Give each step its own --operation suffix (for example example-maintenance-run/renew-2) whenever any step, including a renewal or approval, is repeated with otherwise unchanged fields.

When the rotation demo observes T1 maintenance, its collector also requires --cluster to be the exact kube-system namespace UID of the site-management cluster (the example above uses a placeholder name), --node to be the configured node name (not --node-id), and --operation to be its configured manual_operation or that value with a per-step suffix /<action>-<n>, for example example-maintenance-run/renew-2, where <action> is check, approve, renew, rotate or verify and <n> is 1 through 99 without leading zeros. Rows with a different cluster or operation fail with manual_audit_target_or_run_mismatch. A row recorded with --node-id or a different node name does not count toward that node, and the run fails with per_node_audit_coverage_incomplete. Keep the original audit records; do not delete rows or repeat maintenance to manufacture matching evidence.

For public certificate evidence, add --certificate /path/to/public-certificate.pem to check and verify observations. Maximum input is 1 MiB and 32 certificates. Take public certificate-only copies without exporting private keys or kubeconfig contents. Record before/after fingerprints with the runbook's health checks and post-renewal verification; a changed fingerprint alone does not prove availability or CA stability.

--cluster-id and --node-id accept managed UUIDs instead of hashed external identifiers. Stdout is one JSON line; schema/input/output failure exits nonzero. The tool neither writes PostgreSQL nor contacts a site. Secure, retain and export the JSONL alongside the sanitized maintenance evidence. Shell redirection alone does not provide durable storage, access controls, immutable evidence or delivery acknowledgement. Detect and handle tool errors before marking evidence complete.

Export and retention

Use a read-only database role to select/export the JSON events. For example, with the site's already-configured PostgreSQL client connection:

SELECT observed_at, recorded_at, event
FROM credential_audit_events
WHERE event #>> '{target,cluster_id}' = '00000000-0000-0000-0000-000000000001'
ORDER BY observed_at, event_id;

COPY (SELECT event::text FROM credential_audit_events
      ORDER BY observed_at, event_id) TO STDOUT;

Export into the site's access-controlled evidence store with transport integrity and backup/retention policies. Deduplicate combined exports by event_id; do not count raw rows from repeated exports as distinct operations. Do not export cluster records, Temporal payloads or Kubernetes Secret objects as audit evidence. Those stores can contain private material even though the audit schema does not.

Set a retention interval covering Temporal workflow retention, incident response, release qualification, and the site's evidence requirements. There is no default expiration. Unchanged inspections, repeated identical inspection failures and CSR churn are bounded as described above, so growth follows credential changes, new failures and operations; still monitor table size. Verify exported records and backups before any operator-controlled deletion, and keep unresolved operation/recovery evidence. Pruning rows removes the deduplication record too; a delayed repeated write can then reappear. This alpha ledger is not immutable against a database administrator and has no tamper-evident signing chain.

Qualification

Unit tests exercise allowlist validation, public certificate parsing, stable event IDs, ledger conflict handling, activity correlation, operator schema compatibility, and sink failures without changing renewal/CSR results. Qualify PostgreSQL migration/export, real Temporal activity retry/reset behavior, site access controls and retention, and event coverage during live T1/T2 procedures before claiming release evidence. No live cluster run is implied by the unit tests.