fix: enforce safety invariants mechanically and cut self-noise - #20
Open
machado144 wants to merge 2 commits into
Open
fix: enforce safety invariants mechanically and cut self-noise#20machado144 wants to merge 2 commits into
machado144 wants to merge 2 commits into
Conversation
- Build MySQL connections via mysql.Config/NewConnector — a password containing DSN metacharacters can no longer corrupt the address or inject parameters (e.g. disabling read-only hardening) - Bound MySQL MDL/InnoDB lock waits (lock_wait_timeout=5, innodb_lock_wait_timeout=5), matching PostgreSQL's lock_timeout - Clamp the sampling interval to a 1s floor so --interval typos cannot hammer the target server - Stop flagging gumshoe's own catalog queries in statement checks (mysql.statements_full_scan, mysql.top_statements, pg.top_statements); join sys view back to the digest table for full query text - Add a guard test asserting every registered check reads only system catalogs, at every supported engine version - Add integration tests proving session timeouts are actually in effect - Gate pg.top_statements on PG >= 13 (column rename would error, not degrade) - Prompt for a password on ad-hoc check/watch (README promised it) - Warn when serve binds a non-loopback address (UI is unauthenticated) - Run unit tests with -race in CI (they previously never gated PRs) - Fill the empty LICENSE file (MIT); sync CLAUDE.md Neo4j hardening note Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ PR title follows the required formatCurrent title: |
The marketing site (web/index.html + assets) landed without updating .structlint.yaml, so every PR since has failed the gauntlet gate on 'Directory not in allowed list: web'. Allow the directory and *.html. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Hardening + honesty fixes that came out of a full audit (checks catalog, safety invariants, reliability, UX) plus live dogfooding against docker-compose MySQL 8.0 / PostgreSQL 15 / Neo4j 5.
Safety / reliability
mysql.Config+NewConnectorinstead offmt.Sprintf— a password containing&/@//could previously corrupt the DSN or inject params (worst case:&transaction_read_only=0disabling read-only hardening). TDD:internal/engine/mysql/mysql_test.go.lock_wait_timeout=5+innodb_lock_wait_timeout=5(PG already hadlock_timeout=500ms; MySQL had nothing — server default is 1 year).--interval 1msused to be honored;sampler.Newnow clamps to 1s so a typo can't hammer production.internal/check/safety_test.gowalks every registered check at 8 engine/version combos and fails if any FROM/JOIN target is not a system catalog.statement_timeout/lock_timeout/max_execution_timeare in effect, including apg_sleep(8)that must be server-cancelled at ~3s.go test -race -count=1 ./...job added — the ~130 unit tests previously never gated a PR.Insight quality
mysql.statements_full_scan/mysql.top_statements/pg.top_statements. Statement digests referencing only system catalogs are now skipped. The sys view middle-truncates query text, sostatements_full_scanjoins back toevents_statements_summary_by_digestfor full text (also improves the displayed samples).pg.top_statementsversion-gated to PG ≥ 13 — on older servers it errored instead of degrading.UX
check/watchnow prompt for a password on a TTY (README promised this; it never fired — silent auth failure instead).servewarns when bound to a non-loopback address (the web UI is unauthenticated).LICENSEfile (MIT — README already claimed it); addedgo installsnippet; synced CLAUDE.md's Neo4j hardening description with the actual implementation.How to run & test locally
Follow-ups (not in this PR)
🤖 Generated with Claude Code