|
| 1 | +# 2.6. SBOM workflows |
| 2 | + |
| 3 | +**Up**: `2.` [User guide](user-guide) |
| 4 | + |
| 5 | +**Prev**: `2.5.` [Trusted Publishing](trusted-publishing) |
| 6 | + |
| 7 | +**Next**: `3.1.` [Running the server](running-the-server) |
| 8 | + |
| 9 | +**Sections**: |
| 10 | + |
| 11 | +* [Overview](#overview) |
| 12 | +* [Supported SBOM operations](#supported-sbom-operations) |
| 13 | +* [Convert XML SBOM to JSON](#convert-xml-sbom-to-json) |
| 14 | +* [CycloneDX validation](#cyclonedx-validation) |
| 15 | +* [SBOM scoring and validation](#sbom-scoring-and-validation) |
| 16 | +* [Vulnerability scanning](#vulnerability-scanning) |
| 17 | +* [SBOM augmentation](#sbom-augmentation) |
| 18 | +* [Related interfaces](#related-interfaces) |
| 19 | +* [Related documentation](#related-documentation) |
| 20 | + |
| 21 | +## Overview |
| 22 | + |
| 23 | +ATR provides multiple Software Bill of Materials (SBOM) workflows based on the CycloneDX specification. These workflows help projects generate, validate, augment, convert, and analyze SBOM files for release artifacts. |
| 24 | + |
| 25 | +ATR integrates several external tools including: |
| 26 | + |
| 27 | +* syft |
| 28 | +* CycloneDX CLI |
| 29 | +* sbomqs |
| 30 | +* OSV |
| 31 | + |
| 32 | +These workflows are primarily implemented in the `atr/tasks/sbom.py` module and exposed through draft and report interfaces. |
| 33 | + |
| 34 | +## Supported SBOM operations |
| 35 | + |
| 36 | +ATR supports several SBOM workflows for generation, conversion, analysis, and augmentation. |
| 37 | + |
| 38 | +### Generate CycloneDX SBOM |
| 39 | + |
| 40 | +ATR can generate a CycloneDX JSON SBOM from supported release artifacts including: |
| 41 | + |
| 42 | +* `.tar.gz` |
| 43 | +* `.tgz` |
| 44 | +* `.zip` |
| 45 | +* `.jar` |
| 46 | + |
| 47 | +SBOM generation uses the `syft` tool and produces `.cdx.json` files. |
| 48 | + |
| 49 | +Generation tasks are queued through: |
| 50 | + |
| 51 | +* `atr/post/draft.py` |
| 52 | +* `atr/storage/writers/sbom.py` |
| 53 | + |
| 54 | +Core implementation: |
| 55 | + |
| 56 | +* `generate_cyclonedx` |
| 57 | +* `_generate_cyclonedx_core` |
| 58 | + |
| 59 | +## Convert XML SBOM to JSON |
| 60 | + |
| 61 | +ATR can convert CycloneDX XML SBOM files into JSON format. |
| 62 | + |
| 63 | +Supported input: |
| 64 | + |
| 65 | +* `.cdx.xml` |
| 66 | + |
| 67 | +Generated output: |
| 68 | + |
| 69 | +* `.cdx.json` |
| 70 | + |
| 71 | +Core implementation: |
| 72 | + |
| 73 | +* `convert_cyclonedx` |
| 74 | +* `_convert_cyclonedx_core` |
| 75 | + |
| 76 | +## CycloneDX validation |
| 77 | + |
| 78 | +ATR validates CycloneDX SBOM files using both the CycloneDX CLI and Python validation tooling. |
| 79 | + |
| 80 | +Validation workflows detect: |
| 81 | + |
| 82 | +* schema violations |
| 83 | +* malformed SBOM structures |
| 84 | +* invalid metadata |
| 85 | +* specification compatibility issues |
| 86 | + |
| 87 | +Related modules include: |
| 88 | + |
| 89 | +* `atr/sbom/cyclonedx.py` |
| 90 | + |
| 91 | +## SBOM scoring and validation |
| 92 | + |
| 93 | +ATR performs several validation and scoring operations for CycloneDX SBOM files. |
| 94 | + |
| 95 | +These include: |
| 96 | + |
| 97 | +* CycloneDX CLI validation |
| 98 | +* NTIA 2021 conformance checks |
| 99 | +* license analysis |
| 100 | +* vulnerability analysis |
| 101 | +* SBOM QS scoring |
| 102 | +* tool version analysis |
| 103 | + |
| 104 | +The scoring workflow is implemented through: |
| 105 | + |
| 106 | +* `score_tool` |
| 107 | +* `score_qs` |
| 108 | + |
| 109 | +Related modules include: |
| 110 | + |
| 111 | +* `atr/sbom/conformance.py` |
| 112 | +* `atr/sbom/licenses.py` |
| 113 | +* `atr/sbom/cyclonedx.py` |
| 114 | +* `atr/sbom/sbomqs.py` |
| 115 | + |
| 116 | +## Vulnerability scanning |
| 117 | + |
| 118 | +ATR supports vulnerability analysis through OSV integration. |
| 119 | + |
| 120 | +The OSV workflow: |
| 121 | + |
| 122 | +* scans CycloneDX SBOM files |
| 123 | +* identifies known vulnerabilities |
| 124 | +* augments SBOM files with vulnerability information |
| 125 | + |
| 126 | +Core implementation: |
| 127 | + |
| 128 | +* `osv_scan` |
| 129 | +* `bundle_to_vuln_patch` |
| 130 | + |
| 131 | +Related modules: |
| 132 | + |
| 133 | +* `atr/sbom/osv.py` |
| 134 | + |
| 135 | +## SBOM augmentation |
| 136 | + |
| 137 | +ATR can augment existing SBOM files with additional metadata and NTIA-related properties. |
| 138 | + |
| 139 | +Augmentation workflows may generate updated revisions containing modified SBOM files. |
| 140 | + |
| 141 | +Core implementation: |
| 142 | + |
| 143 | +* `augment` |
| 144 | +* `bundle_to_ntia_patch` |
| 145 | + |
| 146 | +## Related interfaces |
| 147 | + |
| 148 | +SBOM functionality is exposed through several application layers. |
| 149 | + |
| 150 | +Task handlers: |
| 151 | + |
| 152 | +* `atr/tasks/sbom.py` |
| 153 | + |
| 154 | +POST endpoints: |
| 155 | + |
| 156 | +* `atr/post/sbom.py` |
| 157 | +* `atr/post/draft.py` |
| 158 | + |
| 159 | +GET interfaces: |
| 160 | + |
| 161 | +* `atr/get/sbom.py` |
| 162 | + |
| 163 | +Storage writers: |
| 164 | + |
| 165 | +* `atr/storage/writers/sbom.py` |
| 166 | + |
| 167 | +Templates: |
| 168 | + |
| 169 | +* `atr/templates/draft-tools.html` |
| 170 | +* `atr/templates/check-selected-path-table.html` |
| 171 | + |
| 172 | +## Related documentation |
| 173 | + |
| 174 | +Additional SBOM-related behavior is described in: |
| 175 | + |
| 176 | +* [Checks](checks) |
| 177 | +* [Running the server](running-the-server) |
| 178 | +* [Overview of the code](overview-of-the-code) |
0 commit comments