rustedr-light es un detector ligero de procesos para Linux con reglas declarativas en JSON, salida en texto o JSONL y modo daemon con deduplicación de alertas.
- Escanea procesos y recoge
pid,parent pid, nombre, comando, ejecutable y memoria. - Evalúa reglas configurables por campo (
command,name,executable) y por tipo de match (contains,regex,equals,starts_with,ends_with). - Filtra por severidad mínima y puede escribir a
stdouto a fichero. - Tiene modo
scan,daemon,list-rulesyvalidate-rules. - Incluye tests unitarios para el motor de reglas y la deduplicación en runtime.
cargo run -- scan
cargo run -- scan --show-processes
cargo run -- daemon --iterations 3 --interval-secs 2
cargo run -- --format json --output alerts.jsonl scan
cargo run -- list-rules
cargo run -- validate-rulesSe puede cargar un JSON con overrides globales:
{
"rules": "rules/default_rules.json",
"format": "json",
"output": "output/alerts.jsonl",
"min_severity": "medium",
"max_cmd_len": 320,
"daemon_interval_secs": 5,
"alert_cooldown_secs": 120,
"max_alerts_per_scan": 100
}Ejemplo:
cargo run -- --config config.json daemon --iterations 5Formato base:
{
"metadata": {
"name": "custom-rules",
"version": "1.0"
},
"rules": [
{
"id": "curl-pipe-shell",
"description": "Curl piping directly into a shell",
"severity": "high",
"field": "command",
"match_mode": "regex",
"pattern": "\\bcurl\\b.+\\|\\s*(?:ba|z)?sh\\b",
"tags": ["download", "execution"],
"enabled": true
}
]
}Los tests relevantes se ejecutan con:
cargo test