Customer case: CODESYS control logic on a Yocto Linux device
A prospective customer runs CODESYS (IEC 61131-3) control applications on a
device whose OS is Yocto embedded Linux. That single device is really two
layers we must cover end-to-end:
ICS / PLC layer — the CODESYS runtime, the control application (POUs), and
the industrial protocols it speaks (CODESYS programming protocol 11740/11741,
OPC UA, Modbus TCP 502, EtherNet/IP, WebVisu HTTP).
Embedded-Linux layer — the Yocto OS image, its packages, kernel config, and
network services (SSH, TLS, exposed daemons, web).
Goal: from one onboarded target, produce a clear SBOM, SAST, and simulated DAST/Pentest across both layers.
Onboarding binds one TargetType per target, but this device is simultaneously PlcSpsandEmbeddedLinuxYocto. #A decides how the two layers converge
(composite PlcSps that also runs firmware SBOM/CVE + DAST/pentest when those
artifacts/endpoints are attached, vs. two linked targets).
What to ask the customer (once the gaps are closed)
PLCopen XML export of the CODESYS project (interim until #B reads native .project).
A reachable WebVisu / OPC UA endpoint, or agreement to run CODESYS Control
for Linux SL (soft-PLC container) + a runqemu Yocto image for safe DAST/pentest.
Current-state audit (2026-07-17) — frame is in place, engine is not
Traced the Yocto/firmware path in code. The scaffolding exists but nothing behind it processes a real Yocto artifact, so the matrix listing these scans can read as "done" when it isn't:
EmbeddedLinuxYocto + the PlcSps firmware layer offer FirmwareStatic + Sbom + Cve in scan_matrix.rs, and the classifier mapsbitbake→Yocto — but:
FirmwareStatic is a stub — a matrix entry + a ScanPhase only; there is no firmware_static.rs and nothing runs it. → #151
tramiton has no bitbake provider (v0.4.1), so the bitbake→Yocto mapping never fires from real detection. → #150 (now re-scoped to our classifier + SPDX-ingest, no tramiton dep).
Firmware SBOM today is tramiton's source reproducible build (nix seal_and_build), proven for bare-metal MCU (STM32). It does not run a bitbake image build, so no Yocto SBOM is produced today.
Net: the Yocto device-layer coverage is greenfield. What works today = CODESYS control-app SAST/SBOM/CVE + bare-metal/RTOS MCU firmware. Ownership of the Yocto layer stays in this repo: SPDX-ingest (#150) + binary-image static/SBOM (#151) + dynamic QEMU (#149).
## Current-state audit (2026-07-17) — frame is in place, engine is not
Traced the Yocto/firmware path in code. The **scaffolding** exists but nothing behind it processes a real Yocto artifact, so the matrix listing these scans can read as "done" when it isn't:
- **`EmbeddedLinuxYocto` + the PlcSps firmware layer** offer `FirmwareStatic` + `Sbom` + `Cve` in `scan_matrix.rs`, and the classifier *maps* `bitbake→Yocto` — but:
- **`FirmwareStatic` is a stub** — a matrix entry + a `ScanPhase` only; there is no `firmware_static.rs` and nothing runs it. → **#151**
- **tramiton has no bitbake provider (v0.4.1)**, so the `bitbake→Yocto` mapping never fires from real detection. → **#150** (now re-scoped to *our* classifier + SPDX-ingest, no tramiton dep).
- **Firmware SBOM today** is tramiton's source *reproducible build* (nix `seal_and_build`), proven for bare-metal MCU (STM32). It does **not** run a bitbake image build, so **no Yocto SBOM is produced today**.
**Net:** the Yocto device-layer coverage is greenfield. What works today = CODESYS control-app SAST/SBOM/CVE + bare-metal/RTOS MCU firmware. Ownership of the Yocto layer stays in this repo: SPDX-ingest (**#150**) + binary-image static/SBOM (**#151**) + dynamic QEMU (**#149**).
sharang
modified the milestone from Onboarding v1 to R2 · Moat2026-09-20 20:23:41 +00:00
✅ PLCopen XML: ST is analysed as written; FBD and LD are translated into synthetic ST. Inside SFC, the ST/FBD/LD bodies of actions and transitions are analysed.
✅#827: a native CODESYS project (the binary .project, also inside a .projectarchive) is no longer passed over silently. The scan run lists it under SPS-Projekt (natives Format) with the export instruction.
✅#829 (+ #830): an export script for the CODESYS Script Engine, run in the IDE or headless in CI. It writes PLCopen XML with every POU. Download: /docs/downloads/codesys-export-plcopen.py; guide: PLC / SPS → Exporting PLCopen XML automatically.
✅#828: test data and per-target excluded paths (#820, #825) are now left out of PLC targets too.
Decided: the binary .project format is not parsed. The PLCopen XML export is the only route to control-logic SAST.
counting the CODESYS runtime once, not again next to #166.
These need build outputs (tmp/deploy/spdx, the cve-check JSON) and the Yocto release the device uses.
Unchanged: DAST and pentest for both layers (#148, #149) are outside this scope.
## Status 2026-11-04: what changed for the CODESYS and Yocto layers
**CODESYS / PLC layer (SAST, #165)**
- ✅ PLCopen XML: ST is analysed as written; FBD and LD are translated into synthetic ST. Inside SFC, the ST/FBD/LD bodies of actions and transitions are analysed.
- ✅ #827: a native CODESYS project (the binary `.project`, also inside a `.projectarchive`) is no longer passed over silently. The scan run lists it under **SPS-Projekt (natives Format)** with the export instruction.
- ✅ #829 (+ #830): an export script for the CODESYS Script Engine, run in the IDE or headless in CI. It writes PLCopen XML with every POU. Download: `/docs/downloads/codesys-export-plcopen.py`; guide: *PLC / SPS → Exporting PLCopen XML automatically*.
- ✅ #828: test data and per-target excluded paths (#820, #825) are now left out of PLC targets too.
- **Decided:** the binary `.project` format is not parsed. The PLCopen XML export is the only route to control-logic SAST.
- ⏳ Open in #165:
- Rules on the SFC step graph.
- CFC.
- Both need a real export containing LD/FBD/SFC/CFC POUs, made with the script above.
**Yocto layer (#150)**
- ✅ Our own classifier detects Yocto/BitBake layer trees; no Tramiton dependency.
- ✅ Recipe inventory without a build:
- One SBOM component per recipe, with PV, SRC_URI/SRCREV, LICENSE and CPE.
- NVD matching by CPE.
- VEX statements from CVE_STATUS and from `CVE:` patch tags.
- The image content as declared in IMAGE_INSTALL.
- Layer pins plus the Yocto release's end-of-life check.
- ⏳ Open in #150, importing a real build's output:
- create-spdx SPDX (the resolved image content);
- the cve-check JSON (its own verdicts);
- SPDX 3.0, depending on the Yocto release in use;
- counting the CODESYS runtime once, not again next to #166.
- These need build outputs (`tmp/deploy/spdx`, the cve-check JSON) and the Yocto release the device uses.
**Unchanged:** DAST and pentest for both layers (#148, #149) are outside this scope.
Status 2026-11-05: the Yocto build's own output (#150)
Yocto layer: SBOM / CVE
✅#852 reads the image SPDX 2.2 archive (<image>.spdx.tar.zst, create-spdx; Scarthgap and earlier).
For each recipe with packages in the image, it gives version, licence and CPE, marked Im Image (installed by the build).
It also gives the CVEs the recipes' patches fix.
✅#853 adds the new artifact kind build output, uploaded in the wizard and on the target. The scan joins it with the recipe inventory by recipe name, and the build wins:
The version, CPE and image marking come from the build.
An image the SPDX covers is authoritative.
NVD is asked with the built version.
Fixed CVEs become VEX fixed.
✅#854 adds the image's cve-check report (<image>.json), uploaded the same way.
Yocto's verdict comes first: Patched → fixed, Ignored as the CVE_STATUS reason maps.
Unpatched CVEs that our NVD match missed are added.
✅#855 adds the wizard entry and the guide section Embedded Linux / Yocto → Im Image (gebaut).
✅#856 adds the nightly target fw-yocto-built, checked against the agent on stage. It is a layer plus a trimmed real scarthgap 5.0.21 build.
⏳ A target with only build outputs (no layer tree) — in progress.
⏳ SPDX 3.0 (Styhead 5.1 and later) needs a sample from such a build.
⏳ Kernel CVEs filtered by the kernel configuration. In a real image the kernel brings thousands of NVD CVEs; the build's SPDX and cve-check settle almost all of them as fixed today.
Samples: a local scarthgap build with cve-check on (core-image-minimal, qemuarm64). The fixtures in the repo are trimmed copies without local paths.
## Status 2026-11-05: the Yocto build's own output (#150)
**Yocto layer: SBOM / CVE**
- ✅ #852 reads the image SPDX 2.2 archive (`<image>.spdx.tar.zst`, create-spdx; Scarthgap and earlier).
- For each recipe with packages in the image, it gives version, licence and CPE, marked **Im Image (installed by the build)**.
- It also gives the CVEs the recipes' patches fix.
- ✅ #853 adds the new artifact kind **build output**, uploaded in the wizard and on the target. The scan joins it with the recipe inventory by recipe name, and the build wins:
- The version, CPE and image marking come from the build.
- An image the SPDX covers is authoritative.
- NVD is asked with the built version.
- Fixed CVEs become VEX `fixed`.
- ✅ #854 adds the image's cve-check report (`<image>.json`), uploaded the same way.
- Yocto's verdict comes first: Patched → fixed, Ignored as the CVE_STATUS reason maps.
- Unpatched CVEs that our NVD match missed are added.
- ✅ #855 adds the wizard entry and the guide section *Embedded Linux / Yocto → Im Image (gebaut)*.
- ✅ #856 adds the nightly target `fw-yocto-built`, checked against the agent on stage. It is a layer plus a trimmed real scarthgap 5.0.21 build.
- ⏳ A target with **only** build outputs (no layer tree) — in progress.
- ⏳ SPDX 3.0 (Styhead 5.1 and later) needs a sample from such a build.
- ⏳ Kernel CVEs filtered by the kernel configuration. In a real image the kernel brings thousands of NVD CVEs; the build's SPDX and cve-check settle almost all of them as fixed today.
**Samples:** a local scarthgap build with cve-check on (core-image-minimal, qemuarm64). The fixtures in the repo are trimmed copies without local paths.
Status 2026-11-05 (2): Yocto tier 2 is done (#150)
Since the last update, on stage:
✅#857, build output without layers. A target with only its image SPDX or cve-check report is scanned: SBOM, CVEs and VEX come from the build output alone, and the run lists source_code as not run. The scan matrix now turns on the Yocto image SBOM and CVE scans when a build output is attached; they were "planned".
✅#858, kernel CVEs filtered by the configuration. Yocto's own improve_kernel_cve_report.py (OE-Core since Scarthgap) checks each kernel CVE of the Linux kernel CNA against the files the kernel compiled and writes the cve-check report again. Uploaded as a build output, it is mapped to VEX. On the Scarthgap sample (linux-yocto 6.6.151), 2,230 of 22,001 kernel CVEs became not affected (not built) and 337 rejected, with no rebuild needed. The guide has the commands.
✅#859, SPDX 3.0. It reads the create-spdx-3.0 image document (<image>.spdx.json, the default from Styhead 5.1): the installed packages via the rootfs build, the recipe via its build, and the build's VEX (fixed, not affected with the justification).
✅#860, nightly target fw-yocto-spdx3-only. It carries only the SPDX 3.0 document, no layers, and is checked against the agent on stage.
Samples: the local Scarthgap 5.0.21 build (core-image-minimal, qemuarm64), regenerated once with cve-check and once with create-spdx-3.0, and the kernel report from the kernel CNA's data. The fixtures are trimmed copies without local paths.
Still open for this customer case: the ICS/PLC dynamic paths (#148, #149), and #165's SFC/CFC rules, which wait on a real CODESYS export.
## Status 2026-11-05 (2): Yocto tier 2 is done (#150)
Since the last update, on stage:
- ✅ **#857, build output without layers.** A target with only its image SPDX or cve-check report is scanned: SBOM, CVEs and VEX come from the build output alone, and the run lists `source_code` as not run. The scan matrix now turns on the Yocto image SBOM and CVE scans when a build output is attached; they were "planned".
- ✅ **#858, kernel CVEs filtered by the configuration.** Yocto's own `improve_kernel_cve_report.py` (OE-Core since Scarthgap) checks each kernel CVE of the Linux kernel CNA against the files the kernel compiled and writes the cve-check report again. Uploaded as a build output, it is mapped to VEX. On the Scarthgap sample (linux-yocto 6.6.151), **2,230 of 22,001** kernel CVEs became *not affected (not built)* and 337 *rejected*, with no rebuild needed. The guide has the commands.
- ✅ **#859, SPDX 3.0.** It reads the `create-spdx-3.0` image document (`<image>.spdx.json`, the default from Styhead 5.1): the installed packages via the rootfs build, the recipe via its build, and the build's VEX (fixed, not affected with the justification).
- ✅ **#860, nightly target `fw-yocto-spdx3-only`.** It carries only the SPDX 3.0 document, no layers, and is checked against the agent on stage.
**Samples:** the local Scarthgap 5.0.21 build (core-image-minimal, qemuarm64), regenerated once with cve-check and once with create-spdx-3.0, and the kernel report from the kernel CNA's data. The fixtures are trimmed copies without local paths.
**Still open for this customer case:** the ICS/PLC dynamic paths (#148, #149), and #165's SFC/CFC rules, which wait on a real CODESYS export.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Customer case: CODESYS control logic on a Yocto Linux device
A prospective customer runs CODESYS (IEC 61131-3) control applications on a
device whose OS is Yocto embedded Linux. That single device is really two
layers we must cover end-to-end:
the industrial protocols it speaks (CODESYS programming protocol 11740/11741,
OPC UA, Modbus TCP 502, EtherNet/IP, WebVisu HTTP).
network services (SSH, TLS, exposed daemons, web).
Goal: from one onboarded target, produce a clear SBOM, SAST, and simulated
DAST/Pentest across both layers.
Coverage matrix (status as of this issue)
.project+ LD/FBD/SFC/CFC → #165supports_pentest(PlcSps)=false; soft-PLC + ICS modules → #148Legend: ✅ done · 🟡 issue exists / partial · ❌ gap.
Convergence problem
Onboarding binds one
TargetTypeper target, but this device is simultaneouslyPlcSpsandEmbeddedLinuxYocto. #A decides how the two layers converge(composite PlcSps that also runs firmware SBOM/CVE + DAST/pentest when those
artifacts/endpoints are attached, vs. two linked targets).
What to ask the customer (once the gaps are closed)
.project).for Linux SL (soft-PLC container) + a runqemu Yocto image for safe DAST/pentest.
Tracks
Implementation order: #164 → #166 → #165 → (#148/#149 ICS dynamic).
Current-state audit (2026-07-17) — frame is in place, engine is not
Traced the Yocto/firmware path in code. The scaffolding exists but nothing behind it processes a real Yocto artifact, so the matrix listing these scans can read as "done" when it isn't:
EmbeddedLinuxYocto+ the PlcSps firmware layer offerFirmwareStatic+Sbom+Cveinscan_matrix.rs, and the classifier mapsbitbake→Yocto— but:FirmwareStaticis a stub — a matrix entry + aScanPhaseonly; there is nofirmware_static.rsand nothing runs it. → #151bitbake→Yoctomapping never fires from real detection. → #150 (now re-scoped to our classifier + SPDX-ingest, no tramiton dep).seal_and_build), proven for bare-metal MCU (STM32). It does not run a bitbake image build, so no Yocto SBOM is produced today.Net: the Yocto device-layer coverage is greenfield. What works today = CODESYS control-app SAST/SBOM/CVE + bare-metal/RTOS MCU firmware. Ownership of the Yocto layer stays in this repo: SPDX-ingest (#150) + binary-image static/SBOM (#151) + dynamic QEMU (#149).
Status 2026-11-04: what changed for the CODESYS and Yocto layers
CODESYS / PLC layer (SAST, #165)
.project, also inside a.projectarchive) is no longer passed over silently. The scan run lists it under SPS-Projekt (natives Format) with the export instruction./docs/downloads/codesys-export-plcopen.py; guide: PLC / SPS → Exporting PLCopen XML automatically..projectformat is not parsed. The PLCopen XML export is the only route to control-logic SAST.Yocto layer (#150)
CVE:patch tags.tmp/deploy/spdx, the cve-check JSON) and the Yocto release the device uses.Unchanged: DAST and pentest for both layers (#148, #149) are outside this scope.
Status 2026-11-05: the Yocto build's own output (#150)
Yocto layer: SBOM / CVE
<image>.spdx.tar.zst, create-spdx; Scarthgap and earlier).fixed.<image>.json), uploaded the same way.fw-yocto-built, checked against the agent on stage. It is a layer plus a trimmed real scarthgap 5.0.21 build.Samples: a local scarthgap build with cve-check on (core-image-minimal, qemuarm64). The fixtures in the repo are trimmed copies without local paths.
Status 2026-11-05 (2): Yocto tier 2 is done (#150)
Since the last update, on stage:
source_codeas not run. The scan matrix now turns on the Yocto image SBOM and CVE scans when a build output is attached; they were "planned".improve_kernel_cve_report.py(OE-Core since Scarthgap) checks each kernel CVE of the Linux kernel CNA against the files the kernel compiled and writes the cve-check report again. Uploaded as a build output, it is mapped to VEX. On the Scarthgap sample (linux-yocto 6.6.151), 2,230 of 22,001 kernel CVEs became not affected (not built) and 337 rejected, with no rebuild needed. The guide has the commands.create-spdx-3.0image document (<image>.spdx.json, the default from Styhead 5.1): the installed packages via the rootfs build, the recipe via its build, and the build's VEX (fixed, not affected with the justification).fw-yocto-spdx3-only. It carries only the SPDX 3.0 document, no layers, and is checked against the agent on stage.Samples: the local Scarthgap 5.0.21 build (core-image-minimal, qemuarm64), regenerated once with cve-check and once with create-spdx-3.0, and the kernel report from the kernel CNA's data. The fixtures are trimmed copies without local paths.
Still open for this customer case: the ICS/PLC dynamic paths (#148, #149), and #165's SFC/CFC rules, which wait on a real CODESYS export.