feat(pipeline): PLC/SPS control-logic security scanner (IEC 61131-3) #162

Merged
sharang merged 3 commits from feat/plc-control-logic-scanner into main 2026-07-16 08:31:44 +00:00
Showing only changes of commit 5e983d699f - Show all commits
+3 -3
View File
@@ -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,