Skip to main content

Module dangerous_commands

Module dangerous_commands 

Source
Expand description

Detection of dangerous commands that should never be executed.

This module implements hardcoded detection for commands that are inherently destructive or dangerous, regardless of their options.

Examples:

  • rm -rf / (destructive)
  • git reset --hard (destructive)
  • dd if=/dev/zero of=/dev/sda (very destructive)
  • sudo rm (privilege escalation + destruction)

Functionsยง

command_might_be_dangerous
Checks if a command appears dangerous to execute. Returns true if the command should be blocked before execution.