Skip to content

fix(audit): redact credential values in audit entries and log events - #826

Merged
antosubash merged 8 commits into
mainfrom
fix/s01-audit-redaction
Nov 5, 2026
Merged

antosubash merged 8 commits into
mainfrom
fix/s01-audit-redaction

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Hardening: the audit trail and entity log events no longer record credential values.

  • New framework mechanism __audit_redact_fields__ (always) and __audit_redact_row__ (per-row predicate) in simple_module_db.audit_redaction: the change entry stays, its old/new values become [redacted]. Applied on the ORM flush path, the created snapshot, bulk/Core statement capture and manual record_bulk_audit.
  • Applied to Setting.value (secret by the same rule as settings masking, simple_module_core.secret_fields.conceals_secret + SENSITIVE_KEYS, now in core), User.hashed_password, OAuth account tokens, session/refresh token models (their primary key is the token, so entity_id is masked too), tenant invitation token hashes, auth refresh outcomes and lease holders.
  • INFO entity-updated/entity-deleted log events mask credential primary keys.
  • Migration b8d4f2a6c901 (audit_log branch) scrubs stored history; it redacts all historical settings values conservatively because old entries lack the key. Downgrade is a no-op.
  • Removed: settings.constants.SENSITIVE_KEYS (moved to core). CHANGELOG under Unreleased → Security / Removed; operators should rotate credentials saved through the settings UI on earlier versions.

Pipeline: /optimize (1 commit), two review rounds (correctness + maintainability), triage notes kept locally.
Local CI: make lint ✓ · make test-py (8 workers) 7858 passed ✓ · make test-js ✓ · make migrations-roundtrip-pg ✓.

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 505e94d
Status: ✅  Deploy successful!
Preview URL: https://b1e1e541.simple-module-python.pages.dev
Branch Preview URL: https://fix-s01-audit-redaction.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-05T14:56:23.424369Z 18b9cd9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit eec3e15 into main Nov 5, 2026
17 checks passed
@antosubash
antosubash deleted the fix/s01-audit-redaction branch November 5, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant