1111permissions : read-all
1212
1313jobs :
14- docker :
14+ docker_backend_release :
1515 runs-on : ubuntu-latest
1616 steps :
1717 -
@@ -21,10 +21,10 @@ jobs:
2121 ref : ' v${{ github.event.inputs.release }}'
2222 -
2323 name : Set up QEMU
24- uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2 .0
24+ uses : docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3 .0
2525 -
2626 name : Set up Docker Buildx
27- uses : docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
27+ uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
2828 -
2929 name : Login to Docker Hub
3030 uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
3636 run : echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
3737 -
3838 name : Build and push backend
39- uses : docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10 .0
39+ uses : docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11 .0
4040 with :
4141 context : .
4242 file : ./docker/backend/prod/django/Dockerfile
4848 CREATED=${{ env.CREATED }}
4949 REVISION=${{ github.sha }}
5050 VERSION=${{ github.event.inputs.release }}
51+
52+ docker_frontend_release :
53+ runs-on : ubuntu-latest
54+ steps :
55+ -
56+ name : Checkout
57+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+ with :
59+ ref : ' v${{ github.event.inputs.release }}'
60+ -
61+ name : Set up QEMU
62+ uses : docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
63+ -
64+ name : Set up Docker Buildx
65+ uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
66+ -
67+ name : Login to Docker Hub
68+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
69+ with :
70+ username : ${{ secrets.DOCKERHUB_USERNAME }}
71+ password : ${{ secrets.DOCKERHUB_TOKEN }}
72+ -
73+ name : Set current date as env variable
74+ run : echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
5175 -
5276 name : Build and push frontend
53- uses : docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10 .0
77+ uses : docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11 .0
5478 with :
5579 context : .
5680 file : ./docker/frontend/prod/Dockerfile
@@ -62,15 +86,128 @@ jobs:
6286 CREATED=${{ env.CREATED }}
6387 REVISION=${{ github.sha }}
6488 VERSION=${{ github.event.inputs.release }}
89+
90+ vulnerability_scans_release :
91+ runs-on : ubuntu-latest
92+ needs : [docker_backend_release, docker_frontend_release]
93+ steps :
94+ -
95+ name : Checkout
96+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97+ with :
98+ ref : ' v${{ github.event.inputs.release }}'
6599 -
66100 name : Run vulnerability scanners for images
67- uses : MaibornWolff/secobserve_actions_templates/actions/vulnerability_scanner@5476f0de11c46875081d9767ec166c1e030e9ef0 # main
101+ uses : MaibornWolff/secobserve_actions_templates/actions/vulnerability_scanner@a8344daa56598a80c2c80081974a0468dd29d086 # main
68102 with :
69103 so_configuration : ' so_configuration_sca_current.yml'
70104 SO_API_TOKEN : ${{ secrets.SO_API_TOKEN }}
71105 -
72106 name : Run vulnerability scanners for endpoints
73- uses : MaibornWolff/secobserve_actions_templates/actions/vulnerability_scanner@5476f0de11c46875081d9767ec166c1e030e9ef0 # main
107+ uses : MaibornWolff/secobserve_actions_templates/actions/vulnerability_scanner@a8344daa56598a80c2c80081974a0468dd29d086 # main
74108 with :
75109 so_configuration : ' so_configuration_endpoints.yml'
76110 SO_API_TOKEN : ${{ secrets.SO_API_TOKEN }}
111+
112+ generate_sboms :
113+ runs-on : ubuntu-latest
114+ needs : [docker_backend_release, docker_frontend_release]
115+ permissions :
116+ contents : write
117+ steps :
118+ - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
119+ with :
120+ node-version : 20
121+ -
122+ name : Checkout
123+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124+ with :
125+ ref : ' v${{ github.event.inputs.release }}'
126+ -
127+ name : Install programs
128+ env :
129+ CDXGEN_VERSION : 10.9.4
130+ SBOM_UTILITY_VERSION : 0.16.0
131+ CYCLONE_DX_CLI_VERSION : 0.25.1
132+ run : |
133+ npm install -g @cyclonedx/cdxgen@"$CDXGEN_VERSION"
134+ cd /usr/local/bin
135+ wget --no-verbose https://github.com/CycloneDX/sbom-utility/releases/download/v"$SBOM_UTILITY_VERSION"/sbom-utility-v"$SBOM_UTILITY_VERSION"-linux-amd64.tar.gz -O - | tar -zxf -
136+ wget --no-verbose https://github.com/CycloneDX/cyclonedx-cli/releases/download/v"$CYCLONE_DX_CLI_VERSION"/cyclonedx-linux-x64
137+ cp cyclonedx-linux-x64 /usr/local/bin/cyclonedx
138+ chmod +x /usr/local/bin/cyclonedx
139+ -
140+ name : Generate SBOM for backend application
141+ env :
142+ VERSION : ${{ github.event.inputs.release }}
143+ FETCH_LICENSE : 1
144+ working-directory : ./sbom
145+ run : |
146+ mv ../backend/poetry_requirements.txt ../backend/poetry_requirements.sic
147+ sed -i "s|REPLACE_VERSION|$VERSION|g" ./configuration/patch_backend_application.json
148+ cdxgen ../backend --type python --required-only --profile license-compliance --no-auto-compositions --output sbom_backend_application.json
149+ sbom-utility trim --keys=externalReferences,properties,evidence,authors,lifecycles --quiet --input-file sbom_backend_application.json \
150+ | sbom-utility patch --patch-file ./configuration/patch_supplier.json --quiet --input-file - \
151+ | sbom-utility patch --patch-file ./configuration/patch_backend_application.json --quiet --input-file - --output-file sbom_backend_application_"$VERSION".json
152+ sbom-utility validate --input-file sbom_backend_application_"$VERSION".json
153+ rm sbom_backend_application.json
154+ mv ../backend/poetry_requirements.sic ../backend/poetry_requirements.txt
155+ -
156+ name : Generate SBOM for frontend application
157+ env :
158+ VERSION : ${{ github.event.inputs.release }}
159+ working-directory : ./sbom
160+ run : |
161+ sed -i "s|REPLACE_VERSION|$VERSION|g" ./configuration/patch_frontend_application.json
162+ cdxgen ../frontend --type npm --no-babel --required-only --profile license-compliance --no-auto-compositions --project-name secobserve --output sbom_frontend_application.json
163+ sbom-utility trim --keys=externalReferences,properties,evidence,authors,lifecycles --quiet --input-file sbom_frontend_application.json \
164+ | sbom-utility patch --patch-file ./configuration/patch_supplier.json --quiet --input-file - \
165+ | sbom-utility patch --patch-file ./configuration/patch_frontend_application.json --quiet --input-file - --output-file sbom_frontend_application_"$VERSION".json
166+ sbom-utility validate --input-file sbom_frontend_application_"$VERSION".json
167+ rm sbom_frontend_application.json
168+ -
169+ name : Generate SBOM for backend container
170+ env :
171+ VERSION : ${{ github.event.inputs.release }}
172+ working-directory : ./sbom
173+ run : |
174+ sed -i "s|REPLACE_VERSION|$VERSION|g" ./configuration/patch_backend_container.json
175+ cdxgen maibornwolff/secobserve-backend:$VERSION --type container --exclude-type python --exclude-type ruby --profile license-compliance --no-auto-compositions --output sbom_backend_container.json
176+ sbom-utility trim --keys=externalReferences,properties,evidence,authors,lifecycles,services --quiet --input-file sbom_backend_container.json \
177+ | sbom-utility patch --patch-file ./configuration/patch_supplier.json --quiet --input-file - \
178+ | sbom-utility patch --patch-file ./configuration/patch_backend_container.json --quiet --input-file - --output-file sbom_backend_container_"$VERSION".json
179+ sbom-utility validate --input-file sbom_backend_container_"$VERSION".json
180+ rm sbom_backend_container.json
181+ -
182+ name : Generate SBOM for frontend container
183+ env :
184+ VERSION : ${{ github.event.inputs.release }}
185+ working-directory : ./sbom
186+ run : |
187+ sed -i "s|REPLACE_VERSION|$VERSION|g" ./configuration/patch_frontend_container.json
188+ cdxgen maibornwolff/secobserve-frontend:$VERSION --type container --exclude-type npm --exclude-type ruby --profile license-compliance --no-auto-compositions --output sbom_frontend_container.json
189+ sbom-utility trim --keys=externalReferences,properties,evidence,authors,lifecycles,services --quiet --input-file sbom_frontend_container.json \
190+ | sbom-utility patch --patch-file ./configuration/patch_supplier.json --quiet --input-file - \
191+ | sbom-utility patch --patch-file ./configuration/patch_frontend_container.json --quiet --input-file - --output-file sbom_frontend_container_"$VERSION".json
192+ sbom-utility validate --input-file sbom_frontend_container_"$VERSION".json
193+ rm sbom_frontend_container.json
194+ -
195+ name : Merge SBOMs
196+ env :
197+ VERSION : ${{ github.event.inputs.release }}
198+ working-directory : ./sbom
199+ run : |
200+ sed -i "s|REPLACE_VERSION|$VERSION|g" ./configuration/patch_complete.json
201+ cyclonedx merge --hierarchical --name "SecObserve" --version "$VERSION" --input-files sbom_backend_application_"$VERSION".json sbom_frontend_application_"$VERSION".json sbom_backend_container_"$VERSION".json sbom_frontend_container_"$VERSION".json --output-format json \
202+ | sbom-utility patch --patch-file ./configuration/patch_supplier.json --quiet --input-file - \
203+ | sbom-utility patch --patch-file ./configuration/patch_complete.json --quiet --input-file - --output-file sbom_"$VERSION".json
204+ sbom-utility validate --input-file sbom_"$VERSION".json
205+ -
206+ name : Commit SBOMs
207+ uses : stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5
208+ with :
209+ skip_fetch : true
210+ create_branch : true
211+ commit_message : " chore: generate SBOMs for release ${{ github.event.inputs.release }}"
212+ branch : " chore/sboms_release_${{ github.event.inputs.release }}"
213+ file_pattern : " sbom/sbom*.json"
0 commit comments