feat(relay): gate local-only audit retention behind off-host shipping attestation#282
Closed
jeremi wants to merge 1 commit into
Closed
feat(relay): gate local-only audit retention behind off-host shipping attestation#282jeremi wants to merge 1 commit into
jeremi wants to merge 1 commit into
Conversation
… attestation A local rotating file audit sink caps retention, and an attacker with host access can destroy the audit trail. Add the deployment.evidence.audit_offhost_shipping attestation and the relay.audit.retention_local_only gate, which fires only for a local file sink without the attestation. Stdout and syslog sinks are exempt: stdout retention is the orchestrator's log pipeline's concern, and syslog forwarding is the syslog daemon's own surface. Bound at finding_warn under production and finding_error under evidence_grade; unbound under local/hosted_lab; waivable like the other audit posture gates. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Member
Author
|
Superseded by the integration meta-PR #292 — this branch is merged there unchanged (with cross-PR conflicts resolved once). Branch retained. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deployment.evidence.audit_offhost_shipping: bool(defaultfalse) toDeploymentEvidenceConfig: an operator attestation that audit records are shipped off-host (e.g. to a log collector or SIEM).relay.audit.retention_local_only, which fires when the audit sink is a local rotatingfilesink and the off-host shipping attestation isfalse. Rationale: a local rotating file sink caps retention, and an attacker with host access can destroy the audit trail; operators either ship logs off-host (and attest to it) or accept a posture finding.stdoutandsyslogsinks are exempt from this gate:stdoutretention is the orchestrator's log pipeline's concern, andsyslogforwarding is the syslog daemon's own surface. This exemption rationale is documented incrates/registry-relay/docs/configuration.md(Findings catalog section) and as an inline comment on the gate definition.localandhosted_labunbound (None),production→FindingWarn,evidence_grade→FindingError. Both are waivable finding tiers (noStartupFail/ReadinessFailbehavior change).Security review notes
This changes deployment posture, not authentication/authorization/signing:
fileaudit sink will start seeing afinding_warn-tier finding (relay.audit.retention_local_only) unless they either declaredeployment.evidence.audit_offhost_shipping: trueor add an explicit, dated waiver.evidence_gradedeployments using a localfilesink without the attestation will see afinding_error-tier finding. This does not change startup or readiness behavior;finding_erroris a posture-only tier, same as the existingrelay.audit.best_effortandrelay.auth.api_key_no_rotation_evidencegates.localandhosted_labprofiles (the gate is unbound there), and the new evidence flag defaults tofalse(fail-closed: absence of the attestation keeps the gate active), consistent with the existingingress_rate_limit/api_key_rotationevidence flags.relay.audit.best_effort), with the standard mandatory-reason, mandatory-expiry waiver mechanism.Test coverage
Unit tests in
crates/registry-relay/src/deployment/mod.rs:audit_retention_local_only_binds_production_and_evidence_only: unbound underlocal/hosted_lab,FindingWarnunderproduction,FindingErrorunderevidence_grade, silent when the fact is false.audit_retention_local_only_is_waivable: a waiver suppresses the finding and reportswaived.Integration tests in
crates/registry-relay/tests/deployment_profile_gates.rs:file_sink_without_attestation_warns_under_production: file sink + no attestation underproductionproduces the finding atwarn.file_sink_with_attestation_is_clean_under_production: same config withaudit_offhost_shipping: trueis clean.stdout_and_syslog_sinks_are_exempt_without_attestation: bothstdoutandsyslogsinks, without attestation, are clean.file_sink_without_attestation_errors_under_evidence_grade_and_is_waivable:evidence_gradewith file sink + no attestation yields the error-tier finding, and a waiver for it is honored.Verification
cargo fmt --check— passcargo check --locked --workspace --all-targets— passcargo clippy -p registry-relay --all-targets -- -D warnings— passcargo test --locked -p registry-relay— pass (all suites green; no HTTP endpoint changes, so no OpenAPI regeneration needed)npm run checkindocs/sitewas not run:node_modulesis not installed in this worktree and a full install was out of scope for this change; the only docs edit is the crate-local source doc (crates/registry-relay/docs/configuration.md) thatnpm run generatesyncs into the site.Deviations from spec
The task referenced
docs/site/src/content/docs/products/registry-relay/configuration.mdxas a file to hand-edit. That path is generated (viadocs/site/src/data/repo-docs.yaml's sync ofcrates/registry-relay/docs/configuration.md, run bynpm run generate) and is gitignored (docs/site/.gitignoreexcludessrc/content/docs/products/), so it does not exist as a source file in this repo and must never be hand-edited. This PR instead edits the actual source,crates/registry-relay/docs/configuration.md, which is what gets synced into that generated page.