feat: initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import json, sys
|
||||
|
||||
tool_input = json.loads(sys.stdin.read())
|
||||
command = tool_input.get("tool_input", {}).get("command", "")
|
||||
|
||||
BLOCKED = ["rm -rf /", "dd if=", "mkfs", ":(){:|:&};:"]
|
||||
for blocked in BLOCKED:
|
||||
if blocked in command:
|
||||
print(f"BLOCKED: Gefährlicher Befehl erkannt: {blocked}", file=sys.stderr)
|
||||
sys.exit(2) # Exit-Code 2 = Operation blockiert
|
||||
|
||||
sys.exit(0)
|
||||
Reference in New Issue
Block a user