-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: Detect any folder deletion (
rmdir
) command. (#129)
- Loading branch information
1 parent
931d41b
commit da4c5b2
Showing
6 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- test: rmdir TestFolder | ||
description: match command by finding existing file | ||
- test: rmdir -pv TestFolder | ||
description: match command with flags | ||
- test: rmdir -pv TestFolder | ||
description: match command with spaces |
30 changes: 30 additions & 0 deletions
30
shellfirm/tests/snapshots/checks__fs-strict-folder_deletion.yaml.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: shellfirm/tests/checks.rs | ||
expression: test_file_results | ||
--- | ||
[ | ||
TestSensitivePatternsResult { | ||
file_path: "fs-strict-folder_deletion.yaml", | ||
test: "rmdir TestFolder", | ||
check_detection_ids: [ | ||
"fs-strict:folder_deletion", | ||
], | ||
test_description: "match command by finding existing file", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "fs-strict-folder_deletion.yaml", | ||
test: "rmdir -pv TestFolder", | ||
check_detection_ids: [ | ||
"fs-strict:folder_deletion", | ||
], | ||
test_description: "match command with flags", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "fs-strict-folder_deletion.yaml", | ||
test: "rmdir -pv TestFolder", | ||
check_detection_ids: [ | ||
"fs-strict:folder_deletion", | ||
], | ||
test_description: "match command with spaces", | ||
}, | ||
] |