-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.32 KB
/
security.yml
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
name: Security vulnerability scanner
on:
push:
branches: ["master"]
concurrency:
cancel-in-progress: true
group: security-${{ github.ref }}
jobs:
register:
name: Register images
runs-on: ubuntu-latest
steps:
- name: Register docker image for frontend
uses: SocialGouv/actions/autodevops-build-register@local-cache-cdtn
with:
project: "cdtn-admin"
imageName: cdtn-admin/cdtn-admin-frontend
token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: "./targets/frontend/Dockerfile"
dockercontext: "./targets/frontend/"
trivy:
name: Run trivy
runs-on: ubuntu-18.04
needs: [register]
strategy:
fail-fast: false
matrix:
images: ["cdtn-admin-frontend"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build ${{ matrix.images }} from Dockerfile
run: |
docker build -t ghcr.io/socialgouv/cdtn-admin/${{ matrix.images }}:sha-${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/socialgouv/cdtn-admin/${{ matrix.images }}:sha-${{ github.sha }}"
format: "table"
ignore-unfixed: true
vuln-type: "os,library"
severity: "CRITICAL,HIGH"