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()
|
.iter()
|
||||||
.any(|h| n.contains(h));
|
.any(|h| n.contains(h));
|
||||||
let watchdog = n.contains("watchdog") || n.contains("wdt");
|
let watchdog = n.contains("watchdog") || n.contains("wdt");
|
||||||
let disabling = matches!(value, Expr::Bool(false, _))
|
// A safety enable / interlock / watchdog signal driven to FALSE or 0 in
|
||||||
|| matches!(value, Expr::Int(0, _))
|
// application logic is a bypass (e.g. `Safety_Enable := FALSE`, `Watchdog_Kick := 0`).
|
||||||
|| (watchdog && matches!(value, Expr::Int(0, _)));
|
let disabling = matches!(value, Expr::Bool(false, _)) || matches!(value, Expr::Int(0, _));
|
||||||
if (safety || watchdog) && disabling {
|
if (safety || watchdog) && disabling {
|
||||||
hits.push(RuleHit {
|
hits.push(RuleHit {
|
||||||
line,
|
line,
|
||||||
|
|||||||
Reference in New Issue
Block a user