CI / Check (pull_request) Failing after 2m31s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
Implements ScanType::PlcControlLogic — the missing piece for PlcSps targets, which previously classified but ran no scan. New `pipeline::plc`: - A real IEC 61131-3 Structured Text front end: lexer + recursive-descent parser → AST (POUs, typed VAR sections, statements, expressions). Tolerant recovery so odd constructs never sink a file. - PLCopen XML extractor: pulls each ST POU's interface vars + `<ST>` body and reconstructs equivalent ST, so raw `.st` files and PLCopen projects share one analysis path. - Eight semantic, guard-aware rules over the AST → findings: hardcoded credentials, default/weak passwords, safety-interlock/watchdog bypass, array indexed by unvalidated input, division without a zero-guard (suppressed when an enclosing `IF <d> <> 0` proves it), insecure comm (auth/encryption disabled), and cleartext OT protocol ports, plus unstructured JMP. Each carries CWE + remediation. - `PlcControlLogicScanner` (Scanner impl) walks the project tree and emits `Finding`s (dedup fingerprint, file, line, severity). Wired into `run_target_pipeline`: when the scan plan includes PlcControlLogic, `run_plc_scan` ingests the PlcProject artifact, analyzes it, and persists the findings (findings_count handled by run_target). Demo fixtures under examples/plc-demo/ (a vulnerable pump-station `.st` + a PLCopen `conveyor.xml`). Tests: parser, all-rules-fire, guarded-clean-is-quiet, and an end-to-end tree scan — 5 passing. Adds `roxmltree` (read-only XML) for PLCopen parsing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
2.5 KiB
TOML
70 lines
2.5 KiB
TOML
[package]
|
|
name = "compliance-agent"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
compliance-core = { workspace = true, features = ["mongodb", "telemetry", "axum"] }
|
|
compliance-graph = { path = "../compliance-graph" }
|
|
compliance-dast = { path = "../compliance-dast" }
|
|
# Native firmware build/target detection for bare-metal & RTOS artifacts.
|
|
# Same-company IP, used directly (not via CLI) so the whole tramiton suite is
|
|
# available to the onboarding classifier. NOTE: CI must be able to fetch this
|
|
# private repo (see the git-auth step in .gitea/workflows/ci.yml).
|
|
tramiton-core = { git = "ssh://git@gitea.meghsakha.com:22222/sharang/tramiton.git", tag = "v0.4.1" }
|
|
# tramiton-repro drives the reproducible build (NixBackend seal_and_build) that
|
|
# yields a sealed lock; `libraries_from_inputs` is the analysis-only fallback.
|
|
tramiton-repro = { git = "ssh://git@gitea.meghsakha.com:22222/sharang/tramiton.git", tag = "v0.4.1" }
|
|
# tramiton-sbom renders the bill of materials from a sealed lock (+ binary SCA).
|
|
tramiton-sbom = { git = "ssh://git@gitea.meghsakha.com:22222/sharang/tramiton.git", tag = "v0.4.1" }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
chrono = { workspace = true }
|
|
mongodb = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
sha2 = { workspace = true }
|
|
hex = { workspace = true }
|
|
uuid = { workspace = true }
|
|
secrecy = { workspace = true }
|
|
regex = { workspace = true }
|
|
axum = "0.8"
|
|
tower-http = { version = "0.6", features = ["cors", "trace", "set-header"] }
|
|
git2 = "0.20"
|
|
octocrab = "0.44"
|
|
tokio-cron-scheduler = "0.13"
|
|
dotenvy = "0.15"
|
|
hmac = "0.12"
|
|
walkdir = "2"
|
|
# Read-only XML tree parsing for PLCopen project files (POU extraction).
|
|
roxmltree = "0.20"
|
|
base64 = "0.22"
|
|
urlencoding = "2"
|
|
futures-util = "0.3"
|
|
jsonwebtoken = "9"
|
|
zip = { workspace = true }
|
|
aes-gcm = { workspace = true }
|
|
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-webpki-roots"] }
|
|
futures-core = "0.3"
|
|
dashmap = { workspace = true }
|
|
tokio-stream = { workspace = true }
|
|
rand = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
compliance-core = { workspace = true, features = ["mongodb", "axum"] }
|
|
tower = { version = "0.5", features = ["util"] }
|
|
reqwest = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
tokio = { workspace = true }
|
|
mongodb = { workspace = true }
|
|
uuid = { workspace = true }
|
|
secrecy = { workspace = true }
|
|
axum = "0.8"
|
|
tower-http = { version = "0.6", features = ["cors"] }
|