@@ -9,16 +9,16 @@ using [Syft](https://github.com/anchore/syft).
99## Basic Usage
1010
1111``` yaml
12- - uses : scality/sbom@v1
12+ - uses : scality/sbom@v1.2.2
1313 with :
1414 target : ./
1515` ` `
1616
1717This will create SBOM result files based on type, ex:
1818
1919- repo_sbom_v1.1.0-4-gd6cdf1f.json
20- - repo_sbom_v1.2.0 .json
21- - image_nginx_latest .json
20+ - repo_sbom_v1.2.2 .json
21+ - image_myiso.iso_nginx_latest .json
2222- iso_myiso.iso_128.json
2323
2424If you want to scan a repository, you have to checkout it with ` fetch-tags`.
@@ -39,9 +39,9 @@ The main [SBOM action](action.yml), responsible for generating SBOMs.
3939
4040| Parameter | Description | Default |
4141| --------------------------- | ------------------------------------------------------------------------------------- | ---------------------- |
42- | `grype-version` | Grype version to use | 0.77.2 |
43- | `sfyt-version` | Syft version to use | 1.2 .0 |
44- | `trivy-version` | Trivy version to use | 0.50 .1 |
42+ | `grype-version` | Grype version to use | 0.77.3 |
43+ | `sfyt-version` | Syft version to use | 1.3 .0 |
44+ | `trivy-version` | Trivy version to use | 0.51 .1 |
4545| `target` | A file/directory/iso on the filesystem to scan. | \<current directory> |
4646| `format` | Format of SBOM file. | cyclonedx-json |
4747| `name` | Name of the target, if you need to overwrite the detected. | |
@@ -57,7 +57,7 @@ The main [SBOM action](action.yml), responsible for generating SBOMs.
5757Use the `path` parameter, relative to the repository root :
5858
5959` ` ` yaml
60- - uses: scality/sbom@v1
60+ - uses: scality/sbom@v1.2.2
6161 with:
6262 target: ./artifacts
6363 format: cyclonedx-json
@@ -69,7 +69,7 @@ Images created with Oras for example have custom mediatype and are not usable
6969by Skopeo, they have to be excluded.
7070
7171` ` ` yaml
72- - uses: scality/sbom@v1
72+ - uses: scality/sbom@v1.2.2
7373 with:
7474 target: ./images
7575 exclude_mediatypes: "application/grafana-dashboard+json text/nginx-conf-template"
@@ -102,7 +102,7 @@ jobs:
102102 fetch-tags: true
103103 path: ${{ env.BASE_PATH }}/repo/myrepo
104104 - name: Generate sbom for repository
105- uses: scality/sbom@v1.2.0
105+ uses: scality/sbom@v1.2.2
106106 with:
107107 target: ${{ env.BASE_PATH }}/repo/myrepo
108108 output-dir: ${{ env.SBOM_PATH }}
@@ -124,10 +124,10 @@ jobs:
124124 echo "Downloading my.iso from $ARTIFACTS_URL"
125125 curl -sSfL -o ${{ env.BASE_PATH }}/iso/my.iso -u $ARTIFACTS_USER:$ARTIFACTS_PASSWORD $ARTIFACTS_URL/my.iso
126126 - name: Generate sbom for ISO
127- uses: scality/sbom@v1.2.0
127+ uses: scality/sbom@v1.2.2
128128 with:
129129 target: ${{ env.BASE_PATH }}/iso/my.iso
130- version: "1.0.0" # Make sure to replace this with the actual ISO version
130+ version: "1.0.0" # Make sure to replace this with the actual ISO version to avoid undefined in you SBOM
131131 output-dir: ${{ env.SBOM_PATH }}
132132 - name: Generate archive
133133 shell: bash
@@ -151,6 +151,77 @@ jobs:
151151 source: artifacts
152152` ` `
153153
154+ # # CycloneDX metadata
155+
156+ In generated SBOM you will find this metadata :
157+
158+ - for images contains in ISO :
159+
160+ ` ` ` json
161+ {
162+ "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
163+ "bomFormat": "CycloneDX",
164+ "specVersion": "1.5",
165+ "serialNumber": "urn:uuid:984d102d-0992-4dae-be80-ba551bc2079a",
166+ "version": 1,
167+ "metadata": {
168+ "timestamp": "2024-05-07T09:43:34Z",
169+ "tools": {
170+ "components": [
171+ {
172+ "type": "application",
173+ "author": "anchore",
174+ "name": "syft",
175+ "version": "1.3.0"
176+ }
177+ ]
178+ },
179+ "component": {
180+ "bom-ref": "1b58496ca93cc57d",
181+ "type": "container",
182+ "name": "my.iso:alpine", // composed by iso_source_name:image_name
183+ "version": "1.1.1" // image_version
184+ }
185+ },
186+ ...
187+ ` ` `
188+
189+ - for ISO :
190+
191+ ` ` ` json
192+ {
193+ "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
194+ "bomFormat": "CycloneDX",
195+ "specVersion": "1.5",
196+ "serialNumber": "urn:uuid:db2bc22b-a5e5-49a9-9d02-61a18480ead4",
197+ "version": 1,
198+ "metadata": {
199+ "timestamp": "2024-05-07T09:41:46Z",
200+ "tools": {
201+ "components": [
202+ {
203+ "type": "application",
204+ "author": "anchore",
205+ "name": "syft",
206+ "version": "1.3.0"
207+ }
208+ ]
209+ },
210+ "component": {
211+ "bom-ref": "4a057776eee09e2f",
212+ "type": "file",
213+ "name": "my.iso", // ISO basename calculated by target var
214+ "version": "undefined" // for ISO if version is not provided, you will get undefined
215+ }
216+ }
217+ }
218+ ` ` `
219+
220+ -
221+ # # Know issue
222+
223+ - scanning a repo present in `/tmp` will not work. Syft doesn't use right catalogers in this path. An issue is open [here](https://github.com/anchore/syft/issues/2847)
224+
154225# # References
155226
156227HTML template for **Grype** results visualisation was slightly modified from [Grype Contrib](https://github.com/opt-nc/grype-contribs).
0 commit comments