|
1 | 1 | ## Unreleased |
2 | 2 |
|
| 3 | +FEATURES: |
| 4 | + |
| 5 | +- **Context-Aware Protection**: Automatically detects SSH sessions, root user, protected git branches, production Kubernetes contexts, and custom environment variables to escalate challenge difficulty based on risk level (Normal / Elevated / Critical). |
| 6 | +- **Safe Alternative Suggestions**: Risky commands now show a safer alternative (e.g., `git push --force` suggests `--force-with-lease`). Alternatives are displayed in green alongside the challenge prompt. |
| 7 | +- **Project-Level Policies**: Teams can commit a `.shellfirm.yaml` file to enforce additive-only safety rules (deny lists, challenge escalation overrides, branch-specific rules). Policies are discovered by walking up the directory tree. |
| 8 | +- **Audit Trail**: Optional logging of every intercepted command, matched patterns, challenge type, outcome (ALLOWED/BLOCKED/DENIED), and context labels. Commands: `shellfirm audit show` and `shellfirm audit clear`. |
| 9 | +- **Zero-Friction Setup**: New `shellfirm init <shell>` command prints the appropriate hook for eval. Auto-detects shell when no argument is given. |
| 10 | +- **Custom Checks**: Load user-defined check YAMLs from `~/.shellfirm/checks/` at runtime. |
| 11 | +- **Expanded Pattern Coverage**: New built-in checks for Docker, AWS CLI, GCP, Azure CLI, and database commands (DROP, TRUNCATE). |
| 12 | +- **Policy CLI**: `shellfirm policy init` scaffolds a template; `shellfirm policy validate` checks syntax. |
| 13 | + |
| 14 | +IMPROVEMENTS: |
| 15 | + |
| 16 | +- **Compound Command Splitting**: Properly splits commands on `&&`, `||`, `|`, `;` operators, replacing the previous character-based splitting that could miss risky subcommands. |
| 17 | +- **Dependency Injection Architecture**: All I/O abstracted through `Environment` and `Prompter` traits, enabling fully sandboxed testing with zero real system access. |
| 18 | +- **Three-Tier Test Suite**: 102 tests across Pure Logic (Tier 1), Sandboxed Integration (Tier 2), and YAML-driven Decision Matrix (Tier 3). |
| 19 | +- **Dependency Upgrades**: clap v3 -> v4, serde_yaml 0.8 -> 0.9, removed `lazy_static` (replaced with `std::sync::OnceLock`), `tempdir` -> `tempfile`, workspace resolver set to v2. |
| 20 | +- **Fish Shell Fix**: `commandline -f execute` now only runs when `shellfirm pre-command` exits successfully, preventing commands from executing after cancellation. |
| 21 | +- **Zsh Shell Fix**: Added binary existence check before invoking shellfirm. |
| 22 | +- **Safer Unwraps**: Replaced unsafe `unwrap()` calls in filter matching with proper `match` + error logging. |
| 23 | + |
| 24 | +BREAKING CHANGES: |
| 25 | + |
| 26 | +- Settings file now includes `context` and `audit_enabled` fields (defaults applied automatically on upgrade). |
| 27 | + |
3 | 28 | ## 0.2.6 |
| 29 | + |
4 | 30 | IMPROVMENT |
5 | | -* Add git-strict file commands. [PR-112](https://github.com/kaplanelad/shellfirm/pull/112) |
6 | | -* Add more git commands. [PR-112](https://github.com/kaplanelad/shellfirm/pull/112) |
7 | | -* Add Terraform commands. [PR-113](https://github.com/kaplanelad/shellfirm/pull/113) |
8 | | -* Improve xtask. [PR-115](https://github.com/kaplanelad/shellfirm/pull/115) |
9 | | -* Improve docs. [PR-116](https://github.com/kaplanelad/shellfirm/pull/116) |
10 | | -* Allow ignoring patterns. [PR-117](https://github.com/kaplanelad/shellfirm/pull/117) |
| 31 | + |
| 32 | +- Add git-strict file commands. [PR-112](https://github.com/kaplanelad/shellfirm/pull/112) |
| 33 | +- Add more git commands. [PR-112](https://github.com/kaplanelad/shellfirm/pull/112) |
| 34 | +- Add Terraform commands. [PR-113](https://github.com/kaplanelad/shellfirm/pull/113) |
| 35 | +- Improve xtask. [PR-115](https://github.com/kaplanelad/shellfirm/pull/115) |
| 36 | +- Improve docs. [PR-116](https://github.com/kaplanelad/shellfirm/pull/116) |
| 37 | +- Allow ignoring patterns. [PR-117](https://github.com/kaplanelad/shellfirm/pull/117) |
11 | 38 |
|
12 | 39 | ## 0.2.5 |
| 40 | + |
13 | 41 | IMPROVMENT |
14 | | -* create unites for regex checks. [PR-107](https://github.com/kaplanelad/shellfirm/pull/107) |
15 | | -* Remove contains method. [PR-108](https://github.com/kaplanelad/shellfirm/pull/108) |
16 | | -* check is folder or directory exists before prompt a message. [PR-109](https://github.com/kaplanelad/shellfirm/pull/109) |
| 42 | + |
| 43 | +- create unites for regex checks. [PR-107](https://github.com/kaplanelad/shellfirm/pull/107) |
| 44 | +- Remove contains method. [PR-108](https://github.com/kaplanelad/shellfirm/pull/108) |
| 45 | +- check is folder or directory exists before prompt a message. [PR-109](https://github.com/kaplanelad/shellfirm/pull/109) |
17 | 46 |
|
18 | 47 | BRAKING CHANGES |
19 | | -* Change shellfirm configuration. [PR-103](https://github.com/kaplanelad/shellfirm/pull/103) |
| 48 | + |
| 49 | +- Change shellfirm configuration. [PR-103](https://github.com/kaplanelad/shellfirm/pull/103) |
20 | 50 |
|
21 | 51 | ## 0.2.4 |
| 52 | + |
22 | 53 | IMPROVMENT |
23 | | -* Check test. [PR-98](https://github.com/kaplanelad/shellfirm/pull/98) |
24 | | -* Remove vergen package. [PR-100](https://github.com/kaplanelad/shellfirm/pull/100) |
25 | | -* add .rustfmt.toml file. [PR-](https://github.com/kaplanelad/shellfirm/pull/101) |
| 54 | + |
| 55 | +- Check test. [PR-98](https://github.com/kaplanelad/shellfirm/pull/98) |
| 56 | +- Remove vergen package. [PR-100](https://github.com/kaplanelad/shellfirm/pull/100) |
| 57 | +- add .rustfmt.toml file. [PR-](https://github.com/kaplanelad/shellfirm/pull/101) |
26 | 58 |
|
27 | 59 | ## 0.2.3 |
| 60 | + |
28 | 61 | IMPROVMENT |
29 | | -* Support $XDG_CONFIG_HOME. [PR-87](https://github.com/kaplanelad/shellfirm/pull/87) |
30 | | -* Add xtask.[PR-95](https://github.com/kaplanelad/shellfirm/pull/95) |
31 | | -* Interactive menu in config reset command. [PR-96](https://github.com/kaplanelad/shellfirm/pull/96) |
| 62 | + |
| 63 | +- Support $XDG_CONFIG_HOME. [PR-87](https://github.com/kaplanelad/shellfirm/pull/87) |
| 64 | +- Add xtask.[PR-95](https://github.com/kaplanelad/shellfirm/pull/95) |
| 65 | +- Interactive menu in config reset command. [PR-96](https://github.com/kaplanelad/shellfirm/pull/96) |
32 | 66 |
|
33 | 67 | DOCS |
34 | | -* More installation examples. [PR-](https://github.com/kaplanelad/shellfirm/pull/94) |
| 68 | + |
| 69 | +- More installation examples. [PR-](https://github.com/kaplanelad/shellfirm/pull/94) |
35 | 70 |
|
36 | 71 | ## 0.2.2 |
| 72 | + |
37 | 73 | IMPROVMENT |
38 | | -* Adds crontab -r as a risky command. [PR-81](https://github.com/kaplanelad/shellfirm/pull/81) |
39 | | -* Decouple test from base checks. [PR-84](https://github.com/kaplanelad/shellfirm/pull/84) |
40 | | -* Decouple test from app version snapshots. [PR-85](https://github.com/kaplanelad/shellfirm/pull/85) |
41 | | -* Improve config tests. [PR-86](https://github.com/kaplanelad/shellfirm/pull/86) |
| 74 | + |
| 75 | +- Adds crontab -r as a risky command. [PR-81](https://github.com/kaplanelad/shellfirm/pull/81) |
| 76 | +- Decouple test from base checks. [PR-84](https://github.com/kaplanelad/shellfirm/pull/84) |
| 77 | +- Decouple test from app version snapshots. [PR-85](https://github.com/kaplanelad/shellfirm/pull/85) |
| 78 | +- Improve config tests. [PR-86](https://github.com/kaplanelad/shellfirm/pull/86) |
42 | 79 |
|
43 | 80 | BUG FIX |
44 | | -* Change title for fish installation instructions. [PR-82](https://github.com/kaplanelad/shellfirm/pull/82) |
| 81 | + |
| 82 | +- Change title for fish installation instructions. [PR-82](https://github.com/kaplanelad/shellfirm/pull/82) |
45 | 83 |
|
46 | 84 | ## 0.2.1 |
| 85 | + |
47 | 86 | IMPROVMENTS: |
48 | | -* Add heroku risky patterns.[PR-75](https://github.com/kaplanelad/shellfirm/pull/75) |
| 87 | + |
| 88 | +- Add heroku risky patterns.[PR-75](https://github.com/kaplanelad/shellfirm/pull/75) |
49 | 89 |
|
50 | 90 | DOCS |
51 | | -* Spell correction for README typo. [PR-79](https://github.com/kaplanelad/shellfirm/pull/79) |
52 | | -* docs/checks/fs - clarify descriptions. [PR-77](https://github.com/kaplanelad/shellfirm/pull/77) |
| 91 | + |
| 92 | +- Spell correction for README typo. [PR-79](https://github.com/kaplanelad/shellfirm/pull/79) |
| 93 | +- docs/checks/fs - clarify descriptions. [PR-77](https://github.com/kaplanelad/shellfirm/pull/77) |
53 | 94 |
|
54 | 95 | ## 0.2.0 |
| 96 | + |
55 | 97 | IMPROVMENTS: |
56 | | -* Replace / with path join.[PR-72](https://github.com/kaplanelad/shellfirm/pull/72) |
57 | | -* Bump crossbeam-utils from 0.8.5 to 0.8.10. [PR-74](https://github.com/kaplanelad/shellfirm/pull/74) |
58 | 98 |
|
| 99 | +- Replace / with path join.[PR-72](https://github.com/kaplanelad/shellfirm/pull/72) |
| 100 | +- Bump crossbeam-utils from 0.8.5 to 0.8.10. [PR-74](https://github.com/kaplanelad/shellfirm/pull/74) |
59 | 101 |
|
60 | 102 | ## 0.2.0 |
| 103 | + |
61 | 104 | IMPROVMENTS: |
62 | | -* Improve test. [PR-71](https://github.com/kaplanelad/shellfirm/pull/71) |
63 | | -* replace / with path join. [PR-72](https://github.com/kaplanelad/shellfirm/pull/72) |
64 | | -* Text cleanuo. [PR-]https://github.com/kaplanelad/shellfirm/pull/66 |
| 105 | + |
| 106 | +- Improve test. [PR-71](https://github.com/kaplanelad/shellfirm/pull/71) |
| 107 | +- replace / with path join. [PR-72](https://github.com/kaplanelad/shellfirm/pull/72) |
| 108 | +- Text cleanuo. [PR-]https://github.com/kaplanelad/shellfirm/pull/66 |
65 | 109 |
|
66 | 110 | ## 0.1.6 |
| 111 | + |
67 | 112 | IMPROVMENTS |
68 | | -* change ~ to home dir in IsFileExists FILTER. [PR-63](https://github.com/kaplanelad/shellfirm/pull/63) |
69 | | -* Fish shell support. [PR-61](https://github.com/kaplanelad/shellfirm/pull/61) |
70 | 113 |
|
71 | | -## 0.1.5 |
| 114 | +- change ~ to home dir in IsFileExists FILTER. [PR-63](https://github.com/kaplanelad/shellfirm/pull/63) |
| 115 | +- Fish shell support. [PR-61](https://github.com/kaplanelad/shellfirm/pull/61) |
| 116 | + |
| 117 | +## 0.1.5 |
72 | 118 |
|
73 | 119 | IMPROVMENTS: |
74 | | -* Ading custom check - for check if file exsits before prompt a delete/flush verification. [PR-46](https://github.com/kaplanelad/shellfirm/pull/60) |
75 | | -* Support multiple commands in one line. [MR](https://github.com/kaplanelad/shellfirm/commit/c2c4d0633dcdac38b6b44d5351179f6e1421096d) |
| 120 | + |
| 121 | +- Ading custom check - for check if file exsits before prompt a delete/flush verification. [PR-46](https://github.com/kaplanelad/shellfirm/pull/60) |
| 122 | +- Support multiple commands in one line. [MR](https://github.com/kaplanelad/shellfirm/commit/c2c4d0633dcdac38b6b44d5351179f6e1421096d) |
76 | 123 |
|
77 | 124 | BUG |
78 | | -* Replace `~` char with home directory path. [PR-63](https://github.com/kaplanelad/shellfirm/pull/63) |
79 | | -## 0.1.4 |
| 125 | + |
| 126 | +- Replace `~` char with home directory path. [PR-63](https://github.com/kaplanelad/shellfirm/pull/63) |
| 127 | + |
| 128 | +## 0.1.4 |
80 | 129 |
|
81 | 130 | IMPROVMENTS: |
82 | | -* Update config file from baseline checks when `shellfirm` binary update. [PR-46](https://github.com/kaplanelad/shellfirm/pull/46) |
83 | | -* Show single prompt verification when multiple pattern is detected. [PR-51](https://github.com/kaplanelad/shellfirm/pull/51) |
84 | | -* Improve `rm` pattern. [PR-53](https://github.com/kaplanelad/shellfirm/pull/53) |
85 | | -* Improve `chmod` pattern. [PR-54](https://github.com/kaplanelad/shellfirm/pull/54) |
86 | | -* Adding reboot and shutdown risky pattern. [PR-56](https://github.com/kaplanelad/shellfirm/pull/56) |
| 131 | + |
| 132 | +- Update config file from baseline checks when `shellfirm` binary update. [PR-46](https://github.com/kaplanelad/shellfirm/pull/46) |
| 133 | +- Show single prompt verification when multiple pattern is detected. [PR-51](https://github.com/kaplanelad/shellfirm/pull/51) |
| 134 | +- Improve `rm` pattern. [PR-53](https://github.com/kaplanelad/shellfirm/pull/53) |
| 135 | +- Improve `chmod` pattern. [PR-54](https://github.com/kaplanelad/shellfirm/pull/54) |
| 136 | +- Adding reboot and shutdown risky pattern. [PR-56](https://github.com/kaplanelad/shellfirm/pull/56) |
87 | 137 |
|
88 | 138 | BUG: |
89 | | -* Ignore text between quotes. [PR-57](https://github.com/kaplanelad/shellfirm/pull/57) |
90 | 139 |
|
91 | | -## 0.1.3 |
| 140 | +- Ignore text between quotes. [PR-57](https://github.com/kaplanelad/shellfirm/pull/57) |
| 141 | + |
| 142 | +## 0.1.3 |
92 | 143 |
|
93 | 144 | IMPROVEMENTS: |
94 | | -* Improve FS checks. [PR-30](https://github.com/kaplanelad/shellfirm/pull/30) |
95 | | -* Skip github actions on push (without PR) or on *.md file/docs folder. [PR-33](https://github.com/kaplanelad/shellfirm/pull/33) |
96 | | -* Adding strict file sytem command. [PR-36](https://github.com/kaplanelad/shellfirm/pull/36) |
97 | | -* FS checks - adding to `rm`/`chmod` pattern the chars `.` and `./` as risky command. [PR-38](https://github.com/kaplanelad/shellfirm/pull/38) |
98 | | -* Adding a better error message when config file is invalid. [PR-42](https://github.com/kaplanelad/shellfirm/pull/42) |
99 | | -* Adding kubernetes strict risky patters. [PR-41](https://github.com/kaplanelad/shellfirm/pull/41) |
100 | | -* Allow to override deafult per pattern. [PR-43](https://github.com/kaplanelad/shellfirm/pull/43) |
| 145 | + |
| 146 | +- Improve FS checks. [PR-30](https://github.com/kaplanelad/shellfirm/pull/30) |
| 147 | +- Skip github actions on push (without PR) or on \*.md file/docs folder. [PR-33](https://github.com/kaplanelad/shellfirm/pull/33) |
| 148 | +- Adding strict file sytem command. [PR-36](https://github.com/kaplanelad/shellfirm/pull/36) |
| 149 | +- FS checks - adding to `rm`/`chmod` pattern the chars `.` and `./` as risky command. [PR-38](https://github.com/kaplanelad/shellfirm/pull/38) |
| 150 | +- Adding a better error message when config file is invalid. [PR-42](https://github.com/kaplanelad/shellfirm/pull/42) |
| 151 | +- Adding kubernetes strict risky patters. [PR-41](https://github.com/kaplanelad/shellfirm/pull/41) |
| 152 | +- Allow to override deafult per pattern. [PR-43](https://github.com/kaplanelad/shellfirm/pull/43) |
101 | 153 |
|
102 | 154 | FEATURES: |
103 | | -* Promt message while using `config reset` + ading the option to backup file. [PR-31](https://github.com/kaplanelad/shellfirm/pull/31) |
| 155 | + |
| 156 | +- Promt message while using `config reset` + ading the option to backup file. [PR-31](https://github.com/kaplanelad/shellfirm/pull/31) |
104 | 157 |
|
105 | 158 | BREAKING CHANGES: |
106 | | -* Change `is` field in yaml file to `test`. [PR-32](https://github.com/kaplanelad/shellfirm/pull/32) |
| 159 | + |
| 160 | +- Change `is` field in yaml file to `test`. [PR-32](https://github.com/kaplanelad/shellfirm/pull/32) |
107 | 161 |
|
108 | 162 | ## 0.1.2 - (Jan 4, 2022) |
109 | 163 |
|
110 | 164 | IMPROVEMENTS: |
111 | | -* Mark history | sh/bash as risky command. [PR-27](https://github.com/kaplanelad/shellfirm/pull/27) |
112 | | -* Add 2 check for `fs` group. detect `chmod 777 /` and `find -delete`. [PR-28](https://github.com/kaplanelad/shellfirm/pull/28) |
| 165 | + |
| 166 | +- Mark history | sh/bash as risky command. [PR-27](https://github.com/kaplanelad/shellfirm/pull/27) |
| 167 | +- Add 2 check for `fs` group. detect `chmod 777 /` and `find -delete`. [PR-28](https://github.com/kaplanelad/shellfirm/pull/28) |
113 | 168 |
|
114 | 169 | ## 0.1.1 (Jan 3, 2022) |
115 | 170 |
|
116 | 171 | IMPROVEMENTS: |
117 | 172 |
|
118 | | -* Add application logger. [PR-24](https://github.com/kaplanelad/shellfirm/pull/24) |
| 173 | +- Add application logger. [PR-24](https://github.com/kaplanelad/shellfirm/pull/24) |
119 | 174 |
|
120 | 175 | ## 0.1.0 (Jan 2, 2022) |
| 176 | + |
121 | 177 | Initial release |
0 commit comments