feat(pipeline): PLC/SPS control-logic security scanner (IEC 61131-3) #162
@@ -395,9 +395,9 @@ fn check_safety_bypass(target: &Expr, value: &Expr, line: u32, pou: &str, hits:
|
||||
.iter()
|
||||
.any(|h| n.contains(h));
|
||||
let watchdog = n.contains("watchdog") || n.contains("wdt");
|
||||
let disabling = matches!(value, Expr::Bool(false, _))
|
||||
|| matches!(value, Expr::Int(0, _))
|
||||
|| (watchdog && matches!(value, Expr::Int(0, _)));
|
||||
// A safety enable / interlock / watchdog signal driven to FALSE or 0 in
|
||||
// application logic is a bypass (e.g. `Safety_Enable := FALSE`, `Watchdog_Kick := 0`).
|
||||
let disabling = matches!(value, Expr::Bool(false, _)) || matches!(value, Expr::Int(0, _));
|
||||
if (safety || watchdog) && disabling {
|
||||
hits.push(RuleHit {
|
||||
line,
|
||||
|
||||
Reference in New Issue
Block a user