-
Notifications
You must be signed in to change notification settings - Fork 9
75 lines (64 loc) · 1.96 KB
/
security_scanning.yml
File metadata and controls
75 lines (64 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
name: Security Scanning 🕵️
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v6
- name: 'Setup yq'
uses: dcarbone/install-yq-action@v1.3.1
- id: set-matrix
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
scan_ci_container:
name: 'Scan CI container'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Extract version number
id: extract_version
uses: actions/github-script@v9
with:
script: |
const agentVersion = '${{ matrix.db_version }}';
const version = agentVersion.split('-')[0];
core.setOutput('version', version);
- name: Build CI container
uses: docker/build-push-action@v7
with:
tags: 'ci/openvoxdb:${{ steps.extract_version.outputs.version }}'
context: openvoxdb
file: openvoxdb/Containerfile
push: false
build-args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXDB_VERSION=${{ matrix.db_version }}
- name: Scan image with Anchore Grype
uses: anchore/scan-action@v7
id: scan
with:
image: 'ci/openvoxdb:${{ steps.extract_version.outputs.version }}'
fail-build: false
- name: Inspect action SARIF report
run: jq . ${{ steps.scan.outputs.sarif }}
- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: ${{ steps.scan.outputs.sarif }}