Skip to content

Embedded Linux control software: sub-models, privilege contexts, embedded-linux library - #25

Merged
cpyix merged 6 commits into
mainfrom
feat/embedded-linux
Oct 30, 2026
Merged

cpyix merged 6 commits into
mainfrom
feat/embedded-linux

Conversation

@cpyix

@cpyix cpyix commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Control software that runs as several processes on a Linux industrial PC can now be modelled as a sub-model refining an element of the machine model, with trust boundaries inside a host (privilege contexts). One risk assessment per product (BSI TR-03183-1) is kept.

  • Data model (optional fields, no schema bump per ADR-0015): runs_on, privilege (kernel|root|service|user, account, capabilities), listens_on, authentication, memory_safe, sbom_ref (purl/CPE), refines: <model>/<id>. A process without a zone takes its host's zone. New module topology.py, mirrored in app/src/topology.ts.
  • Rules
    • Errors: runs-on-invalid, runs-on-cycle, refines-unresolved, refines-multiple-parents, refines-cycle.
    • Warnings: exposed-service-unauthenticated, privilege-boundary-gap, host-takeover-understated (no fixed impact threshold), duplicate-assessment, sbom-ref-invalid.
    • Refined and refining elements share threat coverage. CRA coverage is checked once per product.
  • Reports
    • The parent's document contains the sub-model, with ids qualified as software/T-0001. Risk distribution, traceability, approvals and CRA coverage count both models.
    • build no longer renders a sub-model on its own; --model still does.
    • Host, privilege, refinement and boundary columns plus a "technical attack surface" table, shown only when the model uses them.
    • The SVG frames hosts and privilege contexts.
  • Library embedded-linux: 21 element types, 55 threat templates and 14 Linux-specific measures; everything else points at OT measures. library.yaml gains requires: [ot], and element types can preset privilege, authentication and listeners. init -l embedded-linux --example creates main plus a refining sub-model software (validate: 0 errors).
  • GUI
    • Host and privilege-context frames; flows across a privilege boundary are dotted; hosts nest inside zones in ELK auto layout.
    • Element form fields for all new attributes.
    • The building-block palette can be filtered by library.
  • Docs: methodik, pruefregeln, bibliotheksformat, vorlagenreferenz, quick starts, skill and changelog.

Exports (CSV/JSON/XLSX) are unchanged; they run on the example and already carry a model column. OSCAL is import-only and not affected.

Test plan

  • uv run pytest --ignore=tests/e2e: 392 passed (compat corpus v0.1.0–v0.4.0 unchanged)
  • uv run pytest tests/e2e: 68 passed (de/en)
  • ruff, mypy, svelte-check clean
  • scripts/library_coverage.py ot embedded-linux: no issues, 0 gaps
  • threatwright init x -l embedded-linux --example && threatwright validate x: 0 errors; build --format md writes one analysis document

🤖 Generated with Claude Code

cpyix and others added 6 commits October 21, 2026 17:08
…nes on elements

Optional, additive fields (no schema bump, ADR-0015). topology.py answers
where an element runs, its effective zone (inherited from the host) and
which boundary a flow crosses; assistant, ARC, reports and the SVG diagram
use the effective zone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…, host takeover

New errors runs-on-invalid, runs-on-cycle, refines-unresolved,
refines-multiple-parents, refines-cycle; new warnings
exposed-service-unauthenticated, privilege-boundary-gap,
host-takeover-understated, duplicate-assessment, sbom-ref-invalid.
Refined and refining elements share threat coverage, and CRA coverage is
checked once per product (model plus its sub-models).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lumns, attack surface

A model and the sub-models refining it form one document and one
assessment: sub-model ids are qualified (software/T-0001), risk
distribution, traceability, approvals and CRA coverage count them together,
and build no longer renders a sub-model on its own (--model still does).
Element and flow tables gain host, privilege context, refinement and
boundary columns when the model uses them, plus a technical attack surface
table. The SVG diagram frames hosts and privilege contexts and dashes flows
across a privilege boundary.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
New bundled library for control software on a Linux industrial PC:
21 element types (processes, OS services, kernel and modules, shared
memory, update staging, local IPC, SSH, SMTP, USB HID, people with system
access), 55 threat templates and 14 Linux-specific measures; everything
else points at existing OT measures. library.yaml gains `requires`
(checked as library-invalid), element types can preset privilege,
authentication and listens_on. init -l embedded-linux brings ot along;
--example creates a machine model main and a sub-model software whose host
refines the industrial PC (validate: 0 errors).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…by library

The diagram frames each host with what runs on it and each privilege
context inside, draws flows across a privilege boundary dotted and nests
hosts inside zones in the auto layout; processes take the zone of their
host. The element form edits runs_on, privilege, listens_on,
authentication, memory_safe, purl/CPE and refines (elements of the other
models come with the model payload). The palette filters building blocks
by library once more than one is active; /api/library names each type's
library. Adding embedded-linux in the wizard adds ot first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
methodik (sub-models and privilege contexts), bibliotheksformat (requires,
element defaults, new library), vorlagenreferenz (columns and variables),
quick starts, agent skill and changelog.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cpyix
cpyix merged commit 9ae8367 into main Oct 30, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant