Skip to content

Commit 18eae8d

Browse files
Vaibhav  BhallaVaibhav  Bhalla
authored andcommitted
feat(ci-cd): add trivy scan
GH-2292
1 parent 524ceb7 commit 18eae8d

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/trivy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Trivy Scan
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
pull_request:
9+
branches: [master]
10+
types: [opened, synchronize, reopened]
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# This workflow contains a single job called "trivy"
15+
trivy:
16+
# The type of runner that the job will run on
17+
runs-on: [self-hosted, linux, codebuild]
18+
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22+
- uses: actions/checkout@v3
23+
24+
- name: Run Trivy vulnerability scanner in repo mode
25+
uses: aquasecurity/trivy-action@0.28.0
26+
with:
27+
scan-type: "fs"
28+
scan-ref: "${{ github.workspace }}"
29+
trivy-config: "${{ github.workspace }}/trivy.yaml"

trivy.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
format: table
2+
exit-code: 1
3+
severity:
4+
- HIGH
5+
- CRITICAL
6+
skip-files:
7+
- db.env
8+
security-checks:
9+
- vuln
10+
- secret
11+
- license
12+
vulnerability:
13+
type:
14+
- os
15+
- library
16+
ignore-unfixed: true

0 commit comments

Comments
 (0)