-
Notifications
You must be signed in to change notification settings - Fork 51
/
sbom_generation.yaml
77 lines (64 loc) · 3.75 KB
/
sbom_generation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
# This OCI DevOps build specification file [1] generates a Software Bill of Materials (SBOM) of the repository.
# The file is needed to run checks for third-party vulnerabilities and business approval according to Oracle’s GitHub policies.
# [1] https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm
version: 0.1
component: build
timeoutInSeconds: 1000
shell: bash
steps:
- type: Command
name: "Run Maven cycloneDX plugin command for JdbcExamples"
command: |
cd JdbcExamples
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ..
- type: Command
name: "Run Maven cycloneDX plugin command for MongoExamples"
command: |
cd MongoExamples
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ..
- type: Command
name: "Run Maven cycloneDX plugin command for MongoExamples"
command: |
cd YCSB/ycsb-soda
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ../..
- type: Command
name: "Run Maven cycloneDX plugin command for MongoExamples"
command: |
cd SodaExamples
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ..
- type: Command
name: "Install cyclonedx_py module"
command: |
pip install cyclonedx-bom
- type: Command
name: "Run Python cyclonedx_py module"
command: |
cd Python-Demo-App
# For more details, visit https://github.com/CycloneDX/cyclonedx-python/blob/main/README.md
python3 -m cyclonedx_py -r -pb --format json -o artifactSBOM.json --schema-version 1.4
cd ..
# Start merging the artifacts
- type: Command
name: "Download CycloneDx-cli executable and install dependencies"
command: |
wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.24.2/cyclonedx-linux-x64
yum install -y libicu
- type: Command
name: "Merge multiple SBOMs using CycloneDX-cli"
command: |
# For more details, visit https://github.com/CycloneDX/cyclonedx-cli/blob/main/README.md
chmod +x cyclonedx-linux-x64
./cyclonedx-linux-x64 merge --input-files ./JdbcExamples/target/artifactSBOM.json ./MongoExamples/target/artifactSBOM.json ./YCSB/ycsb-soda/target/artifactSBOM.json ./SodaExamples/target/artifactSBOM.json ./Python-Demo-App/target/artifactSBOM.json --output-file merged-bom.json
outputArtifacts:
- name: artifactSBOM
type: BINARY
location: ${OCI_PRIMARY_SOURCE_DIR}/merged-bom.json