Repository navigation
new(security): check-staged-secrets.sh, an opt-in staged-blob secret check (TK-025) - #411
Merged
Merged
Conversation
…tion (TK-025) Situational skills only; sources and field evidence in CHANGELOG. Verified claims are marked as field observations where mxcli/Mendix docs did not confirm them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
….docker/.env, CRLF (TK-025 review) Skip values under 8 chars, well-known defaults (mendix etc.) and values equal to .env.example. One git grep -F -f per value (value via 600 file, not argv). Read .docker/.env and similar. Normalise CRLF, spaces and inline comments. Tests for each. Skill text states what the check does not protect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… model run --local writes every constant's model default into bootConfig, so a placeholder default of a key-like constant counted as a secret and could not be unstaged. Values present at HEAD in *.mpr or mprcontents/ are skipped; a constant passed with a value not in the model is still found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MendixMau
marked this pull request as ready for review
October 16, 2026 03:52
4 tasks done
Keep both manifest entries and both changelog entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are name Same non-fatal probe exec.sh uses; a local fallback when _common.sh is absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
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.
Direct lane
What changed and why: a field run (five apps, mxcli v0.26.0) had six secret leak events into agent transcripts and one demo password reach git:
.mxcli/run-local.jsonholds database and API passwords in clear underbootConfig, and a rendered login page with the password filled in was tracked..gitignoredoes not help once a file is tracked, andgit commit -- <path>re-adds an ignored tracked file at commit time. Newproject-bin/check-staged-secrets.shcompares the project's real secret values (.env,.env.*,run-local.jsonbootConfig, optional$MXTK_SECRET_VALUES_FILE) against the staged blobs, or with--treeevery tracked file at HEAD, and prints only the file and the key name, never a value. Not treated as secrets: values under 8 characters, well-known dev defaults (mendix,password,admin, ...;mendixis the mxcli database password and sits in thousands of tracked files, so counting it would fail every commit), and a value equal to the same key in.env.example..docker/.env(themxcli dockerlayout) is read too. CRLF,KEY = valueand inline comments are normalised. Scanning is onegit grep -F -fper value, with the value passed through a mode 600 file, not argv. A new section inskills/learned-constants-and-secrets.mdlists the files and commands an agent never prints. It is opt-in and not wired into the generated pre-commit hook; a separate warn-only wiring PR comes later. Finding TK-025, no GitHub issue.Impact
project-bin/check-staged-secrets.sh(named inMXTK_PROJECT_BINinbin/lib/install-manifest.sh),skills/learned-constants-and-secrets.md, its test, CHANGELOG.md. Reads.env*and.mxcli/run-local.jsonif present; plain bash and git, any OS. No overlap with_common.shorexec.sh.learned-constants-and-secretsisondemandinbin/lib/skill-routing.tsv, no always-loaded file touched.bin/render-routing.sh --check: baseline 75225 words (budget 80000), same on origin/master and on this head.--tree) 2.6 s (was 41 s to 3 min 16 s for 231 files)Field evidence: the leak events come from the lab report; the script was not run against that lab's real values. The test uses made-up values only and proves the mechanism, not a real leak.
bash tests/wave2/test-check-staged-secrets.shgives 30 passed, 0 failed on this head, including the defaultmendixpassword (exit 0),.docker/.env, a CRLF file, spaced and commented values, an.env.example-equal value, and MicroflowConstants values: a placeholder default already in the committed model is skipped (exit 0, staged and --tree), a constant value not in the model is still found. On master the subject script does not exist, so the test cannot run there (the whole check is absent).bin/check-pr-discipline.sh origin/masterclean## Unreleased🤖 Generated with Claude Code