mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-10 14:50:50 -08:00
Compare commits
215 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8016b821a2 | ||
|
|
7a25dadb44 | ||
|
|
9c794c0ffc | ||
|
|
14c1024b47 | ||
|
|
998f750432 | ||
|
|
770b14113c | ||
|
|
3ccb1a0f10 | ||
|
|
58cfd1b074 | ||
|
|
715963d754 | ||
|
|
37da98df45 | ||
|
|
cdee7030ac | ||
|
|
6a2225b425 | ||
|
|
a2a02de7c5 | ||
|
|
e739ab8506 | ||
|
|
c6d5d856ce | ||
|
|
194a814688 | ||
|
|
03830c50c9 | ||
|
|
8e814fa23d | ||
|
|
2dc76ba782 | ||
|
|
c17176ba97 | ||
|
|
bce70af369 | ||
|
|
4369a19af7 | ||
|
|
5566548b78 | ||
|
|
a8af76a471 | ||
|
|
c8ed432f28 | ||
|
|
551a46efcc | ||
|
|
261649b115 | ||
|
|
acfddd4570 | ||
|
|
419e3d2023 | ||
|
|
f0961d54f6 | ||
|
|
a5d485cf8a | ||
|
|
29b8faf5fa | ||
|
|
e3bef02018 | ||
|
|
916f6c66f8 | ||
|
|
8e6cd0e917 | ||
|
|
060d0bb641 | ||
|
|
2d090ef2df | ||
|
|
6343e4fc71 | ||
|
|
a018ee1f9b | ||
|
|
5da053f302 | ||
|
|
3d66cb8d88 | ||
|
|
9aca98cca8 | ||
|
|
7811ad0d24 | ||
|
|
fae710db8f | ||
|
|
d2d4022ef3 | ||
|
|
164b025413 | ||
|
|
5dd9bd4701 | ||
|
|
7c2017fa7a | ||
|
|
63c9469bdd | ||
|
|
aa822c260f | ||
|
|
30cc88fa87 | ||
|
|
e32215c99d | ||
|
|
d4da83c633 | ||
|
|
0d7d97d131 | ||
|
|
9873cf3b9c | ||
|
|
95c8fd912e | ||
|
|
12ec0dfe9e | ||
|
|
9b7d7132b7 | ||
|
|
13e72eca58 | ||
|
|
a9861994e5 | ||
|
|
46d5abad42 | ||
|
|
34ab09d559 | ||
|
|
1ba5b59527 | ||
|
|
4fab0f8b99 | ||
|
|
d7709816c3 | ||
|
|
4337068208 | ||
|
|
d82d6cb731 | ||
|
|
cfddfb33c1 | ||
|
|
dfcb0f90db | ||
|
|
183eaafb4e | ||
|
|
94d6e8ced6 | ||
|
|
336c47ecc3 | ||
|
|
06b44738e7 | ||
|
|
a51ceddada | ||
|
|
53517d622b | ||
|
|
ad544e97cc | ||
|
|
089368d968 | ||
|
|
116356500e | ||
|
|
637da2b178 | ||
|
|
13190e92d9 | ||
|
|
6bca7c3c79 | ||
|
|
8e4279b863 | ||
|
|
e98c873ed0 | ||
|
|
b1c2eab5aa | ||
|
|
1c49a16c65 | ||
|
|
8dd0fcd61b | ||
|
|
74e4c6e012 | ||
|
|
245c120532 | ||
|
|
86714bf6bf | ||
|
|
a75839212c | ||
|
|
4d00d8b52a | ||
|
|
3ad2b3e255 | ||
|
|
8baccd7909 | ||
|
|
e75a90f2e5 | ||
|
|
6625bd32e0 | ||
|
|
826fe60732 | ||
|
|
f23ed77598 | ||
|
|
df024e88dd | ||
|
|
29dee32814 | ||
|
|
1a67472d2b | ||
|
|
09e37b7c67 | ||
|
|
87a9aa60d1 | ||
|
|
712dcd3007 | ||
|
|
625f22b819 | ||
|
|
6a2f6fde4f | ||
|
|
5f69937cc6 | ||
|
|
258d153461 | ||
|
|
ade033a837 | ||
|
|
f85c9fac6f | ||
|
|
9d7f5c948e | ||
|
|
f148eb10f2 | ||
|
|
97f95c4ddf | ||
|
|
abd62ae74e | ||
|
|
7c409fd270 | ||
|
|
1b68327b65 | ||
|
|
a2482c14e1 | ||
|
|
e866bd5b5d | ||
|
|
1870f28461 | ||
|
|
6c81e5505e | ||
|
|
8ec3938e01 | ||
|
|
f6c5d58001 | ||
|
|
c4022d61b3 | ||
|
|
317792433e | ||
|
|
dd9620ef38 | ||
|
|
eb3ceb323d | ||
|
|
ab74caa87f | ||
|
|
71da44f7e1 | ||
|
|
102b6df738 | ||
|
|
aa19aaf4e4 | ||
|
|
8fcef352b3 | ||
|
|
fb8c516ded | ||
|
|
96bd7ac594 | ||
|
|
12c5bf0805 | ||
|
|
d6c40ce058 | ||
|
|
9d2057a7c2 | ||
|
|
2a9d9bd214 | ||
|
|
617c3e31bd | ||
|
|
56cedc0d67 | ||
|
|
d7d7265eb0 | ||
|
|
6639911662 | ||
|
|
337cb75353 | ||
|
|
9361cdb7e2 | ||
|
|
ee01e6e2f4 | ||
|
|
3d2f583ecd | ||
|
|
c4b5ab7881 | ||
|
|
355c1b583b | ||
|
|
7244ece536 | ||
|
|
5cd0566843 | ||
|
|
ebb74a5de0 | ||
|
|
24a8d6aaa8 | ||
|
|
9d0d7ad886 | ||
|
|
e8230e19d7 | ||
|
|
04535b554a | ||
|
|
939e34e37c | ||
|
|
7cb6c02a4e | ||
|
|
c1d26ec334 | ||
|
|
4f70468bdd | ||
|
|
1dfece89d0 | ||
|
|
e1ea02c7b8 | ||
|
|
64926d8423 | ||
|
|
eb54bb5da5 | ||
|
|
dc76c6e4f4 | ||
|
|
1b7e47424b | ||
|
|
876ab84b36 | ||
|
|
eef7c4fb40 | ||
|
|
069aae59ec | ||
|
|
4a9ac6d199 | ||
|
|
9c5e5a04ee | ||
|
|
388f47669d | ||
|
|
cd3e4bcac2 | ||
|
|
ce81c05851 | ||
|
|
cf0f0d00c2 | ||
|
|
8a3a113eea | ||
|
|
19495ba7c2 | ||
|
|
e787e1af01 | ||
|
|
327cf88397 | ||
|
|
82214736a9 | ||
|
|
7694df11fb | ||
|
|
74dc5b6804 | ||
|
|
32a02a95dd | ||
|
|
fb79ea7c95 | ||
|
|
c6844a73f1 | ||
|
|
a813506f41 | ||
|
|
14adbb4464 | ||
|
|
efe0e0f8f3 | ||
|
|
73dde32632 | ||
|
|
aadbad1d78 | ||
|
|
14a0981efa | ||
|
|
3ac63887dc | ||
|
|
3c1601b6cb | ||
|
|
c107e1af29 | ||
|
|
b26f217172 | ||
|
|
7bd3b630bb | ||
|
|
535b5a96d9 | ||
|
|
428420ee84 | ||
|
|
7fec991c58 | ||
|
|
6ccc0a554b | ||
|
|
458c5d95e6 | ||
|
|
5c0ff6dad1 | ||
|
|
e2bd7f75d5 | ||
|
|
f95fbcb672 | ||
|
|
7651bf59b2 | ||
|
|
fc20dfdd80 | ||
|
|
3bd80e7c28 | ||
|
|
2900a21176 | ||
|
|
85cb9a7639 | ||
|
|
4e962c02aa | ||
|
|
aa48a7b865 | ||
|
|
8aabbea2d3 | ||
|
|
ec02a655af | ||
|
|
27d35baa4a | ||
|
|
c3a66da9c3 | ||
|
|
2000fe24c6 | ||
|
|
2be642154f | ||
|
|
41c0ef642e |
19
.github/CODEOWNERS
vendored
19
.github/CODEOWNERS
vendored
@@ -1,15 +1,22 @@
|
||||
# Global
|
||||
* @knqyf263
|
||||
|
||||
# SBOM/Vulnerability scanning
|
||||
pkg/dependency/ @knqyf263 @DmitriyLewen
|
||||
pkg/fanal/ @knqyf263 @DmitriyLewen
|
||||
pkg/sbom/ @knqyf263 @DmitriyLewen
|
||||
pkg/scanner/ @knqyf263 @DmitriyLewen
|
||||
|
||||
# Misconfiguration scanning
|
||||
docs/docs/scanner/misconfiguration @knqyf263 @simar7
|
||||
docs/docs/target/aws.md @knqyf263 @simar7
|
||||
pkg/fanal/analyzer/config @knqyf263 @simar7
|
||||
pkg/cloud @knqyf263 @simar7
|
||||
docs/docs/scanner/misconfiguration/ @simar7 @nikpivkin
|
||||
docs/docs/target/aws.md @simar7 @nikpivkin
|
||||
pkg/fanal/analyzer/config/ @simar7 @nikpivkin
|
||||
pkg/cloud/ @simar7 @nikpivkin
|
||||
pkg/iac/ @simar7 @nikpivkin
|
||||
|
||||
# Helm chart
|
||||
helm/trivy/ @chen-keinan
|
||||
|
||||
# Kubernetes scanning
|
||||
pkg/k8s/ @josedonizetti @chen-keinan @knqyf263
|
||||
docs/docs/kubernetes/ @josedonizetti @chen-keinan @knqyf263
|
||||
pkg/k8s/ @chen-keinan
|
||||
docs/docs/target/kubernetes.md @chen-keinan
|
||||
|
||||
4
.github/workflows/auto-update-labels.yaml
vendored
4
.github/workflows/auto-update-labels.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install aqua tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
|
||||
10
.github/workflows/canary.yaml
vendored
10
.github/workflows/canary.yaml
vendored
@@ -25,35 +25,35 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.3.2
|
||||
uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload artifacts (trivy_Linux-64bit)
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: trivy_Linux-64bit
|
||||
path: dist/trivy_*_Linux-64bit.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_Linux-ARM64)
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: trivy_Linux-ARM64
|
||||
path: dist/trivy_*_Linux-ARM64.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_macOS-64bit)
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: trivy_macOS-64bit
|
||||
path: dist/trivy_*_macOS-64bit.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_macOS-ARM64)
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: trivy_macOS-ARM64
|
||||
path: dist/trivy_*_macOS-ARM64.tar.gz
|
||||
|
||||
2
.github/workflows/mkdocs-dev.yaml
vendored
2
.github/workflows/mkdocs-dev.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
2
.github/workflows/mkdocs-latest.yaml
vendored
2
.github/workflows/mkdocs-latest.yaml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
8
.github/workflows/publish-chart.yaml
vendored
8
.github/workflows/publish-chart.yaml
vendored
@@ -22,11 +22,11 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78
|
||||
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814
|
||||
with:
|
||||
version: v3.5.0
|
||||
- name: Set up python
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
id: lint
|
||||
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992
|
||||
- name: Setup Kubernetes cluster (KIND)
|
||||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140
|
||||
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
image: ${{ env.KIND_IMAGE }}
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install chart-releaser
|
||||
|
||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -19,12 +19,12 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.3.2
|
||||
uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
sudo apt-get -y install rpm reprepro createrepo-c distro-info
|
||||
|
||||
- name: Checkout trivy-repo
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/trivy-repo
|
||||
path: trivy-repo
|
||||
|
||||
17
.github/workflows/reusable-release.yaml
vendored
17
.github/workflows/reusable-release.yaml
vendored
@@ -27,16 +27,16 @@ jobs:
|
||||
contents: read # Not required for public repositories, but for clarity
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v9
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
root-reserve-mb: 32768 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
remove-android: 'true'
|
||||
remove-docker-images: 'true'
|
||||
remove-dotnet: 'true'
|
||||
remove-haskell: 'true'
|
||||
|
||||
- name: Cosign install
|
||||
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149
|
||||
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -77,6 +77,7 @@ jobs:
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: false # Disable cache to avoid free space issues during `Post Setup Go` step.
|
||||
|
||||
- name: Generate SBOM
|
||||
uses: CycloneDX/gh-gomod-generate-sbom@v2
|
||||
@@ -90,6 +91,11 @@ jobs:
|
||||
run: |
|
||||
echo "$GPG_KEY" > gpg.key
|
||||
|
||||
# Create tmp dir for GoReleaser
|
||||
- name: "create tmp dir"
|
||||
run: |
|
||||
mkdir tmp
|
||||
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
@@ -99,6 +105,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
NFPM_DEFAULT_RPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
GPG_FILE: "gpg.key"
|
||||
TMPDIR: "tmp"
|
||||
|
||||
- name: "remove gpg key"
|
||||
run: |
|
||||
@@ -121,7 +128,7 @@ jobs:
|
||||
public.ecr.aws/aquasecurity/trivy:canary
|
||||
|
||||
- name: Cache Trivy binaries
|
||||
uses: actions/cache@v3.3.2
|
||||
uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: dist/
|
||||
# use 'github.sha' to create a unique cache folder for each run.
|
||||
|
||||
8
.github/workflows/roadmap.yaml
vendored
8
.github/workflows/roadmap.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 'kind/feature' AND 'priority/backlog' labels -> 'Backlog' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.0 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
field-values: Backlog
|
||||
|
||||
# 'kind/feature' AND 'priority/important-longterm' labels -> 'Important (long-term)' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.0 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
field-values: Important (long-term)
|
||||
|
||||
# 'kind/feature' AND 'priority/important-soon' labels -> 'Important (soon)' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.0 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
field-values: Important (soon)
|
||||
|
||||
# 'kind/feature' AND 'priority/critical-urgent' labels -> 'Urgent' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.0 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
|
||||
2
.github/workflows/scan.yaml
vendored
2
.github/workflows/scan.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Run Trivy vulnerability scanner and create GitHub issues
|
||||
uses: knqyf263/trivy-issue-action@v0.0.5
|
||||
|
||||
2
.github/workflows/semantic-pr.yaml
vendored
2
.github/workflows/semantic-pr.yaml
vendored
@@ -75,6 +75,7 @@ jobs:
|
||||
dart
|
||||
swift
|
||||
bitnami
|
||||
conda
|
||||
|
||||
os
|
||||
lang
|
||||
@@ -100,4 +101,5 @@ jobs:
|
||||
helm
|
||||
report
|
||||
db
|
||||
parser
|
||||
deps
|
||||
|
||||
2
.github/workflows/test-docs.yaml
vendored
2
.github/workflows/test-docs.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
50
.github/workflows/test.yaml
vendored
50
.github/workflows/test.yaml
vendored
@@ -15,7 +15,17 @@ jobs:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 32768 # The golangci-lint uses a lot of space.
|
||||
remove-android: "true"
|
||||
remove-docker-images: "true"
|
||||
remove-dotnet: "true"
|
||||
remove-haskell: "true"
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -33,10 +43,10 @@ jobs:
|
||||
|
||||
- name: Lint
|
||||
id: lint
|
||||
uses: golangci/golangci-lint-action@v3.7.0
|
||||
uses: golangci/golangci-lint-action@v4.0.0
|
||||
with:
|
||||
version: v1.54
|
||||
args: --deadline=30m --out-format=line-number
|
||||
version: v1.57
|
||||
args: --timeout=30m --out-format=line-number
|
||||
skip-cache: true # https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052197778
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
@@ -47,7 +57,7 @@ jobs:
|
||||
if: ${{ failure() && steps.lint.conclusion == 'failure' }}
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
aqua_opts: ""
|
||||
@@ -69,7 +79,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -77,7 +87,7 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
@@ -89,16 +99,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v9
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
root-reserve-mb: 32768 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
remove-android: "true"
|
||||
remove-docker-images: "true"
|
||||
remove-dotnet: "true"
|
||||
remove-haskell: "true"
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -106,7 +116,7 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
@@ -118,7 +128,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -126,7 +136,7 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
@@ -140,23 +150,23 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v9
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
root-reserve-mb: 32768 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
remove-android: 'true'
|
||||
remove-docker-images: 'true'
|
||||
remove-dotnet: 'true'
|
||||
remove-haskell: 'true'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.2.0
|
||||
uses: aquaproj/aqua-installer@v3.0.0
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
- name: Run vm integration tests
|
||||
@@ -173,9 +183,9 @@ jobs:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v9
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
root-reserve-mb: 32768 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
|
||||
remove-android: 'true'
|
||||
remove-docker-images: 'true'
|
||||
remove-dotnet: 'true'
|
||||
@@ -183,7 +193,7 @@ jobs:
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
|
||||
@@ -19,6 +19,7 @@ linters-settings:
|
||||
locale: US
|
||||
ignore-words:
|
||||
- licence
|
||||
- optimise
|
||||
gosec:
|
||||
excludes:
|
||||
- G101
|
||||
@@ -87,14 +88,16 @@ linters:
|
||||
- gocritic
|
||||
|
||||
run:
|
||||
go: '1.21'
|
||||
skip-files:
|
||||
go: '1.22'
|
||||
|
||||
issues:
|
||||
exclude-files:
|
||||
- ".*_mock.go$"
|
||||
- ".*_test.go$"
|
||||
- "integration/*"
|
||||
- "examples/*"
|
||||
|
||||
issues:
|
||||
exclude-dirs:
|
||||
- "pkg/iac/scanners/terraform/parser/funcs" # copies of Terraform functions
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- gosec
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.19.0
|
||||
FROM alpine:3.19.1
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
COPY trivy /usr/local/bin/trivy
|
||||
COPY contrib/*.tpl contrib/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.19.0
|
||||
FROM alpine:3.19.1
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
|
||||
# binaries were created with GoReleaser
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM --platform=linux/amd64 golang:1.21
|
||||
FROM --platform=linux/amd64 golang:1.22
|
||||
|
||||
# Set environment variable for protoc
|
||||
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
|
||||
@@ -14,7 +14,7 @@ RUN curl --retry 5 -OL https://github.com/protocolbuffers/protobuf/releases/down
|
||||
|
||||
# Install Go tools
|
||||
RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0
|
||||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
|
||||
RUN go install github.com/magefile/mage@v1.14.0
|
||||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.0
|
||||
RUN go install github.com/magefile/mage@v1.15.0
|
||||
|
||||
ENV TRIVY_PROTOC_CONTAINER=true
|
||||
|
||||
@@ -5,6 +5,6 @@ registries:
|
||||
- type: standard
|
||||
ref: v3.157.0 # renovate: depName=aquaproj/aqua-registry
|
||||
packages:
|
||||
- name: tinygo-org/tinygo@v0.29.0
|
||||
- name: tinygo-org/tinygo@v0.31.1
|
||||
- name: WebAssembly/binaryen@version_112
|
||||
- name: magefile/mage@v1.14.0
|
||||
|
||||
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
@@ -9,13 +10,18 @@ import (
|
||||
"github.com/aquasecurity/trivy/pkg/commands"
|
||||
"github.com/aquasecurity/trivy/pkg/log"
|
||||
"github.com/aquasecurity/trivy/pkg/plugin"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
|
||||
_ "modernc.org/sqlite" // sqlite driver for RPM DB and Java DB
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := run(); err != nil {
|
||||
log.Fatal(err)
|
||||
var exitError *types.ExitError
|
||||
if errors.As(err, &exitError) {
|
||||
os.Exit(exitError.Code)
|
||||
}
|
||||
log.Fatal("Fatal error", log.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,3 +56,21 @@ ignore {
|
||||
# https://cwe.mitre.org/data/definitions/352.html
|
||||
input.CweIDs[_] == "CWE-352"
|
||||
}
|
||||
|
||||
# Ignore a license
|
||||
ignore {
|
||||
input.PkgName == "alpine-baselayout"
|
||||
input.Name == "GPL-2.0"
|
||||
}
|
||||
|
||||
# Ignore loose file license
|
||||
ignore {
|
||||
input.Name == "AGPL-3.0"
|
||||
input.FilePath == "/usr/share/grafana/LICENSE"
|
||||
}
|
||||
|
||||
# Ignore secret
|
||||
ignore {
|
||||
input.RuleID == "aws-access-key-id"
|
||||
input.Match == "AWS_ACCESS_KEY_ID=\"********************\""
|
||||
}
|
||||
|
||||
@@ -73,8 +73,11 @@
|
||||
{{- /* TODO: Type not extractable - https://github.com/aquasecurity/trivy-db/pull/24 */}}
|
||||
"type": "cve",
|
||||
"name": "{{ .VulnerabilityID }}",
|
||||
"value": "{{ .VulnerabilityID }}",
|
||||
"value": "{{ .VulnerabilityID }}"
|
||||
{{- /* cf. https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/blob/e3d280d7f0862ca66a1555ea8b24016a004bb914/dist/container-scanning-report-format.json#L157-179 */}}
|
||||
{{- if .PrimaryURL | regexMatch "^(https?|ftp)://.+" -}},
|
||||
"url": "{{ .PrimaryURL }}"
|
||||
{{- end }}
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
@@ -85,9 +88,13 @@
|
||||
{{- else -}}
|
||||
,
|
||||
{{- end -}}
|
||||
{{- if . | regexMatch "^(https?|ftp)://.+" -}}
|
||||
{
|
||||
"url": "{{ regexFind "[^ ]+" . }}"
|
||||
"url": "{{ . }}"
|
||||
}
|
||||
{{- else -}}
|
||||
{{- $l_first = true }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ others:
|
||||
- helm
|
||||
- report
|
||||
- db
|
||||
- parser
|
||||
- deps
|
||||
|
||||
The `<scope>` can be empty (e.g. if the change is a global or difficult to assign to a single component), in which case the parentheses are omitted.
|
||||
|
||||
53
docs/community/principles.md
Normal file
53
docs/community/principles.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Trivy Project Principles
|
||||
This document outlines the guiding principles and governance framework for the Trivy project.
|
||||
|
||||
## Core Principles
|
||||
Trivy is a security scanner focused on static analysis and designed with simplicity and security at its core.
|
||||
All new proposals to the project must adhere to the following principles.
|
||||
|
||||
### Static Analysis (No Runtime Required)
|
||||
Trivy operates without requiring container or VM image startups, eliminating the need for Docker or similar runtimes, except for scanning images stored within a container runtime.
|
||||
This approach enhances security and efficiency by minimizing dependencies.
|
||||
|
||||
### External Dependency Free (Single Binary)
|
||||
Operating as a single binary, Trivy is independent of external environments and avoids executing external OS commands or processes.
|
||||
If specific functionality, like Maven's, is needed, Trivy opts for internal reimplementations or processing outputs of the tool without direct execution of external tools.
|
||||
|
||||
This approach obviously requires more effort but significantly reduces security risks associated with executing OS commands and dependency errors due to external environment versions.
|
||||
Simplifying the scanner's use by making it operational immediately upon binary download facilitates easier initiation of scans.
|
||||
|
||||
### No Setup Required
|
||||
Trivy must be ready to use immediately after installation.
|
||||
It's unacceptable for Trivy not to function without setting up a database or writing configuration files by default.
|
||||
Such setups should only be necessary for users requiring specific customizations.
|
||||
|
||||
Security often isn't a top priority for many organizations and can be easily deferred.
|
||||
Trivy aims to lower the barrier to entry by simplifying the setup process, making it easier for users to start securing their projects.
|
||||
|
||||
### Security Focus
|
||||
Trivy prioritizes the identification of security issues, excluding features unrelated to security, such as performance metrics or content listings of container images.
|
||||
It can, however, produce and output intermediate representations like SBOMs for comprehensive security assessments.
|
||||
|
||||
Trivy serves as a tool with opinions on security, used to warn users about potential issues.
|
||||
|
||||
### Detecting Unintended States
|
||||
Trivy is designed to detect unintended vulnerable states in projects, such as the use of vulnerable versions of dependencies or misconfigurations in Infrastructure as Code (IaC) that may unintentionally expose servers to the internet.
|
||||
The focus is on identifying developer mistakes or undesirable states, not on detecting intentional attacks, such as malicious images and malware.
|
||||
|
||||
## Out of Scope Features
|
||||
Aqua Security offers a premium version with several features not available in the open-source Trivy project.
|
||||
While detailed information can be found [here][trivy-aqua], it's beneficial to highlight specific functionalities frequently inquired about:
|
||||
|
||||
### Runtime Security
|
||||
As mentioned in [the Core Principles](#static-analysis-no-runtime-required), Trivy is a static analysis security scanner, making runtime security outside its scope.
|
||||
Runtime security needs are addressed by [Tracee][tracee] or [the commercial version of Aqua Security]().
|
||||
|
||||
### Intentional Attacks
|
||||
As mentioned in [the Core Principles](#detecting-unintended-states), detection of intentional attacks, such as malware or malicious container images, is not covered by Trivy and is supported in [the commercial version][aqua].
|
||||
|
||||
### User Interface
|
||||
Trivy primarily operates via CLI for displaying results, with a richer UI available in [the commercial version][aqua].
|
||||
|
||||
[trivy-aqua]: https://github.com/aquasecurity/resources/blob/main/trivy-aqua.md
|
||||
[tracee]: https://github.com/aquasecurity/tracee
|
||||
[aqua]: https://www.aquasec.com/
|
||||
@@ -137,6 +137,6 @@ $ trivy conf --skip-policy-update /path/to/conf
|
||||
```
|
||||
|
||||
[allowlist]: ../references/troubleshooting.md
|
||||
[oras]: https://oras.land/cli/
|
||||
[oras]: https://oras.land/docs/installation
|
||||
|
||||
[^1]: This is only required to scan `jar` files. More information about `Java index db` [here](../coverage/language/java.md)
|
||||
|
||||
@@ -70,7 +70,7 @@ $ trivy server --cache-backend redis://localhost:6379 \
|
||||
|
||||
[trivy-db]: ./db.md#vulnerability-database
|
||||
[trivy-java-db]: ./db.md#java-index-database
|
||||
[misconf-policies]: ../scanner/misconfiguration/policy/builtin.md
|
||||
[misconf-policies]: ../scanner/misconfiguration/check/builtin.md
|
||||
|
||||
[^1]: Downloaded when scanning for vulnerabilities
|
||||
[^2]: Downloaded when scanning `jar/war/par/ear` files
|
||||
|
||||
@@ -54,18 +54,28 @@ $ trivy image --download-db-only
|
||||
$ trivy image --db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-db
|
||||
```
|
||||
|
||||
!!!note
|
||||
Trivy automatically adds the `trivy-db` schema version as a tag if the tag is not used:
|
||||
|
||||
`trivy-db-registry:latest` => `trivy-db-registry:latest`, but `trivy-db-registry` => `trivy-db-registry:2`.
|
||||
|
||||
## Java Index Database
|
||||
The same options are also available for the Java index DB, which is used for scanning Java applications.
|
||||
Skipping an update can be done by using the `--skip-java-db-update` option, while `--download-java-db-only` can be used to only download the Java index DB.
|
||||
|
||||
!!! Note
|
||||
In [Client/Server](../references/modes/client-server.md) mode, `Java index DB` is currently only used on the `client` side.
|
||||
|
||||
Downloading the Java index DB from an external OCI registry can be done by using the `--java-db-repository` option.
|
||||
|
||||
```
|
||||
$ trivy image --java-db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-java-db --download-java-db-only
|
||||
```
|
||||
|
||||
!!! Note
|
||||
In [Client/Server](../references/modes/client-server.md) mode, `Java index DB` is currently only used on the `client` side.
|
||||
!!!note
|
||||
Trivy automatically adds the `trivy-java-db` schema version as a tag if the tag is not used:
|
||||
|
||||
`java-db-registry:latest` => `java-db-registry:latest`, but `java-db-registry` => `java-db-registry:1`.
|
||||
|
||||
## Remove DBs
|
||||
The `--reset` flag removes all caches and databases.
|
||||
|
||||
@@ -1,81 +1,34 @@
|
||||
# Filtering
|
||||
Trivy provides various methods for filtering the results.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
Issues("Detected\nIssues") --> Severity
|
||||
|
||||
## By Status
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Trivy supports the following vulnerability statuses:
|
||||
|
||||
- `unknown`
|
||||
- `not_affected`: this package is not affected by this vulnerability on this platform
|
||||
- `affected`: this package is affected by this vulnerability on this platform, but there is no patch released yet
|
||||
- `fixed`: this vulnerability is fixed on this platform
|
||||
- `under_investigation`: it is currently unknown whether or not this vulnerability affects this package on this platform, and it is under investigation
|
||||
- `will_not_fix`: this package is affected by this vulnerability on this platform, but there is currently no intention to fix it (this would primarily be for flaws that are of Low or Moderate impact that pose no significant risk to customers)
|
||||
- `fix_deferred`: this package is affected by this vulnerability on this platform, and may be fixed in the future
|
||||
- `end_of_life`: this package has been identified to contain the impacted component, but analysis to determine whether it is affected or not by this vulnerability was not performed
|
||||
|
||||
Note that vulnerabilities with the `unknown`, `not_affected` or `under_investigation` status are not detected.
|
||||
These are only defined for comprehensiveness, and you will not have the opportunity to specify these statuses.
|
||||
|
||||
Some statuses are supported in limited distributions.
|
||||
|
||||
| OS | Fixed | Affected | Under Investigation | Will Not Fix | Fix Deferred | End of Life |
|
||||
|:----------:|:-----:|:--------:|:-------------------:|:------------:|:------------:|:-----------:|
|
||||
| Debian | ✓ | ✓ | | | ✓ | ✓ |
|
||||
| RHEL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Other OSes | ✓ | ✓ | | | | |
|
||||
|
||||
|
||||
To ignore vulnerabilities with specific statuses, use the `--ignore-status <list_of_statuses>` option.
|
||||
|
||||
|
||||
```bash
|
||||
$ trivy image --ignore-status affected,fixed ruby:2.4.0
|
||||
subgraph Filtering
|
||||
subgraph Prioritization
|
||||
direction TB
|
||||
Severity("By Severity") --> Status("By Status")
|
||||
end
|
||||
subgraph Suppression
|
||||
Status --> Ignore("By Finding IDs")
|
||||
Ignore --> Rego("By Rego")
|
||||
Rego --> VEX("By VEX")
|
||||
end
|
||||
end
|
||||
VEX --> Results
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
Similar to the functionality of filtering results, you can also limit the sub-targets for each scanner.
|
||||
For information on these settings, please refer to the scanner-specific documentation ([vulnerability](../scanner/vulnerability.md) , [misconfiguration](../scanner/misconfiguration/index.md), etc.).
|
||||
|
||||
```
|
||||
2019-05-16T12:50:14.786+0900 INFO Detecting Debian vulnerabilities...
|
||||
## Prioritization
|
||||
You can filter the results by
|
||||
|
||||
ruby:2.4.0 (debian 8.7)
|
||||
=======================
|
||||
Total: 527 (UNKNOWN: 0, LOW: 276, MEDIUM: 83, HIGH: 158, CRITICAL: 10)
|
||||
- [Severity](#by-severity)
|
||||
- [Status](#by-status)
|
||||
|
||||
┌─────────────────────────────┬──────────────────┬──────────┬──────────────┬────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
|
||||
├─────────────────────────────┼──────────────────┼──────────┼──────────────┼────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ binutils │ CVE-2014-9939 │ CRITICAL │ will_not_fix │ 2.25-5 │ │ binutils: buffer overflow in ihex.c │
|
||||
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2014-9939 │
|
||||
│ ├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ │ CVE-2017-6969 │ │ │ │ │ binutils: Heap-based buffer over-read in readelf when │
|
||||
│ │ │ │ │ │ │ processing corrupt RL78 binaries │
|
||||
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2017-6969 │
|
||||
│ ├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
...
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
!!! tip
|
||||
To skip all unfixed vulnerabilities, you can use the `--ignore-unfixed` flag .
|
||||
It is a shorthand of `--ignore-status affected,will_not_fix,fix_deferred,end_of_life`.
|
||||
It displays "fixed" vulnerabilities only.
|
||||
|
||||
```bash
|
||||
$ trivy image --ignore-unfixed ruby:2.4.0
|
||||
```
|
||||
|
||||
## By Severity
|
||||
### By Severity
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
@@ -202,11 +155,125 @@ See https://avd.aquasec.com/misconfig/avd-aws-0081
|
||||
```
|
||||
</details>
|
||||
|
||||
## By Finding IDs
|
||||
### By Status
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Trivy supports the following vulnerability statuses:
|
||||
|
||||
- `unknown`
|
||||
- `not_affected`: this package is not affected by this vulnerability on this platform
|
||||
- `affected`: this package is affected by this vulnerability on this platform, but there is no patch released yet
|
||||
- `fixed`: this vulnerability is fixed on this platform
|
||||
- `under_investigation`: it is currently unknown whether or not this vulnerability affects this package on this platform, and it is under investigation
|
||||
- `will_not_fix`: this package is affected by this vulnerability on this platform, but there is currently no intention to fix it (this would primarily be for flaws that are of Low or Moderate impact that pose no significant risk to customers)
|
||||
- `fix_deferred`: this package is affected by this vulnerability on this platform, and may be fixed in the future
|
||||
- `end_of_life`: this package has been identified to contain the impacted component, but analysis to determine whether it is affected or not by this vulnerability was not performed
|
||||
|
||||
Note that vulnerabilities with the `unknown`, `not_affected` or `under_investigation` status are not detected.
|
||||
These are only defined for comprehensiveness, and you will not have the opportunity to specify these statuses.
|
||||
|
||||
Some statuses are supported in limited distributions.
|
||||
|
||||
| OS | Fixed | Affected | Under Investigation | Will Not Fix | Fix Deferred | End of Life |
|
||||
|:----------:|:-----:|:--------:|:-------------------:|:------------:|:------------:|:-----------:|
|
||||
| Debian | ✓ | ✓ | | | ✓ | ✓ |
|
||||
| RHEL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Other OSes | ✓ | ✓ | | | | |
|
||||
|
||||
|
||||
To ignore vulnerabilities with specific statuses, use the `--ignore-status <list_of_statuses>` option.
|
||||
|
||||
|
||||
```bash
|
||||
$ trivy image --ignore-status affected,fixed ruby:2.4.0
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2019-05-16T12:50:14.786+0900 INFO Detecting Debian vulnerabilities...
|
||||
|
||||
ruby:2.4.0 (debian 8.7)
|
||||
=======================
|
||||
Total: 527 (UNKNOWN: 0, LOW: 276, MEDIUM: 83, HIGH: 158, CRITICAL: 10)
|
||||
|
||||
┌─────────────────────────────┬──────────────────┬──────────┬──────────────┬────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
|
||||
├─────────────────────────────┼──────────────────┼──────────┼──────────────┼────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ binutils │ CVE-2014-9939 │ CRITICAL │ will_not_fix │ 2.25-5 │ │ binutils: buffer overflow in ihex.c │
|
||||
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2014-9939 │
|
||||
│ ├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ │ CVE-2017-6969 │ │ │ │ │ binutils: Heap-based buffer over-read in readelf when │
|
||||
│ │ │ │ │ │ │ processing corrupt RL78 binaries │
|
||||
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2017-6969 │
|
||||
│ ├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
...
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
!!! tip
|
||||
To skip all unfixed vulnerabilities, you can use the `--ignore-unfixed` flag .
|
||||
It is a shorthand of `--ignore-status affected,will_not_fix,fix_deferred,end_of_life`.
|
||||
It displays "fixed" vulnerabilities only.
|
||||
|
||||
```bash
|
||||
$ trivy image --ignore-unfixed ruby:2.4.0
|
||||
```
|
||||
|
||||
## Suppression
|
||||
You can filter the results by
|
||||
|
||||
- [Finding IDs](#by-finding-ids)
|
||||
- [Rego](#by-rego)
|
||||
- [Vulnerability Exploitability Exchange (VEX)](#by-vulnerability-exploitability-exchange-vex)
|
||||
|
||||
To show the suppressed results, use the `--show-suppressed` flag.
|
||||
|
||||
!!! note
|
||||
This flag is currently available only in the table format.
|
||||
|
||||
```bash
|
||||
$ trivy image --vex debian11.csaf.vex --ignorefile .trivyignore.yaml --show-suppressed debian:11
|
||||
...
|
||||
|
||||
Suppressed Vulnerabilities (Total: 9)
|
||||
|
||||
┌───────────────┬───────────────┬──────────┬──────────────┬─────────────────────────────────────────────┬───────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Status │ Statement │ Source │
|
||||
├───────────────┼───────────────┼──────────┼──────────────┼─────────────────────────────────────────────┼───────────────────┤
|
||||
│ libdb5.3 │ CVE-2019-8457 │ CRITICAL │ not_affected │ vulnerable_code_not_in_execute_path │ CSAF VEX │
|
||||
├───────────────┼───────────────┼──────────┼──────────────┼─────────────────────────────────────────────┼───────────────────┤
|
||||
│ bsdutils │ CVE-2022-0563 │ LOW │ ignored │ Accept the risk │ .trivyignore.yaml │
|
||||
├───────────────┤ │ │ │ │ │
|
||||
│ libblkid1 │ │ │ │ │ │
|
||||
├───────────────┤ │ │ │ │ │
|
||||
│ libmount1 │ │ │ │ │ │
|
||||
├───────────────┤ │ │ │ │ │
|
||||
│ libsmartcols1 │ │ │ │ │ │
|
||||
├───────────────┤ │ │ │ │ │
|
||||
│ libuuid1 │ │ │ │ │ │
|
||||
├───────────────┤ │ │ │ │ │
|
||||
│ mount │ │ │ │ │ │
|
||||
├───────────────┼───────────────┤ │ ├─────────────────────────────────────────────┤ │
|
||||
│ tar │ CVE-2005-2541 │ │ │ The vulnerable configuration is not enabled │ │
|
||||
├───────────────┼───────────────┤ │ ├─────────────────────────────────────────────┤ │
|
||||
│ util-linux │ CVE-2022-0563 │ │ │ Accept the risk │ │
|
||||
└───────────────┴───────────────┴──────────┴──────────────┴─────────────────────────────────────────────┴───────────────────┘
|
||||
```
|
||||
|
||||
### By Finding IDs
|
||||
|
||||
Trivy supports the [.trivyignore](#trivyignore) and [.trivyignore.yaml](#trivyignoreyaml) ignore files.
|
||||
|
||||
### .trivyignore
|
||||
#### .trivyignore
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
@@ -254,7 +321,7 @@ Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
</details>
|
||||
|
||||
### .trivyignore.yaml
|
||||
#### .trivyignore.yaml
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
@@ -271,12 +338,13 @@ For the `.trivyignore.yaml` file, you can set ignored IDs separately for `vulner
|
||||
|
||||
Available fields:
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|------------|:--------:|---------------------|------------------------------------------------------------------------------------------------------------|
|
||||
| id | ✓ | string | The identifier of the vulnerability, misconfiguration, secret, or license[^1]. |
|
||||
| paths | | string array | The list of file paths to be ignored. If `paths` is not set, the ignore finding is applied to all files. |
|
||||
| expired_at | | date (`yyyy-mm-dd`) | The expiration date of the ignore finding. If `expired_at` is not set, the ignore finding is always valid. |
|
||||
| statement | | string | The reason for ignoring the finding. (This field is not used for filtering.) |
|
||||
| Field | Required | Type | Description |
|
||||
|------------|:--------:|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| id | ✓ | string | The identifier of the vulnerability, misconfiguration, secret, or license[^1]. |
|
||||
| paths[^2] | | string array | The list of file paths to ignore. If `paths` is not set, the ignore finding is applied to all files. |
|
||||
| purls | | string array | The list of PURLs to ignore packages. If `purls` is not set, the ignore finding is applied to all packages. This field is currently available only for vulnerabilities. |
|
||||
| expired_at | | date (`yyyy-mm-dd`) | The expiration date of the ignore finding. If `expired_at` is not set, the ignore finding is always valid. |
|
||||
| statement | | string | The reason for ignoring the finding. (This field is not used for filtering.) |
|
||||
|
||||
```bash
|
||||
$ cat .trivyignore.yaml
|
||||
@@ -288,6 +356,8 @@ vulnerabilities:
|
||||
- id: CVE-2023-2650
|
||||
- id: CVE-2023-3446
|
||||
- id: CVE-2023-3817
|
||||
purls:
|
||||
- "pkg:deb/debian/libssl1.1"
|
||||
- id: CVE-2023-29491
|
||||
expired_at: 2023-09-01
|
||||
|
||||
@@ -339,83 +409,14 @@ Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## By Vulnerability Target
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Use `--vuln-type` option.
|
||||
|
||||
```bash
|
||||
$ trivy image --vuln-type os ruby:2.4.0
|
||||
```
|
||||
|
||||
Available values:
|
||||
|
||||
- library
|
||||
- os
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```bash
|
||||
2019-05-22T19:36:50.530+0200 [34mINFO[0m Updating vulnerability database...
|
||||
2019-05-22T19:36:51.681+0200 [34mINFO[0m Detecting Alpine vulnerabilities...
|
||||
2019-05-22T19:36:51.685+0200 [34mINFO[0m Updating npm Security DB...
|
||||
2019-05-22T19:36:52.389+0200 [34mINFO[0m Detecting npm vulnerabilities...
|
||||
2019-05-22T19:36:52.390+0200 [34mINFO[0m Updating pipenv Security DB...
|
||||
2019-05-22T19:36:53.406+0200 [34mINFO[0m Detecting pipenv vulnerabilities...
|
||||
|
||||
ruby:2.4.0 (debian 8.7)
|
||||
=======================
|
||||
Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| curl | CVE-2018-14618 | CRITICAL | 7.61.0-r0 | 7.61.1-r0 | curl: NTLM password overflow |
|
||||
| | | | | | via integer overflow |
|
||||
+ +------------------+----------+ +---------------+----------------------------------+
|
||||
| | CVE-2018-16839 | HIGH | | 7.61.1-r1 | curl: Integer overflow leading |
|
||||
| | | | | | to heap-based buffer overflow in |
|
||||
| | | | | | Curl_sasl_create_plain_message() |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| git | CVE-2018-17456 | HIGH | 2.15.2-r0 | 2.15.3-r0 | git: arbitrary code execution |
|
||||
| | | | | | via .gitmodules |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2018-19486 | | | | git: Improper handling of |
|
||||
| | | | | | PATH allows for commands to be |
|
||||
| | | | | | executed from... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| libssh2 | CVE-2019-3855 | CRITICAL | 1.8.0-r2 | 1.8.1-r0 | libssh2: Integer overflow in |
|
||||
| | | | | | transport read resulting in |
|
||||
| | | | | | out of bounds write... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| sqlite | CVE-2018-20346 | MEDIUM | 3.21.0-r1 | 3.25.3-r0 | CVE-2018-20505 CVE-2018-20506 |
|
||||
| | | | | | sqlite: Multiple flaws in |
|
||||
| | | | | | sqlite which can be triggered |
|
||||
| | | | | | via... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| tar | CVE-2018-20482 | LOW | 1.29-r1 | 1.31-r0 | tar: Infinite read loop in |
|
||||
| | | | | | sparse_dump_region function in |
|
||||
| | | | | | sparse.c |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## By Rego
|
||||
### By Rego
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
@@ -460,7 +461,8 @@ trivy image -f json centos:7
|
||||
...
|
||||
```
|
||||
|
||||
Each individual vulnerability (under `Results.Vulnerabilities`) or Misconfiguration (under `Results.Misconfigurations`) is evaluated for exclusion or inclusion by the `ignore` rule.
|
||||
Each individual Vulnerability, Misconfiguration, License and Secret (under `Results.Vulnerabilities`, `Results.Misconfigurations`,
|
||||
`Results.Licenses`, `Results.Secrets`) is evaluated for exclusion or inclusion by the `ignore` rule.
|
||||
|
||||
The following is a Rego ignore policy that filters out every vulnerability with a specific CWE ID (as seen in the JSON example above):
|
||||
|
||||
@@ -483,39 +485,16 @@ More info about the helper functions are in the library [here](https://github.co
|
||||
|
||||
You can find more example policies [here](https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/pkg/result/module.go)
|
||||
|
||||
## By Inline Comments
|
||||
|
||||
### By Vulnerability Exploitability Exchange (VEX)
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | |
|
||||
| Misconfiguration | ✓ |
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Some configuration file formats (e.g. Terraform) support inline comments.
|
||||
Please refer to the [VEX documentation](../supply-chain/vex.md) for the details.
|
||||
|
||||
In cases where trivy can detect comments of a specific format immediately adjacent to resource definitions, it is possible to filter/ignore findings from a single point of resource definition (in contrast to `.trivyignore`, which has a directory-wide scope on all of the files scanned).
|
||||
|
||||
The format for these comments is `trivy:ignore:<Vulnerability ID>` immediately following the format-specific line-comment token. You can add multiple ignores on the same comment line.
|
||||
|
||||
For example, to filter a Vulnerability ID "AVD-GCP-0051" in a Terraform HCL file:
|
||||
|
||||
```terraform
|
||||
#trivy:ignore:AVD-GCP-0051
|
||||
resource "google_container_cluster" "one_off_test" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
}
|
||||
```
|
||||
|
||||
For example, to filter vulnerabilities "AVD-GCP-0051" and "AVD-GCP-0053" in a Terraform HCL file:
|
||||
|
||||
```terraform
|
||||
#trivy:ignore:AVD-GCP-0051 trivy:ignore:AVD-GCP-0053
|
||||
resource "google_container_cluster" "one_off_test" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
}
|
||||
```
|
||||
|
||||
[^1]: license name is used as id for `.trivyignore.yaml` files
|
||||
[^1]: license name is used as id for `.trivyignore.yaml` files.
|
||||
[^2]: This doesn't work for os package licenses (e.g. apk, dpkg, rpm). For projects which manage dependencies through a dependency file (e.g. go.mod, yarn.lock) `path` should point to that particular file.
|
||||
|
||||
@@ -63,6 +63,7 @@ The following languages are currently supported:
|
||||
| Go | [go.mod][go-mod] |
|
||||
| PHP | [composer.lock][composer-lock] |
|
||||
| Java | [pom.xml][pom-xml] |
|
||||
| | [*gradle.lockfile][gradle-lockfile] |
|
||||
| Dart | [pubspec.lock][pubspec-lock] |
|
||||
|
||||
This tree is the reverse of the dependency graph.
|
||||
@@ -445,5 +446,6 @@ $ trivy convert --format table --severity CRITICAL result.json
|
||||
[go-mod]: ../coverage/language/golang.md#go-modules
|
||||
[composer-lock]: ../coverage/language/php.md#composer
|
||||
[pom-xml]: ../coverage/language/java.md#pomxml
|
||||
[gradle-lockfile]: ../coverage/language/java.md#gradlelock
|
||||
[pubspec-lock]: ../coverage/language/dart.md#dart
|
||||
[cargo-binaries]: ../coverage/language/rust.md#binaries
|
||||
@@ -11,7 +11,7 @@ The following scanners are supported.
|
||||
Trivy recursively searches directories and scans all found Helm files.
|
||||
|
||||
It evaluates variables, functions, and other elements within Helm templates and resolve the chart to Kubernetes manifests then run the Kubernetes checks.
|
||||
See [here](../../scanner/misconfiguration/policy/builtin.md) for more details on the built-in policies.
|
||||
See [here](../../scanner/misconfiguration/check/builtin.md) for more details on the built-in policies.
|
||||
|
||||
### Value overrides
|
||||
There are a number of options for overriding values in Helm charts.
|
||||
|
||||
@@ -8,14 +8,15 @@ Trivy scans Infrastructure as Code (IaC) files for
|
||||
|
||||
## Supported configurations
|
||||
|
||||
| Config type | File patterns |
|
||||
|-------------------------------------|-------------------------------|
|
||||
| [Kubernetes](kubernetes.md) | *.yml, *.yaml, *.json |
|
||||
| [Docker](docker.md) | Dockerfile, Containerfile |
|
||||
| [Terraform](terraform.md) | *.tf, *.tf.json, *.tfvars, |
|
||||
| [CloudFormation](cloudformation.md) | *.yml, *.yaml, *.json |
|
||||
| [Azure ARM Template](azure-arm.md) | *.json |
|
||||
| [Helm](helm.md) | *.yaml, *.tpl, *.tar.gz, etc. |
|
||||
| Config type | File patterns |
|
||||
|-------------------------------------|-----------------------------------------------|
|
||||
| [Kubernetes](kubernetes.md) | \*.yml, \*.yaml, \*.json |
|
||||
| [Docker](docker.md) | Dockerfile, Containerfile |
|
||||
| [Terraform](terraform.md) | \*.tf, \*.tf.json, \*.tfvars |
|
||||
| [Terraform Plan](terraform.md) | tfplan, \*.tfplan, \*.tfplan.json, \*.tf.json |
|
||||
| [CloudFormation](cloudformation.md) | \*.yml, \*.yaml, \*.json |
|
||||
| [Azure ARM Template](azure-arm.md) | \*.json |
|
||||
| [Helm](helm.md) | \*.yaml, \*.tpl, \*.tar.gz, etc. |
|
||||
|
||||
[misconf]: ../../scanner/misconfiguration/index.md
|
||||
[secret]: ../../scanner/secret.md
|
||||
|
||||
@@ -8,18 +8,23 @@ Trivy supports the scanners listed in the table below.
|
||||
|
||||
It supports the following formats:
|
||||
|
||||
| Format | Supported |
|
||||
|:---------:|:---------:|
|
||||
| JSON | ✓ |
|
||||
| HCL | ✓ |
|
||||
| Plan JSON | ✓ |
|
||||
|
||||
Trivy can scan the results of `terraform plan`.
|
||||
You can scan by passing the file generated as shown below to Trivy:
|
||||
| Format | Supported |
|
||||
|:-------------:|:---------:|
|
||||
| JSON | ✓ |
|
||||
| HCL | ✓ |
|
||||
| Plan Snapshot | ✓ |
|
||||
| Plan JSON | ✓ |
|
||||
|
||||
Trivy can scan Terraform Plan files (snapshots) or their JSON representations. To create a Terraform Plan and scan it, run the following command:
|
||||
```bash
|
||||
terraform plan --out tfplan
|
||||
trivy conf tfplan
|
||||
```
|
||||
$ terraform plan --out tfplan.binary
|
||||
$ terraform show -json tfplan.binary > tfplan.json
|
||||
|
||||
To scan a Terraform Plan representation in JSON format, run the following command:
|
||||
```bash
|
||||
terraform show -json tfplan > tfplan.json
|
||||
trivy conf tfplan.json
|
||||
```
|
||||
|
||||
## Misconfiguration
|
||||
|
||||
@@ -1,23 +1,34 @@
|
||||
# C/C++
|
||||
|
||||
Trivy supports [Conan][conan] C/C++ Package Manager.
|
||||
Trivy supports Conan C/C++ Package Manager ([v1][conanV1] and [v2][conanV2] with limitations).
|
||||
|
||||
The following scanners are supported.
|
||||
|
||||
| Package manager | SBOM | Vulnerability | License |
|
||||
| --------------- | :---: | :-----------: | :-----: |
|
||||
| Conan | ✓ | ✓ | - |
|
||||
| Package manager | SBOM | Vulnerability | License |
|
||||
|-----------------|:----:|:-------------:|:-------:|
|
||||
| Conan | ✓ | ✓ | ✓[^1] |
|
||||
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|
||||
| --------------- | -------------- | :---------------------: | :--------------: | :----------------------------------: | :------: |
|
||||
| Conan | conan.lock[^1] | ✓ | Excluded | ✓ | ✓ |
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|
||||
|-----------------------|----------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|
|
||||
| Conan (lockfile v1) | conan.lock[^2] | ✓ | Excluded | ✓ | ✓ |
|
||||
| Conan (lockfile v2) | conan.lock[^2] | ✓ [^3] | Excluded | - | ✓ |
|
||||
|
||||
## Conan
|
||||
In order to detect dependencies, Trivy searches for `conan.lock`[^1].
|
||||
|
||||
[conan]: https://docs.conan.io/1/index.html
|
||||
[conanV1]: https://docs.conan.io/1/index.html
|
||||
[conanV2]: https://docs.conan.io/2/
|
||||
|
||||
### Licenses
|
||||
The Conan lock file doesn't contain any license information.
|
||||
To obtain licenses we parse the `conanfile.py` files from the [conan cache directory][conan-cache-dir].
|
||||
To correctly detection licenses, ensure that the cache directory contains all dependencies used.
|
||||
|
||||
[conan-cache-dir]: https://docs.conan.io/1/mastering/custom_cache.html
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
|
||||
[^1]: `conan.lock` is default name. To scan a custom filename use [file-patterns](../../configuration/skipping.md#file-patterns)
|
||||
[^1]: The local cache should contain the dependencies used. See [licenses](#licenses).
|
||||
[^2]: `conan.lock` is default name. To scan a custom filename use [file-patterns](../../configuration/skipping.md#file-patterns).
|
||||
[^3]: For `conan.lock` in version 2, indirect dependencies are included in analysis but not flagged explicitly in dependency tree
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Go
|
||||
|
||||
## Data Sources
|
||||
The data sources are listed [here](../../scanner/vulnerability.md#data-sources-1).
|
||||
Trivy uses Go Vulnerability Database for standard packages, such as `net/http`, and uses GitHub Advisory Database for third-party packages.
|
||||
|
||||
## Features
|
||||
Trivy supports two types of Go scanning, Go Modules and binaries built by Go.
|
||||
|
||||
@@ -12,10 +16,10 @@ The following scanners are supported.
|
||||
|
||||
The table below provides an outline of the features Trivy offers.
|
||||
|
||||
| Artifact | Offline[^1] | Dev dependencies | [Dependency graph][dependency-graph] |
|
||||
|----------|:-----------:|:-----------------|:----------------------------------:|
|
||||
| Modules | ✅ | Include | ✅[^2] |
|
||||
| Binaries | ✅ | Exclude | - |
|
||||
| Artifact | Offline[^1] | Dev dependencies | [Dependency graph][dependency-graph] | Stdlib |
|
||||
|----------|:-----------:|:-----------------|:------------------------------------:|:------:|
|
||||
| Modules | ✅ | Include | ✅[^2] | - |
|
||||
| Binaries | ✅ | Exclude | - | ✅[^4] |
|
||||
|
||||
!!! note
|
||||
Trivy scans only dependencies of the Go project.
|
||||
@@ -74,7 +78,20 @@ $ trivy rootfs ./your_binary
|
||||
!!! note
|
||||
It doesn't work with UPX-compressed binaries.
|
||||
|
||||
#### Empty versions
|
||||
There are times when Go uses the `(devel)` version for modules/dependencies.
|
||||
|
||||
- Only Go binaries installed using the `go install` command contain correct (semver) version for the main module.
|
||||
In other cases, Go uses the `(devel)` version[^3].
|
||||
- Dependencies replaced with local ones use the `(devel)` versions.
|
||||
|
||||
In the first case, Trivy will attempt to parse any `-ldflags` as a secondary source, and will leave the version
|
||||
empty if it cannot do so[^5]. For the second case, the version of such packages is empty.
|
||||
|
||||
[^1]: It doesn't require the Internet access.
|
||||
[^2]: Need to download modules to local cache beforehand
|
||||
[^3]: See https://github.com/aquasecurity/trivy/issues/1837#issuecomment-1832523477
|
||||
[^4]: Identify the Go version used to compile the binary and detect its vulnerabilities
|
||||
[^5]: See https://github.com/golang/go/issues/63432#issuecomment-1751610604
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
|
||||
@@ -3,11 +3,11 @@ Trivy supports three types of Java scanning: `JAR/WAR/PAR/EAR`, `pom.xml` and `*
|
||||
|
||||
Each artifact supports the following scanners:
|
||||
|
||||
| Artifact | SBOM | Vulnerability | License |
|
||||
| ---------------- | :---: | :-----------: | :-----: |
|
||||
| JAR/WAR/PAR/EAR | ✓ | ✓ | - |
|
||||
| pom.xml | ✓ | ✓ | ✓ |
|
||||
| *gradle.lockfile | ✓ | ✓ | - |
|
||||
| Artifact | SBOM | Vulnerability | License |
|
||||
|------------------|:----:|:-------------:|:-------:|
|
||||
| JAR/WAR/PAR/EAR | ✓ | ✓ | - |
|
||||
| pom.xml | ✓ | ✓ | ✓ |
|
||||
| *gradle.lockfile | ✓ | ✓ | ✓ |
|
||||
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
|
||||
@@ -15,7 +15,7 @@ The following table provides an outline of the features Trivy offers.
|
||||
|------------------|:---------------------:|:----------------:|:------------------------------------:|:--------:|
|
||||
| JAR/WAR/PAR/EAR | Trivy Java DB | Include | - | - |
|
||||
| pom.xml | Maven repository [^1] | Exclude | ✓ | ✓[^7] |
|
||||
| *gradle.lockfile | - | Exclude | - | - |
|
||||
| *gradle.lockfile | - | Exclude | ✓ | ✓ |
|
||||
|
||||
These may be enabled or disabled depending on the target.
|
||||
See [here](./index.md) for the detail.
|
||||
@@ -42,7 +42,19 @@ Trivy parses your `pom.xml` file and tries to find files with dependencies from
|
||||
- relativePath field[^5]
|
||||
- local repository directory[^6].
|
||||
|
||||
If your machine doesn't have the necessary files - Trivy tries to find the information about these dependencies in the [maven repository](https://repo.maven.apache.org/maven2/).
|
||||
### remote repositories
|
||||
If your machine doesn't have the necessary files - Trivy tries to find the information about these dependencies in the remote repositories:
|
||||
|
||||
- [repositories from pom files][maven-pom-repos]
|
||||
- [maven central repository][maven-central]
|
||||
|
||||
Trivy reproduces Maven's repository selection and priority:
|
||||
|
||||
- for snapshot artifacts:
|
||||
- check only snapshot repositories from pom files (if exists)
|
||||
- for other artifacts:
|
||||
- check release repositories from pom files (if exists)
|
||||
- check [maven central][maven-central]
|
||||
|
||||
!!! Note
|
||||
Trivy only takes information about packages. We don't take a list of vulnerabilities for packages from the `maven repository`.
|
||||
@@ -55,12 +67,33 @@ The vulnerability database will be downloaded anyway.
|
||||
!!! Warning
|
||||
Trivy may skip some dependencies (that were not found on your local machine) when the `--offline-scan` flag is passed.
|
||||
|
||||
## Gradle.lock
|
||||
`gradle.lock` files contain all necessary information about used dependencies.
|
||||
Trivy simply parses the file, extract dependencies, and finds vulnerabilities for them.
|
||||
It doesn't require the internet access.
|
||||
|
||||
[^1]: https://github.com/aquasecurity/trivy-java-db
|
||||
### maven-invoker-plugin
|
||||
Typically, the integration tests directory (`**/[src|target]/it/*/pom.xml`) of [maven-invoker-plugin][maven-invoker-plugin] doesn't contain actual `pom.xml` files and should be skipped to avoid noise.
|
||||
|
||||
Trivy marks dependencies from these files as the development dependencies and skip them by default.
|
||||
If you need to show them, use the `--include-dev-deps` flag.
|
||||
|
||||
|
||||
## Gradle.lock
|
||||
`gradle.lock` files only contain information about used dependencies.
|
||||
|
||||
!!!note
|
||||
All necessary files are checked locally. Gradle file scanning doesn't require internet access.
|
||||
|
||||
### Dependency-tree
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
Trivy finds child dependencies from `*.pom` files in the cache[^8] directory.
|
||||
|
||||
But there is no reliable way to determine direct dependencies (even using other files).
|
||||
Therefore, we mark all dependencies as indirect to use logic to guess direct dependencies and build a dependency tree.
|
||||
|
||||
### Licenses
|
||||
Trity also can detect licenses for dependencies.
|
||||
|
||||
Make sure that you have cache[^8] directory to find licenses from `*.pom` dependency files.
|
||||
|
||||
[^1]: Uses maven repository to get information about dependencies. Internet access required.
|
||||
[^2]: It means `*.jar`, `*.war`, `*.par` and `*.ear` file
|
||||
[^3]: `ArtifactID`, `GroupID` and `Version`
|
||||
@@ -68,5 +101,9 @@ It doesn't require the internet access.
|
||||
[^5]: When you use dependency path in `relativePath` field in pom.xml file
|
||||
[^6]: `/Users/<username>/.m2/repository` (for Linux and Mac) and `C:/Users/<username>/.m2/repository` (for Windows) by default
|
||||
[^7]: To avoid confusion, Trivy only finds locations for direct dependencies from the base pom.xml file.
|
||||
[^8]: The supported directories are `$GRADLE_USER_HOME/caches` and `$HOME/.gradle/caches` (`%HOMEPATH%\.gradle\caches` for Windows).
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[maven-invoker-plugin]: https://maven.apache.org/plugins/maven-invoker-plugin/usage.html
|
||||
[maven-central]: https://repo.maven.apache.org/maven2/
|
||||
[maven-pom-repos]: https://maven.apache.org/settings.html#repositories
|
||||
@@ -55,6 +55,9 @@ By default, Trivy doesn't report development dependencies. Use the `--include-de
|
||||
### pnpm
|
||||
Trivy parses `pnpm-lock.yaml`, then finds production dependencies and builds a [tree][dependency-graph] of dependencies with vulnerabilities.
|
||||
|
||||
!!! note
|
||||
Trivy currently only supports Lockfile [v6][pnpm-lockfile-v6] or earlier.
|
||||
|
||||
### Bun
|
||||
Trivy supports scanning `yarn.lock` files generated by [Bun](https://bun.sh/docs/install/lockfile#how-do-i-inspect-bun-s-lockfile). You can use the command `bun install -y` to generate a Yarn-compatible `yarn.lock`.
|
||||
|
||||
@@ -69,5 +72,6 @@ Trivy searches for `package.json` files under `node_modules` and identifies inst
|
||||
It only extracts package names, versions and licenses for those packages.
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[pnpm-lockfile-v6]: https://github.com/pnpm/spec/blob/fd3238639af86c09b7032cc942bab3438b497036/lockfile/6.0.md
|
||||
|
||||
[^1]: [yarn.lock](#bun) must be generated
|
||||
|
||||
36
docs/docs/coverage/os/conda.md
Normal file
36
docs/docs/coverage/os/conda.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Conda
|
||||
|
||||
Trivy supports the following scanners for Conda packages.
|
||||
|
||||
| Scanner | Supported |
|
||||
|:-------------:|:---------:|
|
||||
| SBOM | ✓ |
|
||||
| Vulnerability | - |
|
||||
| License | ✓[^1] |
|
||||
|
||||
|
||||
## SBOM
|
||||
Trivy detects packages that have been installed with `Conda`.
|
||||
|
||||
|
||||
### `<package>.json`
|
||||
Trivy parses `<conda-root>/envs/<env>/conda-meta/<package>.json` files to find the version and license for the dependencies installed in your env.
|
||||
|
||||
### `environment.yml`[^2]
|
||||
Trivy supports parsing [environment.yml][environment.yml][^2] files to find dependency list.
|
||||
|
||||
!!! note
|
||||
License detection is currently not supported.
|
||||
|
||||
`environment.yml`[^2] files supports [version range][env-version-range]. We can't be sure about versions for these dependencies.
|
||||
Therefore, you need to use `conda env export` command to get dependency list in `Conda` default format before scanning `environment.yml`[^2] file.
|
||||
|
||||
!!! note
|
||||
For dependencies in a non-Conda format, Trivy doesn't include a version of them.
|
||||
|
||||
|
||||
[^1]: License detection is only supported for `<package>.json` files
|
||||
[^2]: Trivy supports both `yaml` and `yml` extensions.
|
||||
|
||||
[environment.yml]: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#sharing-an-environment
|
||||
[env-version-range]: https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#examples-of-package-specs
|
||||
@@ -9,23 +9,24 @@ Trivy supports operating systems for
|
||||
|
||||
## Supported OS
|
||||
|
||||
| OS | Supported Versions | Package Managers |
|
||||
|-----------------------------------------------|-------------------------------------|------------------|
|
||||
| [Alpine Linux](alpine.md) | 2.2 - 2.7, 3.0 - 3.19, edge | apk |
|
||||
| [Wolfi Linux](wolfi.md) | (n/a) | apk |
|
||||
| [Chainguard](chainguard.md) | (n/a) | apk |
|
||||
| [Red Hat Enterprise Linux](rhel.md) | 6, 7, 8 | dnf/yum/rpm |
|
||||
| [CentOS](centos.md)[^1] | 6, 7, 8 | dnf/yum/rpm |
|
||||
| [AlmaLinux](alma.md) | 8, 9 | dnf/yum/rpm |
|
||||
| [Rocky Linux](rocky.md) | 8, 9 | dnf/yum/rpm |
|
||||
| [Oracle Linux](oracle.md) | 5, 6, 7, 8 | dnf/yum/rpm |
|
||||
| [CBL-Mariner](cbl-mariner.md) | 1.0, 2.0 | dnf/yum/rpm |
|
||||
| [Amazon Linux](amazon.md) | 1, 2, 2023 | dnf/yum/rpm |
|
||||
| [openSUSE Leap](suse.md) | 42, 15 | zypper/rpm |
|
||||
| [SUSE Enterprise Linux](suse.md) | 11, 12, 15 | zypper/rpm |
|
||||
| [Photon OS](photon.md) | 1.0, 2.0, 3.0, 4.0 | tndf/yum/rpm |
|
||||
| [Debian GNU/Linux](debian.md) | 7, 8, 9, 10, 11, 12 | apt/dpkg |
|
||||
| [Ubuntu](ubuntu.md) | All versions supported by Canonical | apt/dpkg |
|
||||
| OS | Supported Versions | Package Managers |
|
||||
|--------------------------------------|-------------------------------------|------------------|
|
||||
| [Alpine Linux](alpine.md) | 2.2 - 2.7, 3.0 - 3.19, edge | apk |
|
||||
| [Wolfi Linux](wolfi.md) | (n/a) | apk |
|
||||
| [Chainguard](chainguard.md) | (n/a) | apk |
|
||||
| [Red Hat Enterprise Linux](rhel.md) | 6, 7, 8 | dnf/yum/rpm |
|
||||
| [CentOS](centos.md)[^1] | 6, 7, 8 | dnf/yum/rpm |
|
||||
| [AlmaLinux](alma.md) | 8, 9 | dnf/yum/rpm |
|
||||
| [Rocky Linux](rocky.md) | 8, 9 | dnf/yum/rpm |
|
||||
| [Oracle Linux](oracle.md) | 5, 6, 7, 8 | dnf/yum/rpm |
|
||||
| [CBL-Mariner](cbl-mariner.md) | 1.0, 2.0 | dnf/yum/rpm |
|
||||
| [Amazon Linux](amazon.md) | 1, 2, 2023 | dnf/yum/rpm |
|
||||
| [openSUSE Leap](suse.md) | 42, 15 | zypper/rpm |
|
||||
| [SUSE Enterprise Linux](suse.md) | 11, 12, 15 | zypper/rpm |
|
||||
| [Photon OS](photon.md) | 1.0, 2.0, 3.0, 4.0 | tndf/yum/rpm |
|
||||
| [Debian GNU/Linux](debian.md) | 7, 8, 9, 10, 11, 12 | apt/dpkg |
|
||||
| [Ubuntu](ubuntu.md) | All versions supported by Canonical | apt/dpkg |
|
||||
| [OSs with installed Conda](conda.md) | - | conda |
|
||||
|
||||
## Supported container images
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ trivy [global flags] command [flags] target
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
* [trivy repository](trivy_repository.md) - Scan a repository
|
||||
* [trivy rootfs](trivy_rootfs.md) - Scan rootfs
|
||||
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities
|
||||
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities and licenses
|
||||
* [trivy server](trivy_server.md) - Server mode
|
||||
* [trivy version](trivy_version.md) - Print the version
|
||||
* [trivy vm](trivy_vm.md) - [EXPERIMENTAL] Scan a virtual machine image
|
||||
|
||||
@@ -69,13 +69,17 @@ trivy aws [flags]
|
||||
--account string The AWS account to scan. It's useful to specify this when reviewing cached results for multiple accounts.
|
||||
--arn string The AWS ARN to show results for. Useful to filter results once a scan is cached.
|
||||
--cf-params strings specify paths to override the CloudFormation parameters files
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--compliance string compliance report to generate (aws-cis-1.2,aws-cis-1.4)
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--endpoint string AWS Endpoint override
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -85,18 +89,16 @@ trivy aws [flags]
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--max-cache-age duration The maximum age of the cloud cache. Cached data will be requeried from the cloud provider if it is older than this. (default 24h0m0s)
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--max-cache-age duration The maximum age of the cloud cache. Cached data will be required from the cloud provider if it is older than this. (default 24h0m0s)
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
-o, --output string output file name
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--region string AWS Region to scan
|
||||
--report string specify a report format for the output (all,summary) (default "all")
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--service strings Only scan AWS Service(s) specified with this flag. Can specify multiple services using --service A --service B etc.
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-service strings Skip selected AWS Service(s) specified with this flag. Can specify multiple services using --skip-service A --skip-service B etc.
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
|
||||
@@ -12,14 +12,18 @@ trivy config [flags] DIR
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--cf-params strings specify paths to override the CloudFormation parameters files
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -29,24 +33,22 @@ trivy config [flags] DIR
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
-o, --output string output file name
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--registry-token string registry token
|
||||
--report string specify a compliance report format for the output (all,summary) (default "all")
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
|
||||
@@ -31,6 +31,7 @@ trivy convert [flags] RESULT_JSON
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--report string specify a report format for the output (all,summary) (default "all")
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
-t, --template string output template
|
||||
```
|
||||
|
||||
|
||||
@@ -22,12 +22,14 @@ trivy filesystem [flags] PATH
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--cf-params strings specify paths to override the CloudFormation parameters files
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
@@ -35,6 +37,8 @@ trivy filesystem [flags] PATH
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -47,11 +51,11 @@ trivy filesystem [flags] PATH
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
@@ -59,8 +63,6 @@ trivy filesystem [flags] PATH
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
@@ -69,17 +71,18 @@ trivy filesystem [flags] PATH
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--report string specify a compliance report format for the output (all,summary) (default "all")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
|
||||
@@ -36,12 +36,14 @@ trivy image [flags] IMAGE_NAME
|
||||
```
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate (docker-cis)
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--docker-host string unix domain socket path to use for docker scanning
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
@@ -51,6 +53,8 @@ trivy image [flags] IMAGE_NAME
|
||||
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -65,11 +69,11 @@ trivy image [flags] IMAGE_NAME
|
||||
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--input string input file path instead of image name
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
@@ -78,8 +82,7 @@ trivy image [flags] IMAGE_NAME
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--platform string set platform in the form os/arch if image is multi-platform capable
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--podman-host string unix podman socket path to use for podman scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
@@ -89,17 +92,18 @@ trivy image [flags] IMAGE_NAME
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine)
|
||||
--report string specify a format for the compliance report. (all,summary) (default "summary")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--token string for authentication in client/server mode
|
||||
|
||||
@@ -2,50 +2,56 @@
|
||||
|
||||
[EXPERIMENTAL] Scan kubernetes cluster
|
||||
|
||||
### Synopsis
|
||||
|
||||
Default context in kube configuration will be used unless specified
|
||||
|
||||
```
|
||||
trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg: pods, pod/NAME }
|
||||
trivy kubernetes [flags] [CONTEXT]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# cluster scanning
|
||||
$ trivy k8s --report summary cluster
|
||||
$ trivy k8s --report summary
|
||||
|
||||
# namespace scanning:
|
||||
$ trivy k8s -n kube-system --report summary all
|
||||
# cluster scanning with specific namespace:
|
||||
$ trivy k8s --include-namespaces kube-system --report summary
|
||||
|
||||
# resources scanning:
|
||||
$ trivy k8s --report=summary deploy
|
||||
$ trivy k8s --namespace=kube-system --report=summary deploy,configmaps
|
||||
|
||||
# resource scanning:
|
||||
$ trivy k8s deployment/orion
|
||||
# cluster with specific context:
|
||||
$ trivy k8s kind-kind --report summary
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-A, --all-namespaces fetch resources from all cluster namespaces
|
||||
--burst int specify the maximum burst for throttle (default 10)
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate (k8s-nsa,k8s-cis,k8s-pss-baseline,k8s-pss-restricted)
|
||||
--components strings specify which components to scan (workload,infra) (default [workload,infra])
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--context string specify a context to scan
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--disable-node-collector When the flag is activated, the node-collector job will not be executed, thus skipping misconfiguration findings on the node.
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
--exclude-kinds strings indicate the kinds exclude from scanning (example: node)
|
||||
--exclude-namespaces strings indicate the namespaces excluded from scanning (example: kube-system)
|
||||
--exclude-nodes strings indicate the node labels that the node-collector job should exclude from scanning (example: kubernetes.io/arch:arm64,team:dev)
|
||||
--exclude-owned exclude resources that have an owner reference
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,cyclonedx) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -56,13 +62,14 @@ trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg:
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
|
||||
--include-kinds strings indicate the kinds included in scanning (example: node)
|
||||
--include-namespaces strings indicate the namespaces included in scanning (example: kube-system)
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
|
||||
--kubeconfig string specify the kubeconfig file path to use
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
-n, --namespace string specify a namespace to scan
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--no-progress suppress progress bar
|
||||
--node-collector-imageref string indicate the image reference for the node-collector scan job (default "ghcr.io/aquasecurity/node-collector:0.0.9")
|
||||
--node-collector-namespace string specify the namespace in which the node-collector job should be deployed (default "trivy-temp")
|
||||
@@ -71,8 +78,6 @@ trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg:
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--qps float specify the maximum QPS to the master from this client (default 5)
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
@@ -82,16 +87,18 @@ trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg:
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--report string specify a report format for the output (all,summary) (default "all")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,rbac) (default [vuln,misconfig,secret,rbac])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-images skip the downloading and scanning of images (vulnerabilities and secrets) in the cluster resources
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--tolerations strings specify node-collector job tolerations (example: key1=value1:NoExecute,key2=value2:NoSchedule)
|
||||
|
||||
@@ -22,12 +22,14 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--cf-params strings specify paths to override the CloudFormation parameters files
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--commit string pass the commit hash to be scanned
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
@@ -35,6 +37,8 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -47,11 +51,11 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
@@ -59,8 +63,6 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
@@ -68,17 +70,18 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--registry-token string registry token
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--tag string pass the tag name to be scanned
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
|
||||
@@ -25,11 +25,13 @@ trivy rootfs [flags] ROOTDIR
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--cf-params strings specify paths to override the CloudFormation parameters files
|
||||
--check-namespaces strings Rego namespaces
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
|
||||
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
|
||||
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
@@ -38,6 +40,8 @@ trivy rootfs [flags] ROOTDIR
|
||||
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -49,11 +53,11 @@ trivy rootfs [flags] ROOTDIR
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
@@ -61,8 +65,6 @@ trivy rootfs [flags] ROOTDIR
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
@@ -70,17 +72,18 @@ trivy rootfs [flags] ROOTDIR
|
||||
--registry-token string registry token
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-check-update skip fetching rego check updates
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## trivy sbom
|
||||
|
||||
Scan SBOM for vulnerabilities
|
||||
Scan SBOM for vulnerabilities and licenses
|
||||
|
||||
```
|
||||
trivy sbom [flags] SBOM_PATH
|
||||
@@ -25,7 +25,7 @@ trivy sbom [flags] SBOM_PATH
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
@@ -36,8 +36,9 @@ trivy sbom [flags] SBOM_PATH
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
@@ -50,8 +51,10 @@ trivy sbom [flags] SBOM_PATH
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--reset remove all caches and database
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,license) (default [vuln])
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
|
||||
@@ -23,7 +23,7 @@ trivy server [flags]
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
-h, --help help for server
|
||||
|
||||
@@ -23,10 +23,11 @@ trivy vm [flags] VM_IMAGE
|
||||
--aws-region string AWS region to scan
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
@@ -35,6 +36,8 @@ trivy vm [flags] VM_IMAGE
|
||||
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
|
||||
--helm-api-versions strings Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command. (can specify multiple or separate values with commas: policy/v1/PodDisruptionBudget,apps/v1/Deployment)
|
||||
--helm-kube-version string Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
@@ -45,28 +48,28 @@ trivy vm [flags] VM_IMAGE
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan])
|
||||
--misconfig-scanners strings comma-separated list of misconfig scanners to use for misconfiguration scanning (default [azure-arm,cloudformation,dockerfile,helm,kubernetes,terraform,terraformplan-json,terraformplan-snapshot])
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
-o, --output string output file name
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--parallel int number of goroutines enabled for parallel scanning, set 0 to auto-detect parallelism (default 5)
|
||||
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/trivy-policies:0")
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--reset-checks-bundle remove checks bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,misconfig,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
|
||||
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories or glob patterns to skip
|
||||
--skip-files strings specify the files or glob patterns to skip
|
||||
|
||||
@@ -81,6 +81,15 @@ severity:
|
||||
- MEDIUM
|
||||
- HIGH
|
||||
- CRITICAL
|
||||
|
||||
scan:
|
||||
# Same as '--compliance'
|
||||
# Default is empty
|
||||
compliance:
|
||||
|
||||
# Same as '--show-suppressed'
|
||||
# Default is false
|
||||
show-suppressed: false
|
||||
```
|
||||
|
||||
## Scan Options
|
||||
@@ -106,7 +115,7 @@ scan:
|
||||
|
||||
# Same as '--offline-scan'
|
||||
# Default is false
|
||||
offline-scan: false
|
||||
offline: false
|
||||
|
||||
# Same as '--scanners'
|
||||
# Default depends on subcommand
|
||||
@@ -115,6 +124,24 @@ scan:
|
||||
- misconfig
|
||||
- secret
|
||||
- license
|
||||
-
|
||||
# Same as '--parallel'
|
||||
# Default is 5
|
||||
parallel: 1
|
||||
|
||||
# Same as '--sbom-sources'
|
||||
# Default is empty
|
||||
sbom-sources:
|
||||
- oci
|
||||
- rekor
|
||||
|
||||
# Same as '--rekor-url'
|
||||
# Default is 'https://rekor.sigstore.dev'
|
||||
rekor-url: https://rekor.sigstore.dev
|
||||
|
||||
# Same as '--include-dev-deps'
|
||||
# Default is false
|
||||
include-dev-deps: false
|
||||
```
|
||||
|
||||
## Cache Options
|
||||
@@ -131,6 +158,9 @@ cache:
|
||||
|
||||
# Redis options
|
||||
redis:
|
||||
# Same as '--redis-tls'
|
||||
# Default is false
|
||||
tls:
|
||||
# Same as '--redis-ca'
|
||||
# Default is empty
|
||||
ca:
|
||||
@@ -148,21 +178,25 @@ cache:
|
||||
|
||||
```yaml
|
||||
db:
|
||||
# Same as '--no-progress'
|
||||
# Default is false
|
||||
no-progress: false
|
||||
|
||||
# Same as '--skip-db-update'
|
||||
# Default is false
|
||||
skip-update: false
|
||||
|
||||
# Same as '--no-progress'
|
||||
# Default is false
|
||||
no-progress: false
|
||||
|
||||
# Same as '--db-repository'
|
||||
# Default is 'ghcr.io/aquasecurity/trivy-db'
|
||||
repository: ghcr.io/aquasecurity/trivy-db
|
||||
# Default is 'ghcr.io/aquasecurity/trivy-db:2'
|
||||
repository: ghcr.io/aquasecurity/trivy-db:2
|
||||
|
||||
# Same as '--skip-java-db-update'
|
||||
# Default is false
|
||||
java-skip-update: false
|
||||
|
||||
# Same as '--java-db-repository'
|
||||
# Default is 'ghcr.io/aquasecurity/trivy-java-db'
|
||||
java-repository: ghcr.io/aquasecurity/trivy-java-db
|
||||
# Default is 'ghcr.io/aquasecurity/trivy-java-db:1'
|
||||
java-repository: ghcr.io/aquasecurity/trivy-java-db:1
|
||||
```
|
||||
|
||||
## Registry Options
|
||||
@@ -197,12 +231,29 @@ image:
|
||||
|
||||
# Same as '--platform'
|
||||
# Default is empty
|
||||
platform:
|
||||
platform:
|
||||
|
||||
# Same as '--image-src'
|
||||
# Default is 'docker,containerd,podman,remote'
|
||||
source:
|
||||
- podman
|
||||
- docker
|
||||
|
||||
# Same as '--image-config-scanners'
|
||||
# Default is empty
|
||||
image-config-scanners:
|
||||
- misconfig
|
||||
- secret
|
||||
|
||||
docker:
|
||||
# Same as '--docker-host'
|
||||
# Default is empty
|
||||
host:
|
||||
|
||||
podman:
|
||||
# Same as '--podman-host'
|
||||
# Default is empty
|
||||
host:
|
||||
```
|
||||
|
||||
## Vulnerability Options
|
||||
@@ -219,6 +270,67 @@ vulnerability:
|
||||
# Same as '--ignore-unfixed'
|
||||
# Default is false
|
||||
ignore-unfixed: false
|
||||
|
||||
# Same as '--ignore-unfixed'
|
||||
# Default is empty
|
||||
ignore-status:
|
||||
- end_of_life
|
||||
```
|
||||
|
||||
## License Options
|
||||
Available with license scanning
|
||||
|
||||
```yaml
|
||||
license:
|
||||
# Same as '--license-full'
|
||||
# Default is false
|
||||
full: false
|
||||
|
||||
# Same as '--ignored-licenses'
|
||||
# Default is empty
|
||||
ignored:
|
||||
- MPL-2.0
|
||||
- MIT
|
||||
|
||||
# Same as '--license-confidence-level'
|
||||
# Default is 0.9
|
||||
confidenceLevel: 0.9
|
||||
|
||||
# Set list of forbidden licenses
|
||||
# Default is https://github.com/aquasecurity/trivy/blob/164b025413c5fb9c6759491e9a306b46b869be93/pkg/licensing/category.go#L171
|
||||
forbidden:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
|
||||
# Set list of restricted licenses
|
||||
# Default is https://github.com/aquasecurity/trivy/blob/164b025413c5fb9c6759491e9a306b46b869be93/pkg/licensing/category.go#L199
|
||||
restricted:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
|
||||
# Set list of reciprocal licenses
|
||||
# Default is https://github.com/aquasecurity/trivy/blob/164b025413c5fb9c6759491e9a306b46b869be93/pkg/licensing/category.go#L238
|
||||
reciprocal:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
|
||||
# Set list of notice licenses
|
||||
# Default is https://github.com/aquasecurity/trivy/blob/164b025413c5fb9c6759491e9a306b46b869be93/pkg/licensing/category.go#L260
|
||||
notice:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
|
||||
# Set list of permissive licenses
|
||||
# Default is empty
|
||||
permissive:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
|
||||
# Set list of unencumbered licenses
|
||||
# Default is https://github.com/aquasecurity/trivy/blob/164b025413c5fb9c6759491e9a306b46b869be93/pkg/licensing/category.go#L334
|
||||
unencumbered:
|
||||
- AGPL-1.0
|
||||
- AGPL-3.0
|
||||
```
|
||||
|
||||
## Secret Options
|
||||
@@ -234,11 +346,15 @@ secret:
|
||||
## Rego Options
|
||||
|
||||
```yaml
|
||||
rego
|
||||
rego:
|
||||
# Same as '--trace'
|
||||
# Default is false
|
||||
trace: false
|
||||
|
||||
# Same as '--skip-policy-update'
|
||||
# Default is false
|
||||
skip-policy-update: false
|
||||
|
||||
# Same as '--config-policy'
|
||||
# Default is empty
|
||||
policy:
|
||||
@@ -266,6 +382,10 @@ misconfiguration:
|
||||
# Same as '--include-non-failures'
|
||||
# Default is false
|
||||
include-non-failures: false
|
||||
|
||||
# Same as '--policy-bundle-repository'
|
||||
# Default is 'ghcr.io/aquasecurity/trivy-checks:0'
|
||||
policy-bundle-repository: ghcr.io/aquasecurity/trivy-checks:0
|
||||
|
||||
# Same as '--miconfig-scanners'
|
||||
# Default is all scanners
|
||||
@@ -274,36 +394,46 @@ misconfiguration:
|
||||
- terraform
|
||||
|
||||
# helm value override configurations
|
||||
# set individual values
|
||||
helm:
|
||||
# set individual values
|
||||
set:
|
||||
- securityContext.runAsUser=10001
|
||||
|
||||
# set values with file
|
||||
helm:
|
||||
# set values with file
|
||||
values:
|
||||
- overrides.yaml
|
||||
|
||||
# set specific values from specific files
|
||||
helm:
|
||||
# set specific values from specific files
|
||||
set-file:
|
||||
- image=dev-overrides.yaml
|
||||
|
||||
# set as string and preserve type
|
||||
helm:
|
||||
# set as string and preserve type
|
||||
set-string:
|
||||
- name=true
|
||||
|
||||
# Available API versions used for Capabilities.APIVersions. This flag is the same as the api-versions flag of the helm template command.
|
||||
api-versions:
|
||||
- policy/v1/PodDisruptionBudget
|
||||
- apps/v1/Deployment
|
||||
|
||||
# Kubernetes version used for Capabilities.KubeVersion. This flag is the same as the kube-version flag of the helm template command.
|
||||
kube-version: "v1.21.0"
|
||||
|
||||
# terraform tfvars overrrides
|
||||
terraform:
|
||||
vars:
|
||||
- dev-terraform.tfvars
|
||||
- common-terraform.tfvars
|
||||
|
||||
# Same as '--tf-exclude-downloaded-modules'
|
||||
# Default is false
|
||||
terraform:
|
||||
# Same as '--tf-exclude-downloaded-modules'
|
||||
# Default is false
|
||||
exclude-downloaded-modules: false
|
||||
|
||||
# Same as '--cf-params'
|
||||
# Default is false
|
||||
cloudformation:
|
||||
params:
|
||||
- params.json
|
||||
```
|
||||
|
||||
## Kubernetes Options
|
||||
@@ -318,6 +448,58 @@ kubernetes:
|
||||
# Same as '--namespace'
|
||||
# Default is empty
|
||||
namespace:
|
||||
|
||||
# Same as '--kubeconfig'
|
||||
# Default is empty
|
||||
kubeconfig: ~/.kube/config2
|
||||
|
||||
# Same as '--components'
|
||||
# Default is 'workload,infra'
|
||||
components:
|
||||
- workload
|
||||
- infra
|
||||
|
||||
# Same as '--k8s-version'
|
||||
# Default is empty
|
||||
k8s-version: 1.21.0
|
||||
|
||||
# Same as '--tolerations'
|
||||
# Default is empty
|
||||
tolerations:
|
||||
- key1=value1:NoExecute
|
||||
- key2=value2:NoSchedule
|
||||
|
||||
# Same as '--all-namespaces'
|
||||
# Default is false
|
||||
all-namespaces: false
|
||||
|
||||
node-collector:
|
||||
# Same as '--node-collector-namespace'
|
||||
# Default is 'trivy-temp'
|
||||
namespace: ~/.kube/config2
|
||||
|
||||
# Same as '--node-collector-imageref'
|
||||
# Default is 'ghcr.io/aquasecurity/node-collector:0.0.9'
|
||||
imageref: ghcr.io/aquasecurity/node-collector:0.0.9
|
||||
|
||||
exclude:
|
||||
# Same as '--exclude-owned'
|
||||
# Default is false
|
||||
owned: true
|
||||
|
||||
# Same as '--exclude-nodes'
|
||||
# Default is empty
|
||||
nodes:
|
||||
- kubernetes.io/arch:arm64
|
||||
- team:dev
|
||||
|
||||
# Same as '--qps'
|
||||
# Default is 5.0
|
||||
qps: 5.0
|
||||
|
||||
# Same as '--burst'
|
||||
# Default is 10
|
||||
burst: 10
|
||||
```
|
||||
|
||||
## Repository Options
|
||||
@@ -388,6 +570,35 @@ cloud:
|
||||
|
||||
# the aws account to use (this will be determined from your environment when not set)
|
||||
account: 123456789012
|
||||
|
||||
# the aws specific services
|
||||
service:
|
||||
- s3
|
||||
- ec2
|
||||
|
||||
# the aws specific arn
|
||||
arn: arn:aws:s3:::example-bucket
|
||||
|
||||
# skip the aws specific services
|
||||
skip-service:
|
||||
- s3
|
||||
- ec2
|
||||
```
|
||||
|
||||
## Module Options
|
||||
Available for modules
|
||||
|
||||
```yaml
|
||||
module:
|
||||
# Same as '--module-dir'
|
||||
# Default is '$HOME/.trivy/modules'
|
||||
dir: $HOME/.trivy/modules
|
||||
|
||||
# Same as '--enable-modules'
|
||||
# Default is empty
|
||||
enable-modules:
|
||||
- trivy-module-spring4shell
|
||||
- trivy-module-wordpress
|
||||
```
|
||||
|
||||
[example]: https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/examples/trivy-conf/trivy.yaml
|
||||
|
||||
@@ -22,18 +22,16 @@ Check out [the coverage document][coverage] for details.
|
||||
To enable extended license scanning, you can use `--license-full`.
|
||||
In addition to package licenses, Trivy scans source code files, Markdown documents, text files and `LICENSE` documents to identify license usage within the image or filesystem.
|
||||
|
||||
By default, Trivy only classifies licenses that are matched with a confidence level of 0.9 or more by the classifer.
|
||||
By default, Trivy only classifies licenses that are matched with a confidence level of 0.9 or more by the classifier.
|
||||
To configure the confidence level, you can use `--license-confidence-level`. This enables us to classify licenses that might be matched with a lower confidence level by the classifer.
|
||||
|
||||
!!! note
|
||||
The full license scanning is expensive. It takes a while.
|
||||
|
||||
Currently, the standard license scanning doesn't support filesystem and repository scanning.
|
||||
|
||||
| License scanning | Image | Rootfs | Filesystem | Repository |
|
||||
| :-------------------: | :---: | :----: | :--------: | :--------: |
|
||||
| Standard | ✅ | ✅ | - | - |
|
||||
| Full (--license-full) | ✅ | ✅ | ✅ | ✅ |
|
||||
| License scanning | Image | Rootfs | Filesystem | Repository | SBOM |
|
||||
|:---------------------:|:-----:|:------:|:----------:|:----------:|:----:|
|
||||
| Standard | ✅ | ✅ | ✅[^1][^2] | ✅[^1][^2] | ✅ |
|
||||
| Full (--license-full) | ✅ | ✅ | ✅ | ✅ | - |
|
||||
|
||||
License checking classifies the identified licenses and map the classification to severity.
|
||||
|
||||
@@ -344,6 +342,8 @@ license:
|
||||
permissive: []
|
||||
```
|
||||
|
||||
[^1]: See the list of supported language files [here](../coverage/language/index.md).
|
||||
[^2]: Some lock files require additional files (e.g. files from the cache directory) to detect licenses. Check [coverage][coverage] for more information.
|
||||
|
||||
[coverage]: ../coverage/index.md
|
||||
[google-license-classification]: https://opensource.google/documentation/reference/thirdparty/licenses
|
||||
|
||||
21
docs/docs/scanner/misconfiguration/check/builtin.md
Normal file
21
docs/docs/scanner/misconfiguration/check/builtin.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Built-in Checks
|
||||
|
||||
## Check Sources
|
||||
Built-in checks are mainly written in [Rego][rego] and Go.
|
||||
Those checks are managed under [trivy-checks repository][trivy-checks].
|
||||
See [here](../../../coverage/iac/index.md) for the list of supported config types.
|
||||
|
||||
For suggestions or issues regarding policy content, please open an issue under the [trivy-checks][trivy-checks] repository.
|
||||
|
||||
## Check Distribution
|
||||
Trivy checks are distributed as an OPA bundle on [GitHub Container Registry][ghcr] (GHCR).
|
||||
When misconfiguration detection is enabled, Trivy pulls the OPA bundle from GHCR as an OCI artifact and stores it in the cache.
|
||||
Those checks are then loaded into Trivy OPA engine and used for detecting misconfigurations.
|
||||
If Trivy is unable to pull down newer checks, it will use the embedded set of checks as a fallback. This is also the case in air-gap environments where `--skip-policy-update` might be passed.
|
||||
|
||||
## Update Interval
|
||||
Trivy checks for updates to OPA bundle on GHCR every 24 hours and pulls it if there are any updates.
|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
[trivy-checks]: https://github.com/aquasecurity/trivy-checks
|
||||
[ghcr]: https://github.com/aquasecurity/trivy-checks/pkgs/container/trivy-checks
|
||||
@@ -28,8 +28,6 @@ The `exception` rule must be defined under `namespace.exceptions`.
|
||||
|
||||
This example exempts all built-in policies for Kubernetes.
|
||||
|
||||
For more details, see [an example][ns-example].
|
||||
|
||||
## Rule-based exceptions
|
||||
There are some cases where you need more flexibility and granularity in defining which cases to exempt.
|
||||
Rule-based exceptions lets you granularly choose which individual rules to exempt, while also declaring under which conditions to exempt them.
|
||||
@@ -87,12 +85,8 @@ If you want to apply rule-based exceptions to built-in policies, you have to def
|
||||
}
|
||||
```
|
||||
|
||||
This exception is applied to [KSV012][ksv012] in trivy-policies.
|
||||
You can get the package names in the [trivy-policies repository][trivy-policies] or the JSON output from Trivy.
|
||||
This exception is applied to [KSV012][ksv012] in trivy-checks.
|
||||
You can get the package names in the [trivy-checks repository][trivy-checks] or the JSON output from Trivy.
|
||||
|
||||
For more details, see [an example][rule-example].
|
||||
|
||||
[ns-example]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/namespace-exception
|
||||
[rule-example]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/rule-exception
|
||||
[ksv012]: https://github.com/aquasecurity/trivy-policies/blob/main/rules/kubernetes/policies/pss/restricted/3_runs_as_root.rego
|
||||
[trivy-policies]: https://github.com/aquasecurity/trivy-policies/
|
||||
[ksv012]: https://github.com/aquasecurity/trivy-checks/blob/f36a5b732c4b1293a720c40baab0a7c106ea455e/checks/kubernetes/pss/restricted/3_runs_as_root.rego
|
||||
[trivy-checks]: https://github.com/aquasecurity/trivy-checks/
|
||||
@@ -27,7 +27,7 @@ In the above general file formats, Trivy automatically identifies the following
|
||||
- CloudFormation (JSON/YAML)
|
||||
- Kubernetes (JSON/YAML)
|
||||
- Helm (YAML)
|
||||
- Terraform Plan (JSON)
|
||||
- Terraform Plan (JSON/Snapshot)
|
||||
|
||||
This is useful for filtering inputs, as described below.
|
||||
|
||||
@@ -101,9 +101,8 @@ In this case, `user.*` will be evaluated.
|
||||
Any package prefixes such as `main` and `user` are allowed.
|
||||
|
||||
### Metadata
|
||||
Metadata helps enrich Trivy's scan results with useful information.
|
||||
|
||||
The annotation format is described in the [OPA documentation](https://www.openpolicyagent.org/docs/latest/annotations/).
|
||||
The check must contain a [Rego Metadata](https://www.openpolicyagent.org/docs/latest/policy-language/#metadata) section. Trivy uses standard rego metadata to define the new policy and general information about it.
|
||||
|
||||
Trivy supports extra fields in the `custom` section as described below.
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
Policies can be defined with custom schemas that allow inputs to be verified against them. Adding a policy schema
|
||||
enables Trivy to show more detailed error messages when an invalid input is encountered.
|
||||
|
||||
In Trivy we have been able to define a schema for a [Dockerfile](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/dockerfile.json)
|
||||
Without input schemas, a policy would be as follows:
|
||||
In Trivy we have been able to define a schema for a [Dockerfile](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json). Without input schemas, a policy would be as follows:
|
||||
|
||||
!!! example
|
||||
```
|
||||
@@ -36,7 +35,7 @@ schema as such
|
||||
```
|
||||
|
||||
Here `input: schema["dockerfile"]` points to a schema that expects a valid `Dockerfile` as input. An example of this
|
||||
can be found [here](https://github.com/aquasecurity/defsec/blob/master/pkg/rego/schemas/dockerfile.json)
|
||||
can be found [here](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json).
|
||||
|
||||
Now if this policy is evaluated against, a more descriptive error will be available to help fix the problem.
|
||||
|
||||
@@ -50,9 +49,9 @@ Now if this policy is evaluated against, a more descriptive error will be availa
|
||||
|
||||
Currently, out of the box the following schemas are supported natively:
|
||||
|
||||
1. [Docker](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/dockerfile.json)
|
||||
2. [Kubernetes](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/kubernetes.json)
|
||||
3. [Cloud](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/cloud.json)
|
||||
1. [Docker](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json)
|
||||
2. [Kubernetes](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/kubernetes.json)
|
||||
3. [Cloud](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/cloud.json)
|
||||
|
||||
|
||||
## Custom Policies with Custom Schemas
|
||||
@@ -89,4 +88,4 @@ To use such a policy with Trivy, use the `--config-policy` flag that points to t
|
||||
$ trivy --config-policy=/Users/user/my-custom-policies <path/to/iac>
|
||||
```
|
||||
|
||||
For more details on how to define schemas within Rego policies, please see the [OPA guide](https://www.openpolicyagent.org/docs/latest/schemas/#schema-annotations) that describes it in more detail.
|
||||
For more details on how to define schemas within Rego policies, please see the [OPA guide](https://www.openpolicyagent.org/docs/latest/policy-language/#schema-annotations) that describes it in more detail.
|
||||
@@ -22,7 +22,7 @@ For more details, see [Policy Testing][opa-testing].
|
||||
}
|
||||
```
|
||||
|
||||
To write tests for custom policies, you can refer to existing tests under [trivy-policies][trivy-policies].
|
||||
To write tests for custom policies, you can refer to existing tests under [trivy-checks][trivy-checks].
|
||||
|
||||
## Go testing
|
||||
[Fanal][fanal] which is a core library of Trivy can be imported as a Go library.
|
||||
@@ -85,6 +85,6 @@ The following example stores allowed and denied configuration files in a directo
|
||||
`Dockerfile.allowed` has one successful result in `Successes`, while `Dockerfile.denied` has one failure result in `Failures`.
|
||||
|
||||
[opa-testing]: https://www.openpolicyagent.org/docs/latest/policy-testing/
|
||||
[defsec]: https://github.com/aquasecurity/trivy-policies/tree/main
|
||||
[defsec]: https://github.com/aquasecurity/trivy-checks/tree/main
|
||||
[table]: https://github.com/golang/go/wiki/TableDrivenTests
|
||||
[fanal]: https://github.com/aquasecurity/fanal
|
||||
@@ -6,7 +6,7 @@ In addition to built-in policies, you can write your own custom policies, as you
|
||||
|
||||
Simply specify a directory containing IaC files such as Terraform, CloudFormation, Azure ARM templates, Helm Charts and Dockerfile.
|
||||
|
||||
``` bash
|
||||
```bash
|
||||
$ trivy config [YOUR_IaC_DIRECTORY]
|
||||
```
|
||||
|
||||
@@ -316,15 +316,17 @@ This section describes misconfiguration-specific configuration.
|
||||
Other common options are documented [here](../../configuration/index.md).
|
||||
|
||||
### Enabling a subset of misconfiguration scanners
|
||||
It's possible to only enable certain misconfiguration scanners if you prefer. You can do so by passing the `--misconfig-scanners` option.
|
||||
It's possible to only enable certain misconfiguration scanners if you prefer.
|
||||
You can do so by passing the `--misconfig-scanners` option.
|
||||
This flag takes a comma-separated list of configuration scanner types.
|
||||
|
||||
```bash
|
||||
trivy config --misconfig-scanners=terraform,dockerfile .
|
||||
```
|
||||
|
||||
Will only scan for misconfigurations that pertain to Terraform and Dockerfiles.
|
||||
|
||||
### Pass custom policies
|
||||
### Passing custom policies
|
||||
You can pass policy files or directories including your custom policies through `--policy` option.
|
||||
This can be repeated for specifying multiple files or directories.
|
||||
|
||||
@@ -338,7 +340,7 @@ For more details, see [Custom Policies](./custom/index.md).
|
||||
!!! tip
|
||||
You also need to specify `--namespaces` option.
|
||||
|
||||
### Pass custom data
|
||||
### Passing custom data
|
||||
You can pass directories including your custom data through `--data` option.
|
||||
This can be repeated for specifying multiple directories.
|
||||
|
||||
@@ -349,7 +351,7 @@ trivy conf --policy ./policy --data ./data --namespaces user ./configs
|
||||
|
||||
For more details, see [Custom Data](./custom/data.md).
|
||||
|
||||
### Pass namespaces
|
||||
### Passing namespaces
|
||||
By default, Trivy evaluates policies defined in `builtin.*`.
|
||||
If you want to evaluate custom policies in other packages, you have to specify package prefixes through `--namespaces` option.
|
||||
This can be repeated for specifying multiple packages.
|
||||
@@ -358,4 +360,202 @@ This can be repeated for specifying multiple packages.
|
||||
trivy conf --policy ./policy --namespaces main --namespaces user ./configs
|
||||
```
|
||||
|
||||
[custom]: custom/index.md
|
||||
### Private terraform registries
|
||||
Trivy can download terraform code from private registries.
|
||||
To pass credentials you must use the `TF_TOKEN_` environment variables.
|
||||
You cannot use a `.terraformrc` or `terraform.rc` file, these are not supported by trivy yet.
|
||||
|
||||
From the terraform [docs](https://developer.hashicorp.com/terraform/cli/config/config-file#environment-variable-credentials):
|
||||
|
||||
> Environment variable names should have the prefix TF_TOKEN_ added to the domain name, with periods encoded as underscores.
|
||||
> For example, the value of a variable named `TF_TOKEN_app_terraform_io` will be used as a bearer authorization token when the CLI makes service requests to the hostname `app.terraform.io`.
|
||||
>
|
||||
> You must convert domain names containing non-ASCII characters to their punycode equivalent with an ACE prefix.
|
||||
> For example, token credentials for `例えば.com` must be set in a variable called `TF_TOKEN_xn--r8j3dr99h_com`.
|
||||
>
|
||||
> Hyphens are also valid within host names but usually invalid as variable names and may be encoded as double underscores.
|
||||
> For example, you can set a token for the domain name café.fr as TF_TOKEN_xn--caf-dma_fr or TF_TOKEN_xn____caf__dma_fr.
|
||||
|
||||
If multiple variables evaluate to the same hostname, Trivy will choose the environment variable name where the dashes have not been encoded as double underscores.
|
||||
|
||||
|
||||
### Skipping resources by inline comments
|
||||
|
||||
Trivy supports ignoring misconfigured resources by inline comments for Terraform and CloudFormation configuration files only.
|
||||
|
||||
In cases where Trivy can detect comments of a specific format immediately adjacent to resource definitions, it is possible to ignore findings from a single source of resource definition (in contrast to `.trivyignore`, which has a directory-wide scope on all of the files scanned). The format for these comments is `trivy:ignore:<rule>` immediately following the format-specific line-comment [token](https://developer.hashicorp.com/terraform/language/syntax/configuration#comments).
|
||||
|
||||
The ignore rule must contain one of the possible check IDs that can be found in its metadata: ID, short code or alias. The `id` from the metadata is not case-sensitive, so you can specify, for example, `AVD-AWS-0089` or `avd-aws-0089`.
|
||||
|
||||
For example, to ignore a misconfiguration ID `AVD-GCP-0051` in a Terraform HCL file:
|
||||
|
||||
```terraform
|
||||
#trivy:ignore:AVD-GCP-0051
|
||||
resource "google_container_cluster" "example" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
}
|
||||
```
|
||||
|
||||
You can add multiple ignores on the same comment line:
|
||||
```terraform
|
||||
#trivy:ignore:AVD-GCP-0051 trivy:ignore:AVD-GCP-0053
|
||||
resource "google_container_cluster" "example" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
}
|
||||
```
|
||||
|
||||
You can also specify a long ID, which is formed as follows: `<provider>-<service>-<short-code>`.
|
||||
|
||||
As an example, consider the following check metadata:
|
||||
|
||||
```yaml
|
||||
# custom:
|
||||
# id: AVD-AWS-0089
|
||||
# avd_id: AVD-AWS-0089
|
||||
# provider: aws
|
||||
# service: s3
|
||||
# severity: LOW
|
||||
# short_code: enable-logging
|
||||
```
|
||||
|
||||
Long ID would look like the following: `aws-s3-enable-logging`.
|
||||
|
||||
Example for CloudFromation:
|
||||
```yaml
|
||||
AWSTemplateFormatVersion: "2010-09-09"
|
||||
Resources:
|
||||
#trivy:ignore:*
|
||||
S3Bucket:
|
||||
Type: 'AWS::S3::Bucket'
|
||||
Properties:
|
||||
BucketName: test-bucket
|
||||
```
|
||||
|
||||
#### Expiration Date
|
||||
|
||||
You can specify the expiration date of the ignore rule in `yyyy-mm-dd` format. This is a useful feature when you want to make sure that an ignored issue is not forgotten and worth revisiting in the future. For example:
|
||||
```tf
|
||||
#trivy:ignore:aws-s3-enable-logging:exp:2024-03-10
|
||||
resource "aws_s3_bucket" "example" {
|
||||
bucket = "test"
|
||||
}
|
||||
```
|
||||
|
||||
The `aws-s3-enable-logging` check will be ignored until `2024-03-10` until the ignore rule expires.
|
||||
|
||||
#### Ignoring by attributes
|
||||
|
||||
You can ignore a resource by its attribute value. This is useful when using the `for-each` meta-argument. For example:
|
||||
|
||||
```tf
|
||||
locals {
|
||||
ports = ["3306", "5432"]
|
||||
}
|
||||
|
||||
#trivy:ignore:aws-ec2-no-public-ingress-sgr[from_port=3306]
|
||||
resource "aws_security_group_rule" "example" {
|
||||
for_each = toset(local.ports)
|
||||
type = "ingress"
|
||||
from_port = each.key
|
||||
to_port = each.key
|
||||
protocol = "TCP"
|
||||
cidr_blocks = ["0.0.0.0/0"]
|
||||
security_group_id = aws_security_group.example.id
|
||||
source_security_group_id = aws_security_group.example.id
|
||||
}
|
||||
```
|
||||
|
||||
The `aws-ec2-no-public-ingress-sgr` check will be ignored only for the `aws_security_group_rule` resource with port number `5432`. It is important to note that the ignore rule should not enclose the attribute value in quotes, despite the fact that the port is represented as a string.
|
||||
|
||||
If you want to ignore multiple resources on different attributes, you can specify multiple ignore rules:
|
||||
|
||||
```tf
|
||||
#trivy:ignore:aws-ec2-no-public-ingress-sgr[from_port=3306]
|
||||
#trivy:ignore:aws-ec2-no-public-ingress-sgr[from_port=5432]
|
||||
```
|
||||
|
||||
You can also ignore a resource on multiple attributes:
|
||||
```tf
|
||||
locals {
|
||||
rules = {
|
||||
first = {
|
||||
port = 1000
|
||||
type = "ingress"
|
||||
},
|
||||
second = {
|
||||
port = 1000
|
||||
type = "egress"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#trivy:ignore:aws-ec2-no-public-ingress-sgr[from_port=1000,type=egress]
|
||||
resource "aws_security_group_rule" "example" {
|
||||
for_each = { for k, v in local.rules : k => v }
|
||||
|
||||
type = each.value.type
|
||||
from_port = each.value.port
|
||||
to_port = each.value.port
|
||||
protocol = "TCP"
|
||||
cidr_blocks = ["0.0.0.0/0"]
|
||||
security_group_id = aws_security_group.example.id
|
||||
source_security_group_id = aws_security_group.example.id
|
||||
}
|
||||
```
|
||||
|
||||
Checks can also be ignored by nested attributes, but certain restrictions apply:
|
||||
|
||||
- You cannot access an individual block using indexes, for example when working with dynamic blocks.
|
||||
- Special variables like [each](https://developer.hashicorp.com/terraform/language/meta-arguments/for_each#the-each-object) and [count](https://developer.hashicorp.com/terraform/language/meta-arguments/count#the-count-object) cannot be accessed.
|
||||
|
||||
```tf
|
||||
#trivy:ignore:*[logging_config.prefix=myprefix]
|
||||
resource "aws_cloudfront_distribution" "example" {
|
||||
logging_config {
|
||||
include_cookies = false
|
||||
bucket = "mylogs.s3.amazonaws.com"
|
||||
prefix = "myprefix"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Ignoring module issues
|
||||
|
||||
Issues in third-party modules cannot be ignored using the method described above, because you may not have access to modify the module source code. In such a situation you can add ignore rules above the module block, for example:
|
||||
|
||||
```tf
|
||||
#trivy:ignore:aws-s3-enable-logging
|
||||
module "s3_bucket" {
|
||||
source = "terraform-aws-modules/s3-bucket/aws"
|
||||
|
||||
bucket = "my-s3-bucket"
|
||||
}
|
||||
```
|
||||
|
||||
An example of ignoring checks for a specific bucket in a module:
|
||||
```tf
|
||||
locals {
|
||||
bucket = ["test1", "test2"]
|
||||
}
|
||||
|
||||
#trivy:ignore:*[bucket=test1]
|
||||
module "s3_bucket" {
|
||||
for_each = toset(local.bucket)
|
||||
source = "terraform-aws-modules/s3-bucket/aws"
|
||||
bucket = each.value
|
||||
}
|
||||
```
|
||||
|
||||
#### Support for Wildcards
|
||||
|
||||
You can use wildcards in the `ws` (workspace) and `ignore` sections of the ignore rules.
|
||||
|
||||
```tf
|
||||
# trivy:ignore:aws-s3-*:ws:dev-*
|
||||
```
|
||||
|
||||
This example ignores all checks starting with `aws-s3-` for workspaces matching the pattern `dev-*`.
|
||||
|
||||
[custom]: custom/index.md
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Built-in Policies
|
||||
|
||||
## Policy Sources
|
||||
Built-in policies are mainly written in [Rego][rego] and Go.
|
||||
Those policies are managed under [trivy-policies repository][trivy-policies].
|
||||
See [here](../../../coverage/iac/index.md) for the list of supported config types.
|
||||
|
||||
For suggestions or issues regarding policy content, please open an issue under the [trivy-policies][trivy-policies] repository.
|
||||
|
||||
## Policy Distribution
|
||||
Trivy policies are distributed as an OPA bundle on [GitHub Container Registry][ghcr] (GHCR).
|
||||
When misconfiguration detection is enabled, Trivy pulls the OPA bundle from GHCR as an OCI artifact and stores it in the cache.
|
||||
Those policies are then loaded into Trivy OPA engine and used for detecting misconfigurations.
|
||||
If Trivy is unable to pull down newer policies, it will use the embedded set of policies as a fallback. This is also the case in air-gap environments where `--skip-policy-update` might be passed.
|
||||
|
||||
## Update Interval
|
||||
Trivy checks for updates to OPA bundle on GHCR every 24 hours and pulls it if there are any updates.
|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
|
||||
[kubernetes-policies]: https://github.com/aquasecurity/trivy-policies/tree/main/rules/kubernetes/policies
|
||||
[docker-policies]: https://github.com/aquasecurity/trivy-policies/tree/main/rules/docker/policies
|
||||
[trivy-policies]: https://github.com/aquasecurity/trivy-policies
|
||||
[ghcr]: https://github.com/aquasecurity/trivy-policies/pkgs/container/trivy-policies
|
||||
@@ -91,6 +91,7 @@ See [here](../coverage/language/index.md#supported-languages) for the supported
|
||||
| | [GitHub Advisory Database (npm)][nodejs-ghsa] | ✅ | - |
|
||||
| Java | [GitHub Advisory Database (Maven)][java-ghsa] | ✅ | - |
|
||||
| Go | [GitHub Advisory Database (Go)][go-ghsa] | ✅ | - |
|
||||
| | [Go Vulnerability Database][go-vulndb] | ✅ | - |
|
||||
| Rust | [Open Source Vulnerabilities (crates.io)][rust-osv] | ✅ | - |
|
||||
| .NET | [GitHub Advisory Database (NuGet)][dotnet-ghsa] | ✅ | - |
|
||||
| C/C++ | [GitLab Advisories Community][gitlab] | ✅ | 1 month |
|
||||
@@ -152,6 +153,76 @@ The default is `ghcr.io/aquasecurity/trivy-java-db`.
|
||||
If authentication is required, you need to run `docker login YOUR_REGISTRY`.
|
||||
Currently, specifying a username and password is not supported.
|
||||
|
||||
## Configuration
|
||||
This section describes vulnerability-specific configuration.
|
||||
Other common options are documented [here](../configuration/index.md).
|
||||
|
||||
### Enabling a subset of package types
|
||||
It's possible to only enable certain package types if you prefer.
|
||||
You can do so by passing the `--vuln-type` option.
|
||||
This flag takes a comma-separated list of package types.
|
||||
|
||||
Available values:
|
||||
|
||||
- os
|
||||
- Scan OS packages managed by the OS package manager (e.g. `dpkg`, `yum`, `apk`).
|
||||
- library
|
||||
- Scan language-specific packages (e.g. packages installed by `pip`, `npm`, or `gem`).
|
||||
|
||||
```bash
|
||||
$ trivy image --vuln-type os ruby:2.4.0
|
||||
```
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```bash
|
||||
2019-05-22T19:36:50.530+0200 [34mINFO[0m Updating vulnerability database...
|
||||
2019-05-22T19:36:51.681+0200 [34mINFO[0m Detecting Alpine vulnerabilities...
|
||||
2019-05-22T19:36:51.685+0200 [34mINFO[0m Updating npm Security DB...
|
||||
2019-05-22T19:36:52.389+0200 [34mINFO[0m Detecting npm vulnerabilities...
|
||||
2019-05-22T19:36:52.390+0200 [34mINFO[0m Updating pipenv Security DB...
|
||||
2019-05-22T19:36:53.406+0200 [34mINFO[0m Detecting pipenv vulnerabilities...
|
||||
|
||||
ruby:2.4.0 (debian 8.7)
|
||||
=======================
|
||||
Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| curl | CVE-2018-14618 | CRITICAL | 7.61.0-r0 | 7.61.1-r0 | curl: NTLM password overflow |
|
||||
| | | | | | via integer overflow |
|
||||
+ +------------------+----------+ +---------------+----------------------------------+
|
||||
| | CVE-2018-16839 | HIGH | | 7.61.1-r1 | curl: Integer overflow leading |
|
||||
| | | | | | to heap-based buffer overflow in |
|
||||
| | | | | | Curl_sasl_create_plain_message() |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| git | CVE-2018-17456 | HIGH | 2.15.2-r0 | 2.15.3-r0 | git: arbitrary code execution |
|
||||
| | | | | | via .gitmodules |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2018-19486 | | | | git: Improper handling of |
|
||||
| | | | | | PATH allows for commands to be |
|
||||
| | | | | | executed from... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| libssh2 | CVE-2019-3855 | CRITICAL | 1.8.0-r2 | 1.8.1-r0 | libssh2: Integer overflow in |
|
||||
| | | | | | transport read resulting in |
|
||||
| | | | | | out of bounds write... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| sqlite | CVE-2018-20346 | MEDIUM | 3.21.0-r1 | 3.25.3-r0 | CVE-2018-20505 CVE-2018-20506 |
|
||||
| | | | | | sqlite: Multiple flaws in |
|
||||
| | | | | | sqlite which can be triggered |
|
||||
| | | | | | via... |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| tar | CVE-2018-20482 | LOW | 1.29-r1 | 1.31-r0 | tar: Infinite read loop in |
|
||||
| | | | | | sparse_dump_region function in |
|
||||
| | | | | | sparse.c |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
[^1]: https://github.com/GoogleContainerTools/distroless
|
||||
|
||||
[nvd-CVE-2023-0464]: https://nvd.nist.gov/vuln/detail/CVE-2023-0464
|
||||
@@ -185,6 +256,7 @@ Currently, specifying a username and password is not supported.
|
||||
[go-ghsa]: https://github.com/advisories?query=ecosystem%3Ago
|
||||
[swift-ghsa]: https://github.com/advisories?query=ecosystem%3Aswift
|
||||
|
||||
[go-vulndb]: https://pkg.go.dev/vuln/
|
||||
[php]: https://github.com/FriendsOfPHP/security-advisories
|
||||
[ruby]: https://github.com/rubysec/ruby-advisory-db
|
||||
[nodejs]: https://github.com/nodejs/security-wg
|
||||
|
||||
@@ -110,7 +110,7 @@ It is disabled by default.
|
||||
You can enable it with `--image-config-scanners config`.
|
||||
|
||||
```
|
||||
$ trivy image --image-config-scanners config [YOUR_IMAGE_NAME]
|
||||
$ trivy image --image-config-scanners misconfig [YOUR_IMAGE_NAME]
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -500,3 +500,10 @@ You can configure Docker daemon socket with `DOCKER_HOST` or `--docker-host`.
|
||||
```shell
|
||||
$ trivy image --docker-host tcp://127.0.0.1:2375 YOUR_IMAGE
|
||||
```
|
||||
|
||||
### Configure Podman daemon socket to connect to.
|
||||
You can configure Podman daemon socket with `--podman-host`.
|
||||
|
||||
```shell
|
||||
$ trivy image --podman-host /run/user/1000/podman/podman.sock YOUR_IMAGE
|
||||
```
|
||||
|
||||
@@ -9,7 +9,7 @@ Trivy can also be installed *inside* your cluster as a Kubernetes Operator, and
|
||||
When scanning a Kubernetes cluster, Trivy differentiates between the following:
|
||||
|
||||
1. Cluster infrastructure (e.g api-server, kubelet, addons)
|
||||
1. Cluster configuration (e.g Roles, ClusterRoles).
|
||||
1. Cluster configuration (e.g Roles, ClusterRoles).
|
||||
1. Application workloads (e.g nginx, postgresql).
|
||||
|
||||
When scanning any of the above, the container image is scanned separately to the Kubernetes resource definition (the YAML manifest) that defines the resource.
|
||||
@@ -28,60 +28,79 @@ Kubernetes resource definition is scanned for:
|
||||
|
||||
## Kubernetes target configurations
|
||||
|
||||
Trivy follows the behavior of the `kubectl` tool as much as possible.
|
||||
|
||||
### Scope
|
||||
|
||||
The command expects an argument that selects the scope of the scan (similarly to how `kubectl` expects an argument after `kubectl get`). This argument can be:
|
||||
1. A Kubernetes Kind. e.g `pod`, `deployment`, etc.
|
||||
2. A Kubernetes Resource. e.g `pods/mypod`, etc.
|
||||
3. `all`. Scan common workload kinds, as listed [here](https://github.com/aquasecurity/trivy-kubernetes/blob/bf8cc2a00d9772e0aa271f06d375b936152b54b1/pkg/k8s/k8s.go#L296:L314)
|
||||
4. `cluster` scan the entire cluster including all namespaced resources and cluster level resources.
|
||||
|
||||
Examples:
|
||||
|
||||
```
|
||||
trivy k8s all
|
||||
trivy k8s pods
|
||||
trivy k8s deploy myapp
|
||||
trivy k8s pod/mypod
|
||||
trivy k8s pods,deploy
|
||||
trivy k8s cluster
|
||||
```sh
|
||||
trivy k8s [flags] [CONTEXT] - if the target name [CONTEXT] is not specified, the default will be used.
|
||||
```
|
||||
|
||||
Note that the scope argument must appear last in the command line, after any other flag.
|
||||
for example:
|
||||
|
||||
### Cluster
|
||||
```sh
|
||||
trivy k8s --report summary
|
||||
```
|
||||
|
||||
By default Trivy will look for a [`kubeconfig` configuration file in the default location](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/), and use the default cluster that is specified.
|
||||
You can also specify a `kubeconfig` using the `--kubeconfig` flag:
|
||||
|
||||
```
|
||||
```sh
|
||||
trivy k8s --kubeconfig ~/.kube/config2
|
||||
```
|
||||
|
||||
### Namespace
|
||||
By default, all cluster resource images will be downloaded and scanned.
|
||||
|
||||
By default Trivy will scan all namespaces (following `kubectl` behavior). To specify a namespace use the `--namespace` flag:
|
||||
### Skip-images
|
||||
|
||||
You can control whether Trivy will scan and download the cluster resource images. To disable this feature, add the --skip-images flag.
|
||||
|
||||
- `--skip-images` flag will prevent the downloading and scanning of images (including vulnerabilities and secrets) in the cluster resources.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --skip-images
|
||||
```
|
||||
trivy k8s --kubeconfig ~/.kube/config2 --namespace default
|
||||
```
|
||||
### Node
|
||||
|
||||
You can exclude specific nodes from the scan using the `--exclude-nodes` flag, which takes a label in the format `label-name:label-value` and excludes all matching nodes:
|
||||
### Include/Exclude Kinds
|
||||
|
||||
You can control which kinds of resources will be discovered using the `--include-kinds` or `--exclude-kinds` comma-separated flags:
|
||||
|
||||
***Note:*** Both flags (`--include-kinds` or `--exclude-kinds`) cannot be set in conjunction.
|
||||
|
||||
- `--include-kinds` will include the listed kinds in cluster scanning.
|
||||
- `--exclude-kinds` will exclude the listed kinds from cluster scanning.
|
||||
|
||||
By default, all kinds will be included in cluster scanning.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --exclude-kinds node,pod
|
||||
```
|
||||
trivy k8s cluster --report summary --exclude-nodes kubernetes.io/arch:arm6
|
||||
|
||||
### Include/Exclude Namespaces
|
||||
|
||||
You can control which namespaces will be discovered using the `--include-namespaces` or `--exclude-namespaces` comma-separated flags:
|
||||
|
||||
***Note:*** Both flags (`--include-namespaces` or `--exclude-namespaces`) cannot be set in conjunction.
|
||||
|
||||
- `--include-namespaces` will include the listed namespaces in cluster scanning.
|
||||
- `--exclude-namespaces` will exclude the listed namespaces from cluster scanning.
|
||||
|
||||
By default, all namespaces will be included in cluster scanning.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --exclude-namespace dev-system,staging-system
|
||||
```
|
||||
|
||||
## Control Plane and Node Components Vulnerability Scanning
|
||||
|
||||
Trivy is capable of discovering Kubernetes control plane (apiserver, controller-manager and etc) and node components(kubelet, kube-proxy and etc), matching them against the [official Kubernetes vulnerability database feed](https://github.com/aquasecurity/vuln-list-k8s), and reporting any vulnerabilities it finds
|
||||
Trivy is capable of discovering Kubernetes control plane (apiserver, controller-manager and etc) and node components(kubelet, kube-proxy and etc), matching them against the [official Kubernetes vulnerability database feed](https://github.com/aquasecurity/vuln-list-k8s), and reporting any vulnerabilities it finds.
|
||||
|
||||
To read more about KBOM, see the [documentation for Kubernetes scanning](./sbom.md#kbom).
|
||||
|
||||
```
|
||||
trivy k8s cluster --scanners vuln --report all
|
||||
```sh
|
||||
trivy k8s --scanners vuln --report all
|
||||
|
||||
NodeComponents/kind-control-plane (kubernetes)
|
||||
|
||||
@@ -101,13 +120,43 @@ Total: 3 (UNKNOWN: 0, LOW: 1, MEDIUM: 0, HIGH: 2, CRITICAL: 0)
|
||||
└────────────────┴────────────────┴──────────┴────────┴───────────────────┴──────────────────────────────────┴───────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Node-Collector
|
||||
|
||||
### Components types
|
||||
Node-collector is a scan job that collects node configuration parameters and permission information. This information will be evaluated against Kubernetes hardening (e.g. CIS benchmark) and best practices values. The scan results will be output in infrastructure assessment and CIS benchmark compliance reports.
|
||||
|
||||
You can control what kinds of components are discovered using the `--components` flag:
|
||||
- `--components infra` will discover only cluster infrastructure components.
|
||||
- `--components workloads` will discover only application workloads.
|
||||
- If the flag is omitted: infra, workloads, and RBAC are discovered.
|
||||
### Disable Node Collector
|
||||
|
||||
You can control whether the node scan-job (`node-collector`) will run in the cluster. To disable it, add the `--disable-node-collector` flag
|
||||
|
||||
- `--disable-node-collector` This flag will exclude findings related to Node (infra assessment) misconfigurations
|
||||
|
||||
By default, the node scan-job (`node-collector`) will run in the cluster.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --disable-node-collector
|
||||
```
|
||||
|
||||
### Taints and Tolerations
|
||||
|
||||
The node-collector scan-job will run on every node. In case the node has been tainted, it is possible to add toleration to the scan job for it to be scheduled on the tainted node. for more details [see k8s docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
|
||||
|
||||
- `--tolerations key1=value1:NoExecute,key2=value2:NoSchedule` this flag wil enable node-collector to be schedule on tainted Node
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --tolerations key1=value1:NoExecute,key2=value2:NoSchedule
|
||||
```
|
||||
|
||||
### Exclude Nodes by Label
|
||||
|
||||
You can exclude specific nodes from the scan using the `--exclude-nodes` flag, which takes a label in the format `label-name:label-value` and excludes all matching nodes:
|
||||
|
||||
```sh
|
||||
trivy k8s --report summary --exclude-nodes kubernetes.io/arch:arm6
|
||||
```
|
||||
|
||||
## Reporting and filtering
|
||||
|
||||
@@ -117,8 +166,8 @@ You can always choose the report granularity using the `--report summary`/`--rep
|
||||
|
||||
Scan a full cluster and generate a simple summary report:
|
||||
|
||||
```
|
||||
$ trivy k8s --report=summary cluster
|
||||
```sh
|
||||
trivy k8s --report=summary
|
||||
```
|
||||
|
||||

|
||||
@@ -126,15 +175,15 @@ $ trivy k8s --report=summary cluster
|
||||
Filter by severity:
|
||||
|
||||
```
|
||||
trivy k8s --severity=CRITICAL --report=all cluster
|
||||
trivy k8s --severity=CRITICAL --report=all
|
||||
```
|
||||
|
||||
Filter by scanners (Vulnerabilities, Secrets or Misconfigurations):
|
||||
|
||||
```
|
||||
trivy k8s --scanners=secret --report=summary cluster
|
||||
trivy k8s --scanners=secret --report=summary
|
||||
# or
|
||||
trivy k8s --scanners=misconfig --report=summary cluster
|
||||
trivy k8s --scanners=misconfig --report=summary
|
||||
```
|
||||
|
||||
The supported output formats are `table`, which is the default, and `json`.
|
||||
@@ -300,6 +349,7 @@ trivy k8s --format json -o results.json cluster
|
||||
</details>
|
||||
|
||||
## Compliance
|
||||
|
||||
This section describes Kubernetes specific compliance reports.
|
||||
For an overview of Trivy's Compliance feature, including working with custom compliance, check out the [Compliance documentation](../compliance/compliance.md).
|
||||
|
||||
@@ -318,7 +368,7 @@ Scan the cluster for Kubernetes Pod Security Standards Baseline compliance:
|
||||
|
||||
```
|
||||
|
||||
$ trivy k8s cluster --compliance=k8s-pss-baseline --report summary
|
||||
trivy k8s --compliance=k8s-pss-baseline --report summary
|
||||
|
||||
```
|
||||
|
||||
@@ -326,7 +376,7 @@ Get the detailed report for checks:
|
||||
|
||||
```
|
||||
|
||||
$ trivy k8s cluster --compliance=k8s-cis --report all
|
||||
trivy k8s --compliance=k8s-cis --report all
|
||||
|
||||
```
|
||||
|
||||
@@ -334,7 +384,7 @@ Get summary report in JSON format:
|
||||
|
||||
```
|
||||
|
||||
$ trivy k8s cluster --compliance=k8s-cis --report summary --format json
|
||||
trivy k8s --compliance=k8s-cis --report summary --format json
|
||||
|
||||
```
|
||||
|
||||
@@ -342,7 +392,7 @@ Get detailed report in JSON format:
|
||||
|
||||
```
|
||||
|
||||
$ trivy k8s cluster --compliance=k8s-cis --report all --format json
|
||||
trivy k8s --compliance=k8s-cis --report all --format json
|
||||
|
||||
```
|
||||
|
||||
@@ -355,7 +405,7 @@ Trivy can generate KBOM in CycloneDX format:
|
||||
|
||||
```sh
|
||||
|
||||
$ trivy k8s cluster --format cyclonedx --output mykbom.cdx.json
|
||||
trivy k8s --format cyclonedx --output mykbom.cdx.json
|
||||
|
||||
```
|
||||
|
||||
@@ -363,7 +413,7 @@ Trivy can also scan that generated KBOM (or any SBOM) for vulnerabilities:
|
||||
|
||||
```sh
|
||||
|
||||
$ trivy sbom mykbom.cdx.json
|
||||
trivy sbom mykbom.cdx.json
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# SBOM scanning
|
||||
|
||||
Trivy can take the following SBOM formats as an input and scan for vulnerabilities.
|
||||
Trivy can take the following SBOM formats as an input and scan for vulnerabilities and licenses.
|
||||
|
||||
- CycloneDX
|
||||
- SPDX
|
||||
@@ -17,6 +17,9 @@ $ trivy sbom /path/to/sbom_file
|
||||
|
||||
```
|
||||
|
||||
By default, vulnerability scan in SBOM is executed. You can use `--scanners vuln,license`
|
||||
command property to select also license scan, or `--scanners license` alone.
|
||||
|
||||
!!! note
|
||||
Passing SBOMs generated by tool other than Trivy may result in inaccurate detection
|
||||
because Trivy relies on custom properties in SBOM for accurate scanning.
|
||||
@@ -117,6 +120,11 @@ Total: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 2)
|
||||
|
||||
To read more about KBOM, see the [documentation for Kubernetes scanning](./kubernetes.md#KBOM).
|
||||
|
||||
The supported Kubernetes distributions for core components vulnerability scanning are:
|
||||
|
||||
- [Kubernetes upstream](https://github.com/kubernetes/kubernetes)
|
||||
- [Rancher rke2](https://github.com/rancher/rke2)
|
||||
|
||||
```sh
|
||||
|
||||
$ trivy k8s --format cyclonedx cluster -o kbom.json
|
||||
|
||||
@@ -79,3 +79,11 @@ You can use Trivy Resource in Concourse for scanning containers and introducing
|
||||
It has capabilities to fail the pipeline, create issues, alert communication channels (using respective resources) based on Trivy scan output.
|
||||
|
||||
👉 Get it at: <https://github.com/Comcast/trivy-resource/>
|
||||
|
||||
|
||||
## SecObserve GitHub actions and GitLab templates (Community)
|
||||
[SecObserve GitHub actions and GitLab templates](https://github.com/MaibornWolff/secobserve_actions_templates) run various vulnerability scanners, providing uniform methods and parameters for launching the tools.
|
||||
|
||||
The Trivy integration supports scanning Docker images and local filesystems for vulnerabilities as well as scanning IaC files for misconfigurations.
|
||||
|
||||
👉 Get it at: <https://github.com/MaibornWolff/secobserve_actions_templates>
|
||||
|
||||
@@ -1,21 +1,32 @@
|
||||
# Reporting
|
||||
|
||||
## SonarQube (Community)
|
||||
A Trivy plugin that converts JSON report to SonarQube [generic issues format](https://docs.sonarqube.org/9.6/analyzing-source-code/importing-external-issues/generic-issue-import-format/).
|
||||
|
||||
👉 Get it at: <https://github.com/umax/trivy-plugin-sonarqube>
|
||||
|
||||
## DefectDojo (Community)
|
||||
DefectDojo can parse Trivy JSON reports. The parser supports deduplication and auto-close features.
|
||||
|
||||
👉 Get it at: <https://github.com/DefectDojo/django-DefectDojo>
|
||||
|
||||
## SecObserve (Community)
|
||||
SecObserve can parse Trivy results as CycloneDX reports and provides an unified overview of vulnerabilities from different sources. Vulnerabilities can be evaluated with manual and rule based assessments.
|
||||
|
||||
👉 Get it at: <https://github.com/MaibornWolff/SecObserve>
|
||||
|
||||
## Scan2html (Community)
|
||||
A Trivy plugin that scans and outputs the results to an interactive html file.
|
||||
|
||||
👉 Get it at: <https://github.com/fatihtokus/scan2html>
|
||||
|
||||
## SonarQube (Community)
|
||||
A Trivy plugin that converts JSON report to SonarQube [generic issues format](https://docs.sonarqube.org/9.6/analyzing-source-code/importing-external-issues/generic-issue-import-format/).
|
||||
|
||||
👉 Get it at: <https://github.com/umax/trivy-plugin-sonarqube>
|
||||
|
||||
## Trivy-Streamlit (Community)
|
||||
Trivy-Streamlit is a Streamlit application that allows you to quickly parse the results from a Trivy JSON report.
|
||||
|
||||
👉 Get it at: <https://github.com/mfreeman451/trivy-streamlit>
|
||||
|
||||
## Trivy-Vulnerability-Explorer (Community)
|
||||
|
||||
This project is a web application that allows to load a Trivy report in json format and displays the vulnerabilities of a single target in an interactive data table.
|
||||
|
||||
👉 Get it at: <https://github.com/dbsystel/trivy-vulnerability-explorer>
|
||||
|
||||
@@ -10,11 +10,10 @@ In this section you will find an aggregation of the different ways to install Tr
|
||||
Add repository setting to `/etc/yum.repos.d`.
|
||||
|
||||
``` bash
|
||||
RELEASE_VERSION=$(grep -Po '(?<=VERSION_ID=")[0-9]' /etc/os-release)
|
||||
cat << EOF | sudo tee -a /etc/yum.repos.d/trivy.repo
|
||||
[trivy]
|
||||
name=Trivy repository
|
||||
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/
|
||||
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/\$basearch/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=https://aquasecurity.github.io/trivy-repo/rpm/public.key
|
||||
@@ -35,9 +34,9 @@ In this section you will find an aggregation of the different ways to install Tr
|
||||
Add repository setting to `/etc/apt/sources.list.d`.
|
||||
|
||||
``` bash
|
||||
sudo apt-get install wget apt-transport-https gnupg lsb-release
|
||||
sudo apt-get install wget apt-transport-https gnupg
|
||||
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
|
||||
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb generic main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install trivy
|
||||
```
|
||||
@@ -86,31 +85,79 @@ References:
|
||||
Nix package manager for Linux and MacOS.
|
||||
|
||||
=== "Command line"
|
||||
|
||||
`nix-env --install -A nixpkgs.trivy`
|
||||
`nix-env --install -A nixpkgs.trivy`
|
||||
|
||||
=== "Configuration"
|
||||
|
||||
```nix
|
||||
# your other config ...
|
||||
environment.systemPackages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
```nix
|
||||
# your other config ...
|
||||
environment.systemPackages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
|
||||
=== "Home Manager"
|
||||
|
||||
```nix
|
||||
# your other config ...
|
||||
home.packages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
```nix
|
||||
# your other config ...
|
||||
home.packages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
|
||||
References:
|
||||
- <https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/trivy/default.nix>
|
||||
|
||||
- https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/trivy/default.nix
|
||||
|
||||
### FreeBSD (Official)
|
||||
|
||||
[Pkg](https://freebsd.org) for FreeBSD.
|
||||
|
||||
```bash
|
||||
pkg install trivy
|
||||
```
|
||||
|
||||
### asdf/mise (Community)
|
||||
|
||||
[asdf](https://github.com/asdf-vm/asdf) and [mise](https://github.com/jdx/mise) are quite similar tools you can use to install trivy.
|
||||
See their respective documentation for more information of how to install them and use them:
|
||||
|
||||
- [asdf](https://asdf-vm.com/guide/getting-started.html)
|
||||
- [mise](https://mise.jdx.dev/getting-started.html)
|
||||
|
||||
The plugin used by both tools is developped [here](https://github.com/zufardhiyaulhaq/asdf-trivy)
|
||||
|
||||
|
||||
=== "asdf"
|
||||
A basic global installation is shown below, for specific version or/and local version to a directory see "asdf" documentation.
|
||||
|
||||
```shell
|
||||
# Install plugin
|
||||
asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git
|
||||
|
||||
# Install latest version
|
||||
asdf install trivy latest
|
||||
|
||||
# Set a version globally (on your ~/.tool-versions file)
|
||||
asdf global trivy latest
|
||||
|
||||
# Now trivy commands are available
|
||||
trivy --version
|
||||
```
|
||||
|
||||
=== "mise"
|
||||
A basic global installation is shown below, for specific version or/and local version to a directory see "mise" documentation.
|
||||
|
||||
``` shell
|
||||
# Install plugin and install latest version
|
||||
mise install trivy@latest
|
||||
|
||||
# Set a version globally (on your ~/.tool-versions file)
|
||||
mise use -g trivy@latest
|
||||
|
||||
# Now trivy commands are available
|
||||
trivy --version
|
||||
```
|
||||
|
||||
## Install from GitHub Release (Official)
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 330 KiB |
@@ -126,7 +126,7 @@ Contact us about any matter by opening a GitHub Discussion [here][discussions]
|
||||
|
||||
[Ecosystem]: ./ecosystem/index.md
|
||||
[Installation]: getting-started/installation.md
|
||||
[pronunciation]: #how-to-pronounce-the-name-trivy
|
||||
[pronunciation]: getting-started/faq.md#how-to-pronounce-the-name-trivy
|
||||
[Scanning Coverage]: ./docs/coverage/index.md
|
||||
|
||||
[aquasec]: https://aquasec.com
|
||||
|
||||
@@ -41,7 +41,7 @@ trivy:
|
||||
# Build image
|
||||
- docker build -t $IMAGE .
|
||||
# Build report
|
||||
- ./trivy image --exit-code 0 --format template --template "@contrib/gitlab.tpl" -o gl-container-scanning-report.json $IMAGE
|
||||
- ./trivy image --exit-code 0 --format template --template "@/contrib/gitlab.tpl" -o gl-container-scanning-report.json $IMAGE
|
||||
# Print report
|
||||
- ./trivy image --exit-code 0 --severity HIGH $IMAGE
|
||||
# Fail on severe vulnerabilities
|
||||
@@ -49,7 +49,7 @@ trivy:
|
||||
cache:
|
||||
paths:
|
||||
- .trivycache/
|
||||
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab EE Ultimate or GitLab.com Gold)
|
||||
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab Ultimate)
|
||||
artifacts:
|
||||
reports:
|
||||
container_scanning: gl-container-scanning-report.json
|
||||
@@ -148,9 +148,9 @@ trivy:
|
||||
# Build image
|
||||
- docker build -t $IMAGE .
|
||||
# Image report
|
||||
- ./trivy image --exit-code 0 --format template --template "@contrib/gitlab-codequality.tpl" -o gl-codeclimate-image.json $IMAGE
|
||||
- ./trivy image --exit-code 0 --format template --template "@/contrib/gitlab-codequality.tpl" -o gl-codeclimate-image.json $IMAGE
|
||||
# Filesystem report
|
||||
- ./trivy filesystem --scanners misconfig,vuln --exit-code 0 --format template --template "@contrib/gitlab-codequality.tpl" -o gl-codeclimate-fs.json .
|
||||
- ./trivy filesystem --scanners misconfig,vuln --exit-code 0 --format template --template "@/contrib/gitlab-codequality.tpl" -o gl-codeclimate-fs.json .
|
||||
# Combine report
|
||||
- apk update && apk add jq
|
||||
- jq -s 'add' gl-codeclimate-image.json gl-codeclimate-fs.json > gl-codeclimate.json
|
||||
|
||||
@@ -1,58 +1,51 @@
|
||||
# Kubernetes Scanning Tutorial
|
||||
|
||||
## Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
To test the following commands yourself, make sure that you’re connected to a Kubernetes cluster. A simple kind, a Docker-Desktop or microk8s cluster will do. In our case, we’ll use a one-node kind cluster.
|
||||
|
||||
Pro tip: The output of the commands will be even more interesting if you have some workloads running in your cluster.
|
||||
Pro tip: The output of the commands will be even more interesting if you have some workloads running in your cluster.
|
||||
|
||||
## Cluster Scanning
|
||||
|
||||
Trivy K8s is great to get an overview of all the vulnerabilities and misconfiguration issues or to scan specific workloads that are running in your cluster. You would want to use the Trivy K8s command either on your own local cluster or in your CI/CD pipeline post deployments.
|
||||
|
||||
The `trivy k8s` command is part of the Trivy CLI.
|
||||
The `trivy k8s` command is part of the Trivy CLI.
|
||||
|
||||
With the following command, we can scan our entire Kubernetes cluster for vulnerabilities and get a summary of the scan:
|
||||
With the following command, we can scan our entire Kubernetes cluster for vulnerabilities and get a summary of the scan:
|
||||
|
||||
```
|
||||
trivy k8s --report=summary cluster
|
||||
```sh
|
||||
trivy k8s --report=summary
|
||||
```
|
||||
|
||||
To get detailed information for all your resources, just replace ‘summary’ with ‘all’:
|
||||
|
||||
```
|
||||
trivy k8s --report=all cluster
|
||||
```sh
|
||||
trivy k8s --report=all
|
||||
```
|
||||
|
||||
However, we recommend displaying all information only in case you scan a specific namespace or resource since you can get overwhelmed with additional details.
|
||||
|
||||
Furthermore, we can specify the namespace that Trivy is supposed to scan to focus on specific resources in the scan result:
|
||||
|
||||
```
|
||||
trivy k8s -n kube-system --report=summary cluster
|
||||
```sh
|
||||
trivy k8s --include-namespaces kube-system --report summary
|
||||
```
|
||||
|
||||
Again, if you’d like to receive additional details, use the ‘--report=all’ flag:
|
||||
|
||||
```
|
||||
trivy k8s -n kube-system --report=all cluster
|
||||
```sh
|
||||
trivy k8s --include-namespaces kube-system --report all
|
||||
```
|
||||
|
||||
Like with scanning for vulnerabilities, we can also filter in-cluster security issues by severity of the vulnerabilities:
|
||||
|
||||
```
|
||||
trivy k8s --severity=CRITICAL --report=summary cluster
|
||||
```sh
|
||||
trivy k8s --severity=CRITICAL --report=summary
|
||||
```
|
||||
|
||||
Note that you can use any of the Trivy flags on the Trivy K8s command.
|
||||
|
||||
With the Trivy K8s command, you can also scan specific workloads that are running within your cluster, such as our deployment:
|
||||
|
||||
```
|
||||
trivy k8s --namespace app --report=summary deployments/react-application
|
||||
```
|
||||
|
||||
## Trivy Operator
|
||||
## Trivy Operator
|
||||
|
||||
The Trivy K8s command is an imperative model to scan resources. We wouldn’t want to manually scan each resource across different environments. The larger the cluster and the more workloads are running in it, the more error-prone this process would become. With the Trivy Operator, we can automate the scanning process after the deployment.
|
||||
|
||||
@@ -66,15 +59,9 @@ This has several benefits:
|
||||
|
||||
- The CRDs can be both machine and human-readable depending on which applications consume the CRDs. This allows for more versatile applications of the Trivy operator.
|
||||
|
||||
|
||||
There are several ways that you can install the Trivy Operator in your cluster. In this guide, we’re going to use the Helm installation based on the [following documentation.](../../docs/target/kubernetes.md#trivy-operator)
|
||||
|
||||
Please follow the Trivy Operator documentation for further information on:
|
||||
|
||||
- [Installation of the Trivy Operator](https://aquasecurity.github.io/trivy-operator/latest/getting-started/installation/)
|
||||
- [Getting started guide](https://aquasecurity.github.io/trivy-operator/latest/getting-started/quick-start/)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- [Getting started guide](https://aquasecurity.github.io/trivy-operator/latest/getting-started/quick-start/)
|
||||
111
docs/tutorials/misconfiguration/custom-checks.md
Normal file
111
docs/tutorials/misconfiguration/custom-checks.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# Custom Checks with Rego
|
||||
|
||||
Trivy can scan configuration files for common security issues (a.k.a IaC misconfiguration scanning). In addition to a comprehensive built in database of checks, you can add your own custom checks. Checks are written in [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/) language and the full documentation for checks and customizing them is available [here](https://aquasecurity.github.io/trivy/latest/docs/scanner/misconfiguration/custom/).
|
||||
|
||||
This tutorial will walk you through writing a custom check in Rego that checks for an issue in a Dockerfile.
|
||||
|
||||
When you are writing a check, it's important to understand the input to the check. This will be the IaC file that you are scanning; for example, a Kubernetes YAML resource definition, or an AWS JSON CloudFormation, or in our case a Dockerfile.
|
||||
|
||||
Since Rego is primarily tailored to query JSON objects, all incoming configuration files needs to be first converted to structured objects, which is available to the Rego code as the input variable. This is nothing that users have to do manually in Trivy. Instead, Rego makes it possible to pass in custom Schemas that detail how files are converted. Once Rego has access to a custom Schema, it will know in which format to access configuration files such as a Dockerfile.
|
||||
|
||||
[Here you can find the schemas](https://github.com/aquasecurity/trivy/tree/main/pkg/iac/rego/schemas) that define how different configuration files are converted to JSON by Trivy.
|
||||
This tutorial will make use of the [dockerfile.json schema](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json). The schema will need to be parsed into your custom check.
|
||||
|
||||
Users can also use the [Schema Explorer](https://aquasecurity.github.io/trivy-schemas/) to view the structure of the data provided to Rego.
|
||||
|
||||
## Create a Rego file and Specify Trivy metadata
|
||||
|
||||
First, create a new `.rego` file e.g. a `docker-check.rego` file:
|
||||
```
|
||||
touch docker-check.rego
|
||||
```
|
||||
|
||||
Next, we need to specify metadata about the check. This is information that helps Trivy load and process the check.
|
||||
|
||||
```
|
||||
# METADATA
|
||||
# title: Verify Image
|
||||
# description: Verify Image is allowed to be used and in the right format
|
||||
# schemas:
|
||||
# - input: schema["dockerfile"]
|
||||
# custom:
|
||||
# id: ID001
|
||||
# severity: MEDIUM
|
||||
# input:
|
||||
# selector:
|
||||
# - type: dockerfile
|
||||
```
|
||||
|
||||
Important: The `METADATA` has to be defined on top of the file.
|
||||
|
||||
More information on the different fields in the metadata can be found in the [Trivy documentation.](https://aquasecurity.github.io/trivy/latest/docs/scanner/misconfiguration/custom/)
|
||||
|
||||
## Package and imports
|
||||
|
||||
```
|
||||
package custom.dockerfile.ID001
|
||||
|
||||
import future.keywords.in
|
||||
```
|
||||
|
||||
Every rego check has a package name. In our case, we will call it `custom.dockerfile.ID001` to avoid confusion between custom checks and built-in checks. The group name `dockerfile` has no effect on the package name. Note that each package has to contain only one check. However, we can pass multiple checks into our Trivy scan.
|
||||
The first keyword of the package, in this case `custom`, will be reused in the `trivy` command as the `--namespace`.
|
||||
|
||||
## Allowed data
|
||||
|
||||
The check that we are setting up compares the container images used in the Dockerfile with a list of white-listed container images. Thus, we need to add the images that are allowed to be used in the Dockerfile to our check. In our case, we will store them in an array of arrays:
|
||||
|
||||
```
|
||||
allowed_images := {
|
||||
["node:21-alpine3.19", "as", "build-deps"],
|
||||
["nginx:1.2"]
|
||||
}
|
||||
```
|
||||
|
||||
## Select the images that are used in the Dockerfile
|
||||
|
||||
Next, we need to iterate over the different commands in our Dockerfile and identify the commands that provide the base container images:
|
||||
|
||||
```
|
||||
deny[msg] {
|
||||
input.Stages[m].Commands[l].Cmd == "from"
|
||||
val := input.Stages[m].Commands[l].Value
|
||||
not val in allowed_images
|
||||
msg := sprintf("The container image '%s' used in the Dockerfile is not allowed", val)
|
||||
}
|
||||
```
|
||||
|
||||
Let's look at the check line by line:
|
||||
|
||||
1. The rule should always be `deny` in the Trivy Rego checks
|
||||
2. `input.Stages[m].Commands[l].Cmd` `input` allows us to access the different commands in the Dockerfile. We need to access the commands that use "FROM". Every command will be converted to lowercase.
|
||||
3. `val := input.Stages[m].Commands[l].Value` accesses the value of the `FROM` command and stores it in `val`
|
||||
4. `not val in allowed_images` checks whether val is not part of our allowed images list; this part of the check relies on the import statement
|
||||
5. In case our check fails, the `msg` will be printed with the image name used in `val`
|
||||
|
||||
Note that Rego
|
||||
|
||||
* uses `AND` automatically to combine conditions in this check
|
||||
* automatically iterates through the array of commands in the Dockefile and allowed images
|
||||
|
||||
## Run the check in a Trivy misconfiguration scan
|
||||
|
||||
Ensure that you have Trivy installed and run the following command:
|
||||
|
||||
```bash
|
||||
trivy fs --scanners misconf --policy ./docker-check.rego --namespaces custom ./Dockerfile
|
||||
```
|
||||
|
||||
Please replace:
|
||||
|
||||
* `./docker-check.rego` with the file path to your check
|
||||
* `custom` should be replaced with your package name if different
|
||||
* `./Dockerfile` is the path to the Dockerfile that should be scanned
|
||||
|
||||
**Note**: If you define custom packages, you have to specify the package prefix via `--namespaces` option. In our case, we called the custom package `custom`.
|
||||
|
||||
## Resources
|
||||
|
||||
* [Rego provides a long list of courses](https://academy.styra.com/collections) that can be useful in writing more complex checks
|
||||
* [The Rego documentation provides detailed information on the different types, iterations etc.](https://www.openpolicyagent.org/docs/latest/)
|
||||
* Have a look at the [built-in checks](https://github.com/aquasecurity/trivy-checks/tree/main/checks) for Trivy for inspiration on how to write custom checks.
|
||||
@@ -104,22 +104,7 @@ The `trivy config` command is a sub-command of the `trivy fs` command. You can l
|
||||
|
||||
## Scanning Terraform Plan files
|
||||
|
||||
Instead of scanning your different Terraform resources individually, you could also scan your terraform plan output before it is deployed for misconfiguration. This will give you insights into any misconfiguration of your resources as they would become deployed. [Here](https://aquasecurity.github.io/trivy/latest/docs/scanner/misconfiguration/custom/examples/#terraform-plan) is the link to the documentation.
|
||||
|
||||
First, create a terraform plan and save it to a file:
|
||||
```
|
||||
terraform plan --out tfplan.binary
|
||||
```
|
||||
|
||||
Next, convert the file into json format:
|
||||
```
|
||||
terraform show -json tfplan.binary > tfplan.json
|
||||
```
|
||||
|
||||
Lastly, scan the file with the `trivy config` command:
|
||||
```
|
||||
trivy config ./tfplan.json
|
||||
```
|
||||
Instead of scanning your different Terraform resources individually, you could also scan your Terraform Plan file before it is deployed for misconfiguration. This will give you insights into any misconfiguration of your resources as they would become deployed. [Here](https://aquasecurity.github.io/trivy/latest/docs/coverage/iac/terraform/#terraform) is the link to the documentation.
|
||||
|
||||
Note that you need to be able to create a terraform init and plan without any errors.
|
||||
|
||||
|
||||
342
go.mod
342
go.mod
@@ -1,63 +1,64 @@
|
||||
module github.com/aquasecurity/trivy
|
||||
|
||||
go 1.21
|
||||
go 1.22
|
||||
|
||||
toolchain go1.22.0
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1
|
||||
github.com/BurntSushi/toml v1.3.2
|
||||
github.com/CycloneDX/cyclonedx-go v0.8.0
|
||||
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
|
||||
github.com/Masterminds/sprig/v3 v3.2.3
|
||||
github.com/NYTimes/gziphandler v1.1.1
|
||||
github.com/alicebob/miniredis/v2 v2.31.0
|
||||
github.com/alicebob/miniredis/v2 v2.31.1
|
||||
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
|
||||
github.com/aquasecurity/defsec v0.94.1
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20240131191227-2779e24d07b5
|
||||
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
|
||||
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
|
||||
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
|
||||
github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492
|
||||
github.com/aquasecurity/loading v0.0.5
|
||||
github.com/aquasecurity/table v1.8.0
|
||||
github.com/aquasecurity/testdocker v0.0.0-20230111101738-e741bda259da
|
||||
github.com/aquasecurity/testdocker v0.0.0-20240419073403-90bd43849334
|
||||
github.com/aquasecurity/tml v0.6.1
|
||||
github.com/aquasecurity/trivy-aws v0.7.1
|
||||
github.com/aquasecurity/trivy-aws v0.8.0
|
||||
github.com/aquasecurity/trivy-checks v0.10.5-0.20240430045208-6cc735de6b9e
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20231005141211-4fc651f7ac8d
|
||||
github.com/aquasecurity/trivy-iac v0.8.0
|
||||
github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48
|
||||
github.com/aquasecurity/trivy-kubernetes v0.6.3-0.20240118072219-c433b06f98e1
|
||||
github.com/aquasecurity/trivy-policies v0.8.0
|
||||
github.com/aws/aws-sdk-go-v2 v1.24.1
|
||||
github.com/aws/aws-sdk-go-v2/config v1.26.3
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.16.14
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.11
|
||||
github.com/aws/aws-sdk-go-v2/service/ec2 v1.142.0
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.24.6
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7
|
||||
github.com/aquasecurity/trivy-kubernetes v0.6.7-0.20240425111126-a549f8de71bb
|
||||
github.com/aws/aws-sdk-go-v2 v1.26.1
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.11
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.11
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15
|
||||
github.com/aws/aws-sdk-go-v2/service/ec2 v1.155.1
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.27.4
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6
|
||||
github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/cheggaaa/pb/v3 v3.1.4
|
||||
github.com/containerd/containerd v1.7.11
|
||||
github.com/containerd/containerd v1.7.16
|
||||
github.com/csaf-poc/csaf_distribution/v3 v3.0.0
|
||||
github.com/docker/docker v24.0.7+incompatible
|
||||
github.com/docker/go-connections v0.4.0
|
||||
github.com/fatih/color v1.15.0
|
||||
github.com/docker/docker v26.0.2+incompatible
|
||||
github.com/docker/go-connections v0.5.0
|
||||
github.com/fatih/color v1.16.0
|
||||
github.com/go-git/go-git/v5 v5.11.0
|
||||
github.com/go-openapi/runtime v0.26.0
|
||||
github.com/go-openapi/strfmt v0.21.7
|
||||
github.com/go-openapi/runtime v0.28.0
|
||||
github.com/go-openapi/strfmt v0.23.0
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||
github.com/golang/protobuf v1.5.3
|
||||
github.com/google/go-containerregistry v0.17.0
|
||||
github.com/golang/protobuf v1.5.4
|
||||
github.com/google/go-containerregistry v0.19.1
|
||||
github.com/google/licenseclassifier/v2 v2.0.0
|
||||
github.com/google/uuid v1.5.0
|
||||
github.com/google/wire v0.5.0
|
||||
github.com/hashicorp/go-getter v1.7.3
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/google/wire v0.6.0
|
||||
github.com/hashicorp/go-getter v1.7.4
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.6
|
||||
github.com/hashicorp/go-retryablehttp v0.7.5
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/in-toto/in-toto-golang v0.9.0
|
||||
github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f
|
||||
github.com/knqyf263/go-deb-version v0.0.0-20230223133812-3ed183d23422
|
||||
@@ -65,8 +66,9 @@ require (
|
||||
github.com/knqyf263/go-rpmdb v0.0.0-20231008124120-ac49267ab4e1
|
||||
github.com/knqyf263/nested v0.0.1
|
||||
github.com/kylelemons/godebug v1.1.0
|
||||
github.com/liamg/jfather v0.0.7
|
||||
github.com/magefile/mage v1.15.0
|
||||
github.com/mailru/easyjson v0.7.7
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac
|
||||
github.com/masahiro331/go-ebs-file v0.0.0-20240112135404-d5fbb1d46323
|
||||
github.com/masahiro331/go-ext4-filesystem v0.0.0-20231208112839-4339555a0cd4
|
||||
@@ -74,61 +76,81 @@ require (
|
||||
github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd
|
||||
github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70
|
||||
github.com/mattn/go-shellwords v1.0.12
|
||||
github.com/microsoft/go-rustaudit v0.0.0-20220808201409-204dfee52032
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/moby/buildkit v0.11.6
|
||||
github.com/open-policy-agent/opa v0.60.0
|
||||
github.com/moby/buildkit v0.12.5
|
||||
github.com/open-policy-agent/opa v0.64.1
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/image-spec v1.1.0-rc5
|
||||
github.com/opencontainers/image-spec v1.1.0
|
||||
github.com/openvex/go-vex v0.2.5
|
||||
github.com/owenrumney/go-sarif/v2 v2.3.0
|
||||
github.com/package-url/packageurl-go v0.1.2
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22
|
||||
github.com/samber/lo v1.39.0
|
||||
github.com/saracen/walker v0.1.3
|
||||
github.com/secure-systems-lab/go-securesystemslib v0.8.0
|
||||
github.com/sigstore/rekor v1.2.2
|
||||
github.com/sigstore/rekor v1.3.6
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/sosedoff/gitkit v0.4.0
|
||||
github.com/spdx/tools-golang v0.5.4-0.20231108154018-0c0f394b5e1a // v0.5.3 with necessary changes. Can be upgraded to version 0.5.4 after release.
|
||||
github.com/spf13/cast v1.5.1
|
||||
github.com/spf13/cast v1.6.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/viper v1.16.0
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/testcontainers/testcontainers-go v0.27.0
|
||||
github.com/testcontainers/testcontainers-go/modules/localstack v0.26.0
|
||||
github.com/tetratelabs/wazero v1.2.1
|
||||
github.com/spf13/viper v1.18.2
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/testcontainers/testcontainers-go v0.30.0
|
||||
github.com/testcontainers/testcontainers-go/modules/localstack v0.28.0
|
||||
github.com/tetratelabs/wazero v1.7.0
|
||||
github.com/twitchtv/twirp v8.1.2+incompatible
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/xlab/treeprint v1.2.0
|
||||
go.etcd.io/bbolt v1.3.8
|
||||
go.uber.org/zap v1.26.0
|
||||
go.etcd.io/bbolt v1.3.9
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
||||
golang.org/x/mod v0.14.0
|
||||
golang.org/x/mod v0.16.0
|
||||
golang.org/x/net v0.24.0
|
||||
golang.org/x/sync v0.6.0
|
||||
golang.org/x/term v0.16.0
|
||||
golang.org/x/term v0.19.0
|
||||
golang.org/x/text v0.14.0
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
|
||||
google.golang.org/protobuf v1.32.0
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
|
||||
google.golang.org/protobuf v1.34.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/api v0.29.0
|
||||
k8s.io/api v0.29.3
|
||||
k8s.io/utils v0.0.0-20231127182322-b307cd553661
|
||||
modernc.org/sqlite v1.28.0
|
||||
modernc.org/sqlite v1.29.7
|
||||
)
|
||||
|
||||
require github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c
|
||||
require (
|
||||
github.com/alecthomas/chroma v0.10.0
|
||||
github.com/antchfx/htmlquery v1.3.0
|
||||
github.com/apparentlymart/go-cidr v1.1.0
|
||||
github.com/aws/smithy-go v1.20.2
|
||||
github.com/hashicorp/go-uuid v1.0.3
|
||||
github.com/hashicorp/go-version v1.6.0
|
||||
github.com/hashicorp/hc-install v0.6.3
|
||||
github.com/hashicorp/hcl/v2 v2.19.1
|
||||
github.com/hashicorp/terraform-exec v0.20.0
|
||||
github.com/liamg/iamgo v0.0.9
|
||||
github.com/liamg/memoryfs v1.6.0
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/owenrumney/squealer v1.2.2
|
||||
github.com/zclconf/go-cty v1.14.4
|
||||
github.com/zclconf/go-cty-yaml v1.0.3
|
||||
golang.org/x/crypto v0.22.0
|
||||
helm.sh/helm/v3 v3.14.2
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.110.8 // indirect
|
||||
cloud.google.com/go/compute v1.23.0 // indirect
|
||||
cloud.google.com/go v0.112.1 // indirect
|
||||
cloud.google.com/go/compute v1.25.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
cloud.google.com/go/iam v1.1.2 // indirect
|
||||
cloud.google.com/go/storage v1.31.0 // indirect
|
||||
cloud.google.com/go/iam v1.1.6 // indirect
|
||||
cloud.google.com/go/storage v1.39.1 // indirect
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
|
||||
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.29 // indirect
|
||||
@@ -136,35 +158,32 @@ require (
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
|
||||
github.com/Intevation/gval v1.3.0 // indirect
|
||||
github.com/Intevation/jsonpath v0.2.1 // indirect
|
||||
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
||||
github.com/Masterminds/squirrel v1.5.4 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/Microsoft/hcsshim v0.11.4 // indirect
|
||||
github.com/OneOfOne/xxhash v1.2.8 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect
|
||||
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect
|
||||
github.com/VividCortex/ewma v1.2.0 // indirect
|
||||
github.com/agext/levenshtein v1.2.3 // indirect
|
||||
github.com/agnivade/levenshtein v1.1.1 // indirect
|
||||
github.com/alecthomas/chroma v0.10.0 // indirect
|
||||
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
|
||||
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
|
||||
github.com/apparentlymart/go-cidr v1.1.0 // indirect
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||
github.com/antchfx/xpath v1.2.3 // indirect
|
||||
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aws/aws-sdk-go v1.49.21 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
|
||||
github.com/aws/aws-sdk-go v1.51.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.26.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/apigateway v1.21.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.18.6 // indirect
|
||||
@@ -174,25 +193,25 @@ require (
|
||||
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.32.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.30.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/codebuild v1.26.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/docdb v1.29.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/docdb v1.33.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ebs v1.21.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecs v1.35.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/efs v1.26.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.37.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/efs v1.28.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.41.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.25.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/emr v1.36.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/iam v1.28.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/kafka v1.28.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/kinesis v1.24.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.27.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.30.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/lambda v1.49.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/mq v1.20.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/neptune v1.28.1 // indirect
|
||||
@@ -201,10 +220,9 @@ require (
|
||||
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.26.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.29.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/workspaces v1.35.6 // indirect
|
||||
github.com/aws/smithy-go v1.19.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/workspaces v1.38.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
|
||||
github.com/briandowns/spinner v1.23.0 // indirect
|
||||
@@ -217,17 +235,17 @@ require (
|
||||
github.com/containerd/fifo v1.1.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
|
||||
github.com/containerd/ttrpc v1.2.2 // indirect
|
||||
github.com/containerd/typeurl v1.0.2 // indirect
|
||||
github.com/containerd/ttrpc v1.2.3 // indirect
|
||||
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
||||
github.com/cpuguy83/dockercfg v0.3.1 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/dlclark/regexp2 v1.4.0 // indirect
|
||||
github.com/docker/cli v24.0.6+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.2+incompatible // indirect
|
||||
github.com/docker/cli v25.0.1+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.3+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.7.0 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
@@ -247,33 +265,31 @@ require (
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/go-logr/logr v1.4.1 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/analysis v0.21.4 // indirect
|
||||
github.com/go-openapi/errors v0.20.4 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/loads v0.21.2 // indirect
|
||||
github.com/go-openapi/spec v0.20.9 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
github.com/go-openapi/validate v0.22.1 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.1 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-openapi/analysis v0.23.0 // indirect
|
||||
github.com/go-openapi/errors v0.22.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/loads v0.22.0 // indirect
|
||||
github.com/go-openapi/spec v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/go-openapi/validate v0.24.0 // indirect
|
||||
github.com/go-test/deep v1.1.0 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
github.com/goccy/go-yaml v1.9.5 // indirect
|
||||
github.com/gofrs/uuid v4.3.1+incompatible // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/flatbuffers v2.0.8+incompatible // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 // indirect
|
||||
github.com/google/s2a-go v0.1.5 // indirect
|
||||
github.com/google/s2a-go v0.1.7 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/gosuri/uitable v0.0.4 // indirect
|
||||
@@ -281,11 +297,9 @@ require (
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-safetemp v1.0.0 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/go-version v1.6.0 // indirect
|
||||
github.com/hashicorp/golang-lru v0.6.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
|
||||
github.com/hashicorp/terraform-json v0.19.0 // indirect
|
||||
github.com/huandu/xstrings v1.4.0 // indirect
|
||||
github.com/imdario/mergo v0.3.15 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
@@ -294,35 +308,30 @@ require (
|
||||
github.com/jmoiron/sqlx v1.3.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.16.6 // indirect
|
||||
github.com/klauspost/compress v1.17.4 // indirect
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/liamg/iamgo v0.0.9 // indirect
|
||||
github.com/liamg/jfather v0.0.7 // indirect
|
||||
github.com/liamg/memoryfs v1.6.0 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/microsoft/go-rustaudit v0.0.0-20220808201409-204dfee52032 // indirect
|
||||
github.com/miekg/dns v1.1.53 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/patternmatcher v0.6.0 // indirect
|
||||
github.com/moby/spdystream v0.2.0 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||
github.com/moby/sys/sequential v0.5.0 // indirect
|
||||
github.com/moby/sys/signal v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.1.0 // indirect
|
||||
github.com/moby/term v0.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
@@ -330,38 +339,43 @@ require (
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/opencontainers/runc v1.1.12 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.1.0-rc.1 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.1.0 // indirect
|
||||
github.com/opencontainers/selinux v1.11.0 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/owenrumney/squealer v1.2.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.16.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.44.0 // indirect
|
||||
github.com/prometheus/procfs v0.10.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||
github.com/prometheus/client_golang v1.19.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.48.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/rubenv/sql-migrate v1.5.2 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
|
||||
github.com/sergi/go-diff v1.3.1 // indirect
|
||||
github.com/shibumi/go-pathspec v1.3.0 // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/skeema/knownhosts v1.2.1 // indirect
|
||||
github.com/spf13/afero v1.9.5 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/stretchr/objx v0.5.0 // indirect
|
||||
github.com/subosito/gotenv v1.4.2 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/ulikunitz/xz v0.5.11 // indirect
|
||||
github.com/vbatts/tar-split v0.11.3 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
@@ -369,66 +383,50 @@ require (
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/yashtewari/glob-intersection v0.2.0 // indirect
|
||||
github.com/yuin/gopher-lua v1.1.0 // indirect
|
||||
github.com/zclconf/go-cty v1.13.0 // indirect
|
||||
github.com/zclconf/go-cty-yaml v1.0.3 // indirect
|
||||
go.mongodb.org/mongo-driver v1.11.3 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.3 // indirect
|
||||
go.mongodb.org/mongo-driver v1.14.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
|
||||
go.opentelemetry.io/otel v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.21.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
|
||||
go.opentelemetry.io/otel v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.24.0 // indirect
|
||||
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
|
||||
go.uber.org/goleak v1.3.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.18.0 // indirect
|
||||
golang.org/x/net v0.20.0 // indirect
|
||||
golang.org/x/oauth2 v0.13.0 // indirect
|
||||
golang.org/x/sys v0.16.0 // indirect
|
||||
golang.org/x/oauth2 v0.18.0 // indirect
|
||||
golang.org/x/sys v0.19.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.15.0 // indirect
|
||||
google.golang.org/api v0.138.0 // indirect
|
||||
golang.org/x/tools v0.19.0 // indirect
|
||||
google.golang.org/api v0.172.0 // indirect
|
||||
google.golang.org/appengine v1.6.8 // indirect
|
||||
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/grpc v1.60.1 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240311173647-c811ad7063a7 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
|
||||
google.golang.org/grpc v1.63.2 // indirect
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
helm.sh/helm/v3 v3.14.0 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.29.0 // indirect
|
||||
k8s.io/apimachinery v0.29.0 // indirect
|
||||
k8s.io/apimachinery v0.29.3 // indirect
|
||||
k8s.io/apiserver v0.29.0 // indirect
|
||||
k8s.io/cli-runtime v0.29.0 // indirect
|
||||
k8s.io/client-go v0.29.0 // indirect
|
||||
k8s.io/component-base v0.29.0 // indirect
|
||||
k8s.io/cli-runtime v0.29.3 // indirect
|
||||
k8s.io/client-go v0.29.3 // indirect
|
||||
k8s.io/component-base v0.29.3 // indirect
|
||||
k8s.io/klog/v2 v2.120.0 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
k8s.io/kubectl v0.29.0 // indirect
|
||||
lukechampine.com/uint128 v1.2.0 // indirect
|
||||
modernc.org/cc/v3 v3.40.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.13 // indirect
|
||||
modernc.org/libc v1.29.0 // indirect
|
||||
k8s.io/kubectl v0.29.3 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
|
||||
modernc.org/libc v1.49.3 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.7.2 // indirect
|
||||
modernc.org/opt v0.1.3 // indirect
|
||||
modernc.org/strutil v1.1.3 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
oras.land/oras-go v1.2.4 // indirect
|
||||
oras.land/oras-go v1.2.5 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
)
|
||||
|
||||
// oras 1.2.2 is incompatible with github.com/docker/docker v24.0.2
|
||||
// cf. https://github.com/oras-project/oras-go/pull/527
|
||||
replace oras.land/oras-go => oras.land/oras-go v1.2.4-0.20230801060855-932dd06d38af
|
||||
|
||||
// testcontainers-go has a bug with versions v0.25.0 and v0.26.0
|
||||
// ref: https://github.com/testcontainers/testcontainers-go/issues/1782
|
||||
replace github.com/testcontainers/testcontainers-go => github.com/testcontainers/testcontainers-go v0.23.0
|
||||
|
||||
@@ -4,16 +4,13 @@ package integration
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
dockercontainer "github.com/docker/docker/api/types/container"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/testcontainers/testcontainers-go"
|
||||
"github.com/testcontainers/testcontainers-go/modules/localstack"
|
||||
|
||||
"github.com/aquasecurity/trivy/internal/testutil"
|
||||
awscommands "github.com/aquasecurity/trivy/pkg/cloud/aws/commands"
|
||||
"github.com/aquasecurity/trivy/pkg/flag"
|
||||
)
|
||||
@@ -28,7 +25,7 @@ func TestAwsCommandRun(t *testing.T) {
|
||||
{
|
||||
name: "fail without region",
|
||||
options: flag.Options{
|
||||
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
|
||||
RegoOptions: flag.RegoOptions{SkipCheckUpdate: true},
|
||||
},
|
||||
envs: map[string]string{
|
||||
"AWS_ACCESS_KEY_ID": "test",
|
||||
@@ -42,7 +39,7 @@ func TestAwsCommandRun(t *testing.T) {
|
||||
"AWS_PROFILE": "non-existent-profile",
|
||||
},
|
||||
options: flag.Options{
|
||||
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
|
||||
RegoOptions: flag.RegoOptions{SkipCheckUpdate: true},
|
||||
AWSOptions: flag.AWSOptions{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
@@ -53,7 +50,8 @@ func TestAwsCommandRun(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
localstackC, addr := setupLocalStack(t, ctx)
|
||||
localstackC, addr, err := testutil.SetupLocalStack(ctx, "2.2.0")
|
||||
require.NoError(t, err)
|
||||
defer localstackC.Terminate(ctx)
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -78,32 +76,3 @@ func TestAwsCommandRun(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setupLocalStack(t *testing.T, ctx context.Context) (*localstack.LocalStackContainer, string) {
|
||||
t.Helper()
|
||||
t.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
|
||||
container, err := localstack.RunContainer(ctx, testcontainers.CustomizeRequest(
|
||||
testcontainers.GenericContainerRequest{
|
||||
ContainerRequest: testcontainers.ContainerRequest{
|
||||
Image: "localstack/localstack:2.2.0",
|
||||
HostConfigModifier: func(hostConfig *dockercontainer.HostConfig) {
|
||||
hostConfig.AutoRemove = true
|
||||
},
|
||||
},
|
||||
},
|
||||
))
|
||||
require.NoError(t, err)
|
||||
|
||||
p, err := container.MappedPort(ctx, "4566/tcp")
|
||||
require.NoError(t, err)
|
||||
|
||||
provider, err := testcontainers.NewDockerProvider()
|
||||
require.NoError(t, err)
|
||||
defer provider.Close()
|
||||
|
||||
host, err := provider.DaemonHost(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
return container, fmt.Sprintf("http://%s:%d", host, p.Int())
|
||||
|
||||
}
|
||||
|
||||
@@ -242,6 +242,16 @@ func TestClientServer(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/pom.json.golden",
|
||||
},
|
||||
{
|
||||
name: "scan package-lock.json with repo command in client/server mode",
|
||||
args: csArgs{
|
||||
Command: "repo",
|
||||
RemoteAddrOption: "--server",
|
||||
Target: "testdata/fixtures/repo/npm/",
|
||||
ListAllPackages: true,
|
||||
},
|
||||
golden: "testdata/npm.json.golden",
|
||||
},
|
||||
{
|
||||
name: "scan sample.pem with repo command in client/server mode",
|
||||
args: csArgs{
|
||||
@@ -273,7 +283,9 @@ func TestClientServer(t *testing.T) {
|
||||
osArgs = append(osArgs, "--secret-config", tt.args.secretConfig)
|
||||
}
|
||||
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{})
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{
|
||||
override: overrideUID,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -387,7 +399,9 @@ func TestClientServerWithFormat(t *testing.T) {
|
||||
t.Setenv("AWS_ACCOUNT_ID", "123456789012")
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
|
||||
runTest(t, osArgs, tt.golden, "", tt.args.Format, runOptions{})
|
||||
runTest(t, osArgs, tt.golden, "", tt.args.Format, runOptions{
|
||||
override: overrideUID,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -465,7 +479,10 @@ func TestClientServerWithToken(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{wantErr: tt.wantErr})
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{
|
||||
override: overrideUID,
|
||||
wantErr: tt.wantErr,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -491,7 +508,9 @@ func TestClientServerWithRedis(t *testing.T) {
|
||||
osArgs := setupClient(t, testArgs, addr, cacheDir, golden)
|
||||
|
||||
// Run Trivy client
|
||||
runTest(t, osArgs, golden, "", types.FormatJSON, runOptions{})
|
||||
runTest(t, osArgs, golden, "", types.FormatJSON, runOptions{
|
||||
override: overrideUID,
|
||||
})
|
||||
})
|
||||
|
||||
// Terminate the Redis container
|
||||
@@ -588,6 +607,10 @@ func setupClient(t *testing.T, c csArgs, addr string, cacheDir string, golden st
|
||||
osArgs = append(osArgs, "--format", "json")
|
||||
}
|
||||
|
||||
if c.ListAllPackages {
|
||||
osArgs = append(osArgs, "--list-all-pkgs")
|
||||
}
|
||||
|
||||
if c.IgnoreUnfixed {
|
||||
osArgs = append(osArgs, "--ignore-unfixed")
|
||||
}
|
||||
|
||||
@@ -245,7 +245,10 @@ func TestDockerEngine(t *testing.T) {
|
||||
// load image into docker engine
|
||||
res, err := cli.ImageLoad(ctx, testfile, true)
|
||||
require.NoError(t, err, tt.name)
|
||||
io.Copy(io.Discard, res.Body)
|
||||
if _, err := io.Copy(io.Discard, res.Body); err != nil {
|
||||
require.NoError(t, err, tt.name)
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
// tag our image to something unique
|
||||
err = cli.ImageTag(ctx, tt.imageTag, tt.input)
|
||||
@@ -253,15 +256,14 @@ func TestDockerEngine(t *testing.T) {
|
||||
|
||||
// cleanup
|
||||
t.Cleanup(func() {
|
||||
_, err = cli.ImageRemove(ctx, tt.input, api.ImageRemoveOptions{
|
||||
_, _ = cli.ImageRemove(ctx, tt.input, api.ImageRemoveOptions{
|
||||
Force: true,
|
||||
PruneChildren: true,
|
||||
})
|
||||
_, err = cli.ImageRemove(ctx, tt.imageTag, api.ImageRemoveOptions{
|
||||
_, _ = cli.ImageRemove(ctx, tt.imageTag, api.ImageRemoveOptions{
|
||||
Force: true,
|
||||
PruneChildren: true,
|
||||
})
|
||||
assert.NoError(t, err, tt.name)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -192,9 +192,10 @@ func readSpdxJson(t *testing.T, filePath string) *spdx.Document {
|
||||
return bom
|
||||
}
|
||||
|
||||
type OverrideFunc func(t *testing.T, want, got *types.Report)
|
||||
type runOptions struct {
|
||||
wantErr string
|
||||
override func(want, got *types.Report)
|
||||
override OverrideFunc
|
||||
fakeUUID string
|
||||
}
|
||||
|
||||
@@ -262,11 +263,11 @@ func compareRawFiles(t *testing.T, wantFile, gotFile string) {
|
||||
assert.EqualValues(t, string(want), string(got))
|
||||
}
|
||||
|
||||
func compareReports(t *testing.T, wantFile, gotFile string, override func(want, got *types.Report)) {
|
||||
func compareReports(t *testing.T, wantFile, gotFile string, override func(t *testing.T, want, got *types.Report)) {
|
||||
want := readReport(t, wantFile)
|
||||
got := readReport(t, gotFile)
|
||||
if override != nil {
|
||||
override(&want, &got)
|
||||
override(t, &want, &got)
|
||||
}
|
||||
assert.Equal(t, want, got)
|
||||
}
|
||||
@@ -307,3 +308,33 @@ func validateReport(t *testing.T, schema string, report any) {
|
||||
assert.True(t, valid, strings.Join(errs, "\n"))
|
||||
}
|
||||
}
|
||||
|
||||
func overrideFuncs(funcs ...OverrideFunc) OverrideFunc {
|
||||
return func(t *testing.T, want, got *types.Report) {
|
||||
for _, f := range funcs {
|
||||
if f == nil {
|
||||
continue
|
||||
}
|
||||
f(t, want, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// overrideUID only checks for the presence of the package UID and clears the UID;
|
||||
// the UID is calculated from the package metadata, but the UID does not match
|
||||
// as it varies slightly depending on the mode of scanning, e.g. the digest of the layer.
|
||||
func overrideUID(t *testing.T, want, got *types.Report) {
|
||||
for i, result := range got.Results {
|
||||
for j, vuln := range result.Vulnerabilities {
|
||||
assert.NotEmptyf(t, vuln.PkgIdentifier.UID, "UID is empty: %s", vuln.VulnerabilityID)
|
||||
// Do not compare UID as the package metadata is slightly different between the tests,
|
||||
// causing different UIDs.
|
||||
got.Results[i].Vulnerabilities[j].PkgIdentifier.UID = ""
|
||||
}
|
||||
}
|
||||
for i, result := range want.Results {
|
||||
for j := range result.Vulnerabilities {
|
||||
want.Results[i].Vulnerabilities[j].PkgIdentifier.UID = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,17 @@ import (
|
||||
// "mage test:k8s" will run this test.
|
||||
|
||||
func TestK8s(t *testing.T) {
|
||||
// Set up testing DB
|
||||
cacheDir := initDB(t)
|
||||
t.Run("misconfig and vulnerability scan", func(t *testing.T) {
|
||||
// Set up the output file
|
||||
outputFile := filepath.Join(t.TempDir(), "output.json")
|
||||
|
||||
osArgs := []string{
|
||||
"--cache-dir",
|
||||
cacheDir,
|
||||
"k8s",
|
||||
"cluster",
|
||||
"kind-kind-test",
|
||||
"--report",
|
||||
"summary",
|
||||
"-q",
|
||||
@@ -35,10 +39,6 @@ func TestK8s(t *testing.T) {
|
||||
"5m0s",
|
||||
"--format",
|
||||
"json",
|
||||
"--components",
|
||||
"workload",
|
||||
"--context",
|
||||
"kind-kind-test",
|
||||
"--output",
|
||||
outputFile,
|
||||
}
|
||||
@@ -75,12 +75,10 @@ func TestK8s(t *testing.T) {
|
||||
outputFile := filepath.Join(t.TempDir(), "output.json")
|
||||
osArgs := []string{
|
||||
"k8s",
|
||||
"cluster",
|
||||
"kind-kind-test",
|
||||
"--format",
|
||||
"cyclonedx",
|
||||
"-q",
|
||||
"--context",
|
||||
"kind-kind-test",
|
||||
"--output",
|
||||
outputFile,
|
||||
}
|
||||
@@ -107,51 +105,5 @@ func TestK8s(t *testing.T) {
|
||||
assert.True(t, lo.SomeBy(*got.Dependencies, func(r cdx.Dependency) bool {
|
||||
return len(*r.Dependencies) > 0
|
||||
}))
|
||||
|
||||
})
|
||||
|
||||
t.Run("specific resource scan", func(t *testing.T) {
|
||||
// Set up the output file
|
||||
outputFile := filepath.Join(t.TempDir(), "output.json")
|
||||
|
||||
osArgs := []string{
|
||||
"k8s",
|
||||
"-n",
|
||||
"default",
|
||||
"deployments/nginx-deployment",
|
||||
"-q",
|
||||
"--timeout",
|
||||
"5m0s",
|
||||
"--format",
|
||||
"json",
|
||||
"--components",
|
||||
"workload",
|
||||
"--context",
|
||||
"kind-kind-test",
|
||||
"--output",
|
||||
outputFile,
|
||||
}
|
||||
|
||||
// Run Trivy
|
||||
err := execute(osArgs)
|
||||
require.NoError(t, err)
|
||||
|
||||
var got report.Report
|
||||
f, err := os.Open(outputFile)
|
||||
require.NoError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
err = json.NewDecoder(f).Decode(&got)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Flatten findings
|
||||
results := lo.FlatMap(got.Resources, func(resource report.Resource, _ int) []types.Result {
|
||||
return resource.Results
|
||||
})
|
||||
|
||||
// Has vulnerabilities
|
||||
assert.True(t, lo.SomeBy(results, func(r types.Result) bool {
|
||||
return len(r.Vulnerabilities) > 0
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -202,12 +202,12 @@ func TestRegistry(t *testing.T) {
|
||||
// Run Trivy
|
||||
runTest(t, osArgs, tc.golden, "", types.FormatJSON, runOptions{
|
||||
wantErr: tc.wantErr,
|
||||
override: func(_, got *types.Report) {
|
||||
override: overrideFuncs(overrideUID, func(t *testing.T, _, got *types.Report) {
|
||||
got.ArtifactName = tc.imageName
|
||||
for i := range got.Results {
|
||||
got.Results[i].Target = fmt.Sprintf("%s (alpine 3.10.2)", tc.imageName)
|
||||
}
|
||||
},
|
||||
}),
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestRepository(t *testing.T) {
|
||||
name string
|
||||
args args
|
||||
golden string
|
||||
override func(want, got *types.Report)
|
||||
override func(t *testing.T, want, got *types.Report)
|
||||
}{
|
||||
{
|
||||
name: "gomod",
|
||||
@@ -341,6 +341,15 @@ func TestRepository(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/conda-cyclonedx.json.golden",
|
||||
},
|
||||
{
|
||||
name: "conda environment.yaml generating CycloneDX SBOM",
|
||||
args: args{
|
||||
command: "fs",
|
||||
format: "cyclonedx",
|
||||
input: "testdata/fixtures/repo/conda-environment",
|
||||
},
|
||||
golden: "testdata/conda-environment-cyclonedx.json.golden",
|
||||
},
|
||||
{
|
||||
name: "pom.xml generating CycloneDX SBOM (with vulnerabilities)",
|
||||
args: args{
|
||||
@@ -369,7 +378,7 @@ func TestRepository(t *testing.T) {
|
||||
skipFiles: []string{"testdata/fixtures/repo/gomod/submod2/go.mod"},
|
||||
},
|
||||
golden: "testdata/gomod-skip.json.golden",
|
||||
override: func(want, _ *types.Report) {
|
||||
override: func(_ *testing.T, want, _ *types.Report) {
|
||||
want.ArtifactType = ftypes.ArtifactFilesystem
|
||||
},
|
||||
},
|
||||
@@ -383,7 +392,7 @@ func TestRepository(t *testing.T) {
|
||||
input: "testdata/fixtures/repo/custom-policy",
|
||||
},
|
||||
golden: "testdata/dockerfile-custom-policies.json.golden",
|
||||
override: func(want, got *types.Report) {
|
||||
override: func(_ *testing.T, want, got *types.Report) {
|
||||
want.ArtifactType = ftypes.ArtifactFilesystem
|
||||
},
|
||||
},
|
||||
|
||||
@@ -19,12 +19,13 @@ func TestSBOM(t *testing.T) {
|
||||
input string
|
||||
format string
|
||||
artifactType string
|
||||
scanners string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
golden string
|
||||
override types.Report
|
||||
override OverrideFunc
|
||||
}{
|
||||
{
|
||||
name: "centos7 cyclonedx",
|
||||
@@ -34,31 +35,17 @@ func TestSBOM(t *testing.T) {
|
||||
artifactType: "cyclonedx",
|
||||
},
|
||||
golden: "testdata/centos-7.json.golden",
|
||||
override: types.Report{
|
||||
ArtifactName: "testdata/fixtures/sbom/centos-7-cyclonedx.json",
|
||||
ArtifactType: ftypes.ArtifactType("cyclonedx"),
|
||||
Results: types.Results{
|
||||
{
|
||||
Target: "testdata/fixtures/sbom/centos-7-cyclonedx.json (centos 7.6.1810)",
|
||||
Vulnerabilities: []types.DetectedVulnerability{
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
override: func(t *testing.T, want, got *types.Report) {
|
||||
want.ArtifactName = "testdata/fixtures/sbom/centos-7-cyclonedx.json"
|
||||
want.ArtifactType = ftypes.ArtifactCycloneDX
|
||||
|
||||
require.Len(t, got.Results, 1)
|
||||
want.Results[0].Target = "testdata/fixtures/sbom/centos-7-cyclonedx.json (centos 7.6.1810)"
|
||||
|
||||
require.Len(t, got.Results[0].Vulnerabilities, 3)
|
||||
want.Results[0].Vulnerabilities[0].PkgIdentifier.BOMRef = "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810"
|
||||
want.Results[0].Vulnerabilities[1].PkgIdentifier.BOMRef = "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"
|
||||
want.Results[0].Vulnerabilities[2].PkgIdentifier.BOMRef = "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -87,31 +74,17 @@ func TestSBOM(t *testing.T) {
|
||||
artifactType: "cyclonedx",
|
||||
},
|
||||
golden: "testdata/centos-7.json.golden",
|
||||
override: types.Report{
|
||||
ArtifactName: "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl",
|
||||
ArtifactType: ftypes.ArtifactType("cyclonedx"),
|
||||
Results: types.Results{
|
||||
{
|
||||
Target: "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl (centos 7.6.1810)",
|
||||
Vulnerabilities: []types.DetectedVulnerability{
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
{
|
||||
PkgIdentifier: ftypes.PkgIdentifier{
|
||||
BOMRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
override: func(t *testing.T, want, got *types.Report) {
|
||||
want.ArtifactName = "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl"
|
||||
want.ArtifactType = ftypes.ArtifactCycloneDX
|
||||
|
||||
require.Len(t, got.Results, 1)
|
||||
want.Results[0].Target = "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl (centos 7.6.1810)"
|
||||
|
||||
require.Len(t, got.Results[0].Vulnerabilities, 3)
|
||||
want.Results[0].Vulnerabilities[0].PkgIdentifier.BOMRef = "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810"
|
||||
want.Results[0].Vulnerabilities[1].PkgIdentifier.BOMRef = "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"
|
||||
want.Results[0].Vulnerabilities[2].PkgIdentifier.BOMRef = "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -122,14 +95,12 @@ func TestSBOM(t *testing.T) {
|
||||
artifactType: "spdx",
|
||||
},
|
||||
golden: "testdata/centos-7.json.golden",
|
||||
override: types.Report{
|
||||
ArtifactName: "testdata/fixtures/sbom/centos-7-spdx.txt",
|
||||
ArtifactType: ftypes.ArtifactType("spdx"),
|
||||
Results: types.Results{
|
||||
{
|
||||
Target: "testdata/fixtures/sbom/centos-7-spdx.txt (centos 7.6.1810)",
|
||||
},
|
||||
},
|
||||
override: func(t *testing.T, want, got *types.Report) {
|
||||
want.ArtifactName = "testdata/fixtures/sbom/centos-7-spdx.txt"
|
||||
want.ArtifactType = ftypes.ArtifactSPDX
|
||||
|
||||
require.Len(t, got.Results, 1)
|
||||
want.Results[0].Target = "testdata/fixtures/sbom/centos-7-spdx.txt (centos 7.6.1810)"
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -140,16 +111,24 @@ func TestSBOM(t *testing.T) {
|
||||
artifactType: "spdx",
|
||||
},
|
||||
golden: "testdata/centos-7.json.golden",
|
||||
override: types.Report{
|
||||
ArtifactName: "testdata/fixtures/sbom/centos-7-spdx.json",
|
||||
ArtifactType: ftypes.ArtifactType("spdx"),
|
||||
Results: types.Results{
|
||||
{
|
||||
Target: "testdata/fixtures/sbom/centos-7-spdx.json (centos 7.6.1810)",
|
||||
},
|
||||
},
|
||||
override: func(t *testing.T, want, got *types.Report) {
|
||||
want.ArtifactName = "testdata/fixtures/sbom/centos-7-spdx.json"
|
||||
want.ArtifactType = ftypes.ArtifactSPDX
|
||||
|
||||
require.Len(t, got.Results, 1)
|
||||
want.Results[0].Target = "testdata/fixtures/sbom/centos-7-spdx.json (centos 7.6.1810)"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "license check cyclonedx json",
|
||||
args: args{
|
||||
input: "testdata/fixtures/sbom/license-cyclonedx.json",
|
||||
format: "json",
|
||||
artifactType: "cyclonedx",
|
||||
scanners: "license",
|
||||
},
|
||||
golden: "testdata/license-cyclonedx.json.golden",
|
||||
},
|
||||
}
|
||||
|
||||
// Set up testing DB
|
||||
@@ -157,6 +136,11 @@ func TestSBOM(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
scanners := "vuln"
|
||||
if tt.args.scanners != "" {
|
||||
scanners = tt.args.scanners
|
||||
}
|
||||
|
||||
osArgs := []string{
|
||||
"--cache-dir",
|
||||
cacheDir,
|
||||
@@ -165,6 +149,8 @@ func TestSBOM(t *testing.T) {
|
||||
"--skip-db-update",
|
||||
"--format",
|
||||
tt.args.format,
|
||||
"--scanners",
|
||||
scanners,
|
||||
}
|
||||
|
||||
// Set up the output file
|
||||
@@ -177,20 +163,30 @@ func TestSBOM(t *testing.T) {
|
||||
osArgs = append(osArgs, tt.args.input)
|
||||
|
||||
// Run "trivy sbom"
|
||||
err := execute(osArgs)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Compare want and got
|
||||
switch tt.args.format {
|
||||
case "json":
|
||||
compareSBOMReports(t, tt.golden, outputFile, tt.override)
|
||||
default:
|
||||
require.Fail(t, "invalid format", "format: %s", tt.args.format)
|
||||
}
|
||||
runTest(t, osArgs, tt.golden, outputFile, types.Format(tt.args.format), runOptions{
|
||||
override: overrideFuncs(overrideSBOMReport, overrideUID, tt.override),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func overrideSBOMReport(t *testing.T, want, got *types.Report) {
|
||||
want.Metadata.ImageID = ""
|
||||
want.Metadata.ImageConfig = v1.ConfigFile{}
|
||||
want.Metadata.DiffIDs = nil
|
||||
for i, result := range want.Results {
|
||||
for j := range result.Vulnerabilities {
|
||||
want.Results[i].Vulnerabilities[j].Layer.DiffID = ""
|
||||
}
|
||||
}
|
||||
|
||||
// when running on Windows FS
|
||||
got.ArtifactName = filepath.ToSlash(filepath.Clean(got.ArtifactName))
|
||||
for i, result := range got.Results {
|
||||
got.Results[i].Target = filepath.ToSlash(filepath.Clean(result.Target))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(teppei): merge into compareReports
|
||||
func compareSBOMReports(t *testing.T, wantFile, gotFile string, overrideWant types.Report) {
|
||||
want := readReport(t, wantFile)
|
||||
@@ -223,5 +219,10 @@ func compareSBOMReports(t *testing.T, wantFile, gotFile string, overrideWant typ
|
||||
}
|
||||
|
||||
got := readReport(t, gotFile)
|
||||
// when running on Windows FS
|
||||
got.ArtifactName = filepath.ToSlash(filepath.Clean(got.ArtifactName))
|
||||
for i, result := range got.Results {
|
||||
got.Results[i].Target = filepath.ToSlash(filepath.Clean(result.Target))
|
||||
}
|
||||
assert.Equal(t, want, got)
|
||||
}
|
||||
|
||||
3
integration/testdata/almalinux-8.json.golden
vendored
3
integration/testdata/almalinux-8.json.golden
vendored
@@ -57,7 +57,8 @@
|
||||
"PkgID": "openssl-libs@1.1.1k-4.el8.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/alma/openssl-libs@1.1.1k-4.el8?arch=x86_64\u0026distro=alma-8.5\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/alma/openssl-libs@1.1.1k-4.el8?arch=x86_64\u0026distro=alma-8.5\u0026epoch=1",
|
||||
"UID": "3f965238234faa63"
|
||||
},
|
||||
"InstalledVersion": "1:1.1.1k-4.el8",
|
||||
"FixedVersion": "1:1.1.1k-5.el8_5",
|
||||
|
||||
12
integration/testdata/alpine-310.json.golden
vendored
12
integration/testdata/alpine-310.json.golden
vendored
@@ -59,7 +59,8 @@
|
||||
"PkgID": "libcrypto1.1@1.1.1c-r0",
|
||||
"PkgName": "libcrypto1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2"
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2",
|
||||
"UID": "c6c116a4441ec6de"
|
||||
},
|
||||
"InstalledVersion": "1.1.1c-r0",
|
||||
"FixedVersion": "1.1.1d-r0",
|
||||
@@ -131,7 +132,8 @@
|
||||
"PkgID": "libcrypto1.1@1.1.1c-r0",
|
||||
"PkgName": "libcrypto1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2"
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2",
|
||||
"UID": "c6c116a4441ec6de"
|
||||
},
|
||||
"InstalledVersion": "1.1.1c-r0",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
@@ -213,7 +215,8 @@
|
||||
"PkgID": "libssl1.1@1.1.1c-r0",
|
||||
"PkgName": "libssl1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2"
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2",
|
||||
"UID": "e132dcfcc51772ef"
|
||||
},
|
||||
"InstalledVersion": "1.1.1c-r0",
|
||||
"FixedVersion": "1.1.1d-r0",
|
||||
@@ -285,7 +288,8 @@
|
||||
"PkgID": "libssl1.1@1.1.1c-r0",
|
||||
"PkgName": "libssl1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2"
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1c-r0?arch=x86_64\u0026distro=3.10.2",
|
||||
"UID": "e132dcfcc51772ef"
|
||||
},
|
||||
"InstalledVersion": "1.1.1c-r0",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
"PkgID": "musl@1.1.20-r4",
|
||||
"PkgName": "musl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/musl@1.1.20-r4?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/musl@1.1.20-r4?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "d6abd271e71d3ce2"
|
||||
},
|
||||
"InstalledVersion": "1.1.20-r4",
|
||||
"FixedVersion": "1.1.20-r5",
|
||||
@@ -104,7 +105,8 @@
|
||||
"PkgID": "musl-utils@1.1.20-r4",
|
||||
"PkgName": "musl-utils",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/musl-utils@1.1.20-r4?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/musl-utils@1.1.20-r4?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "8c341199f4077fc8"
|
||||
},
|
||||
"InstalledVersion": "1.1.20-r4",
|
||||
"FixedVersion": "1.1.20-r5",
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
"PkgID": "libcrypto1.1@1.1.1b-r1",
|
||||
"PkgName": "libcrypto1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "d2c46e721bca75d3"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
@@ -141,7 +142,8 @@
|
||||
"PkgID": "libssl1.1@1.1.1b-r1",
|
||||
"PkgName": "libssl1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "e39a91b0fefcbb1d"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
|
||||
18
integration/testdata/alpine-39.json.golden
vendored
18
integration/testdata/alpine-39.json.golden
vendored
@@ -59,7 +59,8 @@
|
||||
"PkgID": "libcrypto1.1@1.1.1b-r1",
|
||||
"PkgName": "libcrypto1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "d2c46e721bca75d3"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r0",
|
||||
@@ -131,7 +132,8 @@
|
||||
"PkgID": "libcrypto1.1@1.1.1b-r1",
|
||||
"PkgName": "libcrypto1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libcrypto1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "d2c46e721bca75d3"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
@@ -213,7 +215,8 @@
|
||||
"PkgID": "libssl1.1@1.1.1b-r1",
|
||||
"PkgName": "libssl1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "e39a91b0fefcbb1d"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r0",
|
||||
@@ -285,7 +288,8 @@
|
||||
"PkgID": "libssl1.1@1.1.1b-r1",
|
||||
"PkgName": "libssl1.1",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/libssl1.1@1.1.1b-r1?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "e39a91b0fefcbb1d"
|
||||
},
|
||||
"InstalledVersion": "1.1.1b-r1",
|
||||
"FixedVersion": "1.1.1d-r2",
|
||||
@@ -367,7 +371,8 @@
|
||||
"PkgID": "musl@1.1.20-r4",
|
||||
"PkgName": "musl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/musl@1.1.20-r4?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/musl@1.1.20-r4?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "d6abd271e71d3ce2"
|
||||
},
|
||||
"InstalledVersion": "1.1.20-r4",
|
||||
"FixedVersion": "1.1.20-r5",
|
||||
@@ -412,7 +417,8 @@
|
||||
"PkgID": "musl-utils@1.1.20-r4",
|
||||
"PkgName": "musl-utils",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/musl-utils@1.1.20-r4?arch=x86_64\u0026distro=3.9.4"
|
||||
"PURL": "pkg:apk/alpine/musl-utils@1.1.20-r4?arch=x86_64\u0026distro=3.9.4",
|
||||
"UID": "8c341199f4077fc8"
|
||||
},
|
||||
"InstalledVersion": "1.1.20-r4",
|
||||
"FixedVersion": "1.1.20-r5",
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
"PkgID": "git@2.35.1-r2",
|
||||
"PkgName": "git",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:apk/alpine/git@2.35.1-r2?arch=x86_64\u0026distro=3.16"
|
||||
"PURL": "pkg:apk/alpine/git@2.35.1-r2?arch=x86_64\u0026distro=3.16",
|
||||
"UID": "d44ac4666246b919"
|
||||
},
|
||||
"InstalledVersion": "2.35.1-r2",
|
||||
"FixedVersion": "2.35.2-r0",
|
||||
|
||||
3
integration/testdata/amazon-1.json.golden
vendored
3
integration/testdata/amazon-1.json.golden
vendored
@@ -58,7 +58,8 @@
|
||||
"PkgID": "curl@7.61.1-11.91.amzn1.x86_64",
|
||||
"PkgName": "curl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-11.91.amzn1?arch=x86_64\u0026distro=amazon-AMI+release+2018.03"
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-11.91.amzn1?arch=x86_64\u0026distro=amazon-AMI+release+2018.03",
|
||||
"UID": "9fafb1be522b1e7"
|
||||
},
|
||||
"InstalledVersion": "7.61.1-11.91.amzn1",
|
||||
"FixedVersion": "7.61.1-12.93.amzn1",
|
||||
|
||||
6
integration/testdata/amazon-2.json.golden
vendored
6
integration/testdata/amazon-2.json.golden
vendored
@@ -58,7 +58,8 @@
|
||||
"PkgID": "curl@7.61.1-9.amzn2.0.1.x86_64",
|
||||
"PkgName": "curl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-9.amzn2.0.1?arch=x86_64\u0026distro=amazon-2+%28Karoo%29"
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-9.amzn2.0.1?arch=x86_64\u0026distro=amazon-2+%28Karoo%29",
|
||||
"UID": "c5998529d683c5c3"
|
||||
},
|
||||
"InstalledVersion": "7.61.1-9.amzn2.0.1",
|
||||
"FixedVersion": "7.61.1-12.amzn2.0.1",
|
||||
@@ -129,7 +130,8 @@
|
||||
"PkgID": "curl@7.61.1-9.amzn2.0.1.x86_64",
|
||||
"PkgName": "curl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-9.amzn2.0.1?arch=x86_64\u0026distro=amazon-2+%28Karoo%29"
|
||||
"PURL": "pkg:rpm/amazon/curl@7.61.1-9.amzn2.0.1?arch=x86_64\u0026distro=amazon-2+%28Karoo%29",
|
||||
"UID": "c5998529d683c5c3"
|
||||
},
|
||||
"InstalledVersion": "7.61.1-9.amzn2.0.1",
|
||||
"FixedVersion": "7.61.1-11.amzn2.0.2",
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
"PkgID": "ammonia@1.9.0",
|
||||
"PkgName": "ammonia",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:cargo/ammonia@1.9.0"
|
||||
"PURL": "pkg:cargo/ammonia@1.9.0",
|
||||
"UID": "fa518cac41270ffe"
|
||||
},
|
||||
"InstalledVersion": "1.9.0",
|
||||
"FixedVersion": "\u003e= 2.1.0",
|
||||
@@ -103,7 +104,8 @@
|
||||
"PkgID": "ammonia@1.9.0",
|
||||
"PkgName": "ammonia",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:cargo/ammonia@1.9.0"
|
||||
"PURL": "pkg:cargo/ammonia@1.9.0",
|
||||
"UID": "fa518cac41270ffe"
|
||||
},
|
||||
"InstalledVersion": "1.9.0",
|
||||
"FixedVersion": "\u003e= 3.1.0, \u003e= 2.1.3, \u003c 3.0.0",
|
||||
|
||||
6
integration/testdata/centos-6.json.golden
vendored
6
integration/testdata/centos-6.json.golden
vendored
@@ -80,7 +80,8 @@
|
||||
"PkgID": "glibc@2.12-1.212.el6.x86_64",
|
||||
"PkgName": "glibc",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/glibc@2.12-1.212.el6?arch=x86_64\u0026distro=centos-6.10"
|
||||
"PURL": "pkg:rpm/centos/glibc@2.12-1.212.el6?arch=x86_64\u0026distro=centos-6.10",
|
||||
"UID": "24b11591bb7262c4"
|
||||
},
|
||||
"InstalledVersion": "2.12-1.212.el6",
|
||||
"Status": "end_of_life",
|
||||
@@ -136,7 +137,8 @@
|
||||
"PkgID": "openssl@1.0.1e-57.el6.x86_64",
|
||||
"PkgName": "openssl",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl@1.0.1e-57.el6?arch=x86_64\u0026distro=centos-6.10"
|
||||
"PURL": "pkg:rpm/centos/openssl@1.0.1e-57.el6?arch=x86_64\u0026distro=centos-6.10",
|
||||
"UID": "935959fd0ed81eb9"
|
||||
},
|
||||
"InstalledVersion": "1.0.1e-57.el6",
|
||||
"FixedVersion": "1.0.1e-58.el6_10",
|
||||
|
||||
@@ -73,7 +73,8 @@
|
||||
"PkgID": "openssl-libs@1.0.2k-16.el7.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1",
|
||||
"UID": "20f09cdcea6545a2"
|
||||
},
|
||||
"InstalledVersion": "1:1.0.2k-16.el7",
|
||||
"FixedVersion": "1:1.0.2k-19.el7",
|
||||
@@ -166,7 +167,8 @@
|
||||
"PkgID": "openssl-libs@1.0.2k-16.el7.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1",
|
||||
"UID": "20f09cdcea6545a2"
|
||||
},
|
||||
"InstalledVersion": "1:1.0.2k-16.el7",
|
||||
"FixedVersion": "1:1.0.2k-19.el7",
|
||||
|
||||
@@ -73,7 +73,8 @@
|
||||
"PkgID": "openssl-libs@1.0.2k-16.el7.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1",
|
||||
"UID": "20f09cdcea6545a2"
|
||||
},
|
||||
"InstalledVersion": "1:1.0.2k-16.el7",
|
||||
"FixedVersion": "1:1.0.2k-19.el7",
|
||||
|
||||
9
integration/testdata/centos-7.json.golden
vendored
9
integration/testdata/centos-7.json.golden
vendored
@@ -70,7 +70,8 @@
|
||||
"PkgID": "bash@4.2.46-31.el7.x86_64",
|
||||
"PkgName": "bash",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64\u0026distro=centos-7.6.1810"
|
||||
"PURL": "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64\u0026distro=centos-7.6.1810",
|
||||
"UID": "64aff37eb11b9c25"
|
||||
},
|
||||
"InstalledVersion": "4.2.46-31.el7",
|
||||
"Status": "will_not_fix",
|
||||
@@ -130,7 +131,8 @@
|
||||
"PkgID": "openssl-libs@1.0.2k-16.el7.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1",
|
||||
"UID": "20f09cdcea6545a2"
|
||||
},
|
||||
"InstalledVersion": "1:1.0.2k-16.el7",
|
||||
"FixedVersion": "1:1.0.2k-19.el7",
|
||||
@@ -223,7 +225,8 @@
|
||||
"PkgID": "openssl-libs@1.0.2k-16.el7.x86_64",
|
||||
"PkgName": "openssl-libs",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1"
|
||||
"PURL": "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64\u0026distro=centos-7.6.1810\u0026epoch=1",
|
||||
"UID": "20f09cdcea6545a2"
|
||||
},
|
||||
"InstalledVersion": "1:1.0.2k-16.el7",
|
||||
"FixedVersion": "1:1.0.2k-19.el7",
|
||||
|
||||
6
integration/testdata/cocoapods.json.golden
vendored
6
integration/testdata/cocoapods.json.golden
vendored
@@ -25,7 +25,8 @@
|
||||
"ID": "_NIODataStructures@2.41.0",
|
||||
"Name": "_NIODataStructures",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:cocoapods/_NIODataStructures@2.41.0"
|
||||
"PURL": "pkg:cocoapods/_NIODataStructures@2.41.0",
|
||||
"UID": "ddc948d6b5e15241"
|
||||
},
|
||||
"Version": "2.41.0",
|
||||
"Layer": {}
|
||||
@@ -37,7 +38,8 @@
|
||||
"PkgID": "_NIODataStructures@2.41.0",
|
||||
"PkgName": "_NIODataStructures",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:cocoapods/_NIODataStructures@2.41.0"
|
||||
"PURL": "pkg:cocoapods/_NIODataStructures@2.41.0",
|
||||
"UID": "ddc948d6b5e15241"
|
||||
},
|
||||
"InstalledVersion": "2.41.0",
|
||||
"FixedVersion": "2.29.1, 2.39.1, 2.42.0",
|
||||
|
||||
11
integration/testdata/composer.lock.json.golden
vendored
11
integration/testdata/composer.lock.json.golden
vendored
@@ -25,12 +25,14 @@
|
||||
"ID": "guzzlehttp/guzzle@7.4.4",
|
||||
"Name": "guzzlehttp/guzzle",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:composer/guzzlehttp/guzzle@7.4.4"
|
||||
"PURL": "pkg:composer/guzzlehttp/guzzle@7.4.4",
|
||||
"UID": "c26bf8868607a91c"
|
||||
},
|
||||
"Version": "7.4.4",
|
||||
"Licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"Relationship": "direct",
|
||||
"DependsOn": [
|
||||
"guzzlehttp/psr7@1.8.3"
|
||||
],
|
||||
@@ -46,13 +48,15 @@
|
||||
"ID": "guzzlehttp/psr7@1.8.3",
|
||||
"Name": "guzzlehttp/psr7",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:composer/guzzlehttp/psr7@1.8.3"
|
||||
"PURL": "pkg:composer/guzzlehttp/psr7@1.8.3",
|
||||
"UID": "1730859e3ff83ab9"
|
||||
},
|
||||
"Version": "1.8.3",
|
||||
"Licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -68,7 +72,8 @@
|
||||
"PkgID": "guzzlehttp/psr7@1.8.3",
|
||||
"PkgName": "guzzlehttp/psr7",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:composer/guzzlehttp/psr7@1.8.3"
|
||||
"PURL": "pkg:composer/guzzlehttp/psr7@1.8.3",
|
||||
"UID": "1730859e3ff83ab9"
|
||||
},
|
||||
"InstalledVersion": "1.8.3",
|
||||
"FixedVersion": "1.8.4",
|
||||
|
||||
31
integration/testdata/conan.json.golden
vendored
31
integration/testdata/conan.json.golden
vendored
@@ -25,10 +25,12 @@
|
||||
"ID": "bzip2/1.0.8",
|
||||
"Name": "bzip2",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/bzip2@1.0.8"
|
||||
"PURL": "pkg:conan/bzip2@1.0.8",
|
||||
"UID": "6e2ff993df2d9107"
|
||||
},
|
||||
"Version": "1.0.8",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -41,10 +43,12 @@
|
||||
"ID": "expat/2.4.8",
|
||||
"Name": "expat",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/expat@2.4.8"
|
||||
"PURL": "pkg:conan/expat@2.4.8",
|
||||
"UID": "71c2d92d60f7f21c"
|
||||
},
|
||||
"Version": "2.4.8",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -57,10 +61,12 @@
|
||||
"ID": "openssl/1.1.1q",
|
||||
"Name": "openssl",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/openssl@1.1.1q"
|
||||
"PURL": "pkg:conan/openssl@1.1.1q",
|
||||
"UID": "13c605db6afa69dd"
|
||||
},
|
||||
"Version": "1.1.1q",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -73,10 +79,12 @@
|
||||
"ID": "pcre/8.43",
|
||||
"Name": "pcre",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/pcre@8.43"
|
||||
"PURL": "pkg:conan/pcre@8.43",
|
||||
"UID": "4e01c692a67e12e4"
|
||||
},
|
||||
"Version": "8.43",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"DependsOn": [
|
||||
"bzip2/1.0.8",
|
||||
"zlib/1.2.12"
|
||||
@@ -93,9 +101,11 @@
|
||||
"ID": "poco/1.9.4",
|
||||
"Name": "poco",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/poco@1.9.4"
|
||||
"PURL": "pkg:conan/poco@1.9.4",
|
||||
"UID": "312753cebe80c0eb"
|
||||
},
|
||||
"Version": "1.9.4",
|
||||
"Relationship": "direct",
|
||||
"DependsOn": [
|
||||
"pcre/8.43",
|
||||
"zlib/1.2.12",
|
||||
@@ -115,10 +125,12 @@
|
||||
"ID": "sqlite3/3.39.2",
|
||||
"Name": "sqlite3",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/sqlite3@3.39.2"
|
||||
"PURL": "pkg:conan/sqlite3@3.39.2",
|
||||
"UID": "43bc9c58092c7c9e"
|
||||
},
|
||||
"Version": "3.39.2",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -131,10 +143,12 @@
|
||||
"ID": "zlib/1.2.12",
|
||||
"Name": "zlib",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:conan/zlib@1.2.12"
|
||||
"PURL": "pkg:conan/zlib@1.2.12",
|
||||
"UID": "d6faf8d6dfd1985"
|
||||
},
|
||||
"Version": "1.2.12",
|
||||
"Indirect": true,
|
||||
"Relationship": "indirect",
|
||||
"Layer": {},
|
||||
"Locations": [
|
||||
{
|
||||
@@ -150,7 +164,8 @@
|
||||
"PkgID": "pcre/8.43",
|
||||
"PkgName": "pcre",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:conan/pcre@8.43"
|
||||
"PURL": "pkg:conan/pcre@8.43",
|
||||
"UID": "4e01c692a67e12e4"
|
||||
},
|
||||
"InstalledVersion": "8.43",
|
||||
"FixedVersion": "8.45",
|
||||
|
||||
18
integration/testdata/conda-cyclonedx.json.golden
vendored
18
integration/testdata/conda-cyclonedx.json.golden
vendored
@@ -2,7 +2,7 @@
|
||||
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
|
||||
"bomFormat": "CycloneDX",
|
||||
"specVersion": "1.5",
|
||||
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000004",
|
||||
"version": 1,
|
||||
"metadata": {
|
||||
"timestamp": "2021-08-25T12:20:30+00:00",
|
||||
@@ -17,7 +17,7 @@
|
||||
]
|
||||
},
|
||||
"component": {
|
||||
"bom-ref": "3ff14136-e09f-4df9-80ea-000000000002",
|
||||
"bom-ref": "3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"type": "application",
|
||||
"name": "testdata/fixtures/repo/conda",
|
||||
"properties": [
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"bom-ref": "pkg:conda/openssl@1.1.1q?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fopenssl-1.1.1q-h7f8727e_0.json",
|
||||
"bom-ref": "pkg:conda/openssl@1.1.1q",
|
||||
"type": "library",
|
||||
"name": "openssl",
|
||||
"version": "1.1.1q",
|
||||
@@ -54,7 +54,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"bom-ref": "pkg:conda/pip@22.2.2?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fpip-22.2.2-py38h06a4308_0.json",
|
||||
"bom-ref": "pkg:conda/pip@22.2.2",
|
||||
"type": "library",
|
||||
"name": "pip",
|
||||
"version": "22.2.2",
|
||||
@@ -80,18 +80,18 @@
|
||||
],
|
||||
"dependencies": [
|
||||
{
|
||||
"ref": "3ff14136-e09f-4df9-80ea-000000000002",
|
||||
"ref": "3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"dependsOn": [
|
||||
"pkg:conda/openssl@1.1.1q?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fopenssl-1.1.1q-h7f8727e_0.json",
|
||||
"pkg:conda/pip@22.2.2?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fpip-22.2.2-py38h06a4308_0.json"
|
||||
"pkg:conda/openssl@1.1.1q",
|
||||
"pkg:conda/pip@22.2.2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ref": "pkg:conda/openssl@1.1.1q?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fopenssl-1.1.1q-h7f8727e_0.json",
|
||||
"ref": "pkg:conda/openssl@1.1.1q",
|
||||
"dependsOn": []
|
||||
},
|
||||
{
|
||||
"ref": "pkg:conda/pip@22.2.2?file_path=miniconda3%2Fenvs%2Ftestenv%2Fconda-meta%2Fpip-22.2.2-py38h06a4308_0.json",
|
||||
"ref": "pkg:conda/pip@22.2.2",
|
||||
"dependsOn": []
|
||||
}
|
||||
],
|
||||
|
||||
80
integration/testdata/conda-environment-cyclonedx.json.golden
vendored
Normal file
80
integration/testdata/conda-environment-cyclonedx.json.golden
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
|
||||
"bomFormat": "CycloneDX",
|
||||
"specVersion": "1.5",
|
||||
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000004",
|
||||
"version": 1,
|
||||
"metadata": {
|
||||
"timestamp": "2021-08-25T12:20:30+00:00",
|
||||
"tools": {
|
||||
"components": [
|
||||
{
|
||||
"type": "application",
|
||||
"group": "aquasecurity",
|
||||
"name": "trivy",
|
||||
"version": "dev"
|
||||
}
|
||||
]
|
||||
},
|
||||
"component": {
|
||||
"bom-ref": "3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"type": "application",
|
||||
"name": "testdata/fixtures/repo/conda-environment",
|
||||
"properties": [
|
||||
{
|
||||
"name": "aquasecurity:trivy:SchemaVersion",
|
||||
"value": "2"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"bom-ref": "3ff14136-e09f-4df9-80ea-000000000002",
|
||||
"type": "application",
|
||||
"name": "environment.yaml",
|
||||
"properties": [
|
||||
{
|
||||
"name": "aquasecurity:trivy:Class",
|
||||
"value": "lang-pkgs"
|
||||
},
|
||||
{
|
||||
"name": "aquasecurity:trivy:Type",
|
||||
"value": "conda-environment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bom-ref": "pkg:conda/bzip2@1.0.8",
|
||||
"type": "library",
|
||||
"name": "bzip2",
|
||||
"version": "1.0.8",
|
||||
"purl": "pkg:conda/bzip2@1.0.8",
|
||||
"properties": [
|
||||
{
|
||||
"name": "aquasecurity:trivy:PkgType",
|
||||
"value": "conda-environment"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"dependencies": [
|
||||
{
|
||||
"ref": "3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"dependsOn": [
|
||||
"3ff14136-e09f-4df9-80ea-000000000002"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ref": "3ff14136-e09f-4df9-80ea-000000000002",
|
||||
"dependsOn": [
|
||||
"pkg:conda/bzip2@1.0.8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ref": "pkg:conda/bzip2@1.0.8",
|
||||
"dependsOn": []
|
||||
}
|
||||
],
|
||||
"vulnerabilities": []
|
||||
}
|
||||
43
integration/testdata/conda-spdx.json.golden
vendored
43
integration/testdata/conda-spdx.json.golden
vendored
@@ -3,7 +3,7 @@
|
||||
"dataLicense": "CC0-1.0",
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"name": "testdata/fixtures/repo/conda",
|
||||
"documentNamespace": "http://aquasecurity.github.io/trivy/filesystem/testdata/fixtures/repo/conda-3ff14136-e09f-4df9-80ea-000000000001",
|
||||
"documentNamespace": "http://aquasecurity.github.io/trivy/filesystem/testdata/fixtures/repo/conda-3ff14136-e09f-4df9-80ea-000000000004",
|
||||
"creationInfo": {
|
||||
"creators": [
|
||||
"Organization: aquasecurity",
|
||||
@@ -12,17 +12,9 @@
|
||||
"created": "2021-08-25T12:20:30Z"
|
||||
},
|
||||
"packages": [
|
||||
{
|
||||
"name": "conda-pkg",
|
||||
"SPDXID": "SPDXRef-Application-ee5ef1aa4ac89125",
|
||||
"downloadLocation": "NONE",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "Conda",
|
||||
"primaryPackagePurpose": "APPLICATION"
|
||||
},
|
||||
{
|
||||
"name": "openssl",
|
||||
"SPDXID": "SPDXRef-Package-20b95c21bfbf9fc4",
|
||||
"SPDXID": "SPDXRef-Package-b8061a5279413d55",
|
||||
"versionInfo": "1.1.1q",
|
||||
"supplier": "NOASSERTION",
|
||||
"downloadLocation": "NONE",
|
||||
@@ -39,11 +31,14 @@
|
||||
"referenceLocator": "pkg:conda/openssl@1.1.1q"
|
||||
}
|
||||
],
|
||||
"attributionTexts": [
|
||||
"PkgType: conda-pkg"
|
||||
],
|
||||
"primaryPackagePurpose": "LIBRARY"
|
||||
},
|
||||
{
|
||||
"name": "pip",
|
||||
"SPDXID": "SPDXRef-Package-11a429ec3bd01d80",
|
||||
"SPDXID": "SPDXRef-Package-84198b3828050c11",
|
||||
"versionInfo": "22.2.2",
|
||||
"supplier": "NOASSERTION",
|
||||
"downloadLocation": "NONE",
|
||||
@@ -60,6 +55,9 @@
|
||||
"referenceLocator": "pkg:conda/pip@22.2.2"
|
||||
}
|
||||
],
|
||||
"attributionTexts": [
|
||||
"PkgType: conda-pkg"
|
||||
],
|
||||
"primaryPackagePurpose": "LIBRARY"
|
||||
},
|
||||
{
|
||||
@@ -105,28 +103,23 @@
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Filesystem-2e2426fd0f2580ef",
|
||||
"relatedSpdxElement": "SPDXRef-Application-ee5ef1aa4ac89125",
|
||||
"relatedSpdxElement": "SPDXRef-Package-84198b3828050c11",
|
||||
"relationshipType": "CONTAINS"
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Application-ee5ef1aa4ac89125",
|
||||
"relatedSpdxElement": "SPDXRef-Package-20b95c21bfbf9fc4",
|
||||
"spdxElementId": "SPDXRef-Filesystem-2e2426fd0f2580ef",
|
||||
"relatedSpdxElement": "SPDXRef-Package-b8061a5279413d55",
|
||||
"relationshipType": "CONTAINS"
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Package-20b95c21bfbf9fc4",
|
||||
"relatedSpdxElement": "SPDXRef-File-600e5e0110a84891",
|
||||
"relationshipType": "CONTAINS"
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Application-ee5ef1aa4ac89125",
|
||||
"relatedSpdxElement": "SPDXRef-Package-11a429ec3bd01d80",
|
||||
"relationshipType": "CONTAINS"
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Package-11a429ec3bd01d80",
|
||||
"spdxElementId": "SPDXRef-Package-84198b3828050c11",
|
||||
"relatedSpdxElement": "SPDXRef-File-7eb62e2a3edddc0a",
|
||||
"relationshipType": "CONTAINS"
|
||||
},
|
||||
{
|
||||
"spdxElementId": "SPDXRef-Package-b8061a5279413d55",
|
||||
"relatedSpdxElement": "SPDXRef-File-600e5e0110a84891",
|
||||
"relationshipType": "CONTAINS"
|
||||
}
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user