Scan all images #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scan all images | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 2 * * *' | |
jobs: | |
image_list: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.7.1 | |
- name: Install grype | |
run: curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin | |
- name: Install deps | |
run: poetry install | |
- name: Generate image names | |
id: scan | |
run: poetry run python stack_scanner/main.py | |
outputs: | |
matrix: ${{ steps.scan.outputs.matrix }} | |
scan: | |
needs: image_list | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
max-parallel: 2 | |
fail-fast: false | |
matrix: | |
product_version: ${{ fromJson(needs.image_list.outputs.matrix) }} | |
steps: | |
- name: Run Grype image | |
uses: MaibornWolff/secobserve_actions_templates/actions/SCA/grype_image@dev | |
with: | |
target: docker.stackable.tech/stackable/${{ matrix.product_version.product }}:${{ matrix.product_version.version }}-stackable${{ matrix.product_version.release }} | |
report_name: 'grype.json' | |
so_product_name: ${{ matrix.product_version.product }} | |
so_api_base_url: https://secobserve-backend.stackable.tech | |
so_api_token: ${{ secrets.SECOBSERVE_API_TOKEN }} | |
so_branch_name: ${{ matrix.product_version.version }}-stackable${{ matrix.product_version.release }} | |
further_parameters: "--by-cve" | |
- name: Run Trivy image | |
uses: MaibornWolff/secobserve_actions_templates/actions/SCA/trivy_image@dev | |
with: | |
target: docker.stackable.tech/stackable/${{ matrix.product_version.product }}:${{ matrix.product_version.version }}-stackable${{ matrix.product_version.release }} | |
report_name: 'trivy.json' | |
so_api_base_url: https://secobserve-backend.stackable.tech | |
so_api_token: ${{ secrets.SECOBSERVE_API_TOKEN }} | |
so_product_name: ${{ matrix.product_version.product }} | |
so_branch_name: ${{ matrix.product_version.version }}-stackable${{ matrix.product_version.release }} | |
# - name: Scan Remote Image | |
# uses: neuvector/scan-action@main | |
# with: | |
# image-repository: ${{ matrix.image }} | |
# image-tag: ${{ matrix.tag }} | |
# output: json | |
# debug: true | |
- name: List files to see if NeuVector outputs something | |
run: ls | |
- name: Upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: secobserve | |
path: | | |
dd_import_trivy_image.json | |
dd_import_grype_image.json |