Skip to content

Commit 0105373

Browse files
authored
docs(trivy): Add instructions to scan tarballs. (#134)
Signed-off-by: Simar <[email protected]>
1 parent bc615ae commit 0105373

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,35 @@ jobs:
5151
severity: 'CRITICAL,HIGH'
5252
```
5353
54+
55+
### Scanning a Tarball
56+
```yaml
57+
name: build
58+
on:
59+
push:
60+
branches:
61+
- master
62+
pull_request:
63+
jobs:
64+
build:
65+
name: Build
66+
runs-on: ubuntu-20.04
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v2
70+
71+
- name: Generate tarball from image
72+
run: |
73+
docker pull <your-docker-image>
74+
docker save -o vuln-image.tar <your-docker-image>
75+
76+
- name: Run Trivy vulnerability scanner in tarball mode
77+
uses: aquasecurity/trivy-action@master
78+
with:
79+
input: /github/workspace/vuln-image.tar
80+
severity: 'CRITICAL,HIGH'
81+
```
82+
5483
### Using Trivy with GitHub Code Scanning
5584
If you have [GitHub code scanning](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning) available you can use Trivy as a scanning tool as follows:
5685
```yaml

0 commit comments

Comments
 (0)