docs(fermata): the page lists what stays open after the fixes; the failure diagram leaves the public README

threat-landscape.svg showed specific failures and nothing else used it, so it is gone. The
false entry on runs outside a project now names all four markers, with a test.
This commit is contained in:
2026-11-07 09:48:21 +01:00
parent 67e41c58c3
commit b9e8e52731
5 changed files with 61 additions and 22 deletions
+8 -6
View File
@@ -21,13 +21,15 @@ This is the largest limit for values fermata knows.
The check reads the command's text, not what the shell makes of it.
- A substitution that builds the name, and a script that opens the file: `cat $(printf '.e%s' nv)`, `python -c "print(open('.env').read())"`, `sh run.sh`. (Test: `a_variable_a_substitution_and_a_script_hide_the_file_from_the_command_rules`.)
- A form where the name is not a word of its own: `echo "$(cat .env)"`, `bash <<EOF` with `cat .env` in its body, `find . -name .env -exec cat {} \;`, `curl -d @.env`, `curl -F file=@.env`, `git show HEAD:.env`, `git show :.env`, `cat .{env,x}`. (Test: `a_command_that_names_the_file_in_a_form_the_check_does_not_read_passes`.)
- A command line the check does not read as one: `bash -c -- 'cat .env'`, `eval` past its first argument (`eval 'true' 'cat .env'`), and a shell behind a wrapper's flag value (`sudo -u root bash -c 'cat .env'`). (Test: `a_command_line_the_check_does_not_read_as_one_passes`.)
- A form where the name is not a word of its own: `echo "$(cat .env)"`, `bash <<EOF` with `cat .env` in its body, `find . -name .env -exec cat {} \;`, `curl -d @.env`, `curl -F file=@.env`, `git show HEAD:.env`, `git show :.env`, `cat .{env,x}`, and a short flag's attached value (`git commit -F.env`, `tool -f.env`). (Test: `a_command_that_names_the_file_in_a_form_the_check_does_not_read_passes`.)
- A command line the check does not read as one: a shell behind a wrapper's flag value (`sudo -u root bash -c 'cat .env'`), a shell or language off the list (`rc -c`, `python3 -c`), and an encoded line (`pwsh -EncodedCommand`). (Test: `a_command_line_the_check_does_not_read_as_one_passes`.)
- A flag named `--exclude=`, `--exclude-dir=`, `--ignore=` or `--grep=` hides its value, for any program, since what a script does with it is not read: `tool --exclude=.env`. (Test: `a_flag_named_like_an_exclude_hides_its_value_for_any_program`.)
- A script given by an absolute path cannot be told from the real wrapper: `/home/me/scripts/env ls .env` passes, as `/usr/bin/env ls .env` should. (Test: `a_script_given_by_an_absolute_path_passes_when_its_first_word_is_a_metadata_verb`.)
- A printing verb off the list: `python -c`, `perl -e`. (Test: `a_printing_verb_off_the_list_is_not_checked_against_the_rules_unless_it_names_the_file`.)
- A ruled file run as the program itself: `./.env`, `sudo vendor/bin/x` under a rule on `vendor/`. (Test: `a_ruled_file_run_as_the_program_passes`.)
- A change of directory: `cd ../other && cat .env`. A secret file in no project has no rules at all. (Test: `a_command_that_prints_a_secret_file_outside_the_project_passes`.)
- A command run in one project does not meet another project's rules: `cat ../other/x` passes, while a Read of that file is stopped. (Test: `a_command_in_one_project_is_not_stopped_by_another_projects_rule`.)
- A new file named to a verb off the writing list: `git clone https://example.invalid/x vendor/new`, `unzip a.zip -d vendor/new`, `python make.py vendor/new`, and a flag's value such as `cp --target-directory=vendor/new a.txt`. (Test: `a_new_file_named_to_a_verb_off_the_writing_list_is_not_checked`.)
- A write by a verb off the writing list: `git clone https://example.invalid/x vendor/new`, `unzip a.zip -d vendor/new`, `tar cf vendor/new a.txt`, `python make.py vendor/new`, `perl -pi`, `awk -i inplace`. A glob over directories in the target (`touch vend*/new`) is not read either. (Test: `a_new_file_named_to_a_verb_off_the_writing_list_is_not_checked`.)
## Secret files fermata cannot mask
@@ -35,10 +37,10 @@ A Read, a Grep with that `path` and a printing command that names such a file ar
- A route that does not name the file: `grep -r TOKEN .`, `ls -R`, `tar cf x.tar .`, a script that opens it. This holds for `*.p12`, `*.pfx`, `.netrc`, `.htpasswd` and a text `*.key`. (Test: `an_unmaskable_file_is_reached_by_a_route_that_does_not_name_it`.)
- A printing verb off the list: `dd if=server.p12`, `perl -ne print server.p12`, `python3 show.py server.p12`. (Test: `a_printing_verb_not_on_the_list_passes_the_read_gate`.)
- A form the gate does not read: `sudo -u root cat id_rsa`, where the flag's value becomes the verb; `eval cat id_rsa`, where only the first argument is read as a command line; `cat <&3 id_rsa`, where `<&` ends the segment; `cat */id_rsa` and `cat ./s*/a.key`, a glob over directories. A rule on the file's name still stops each of them. (Test: `a_flag_value_as_verb_and_a_glob_over_directories_pass_the_read_gate`.)
- A form the gate does not read: `sudo -u root cat id_rsa`, where the flag's value becomes the verb; `bash -c -o pipefail 'cat id_rsa'`, where that word does; `cat <&3 id_rsa`, where `<&` ends the segment; `cat */id_rsa` and `cat ./s*/a.key`, a glob over directories; `./env cat id_rsa`, `bin/sudo cat id_rsa` and `./busybox cat id_rsa`, each a script as far as the check knows. A rule on the file's name still stops each of them. (Test: `a_flag_value_as_verb_and_a_glob_over_directories_pass_the_read_gate`.)
- The stop needs the PreToolUse hook. Without it a Read reaches the model, and PostToolUse has nothing to mask in it. (Test: `the_read_gate_stands_only_in_a_pre_tool_use_hook`.)
- A text with `{{` or `{%` that does not parse passes as a template, and a literal value in it reaches the model. (Test: `a_template_holding_a_literal_value_passes_a_read`.)
- A certificate file may hold comment lines and indented attribute lines beside its blocks, so a value spelled as one of them passes: `# fake-value`, ` api_token: fake-value`. (Test: `a_comment_or_an_attribute_line_beside_a_certificate_passes`.)
- A certificate file may hold other text, so a value spelled as that text passes: a comment (`# fake-value`), an indented line (` api_token: fake-value`), `subject=` or `issuer=`, a title above a `====` line, and whatever a certificate block holds. (Test: `a_comment_or_an_attribute_line_beside_a_certificate_passes`.)
- A UTF-16 or Latin-1 `.env`, and JSON with comments, are stopped on a Read. Their values are not masked in the output of other commands. (Test: `a_utf16_or_latin1_file_or_json_with_comments_is_not_masked_when_no_command_names_it`.)
## Values that never enter the list of known secrets
@@ -57,7 +59,7 @@ These values then reach the model.
- A secret number that an MCP tool returns as a JSON number. (Test: `a_secret_number_in_mcp_structured_content_is_not_masked`.)
- A secret equal to a plain setting word (`true`, `3600`, a short duration). It makes no entry. (Test: `tests/core_value_class.rs`.)
- A secret file outside the working project: a Read of `../other/.env` and `cat ../other/.env` pass. (Test: `a_secret_file_outside_the_project_is_not_masked_and_a_read_of_it_passes`.)
- A run with no `.botsecrets` or `.botignore` above the working directory: there is nothing to load, and the output passes. (From the code: `find_project_root` finds no root.)
- A run with no `.git`, `.botsecrets`, `.botignore` or `fermata.toml` above the working directory: nothing is loaded, and the output passes. (Test: `a_run_outside_any_project_is_not_masked`.)
## Masks that do too much or too little