Skip to content

Commit

Permalink
ci: send scan report to bot
Browse files Browse the repository at this point in the history
  • Loading branch information
moabu committed Nov 2, 2022
1 parent 8924220 commit bfefd9b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docker_imagescan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.
# Contact @moabu
name: Scan Image
on:
push:
branches:
- main
paths:
- "docker-**/**"
- "!**.md"
pull_request:
branches:
- master
- main
paths:
- "docker-**/**"
- "!docker-**/CHANGELOG.md"
- "!docker-**/version.txt"
- "!**.md"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
docker-images: ["admin-ui", "casa", "flex-monolith"]
steps:
- uses: actions/checkout@v3
- name: Build the Container image
run: docker build ./docker-${{ matrix.docker-images }} --file ./docker-${{ matrix.docker-images }}/Dockerfile --tag localbuild/scanimage:latest
- uses: anchore/scan-action@v3
id: scan
with:
image: "localbuild/scanimage:latest"
output-format: sarif
fail-build: false
- name: Send JSON report
if: github.event_name == 'workflow_dispatch'
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
grype -v localbuild/scanimage:latest -o json > ${{ matrix.docker-images }}.results.json
curl "https://chat.gluu.org/api/v1/rooms.upload/YNz6rg7eNpngiygkv" \
-F "file=@${{ matrix.docker-images }}.results.json" \
-F "msg=${{ matrix.docker-images }} json report." \
-F "description=Scan detailed JSON report" \
-H "X-Auth-Token: ${{ secrets.MOAUTO_ROCKETCHAT_TOKEN }}" \
-H "X-User-Id: ${{ secrets.MOAUTO_ROCKETCHAT_ID }}"
- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- uses: azure/container-scan@v0
continue-on-error: true
with:
image-name: localbuild/scanimage:latest
run-quality-checks: true
severity-threshold: LOW
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ annotations:
image: janssenproject/persistence-loader:1.0.2-1
- name: scim
image: janssenproject/scim:1.0.2-1
- name: casa
image: gluufederation/casa:5.0.0_dev
- name: admin-ui
image: gluufederation/admin-ui:1.0.1_dev
artifacthub.io/license: Apache-2.0
artifacthub.io/prerelease: "true"
catalog.cattle.io/certified: partner
Expand Down

0 comments on commit bfefd9b

Please sign in to comment.