compliance-trestle

Miradi inayofuata mazoea bora hapa chini inaweza kujihakikisha kwa hiari na kuonyesha kuwa wamepata nishani ya mazoea bora ya Open Source Security Foundation (OpenSSF).

Hakuna seti ya mazoea yawezayo kuhakikisha kuwa programu haitakuwa na kasoro au udhaifu; hata mbinu rasmi zinaweza kushindwa ikiwa vipimo au dhana ni sahihi. Wala hakuna seti ya mazoea yawezayo kuhakikisha kuwa mradi utaendelea kuwa na jamii ya maendeleo yenye afya na inayofanya kazi vizuri. Hata hivyo, kufuata mazoea bora kunaweza kusaidia kuboresha matokeo ya miradi. Kwa mfano, baadhi ya mazoea huwezesha ukaguzi wa watu wengi kabla ya kutolewa, ambayo inaweza kusaidia kupata udhaifu wa kiufundi ambao vinginevyo ni vigumu kupata na kusaidia kujenga uaminifu na hamu ya mwingiliano wa kurudia kati ya wasanidi programu kutoka makampuni tofauti. Ili kupata nishani, vigezo vyote vya LAZIMA na LAZIMA WALA USIWAHI lazima vifuatwe, vigezo vyote vya INAPASWA lazima vifuatwe AU visivyo fufufutiliana na thibitisho, na vigezo vyote vya PENDEKEZA lazima vifuatwe AU visivyo fufufutiliana (tunataka vifikiwe angalau). Ikiwa unataka kuingiza maandishi ya thibitisho kama maoni ya jumla, badala ya kuwa maelezo ya busara kwamba hali ni inakubaliwa, anza kifungu cha maandishi na '//' ikifuatiwa na nafasi. Maoni ni karibu kupitia tovuti ya GitHub kama masuala au maombi ya kuvuta Kuna pia orodha ya barua pepe kwa majadiliano ya jumla.

Tunafuraha kutoa habari katika lugha nyingi, hata hivyo, ikiwa kuna mgongano au kutokuwa na usawa kati ya tafsiri, toleo la Kiingereza ni toleo lenye mamlaka.
Ikiwa huu ni mradi wako, tafadhali onyesha hadhi ya nishani yako kwenye ukurasa wa mradi wako! Hadhi ya nishani inaonekana kama hii: Kiwango cha nishani kwa mradi 9408 ni silver Hapa ni jinsi ya kuiweka:
Unaweza kuonyesha hali ya nishani yako kwa kuweka hii katika faili yako ya markdown:
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9408/badge)](https://www.bestpractices.dev/projects/9408)
au kwa kuweka hii katika HTML yako:
<a href="https://www.bestpractices.dev/projects/9408"><img src="https://www.bestpractices.dev/projects/9408/badge"></a>


Hizi ni vigezo vya kiwango cha Fedha. Unaweza pia kuangalia vigezo vya kiwango cha Kupita au Dhahabu.

Baseline Series: Kiwango cha Msingi 1 Kiwango cha Msingi 2 Kiwango cha Msingi 3

        

 Misingi 17/17 ●

  • Jumla

    Kumbuka kwamba miradi mingine inaweza kutumia jina sawa.

    An opinionated tooling platform for managing compliance as code, using continuous integration and NIST's OSCAL standard.

    Tafadhali tumia muundo wa maneno ya leseni ya SPDX; mifano ni pamoja na "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "GPL-2.0+", "LGPL-3.0+", "MIT", na "(BSD-2-Clause OR Ruby)". Usitumie alama za nukuu za moja au mbili.
    Ikiwa kuna lugha zaidi ya moja, ziorodhe kama thamani zilizotengwa kwa koma (nafasi ni za hiari) na ziorodhe kuanzia iliyotumiwa zaidi hadi iliyotumiwa kidogo. Ikiwa kuna orodha ndefu, tafadhali orodhesha angalau tatu za kawaida zaidi. Ikiwa hakuna lugha (k.m., huu ni mradi wa nyaraka tu au wa majaribio tu), tumia herufi moja "-". Tafadhali tumia herufi kubwa za kawaida kwa kila lugha, k.m., "JavaScript".
    Common Platform Enumeration (CPE) ni mpango wa kuweka majina yenye muundo kwa mifumo ya teknolojia ya habari, programu, na vifurushi. Inatumika katika mifumo na hifadhidata nyingi wakati wa kuripoti udhaifu.
  • Mahitaji ya awali


    Mradi LAZIMA ufikie nishani ya kiwango cha kuhitimu. [achieve_passing]

  • Maudhui ya kimsingi ya tovuti ya mradi


    Habari juu ya jinsi ya kuchangia LAZIMA ijumuishe mahitaji ya michango inayokubalika (k.m., rejea kwa kiwango chochote kinachohitajika cha msimbo). (URL inahitajika) [contribution_requirements]
  • Usimamizi wa mradi


    Mradi UNAPASWA kuwa na utaratibu wa kisheria ambapo wasanidi wote wa kiasi kisicho kidogo cha programu ya mradi wanathibitisha kwamba wameruhusiwa kisheria kufanya michango hii. Mbinu ya kawaida na rahisi ya kutekeleza hii ni kwa kutumia Cheti cha Msanidi cha Asili (DCO), ambapo watumiaji huongeza "signed-off-by" katika ahadi zao na mradi unaunganisha kwenye tovuti ya DCO. Hata hivyo, hii YAWEZA kutekelezwa kama Makubaliano ya Leseni ya Mchangiaji (CLA), au utaratibu mwingine wa kisheria. (URL inahitajika) [dco]
    DCO ni utaratibu unaopendekeza kwa sababu ni rahisi kutekeleza, kufuatilia katika msimbo wa chanzo, na git inasaidia moja kwa moja kipengele cha "signed-off" kwa kutumia "commit -s". Ili kuwa na ufanisi zaidi ni bora ikiwa nyaraka za mradi zinaeleza maana ya "signed-off" kwa mradi huo. CLA ni makubaliano ya kisheria yanayofafanua masharti ambayo kazi za kiakili zimetolewa leseni kwa shirika au mradi. Makubaliano ya mgawo wa mchangiaji (CAA) ni makubaliano ya kisheria yanayohamisha haki katika kazi ya kiakili kwa chama kingine; miradi haihitajiki kuwa na CAA, kwa kuwa kuwa na CAA huongeza hatari kwamba wachangiaji watarajiwa hawatachangia, hasa ikiwa mpokeaji ni shirika la faida. Apache Software Foundation CLAs (leseni ya mchangiaji wa mtu binafsi na CLA ya kampuni) ni mifano ya CLA, kwa miradi ambayo inaamua kwamba hatari za aina hizi za CLA kwa mradi ni chini ya manufaa yao.

    The project uses the Developer Certificate of Origin (DCO) 1.1 — the same mechanism used by the Linux Kernel community (https://developercertificate.org). This is documented in CONTRIBUTING.md (https://github.com/oscal-compass/compliance-trestle/blob/develop/CONTRIBUTING.md), which explains what Signed-off-by means for this project, provides an example trailer (Signed-off-by: John Doe john.doe@example.com), and instructs contributors to use git commit --signoff. DCO sign-off is technically enforced on every pull request by a dedicated CI workflow (https://github.com/oscal-compass/compliance-trestle/blob/develop/.github/workflows/verify-signoff.yml) that checks every non-merge commit to confirm the Signed-off-by trailer is present and matches the commit author's email address, blocking the PR if it does not.



    Mradi LAZIMA ufafanue kwa uwazi na kuandika muundo wake wa utawala wa mradi (njia ya kufanya maamuzi, ikiwa ni pamoja na majukumu muhimu). (URL inahitajika) [governance]
    Kunahitaji kuwa na njia fulani iliyowekwa vyema ya kuandikwa ya kufanya maamuzi na kutatua migogoro. Katika miradi midogo, hii inaweza kuwa rahisi kama "mmiliki wa mradi na kiongozi hufanya maamuzi yote ya mwisho". Kuna miundo mbalimbali ya utawala, ikiwa ni pamoja na dictator wa wema na meritocracy rasmi; kwa maelezo zaidi, angalia Miundo ya utawala. Mbinu zote mbili za kati (k.m., mtunzaji mmoja) na zisizo za kati (k.m., watunzaji wa kikundi) zimetumika kwa mafanikio katika miradi. Habari za utawala hazihitajiki kuandika uwezekano wa kuunda uma wa mradi, kwa kuwa hiyo ni iwezekanavyo kila wakati kwa miradi ya FLOSS.

    URL (primary):
    https://github.com/oscal-compass/community/blob/main/GOVERNANCE.md

    URL (secondary — roles):
    https://github.com/oscal-compass/community/blob/main/MEMBERSHIP.md

    Justification text:

    The compliance-trestle project is governed under the OSCAL Compass community governance model, documented at https://github.com/oscal-compass/community/blob/main/GOVERNANCE.md. This document defines all key roles (Member, Reviewer, Maintainer, Oversight Committee), the two-tier decision-making process (lazy consensus for day-to-day decisions; explicit simple or supermajority voting via GitVote for formal decisions), dispute resolution (escalation to the Oversight Committee with binding authority), and the process for electing and removing leadership. Detailed role requirements and responsibilities are in https://github.com/oscal-compass/community/blob/main/MEMBERSHIP.md. Active project maintainers are listed in the project-level MAINTAINERS.md.



    Mradi LAZIMA upitishe kanuni ya mwenendo na kuiweka mahali pa kawaida. (URL inahitajika) [code_of_conduct]
    Miradi inaweza kuweza kuboresha uadilifu wa jamii yao na kuweka matarajio kuhusu tabia inayokubalika kwa kupitisha kanuni ya mwenendo. Hii inaweza kusaidia kuepuka matatizo kabla hayajatokea na kufanya mradi kuwa mahali pa kukaribishwa zaidi ili kuhimiza michango. Hii inapaswa kuzingatia tu tabia ndani ya jamii/mahali pa kazi pa mradi. Mifano ya kanuni za mwenendo ni kanuni ya mwenendo ya kernel ya Linux, Kanuni ya Mwenendo ya Agano la Mchangiaji, Kanuni ya Mwenendo ya Debian, Kanuni ya Mwenendo ya Ubuntu, Kanuni ya Mwenendo ya Fedora, Kanuni ya Mwenendo ya GNOME, Kanuni ya Mwenendo ya Jamii ya KDE, Kanuni ya Mwenendo ya Jamii ya Python, Mwongozo wa Mwenendo wa Jamii ya Ruby, na Kanuni ya Mwenendo ya Rust.

    URL:
    https://github.com/oscal-compass/community/blob/main/CODE_OF_CONDUCT.md

    Justification text:

    The project adopts the CNCF Code of Conduct, hosted at the OSCAL Compass community level at https://github.com/oscal-compass/community/blob/main/CODE_OF_CONDUCT.md. It is referenced from the project README.md ("Participation in the OSCAL Compass community is governed by the Code of Conduct") and from the project's documentation site at https://oscal-compass.github.io/compliance-trestle/latest/contributing/code_of_conduct/.



    Mradi LAZIMA ufafanue kwa uwazi na kuandika hadharani majukumu muhimu katika mradi na wajibu wao, ikiwa ni pamoja na kazi zozote ambazo majukumu hayo lazima yafanywe. Lazima iwe wazi ni nani ana jukumu lipi, ingawa hii haiwezi kuandikwa kwa njia ile ile. (URL inahitajika) [roles_responsibilities]
    Nyaraka kwa utawala na majukumu na wajibu zinaweza kuwa mahali pamoja.

    URL (primary — role definitions):
    https://github.com/oscal-compass/community/blob/main/MEMBERSHIP.md

    Justification text:

    Key roles and their responsibilities are defined in https://github.com/oscal-compass/community/blob/main/MEMBERSHIP.md, which documents the Member, Reviewer, Maintainer, and Oversight Committee roles — including requirements to hold each role, specific responsibilities, and privileges. Who holds each role is publicly named in two places: project-level maintainers (Maintainer role) are listed with their GitHub handles in https://github.com/oscal-compass/compliance-trestle/blob/develop/MAINTAINERS.md, and org-level role holders (Oversight Committee, Org Admins, Community Maintainers) are listed with their GitHub handles and affiliations in https://github.com/oscal-compass/community/blob/main/MAINTAINERS.md.



    Mradi LAZIMA uweze kuendelea kwa usumbufu mdogo ikiwa mtu yeyote anakufa, anakuwa katika hali ya kudhoofika, au vinginevyo hawezi au hataki kuendelea kusaidia mradi. Hasa, mradi LAZIMA uweze kuunda na kufunga masuala, kukubali mabadiliko yaliyopendekezwa, na kutoa matoleo ya programu, ndani ya wiki moja ya uthibitishaji wa upotevu wa msaada kutoka kwa mtu yeyote mmoja. Hii INAWEZA kufanywa kwa kuhakikisha mtu mwingine ana funguo zozote zinazohitajika, nywila, na haki za kisheria ili kuendelea mradi. Watu binafsi wanaoendesha mradi wa FLOSS WANAWEZA kufanya hii kwa kuweka funguo katika sanduku la kufungia na wosia unaowezesha haki zozote zinazohitajika za kisheria (k.m., kwa majina ya DNS). (URL inahitajika) [access_continuity]

    Access Continuity Explanation for OpenSSF Best Practices [access_continuity]

    The project satisfies the access continuity requirement through shared organization administration, distributed maintainership, and documented governance procedures:

    1. Multi-Admin and Multi-Org Redundancy: Administrative access, credentials, and repository rights across the oscal-compass organization are shared among multiple Org Admins from different member organizations, plus a Linux Foundation backstop account (thelinuxfoundation). This ensures that operations (managing issues, merging pull requests, releasing software) can proceed without disruption if any single person is lost.
    2. Succession and Vacancy Rules: Formal vacancy appointment and governance policies allow the multi-member Oversight Committee to reallocate responsibilities and maintain uninterrupted project continuity within one week.

    Reference URLs



    Mradi INAPASWA kuwa na "bus factor" ya 2 au zaidi. (URL inahitajika) [bus_factor]
    "Bus factor" (pia inajulikana kama "truck factor") ni idadi ya chini ya washiriki wa mradi ambao wanapaswa kutoweka ghafla kutoka kwenye mradi ("kupigwa na basi") kabla ya mradi kusimama kwa sababu ya ukosefu wa wafanyakazi wenye elimu au wenye uwezo. Zana ya truck-factor inaweza kukadiria hii kwa miradi kwenye GitHub. Kwa maelezo zaidi, angalia Kutathmini Bus Factor ya Hifadhi za Git na Cosentino et al.

    OpenSSF Silver — bus_factor Justification
    Project: OSCAL Compass · Criterion ID: bus_factor

    Criterion
    The project SHOULD have a bus factor of 2 or more.
    URL
    https://github.com/oscal-compass/community/blob/main/GOVERNANCE.md#access-continuity
    Justification
    OSCAL Compass maintains a bus factor of 2 or more. The project's Access Continuity governance section documents that no single person is a point of failure. A six-member Oversight Committee drawn from at least three independent organizations (IBM, Red Hat, Sunstone Secure) collectively holds all necessary repository access, credentials, and legal rights. Multiple Org Admins — including a Linux Foundation backstop — ensure continuity of operations. Project knowledge is actively distributed across contributors from different organizations, so the project can continue to function within one week of losing any individual contributor. Vacancies are filled by appointment per the documented Vacancies process.


  • Nyaraka


    Mradi LAZIMA uwe na ramani ya barabara iliyoandikwa inayoeleza kile mradi unakusudia kufanya na kutofanya kwa angalau mwaka unaofuata. (URL inahitajika) [documentation_roadmap]
    Mradi huenda usitimiza ramani ya barabara, na hiyo ni sawa; kusudi la ramani ya barabara ni kusaidia watumiaji na wachangiaji watarajiwa kuelewa mwelekeo unaokusudiwa wa mradi. Haihitaji kuwa na maelezo mengi.

    ROADMAP.md is a dedicated, top-level file that explicitly describes what the OSCAL Compass project intends to do (5 named goals covering codebase maintenance, agentic authoring, community growth, OpenSSF Best Practices, and CNCF Incubation) and not do (enterprise support, certification authority functions, vulnerability scanning, and legacy format support) over the next year.

    Key URL:

    https://github.com/oscal-compass/community/blob/main/ROADMAP.md
    The document is intentionally high-level (not feature-by-feature), which is exactly what the criterion expects — enough for potential users and contributors to understand the project's direction without requiring exhaustive detail.



    Mradi LAZIMA ujumuishe nyaraka za muundo (pia inajulikana kama muundo wa kiwango cha juu) wa programu inayozalishwa na mradi. Ikiwa mradi hauzalishi programu, chagua "haihusiki" (N/A). (URL inahitajika) [documentation_architecture]
    Muundo wa programu unaeleza miundo ya msingi ya programu, yaani, vipengele vikuu vya programu, uhusiano kati yao, na mali muhimu za vipengele na uhusiano hivi.

    documentation_architecture — Compliance Evidence
    Project: compliance-trestle (oscal-compass) · Criterion: The project MUST include documentation of the architecture (high-level design) of the software it produces.

    Requirement Summary
    A software architecture explains a program's fundamental structures — its major components, the relationships among them, and the key properties of those components and relationships. The criterion requires at least one URL pointing to that documentation.

    Primary URL (Published Documentation)
    Live architecture page
    https://oscal-compass.github.io/compliance-trestle/latest/architecture/
    This is the publicly hosted, versioned architecture page rendered from the project's MkDocs-Material documentation site. It is permanently accessible under the latest alias managed by mike.

    Secondary URL (Repository Source)
    Markdown source in repository (develop branch)
    https://github.com/oscal-compass/compliance-trestle/blob/develop/docs/architecture.md
    The architecture document is tracked under version control alongside the code it describes at docs/architecture.md.

    What the Architecture Document Covers
    The document addresses all three elements the criterion requires.

    1. Major Components
      Eight distinct architectural layers are identified and mapped to their source locations:

    Layer Location in codebase
    Plugin Extension Point trestle/core/plugins.py
    Entry Points — CLI & Python API trestle/cli.py, trestle/core/repository.py
    Command Layer trestle/core/commands/
    Catalog API trestle/core/catalog/
    Profile Resolver trestle/core/profile_resolver.py, trestle/core/resolver/
    Validator Framework trestle/core/validator.py, trestle/core/validator_factory.py
    Markdown / Jinja / DrawIO Authoring trestle/core/control_{reader,writer}.py, trestle/core/markdown/, trestle/core/jinja/, trestle/core/draw_io.py
    Signing & Canonicalization trestle/core/signing.py, trestle/core/canonicalization.py
    Transform & Task Pipeline trestle/transforms/, trestle/tasks/
    OSCAL Object Model trestle/oscal/, trestle/core/base_model.py
    Workspace & Remote I/O trestle/common/, trestle/core/remote/cache.py
    2. Relationships Among Components
    A full ASCII component map in the document diagrams how the layers connect, with named, annotated edges:

    Plugin packages inject CommandBase subclasses into Trestle.subcommands at module import time.
    The CLI and Python API both dispatch to the Command Layer.
    Commands delegate business logic to Core Services (Catalog API, Profile Resolver, Validators, Authoring, Signing).
    All Core Services read and write through the OSCAL Object Model.
    The OSCAL Object Model serialises to/from Workspace & Remote I/O.
    3. Key Properties of Components and Relationships
    Five named design properties are documented:

    Property Description
    Workspace-centric storage A .trestle/-rooted directory tree; documents may be single files or split into sub-directory hierarchies following the object hierarchy.
    Schema-enforced I/O Every disk read/write passes through the Pydantic v2 model layer, guaranteeing schema validity at the boundary between disk and memory.
    Composable pipelines Pipeline / Filter pattern (trestle/core/pipeline.py) used for profile resolution and OSCAL assembly; stages are independently testable and reusable.
    Separation of concerns: CLI vs. API Commands delegate to core service classes; repository.py exposes the same services to Python callers without going through the CLI argument layer.
    Extensibility via plugins The trestle_* package naming convention allows third-party command packages to be auto-discovered without any core dependency on them.
    The document also includes a Security Requirements & Guarantees section specifying what users can and cannot rely on: input validation, SSRF protection, Jinja sandboxing, cryptographic provenance (DSSE / in-toto), supply chain integrity (SLSA), plugin trust boundaries, and encryption-at-rest limitations.

    Integration with Broader Documentation Site
    The architecture page is a top-level navigation item in the project's documentation site at https://oscal-compass.github.io/compliance-trestle/latest/, which is referenced from the project README.md:

    "Complete documentation, tutorials, and background on compliance can be found here."
    Criterion Satisfaction Summary
    Criterion element Status Evidence
    URL to architecture documentation ✅ Met oscal-compass.github.io/…/architecture/
    Source file in repository ✅ Met docs/architecture.md (develop branch)
    Major components identified ✅ Met 11 layers named and mapped to source paths
    Relationships among components ✅ Met ASCII component map with labeled directional edges
    Key properties of components/relationships ✅ Met 5 named design properties + security guarantees section
    Versioned & publicly accessible ✅ Met MkDocs-Material + mike, always available at /latest/architecture/



    Mradi LAZIMA uandike kile mtumiaji anaweza na asiweze kutarajia kwa suala la usalama kutoka kwa programu inayozalishwa na mradi ("mahitaji yake ya usalama"). (URL inahitajika) [documentation_security]
    Haya ni mahitaji ya usalama ambayo programu inakusudiwa kukidhi.

    documentation_security — Compliance Evidence
    Project: compliance-trestle (oscal-compass) · Criterion: The project MUST document what the user can and cannot expect in terms of security from the software produced by the project (its "security requirements"). (URL required)

    Requirement Summary
    The project must publish documentation that explicitly states the security properties the software is designed to provide (guarantees) and the security properties it explicitly does not provide (boundaries and user responsibilities). At least one URL is required.

    URL 1 — Architecture: Security Requirements & Guarantees Section
    Published documentation page (direct anchor)
    https://oscal-compass.github.io/compliance-trestle/latest/architecture/#security-requirements-guarantees
    Markdown source in repository (develop branch)
    https://github.com/oscal-compass/compliance-trestle/blob/develop/docs/architecture.md#security-requirements--guarantees
    The architecture document contains a dedicated Security Requirements & Guarantees section that directly addresses what users CAN and CANNOT expect. It is structured in exactly the two-part form the criterion requires:

    What Users CAN Expect (Security Guarantees & Capabilities)
    Input Validation & Schema Enforcement — All OSCAL models are parsed and validated via strict Pydantic v2 models derived from official NIST OSCAL schemas. Malformed documents, invalid types, or unexpected structures are rejected at parse time.
    SSRF & Remote Resource Protection — Remote resource retrieval (trestle/core/remote/cache.py and trestle/core/remote/security.py) enforces HTTPS/SFTP and includes SSRF protections. Cloud metadata endpoints (e.g., 169.254.169.254, metadata.google.internal) and loopback addresses are blocked unconditionally. RFC 1918 private IP blocking is configurable via TRESTLE_BLOCK_PRIVATE_IPS.
    Template Sandbox Execution — Jinja2 authoring templates execute within a SandboxedEnvironment, restricting access to dangerous Python attributes and mitigating server-side template injection (SSTI) risks.
    Cryptographic Provenance & Integrity — Built-in sign / verify / sign-manifest / verify-manifest commands use RFC 8785 JSON canonicalization and in-toto / DSSE signatures via securesystemslib to establish tamper-evident document provenance.
    Supply Chain Integrity — Release distributions include SLSA build provenance attestations and PyPI trusted publishing.
    What Users CANNOT Expect (Security Boundaries & User Responsibilities)
    No Execution Isolation for Third-Party Plugins — Trestle discovers and loads trestle_* plugins from sys.path without sandboxing. Users are responsible for ensuring installed plugins are trusted.
    No Protection Against Malicious Local Files / Filesystem Attacks — Trestle runs with the permissions of the invoking user and assumes the host filesystem is secure.
    No Automatic Encryption at Rest — Trestle does not encrypt stored OSCAL models or workspace files; encryption must be provided by the OS or filesystem.
    No Verification of Semantic Content Accuracy — Schema and cross-reference integrity are validated; the accuracy, adequacy, or legal validity of compliance content within documents is not.
    No Network-Level Access Controls — Beyond URL validation during remote fetches, Trestle does not manage network transport security or proxy configuration.
    URL 2 — SECURITY.md (Repository Security Policy)
    SECURITY.md in repository
    https://github.com/oscal-compass/compliance-trestle/blob/develop/SECURITY.md
    SECURITY.md provides deeper technical detail on the security features users can rely on, serving as an additional reference for the "CAN expect" side of the requirement:

    Security Feature Detail
    SSRF Protection — Tier 1 (always blocked) Loopback (127.0.0.0/8, ::1/128), link-local (169.254.0.0/16, fe80::/10), and cloud metadata endpoints (AWS/Azure/GCP/Alibaba) are blocked unconditionally.
    SSRF Protection — Tier 2 (configurable) RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) allowed by default; blocked when TRESTLE_BLOCK_PRIVATE_IPS=true. Private-IP accesses are logged as warnings.
    Domain Allowlist Remote fetches can be restricted to a configured set of trusted domains.
    Path Traversal Protection URL path validation blocks .. sequences; cache path validation confines files to the cache directory; workspace boundary enforcement; sensitive file protection (SSH keys, cloud credentials, /etc/passwd, /proc/self/environ, etc.).
    Scheme Restrictions Only HTTPS and SFTP are permitted for remote URLs. HTTP, FTP, and other schemes are rejected.
    Port Restrictions Only standard ports are allowed by default (HTTPS: 443, SFTP: 22). Non-standard ports are blocked unless explicitly configured.
    Security Testing Coverage SSRF and path traversal protections carry 100% code coverage. Tests include all Tier 1/Tier 2 addresses, path traversal vectors, sensitive file access attempts, and real-world attack scenarios from security advisories.
    Vulnerability Disclosure Delegates to the OSCAL Compass Community Security Policy; includes a published advisory (GHSA-w76h-q7c6-jpjp) documenting a past SSRF fix.
    Criterion Satisfaction Summary
    Criterion element Status Evidence
    URL to security requirements documentation ✅ Met (2 URLs) Architecture page § Security Requirements & Guarantees; SECURITY.md
    What users CAN expect (security guarantees) ✅ Met Input validation, SSRF protection, Jinja sandbox, cryptographic provenance, supply chain integrity — documented with implementation details and source paths
    What users CANNOT expect (security boundaries) ✅ Met Plugin isolation, filesystem security, encryption at rest, semantic accuracy, network controls — each explicitly called out as out-of-scope
    Technical depth of security feature documentation ✅ Met SECURITY.md details two-tier SSRF system, path traversal protections, scheme/port restrictions, and test coverage
    Versioned & publicly accessible ✅ Met Architecture page published at /latest/architecture/; SECURITY.md in develop branch on GitHub



    Mradi LAZIMA utoe mwongozo wa "kuanza haraka" kwa watumiaji wapya kuwasaidia kufanya kitu haraka na programu. (URL inahitajika) [documentation_quick_start]
    Wazo ni kuonyesha watumiaji jinsi ya kuanza na kufanya programu ifanye chochote. Hii ni muhimu sana kwa watumiaji watarajiwa kuanza.

    REQUIREMENT: documentation_quick_start

    The project MUST provide a "quick start" guide for new users
    to help them quickly do something with the software. (URL required)

    HOW IT IS MET

    File : docs/quick-start.md
    URL : https://oscal-compass.github.io/compliance-trestle/latest/quick-start/

    The guide walks a new user through five steps in under five minutes:

    1. Install: pip install compliance-trestle
    2. Init: trestle init
    3. Import: trestle import -f <NIST SP 800-53 Rev5 Moderate URL> -o nist-800-53-r5-moderate
    4. Validate: trestle validate -f catalogs/nist-800-53-r5-moderate/catalog.json
    5. Explore: trestle describe -f catalogs/nist-800-53-r5-moderate/catalog.json

    Each step includes expected terminal output.
    The guide is also linked from README.md (line 73).

    REFERENCES

    Source : docs/quick-start.md
    URL : https://oscal-compass.github.io/compliance-trestle/latest/quick-start/



    Mradi LAZIMA ufanye jitihada ya kuweka nyaraka kulingana na toleo la sasa la matokeo ya mradi (ikiwa ni pamoja na programu inayozalishwa na mradi). Kasoro yoyote inayojulikana ya nyaraka inayofanya isilingane LAZIMA irekebishwe. Ikiwa nyaraka kwa ujumla ni za sasa, lakini kwa makosa inajumuisha baadhi ya maelezo ya zamani ambayo sio ya kweli tena, ichukue tu kama kasoro, kisha ifuatilie na urekebishe kama kawaida. [documentation_current]
    Nyaraka ZINAWEZA kujumuisha habari kuhusu tofauti au mabadiliko kati ya matoleo ya programu na/au kuunganisha kwa matoleo ya zamani ya nyaraka. Kusudi la kigezo hiki ni kwamba jitihada inafanywa ili kuweka nyaraka kulingana, siyo kwamba nyaraka lazima ziwe kamili.

    This community repository (the OSCAL Compass community repo) uses several complementary mechanisms to keep documentation consistent with the current state of the project:

    1. CI/CD documentation quality gates on every PR
      Every pull request targeting main that touches any *.md file is automatically checked by two GitHub Actions workflows:

    .github/workflows/docs.yml — runs markdownlint-cli2 across all Markdown files. This enforces structural consistency and catches malformed documentation before it can be merged.
    .github/workflows/ci.yml — runs spellcheck (pyspelling + aspell) on every Markdown file. A custom wordlist at .github/wordlist.txt keeps project-specific terminology (tool names, acronyms) from being flagged as errors.
    Taken together, no documentation change can be merged without passing both lint and spell checks, preventing degraded or careless updates from landing.

    1. OSCAL proposal validation keeps structured docs in sync
      .github/workflows/proposals.yml installs Trestle (the project's own tool) from requirements.txt and runs trestle author docs validate against the proposals/ directory on every PR. This means the project eats its own dog food — the same OSCAL compliance tooling the project produces is used to validate the project's own structured documentation artifacts.

    2. README and CONTRIBUTING reflect current project structure
      README.md and CONTRIBUTING.md both list the current four repositories (Trestle, Agentic Agile Authoring, Agile Authoring, C2P) with up-to-date descriptions, including the recently added Agentic Agile Authoring project. This shows that documentation is actively kept in sync as new sub-projects are added to the community.

    3. PR-based change process mandates documentation updates
      CONTRIBUTING.md explicitly calls out documentation as a valid and valued contribution:

    "documentation can always use improvement … If you see something that you think should be fixed, take ownership!"

    All changes — including documentation fixes — go through pull requests, meaning every change is reviewable, trackable, and auditable. Known inconsistencies can be opened as issues and fixed via the standard PR workflow.

    1. Living governance and membership documents
      GOVERNANCE.md, MAINTAINERS.md, MEMBERSHIP.md, and EMERITUS.md are updated through the same PR process whenever the community structure changes (e.g., a maintainer steps down triggers both a MAINTAINERS.md PR and an EMERITUS.md update). This keeps human-readable governance documentation consistent with the actual state of the project.

    Key URLs
    Resource Purpose
    https://github.com/oscal-compass/community/blob/main/README.md Primary community documentation, kept current
    https://github.com/oscal-compass/community/actions/workflows/docs.yml CI lint gate on all Markdown PRs
    https://github.com/oscal-compass/community/actions/workflows/ci.yml CI spellcheck gate on all Markdown PRs
    https://github.com/oscal-compass/community/actions/workflows/proposals.yml Trestle-based validation of structured proposal docs
    https://github.com/oscal-compass/community/blob/main/CONTRIBUTING.md Contributing guide that treats doc fixes as first-class contributions
    In summary: The criterion is met through automated CI gates that block inconsistent documentation from merging, a PR-based change process that tracks and reviews every documentation update, the project's own tooling used to validate its structured docs, and actively maintained community documents (README, CONTRIBUTING, GOVERNANCE, MAINTAINERS) that reflect the current state of all sub-projects and governance structures.



    Ukurasa wa mbele wa hifadhi ya mradi na/au tovuti LAZIMA utambulishe na kuunganisha kiungo kwa mafanikio yoyote, ikiwa ni pamoja na nishani hii ya mazoea bora, ndani ya masaa 48 ya kutambua hadharani kwamba ufanikio umepatikana. (URL inahitajika) [documentation_achievements]
    Ufanikio ni seti yoyote ya vigezo vya nje ambavyo mradi umefanya kazi mahususi kukidhi, ikiwa ni pamoja na nishani fulani. Habari hii haihitaji kuwa kwenye ukurasa wa mbele wa tovuti ya mradi. Mradi unaotumia GitHub unaweza kuweka mafanikio kwenye ukurasa wa mbele wa hifadhi kwa kuyaongeza kwenye faili ya README.

    documentation_achievements — Criterion Met
    Project: compliance-trestle (oscal-compass) | OpenSSF Best Practices

    Criterion: The project repository front page and/or website MUST identify and hyperlink to any achievements, including this best practices badge, within 48 hours of public recognition that the achievement has been attained.

    ✓ MET
    How It Is Met
    The GitHub repository front page is the project's README.md. Lines 10–11 of that file display two OpenSSF achievement badges at the very top of the page, each hyperlinked to its public recognition/results page. Any visitor to github.com/oscal-compass/compliance-trestle sees these badges immediately without scrolling.

    Achievement Badges in README.md (lines 10–11)
    Line 10: OpenSSF Best Practices
    Line 11: OpenSSF Scorecard
    Key URLs
    Achievement Badge / Recognition URL Location in Repo
    OpenSSF Best Practices https://www.bestpractices.dev/projects/9408 README.md, line 10
    OpenSSF Scorecard https://scorecard.dev/viewer/?uri=github.com/oscal-compass/compliance-trestle README.md, line 11
    Repository front page https://github.com/oscal-compass/compliance-trestle GitHub (renders README.md)
    Both badges are placed at the top of README.md — the de-facto front page for any GitHub-hosted project — satisfying the requirement that achievements are identified and hyperlinked on the project repository front page within 48 hours of public recognition.


  • Ufikiaji na kimataifa


    Mradi (tovuti zote za mradi na matokeo ya mradi) INAPASWA kufuata mazoea bora ya ufikiaji ili watu wenye ulemavu bado waweze kushiriki katika mradi na kutumia matokeo ya mradi ambapo ni busara kufanya hivyo. [accessibility_best_practices]
    Kwa programu za wavuti, angalia Miongozo ya Ufikiaji wa Maudhui ya Wavuti (WCAG 2.0) na hati yake inayosaidia Kuelewa WCAG 2.0; angalia pia habari za ufikiaji za W3C. Kwa programu za GUI, zingatia kutumia miongozo ya ufikiaji ya mazingira maalum (kama vile Gnome, KDE, XFCE, Android, iOS, Mac, na Windows). Baadhi ya programu za TUI (k.m., programu za `ncurses`) zinaweza kufanya mambo fulani ili kuzifanya kufikika zaidi (kama mpangilio wa `force-arrow-cursor` wa `alpine`). Programu nyingi za mstari wa amri zinafikika vizuri kama zilivyo. Kigezo hiki mara nyingi ni N/A, k.m., kwa maktaba za programu. Hapa kuna baadhi ya mifano ya hatua za kuchukua au masuala ya kuzingatia:
    • Toa mbadala za maandishi kwa maudhui yoyote yasiyo ya maandishi ili yaweze kubadilishwa kuwa aina nyingine watu wanahitaji, kama vile chapa kubwa, braille, hotuba, alama au lugha rahisi zaidi ( mwongozo wa WCAG 2.0 1.1)
    • Rangi haitumiwi kama njia pekee ya kuona ya kuwasilisha habari, kuashiria kitendo, kuchochea jibu, au kutofautisha kipengele cha kuona. ( mwongozo wa WCAG 2.0 1.4.1)
    • Uwasilishaji wa kuona wa maandishi na picha za maandishi una uwiano wa tofauti wa angalau 4.5:1, isipokuwa kwa maandishi makubwa, maandishi ya bahati mbaya, na nembo ( mwongozo wa WCAG 2.0 1.4.3)
    • Fanya kazi zote zipatikane kutoka kwenye kibodi (mwongozo wa WCAG 2.1)
    • Mradi wa GUI au wa wavuti INAPASWA kupima na angalau kipaza sauti kimoja cha skrini kwenye jukwaa la lengo (k.m., NVDA, Jaws, au WindowEyes kwenye Windows; VoiceOver kwenye Mac & iOS; Orca kwenye Linux/BSD; TalkBack kwenye Android). Programu za TUI ZINAWEZA kufanya kazi kupunguza uchanganyiko wa ziada ili kuzuia usomaji wa ziada na vipaza sauti vya skrini.

    Accessibility — compliance-trestle
    How the project meets WCAG 2.0 accessibility best practices

    Project type
    Compliance-trestle is primarily a command-line application and Python library. CLI tools are inherently accessible: they emit plain text to stdout/stderr, work in any terminal (including Braille displays), support --help on all sub-commands, and do not use colour as the sole means of conveying information. The project also publishes a documentation website (MkDocs Material) where the WCAG criteria below apply.

    WCAG 2.0 criteria
    Criterion Requirement How it is met
    1.1.1 Text alternatives All images in the documentation carry descriptive alt text that conveys the same information as the visual. Decorative images are labelled as such.
    1.4.1 Use of colour Colour is never the only means of conveying information. Code blocks use contextual labels and prose alongside colour highlighting. CLI messages carry a textual prefix (INFO / WARNING / ERROR).
    1.4.3 Contrast ≥ 4.5:1 The documentation site offers a light/dark theme toggle that respects the user's prefers-color-scheme OS setting. Inline code colours in both palettes meet the 4.5:1 minimum.
    2.1.1 Keyboard accessible The documentation site navigation is fully keyboard-accessible. A "Skip to main content" link is the first focusable element on every page so keyboard-only users can bypass the navigation bar.
    2.4.1 Bypass blocks The skip-navigation link targets the main content container so the first Tab keypress delivers focus directly to page content.
    2.4.7 Focus visible A high-contrast focus ring is applied to all interactive elements, restoring the outline the theme resets by default.
    3.1.1 Language of page Every page is served with <html lang="en"> so screen-readers announce the correct language.
    Additional: reduced motion
    CSS animations and transitions are disabled when the user's OS "reduce motion" preference is active, per prefers-reduced-motion (WCAG 2.3.3).

    Screen-reader testing
    Basic compatibility verified with Orca (GNOME, Linux). The skip-navigation link and ARIA landmark structure allow Orca users to reach the main content without traversing the full sidebar.

    References
    WCAG 2.0 specification
    Understanding WCAG 2.0
    W3C Web Accessibility Initiative (WAI)



    Programu iliyozalishwa na mradi INAPASWA kuwa kimataifa ili kuwezesha upatanifu wa lugha wa rahisi kwa utamaduni, eneo, au lugha ya hadhira lengo. Ikiwa kimataifa (i18n) haihusiki (k.m., programu haizalishi maandishi yanayokusudiwa kwa watumiaji wa mwisho na haipangi maandishi yanayosomeka na binadamu), chagua "haihusiki" (N/A). [internationalization]
    Upatanifu wa lugha "unarejelea upatanifu wa bidhaa, programu au maudhui ya hati ili kukidhi lugha, utamaduni na mahitaji mengine ya soko mahususi la lengo (eneo)." Kimataifa ni "muundo na maendeleo ya bidhaa, programu au maudhui ya hati ambayo huwezesha upatanifu wa lugha wa rahisi kwa hadhira lengo zinazotofautiana katika utamaduni, eneo, au lugha." (Ona "Upatanifu wa Lugha dhidi ya Kimataifa" ya W3C.) Programu inakidhi kigezo hiki kwa kuwa kimataifa tu. Hakuna upatanifu wa lugha kwa lugha nyingine mahususi unaohitajika, kwa kuwa mara tu programu imekuwa kimataifa inawezekana kwa wengine kufanya kazi kwenye upatanifu wa lugha.

    Internationalization — compliance-trestle
    How the project meets the i18n best-practices requirement — see W3C: Localization vs. Internationalization

    ✓ Requirement met — partially N/A, partially addressed
    What text the project produces
    Output type Audience i18n applies?
    OSCAL JSON / YAML artifacts Machine-to-machine interchange; content is authored by the user, not generated by trestle N/A — structured data, not trestle-generated natural language
    CLI log messages & --help text Developers and compliance engineers running the tool Applies — English hardcoded today; no gettext wrapping
    Markdown governance output Content is templated and authored by the user; trestle supplies structural scaffolding only N/A — trestle does not generate localizable natural-language prose
    Documentation website English-speaking developers N/A for the requirement — static documentation, not software output
    How the requirement is met
    The dominant output of compliance-trestle is machine-readable OSCAL data (JSON/YAML). This data is structured entirely by the user's own content; trestle acts as a schema-enforcing pipeline and does not inject localizable natural-language text into it. For this majority of the software's output, the i18n criterion is not applicable.

    The CLI does produce a smaller volume of human-readable text — log messages and --help strings — that is currently English-only. The codebase is already prepared for i18n in the following structural ways:

    Every source file declares # -- coding:utf-8 --, ensuring all string literals are UTF-8 and can contain any Unicode character without modification.
    All user-facing strings are plain Python string literals, making them straightforward to wrap with Python's standard gettext module when a translation catalogue is needed — no architectural changes are required.
    No locale-sensitive operations (date formatting, number formatting, sorting of human-readable text) are performed on data that trestle itself generates; where timestamps appear in OSCAL output they follow the ISO 8601 standard, which is locale-neutral.
    The documentation site sets lang="en" explicitly, so the language of all human-readable site content is declared and unambiguous to translation tools.
    Summary
    The bulk of trestle's output (OSCAL artifacts, markdown scaffolding) is N/A for i18n because it carries user-authored content, not software-generated natural language. The small portion that does generate end-user text (CLI messages) is structurally ready for gettext-based localization: UTF-8 source encoding is declared throughout, strings are plain literals with no locale-sensitive formatting, and no architectural changes would be needed to add a translation catalogue.

    References
    W3C: Localization vs. Internationalization
    Python gettext — Internationalization Services
    W3C: Declaring language in HTML


  • Mengine


    Ikiwa tovuti za mradi (tovuti, hifadhi, na URL za kupakua) zinahifadhi nywila kwa ajili ya uthibitishaji wa watumiaji wa nje, nywila LAZIMA zihifadhiwe kama mificho iliyorudiwa na chumvi kwa-mtumiaji kwa kutumia kanuni ya upanuaji (iliyorudiarudia) wa funguo (k.m., Argon2id, Bcrypt, Scrypt, au PBKDF2). Ikiwa tovuti za mradi hazihifadhi nywila kwa kusudi hili, chagua "haihusiki" (N/A). [sites_password_security]
    Kumbuka kwamba matumizi ya GitHub yanakidhi kigezo hiki. Kigezo hiki kinatumika tu kwa nywila zinazotumika kwa ajili ya uthibitishaji wa watumiaji wa nje kwenye tovuti za mradi (pia inaitwa uthibitishaji wa ndani). Ikiwa tovuti za mradi lazima ziingie kwenye tovuti zingine (pia inaitwa uthibitishaji wa nje), zinaweza kuhitaji kuhifadhi ishara za uidhinishaji kwa kusudi hilo kwa njia tofauti (kwa kuwa kuhifadhi mficho hakuna maana). Hii inatumia kigezo cha crypto_password_storage kwa tovuti za mradi, sawa na sites_https.

    The project uses GitHub for repository hosting and access management, and GitHub Pages for its documentation site. Neither the project itself nor any of its sites store passwords for authenticating external users — all inbound authentication is delegated entirely to GitHub and PyPI, both of which use industry-standard iterated-hash password storage. The use of GitHub directly satisfies this criterion. N/A.


 Udhibiti wa Mabadiliko 1/1 ●

  • Matoleo ya awali


    Mradi LAZIMA utunze matoleo ya zamani yaliyotumika mara nyingi ya bidhaa au kutoa njia ya usasishaji kwa matoleo mapya. Ikiwa njia ya usasishaji ni ngumu, mradi LAZIMA uandike jinsi ya kufanya usasishaji (k.m., violesura vilivyobadilika na hatua zilizoanishwa kwa undani ili kusaidia usasishaji). [maintenance_or_update]

    The compliance-trestle project satisfies this requirement through three overlapping mechanisms: active maintenance of older major versions, explicit upgrade documentation, and clear install instructions for every historical version. Evidence is drawn directly from the repository.

    1. Older versions are actively maintained
      README.md at lines 97–119 declares the support status of every major line:

    Branch Status Notes
    v5 (main) Stable – actively developed Current
    v4 Stable – maintenance mode Security & bug-fix releases until 2026-12-31
    v3 Deprecated No longer supported
    v2 Deprecated No longer supported
    The v4 maintenance branch is a live, release-capable branch—not just an archived tag. docs/contributing/maintenance_releases.md documents the formal procedure for creating and managing these branches, and pyproject.toml lines 342–368 configures the semantic-release pipeline to publish from any branch matching ^v\d+$.

    1. Detailed upgrade path is documented
      docs/upgrading.md provides a dedicated upgrade guide. It covers:

    v4 → v5: Breaking changes (minimum Python raised from 3.10 → 3.11, interface changes), with step-by-step migration instructions.
    Pinned install commands for both the new and the prior version:
    pip install --upgrade "compliance-trestle>=5,<6" # v5
    pip install --upgrade "compliance-trestle>=4,<5" # stay on v4

    A "Still on v4?" section explicitly acknowledging users who cannot yet upgrade.
    3. Install instructions for all historical versions are publicly documented
    docs/index.md lines 55–78 gives exact pip install commands for every major version (0.37.x through 5.x) and maps each to its supported OSCAL schema version, so users can pin to whichever release their toolchain requires.

    1. Version history is publicly traceable
      CHANGELOG.md contains a full release log from v0.x through the current v5.1.0, giving a complete audit trail of changes between versions.

    Supporting URLs
    Resource URL
    PyPI release history https://pypi.org/project/compliance-trestle/#history
    All branches (v4, v5, main, develop) https://github.com/oscal-compass/compliance-trestle/branches/all
    Upgrade guide (docs/upgrading.md rendered) https://oscal-compass.github.io/compliance-trestle/upgrading/
    Maintenance releases process https://oscal-compass.github.io/compliance-trestle/contributing/maintenance_releases/
    CHANGELOG https://github.com/oscal-compass/compliance-trestle/blob/main/CHANGELOG.md
    Conclusion: The project keeps the previous major version (v4) alive with security/bug-fix patches, documents a clear v4→v5 upgrade path with exact pip commands and interface-change details, and publishes install commands for all historical versions on its public documentation site—fully satisfying the [maintenance_or_update] requirement.


 Kuripoti 3/3 ●

  • Mchakato wa kuripoti hitilafu


    Mradi LAZIMA utumie kifuatiliaji cha masuala kwa ajili ya kufuatilia masuala ya mtu binafsi. [report_tracker]

    Reports are tracked under GIT issues.
    https://github.com/oscal-compass/compliance-trestle/issues

    New issues are reviewed at least bi-weekly by the maintainers.


  • Mchakato wa kuripoti udhaifu


    Mradi LAZIMA utoe sifa kwa waripoti wa ripoti zote za udhaifu zilizotatuliwa katika miezi 12 iliyopita, isipokuwa kwa waripoti wanaoomba kutojulikana. Ikiwa hakuna udhaifu uliotatuliwa katika miezi 12 iliyopita, chagua "haihusiki" (N/A). (URL inahitajika) [vulnerability_report_credit]

    OpenSSF Silver — vulnerability_report_credit Criterion Met

    Requirement: The project MUST give credit to the reporter(s) of all vulnerability reports resolved in the last 12 months, except for reporters who request anonymity. If no vulnerabilities were resolved in the last 12 months, select N/A.

    Justification: All vulnerability reports resolved in the last 12 months are published as GitHub Security Advisories. Each advisory includes a first-class Credits field that formally names every reporter by GitHub login and role. Credits are only shown for reporters who accepted attribution — those who requested anonymity are excluded automatically. This mechanism satisfies the criterion without any supplementary documentation.

    Verification steps:

    1. Navigate to the project's Security Advisories page.
    2. Open each advisory published or resolved within the last 12 months.
    3. Confirm the Credits section lists at least one reporter with state: accepted, or that no external reporters were involved.

    Key URLs



    Mradi LAZIMA uwe na mchakato ulioandikwa kwa ajili ya kujibu ripoti za udhaifu. (URL inahitajika) [vulnerability_response_process]
    Hii ina uhusiano mkubwa na vulnerability_report_process, ambayo inahitaji kuwa kuna njia iliyoandikwa ya kuripoti udhaifu. Pia inahusiana na vulnerability_report_response, ambayo inahitaji majibu kwa ripoti za udhaifu ndani ya kipindi fulani cha muda.

    Per security-insights.yml: repository.documentation.security-policy=https://github.com/oscal-compass/community/blob/main/SECURITY.md [osps_vm_01_01]


 Ubora 19/19 ●

  • Viwango vya msimbo


    Mradi LAZIMA utambulishe miongozo mahususi ya mtindo wa kuandika msimbo kwa lugha kuu inazotumia, na uhitaji kwamba michango kwa ujumla ikidhi. (URL inahitajika) [coding_standards]
    Katika hali nyingi hii inafanywa kwa kurejelea baadhi ya miongozo ya mtindo iliyopo, huenda ikiorodhesha tofauti. Miongozo hii ya mtindo inaweza kujumuisha njia za kuboresha usomaji na njia za kupunguza uwezekano wa kasoro (ikiwa ni pamoja na udhaifu). Lugha nyingi za programu zina miongozo moja au zaidi ya mtindo inayotumika sana. Mifano ya miongozo ya mtindo ni pamoja na miongozo ya mtindo ya Google na Viwango vya Kuandika Msimbo wa SEI CERT.

    The project identifies specific coding style guides for its primary language (Python) with URLs, and explicitly requires that contributions comply with them.

    The CONTRIBUTING.md file, under the "Code style and formatting" section, states:

    "All contributions must comply with the following coding style guides:"

    and lists the following with direct URLs:

    Scope Style guide URL
    Python — general style PEP 8 – Style Guide for Python Code https://peps.python.org/pep-0008/
    Python — type annotations PEP 484 – Type Hints https://peps.python.org/pep-0484/
    Python — docstrings Google Python Style Guide (docstrings section) https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
    Python — security SEI CERT Python Coding Standard https://wiki.sei.cmu.edu/confluence/display/python/SEI+CERT+Python+Coding+Standard
    Compliance with these guides is mechanically enforced on every pull request through:

    ruff — enforces PEP 8 style (pycodestyle E/W rules), security checks (flake8-bandit S rules aligned with SEI CERT guidance), import ordering, and additional code-quality rules
    mypy — enforces PEP 484 type annotations
    pre-commit hooks — run automatically on every commit and in CI, ensuring no contribution can be merged without passing all style and lint checks
    The full tool configuration is publicly documented in pyproject.toml ([tool.ruff] and [tool.mypy] sections) and .pre-commit-config.yaml.



    Mradi LAZIMA utekeleze kiotomatiki mtindo wake wa kuandika msimbo uliochaguliwa ikiwa kuna angalau zana moja ya FLOSS inayoweza kufanya hivyo katika lugha zilizochaguliwa. [coding_standards_enforced]
    Hii INAWEZA kutekelezwa kwa kutumia zana za uchambuzi mkako na/au kwa kulazimisha msimbo kupitia vifaa vya kurekebisha msimbo. Katika hali nyingi usanidi wa zana umejumuishwa katika hifadhi ya mradi (kwa kuwa miradi tofauti inaweza kuchagua usanidi tofauti). Miradi INAWEZA kuruhusu vighairi vya mtindo (na kwa kawaida itaruhusu); ambapo vighairi vinatokea, LAZIMA viwe nadra na viandikwe katika msimbo katika maeneo yao, ili vighairi hivi viweze kukaguliwa na ili zana ziweze kuzishughulikia kiotomatiki baadaye. Mifano ya zana kama hizo ni pamoja na ESLint (JavaScript), Rubocop (Ruby), na devtools check (R).

    The project automatically enforces its selected coding style on every pull request and every push to develop and main using multiple FLOSS tools. All tool configuration is committed to the repository.

    Tools and their enforcement scope:

    Tool What it enforces Configuration
    ruff (formatter) PEP 8 formatting, quote style, indent width, import ordering pyproject.toml [tool.ruff.format]
    ruff (linter) PEP 8 errors/warnings, Pyflakes, pep8-naming, bugbear, comprehensions, simplify, security (bandit), pyupgrade, ruff-specific rules pyproject.toml [tool.ruff.lint]
    mypy PEP 484 type annotation correctness pyproject.toml [tool.mypy]
    mdformat Markdown document formatting .pre-commit-config.yaml
    Enforcement layers — no contribution can bypass all three:

    Pre-commit hooks — ruff format + lint and mdformat run automatically on every git commit via .pre-commit-config.yaml. Hooks are installed and kept current by make develop.
    PR CI pipeline — the lint job in .github/workflows/python-test.yml runs make code-format, make code-lint, make code-typing, and make mdformat on every pull request. The build job in .github/workflows/python-push.yml repeats the same checks on every push to develop and main. A PR cannot be merged if these steps fail.
    SonarCloud quality gate — an additional static-analysis scan runs on every PR and must pass before merge.
    Exceptions — rare and documented in-code:

    Where a lint rule must be suppressed, a # noqa: <RULE> inline comment is required with a human-readable justification. Only two such suppressions exist in the entire non-generated source tree:

    trestle/core/commands/author/jinja.py:166 — # noqa: N802 - LUT is an established acronym; renaming is a breaking API change
    trestle/core/remote/cache.py:291 — # noqa: S105 - sentinel value {{_}}, not a real password
    The RUF100 rule (unused/invalid noqa directives) is enabled globally, so any suppression that no longer corresponds to an active violation is itself flagged — ensuring that exceptions cannot silently accumulate. All project-level rule exceptions in pyproject.toml are annotated with FIXME comments tracking the count of violations to be remediated incrementally.


  • Mfumo wa ujenzi unaofanya kazi


    Mifumo ya kujenga kwa binari za asili LAZIMA iheshimu vigezo (vya mazingira) vya mkusanyaji na vya kiunganishi vilivyopitishwa kwao (k.m., CC, CFLAGS, CXX, CXXFLAGS, na LDFLAGS) na kuvipitisha kwenye viito vya mkusanyaji na vya kiunganishi. Mfumo wa kujenga UNAWEZA kuvipanua na bendera za ziada; LAZIMA USIBADILISHE thamani zilizotolewa na zake mwenyewe. Ikiwa hakuna binari za asili zinazozalishwa, chagua "haihusiki" (N/A). [build_standard_variables]
    Inapaswa kuwa rahisi kuwezesha vipengele maalum vya kujenga kama Address Sanitizer (ASAN), au kutii mazoea bora ya ugumu wa usambazaji (k.m., kwa kuwezesha kwa urahisi bendera za mkusanyaji kufanya hivyo).

    The OpenSSF Best Practices criterion [build_standard_variables] states:

    "If no native binaries are being generated, select "not applicable" (N/A)."

    This project (compliance-trestle) is a pure Python package managed with Hatchling (pyproject.toml). It contains no native C/C++/Rust/Go source files or compiled extensions that generate native binary executables/libraries requiring compiler and linker flags (CC, CFLAGS, CXX, CXXFLAGS, LDFLAGS).



    Mfumo wa kujenga na usakinishaji UNAPASWA kuhifadhi taarifa za utatuzi ikiwa zimeombwa katika bendera husika (k.m., "install -s" haitumiwa). Ikiwa hakuna mfumo wa kujenga au usakinishaji (k.m., maktaba za kawaida za JavaScript), chagua "haihusiki" (N/A). [build_preserve_debug]
    K.m., kuweka CFLAGS (C) au CXXFLAGS (C++) inapaswa kuunda taarifa husika za utatuzi ikiwa lugha hizo zinatumika, na hazipaswi kuondolewa wakati wa usakinishaji. Taarifa za utatuzi zinahitajika kwa msaada na uchambuzi, na pia ni muhimu kwa kupima uwepo wa vipengele vya ugumu katika binari zilizokusanywa.

    build_preserve_debug — Justification
    Criterion met: N/A (Not Applicable)

    compliance-trestle is a pure Python library. It contains no compiled native code, no C/C++ extensions, no Rust crates, and no other compiled language components. Therefore:

    CFLAGS / CXXFLAGS / debug-stripping flags are entirely irrelevant — there are no binaries, shared objects (.so), or other compiled artifacts to strip.
    The build backend is hatchling (declared in pyproject.toml), which assembles pure-Python source distributions (.tar.gz) and wheels (.whl). Both formats contain only .py source files and data assets — no native compilation step is involved.
    The install command used internally (pip install -e .[dev] in Makefile) does not invoke install -s, strip flags, or any equivalent that could remove debugging information, because there is nothing binary to strip.
    Release builds use python -m build (see pyproject.toml:343-346) which likewise produces pure-Python wheel and sdist archives.
    Python's own .pyc bytecode files (which CPython generates at import time) do carry debug information (line numbers, co_filename, etc.) and are never stripped by the build or install process. The clean target removes leftover .pyc files from the source tree only for housekeeping — it does not affect installed packages.
    Conclusion: Because compliance-trestle has no compiled language components, the build_preserve_debug criterion is N/A. The concept of preserving compiler debug information (-g flags, DWARF sections, .pdb files, etc.) and avoiding stripping (install -s) simply does not apply to this project. Python's inherent source-level debuggability is always fully preserved by the standard hatchling/pip build and install pipeline.



    Mfumo wa kujenga kwa programu iliyozalishwa na mradi LAZIMA USIJENGA kwa njia ya kujirudia saraka ndogo ikiwa kuna utegemezi wa kukatana katika saraka ndogo. Ikiwa hakuna mfumo wa kujenga au usakinishaji (k.m., maktaba za kawaida za JavaScript), chagua "haihusiki" (N/A). [build_non_recursive]
    Taarifa ya utegemezi wa ndani ya mfumo wa kujenga wa mradi inahitaji kuwa sahihi, vinginevyo, mabadiliko ya mradi huenda yasijenge vizuri. Mijengo isiyo sahihi inaweza kusababisha kasoro (ikiwa ni pamoja na udhaifu). Kosa la kawaida katika mifumo mikubwa ya kujenga ni kutumia "ujenzi wa kujirudia" au "make ya kujirudia", yaani, mlingano wa saraka ndogo zinazojumuisha faili za chanzo, ambapo kila saraka ndogo inajengwa kwa uhuru. Isipokuwa kila saraka ndogo ni huru kabisa, hii ni kosa, kwa sababu taarifa ya utegemezi si sahihi.

    build_non_recursive — Assessment: Met ✅
    Here's the analysis of the compliance-trestle project's build system against this criterion:

    Build System
    The project uses Hatchling (PEP 517/518 backend) declared in pyproject.toml:

    [build-system]
    requires = ["hatchling"]
    build-backend = "hatchling.build"

    The wheel target explicitly packages the entire trestle package in a single invocation:

    [tool.hatch.build.targets.wheel]
    packages = ["trestle"]

    Why This Criterion Is Met
    Factor Finding
    Build invocation Single hatch build from the repository root — no recursive subdirectory traversal
    Nested Makefiles / make -C None found
    Independent subproject builds None — all of trestle/common/, trestle/core/, trestle/tasks/, trestle/oscal/, etc. are modules within one package, not separate build units
    Cross-dependencies Extensive cross-imports exist between subdirectories, but they are irrelevant to the build because no recursive build is attempted
    The Cross-Dependency Note (Why It Would Be a Problem If It Were Recursive)
    The subdirectories are heavily interdependent — e.g., trestle/tasks/xlsx_helper.py imports from trestle.core.catalog, trestle.oscal, and trestle.common. If the project used a recursive make-style build with per-subdirectory independence, this would cause broken dependency ordering. However, because Hatchling packages the entire trestle/ tree as a single unit from the root, there is no such problem.

    Answer
    Met — The project does not use a recursive build system. It uses a single-invocation Hatchling build that packages the whole trestle package at once, avoiding the recursive-make anti-pattern entirely.



    Mradi LAZIMA uweze kurudia mchakato wa kuzalisha taarifa kutoka faili za chanzo na kupata matokeo sawa ya biti-kwa-biti. Ikiwa hakuna ujenzi unaofanyika (k.m., lugha za uandishi ambapo msimbo wa chanzo unatumika moja kwa moja badala ya kukusanywa), chagua "haihusiki" (N/A). [build_repeatable]
    Watumiaji wa GCC na clang wanaweza kupata chaguo la -frandom-seed kuwa na manufaa; katika hali fulani, hii inaweza kutatuliwa kwa kulazimisha aina fulani ya mpangilio. Mapendekezo zaidi yanaweza kupatikana kwenye tovuti ya ujenzi unaorudiwa.

    Build Repeatability Assessment: N/A
    This project should be marked Not Applicable (N/A) for the build_repeatable criterion.

    Justification
    compliance-trestle is a pure Python scripting/library project. There is no compilation step. Python source files (.py) are distributed and executed directly — no binary artifacts (.o, .so, .a, executables, .wasm, etc.) are produced from source that would need to be reproduced bit-for-bit.

    What the project actually does:

    Activity Nature Compilation?
    hatch build Packages .py source files into a .whl/.tar.gz archive No — archives source as-is
    make gen-oscal Runs scripts/gen_oscal.py → generates .py model files from JSON schemas Generates source files, not compiled binaries
    python -m build (semantic-release) Builds sdist + wheel via pyproject.toml / hatchling Packages Python source; no compilation
    Tests, linting, typing Runtime checks against source Not a build
    The wheels (.whl) produced are "pure Python" wheels — they contain .py source files verbatim, no compiled C extensions. The build backend is hatchling, which is a source-packaging tool that zips up the trestle/ directory as declared in the [tool.hatch.build.targets.wheel] stanza.

    Recommended justification text:

    This project is a pure Python library (compliance-trestle). No compilation of source to binary occurs. The build process (hatch build / python -m build) packages Python source files (.py) and data directly into a standard sdist .tar.gz and a pure-Python .whl archive using hatchling as the build backend. Because no compiled artifacts are produced from source code, the bit-for-bit reproducibility requirement for compiled builds does not apply. The gen_oscal.py code generation step produces Python source files (not binaries), and those generated files are committed to the repository and tracked in version control. Select: N/A.


  • Mfumo wa usakinishaji


    Mradi LAZIMA utoe njia ya kusakinisha na kuondoa kwa urahisi programu iliyozalishwa na mradi kwa kutumia mkataba unaotumika sana. [installation_common]
    Mifano ni pamoja na kutumia meneja wa kifurushi (kwa mfumo au kiwango cha lugha), "make install/uninstall" (inasaidia DESTDIR), chombo katika muundo wa kawaida, au picha ya mashine pepe katika muundo wa kawaida. Mchakato wa usakinishaji na uondoaji (k.m., kifurushi chake) UNAWEZA kutekelezwa na mtu wa tatu mradi tu ni FLOSS.

    [installation_common] — Met ✅
    The compliance-trestle project fully satisfies this criterion through two standard, commonly-used Python conventions:

    1. PyPI package — pip install
      The project is published to PyPI as compliance-trestle. Any user can install the software in a single command:

    pip install compliance-trestle

    And uninstall equally simply:

    pip uninstall compliance-trestle

    This is the dominant convention for Python language-level package management. pyproject.toml is the package manifest, using hatchling as the build backend, and defines the entry-point console script trestle that becomes available after install.

    1. Documented installation guide
      docs/installation.md provides a complete, step-by-step installation guide covering:

    Python version prerequisites
    Virtual environment setup
    pip install compliance-trestle
    Post-install verification (trestle -h)
    Workspace initialization
    The README.md also explicitly states and links to this guide.

    Justification text (for the badge form)
    compliance-trestle is distributed as a Python package on PyPI under the name compliance-trestle and can be installed via the standard language-level package manager: pip install compliance-trestle and uninstalled with pip uninstall compliance-trestle. The package is built using hatchling with a standard pyproject.toml, exposes the trestle console script entry point, and includes a dedicated installation guide at docs/installation.md. This satisfies the requirement for a commonly-used installation convention.



    Mfumo wa usakinishaji kwa watumiaji wa mwisho LAZIMA uheshimu mkataba wa kawaida kwa kuchagua eneo ambapo vitu vilivyojengwa vinaandikwa kwa wakati wa usakinishaji. Kwa mfano, ikiwa inasakinisha faili kwenye mfumo wa POSIX lazima iheshimu kigezo cha mazingira cha DESTDIR. Ikiwa hakuna mfumo wa usakinishaji au hakuna mkataba wa kawaida, chagua "haihusiki" (N/A). [installation_standard_variables]

    Answer: Met

    Justification:

    compliance-trestle is a Python package distributed via the standard pip/PyPA ecosystem. Its build backend is hatchling (declared in pyproject.toml), and its artifacts are published as a wheel and sdist via hatch build (see Makefile:106) and uploaded to PyPI.

    End-users install the package with:

    pip install compliance-trestle

    This installation path fully honors the standard Python installation conventions, including:

    --prefix / --target – pip respects these to redirect the install destination.
    DESTDIR – when building the wheel and installing via pip into a staging root (common in OS packaging, e.g., RPM/DEB %install phases), pip install --root <DESTDIR> is the standard mechanism, and it is fully supported because the package is a compliant wheel.
    Virtual environments – the primary recommended installation target, where VIRTUAL_ENV drives the prefix automatically.
    --user – honors PYTHONUSERBASE per PEP 370.
    Because the project delegates entirely to pip + hatchling (a PEP 517/518-compliant build backend) rather than implementing a bespoke installer, it inherits all of pip's support for standard installation-location variables with no extra work required. There is no custom install script that would need to be audited for DESTDIR compliance — the standard toolchain handles it.

    Verdict: Met — the installation system is the standard Python/pip toolchain, which honors DESTDIR, --prefix, --root, VIRTUAL_ENV, and PYTHONUSERBASE as per platform and pip conventions.



    Mradi LAZIMA utoe njia kwa wasanidi programu wanaoweza kusakinisha haraka matokeo yote ya mradi na mazingira ya msaada yanayohitajika kufanya mabadiliko, ikiwa ni pamoja na majaribio na mazingira ya majaribio. Hii LAZIMA ifanywe kwa kutumia mkataba unaotumika sana. [installation_development_quick]
    Hii INAWEZA kutekelezwa kwa kutumia chombo kilichozalishwa na/au hati za usakinishaji. Utegemezi wa nje kwa kawaida utasakinishwa kwa kuita mfumo na/au meneja wa kifurushi cha lugha, kwa external_dependencies.

    Met

    Justification: The project provides a conventional Makefile development setup command:

    make develop

    This command:

    Initializes required Git submodules used by tests via make submodules.
    Installs Hatch, the project’s development environment manager.
    Installs the project in editable mode with all development dependencies using pip install -e .[dev].
    The development dependency set is defined in pyproject.toml, and the Hatch test environment installs the required test tooling, including pytest, coverage support, parallel test execution, randomized tests, and mypy (pyproject.toml).

    Tests can then be run using the documented convention:

    make test

    as defined in Makefile and documented in CONTRIBUTING.md.

    Key URLs for the justification:

    Development setup instructions:

    https://github.com/oscal-compass/compliance-trestle/blob/develop/CONTRIBUTING.md#setup---developing-trestle

    Documents make develop, dependency installation, submodule setup, and make test.

    Development command definitions:

    https://github.com/oscal-compass/compliance-trestle/blob/develop/Makefile

    Defines the develop, submodules, test, test-all, and coverage targets.

    Project dependency and test configuration:

    https://github.com/oscal-compass/compliance-trestle/blob/develop/pyproject.toml

    Defines the [dev] optional dependencies and Hatch test environment.

    End-user installation guide:

    https://oscal-compass.github.io/compliance-trestle/latest/installation/

    Documents Python virtual-environment installation and validation.

    Quick Start guide:

    https://oscal-compass.github.io/compliance-trestle/latest/quick-start/

    Provides a quick path to installing and initializing a Trestle workspace.

    A concise justification with URLs could be:

    Met. The project uses the commonly adopted make convention through Makefile. Developers can run make develop to initialize test submodules and install the editable project with development dependencies, then run make test to execute the test suite. These steps are documented in the Contributing guide, while the development and test dependencies are defined in pyproject.toml.


  • Vipengee vilivyotunzwa nje


    Mradi LAZIMA uorodheshe utegemezi wa nje kwa njia inayoweza kuchakatwa na kompyuta. (URL inahitajika) [external_dependencies]
    Kwa kawaida hii inafanywa kwa kutumia mkataba wa meneja wa kifurushi na/au mfumo wa ujenzi. Kumbuka kwamba hii inasaidia kutekeleza installation_development_quick.

    OpenSSF external_dependencies Criterion — Status: Met ✅
    The criterion requires:

    "The project MUST list external dependencies in a computer-processable way."

    How compliance-trestle satisfies it
    The project uses pyproject.toml — the modern, standardised Python packaging manifest (PEP 517 / PEP 621) — as its single source of truth for all external dependencies. This file is machine-readable by all standard Python tooling (pip, hatch, build, dependency scanners, etc.).

    All dependency categories are declared in pyproject.toml:

    Section Purpose Examples
    [project.dependencies] (line 35–55) Runtime dependencies pydantic, cryptography, requests, Jinja2, …
    [project.optional-dependencies] typing (line 59–65) Type-checking extras mypy, types-paramiko, …
    [project.optional-dependencies] docs (line 67–82) Documentation extras mkdocs, mkdocstrings, …
    [project.optional-dependencies] dev (line 84–91) Development / release tooling pre-commit, pylint, gitpython, …
    [tool.hatch.envs.hatch-test].dependencies (line 127–133) Test runner dependencies pytest, pytest-xdist, coverage, …
    Justification URL
    The canonical, publicly reachable location of this file is:

    https://github.com/oscal-compass/compliance-trestle/blob/develop/pyproject.toml

    This is the URL you should enter as the External dependencies justification URL in the OpenSSF Best Practices badge submission. It directly links to the computer-processable dependency manifest in the project's default development branch.



    Miradi LAZIMA ifuatilie au kwa muda mrefu iangalie utegemezi wao wa nje (ikiwa ni pamoja na nakala za urahisi) kugundua udhaifu unaojulikana, na kurekebisha udhaifu unaoweza kutumiwa vibaya au kuthibitisha kuwa hauwezi kutumiwa vibaya. [dependency_monitoring]
    Hii inaweza kufanywa kwa kutumia zana ya kichambua chanzo / zana ya kuangalia utegemezi / zana ya uchambuzi wa muundo wa programu kama OWASP's Dependency-Check, Sonatype's Nexus Auditor, Synopsys' Black Duck Software Composition Analysis, na Bundler-audit (kwa Ruby). Baadhi ya waendesha kifurushi wanajumuisha taratibu za kufanya hii. Ni kubaliwa ikiwa udhaifu wa vipengele hauwezi kutumiwa vibaya, lakini uchambuzi huu ni mgumu na wakati mwingine ni rahisi kusasisha au kurekebisha sehemu.

    Status: Met
    Dependency Monitoring Justification
    The oscal-compass/compliance-trestle project satisfies the [dependency_monitoring] requirement through multiple, layered, automated controls operating in CI/CD and on a recurring schedule:

    1. Snyk SCA — Primary Dependency Vulnerability Scanner
      Tool: Snyk (Software Composition Analysis)
      Evidence: .github/actions/snyk-test/action.yaml · .github/workflows/python-test.yml · .snyk

    On every qualifying pull request, the CI pipeline runs snyk test against a compiled requirements.txt derived from pyproject.toml. This scans all transitive Python dependencies for known CVEs.
    Known, accepted exceptions (e.g., SNYK-PYTHON-ORJSON-15123465, SNYK-PYTHON-PARAMIKO-16425764) are documented in .snyk with justifications, expiry dates, and risk acceptance rationale — satisfying the "verify as unexploitable / accepted risk" path.
    License policy violations are similarly tracked (e.g., MPL-2.0 for certifi and pathspec, approved via CNCF exceptions).
    Key URL: https://snyk.io

    1. GitHub Dependabot — Automated Weekly Dependency Updates
      Tool: GitHub Dependabot
      Evidence: .github/dependabot.yml

    Configured for weekly automated PRs covering both:
    pip Python package dependencies
    github-actions CI action pin updates
    Opens up to 10 PRs per cycle, keeping dependencies continuously patched against newly discovered vulnerabilities.
    Key URL: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates

    1. OpenSSF Scorecard — Supply-Chain Security Posture
      Tool: OpenSSF Scorecard
      Evidence: .github/workflows/scorecard.yml

    Runs weekly (every Saturday) and on every push to develop.
    Scorecard evaluates supply-chain risk factors including dependency pinning, token permissions, and branch protection — complementing direct vulnerability scanning.
    Key URLs:

    https://scorecard.dev/viewer/?uri=github.com/oscal-compass/compliance-trestle
    https://github.com/ossf/scorecard
    4. SonarCloud — SAST with Dependency & Security Rules
    Tool: SonarCloud
    Evidence: .github/workflows/python-test.yml · docs/code-review-policy.md

    Runs on every PR as a mandatory merge gate (no PR may merge while SonarCloud checks fail).
    Detects security vulnerabilities in source code including insecure dependency usage patterns.
    Key URL: https://sonarcloud.io/project/overview?id=compliance-trestle

    1. Ruff / flake8-bandit — Static Security Linting
      Evidence: pyproject.toml ("S" ruleset enabled)

    The S (flake8-bandit security) ruleset is enforced on every commit via ruff linting, catching insecure API usage that may relate to dependency misuse.
    Summary Table
    Control Tool Frequency Scope
    Dependency CVE scan Snyk Every PR All Python transitive deps
    Automated patch PRs Dependabot Weekly pip + GitHub Actions
    Supply-chain posture OpenSSF Scorecard Weekly + push Repository-wide
    Code security gate SonarCloud Every PR (mandatory) Source + security rules
    Static security lint Ruff/Bandit Every commit Source code
    The combination of Snyk (reactive CVE detection) + Dependabot (proactive patching) + Scorecard (supply-chain posture) provides continuous, automated coverage of the [dependency_monitoring] requirement across both direct and transitive dependencies.



    Mradi LAZIMA au:
    1. fanya iwe rahisi kutambua na kusasisha vipengele vinavyotumiwa tena vilivyotunzwa nje; au
    2. tumia vipengele vya kawaida vinavyotolewa na mfumo au lugha ya programu.
    Kisha, ikiwa udhaifu unapatikana katika kipengele kilichotumiwa tena, itakuwa rahisi kusasisha kipengele hicho. [updateable_reused_components]
    Njia ya kawaida ya kutimiza kigezo hiki ni kutumia mifumo ya usimamizi wa kifurushi ya mfumo na lugha ya programu. Programu nyingi za FLOSS zinasambazwa na "maktaba za urahisi" ambazo ni nakala za ndani za maktaba za kawaida (labda zilizoachana). Kwa yenyewe, hiyo ni sawa. Hata hivyo, ikiwa programu *lazima* itumie nakala hizi za ndani (zilizoachanishwa), basi kusasisha maktaba za "kawaida" kama sasisho la usalama litaacha nakala hizi za ziada bado zenye udhaifu. Hii ni suala hasa kwa mifumo ya wingu; ikiwa mtoa huduma ya wingu anasasisha maktaba zao za "kawaida" lakini programu haitazitumia, basi masasisho hayasaidii kweli. Angalia, k.m., "Chromium: Kwa nini bado haiko katika Fedora kama kifurushi sahihi" na Tom Callaway.

    updateable_reused_components — Met ✅
    The project fully satisfies this criterion. All reused external components are managed through the standard Python ecosystem package management toolchain, making them trivially identifiable and updatable. Evidence:

    Standard package manager — pyproject.toml
    All runtime and development dependencies are declared in the [project.dependencies] and [project.optional-dependencies] sections of pyproject.toml, following PEP 518 and PEP 621. There are no vendored or embedded copies of third-party libraries anywhere in the repository. Every dependency is resolved, fetched, and installed at build/install time by pip / hatch.

    No local (forked) convenience copies
    A search of the repository found no vendor/, third_party/, or equivalent directories. The only git submodule (.gitmodules) is nist-content, which is upstream OSCAL reference content — not a code library — and does not need to be patched as a security update path.

    Automated dependency update bot — .github/dependabot.yml
    GitHub Dependabot is configured for both pip packages and github-actions on a weekly schedule. When a new version of any dependency is released (including security patches), Dependabot automatically opens a pull request to update pyproject.toml, ensuring no vulnerable version is left in place silently.

    package-ecosystem: "pip"
    directory: "/"
    schedule:
    interval: "weekly"
    Version constraints allow patching — pyproject.toml
    Most dependencies use >= or = (compatible-release) constraints, not exact pins, so security patch releases from upstream are automatically picked up by installers:
    "cryptography>=46.0.7"
    "requests>=2.32.2"
    "pydantic[email]>=2.11.0"
    "openpyxl
    =3.0"

    The handful of exact pins (e.g., paramiko==5.0.0, Jinja2==3.1.6) are tracked by Dependabot and have documented rationale in .snyk where relevant.

    Vulnerability scanning in CI — .snyk
    The project integrates Snyk for dependency vulnerability scanning. Accepted exceptions carry explicit reasons and expiry dates, ensuring no silent or permanent vulnerability suppression.

    Build toolchain — pyproject.toml
    The build backend is hatchling (declared in [build-system]), and the test/dev environment manager is hatch. Both are standard, well-maintained Python ecosystem tools. All dependency resolution happens through pip at environment creation time — no build-time vendoring or code copying occurs.

    Summary: compliance-trestle uses the Python pip/hatch/pyproject.toml standard ecosystem exclusively for all reused components. There are no embedded library copies. Dependabot provides automated weekly pull requests for any upstream update, including security patches. This makes identifying and updating every reused component straightforward.

    Package / Dependency Management
    PyPI package page: https://pypi.org/project/compliance-trestle/ — the canonical distribution point; consumers install from here via pip install compliance-trestle
    Source repository: https://github.com/oscal-compass/compliance-trestle
    Automated Dependency Updates
    Dependabot config: https://github.com/oscal-compass/compliance-trestle/blob/develop/.github/dependabot.yml — proves automated weekly pip + github-actions update PRs are in place
    Vulnerability Scanning
    Snyk policy: https://github.com/oscal-compass/compliance-trestle/blob/develop/.snyk — shows active scanning with documented, time-bounded exceptions
    Dependency Declaration
    pyproject.toml: https://github.com/oscal-compass/compliance-trestle/blob/develop/pyproject.toml — the single authoritative source of all declared dependencies with version constraints



    Mradi UNAPASWA kuepuka kutumia vitendakazi na API zilizokubaliwa kuwa hazitumiki tena au zilizopitwa na wakati ambapo mbadala wa FLOSS zinapatikana katika seti ya teknolojia inayotumia ("kifurushi cha teknolojia" yake) na kwa wengi wa watumiaji ambao mradi unasaidia (ili watumiaji wawe na ufikiaji wa haraka wa mbadala). [interfaces_current]

    [interfaces_current] Assessment — compliance-trestle
    Criterion: The project SHOULD avoid using deprecated or obsolete functions and APIs where FLOSS alternatives are available in the technology stack.

    Verdict: ✅ MET — with two minor soft-deprecation notes worth tracking.

    Technology Stack
    Language: Python ≥ 3.11 (tested: 3.11, 3.12, 3.13, 3.14 — pyproject.toml)
    Core framework: Pydantic ≥ 2.11.0
    Build system: Hatchling
    Key libraries: importlib_resources, requests, Jinja2, cryptography, openpyxl
    Findings
    ✅ CLEAN — No use of removed/broken deprecated APIs
    Category What was checked Result
    collections.Callable/Mapping/MutableMapping Moved to collections.abc in 3.3, removed in 3.10 ✅ Not used
    distutils Deprecated 3.10, removed in 3.12 ✅ Not used (was removed per CHANGELOG)
    imp module Deprecated 3.4, removed in 3.12 ✅ Not used
    asyncio.coroutine Removed in 3.11 ✅ Not used
    datetime.utcnow() Deprecated since 3.12, fixed per CHANGELOG ✅ Not used
    pkg_resources Deprecated; replaced by importlib.metadata ✅ Removed (per CHANGELOG)
    xml.etree.cElementTree Deprecated since 3.3 ✅ Not used
    unittest.mock Uses stdlib unittest.mock, not external mock package ✅ Correct
    Pydantic v1 APIs (parse_obj, @validator, dict(), inner Config) Fully removed patterns ✅ Pydantic v2 APIs used throughout
    DeprecationWarning suppression filterwarnings/simplefilter ✅ None found
    Logging % string formatting Lazy %s interpolation is the correct logging pattern ✅ Correct
    ⚠️ Soft-Deprecated — Functional, no runtime warnings, tracked for future migration

    1. typing.List, typing.Dict, typing.Tuple, typing.Set, typing.Optional, typing.Union

    Used in 103 files across trestle/, e.g. trestle/common/file_utils.py:25, trestle/core/base_model.py:32, all trestle/oscal/*.py files.

    Status: Soft-deprecated per PEP 585 (Python 3.9+) in favour of built-in generics (list[str], dict[str, Any], etc.)
    Runtime impact: None — no DeprecationWarning is emitted at runtime. These names are not scheduled for removal in any current Python roadmap.
    Rationale for not blocking: The project's OSCAL models in trestle/oscal/ are auto-generated by datamodel-code-generator (evidenced by the comment in tests/trestle/core/models/element_path_test.py:224: "Newer datamodel-code-generator versions generate list[X] instead of typing.List[X]"). Upgrading the generator will naturally resolve this.
    2. constr()/conint() from Pydantic

    Used in all 9 trestle/oscal/*.py files, e.g. trestle/oscal/catalog.py:33.

    Status: Documented as "will be deprecated in Pydantic 3.0" (pydantic/types.py:165) — not yet deprecated in the current version (2.13.4). Alternative is Annotated[str, StringConstraints(...)].
    Runtime impact: None currently.
    Rationale: These are also auto-generated by datamodel-code-generator from OSCAL JSON schemas. When Pydantic 3.0 is released, the generator update will address this.
    3. importlib_resources backport dependency

    Used in trestle/core/commands/author/versioning/template_versioning.py:24 and trestle/core/commands/init.py:24.

    Status: The importlib_resources package is a backport of importlib.resources. Since this project requires Python ≥ 3.11, the stdlib importlib.resources.files() API (available since 3.9) is fully available and the backport dependency is redundant — though not deprecated in the harmful sense.
    Runtime impact: None — the backport is API-compatible with the stdlib. It is an unnecessary third-party dependency for the declared Python floor.
    Summary Justification
    The project meets [interfaces_current]:

    All removed deprecated APIs (Python standard library and Pydantic v1) have been actively cleaned up — confirmed by the CHANGELOG and verified by codebase search with zero hits.
    The two soft-deprecations found (typing generics and Pydantic constr/conint) are: (a) not yet emitting runtime warnings, (b) not scheduled for removal in any current release, and (c) rooted in auto-generated code that will be fixed organically when the upstream code generator is updated.
    The redundant importlib_resources backport has no negative functional impact.
    CI tests across Python 3.11–3.14 ensure no silently-broken deprecated APIs slip through.
    Key references:

    PEP 585 – Type Hinting Generics In Standard Collections
    Pydantic v2 Migration Guide
    Python 3.12 What's New – Removed
    importlib.resources docs (Python 3.11)


  • Seti ya majaribio otomatiki


    Seti ya majaribio ya kiotomatiki LAZIMA itumike kwenye kila ukaguzi wa kuingia kwenye hifadhi iliyoshirikiwa kwa angalau tawi moja. Seti hii ya majaribio LAZIMA itoe ripoti ya mafanikio au kushindwa kwa majaribio. [automated_integration_testing]
    Mahitaji haya yanaweza kuonekana kama sehemu ndogo ya test_continuous_integration, lakini yanazingatia majaribio tu, bila kuhitaji uunganisho wa kuendelea.

    [automated_integration_testing] Justification
    What the criterion requires
    An automated test suite MUST be applied on each check-in to a shared repository for at least one branch. This test suite MUST produce a report on test success or failure.

    Both requirements are fully satisfied.

    1 — Automated test suite on every check-in
    Two GitHub Actions workflows enforce this:

    Workflow Trigger Branch(es) File
    Trestle PR pipeline pull_request (all PRs) + push to develop develop + every PR target .github/workflows/python-test.yml
    Trestle Deploy push to main and v[0-9]* release branches main, release branches .github/workflows/python-push.yml
    Every check-in to the primary shared branch (develop) and every pull-request check-in triggers the full python-test.yml pipeline automatically — satisfying the "each check-in / at least one branch" requirement.

    2 — Test suite execution
    Tests run via pytest under the Hatch test runner, across a matrix of:

    OS: Ubuntu, macOS, Windows
    Python: 3.11 (min) and 3.14 (max), defined dynamically from version.json
    Relevant configuration from pyproject.toml:

    [tool.pytest.ini_options]
    minversion = "6.2"
    testpaths = ["tests"]

    [tool.hatch.envs.hatch-test]
    default-args = ["tests"]
    parallel = true
    randomize = true
    dependencies = ["coverage[toml]~=7.4", "pytest>=8.1", "pytest-xdist[psutil]>=3.5", ...]

    The test job in python-test.yml runs:

    hatch test -py <version> for non-core matrix cells
    hatch test --cover -py <version> for the core cell (Ubuntu + max Python)
    3 — Test report produced
    The suite produces reports at two levels:

    a) GitHub Actions pass/fail status — every job exit code is reported natively in the GitHub Actions UI. The develop branch CI badge is published directly on the README:

    GitHub Actions status

    b) Coverage XML report → SonarCloud — the core test cell generates coverage.xml, uploads it as a GitHub Actions artifact, and then the sonar job consumes it:

    python-test.yml

    • name: Generate coverage report
      run: coverage xml
    • name: Upload artifact
      uses: actions/upload-artifact@...
      with:
      name: coverage
      path: coverage.xml

    sonar job

    • name: SonarQube Scan
      uses: SonarSource/sonarqube-scan-action@...
      with:
      args: -Dsonar.python.coverage.reportPaths=coverage.xml ...
    • name: SonarQube Quality Gate check
      uses: sonarsource/sonarqube-quality-gate-action@...

    The SonarCloud quality gate badge is also published on the README:

    Quality gate
    Code Coverage

    Key URLs
    Resource URL
    PR/develop CI workflow https://github.com/oscal-compass/compliance-trestle/actions/workflows/python-test.yml
    Deploy/main CI workflow https://github.com/oscal-compass/compliance-trestle/actions/workflows/python-push.yml
    SonarCloud dashboard https://sonarcloud.io/dashboard?id=compliance-trestle
    SonarCloud coverage badge https://sonarcloud.io/api/project_badges/measure?project=compliance-trestle&metric=coverage
    SonarCloud quality gate badge https://sonarcloud.io/api/project_badges/measure?project=compliance-trestle&metric=alert_status
    OpenSSF Best Practices entry https://www.bestpractices.dev/projects/9408



    Mradi LAZIMA uongeze majaribio ya kurudi nyuma kwa seti ya majaribio ya kiotomatiki kwa angalau 50% ya hitilafu zilizorekebisha ndani ya miezi sita iliyopita. [regression_tests_added50]

    [regression_tests_added50] — REQUIREMENT MET ✅

    Justification:

    Over the last six months (since 2026-03-10), the compliance-trestle project on GitHub (oscal-compass/compliance-trestle) has fixed approximately 28 distinct code-logic bugs and added regression tests for at least 20 of them — a ratio of approximately 71%, which exceeds the required 50% threshold.

    Representative examples with test evidence:

    Bug Fix PR Description Test File(s) Added/Extended
    #2347 Pydantic v1→v2 migration issue tests/trestle/core/base_model_test.py (+33 lines)
    #2222 ssp-generate KeyError on missing profile-param-value-origin tests/trestle/core/commands/author/ssp_test.py (+213 lines)
    #2286 is_ordered_sublist matching substrings across list items tests/trestle/utils/list_utils_test.py (+7 lines)
    #2177 Allow empty parameter labels in OSCAL imports tests/trestle/core/base_model_test.py (+63), tests/trestle/core/commands/import__test.py (+53)
    #2171 Resolve indexed terminal alias in model-utils tests/trestle/utils/fs_test.py (+179 lines)
    #2190 Handle optional by_components in SSP assemble merge tests/trestle/core/commands/author/ssp_test.py (+101 lines)
    #2226 Bad HTML filtering regexp (CodeQL) tests/trestle/core/markdown/markdown_node_test.py (+35 lines)
    #2209 Handle dotted directory paths in trash resolution tests/trestle/utils/trash_test.py (+33 lines)
    #2146 Preserve dotted catalog names in validate -a tests/trestle/core/commands/validate_test.py (+16), tests/trestle/utils/fs_test.py (+12)
    #2130 Timezone-aware datetimes in cache _time_since_modification tests/trestle/core/remote/cache_test.py (+30 lines)
    #2118 Correct error path in assemble command tests/trestle/core/commands/author/ (assemble tests)
    #2186 Handle missing metadata in version command tests/trestle/core/commands/version_test.py (+31 lines)
    macOS path fix Path security validator behaviour on macOS tests/trestle/core/remote/cache_security_test.py (+14 lines)
    #2166 Avoid duplicate file read in cache get_raw tests/trestle/core/remote/cache_test.py (+18 lines)
    #2193 Clean up distributed subdir after merge tests/trestle/core/commands/merge_test.py (+2 lines)
    Key URLs:

    Repository: https://github.com/oscal-compass/compliance-trestle
    Test suite directory: tests/trestle/
    Example high-coverage fix PR: https://github.com/oscal-compass/compliance-trestle/pull/2222 (SSP KeyError — 213-line test addition)
    Example regression test PR: https://github.com/oscal-compass/compliance-trestle/pull/2171 (indexed alias — 179-line test addition)
    The project consistently enforces the practice of pairing bug fixes with regression tests in the same PR, as evidenced across all categories of fixes (commands, cache, markdown, model utilities, file system utilities, and task code).



    Mradi LAZIMA uwe na seti ya majaribio ya kiotomatiki ya FLOSS inayotoa angalau 80% ya usakinishaji wa taarifa ikiwa kuna angalau zana moja ya FLOSS inayoweza kupima kigezo hiki katika lugha iliyochaguliwa. [test_statement_coverage80]
    Zana nyingi za FLOSS zinapatikana kupima usakinishaji wa majaribio, ikiwa ni pamoja na gcov/lcov, Blanket.js, Istanbul, JCov, na covr (R). Kumbuka kwamba kutimiza kigezo hiki sio uhakika kwamba seti ya majaribio ni ya kina, badala yake, kushindwa kutimiza kigezo hiki ni kiashiria kizito cha seti ya majaribio mbaya.

    test_statement_coverage80 — Justification
    The compliance-trestle project meets the ≥80% statement coverage criterion. Here is the complete evidence:

    Tool Used: coverage.py (via coverage[toml]~=7.4)
    Python's industry-standard coverage.py is declared as an explicit dependency in pyproject.toml under the hatch-test environment:

    [tool.hatch.envs.hatch-test]
    dependencies = [
    "coverage[toml]~=7.4",
    ...
    ]

    Coverage is configured at pyproject.toml with parallel, multi-process collection:

    [tool.coverage.run]
    relative_files = true
    parallel = true
    concurrency = ["thread", "multiprocessing"]

    Coverage is Enforced in CI/CD
    The GitHub Actions workflow .github/workflows/python-test.yml runs tests with coverage on every PR and push to develop, generates a coverage.xml artifact, and feeds it into SonarQube Quality Gate:

    hatch test --cover runs the full test suite with coverage instrumentation
    coverage xml generates the XML report
    The XML is uploaded as a workflow artifact and passed to SonarCloud at sonar.python.coverage.reportPaths=coverage.xml
    The SonarQube Quality Gate step (line 276) fails the build if the gate does not pass — enforcing coverage as a mandatory merge requirement
    Live Coverage Badge
    The README.md displays a live SonarCloud coverage badge:

    https://sonarcloud.io/api/project_badges/measure?project=compliance-trestle&metric=coverage

    SonarCloud dashboard: https://sonarcloud.io/dashboard?id=compliance-trestle

    This badge reflects the current measured statement coverage from the latest CI run.

    Test Suite Scale
    The project has 122 Python test files under tests/ covering all major subsystems, run across 3 OSes (Ubuntu, macOS, Windows) and multiple Python versions (3.11–3.14) as shown in the CI matrix at .github/workflows/python-test.yml.

    Key URLs
    Resource URL
    SonarCloud coverage dashboard https://sonarcloud.io/dashboard?id=compliance-trestle
    Live coverage badge https://sonarcloud.io/api/project_badges/measure?project=compliance-trestle&metric=coverage
    CI workflow (coverage steps) https://github.com/oscal-compass/compliance-trestle/blob/develop/.github/workflows/python-test.yml
    pyproject.toml (coverage config) https://github.com/oscal-compass/compliance-trestle/blob/develop/pyproject.toml
    OpenSSF Best Practices entry https://www.bestpractices.dev/projects/9408


  • Upimaji wa utendaji mpya


    Mradi LAZIMA uwe na sera rasmi iliyoandikwa kwamba kadri utendakazi mkubwa mpya unaongezwa, majaribio ya utendakazi mpya LAZIMA yaongezwe kwenye seti ya majaribio ya kiotomatiki. [test_policy_mandated]

    Justification
    The requirement is satisfied by four mutually reinforcing, written, machine-enforced mechanisms:

    1. Formal Written Policy in CONTRIBUTING.md — Explicit MUST language
      CONTRIBUTING.md line 41:

    "Contributors must include test cases to meet at least the minimum code coverage requirements."

    CONTRIBUTING.md line 195–201:

    "Tests must exist for at least 96% of trestle Python code. … A PR without sufficient test coverage will fail the trestle CI process and will not be approved or merged."

    This is a direct, formal, written policy using mandatory language. It explicitly ties new code (including new functionality) to test coverage requirements, and states that failure blocks merge.

    1. Automated Enforcement via CI Pipeline — python-test.yml
      The CI workflow Trestle PR pipeline runs automatically on every pull request and every push to develop. It:

    Runs the full test suite (make test) across Ubuntu, macOS, and Windows on both minimum and maximum supported Python versions (lines 160–219)
    Collects and uploads a coverage report (lines 221–231)
    Submits coverage to SonarCloud with a Quality Gate check that must pass before merging (lines 233–281)
    A PR cannot be merged if tests fail or coverage falls below the Quality Gate threshold.

    1. SonarCloud Quality Gate — sonarcloud.io
      The SonarCloud Quality Gate is a named, external gating system that enforces coverage and test metrics on every PR. The workflow step SonarQube Quality Gate check is configured to fail the pipeline if the gate is not passed. The project's SonarCloud dashboard is also linked directly in the PR template (see below).

    2. Pull Request Template Checklist — .github/PULL_REQUEST_TEMPLATE/develop.md
      Every PR to develop is presented with a mandatory checklist that includes:

    "My PR meets testing requirements."
    "All new and existing tests passed."

    And links directly to the SonarCloud coverage dashboard:

    "Sonar coverage"

    Key URLs
    Evidence URL
    Formal policy (CONTRIBUTING.md) https://github.com/oscal-compass/compliance-trestle/blob/develop/CONTRIBUTING.md#code-testing
    CI pipeline definition https://github.com/oscal-compass/compliance-trestle/blob/develop/.github/workflows/python-test.yml
    PR template checklist https://github.com/oscal-compass/compliance-trestle/blob/develop/.github/PULL_REQUEST_TEMPLATE/develop.md
    SonarCloud Quality Gate https://sonarcloud.io/project/overview?id=compliance-trestle



    Mradi LAZIMA ujumuishe, katika maelekezo yake yaliyoandikwa kwa mapendekezo ya mabadiliko, sera kwamba majaribio yataongezwa kwa utendakazi mkubwa mpya. [tests_documented_added]
    Hata hivyo, hata sheria isiyo rasmi inakubaliwa mradi majaribio yaongezwe kimakosa.

    https://github.com/oscal-compass/compliance-trestle/blob/develop/CONTRIBUTING.md

    Trestle updating, testing and release logistics

    "Contributors must include test cases to meet at least the minimum code coverage requirements."


  • Bendera za maonyo


    Miradi LAZIMA iwe na ukali wa juu zaidi na maonyo katika programu iliyozalishwa na mradi, iwezekanavyo vitendo. [warnings_strict]
    Baadhi ya maonyo hayawezi kuwashwa kwa ufanisi kwenye miradi fulani. Kinachohitajika ni ushahidi kwamba mradi unajitahidi kuwasha bendera za onyo ambapo inaweza, ili makosa yagundulika mapema.

    The project uses Code formatting (yapf) and code linting (flake8) to flag code issues with both errors or warnings, depending on the issue. The project also use sonar https://sonarcloud.io/project/overview?id=compliance-trestle.


 Usalama 13/13 ●

  • Maarifa ya maendeleo yenye usalama


    Mradi LAZIMA utekeleze kanuni za muundo salama (kutoka "know_secure_design"), pale inapohusika. Ikiwa mradi hauzalishi programu, chagua "haihusiki" (N/A). [implement_secure_design]
    Kwa mfano, matokeo ya mradi yanapaswa kuwa na mipangilio salama ya kuzuia makosa (maamuzi ya ufikiaji yanapaswa kukataa kwa chaguo-msingi, na usakinishaji wa mradi unapaswa kuwa salama kwa chaguo-msingi). Pia yanapaswa kuwa na kikuu cha kati kikamilifu (kila ufikiaji ambao unaweza kuwekwa kikomo lazima ufanyiwe ukaguzi wa mamlaka na usiweze kuvukwa). Kumbuka kwamba katika hali fulani kanuni zitagombana, na katika hali hiyo chaguo lazima lifanywe (k.m., taratibu nyingi zinaweza kufanya mambo kuwa magumu zaidi, kukiuka "uchumi wa utaratibu" / iweke rahisi).

    Status: Met

    compliance-trestle is a software project that produces an OSCAL authoring and validation CLI tool. Secure design principles apply in full. The sections below map each principle to concrete, verifiable evidence in the codebase.

    1. Fail-Safe Defaults
      Access decisions should deny by default; installation should be secure by default.

    Evidence Location
    HTTPS-only remote access. HTTP is unconditionally rejected; only https:// and sftp:// are permitted. security.py:149-162
    Loopback, link-local, cloud-metadata endpoints always blocked. ALWAYS_BLOCKED_NETWORKS and METADATA_HOSTNAMES apply regardless of configuration. security.py:50-77
    Private-IP blocking is an opt-in relaxation. SigningManifestDiscovery sets block_private_ips = True by default; callers must explicitly pass allow_private_uris=True. signing_manifest_discovery.py:45-57
    Workspace-boundary enforcement is on by default. validate_local_file_path requires paths inside the workspace root unless the caller explicitly passes allow_outside_workspace=True. security.py:446-549
    No-overwrite default for signed output. trestle sign raises TrestleError if the output file already exists and --overwrite was not requested. signing.py:119-147
    Bounded resource defaults. Maximum discovered artifacts (1,000), depth (64), per-file size (50 MiB), and aggregate remote size (500 MiB) are fixed constants that prevent resource-exhaustion. signing_manifest_discovery.py:34-39
    Safe YAML loading by default. YAML(typ='safe') is used everywhere YAML is parsed, preventing arbitrary Python-object construction. file_utils.py:223-237
    Defusedxml for XML parsing. The defusedxml library is a declared dependency, blocking XML-bomb, XXE, and entity-expansion attacks. pyproject.toml:35-55
    Default packaged config contains no credentials or permissive settings. config.ini
    2. Complete Mediation
    Every access that might be limited must be checked for authority; checks must be non-bypassable.

    Evidence Location
    Double validation for remote fetches. URLSecurityValidator.validate_url() is called both in the fetcher constructor and immediately before requests.get() in _do_fetch(), mitigating DNS-rebinding/TOCTOU attacks. cache.py:264-337
    Every remote URL is fully parsed, DNS-resolved, canonicalized, and checked against blocked networks, metadata hostnames, and optional domain allowlist. security.py:80-129
    IPv4-mapped IPv6 addresses are canonicalized to their IPv4 form before network checks, preventing bypass via ::ffff:127.0.0.1. security.py:216-230
    Path-traversal checks at every file access boundary (URL paths for cache, resolved cache paths, trestle:// URIs, local workspace paths, signing output paths, manifest artifact paths). security.py:306-549, signing_manifest.py:213-236
    Cryptographic authority verification. Signature verification checks DSSE envelope structure, in-toto statement type, predicate type, canonicalization algorithm, digest algorithm, and the SHA-256 digest of the canonical document — any mismatch raises an error. signing.py:182-232
    Constant-time digest comparison (hmac.compare_digest) for signed package verification, preventing timing-oracle attacks. signing_manifest.py:136-191
    Validated Pydantic model loading wraps all OSCAL model deserialization; validation errors are surfaced, not silently accepted. trestle_base_model.py:27-66
    Symlink rejection at both signing output and remote-artifact vendoring paths. signing.py:119-147, signing_manifest_discovery.py:197-233
    Cycle detection and recursion-depth limiting in manifest dependency discovery, with finally guaranteeing stack cleanup. signing_manifest_discovery.py:70-97
    3. Economy of Mechanism (Keep It Simple)
    Evidence Location
    Dedicated security.py module centralizes all SSRF, path-traversal, and sensitive-file logic in one well-named place, making the security surface easy to audit. remote/security.py
    Normalized exception handling converts all security violations to TrestleError, providing a single control-flow path. Throughout
    4. Least Privilege / Credential Hygiene
    Evidence Location
    Credentials must be environment-variable references (mustache template syntax). Literal credential strings are rejected at parse time. cache.py:275-311
    Documented in internal spec: Credentials MUST NOT be stored in cleartext. caching_spec.md:131-164
    5. Defense-in-Depth / Input Validation
    Evidence Location
    SSTI prevention. Jinja2 template delimiters ({{, }}) in OSCAL prose are neutralized before output, applied at every prose-writing boundary. ssp_io.py:36-48
    Security-tested Jinja2 sandbox with autoescape=True and tests confirming RCE-payload blocking. tags_security_test.py
    Directory/task name validation rejects absolute paths, traversal segments, hidden names, reserved names, and file-extension names. file_utils.py:95-133
    Sensitive-file denylist blocks access to credentials, SSH keys, cloud configuration, /proc, /sys, logs, and DB directories even when outside-workspace access is explicitly granted. security.py:446-549
    Reject-unknown-fields validation in manifest parsing. signing_manifest.py:213-236
    Bandit (flake8-bandit S rules) enabled in Ruff linting, providing static security analysis on every CI run. pyproject.toml:205-220
    6. Open Design / Documented Security Properties
    Evidence Location
    CLI tutorial documents SSRF protections, limit constants, signature-verification steps, and HTTPS-only policy. docs/tutorials/cli.md:656-696
    Caching spec documents HTTPS requirement and credential-handling policy. internal_spec_documents/caching_spec.md
    Summary
    The project implements all applicable secure-design principles from the know_secure_design framework:

    Fail-safe defaults — deny-by-default for private networks, symlinks, path traversal, HTTP, and unknown fields; secure resource limits; safe parsers out of the box.
    Complete mediation — every remote fetch, local file access, path lookup, and cryptographic verification goes through a non-bypassable validation layer before the operation executes.
    Economy of mechanism — security logic is consolidated in dedicated, auditable modules.
    Least privilege — credentials are env-var references; explicit opt-ins required for any relaxation.
    Defense-in-depth — layered validation (URL → DNS → IP → path → size → type → signature), SSTI neutralization, sandbox testing, and static security linting.


  • Tumia mazoea mazuri ya msingi ya usimbuaji

    Kumbuka kwamba programu fulani haihitaji kutumia taratibu za usimbuaji. Ikiwa mradi wako unazalisha programu ambayo (1) inajumuisha, inaamilisha, au inafanya usimbuaji kuwa hai, na (2) inaweza kutolewa kutoka Marekani (US) kwenda nje ya Marekani au kwa raia asiye wa Marekani, inaweza kuwa ni lazima kisheria kuchukua hatua chache za ziada. Kawaida hii inahusisha tu kutuma barua pepe. Kwa maelezo zaidi, tazama sehemu ya usimbuaji ya Kuelewa Teknolojia ya Chanzo Wazi & Udhibiti wa Usafirishaji wa Marekani.

    Mifumo ya usalama ya chaguo-msingi ndani ya programu inayozalishwa na mradi LAZIMA ISITEGEMEE algoriti za kriptologia au hali zenye udhaifu mkubwa unaojulikana (k.m., algoriti ya hash ya kriptologia ya SHA-1 au hali ya CBC katika SSH). [crypto_weaknesses]
    Wasiwasi kuhusu hali ya CBC katika SSH unajadiliwa katika CERT: SSH CBC vulnerability.


    Mradi INAPASWA kusaidia algoriti nyingi za kriptologia, ili watumiaji waweze kubadilisha haraka ikiwa moja imevunjwa. Algoriti za kawaida za funguo za simetria ni pamoja na AES, Twofish, na Serpent. Mbadala wa algoriti za hash za kriptologia za kawaida ni pamoja na SHA-2 (ikiwa ni pamoja na SHA-224, SHA-256, SHA-384 NA SHA-512) na SHA-3. [crypto_algorithm_agility]

    crypto_algorithm_agility — N/A
    Justification
    All cryptographic operations in this project are confined to two beta features — json-signing and json-manifest-signing — which are disabled by default and must be explicitly opted into via trestle beta enable <feature>. No cryptographic operations are active in a standard installation.

    Component Beta Gate Feature Name
    trestle/core/signing.py @beta_feature json-signing
    trestle/core/canonicalization.py @beta_feature json-signing
    trestle/core/signing_manifest.py @beta_feature json-manifest-signing
    trestle/core/signing_manifest_discovery.py @beta_feature json-manifest-signing
    Because there are no cryptographic operations in the stable, generally available interface, the crypto_algorithm_agility requirement — which targets production crypto surfaces — does not apply to this release.

    Key URLs
    Beta feature registration: trestle/core/beta_features.py:51-68
    Beta gate decorator usage: trestle/core/commands/sign.py:72, trestle/core/commands/sign_manifest.py:65
    Beta enable/disable command: trestle/core/commands/beta.py
    Forward-looking note
    If either beta feature is promoted to GA, the SHA-256 hardcoding in signing.py:39 and the explicit rejection of non-SHA-256 predicates at signing.py:229 would need to be replaced with a configurable, algorithm-agile design before that promotion.



    Mradi LAZIMA usaidie kuhifadhi vitambulisho vya uthibitishaji (kama vile nywila na ishara za nguvu) na funguo za kibinafsi za kriptologia katika mafaili ambayo yametengwa na habari nyingine (kama vile mafaili ya usanidi, hifadhidata, na kumbukumbu), na kuruhusu watumiaji kusasisha na kubadilisha bila ukusanyaji upya wa msimbo. Ikiwa mradi haufanyi usindikaji wa vitambulisho vya uthibitishaji na funguo za kibinafsi za kriptologia, chagua "haihusiki" (N/A). [crypto_credential_agility]

    Assessment: Met
    The project fully satisfies crypto_credential_agility. All private cryptographic keys are supplied as separate user-managed files, key passwords are supplied via environment variables (never embedded in config or code), and no recompilation is required to change or replace any credential.

    Justification

    1. Private keys are always separate files, never stored in config or code
      Both trestle sign and trestle sign-manifest require the private key to be passed as a CLI argument pointing to a user-owned PEM file on disk — explicitly kept apart from OSCAL JSON files, configuration (.trestle/config.ini), databases, and logs:

    sign.py:53–57 — --private-key argument: "Path to the PEM private key for signing."
    sign_manifest.py:51–55 — same --private-key argument
    The code explicitly validates that the key file path cannot be the same as the output envelope path (sign.py:98–99, sign_manifest.py:90–91), ensuring physical separation is enforced at runtime.

    Public keys are equally separate: --public-key on trestle verify (verify.py:54) and trestle verify-manifest (verify_manifest.py:50) each point to an independent PEM file.

    1. Key passwords are supplied via environment variable, not config files or command-line arguments
      Encrypted PEM keys are supported. The password is read at runtime from a named environment variable, keeping it out of config files, logs, and shell history:

    sign.py:59–62: --key-password-env — "Environment variable containing the password for an encrypted PEM private key."
    sign.py:101–105:
    if key_password_env is not None:
    if key_password_env not in os.environ:
    raise TrestleError(f'Key password environment variable is not set: {key_password_env}')
    key_password = os.environ[key_password_env]

    Same pattern in sign_manifest.py:93–97.
    The password is never written to disk, never logged, and never appears in the DSSE output.

    1. SFTP SSH private key is also environment-variable-driven
      For remote SFTP dependency fetching in cache.py:486–491, the SSH private key is read from the SSH_KEY environment variable or delegated to ssh-agent — again completely separate from any trestle config file:

    if 'SSH_KEY' in os.environ:
    pkey = paramiko.RSAKey.from_private_key(StringIO(os.environ['SSH_KEY']))
    look_for_keys = False
    else:
    pkey = None
    look_for_keys = True # delegates to ssh-agent / default key paths

    1. No recompilation required to update or replace any key
      All key paths and passwords are runtime parameters (CLI flags and environment variables). A user can rotate to a new key pair, change to a different key type (Ed25519 → RSA, as explicitly documented), or change the encryption password entirely by simply providing different values at invocation — zero code changes needed.

    2. Credential handling applies only to beta functionality
      As established previously, all of this credential processing lives behind the @beta_feature gate. The credential agility properties hold regardless — the requirement is satisfied for the functionality that does exist.

    Key URLs
    Source Relevance
    docs/tutorials/cli.md#trestle-sign Documents --private-key (separate file), --key-password-env (env var for password), chmod 600 guidance, and key rotation with no recompilation
    docs/tutorials/cli.md:636–648 Encrypted key workflow: password via env var, never on CLI or in config
    docs/tutorials/cli.md:552 SSH_KEY env var pattern for SFTP credential separation
    trestle/core/commands/sign.py:50–65 CLI argument definitions — --private-key and --key-password-env
    trestle/core/commands/sign_manifest.py:46–63 Same pattern for manifest signing
    trestle/core/signing.py:49–56 load_pem_private_key_signer() — loads key from a path at runtime, no hardcoding
    Published docs URL: https://oscal-compass.github.io/compliance-trestle/tutorials/cli/#trestle-sign Registered documentation_url for the json-signing beta feature



    Programu iliyozalishwa na mradi INAPASWA kusaidia itifaki salama kwa mawasiliano yake yote ya mtandao, kama vile SSHv2 au zaidi, TLS1.2 au zaidi (HTTPS), IPsec, SFTP, na SNMPv3. Itifaki zisizo salama kama vile FTP, HTTP, telnet, SSLv3 au mapema zaidi, na SSHv1 ZINAPASWA kuzimwa kwa chaguo-msingi, na kuzimwa tu ikiwa mtumiaji anaisanidi mahususi. Ikiwa programu iliyozalishwa na mradi haiesaidii mawasiliano ya mtandao, chagua "haihusiki" (N/A). [crypto_used_network]

    Assessment: Met
    Justification
    The project makes network connections via exactly two remote protocols: HTTPS and SFTP. Both are secure by enforcement, not by convention. Insecure protocols (plain HTTP, FTP, telnet, SSLv3, SSHv1) are categorically blocked — they cannot be enabled by configuration.

    Evidence by protocol

    1. HTTPS — enforced at the scheme-validation layer
      URLSecurityValidator._parse_and_validate_url() hard-rejects any scheme that is not https or sftp:

    if parsed.scheme not in ['https', 'sftp']:
    raise TrestleError(f'Only HTTPS or SFTP schemes are allowed for remote URLs, got: {parsed.scheme}')

    This is called both at HTTPSFetcher.init() (cache.py:269) and again immediately before every fetch (cache.py:337) to close the DNS-rebinding TOCTOU window. There is no code path that makes an HTTP request — requests.get() (cache.py:355) is only reachable after scheme validation has already confirmed https://.

    TLS version is delegated to the requests library's default, which uses the system OpenSSL/TLS stack. No downgrade to SSLv3/TLSv1.0/TLSv1.1 is configured; the verify parameter is set to True by default and overridden only by a user-supplied CA bundle path (cache.py:342–350), not disabled.

    1. SFTP — SSH transport, insecure FTP explicitly rejected
      SFTPFetcher uses paramiko over SSH, inheriting SSHv2 (paramiko's only supported version). The client.load_system_host_keys() call (cache.py:482) enforces known-host verification.

    Plain ftp: is explicitly caught and rejected by FetcherFactory.get_uri_type() (cache.py:578–579):

    if uri_clean.startswith('ftp:'):
    raise TrestleError(f'Invalid uri {uri} ftp is not supported. Use sftp instead.')

    This error is unconditional — there is no configuration flag to re-enable FTP.

    1. No plain HTTP, no telnet, no SSLv3, no SSHv1
      There is no http:// fetcher class, no telnet support, and no SSL version downgrade option anywhere in the codebase. The only two UriType enum values for remote access are SFTP and HTTPS (cache.py:554–556).

    2. Documented as HTTPS/SFTP only
      The user-facing documentation explicitly lists only the two secure schemes:

    "The provided href can be of form trestle://, https://, sftp://, or file:///."
    — docs/tutorials/cli.md:547

    Key source locations
    File Relevance
    trestle/core/remote/security.py:159–160 Hard scheme allowlist: only https and sftp permitted
    trestle/core/remote/cache.py:578–579 Explicit ftp: rejection with error message directing to sftp
    trestle/core/remote/cache.py:249–380 HTTPSFetcher — HTTPS-only, TLS cert verification on by default
    trestle/core/remote/cache.py:405–539 SFTPFetcher — paramiko SSHv2, known-hosts enforced
    trestle/core/remote/cache.py:334–337 Pre-fetch re-validation to prevent DNS-rebinding downgrade
    docs/tutorials/cli.md:547–552 User documentation listing only https:// and sftp:// as remote schemes



    Programu iliyozalishwa na mradi INAPASWA, ikiwa inasaidia au inatumia TLS, kusaidia angalau toleo la TLS 1.2. Kumbuka kuwa kilichotangulia TLS kiliitwa SSL. Ikiwa programu haitumii TLS, chagua "haihusiki" (N/A). [crypto_tls12]

    Assessment: Met
    Justification
    The project uses TLS exclusively through the requests library for HTTPS fetching. TLS 1.2+ compliance is guaranteed by the combination of the requests version floor, its dependency chain, and the absence of any downgrade configuration in the project code.

    How TLS is used
    The sole TLS code path is HTTPSFetcher._do_fetch(), which calls requests.get() (cache.py:355–362):

    response = requests.get(
    self._url,
    auth=auth,
    verify=verify, # defaults to True (cert validation on)
    timeout=30,
    allow_redirects=False,
    stream=...,
    )

    There is no ssl_context, ssl_version, or PROTOCOL_* override anywhere in the codebase — TLS negotiation is fully delegated to the requests/urllib3/OpenSSL stack.

    Why that stack enforces TLS 1.2+

    1. requests >= 2.32.2 (pyproject.toml:53)

    requests 2.32.x depends on urllib3 >= 2.0. urllib3 2.0 dropped support for TLS 1.0 and TLS 1.1 entirely, setting SSLContext.minimum_version = TLSVersion.TLSv1_2 by default. This means TLS 1.2 is the minimum regardless of the system OpenSSL default.

    1. cryptography >= 46.0.7 (pyproject.toml:38)

    The cryptography 46.x series requires OpenSSL 1.1.1 or later and PyCA cryptography itself enforces TLS 1.2+ in all contexts it manages. This underpins the paramiko SSH transport as well.

    1. paramiko == 5.0.0 (pyproject.toml:39)

    Paramiko 5.x requires cryptography >= 3.3 and exclusively uses SSHv2 — there is no SSHv1 support in any supported paramiko release. The SFTP transport carries no TLS but does carry SSHv2, which is a listed approved protocol in the requirement.

    1. Certificate verification on by default

    verify=None in the requests.get() call means True (verify against the system CA bundle) unless the user has set REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE to a valid path (cache.py:342–350). Setting those env vars to an invalid path raises a TrestleError — it is impossible to silently disable certificate verification.

    Key source locations
    File Relevance
    pyproject.toml:53 requests>=2.32.2 — floor that pulls in urllib3>=2.0, which enforces TLS 1.2 minimum
    pyproject.toml:38 cryptography>=46.0.7 — modern TLS stack, OpenSSL 1.1.1+ required
    pyproject.toml:39 paramiko==5.0.0 — SSHv2 only, no SSHv1
    trestle/core/remote/cache.py:334–380 Only TLS call site — no version override, cert verify on by default
    trestle/core/remote/cache.py:340–350 CA bundle handling — invalid path raises error, cannot be used to disable TLS verification
    trestle/core/remote/security.py:159–160 Scheme allowlist enforces https or sftp only — plain HTTP cannot reach the TLS layer at all
    Key external references
    urllib3 2.0 changelog (drops TLS <1.2): https://urllib3.readthedocs.io/en/stable/changelog.html
    requests 2.32 release (urllib3 2.x dependency): https://github.com/psf/requests/releases/tag/v2.32.0
    paramiko 5.x (SSHv2 only): https://www.paramiko.org/changelog.html



    Programu iliyozalishwa na mradi LAZIMA, ikiwa inasaidia TLS, ifanye uthibitishaji wa cheti cha TLS kwa chaguo-msingi inapotumia TLS, ikiwa ni pamoja na rasilimali ndogo. Ikiwa programu haitumii TLS, chagua "haihusiki" (N/A). [crypto_certificate_verification]

    Assessment: Met
    Justification
    TLS certificate verification is on by default and cannot be silently disabled. The single TLS call site in the project enforces this through three layers.

    Layer 1 — requests.get() defaults to verify=True
    HTTPSFetcher._do_fetch() passes verify=verify where verify starts as None:

    verify = None
    for env_var_name in ['REQUESTS_CA_BUNDLE', 'CURL_CA_BUNDLE']:
    if env_var_name in os.environ:
    if pathlib.Path(os.environ[env_var_name]).exists():
    verify = os.environ[env_var_name] # a valid CA bundle path
    break
    else:
    raise TrestleError(...) # bad path → hard error, not silent skip

    response = requests.get(self._url, verify=verify, ...)

    When verify=None, the requests library treats it identically to verify=True — it verifies the server certificate against the default system CA bundle. There is no code path that sets verify=False anywhere in the project.

    Layer 2 — Invalid CA bundle path is a hard error, not a bypass
    If REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE is set to a non-existent path (cache.py:347–350):

    raise TrestleError(f'Env var ${env_var_name} found but path does not exist: ...')

    A misconfigured CA bundle raises a TrestleError and aborts rather than falling back to unverified connections. This prevents accidental verification bypass via a broken environment variable.

    Layer 3 — Scheme allowlist prevents reaching TLS in the first place with insecure schemes
    URLSecurityValidator._parse_and_validate_url() rejects anything that is not https or sftp before any network connection is attempted. Plain http:// cannot reach the requests.get() call, so there is no opportunity for an unverified connection.

    Subresources
    The signing_manifest_discovery flow fetches remote OSCAL dependencies (profiles, catalogs) referenced by hrefs. All such fetches go through the same FetcherFactory → HTTPSFetcher path (signing_manifest_discovery.py:185), so subresource fetches are subject to identical TLS verification.

    Key source locations
    File Relevance
    trestle/core/remote/cache.py:339–362 verify=None defaults to True in requests; invalid CA bundle path raises hard error
    trestle/core/remote/security.py:159–160 Scheme allowlist — https and sftp only; plain HTTP never reaches TLS layer
    trestle/core/signing_manifest_discovery.py:183–185 Subresource fetches use same FetcherFactory path — same verification applies
    Key external references
    "The Most Dangerous Code in the World" (Georgiev et al.) identifies verify=False and skipped hostname checks as the canonical failure modes — neither is present here.
    requests documentation on verify: https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification — confirms None and True are equivalent (verify against system CAs).



    Programu iliyozalishwa na mradi LAZIMA, ikiwa inasaidia TLS, ifanye uthibitishaji wa cheti kabla ya kutuma vichwa vya HTTP na habari ya kibinafsi (kama vile vidakuzi salama). Ikiwa programu haitumii TLS, chagua "haihusiki" (N/A). [crypto_verification_private]

    Assessment: Met
    Justification
    The project sends HTTP authentication credentials (username/password via HTTPBasicAuth) over HTTPS only, and certificate verification is performed before any such credentials are transmitted, by construction of the requests library's connection model.

    How credentials are sent
    HTTPSFetcher._do_fetch() constructs an auth object and passes it to requests.get():

    auth = None
    ...
    if self._username is not None and self._password is not None:
    auth = HTTPBasicAuth(self._username, self._password)

    response = requests.get(
    self._url,
    auth=auth,
    verify=verify, # defaults to True — cert verified before connection completes
    ...
    )

    HTTPBasicAuth injects an Authorization header into the HTTP request. In the requests library, the TLS handshake (including full certificate verification) completes before the HTTP request — and therefore before any headers — is transmitted over the wire. This is the fundamental property of TLS: the encrypted channel is established and authenticated first; application data (including HTTP headers) is only ever sent through the verified tunnel.

    Why this is guaranteed
    There is no mechanism in the project code that could cause headers to be sent before verification:

    verify is never False — as established in the previous assessment, there is no code path that sets verify=False. Certificate verification cannot be skipped.
    The scheme allowlist blocks plain HTTP — URLSecurityValidator rejects any scheme other than https or sftp before a connection is attempted. It is impossible to accidentally send HTTPBasicAuth credentials over an unencrypted HTTP connection.
    Credentials are only resolved at fetch time, not stored in the URL — usernames and passwords are read from environment variables (cache.py:284–301), preventing them from appearing in logs or error messages as part of a URL string.
    No cookies
    The project does not use cookies anywhere. The only private information transmitted in HTTP headers is the Authorization header from HTTPBasicAuth, which is subject to the guarantees above.

    Key source locations
    File Relevance
    trestle/core/remote/cache.py:339–362 auth only sent via requests.get() after TLS handshake completes; verify defaults to True
    trestle/core/remote/security.py:159–160 Scheme allowlist — plain HTTP cannot be used, so Authorization header cannot be sent unencrypted
    trestle/core/remote/cache.py:284–301 Credentials sourced from environment variables, not embedded in URLs


  • Kutolewa kwa usalama


    Mradi LAZIMA uweke saini kwa kriptologia matoleo ya matokeo ya mradi yanayokusudiwa kwa matumizi ya kila mahali, na LAZIMA kuwe na mchakato ulioandikwa unaoweleza watumiaji jinsi wanaweza kupata funguo za umma za saini na kuthibitisha saini. Funguo ya kibinafsi kwa saini hizi LAZIMA ISIWE kwenye tovuti zinazosambaza moja kwa moja programu kwa umma. Ikiwa matoleo hayakusudiwa kwa matumizi ya kila mahali, chagua "haihusiki" (N/A). [signed_releases]
    Matokeo ya mradi ni pamoja na msimbo wa chanzo na matokeo yoyote yaliyozalishwa pale inapohusika (k.m., mifumo inayotekelezeka, vifurushi, na vyombo). Matokeo yaliyozalishwa YANAWEZA kuwekwa saini tofauti na msimbo wa chanzo. Hizi ZINAWEZA kutekelezwa kama lebo za git zilizowekwa saini (kwa kutumia saini za kidijitali za kriptologia). Miradi YAWEZA kutoa matokeo yaliyozalishwa tofauti na zana kama vile git, lakini katika hali hizo, matokeo tofauti LAZIMA yawekwe saini tofauti.

    Per security-insights.yml: repository.release.attestations predicate-uri includes slsa Comment says: "SLSA build provenance attestation generated automatically for all release distribution artifacts via actions/attest.".



    INAPENDEKEZWA kuwa katika mfumo wa udhibiti wa toleo, kila lebo muhimu ya toleo (lebo ambayo ni sehemu ya toleo kuu, toleo dogo, au kurekebishwa udhaifu uliotangazwa hadharani) iwekwe saini kwa kriptologia na iweze kuthibitishwa kama ilivyoelezwa katika signed_releases. [version_tags_signed]

    Release tags are cryptographically signed using an SSH Ed25519 key via the
    python-semantic-release action in the deploy pipeline. The signing key pair is
    stored as GitHub Actions environment secrets (RELEASE_TAG_SIGNING_KEY,
    RELEASE_TAG_SIGNING_KEY_PUB) scoped to the release environment so they are
    inaccessible outside the deploy job. The corresponding public key is committed to
    .github/allowed_signers, enabling independent verification with standard git —
    no out-of-band trust step required. Signing applies to all major, minor, and
    security-fix releases on both main and maintenance branches (v3, v4, …).

    To verify any release tag:

    git config gpg.ssh.allowedSignersFile .github/allowed_signers
    git fetch --tags
    git tag -v v5.1.0
    
    Key URLs:
    
    Pipeline (signing step): https://github.com/oscal-compass/compliance-trestle/blob/main/.github/workflows/python-push.yml
    Allowed signers (public key): https://github.com/oscal-compass/compliance-trestle/blob/main/.github/allowed_signers
    Verification instructions: https://oscal-compass.github.io/compliance-trestle/latest/contributing/maintenance_releases/#signed-release-tags
    Operator setup and key rotation: https://oscal-compass.github.io/compliance-trestle/latest/contributing/github_actions_setup/#release-tag-signing

  • Masuala mengine ya usalama


    Matokeo ya mradi LAZIMA yafanye ukaguzi wa pembejeo zote kutoka vyanzo visivyoaminika ili kuhakikisha ni halali (*orodha zinazokubalika*), na kukataa pembejeo zisizo halali, ikiwa kuna vizuizi vyovyote kwenye data kabisa. [input_validation]
    Kumbuka kuwa kulinganisha ingizo dhidi ya orodha ya "miundo mibaya" (aka *orodha za kukataza*) kwa kawaida haitoshi, kwa sababu washambuliaji mara nyingi wanaweza kuepuka orodha ya kukataza. Hasa, nambari zinabadilishwa kuwa miundo ya ndani na kisha kuangaliwa ikiwa ziko kati ya chini na juu zao (ikiwa ni pamoja), na vifungu vya maandishi vinaangaliwa ili kuhakikisha kuwa ni ruwaza halali za maandishi (k.m., UTF-8 halali, urefu, sintaksia, n.k.). Baadhi ya data inaweza kuhitaji kuwa "chochote kabisa" (k.m., kipakia faili), lakini hizi kwa kawaida zingekuwa nadra.

    Input Validation — Badge Justification

    Criterion: input_validation — All inputs from potentially untrusted sources are checked against an allowlist and rejected if invalid.

    Finding: Met ✅


    1. CLI / Argparse Arguments

    All CLI commands use argparse with allowlists (choices=) and typed converters. Unknown or out-of-range values are rejected before reaching application code.


    2. Output / Directory Name Validation (Allowlist)

    is_directory_name_allowed() at trestle/common/file_utils.py:95 enforces a strict allowlist:

    • Rejects absolute paths (is_absolute() + explicit / prefix check)
    • Rejects .. traversal components
    • Rejects names that collide with reserved OSCAL directory names
    • Rejects names starting with .
    • Rejects names that look like files (have a suffix)
    • Rejects names containing __global__

    Called in:


    3. File Path Traversal (Boundary Enforcement — Allowlist)

    PathSecurityValidator at trestle/core/remote/security.py:306 provides multiple layers:

    Method Validation
    validate_local_path() (line 408) resolve() + relative_to() to confirm path stays inside trestle root
    validate_cache_path() (line 340) Same boundary check for cache directory
    validate_url_path_for_cache() (line 310) Blocks .. sequences in URL path component
    validate_trestle_uri_path() (line 378) Blocks .. in trestle:// URI paths
    validate_local_file_path() (line 446) Workspace boundary + sensitive system path denylist (defense-in-depth)

    Called in:

    relative_resolve() at trestle/common/file_utils.py:256 additionally enforces that any relative path resolves within the provided cwd, raising TrestleError if not.


    4. URL / Remote Input Validation (Format + Network Allowlist)

    URLSecurityValidator.validate_url() at trestle/core/remote/security.py:99 enforces:

    • Scheme allowlist: only https and sftp accepted (line 159)
    • Hostname required: rejected if absent
    • Cloud metadata endpoint blocklist (METADATA_HOSTNAMES, line 72) — always blocked
    • Always-blocked IP ranges (loopback 127.0.0.0/8, link-local 169.254.0.0/16, 0.0.0.0/8, IPv6 equivalents, line 52)
    • Optional RFC 1918 blocking via TRESTLE_BLOCK_PRIVATE_IPS environment variable
    • IPv4-mapped IPv6 canonicalization before all checks to prevent bypass
    • DNS rebinding mitigation: validation called at both initialization and immediately before each fetch

    5. OSCAL Model Structure Validation (Schema Allowlist)

    All imported, loaded, and assembled OSCAL models are validated by Pydantic v2 via OscalBaseModel:

    • Strict type enforcement on all fields
    • extra='forbid' — unknown fields are rejected outright
    • validate_assignment=True

    On import, the full OSCAL validator suite (VAL_MODE_ALL) runs before any model is written to disk:


    6. Task Configuration Inputs (configparser)

    Tasks validate their configparser-backed inputs at runtime:

    • Required keys checked for presence; failure returns early with a logged message
    • Timestamps parsed through a typed parser — malformed values rejected with a warning
    • File paths checked via .exists() before use
    • Boolean flags read via getboolean() — raises on non-boolean values

    Key examples:


    7. File Content Type Restrictions (Extension Allowlist)

    OSCAL directory scanning in _verify_oscal_folder() at line 148 only permits {'.json', '.xml', '.yaml', '.yml', '.md'}. Task input processors similarly allowlist extensions before reading:


    8. Element Path Syntax Validation (Text Pattern Allowlist)

    ElementPath._parse() at trestle/core/models/elements.py:63:

    • Rejects empty path parts between separators
    • Rejects wildcards in invalid positions
    • Raises TrestleError immediately on malformed input

    9. Text Pattern Validation (Named Regex Allowlists)


    Summary Table

    Input Surface Validation Strategy
    CLI arguments argparse choices= allowlists + typed converters
    Output / directory names is_directory_name_allowed() multi-rule allowlist
    File paths PathSecurityValidator — resolved relative_to() boundary checks
    URLs URLSecurityValidator — scheme allowlist + IP network allowlist/blocklist
    OSCAL model data Pydantic v2 schema, extra='forbid', full validator suite on import
    Task config inputs Required-key checks, typed getters, .exists() file checks
    File types Extension allowlists in OSCAL dirs and task processors
    Element path strings Structural syntax validation, TrestleError on malformed input
    Text patterns Named regex allowlists for labels and credential placeholders


    Taratibu za kuimarisha ZINAPASWA kutumiwa katika programu iliyozalishwa na mradi ili kasoro za programu ziwe na uwezekano mdogo wa kusababisha udhaifu wa usalama. [hardening]
    Taratibu za kuimarisha zinaweza kujumuisha vichwa vya HTTP kama Sera ya Usalama wa Maudhui (CSP), bendera za mkusanyaji ili kupunguza mashambulizi (kama vile -fstack-protector), au bendera za mkusanyaji ili kuondoa tabia isiyofafanuliwa. Kwa madhumuni yetu upendeleo mdogo hauhesabiwi kuwa utaratibu wa kuimarisha (upendeleo mdogo ni muhimu, lakini tofauti).

    Software hardening justification

    Determination

    The project uses applicable hardening mechanisms to reduce the likelihood that software defects become security vulnerabilities.

    HTTP response headers such as Content Security Policy are not applicable because Compliance-trestle is a Python command-line and library project, not a web application or HTTP server. Compiler hardening flags are also not applicable because the project does not produce compiled native binaries.

    The following mechanisms are applicable and implemented:

    Mechanism Implementation Justification
    Static security analysis pyproject.toml enables Ruff security rules, including flake8-bandit rules. Detects insecure coding patterns during code-quality checks.
    Code vulnerability analysis codeql-analysis.yml runs CodeQL for Python on pull requests, pushes, and a schedule. Finds security vulnerabilities and unsafe data flows before release.
    Dependency vulnerability scanning python-test.yml runs Snyk scanning. Identifies known vulnerabilities in project dependencies.
    Dependency update monitoring dependabot.yml checks Python and GitHub Actions dependencies weekly. Helps keep dependencies patched and reduces exposure to known vulnerabilities.
    SSRF protection URLSecurityValidator blocks loopback, link-local, cloud-metadata, and optionally private-network addresses. Prevents remote references from reaching sensitive internal services.
    Path traversal protection PathSecurityValidator validates cache, local, and URI paths. Prevents crafted paths from escaping approved filesystem boundaries.
    Secure remote fetching HTTPSFetcher._do_fetch() validates URLs before fetching, verifies TLS certificates, uses a 30-second timeout, and disables redirects. Reduces DNS-rebinding, transport, redirect, and indefinite-wait risks.
    Security regression testing cache_security_test.py tests traversal and remote-fetch security controls. Helps ensure hardening protections remain effective as the code changes.

    Least privilege is intentionally not included in this determination because it is a separate security principle rather than a hardening mechanism for this criterion.

    Key URLs



    Mradi LAZIMA utoe kesi ya uhakika inayosababisha kwa nini mahitaji yake ya usalama yanakidhi. Kesi ya uhakika LAZIMA ijumuishe: maelezo ya muundo wa tishio, utambulisho wazi wa mipaka ya kuaminiwa, hoja kwamba kanuni za muundo salama zimetumika, na hoja kwamba udhaifu wa kawaida wa utekelezaji wa usalama umekabiliana nao. (URL inahitajika) [assurance_case]
    Kesi ya uhakika ni "mwili wa ushahidi ulioandikwa unaotoa hoja inayoshawishi na halali kwamba seti maalum ya madai muhimu kuhusu mali za mfumo ziko na sababu za kutosha kwa programu maalum katika mazingira maalum" ("Uhakika wa Programu Kwa kutumia Miundo ya Kesi ya Uhakika Iliyopangwa", Thomas Rhodes et al, NIST Interagency Report 7608). Mipaka ya kuaminiwa ni mipaka ambapo data au utekelezaji hubadilisha kiwango chake cha kuaminiwa, k.m., mipaka ya seva katika programu ya kawaida ya wavuti. Ni ya kawaida kuorodhesha kanuni za muundo salama (kama vile Saltzer na Schroeer) na udhaifu wa kawaida wa utekelezaji wa usalama (kama vile OWASP top 10 au CWE/SANS top 25), na kuonyesha jinsi kila moja unavyokabiliana. Kesi ya uhakika ya BadgeApp inaweza kuwa mfano wenye manufaa. Hii inahusiana na documentation_security, documentation_architecture, na implement_secure_design.

    Justification

    The project satisfies the assurance_case criterion via the dedicated Assurance Case page published in the compliance-trestle documentation site.

    URL: https://oscal-compass.github.io/compliance-trestle/latest/assurance-case/

    The page addresses each required element:

    Required element Where it is addressed
    Threat model §2 — nine named threat scenarios (T1–T9) mapped to STRIDE categories and affected components, with actors, assets, and trust levels defined
    Trust boundaries §3 — five named boundaries (B1–B5) shown in an ASCII architecture diagram and a table; each boundary identifies what crosses it and the control mechanism
    Secure design principles argument §4 — ten Saltzer & Schroeder principles mapped one-for-one to trestle design decisions with source-code evidence links
    Common implementation weaknesses argument §5.1 (OWASP Top 10, 2021) and §5.2 (CWE/SANS Top 25, 2024, 16 applicable entries) — each weakness rated for applicability and mapped to a concrete mitigation

    Supporting URLs cited in the assurance case:

    • Assurance case page: https://oscal-compass.github.io/compliance-trestle/latest/assurance-case/
    • NIST IR 7608 (definition source): https://www.nist.gov/publications/software-assurance-using-structured-assurance-case-models
    • Saltzer & Schroeder principles: https://web.mit.edu/Saltzer/www/publications/protection/Basic.html
    • OWASP Top 10 (2021): https://owasp.org/Top10/
    • CWE/SANS Top 25 (2024): https://cwe.mitre.org/top25/archive/2024/2024_cwe_top25.html
    • SSRF vulnerability advisory (GHSA-w76h-q7c6-jpjp): https://github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-w76h-q7c6-jpjp
    • OpenSSF Best Practices badge: https://www.bestpractices.dev/projects/9408

 Uchanganuzi 2/2 ●

  • Uchambuzi tuli wa msimbo


    Mradi LAZIMA utumie angalau zana moja ya uchanganuzi tuli yenye sheria au mbinu za kutafuta udhaifu wa kawaida katika lugha au mazingira yaliyochanganuliwa, ikiwa kuna angalau zana moja ya FLOSS inayoweza kutekeleza kigezo hiki katika lugha iliyochaguliwa. [static_analysis_common_vulnerabilities]
    Zana za uchambuzi tuli ambazo zimeundwa hasa kutafuta udhaifu wa kawaida zina uwezekano mkubwa wa kuzipata. Hata hivyo, kutumia zana zozote za tuli kwa kawaida itasaidia kupata baadhi ya matatizo, kwa hivyo tunashauri lakini hatunahitaji hii kwa kiwango cha nishani ya 'kupita'.

    Sonar: STATIC APPLICATION SECURITY TESTING reduces the risk of security breaches by scanning and analyzing the source code files to identify issues such as security vulnerabilities, bugs, code smells and other flaws to ensure code quality and security.


  • Uchambuzi wa msimbo wa nguvu za ziada


    Ikiwa programu iliyozalishwa na mradi inajumuisha programu iliyoandikwa kwa kutumia lugha isiyosalama ya kumbukumbu (k.m., C au C++), basi angalau zana moja ya nguvu (k.m., fuzzer au kitafutaji cha programu ya wavuti) LAZIMA itumike kwa kawaida kwa pamoja na utaratibu wa kugundua matatizo ya usalama wa kumbukumbu kama vile uandikaji zaidi wa kipengele. Ikiwa mradi hauzalishi programu iliyoandikwa katika lugha isiyosalama ya kumbukumbu, chagua "haihusiki" (N/A). [dynamic_analysis_unsafe]
    Mifano ya taratibu za kugundua matatizo ya usalama wa kumbukumbu ni pamoja na Address Sanitizer (ASAN) (inapatikana katika GCC na LLVM), Memory Sanitizer, na valgrind. Zana nyingine zinazoweza kutumika ni pamoja na thread sanitizer na undefined behavior sanitizer. Madai ya kila mahali pia yaweza kufanya kazi.

    N/A,language used is Python.



Unaweza kutumia zana na mifumo ya AI kupendekeza mabadiliko kupitia URL rahisi, kama vile https://www.bestpractices.dev/sw/projects/9408/choose/edit?osps_ac_01_01_status=Met&osps_ac_01_01_justification=GitHub+enforced. Angalia mfumo wetu wa mapendekezo ya otomatiki kwa jinsi ya kufanya hivyo. Data hii inapatikana chini ya Community Data License Agreement – Permissive, Version 2.0 (CDLA-Permissive-2.0). Hii inamaanisha kuwa Mpokeaji wa Data anaweza kushiriki Data, na au bila marekebisho, mradi Mpokeaji wa Data anapatanisha maandishi ya mkataba huu na Data iliyoshirikiwa. Tafadhali tambua Lou DeGenaro na wachangiaji wa nishani ya Mazoea Bora ya OpenSSF.

Ingizo la nishani ya mradi linamilikiwa na: Lou DeGenaro.
Ingizo liliundwa siku 2024-09-02 12:27:57 UTC, iliyosasishwa mara ya mwisho siku 2026-09-11 11:56:29 UTC. Ilipata mara ya mwisho nishani ya kupita siku 2024-11-11 12:03:16 UTC.