Skip to content

Commit dbcc656

Browse files
authored
Merge pull request #33 from NucleiAv/main
fix: expand deny rules and harden hook regex for rm & pipe-to-shell bypasses
2 parents df8374d + e6ebafa commit dbcc656

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"Bash(sudo *)",
1717
"Bash(mkfs *)",
1818
"Bash(dd *)",
19-
"Bash(curl *|bash*)",
2019
"Bash(wget *|bash*)",
20+
"Bash(wget *| bash*)",
2121
"Bash(git push --force*)",
2222
"Bash(git push *--force*)",
2323
"Bash(git reset --hard*)",
@@ -53,7 +53,7 @@
5353
"hooks": [
5454
{
5555
"type": "command",
56-
"command": "CMD=$(jq -r '.tool_input.command'); if echo \"$CMD\" | grep -qE 'rm[[:space:]]+-[^[:space:]]*r[^[:space:]]*f'; then echo 'BLOCKED: Use trash instead of rm -rf' >&2; exit 2; fi"
56+
"command": "CMD=$(jq -r '.tool_input.command'); if echo \"$CMD\" | grep -qiE '(^|;[[:space:]]*|&&[[:space:]]*|[|][|][[:space:]]*|[|][[:space:]]*)rm[[:space:]]' && echo \"$CMD\" | grep -qiE '(^|[[:space:]])-[a-zA-Z]*[rR]|--recursive' && echo \"$CMD\" | grep -qiE '(^|[[:space:]])-[a-zA-Z]*[fF]|--force'; then echo 'BLOCKED: Use trash instead of rm -rf' >&2; exit 2; fi"
5757
},
5858
{
5959
"type": "command",

0 commit comments

Comments
 (0)