docs(fermata): the page drops bash -c -o pipefail and names an indented private block and the = and : write forms
This commit is contained in:
@@ -30,6 +30,7 @@ The check reads the command's text, not what the shell makes of it.
|
||||
- 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 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`.)
|
||||
- An output flag's value given with `=` or `:` (`tool -o=vendor/new`, `sort -o=vendor/new`, `Copy-Item a.txt -Destination:vendor\new`), and BSD's `sed -I`. (Test: `a_write_given_by_an_equals_sign_a_colon_or_sed_capital_i_is_not_checked`.)
|
||||
|
||||
## Secret files fermata cannot mask
|
||||
|
||||
@@ -37,9 +38,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; `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`.)
|
||||
- A form the gate does not read: `sudo -u root cat id_rsa`, where the flag's value becomes the verb; `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 private block indented beside a certificate is taken for the certificate file's text, so a Read passes. Its body is still masked in what the Read shows. (Test: `an_indented_private_block_beside_a_certificate_passes_a_read`.)
|
||||
- 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`.)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user