Skip to content

Commit ea7d0bd

Browse files
spoorccclaude
andauthored
Upgrade OSCAL artifacts to 1.2.2 and enrich with security-as-code data (#1284)
* Upgrade OSCAL artifacts to 1.2.2 and enrich with security-as-code data Both the prEN 40000-1-4 catalog and the Component Definition are upgraded from OSCAL 1.1.2 to 1.2.2 and significantly enriched: Catalog (cra_pren_4000014_oscal_catalog.json): - oscal-version 1.1.2 → 1.2.2 - metadata.parties: dfetch-org (catalog maintainer) and Angelo D'Amato/Vulnir B.V. (original content author, STAN4CR grant) - metadata.roles: catalog-maintainer, content-creator - metadata.responsible-parties: role→party mapping Component Definition (dfetch.component-definition.json, generated by compliance.py): - oscal-version 1.1.2 → 1.2.2 - metadata.document-ids: stable URI cross-reference - metadata.roles: supplier, maintainer - metadata.parties: dfetch-org organisation with GitHub homepage link - metadata.responsible-parties: supplier and maintainer role mapping - metadata.props: OpenSSF Scorecard URL added - component.purpose: describes what dfetch does and its security-relevant properties - component.responsible-roles: supplier party linked to component - component.links: adds SECURITY.md as vulnerability disclosure reference - component.props: asset-type, vendor-name, license enrichment - implemented-requirements: 21 of 35 requirements now carry evidence links (rel="evidence") pointing to the concrete code or CI workflow file that implements each control — making the compliance mapping machine-verifiable - back-matter: 12 resources (up from 3), adding OpenSSF Scorecard, Scorecard workflow, SLSA Source Provenance workflow, Sigstore attestation workflow, in-toto test-results workflow, CodeQL workflow, dependency-review workflow, GitHub Releases, and verify-integrity how-to doc compliance_data.py: - SOImplementation gets evidence_hrefs: list[tuple[str, str]] field - 21 SOs populated with (href, description) pairs pointing to code/CI evidence compliance.py: - _build_metadata: emits 1.2.2 structure with parties/roles/document-ids - _build_component: adds purpose, responsible-roles, enriched props and links - _build_implemented_requirements: emits evidence links from evidence_hrefs - _build_back_matter: 12 resources with tool/framework/type props - render_rst: references updated to OSCAL 1.2.2 Documentation updated in compliance_track.rst and security_pipeline.rst. Changelog entry added to 0.15.0 (unreleased). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01342LwMTGpgbJXEDptAEF5z * Auto-generate compliance_track.rst and control_register.rst from Python data - Add `note`, `TRACK_A_CONTROLS`, `ANNEX_V_MAP` to compliance_data.py so both RST documents can be rendered without pytm installed - Fix 13 SO_IMPLEMENTATIONS divergences from the curated manual RST: ECR-a adds C-040; ECR-b gains integrity-hash-opt-in gap; ECR-c SO.UserUpdateNotification loses incorrect C-040 reference and gains a note; ECR-d SO.AccessControl gains delegation gap; ECR-e DataTransmittedConfidentiality/ComAuth trimmed to [C-045]; ECR-f DataTransmittedIntegrity corrected to [C-005]; ECR-l LogSecurityRelevantActivities loses C-036 (not a logging control); ECR-i/j gain timeout-gap entries; ECR-m SecureDataDeletion gains note - Add _rst_ctrl_ref(), _format_ref_as_rst(), _format_single_ref() helpers; update _part_i_rows() to emit :ref: cross-references; update Part II table and gap analysis to use RST refs and hyperlinks - Add _render_annex_v(), _render_impl_notes(), render_control_register_rst() - Rewrite render_rst(): auto-gen header, richer preamble, Annex V section, status key, horizontal rules, Notes on Implemented rows - Both doc/explanation/*.rst are now auto-generated committed artifacts; removed 430 lines of manually-maintained duplication Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01342LwMTGpgbJXEDptAEF5z * refactor: move control register to pytm-free tm_controls_data module Eliminates the TRACK_A_CONTROLS static-copy duplication in compliance_data.py. All 31 Track A controls (SC_CONTROLS + USAGE_CONTROLS) now live in a single source-of-truth module (security/tm_controls_data.py) with no pytm dependency. - security/tm_controls_data.py (new): Control dataclass + SC_CONTROLS (20 supply-chain controls) + USAGE_CONTROLS (11 usage controls) - security/tm_elements.py: remove duplicate Control class, re-export from tm_controls_data - security/compliance_data.py: remove duplicate Control class and the 180-line TRACK_A_CONTROLS static fallback; import Control from tm_controls_data - security/tm_supply_chain.py: remove inline CONTROLS list; import SC_CONTROLS as CONTROLS from tm_controls_data - security/tm_usage.py: remove inline CONTROLS list; import USAGE_CONTROLS as CONTROLS from tm_controls_data - security/compliance.py: remove importlib/try-except fallback; _load_track_a_ controls() now reads directly from SC_CONTROLS + USAGE_CONTROLS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01342LwMTGpgbJXEDptAEF5z * fix: address review findings in compliance tooling and docs * security/compliance_data.py: add C-010, C-039, C-043 to SO.Updateability controls list — the note already cited these controls but the controls column showed — causing an inconsistency between the table and the implementation note * security/compliance.py: - _format_single_ref: strip glob pattern from GitHub tree URL so *.yml references link to the directory (valid URL) not the glob path (broken URL) - _load_track_a_controls: honour track_b_only=True by returning [] instead of ignoring the parameter (previously silenced a warning; now actually omits Track A from the merged register when the flag is set) * doc/explanation/security_pipeline.rst: update two stale descriptions - control_register entry: RST (maintained) → RST (generated) - compliance pipeline paragraph: reflect that controls now live in tm_controls_data.py and that control_register is also auto-generated * Regenerate all three derived artifacts from updated source: doc/explanation/compliance_track.rst, doc/explanation/control_register.rst, security/dfetch.component-definition.json (version 0.15.0) Skipped: SO.UserUpdateNotification controls column remains — because the implementation note references only code paths (github_version_check.py), not any formal C-xxx control. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01342LwMTGpgbJXEDptAEF5z --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bcb8fac commit ea7d0bd

12 files changed

Lines changed: 1870 additions & 780 deletions

CHANGELOG.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@ Release 0.15.0 (unreleased)
33

44
* Implement C-043: add ``pip-audit`` OSV gate to the release workflow; publishing is blocked if
55
any known vulnerability is found in dfetch's runtime dependencies
6-
* Add CRA Compliance Track B: OSCAL 1.1.2 Component Definition mapping all CRA Annex I Part I
6+
* Add CRA Compliance Track B: OSCAL 1.2.2 Component Definition mapping all CRA Annex I Part I
77
essential requirements (ECR-a–m) through prEN 40000-1-4 Security Objectives to dfetch controls;
88
covers Part II via prEN 40000-1-3; introduces controls C-043 (release-gate CVE check), C-044
99
(data minimisation policy), and C-046 (exploit mitigation inventory)
10+
* Upgrade OSCAL artifacts to 1.2.2: both the prEN 40000-1-4 catalog and the Component Definition
11+
now declare ``oscal-version: 1.2.2``; the catalog gains ``parties``, ``roles``, and
12+
``responsible-parties`` in its metadata; the Component Definition adds a ``purpose`` field on
13+
the component, a ``supplier`` party, ``document-ids`` for stable cross-referencing,
14+
``responsible-roles``, and ``evidence`` links on every implemented-requirement pointing to the
15+
concrete code or CI workflow file that implements the control — turning the compliance mapping
16+
into a machine-verifiable security-as-code artifact; the back-matter is enriched with references
17+
to the OpenSSF Scorecard, SLSA Source Provenance, Sigstore attestation, in-toto test results,
18+
CodeQL, and dependency-review workflows
1019

1120
Release 0.14.0 (released 2026-06-14)
1221
====================================

doc/explanation/compliance_track.rst

Lines changed: 77 additions & 115 deletions
Large diffs are not rendered by default.

doc/explanation/control_register.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
.. This file is auto-generated by ``python -m security.compliance --control-register``.
2+
Do not edit manually — edit security/compliance_data.py or the threat model files instead.
3+
14
.. _control_register:
25

36
Control Register
47
================
58

6-
All controls implemented by dfetch, sorted by ID. Risk-driven controls emerge
7-
from the :doc:`threat models <security>`; compliance-only controls address CRA
8-
requirements not independently surfaced by the risk analysis.
9+
All controls implemented by dfetch, sorted by ID. Risk-driven controls emerge from the :doc:`threat models <security>`; compliance-only controls address CRA requirements not independently surfaced by the risk analysis.
910

1011
.. list-table::
1112
:header-rows: 1
@@ -69,7 +70,7 @@ requirements not independently surfaced by the risk analysis.
6970
C-009
7071
- Actions commit-SHA pinning
7172
- Risk-driven
72-
- `.github/workflows/ <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
73+
- `.github/workflows/*.yml <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
7374
* - .. _c-010:
7475

7576
C-010
@@ -81,19 +82,19 @@ requirements not independently surfaced by the risk analysis.
8182
C-011
8283
- Minimal workflow permissions
8384
- Risk-driven
84-
- `.github/workflows/ <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
85+
- `.github/workflows/*.yml <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
8586
* - .. _c-012:
8687

8788
C-012
8889
- persist-credentials: false
8990
- Risk-driven
90-
- `.github/workflows/ <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
91+
- `.github/workflows/*.yml <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
9192
* - .. _c-013:
9293

9394
C-013
9495
- Harden-runner (egress block)
9596
- Risk-driven
96-
- `.github/workflows/ <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
97+
- `.github/workflows/*.yml <https://github.com/dfetch-org/dfetch/tree/main/.github/workflows>`_
9798
* - .. _c-015:
9899

99100
C-015
@@ -221,3 +222,4 @@ requirements not independently surfaced by the risk analysis.
221222
- Exploit mitigation inventory
222223
- Compliance-only
223224
- :doc:`compliance_track`
225+

doc/explanation/security_pipeline.rst

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ to produce the two RST threat-model pages (:doc:`threat_model_supply_chain` and
3838
sequence diagram, and tables for assets, threats, and controls.
3939

4040
**Compliance pipeline** —
41-
`security/compliance_data.py <https://github.com/dfetch-org/dfetch/blob/main/security/compliance_data.py>`_
42-
defines the 46 dfetch controls and their mapping to CRA essential requirements
41+
`security/tm_controls_data.py <https://github.com/dfetch-org/dfetch/blob/main/security/tm_controls_data.py>`_
42+
defines all dfetch controls (Track A: risk-driven; Track B: compliance-only controls
43+
in ``compliance_data.py``) and their mapping to CRA essential requirements
4344
and prEN 40000-1-4 security objectives.
4445
`security/compliance.py <https://github.com/dfetch-org/dfetch/blob/main/security/compliance.py>`_
4546
reads those definitions together with the static OSCAL catalog and generates
46-
:doc:`compliance_track` (human-readable RST mapping tables) and
47+
:doc:`compliance_track` (human-readable RST mapping tables),
48+
:doc:`control_register` (the full control register with GitHub references), and
4749
`security/dfetch.component-definition.json <https://github.com/dfetch-org/dfetch/blob/main/security/dfetch.component-definition.json>`_
48-
(machine-readable OSCAL 1.1.2 Component Definition; 1.1.2 is the pinned version —
49-
NIST released 1.2.2 in April 2026, migration not yet performed). The
50-
:doc:`control_register` page is maintained manually and references controls
51-
defined in ``compliance_data.py``.
50+
(machine-readable OSCAL 1.2.2 Component Definition). The Component Definition
51+
includes the supplier party, component purpose, and ``evidence`` links on each
52+
implemented-requirement pointing to the concrete code or CI file that implements
53+
the control — making the mapping machine-verifiable.
5254

5355
**Release attestations** — GitHub Actions generates five cryptographic attestation
5456
types *about dfetch itself* during every release, signed by Sigstore and verifiable
@@ -90,16 +92,17 @@ of their choice:
9092
- CRA Annex I → prEN 40000-1-4 SO.* → dfetch control traceability tables
9193

9294
* - :doc:`control_register`
93-
- RST (maintained)
94-
- All 46 dfetch controls (C-001 to C-046) with references and status
95+
- RST (generated)
96+
- All dfetch controls with type, references, and status
9597

9698
* - `security/dfetch.component-definition.json <https://github.com/dfetch-org/dfetch/blob/main/security/dfetch.component-definition.json>`_
97-
- OSCAL 1.1.2 JSON (pinned)
98-
- Machine-readable Component Definition; maps dfetch controls to CRA ECRs
99+
- OSCAL 1.2.2 JSON (generated)
100+
- Machine-readable Component Definition; maps dfetch controls to CRA ECRs;
101+
includes supplier party, component purpose, and evidence links to code
99102

100103
* - `security/cra_pren_4000014_oscal_catalog.json <https://github.com/dfetch-org/dfetch/blob/main/security/cra_pren_4000014_oscal_catalog.json>`_
101-
- OSCAL 1.1.2 JSON (pinned)
102-
- Static prEN 40000-1-4 catalog (input to compliance pipeline, not generated)
104+
- OSCAL 1.2.2 JSON (static)
105+
- Static prEN 40000-1-4 catalog; includes parties, roles, and responsible-parties
103106

104107
* - :ref:`Release attestations <verify-integrity>`
105108
- Sigstore-signed (GitHub Actions)

0 commit comments

Comments
 (0)