diff --git a/settings.json b/settings.json index 3956051..2aa8d9b 100644 --- a/settings.json +++ b/settings.json @@ -16,8 +16,8 @@ "Bash(sudo *)", "Bash(mkfs *)", "Bash(dd *)", - "Bash(curl *|bash*)", "Bash(wget *|bash*)", + "Bash(wget *| bash*)", "Bash(git push --force*)", "Bash(git push *--force*)", "Bash(git reset --hard*)", @@ -53,7 +53,7 @@ "hooks": [ { "type": "command", - "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" + "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" }, { "type": "command",