Repository navigation
fix: credentials, CSP and CI gaps from the docs review - #880
Merged
Merged
Conversation
Closes #873. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: 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
The Vite dev server needs it, so it moves to devCsp. Closes #876. 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
The backend now redacts credentials in that message; the mock matches. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Merged
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.
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 BYandALTER USERended up on disk, in files that were never pruned. There were four paths:#[tracing::instrument]onexecute_query,sqlite_executeand the executor'sexecute*functions recorded the wholesqlargument. These now skip it and record a redacted preview.disable_statement_logging(), andsqlx::query=offin the file filter backs that up.info.The redactor (
mas-core::query::redact) is a port ofsrc/lib/sql-redact.tswith the same six keyword rules. Log files are now kept for 14 days viarolling::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 usesdbus-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.dbusis already linked throughtao.crypto-rustfeature; the crate requires an encrypted session, and this avoids OpenSSL.Release CSP no longer allows loopback (fix: production CSP allows connect-src to any localhost port #876).
http://localhost:*andhttp://127.0.0.1:*move fromcspto a newdevCsp.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
justfilechanges (ci: PRs touching only justfile run no checks #878).Stale comments (chore: two stale comments in CI tooling #879) in
check-documented-commands.shand thecargo-auditjob.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 (
ConnectionProfilederivesDebugwith the password), #883 (agent stdout logged verbatim), #884 (therm -rfdeny 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 warningsandcargo fmt --all --checkare clean.cargo test -p mas-core --lib: 235 passed.cargo test -p sqlpilot --lib: 65 passed.executor::tests::log_redactioncaptures TRACE output fromexecute,execute_ownedand the agent route, and assertshunter2never appears. A control test shows an un-skipped argument does appear. Removing the skip makes the test fail.lib.rsfile_log_testssends sqlx and rmcp payload events throughFILE_LOG_FILTERand 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.mas-core,mas-admin,mas-mcpwith--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.just devwith the newdevCsp. Worth one manual run of each before release.🤖 Generated with Claude Code
https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g