@@ -12,16 +12,53 @@ jobs:
1212  test-scan-docker-image :
1313    name : Test Scan Docker Image 
1414    runs-on : ubuntu-22.04 
15+     env :
16+       IMAGE : kong/kong-gateway-dev:latest  # particular reason for the choice of image: test multi arch image sbom
1517    steps :
1618    - uses : actions/checkout@v3 
1719
20+     - name : Install regctl 
21+       uses : regclient/actions/regctl-installer@main 
22+ 
1823    - name : Login to DockerHub 
1924      if : success() 
2025      uses : docker/login-action@v2 
2126      with :
2227        username : ${{ secrets.GHA_DOCKERHUB_PULL_USER }} 
2328        password : ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUBLIC_TOKEN }} 
2429
25-     - uses : ./security-actions/scan-docker-image 
30+     - name : Parse Architecture Specific Image Manifest Digests 
31+       id : image_manifest_metadata 
32+       run : | 
33+         manifest_list_exists="$( 
34+           if regctl manifest get "${IMAGE}" --format raw-body --require-list -v panic &> /dev/null; then 
35+             echo true  
36+           else 
37+             echo false  
38+           fi 
39+         )" 
40+         echo "manifest_list_exists=$manifest_list_exists" 
41+         echo "manifest_list_exists=$manifest_list_exists" >> $GITHUB_OUTPUT 
42+ 
43+         amd64_sha="$(regctl image digest "${IMAGE}" --platform linux/amd64 || echo '')" 
44+         arm64_sha="$(regctl image digest "${IMAGE}" --platform linux/arm64 || echo '')" 
45+         echo "amd64_sha=$amd64_sha" 
46+         echo "amd64_sha=$amd64_sha" >> $GITHUB_OUTPUT 
47+         echo "arm64_sha=$arm64_sha" 
48+         echo "arm64_sha=$arm64_sha" >> $GITHUB_OUTPUT 
49+ 
50+ name : Scan AMD64 Image digest 
51+       id : sbom_action_amd64 
52+       if : steps.image_manifest_metadata.outputs.amd64_sha != '' 
53+       uses : Kong/public-shared-actions/security-actions/scan-docker-image@v1.1.0 
54+       with :
55+         asset_prefix : kong-gateway-dev-linux-amd64 
56+         image : ${{env.IMAGE}}@${{ steps.image_manifest_metadata.outputs.amd64_sha }} 
57+ 
58+     - name : Scan ARM64 Image digest 
59+       if : steps.image_manifest_metadata.outputs.manifest_list_exists == 'true' && steps.image_manifest_metadata.outputs.arm64_sha != '' 
60+       id : sbom_action_arm64 
61+       uses : Kong/public-shared-actions/security-actions/scan-docker-image@v1.1.0 
2662      with :
27-         image : kong/kong-gateway-dev:latest  #  no particular reason for the choice of image or tag, just an image for tests
63+         asset_prefix : kong-gateway-dev-linux-arm64 
64+         image : ${{env.IMAGE}}@${{ steps.image_manifest_metadata.outputs.arm64_sha }} 
0 commit comments