Skip to content

fix: credentials, CSP and CI gaps from the docs review - #880

Merged
EVWorth merged 7 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h
Oct 24, 2026
Merged

EVWorth merged 7 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h

Conversation

@EVWorth

@EVWorth EVWorth commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes the bugs the documentation review (#874) turned up. Each commit closes one issue, or in one case two.

Changes

  • Credentials stay out of the log file (fix: debug log file records SQL text, including passwords #875). The DEBUG JSON file log recorded SQL text verbatim, so passwords from CREATE USER … IDENTIFIED BY and ALTER USER ended up on disk, in files that were never pruned. There were four paths:

    • #[tracing::instrument] on execute_query, sqlite_execute and the executor's execute* functions recorded the whole sql argument. These now skip it and record a redacted preview.
    • sqlx logged every statement in full at DEBUG, and slow ones at WARN. Every pool now uses disable_statement_logging(), and sqlx::query=off in the file filter backs that up.
    • rmcp logged every MCP request (an agent's SQL) and every response (its rows) at DEBUG. The file filter now holds rmcp at info.
    • Read-only refusal previews, which appear in both the log and the error text, are now redacted.

    The redactor (mas-core::query::redact) is a port of src/lib/sql-redact.ts with the same six keyword rules. Log files are now kept for 14 days via rolling::Builder::max_log_files. If the appender can't open, the app falls back to console-only logging with a warning; it used to panic. The mock backend's refusal message is redacted to match.

  • Linux passwords survive a reboot (bug: check saved passwords survive a reboot on Linux #877). Linux stored passwords with linux-keyutils-keyring-store. That crate's own docs say the kernel facility "is completely in-memory and will not persist across reboots", so every saved password was lost on restart. The app now uses dbus-secret-service-keyring-store, which stores them in GNOME Keyring or KWallet. keyutils remains only as a fallback, with a warning, when the session has no Secret Service.

    • No new system dependency: dbus is already linked through tao.
    • The store uses the crypto-rust feature; the crate requires an encrypted session, and this avoids OpenSSL.
    • Passwords already in keyutils are not migrated. They would be gone at the next reboot anyway.
  • Release CSP no longer allows loopback (fix: production CSP allows connect-src to any localhost port #876). http://localhost:* and http://127.0.0.1:* move from csp to a new devCsp.

  • make → just (chore: code still points at make recipes; the repo uses just #873). 186 #[ignore] reasons and comments named make recipes, but the repo has no Makefile.

  • CI runs on justfile changes (ci: PRs touching only justfile run no checks #878).

  • Stale comments (chore: two stale comments in CI tooling #879) in check-documented-commands.sh and the cargo-audit job.

Closes #873. Closes #875. Closes #876. Closes #877. Closes #878. Closes #879.

Follow-ups filed from this work: #881 (server syntax errors echo the password back into the log), #882 (ConnectionProfile derives Debug with the password), #883 (agent stdout logged verbatim), #884 (the rm -rf deny rule blocks the documented disk cleanup).

The #875 fix was written by the implementer-rust subagent and reviewed before merging into this branch.

Test plan

  • cargo clippy --workspace --all-targets --all-features -- -D warnings and cargo fmt --all --check are clean.
  • cargo test -p mas-core --lib: 235 passed. cargo test -p sqlpilot --lib: 65 passed.
  • New tests prove the redaction:
    • executor::tests::log_redaction captures TRACE output from execute, execute_owned and the agent route, and asserts hunter2 never appears. A control test shows an un-skipped argument does appear. Removing the skip makes the test fail.
    • lib.rs file_log_tests sends sqlx and rmcp payload events through FILE_LOG_FILTER and asserts they are dropped. The test fails without the new directives.
    • tests/log_redaction.rs (#[ignore], real server) is the test that caught the sqlx leak. It passes on MySQL 8 and on MariaDB 11.
  • Integration suites (mas-core, mas-admin, mas-mcp with --ignored): 213 passed on MySQL 8, 213 passed on MariaDB 11.
  • scripts/cargo-audit-check.sh: 0 real vulnerabilities.
  • npm run lint, npm run type-check, the mock backend tests and dprint pass.
  • Not tested here: the Secret Service path on a real Linux desktop (the container has no session bus), and just dev with the new devCsp. Worth one manual run of each before release.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g

Also replaces two comments that described the old command list and a
hardcoded advisory count.

Closes #878. Closes #879.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Linux used the kernel keyutils store, which is in memory only, so every
saved password was gone after a reboot. Use the Secret Service (GNOME
Keyring, KWallet) and fall back to keyutils only when the session has
none.

Closes #877.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The DEBUG JSON log recorded SQL text verbatim, so a CREATE USER or
ALTER USER sent by the admin dialogs left the password on disk, in
files that were never pruned (#875).

- Port the frontend's credential redactor (src/lib/sql-redact.ts) to
  mas-core as query::redact, and log only redacted previews.
- Skip the raw `sql` argument in the instrumented execute_query,
  sqlite_execute and executor spans, which recorded it in full.
- Turn off sqlx statement logging, which wrote every statement at
  DEBUG, and hold back rmcp's DEBUG request/response payloads.
- Keep 14 daily log files instead of all of them.

Closes #875

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
@EVWorth
EVWorth merged commit f9da27a into main Oct 24, 2026
12 checks passed
@EVWorth
EVWorth deleted the claude/hopeful-bardeen-1k4d1h branch October 24, 2026 02:33
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants