|
55 | 55 | org.opencontainers.image.description=${{ inputs.description }}
|
56 | 56 | org.opencontainers.image.vendor=Apollo GraphQL
|
57 | 57 | org.opencontainers.image.licenses=MIT
|
| 58 | + - name: Build and Load Docker Image For Testing |
| 59 | + id: build-for-testing |
| 60 | + uses: docker/build-push-action@67dc78bbaf388b3265f7e1c880e681f4b90d5f48 |
| 61 | + with: |
| 62 | + context: ${{ inputs.directory }} |
| 63 | + file: ${{ inputs.directory }}/Dockerfile |
| 64 | + load: true |
| 65 | + tags: ${{ inputs.image_name }}:test |
| 66 | + platforms: ${{ inputs.platforms }} |
| 67 | + - name: Install Wiz CLI |
| 68 | + working-directory: ${{ runner.temp }} |
| 69 | + run: | |
| 70 | + apt-get update |
| 71 | + apt-get install gpg |
| 72 | + curl -Lo wizcli https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64 |
| 73 | + curl -Lo wizcli-sha256 https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64-sha256 |
| 74 | + curl -Lo wizcli-sha256.sig https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64-sha256.sig |
| 75 | + curl -Lo wiz_public_key.asc https://downloads.wiz.io/wizcli/public_key.asc |
| 76 | + gpg --import wiz_public_key.asc |
| 77 | + gpg --verify /tmp/wizcli-sha256.sig /tmp/wizcli-sha256 |
| 78 | + echo "$(cat /tmp/wizcli-sha256) wizcli" | sha256sum --check |
| 79 | + chmod +x wizcli |
| 80 | + - name: Authenticate Wiz CLI |
| 81 | + working-directory: ${{ runner.temp }} |
| 82 | + run: | |
| 83 | + ./wizcli auth --id ${{ secrets.WIZ_CLIENT_ID }} --secret ${{ secrets.WIZ_CLIENT_SECRET }} |
| 84 | + - name: Scan Image |
| 85 | + working-directory: ${{ runner.temp }} |
| 86 | + run: | |
| 87 | + mkdir -p /tmp/workspace/sbom |
| 88 | + /tmp/wizcli docker scan \ |
| 89 | + --image ${{ inputs.image_name }}:test \ |
| 90 | + --dockerfile ${{ inputs.directory }}/Dockerfile \ |
| 91 | + --policy "Apollo-Default-Vulnerabilities-Policy" \ |
| 92 | + --sbom-format spdx-json \ |
| 93 | + --sbom-output-file ${{ runner.temp }}/${{ inputs.image_name }}/sbom.json \ |
| 94 | + --timeout "0h9m0s" \ |
| 95 | + --sensitive-data |
58 | 96 | - name: Build and Push Docker image
|
59 | 97 | id: push
|
60 | 98 | uses: docker/build-push-action@67dc78bbaf388b3265f7e1c880e681f4b90d5f48
|
|
0 commit comments