Security Policy System
SecurityPolicy is a general-purpose security decision engine responsible for Shell command safety checks and risk classification, preventing the Agent from executing dangerous operations.
Risk Levels
| Level | Description | Timeout |
|---|---|---|
SAFE | Safe commands, read-only operations on whitelist | 60s |
LOW | Low risk, routine operations | 60s |
MEDIUM | Medium risk, requires monitoring | 120s |
HIGH | High risk, may affect system stability | 180s |
CRITICAL | Critical risk, execution blocked | Blocked |
Dangerous Pattern Detection
The system includes 100+ built-in dangerous pattern detection rules covering the following categories:
File System Destruction
rm -rf /- Recursive root directory deletion blockedformat C:- Disk formatting blockeddel /f /s- Force bulk deletion blocked
System Configuration Modification
reg delete- Registry deletion blockedshutdown / reboot- Shutdown/reboot blockedtaskkill /f- Killing core processes blockedsc config / delete- Service modification/deletion blocked
Network Security
netsh firewall- Firewall modification blockediptables -F- Flushing firewall rules blocked
Code Execution
powershell -enc- Encoded PowerShell execution blocked| bash- Pipe-to-shell execution blockedcurl | sh- Download-and-execute blockedLD_PRELOAD=- Library injection attack blocked
Sensitive File Access
cat /etc/shadow- Reading password files blockedcat ~/.ssh/id_rsa- Reading SSH private keys blocked> /etc/passwd- Overwriting system user files blocked
Safety Whitelist
The following command types are allowed by default:
Get-*,Select-*,Where-*ls,dir,pwd,cdcat,type,Get-Content(non-sensitive)ping,Test-Connection
Custom Blacklist
Users can add custom dangerous commands in the config file:
# config/agent/settings.yaml
security:
command_blacklist:
- "dangerous_command"
- "custom_pattern"Self-Protection
The system detects and blocks commands that would terminate the current process (taskkill/kill PID), preventing the Agent from self-termination.
Security Note
Security policies provide best-effort detection but cannot cover all dangerous scenarios. It is recommended to run the Agent in a controlled environment and regularly audit execution logs.
