@@ -148,7 +148,7 @@ jobs:
148
148
cache-to : type=gha,scope=${{ inputs.image }},mode=max
149
149
pull : true
150
150
no-cache : ${{ github.event_name != 'pull_request' }}
151
- sbom : ${{ inputs.image != 'plus-waf' }}
151
+ sbom : true
152
152
provenance : mode=max
153
153
build-args : |
154
154
NJS_DIR=internal/controller/nginx/modules/src
@@ -161,9 +161,23 @@ jobs:
161
161
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
162
162
163
163
- name : Inspect SBOM and output manifest
164
- if : ${{ inputs.image != 'plus-waf' }}
165
164
run : |
165
+ if [[ "${{ inputs.image }}" == "plus-waf" ]]; then
166
+ # For plus-waf, use syft directly
167
+ echo "Generating SBOM for plus-waf using syft..."
168
+
169
+ # Install syft if not available
170
+ if ! command -v syft >/dev/null 2>&1; then
171
+ curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
172
+ fi
173
+
174
+ # Generate SBOM using syft directly for plus-waf (known to work with NAP WAF)
175
+ syft localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} -o spdx-json > sbom-${{ inputs.image }}.json
176
+ echo "Generated SBOM using syft for plus-waf (following NGINX IC pattern)"
177
+ else
178
+ # For other images, use the standard Docker buildx approach
166
179
docker buildx imagetools inspect localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} --format '{{ json (index .SBOM "linux/amd64").SPDX }}' > sbom-${{ inputs.image }}.json
180
+ fi
167
181
docker buildx imagetools inspect localhost:5000/nginx-gateway-fabric/${{ inputs.image }}:${{ steps.meta.outputs.version }} --raw
168
182
169
183
- name : Scan SBOM
@@ -174,12 +188,11 @@ jobs:
174
188
only-fixed : true
175
189
add-cpes-if-none : true
176
190
fail-build : false
177
- if : inputs.image != 'plus-waf'
178
191
179
192
- name : Upload scan result to GitHub Security tab
180
193
uses : github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
181
194
continue-on-error : true
182
195
with :
183
196
sarif_file : ${{ steps.scan.outputs.sarif }}
184
197
category : build-${{ inputs.image }}
185
- if : always() && inputs.image != 'plus-waf '
198
+ if : always() && steps.scan.conclusion == 'success '
0 commit comments