[P0] F06: Implement the protected tamper-evident audit trail #11

Open
opened 2026-10-21 20:29:24 +02:00 by amiryahaya · 0 comments
Owner

Backlog ID: F06 | Priority: P0 | Phase: M1 — Secure build and persistence foundation

Outcome and scope

Define AuditSink and a protected sink adapter for access and administrative events, separate from operational logs. Use approved integrity mechanisms rather than custom cryptography.

Dependencies and gates

Engineering prerequisites: #8 (F03), #10 (F05)

Final retention, access roles and integrity profile require D01/K01 approval. Synthetic adapter tests proceed independently.

Starting points

crates/audit/; migrations/; crates/api/src/; docs/security/audit.md

These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion.

Acceptance criteria

  • Allowed/denied access and policy/marking/crypto/audit changes record actor, action, resource references where permitted, decision, policy/profile version, UTC timestamp, correlation ID and change reason.
  • Audit access is separately authorized; operator privilege does not imply audit or content read permission.
  • Tampering/deletion is detectable, retention/export rules are enforced, and sink outage behavior is explicit and tested without silent loss.
  • Ordinary logs and audit metadata exclude prompt, retrieved text, answers, credentials, tokens and keys by default.

Verification

Integration tests capture permit/deny/admin/feedback events, detect altered records and enforce audit roles. Inject sink failure and inspect captured output with content sentinels.

Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence.

Requirements and design

FR-AUD-001–004, FR-AUTH-008; NFR-OPS-002–003; architecture §13.4

Sources: SRS, system design. Local planning context: docs/implementation-plan.md and docs/development-backlog.md (not published by this task).

Security impact: Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue.

Parent roadmap: #1

**Backlog ID:** F06 | **Priority:** P0 | **Phase:** M1 — Secure build and persistence foundation ## Outcome and scope Define AuditSink and a protected sink adapter for access and administrative events, separate from operational logs. Use approved integrity mechanisms rather than custom cryptography. ## Dependencies and gates **Engineering prerequisites:** #8 (F03), #10 (F05) Final retention, access roles and integrity profile require D01/K01 approval. Synthetic adapter tests proceed independently. ## Starting points crates/audit/; migrations/; crates/api/src/; docs/security/audit.md These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion. ## Acceptance criteria - [ ] Allowed/denied access and policy/marking/crypto/audit changes record actor, action, resource references where permitted, decision, policy/profile version, UTC timestamp, correlation ID and change reason. - [ ] Audit access is separately authorized; operator privilege does not imply audit or content read permission. - [ ] Tampering/deletion is detectable, retention/export rules are enforced, and sink outage behavior is explicit and tested without silent loss. - [ ] Ordinary logs and audit metadata exclude prompt, retrieved text, answers, credentials, tokens and keys by default. ## Verification Integration tests capture permit/deny/admin/feedback events, detect altered records and enforce audit roles. Inject sink failure and inspect captured output with content sentinels. Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence. ## Requirements and design FR-AUD-001–004, FR-AUTH-008; NFR-OPS-002–003; architecture §13.4 Sources: [SRS](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/SRS.md), [system design](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/architecture.md). Local planning context: `docs/implementation-plan.md` and `docs/development-backlog.md` (not published by this task). **Security impact:** Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue. **Parent roadmap:** #1
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#11
No description provided.