mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-10 23:00:48 -08:00
Compare commits
127 Commits
release/v0
...
v0.55.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a1e8b85b4 | ||
|
|
2d80769c34 | ||
|
|
f80183c113 | ||
|
|
2d97700d10 | ||
|
|
870523d384 | ||
|
|
da4ebfa1a7 | ||
|
|
af1d257730 | ||
|
|
1a6295c5e5 | ||
|
|
fd9ed3a330 | ||
|
|
c929290c3c | ||
|
|
feaef9699d | ||
|
|
0cac3ac707 | ||
|
|
bf64003ac8 | ||
|
|
3a5d091759 | ||
|
|
39c80248bc | ||
|
|
a5aa63eff7 | ||
|
|
c96dcdd440 | ||
|
|
7aea79dd93 | ||
|
|
4c6e8ca9cc | ||
|
|
84118d0f3d | ||
|
|
391448aba9 | ||
|
|
344dafd253 | ||
|
|
98e136eb7b | ||
|
|
9d7264af8e | ||
|
|
44e468603d | ||
|
|
0799770b88 | ||
|
|
dd9733e950 | ||
|
|
be861265ca | ||
|
|
45a9627054 | ||
|
|
e9b43f81e6 | ||
|
|
2a6c7ab3b3 | ||
|
|
b65b32ddfa | ||
|
|
9ef05fc6b1 | ||
|
|
bfdf5cfc30 | ||
|
|
6fe672732b | ||
|
|
24a4563686 | ||
|
|
3f0e7ebe0d | ||
|
|
05a829715f | ||
|
|
db2c95598d | ||
|
|
efdbd8f19a | ||
|
|
c5c62d5ff0 | ||
|
|
0c6687d5ba | ||
|
|
aadb090788 | ||
|
|
0047dbf361 | ||
|
|
ee339b5ed7 | ||
|
|
08cc14bd21 | ||
|
|
59c154144e | ||
|
|
2b6d8d9227 | ||
|
|
65d991cee7 | ||
|
|
7278abd4e4 | ||
|
|
ac3eb9d59c | ||
|
|
fe9207255a | ||
|
|
f0ed5e4ced | ||
|
|
a817fae85b | ||
|
|
a4180bddd4 | ||
|
|
c766831069 | ||
|
|
13789b718d | ||
|
|
85dadf5626 | ||
|
|
bb2e26a0ab | ||
|
|
555ac8c11d | ||
|
|
fd8348d610 | ||
|
|
e95152f796 | ||
|
|
2a0e529c36 | ||
|
|
49d5270163 | ||
|
|
b3ee6dac26 | ||
|
|
35c60f030f | ||
|
|
7024572137 | ||
|
|
45b3f34404 | ||
|
|
ff403a3841 | ||
|
|
b3ee4bc885 | ||
|
|
3b7aad3392 | ||
|
|
c2fd2e0d89 | ||
|
|
4a2f492c6e | ||
|
|
f198cf8973 | ||
|
|
54bb8bdfb9 | ||
|
|
4e54a7e84c | ||
|
|
805592d7ec | ||
|
|
5c37361600 | ||
|
|
f35f4a5e83 | ||
|
|
d76febaee1 | ||
|
|
8d5ba3f5e7 | ||
|
|
88ba46047c | ||
|
|
174b1e3515 | ||
|
|
bff317c77b | ||
|
|
c3036de6d7 | ||
|
|
7fa5e7d0ab | ||
|
|
8c87194f0a | ||
|
|
efb1f69383 | ||
|
|
0e286f074f | ||
|
|
051ac3901f | ||
|
|
92b13be668 | ||
|
|
92695630c0 | ||
|
|
9d5201808d | ||
|
|
5cbc452a09 | ||
|
|
5f780450ff | ||
|
|
5f78ea4aee | ||
|
|
5bc662be9a | ||
|
|
b76a725091 | ||
|
|
c8a7abd3b5 | ||
|
|
7066f5e674 | ||
|
|
d1ec89d1db | ||
|
|
2a577a7bae | ||
|
|
4308a0a5e3 | ||
|
|
d1f89672d9 | ||
|
|
a3a6de27c4 | ||
|
|
e674c93470 | ||
|
|
d2f4da86a4 | ||
|
|
f27c236d6e | ||
|
|
7cbdb0a0b5 | ||
|
|
5a9f1a66ee | ||
|
|
ab0fd0d2e7 | ||
|
|
17b5dbfa12 | ||
|
|
a64993e83a | ||
|
|
dc68a662a7 | ||
|
|
ec3e0ca147 | ||
|
|
25f8143f12 | ||
|
|
a7a304d53e | ||
|
|
cb89fbb124 | ||
|
|
03ac93dc20 | ||
|
|
266d9b1f4b | ||
|
|
1f5f348958 | ||
|
|
db68d106ce | ||
|
|
91f22372f9 | ||
|
|
acbec053c9 | ||
|
|
fc6b3a760b | ||
|
|
6a307bb389 | ||
|
|
c46472655e |
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@@ -15,8 +15,8 @@ pkg/cloud/ @simar7 @nikpivkin
|
||||
pkg/iac/ @simar7 @nikpivkin
|
||||
|
||||
# Helm chart
|
||||
helm/trivy/ @chen-keinan
|
||||
helm/trivy/ @afdesk
|
||||
|
||||
# Kubernetes scanning
|
||||
pkg/k8s/ @chen-keinan
|
||||
docs/docs/target/kubernetes.md @chen-keinan
|
||||
pkg/k8s/ @afdesk
|
||||
docs/docs/target/kubernetes.md @afdesk
|
||||
|
||||
4
.github/workflows/bypass-test.yaml
vendored
4
.github/workflows/bypass-test.yaml
vendored
@@ -22,12 +22,12 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest-m, windows-latest, macos-latest]
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- run: 'echo "No test required"'
|
||||
|
||||
integration:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest-m
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: 'echo "No test required"'
|
||||
4
.github/workflows/reusable-release.yaml
vendored
4
.github/workflows/reusable-release.yaml
vendored
@@ -91,7 +91,7 @@ jobs:
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: v2.0.0
|
||||
version: v2.1.0
|
||||
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
# because GoReleaser Free doesn't support pushing images with the `--snapshot` flag.
|
||||
- name: Build and push
|
||||
if: ${{ inputs.goreleaser_config == 'goreleaser-canary.yml' }}
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64, linux/arm64
|
||||
file: ./Dockerfile.canary # path to Dockerfile
|
||||
|
||||
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@v1.0.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.2 # 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@v1.0.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.2 # 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@v1.0.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.2 # 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@v1.0.1 # add new issue to project
|
||||
- uses: actions/add-to-project@v1.0.2 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
|
||||
20
.github/workflows/test.yaml
vendored
20
.github/workflows/test.yaml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest-m, windows-latest, macos-latest]
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
|
||||
@@ -31,15 +31,15 @@ jobs:
|
||||
echo "Run 'go mod tidy' and push it"
|
||||
exit 1
|
||||
fi
|
||||
if: matrix.operating-system == 'ubuntu-latest-m'
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Lint
|
||||
id: lint
|
||||
uses: golangci/golangci-lint-action@v6.0.1
|
||||
with:
|
||||
version: v1.58
|
||||
version: v1.59
|
||||
args: --verbose --out-format=line-number
|
||||
if: matrix.operating-system == 'ubuntu-latest-m'
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Check if linter failed
|
||||
run: |
|
||||
@@ -60,14 +60,14 @@ jobs:
|
||||
echo "Run 'mage docs:generate' and push it"
|
||||
exit 1
|
||||
fi
|
||||
if: matrix.operating-system == 'ubuntu-latest-m'
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Run unit tests
|
||||
run: mage test:unit
|
||||
|
||||
integration:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest-m
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4.1.6
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
|
||||
k8s-integration:
|
||||
name: K8s Integration Test
|
||||
runs-on: ubuntu-latest-m
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4.1.6
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
|
||||
vm-test:
|
||||
name: VM Integration Test
|
||||
runs-on: ubuntu-latest-m
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.6
|
||||
@@ -151,7 +151,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest-m, windows-latest, macos-latest]
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
@@ -178,5 +178,5 @@ jobs:
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: v2.0.0
|
||||
version: v2.1.0
|
||||
args: build --snapshot --clean --timeout 90m ${{ steps.goreleaser_id.outputs.id }}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{".":"0.53.0"}
|
||||
{".":"0.55.0"}
|
||||
|
||||
145
.vex/oci.openvex.json
Normal file
145
.vex/oci.openvex.json
Normal file
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"@context": "https://openvex.dev/ns/v0.2.0",
|
||||
"@id": "https://openvex.dev/docs/public/vex-8e30ed756ae8e4196af93bf43edf68360f396a98c0268787453a3443b26e7d6c",
|
||||
"author": "Aqua Security",
|
||||
"timestamp": "2024-07-10T12:17:44.60495+04:00",
|
||||
"version": 1,
|
||||
"statements": [
|
||||
{
|
||||
"vulnerability": {
|
||||
"name": "CVE-2023-42363"
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=index.docker.io%2Faquasec%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=public.ecr.aws%2Faquasecurity%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_cannot_be_controlled_by_adversary",
|
||||
"impact_statement": "awk is not used"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"name": "CVE-2023-42364"
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=index.docker.io%2Faquasec%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=public.ecr.aws%2Faquasecurity%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_cannot_be_controlled_by_adversary",
|
||||
"impact_statement": "awk is not used"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"name": "CVE-2023-42365"
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=index.docker.io%2Faquasec%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=public.ecr.aws%2Faquasecurity%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_cannot_be_controlled_by_adversary",
|
||||
"impact_statement": "awk is not used"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"name": "CVE-2023-42366"
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=index.docker.io%2Faquasec%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=public.ecr.aws%2Faquasecurity%2Ftrivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"},
|
||||
{"@id": "pkg:apk/alpine/ssl_client"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_cannot_be_controlled_by_adversary",
|
||||
"impact_statement": "awk is not used"
|
||||
}
|
||||
]
|
||||
}
|
||||
458
.vex/trivy.openvex.json
Normal file
458
.vex/trivy.openvex.json
Normal file
@@ -0,0 +1,458 @@
|
||||
{
|
||||
"@context": "https://openvex.dev/ns/v0.2.0",
|
||||
"@id": "aquasecurity/trivy:613fd55abbc2857b5ca28b07a26f3cd4c8b0ddc4c8a97c57497a2d4c4880d7fc",
|
||||
"author": "Aqua Security",
|
||||
"timestamp": "2024-07-09T11:38:00.115697+04:00",
|
||||
"version": 1,
|
||||
"tooling": "https://github.com/aquasecurity/trivy/tree/main/magefiles/vex.go",
|
||||
"statements": [
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2575",
|
||||
"name": "GO-2024-2575",
|
||||
"description": "Helm's Missing YAML Content Leads To Panic in helm.sh/helm/v3",
|
||||
"aliases": [
|
||||
"CVE-2024-26147",
|
||||
"GHSA-r53h-jv2g-vpx6"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/helm.sh/helm/v3",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/helm.sh/helm/v3"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-1765",
|
||||
"name": "GO-2023-1765",
|
||||
"description": "Leaked shared secret and weak blinding in github.com/cloudflare/circl",
|
||||
"aliases": [
|
||||
"CVE-2023-1732",
|
||||
"GHSA-2q89-485c-9j2x"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/cloudflare/circl",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/cloudflare/circl"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2512",
|
||||
"name": "GO-2024-2512",
|
||||
"description": "Classic builder cache poisoning in github.com/docker/docker",
|
||||
"aliases": [
|
||||
"CVE-2024-24557",
|
||||
"GHSA-xw73-rw38-6vjc"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/docker/docker",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/docker/docker"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2453",
|
||||
"name": "GO-2024-2453",
|
||||
"description": "Timing side channel in github.com/cloudflare/circl",
|
||||
"aliases": [
|
||||
"GHSA-9763-4f94-gfch"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/cloudflare/circl",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/cloudflare/circl"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-2048",
|
||||
"name": "GO-2023-2048",
|
||||
"description": "Paths outside of the rootfs could be produced on Windows in github.com/cyphar/filepath-securejoin",
|
||||
"aliases": [
|
||||
"GHSA-6xv5-86q9-7xr8"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/cyphar/filepath-securejoin",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/cyphar/filepath-securejoin"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2497",
|
||||
"name": "GO-2024-2497",
|
||||
"description": "Privilege escalation in github.com/moby/buildkit",
|
||||
"aliases": [
|
||||
"CVE-2024-23653",
|
||||
"GHSA-wr6v-9f75-vh2g"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/moby/buildkit",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/moby/buildkit"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-2102",
|
||||
"name": "GO-2023-2102",
|
||||
"description": "HTTP/2 rapid reset can cause excessive work in net/http",
|
||||
"aliases": [
|
||||
"CVE-2023-39325",
|
||||
"GHSA-4374-p667-p6c8"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/golang.org/x/net",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/golang.org/x/net"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2493",
|
||||
"name": "GO-2024-2493",
|
||||
"description": "Host system file access in github.com/moby/buildkit",
|
||||
"aliases": [
|
||||
"CVE-2024-23651",
|
||||
"GHSA-m3r6-h7wv-7xxv"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/moby/buildkit",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/moby/buildkit"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2491",
|
||||
"name": "GO-2024-2491",
|
||||
"description": "Container breakout through process.cwd trickery and leaked fds in github.com/opencontainers/runc",
|
||||
"aliases": [
|
||||
"CVE-2024-21626",
|
||||
"GHSA-xr7r-f8xq-vfvv"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/opencontainers/runc",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/opencontainers/runc"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2494",
|
||||
"name": "GO-2024-2494",
|
||||
"description": "Host system modification in github.com/moby/buildkit",
|
||||
"aliases": [
|
||||
"CVE-2024-23652",
|
||||
"GHSA-4v98-7qmw-rqr8"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/moby/buildkit",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/moby/buildkit"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-2412",
|
||||
"name": "GO-2023-2412",
|
||||
"description": "RAPL accessibility in github.com/containerd/containerd",
|
||||
"aliases": [
|
||||
"GHSA-7ww5-4wqc-m92c"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/containerd/containerd",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/containerd/containerd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-1988",
|
||||
"name": "GO-2023-1988",
|
||||
"description": "Improper rendering of text nodes in golang.org/x/net/html",
|
||||
"aliases": [
|
||||
"CVE-2023-3978",
|
||||
"GHSA-2wrh-6pvc-2jm9"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/golang.org/x/net",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/golang.org/x/net"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2024-2492",
|
||||
"name": "GO-2024-2492",
|
||||
"description": "Panic in github.com/moby/buildkit",
|
||||
"aliases": [
|
||||
"CVE-2024-23650",
|
||||
"GHSA-9p26-698r-w4hx"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/moby/buildkit",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/moby/buildkit"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2022-0646",
|
||||
"name": "GO-2022-0646",
|
||||
"description": "Use of risky cryptographic algorithm in github.com/aws/aws-sdk-go",
|
||||
"aliases": [
|
||||
"CVE-2020-8911",
|
||||
"CVE-2020-8912",
|
||||
"GHSA-7f33-f4f5-xwgw",
|
||||
"GHSA-f5pg-7wfw-84q9"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aws/aws-sdk-go",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aws/aws-sdk-go"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_present",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
},
|
||||
{
|
||||
"vulnerability": {
|
||||
"@id": "https://pkg.go.dev/vuln/GO-2023-2153",
|
||||
"name": "GO-2023-2153",
|
||||
"description": "Denial of service from HTTP/2 Rapid Reset in google.golang.org/grpc",
|
||||
"aliases": [
|
||||
"GHSA-m425-mq94-257g"
|
||||
]
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/aquasecurity/trivy",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/github.com/aquasecurity/trivy"
|
||||
},
|
||||
"subcomponents": [
|
||||
{
|
||||
"@id": "pkg:golang/google.golang.org/grpc",
|
||||
"identifiers": {
|
||||
"purl": "pkg:golang/google.golang.org/grpc"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "Govulncheck determined that the vulnerable code isn't called"
|
||||
}
|
||||
]
|
||||
}
|
||||
108
CHANGELOG.md
108
CHANGELOG.md
@@ -1,5 +1,113 @@
|
||||
# Changelog
|
||||
|
||||
## [0.55.0](https://github.com/aquasecurity/trivy/compare/v0.54.0...v0.55.0) (2024-09-03)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **cli:** delete deprecated SBOM flags ([#7266](https://github.com/aquasecurity/trivy/issues/7266))
|
||||
|
||||
### Features
|
||||
|
||||
* **cli:** delete deprecated SBOM flags ([#7266](https://github.com/aquasecurity/trivy/issues/7266)) ([7024572](https://github.com/aquasecurity/trivy/commit/70245721372720027b7089bd61c693df48add865))
|
||||
* **go:** use `toolchain` as `stdlib` version for `go.mod` files ([#7163](https://github.com/aquasecurity/trivy/issues/7163)) ([2d80769](https://github.com/aquasecurity/trivy/commit/2d80769c34b118851640411fff9dac0b3e353e82))
|
||||
* **java:** add `test` scope support for `pom.xml` files ([#7414](https://github.com/aquasecurity/trivy/issues/7414)) ([2d97700](https://github.com/aquasecurity/trivy/commit/2d97700d10665142d2f66d7910202bec82116209))
|
||||
* **misconf:** Add support for using spec from on-disk bundle ([#7179](https://github.com/aquasecurity/trivy/issues/7179)) ([be86126](https://github.com/aquasecurity/trivy/commit/be861265cafc89787fda09c59b2ef175e3d04204))
|
||||
* **misconf:** ignore duplicate checks ([#7317](https://github.com/aquasecurity/trivy/issues/7317)) ([9ef05fc](https://github.com/aquasecurity/trivy/commit/9ef05fc6b171a264516a025b0b0bcbbc8cff10bc))
|
||||
* **misconf:** iterator argument support for dynamic blocks ([#7236](https://github.com/aquasecurity/trivy/issues/7236)) ([fe92072](https://github.com/aquasecurity/trivy/commit/fe9207255a4f7f984ec1447f8a9219ae60e560c4))
|
||||
* **misconf:** port and protocol support for EC2 networks ([#7146](https://github.com/aquasecurity/trivy/issues/7146)) ([98e136e](https://github.com/aquasecurity/trivy/commit/98e136eb7baa2b66f4233d96875c1490144e1594))
|
||||
* **misconf:** scanning support for YAML and JSON ([#7311](https://github.com/aquasecurity/trivy/issues/7311)) ([efdbd8f](https://github.com/aquasecurity/trivy/commit/efdbd8f19ab0ab0c3b48293d43e51c81b7b03b89))
|
||||
* **misconf:** support for ignore by nested attributes ([#7205](https://github.com/aquasecurity/trivy/issues/7205)) ([44e4686](https://github.com/aquasecurity/trivy/commit/44e468603d44b077cc4606327fb3e7d7ca435e05))
|
||||
* **misconf:** support for policy and bucket grants ([#7284](https://github.com/aquasecurity/trivy/issues/7284)) ([a817fae](https://github.com/aquasecurity/trivy/commit/a817fae85b7272b391b737ec86673a7cab722bae))
|
||||
* **misconf:** variable support for Terraform Plan ([#7228](https://github.com/aquasecurity/trivy/issues/7228)) ([db2c955](https://github.com/aquasecurity/trivy/commit/db2c95598da098ca610825089eb4ab63b789b215))
|
||||
* **python:** use minimum version for pip packages ([#7348](https://github.com/aquasecurity/trivy/issues/7348)) ([e9b43f8](https://github.com/aquasecurity/trivy/commit/e9b43f81e67789b067352fcb6aa55bc9478bc518))
|
||||
* **report:** export modified findings in JSON ([#7383](https://github.com/aquasecurity/trivy/issues/7383)) ([7aea79d](https://github.com/aquasecurity/trivy/commit/7aea79dd93cfb61453766dbbb2e3fc0fbd317852))
|
||||
* **sbom:** set User-Agent header on requests to Rekor ([#7396](https://github.com/aquasecurity/trivy/issues/7396)) ([af1d257](https://github.com/aquasecurity/trivy/commit/af1d257730422d238871beb674767f8f83c5d06a))
|
||||
* **server:** add internal `--path-prefix` flag for client/server mode ([#7321](https://github.com/aquasecurity/trivy/issues/7321)) ([24a4563](https://github.com/aquasecurity/trivy/commit/24a45636867b893ff54c5ce07197f3b5c6db1d9b))
|
||||
* **server:** Make Trivy Server Multiplexer Exported ([#7389](https://github.com/aquasecurity/trivy/issues/7389)) ([4c6e8ca](https://github.com/aquasecurity/trivy/commit/4c6e8ca9cc9591799907cc73075f2d740e303b8f))
|
||||
* **vm:** Support direct filesystem ([#7058](https://github.com/aquasecurity/trivy/issues/7058)) ([45b3f34](https://github.com/aquasecurity/trivy/commit/45b3f344042bcd90ca63ab696b69bff0e9ab4e36))
|
||||
* **vm:** support the Ext2/Ext3 filesystems ([#6983](https://github.com/aquasecurity/trivy/issues/6983)) ([35c60f0](https://github.com/aquasecurity/trivy/commit/35c60f030fa48de8d8e57958e5ba379814126831))
|
||||
* **vuln:** Add `--detection-priority` flag for accuracy tuning ([#7288](https://github.com/aquasecurity/trivy/issues/7288)) ([fd8348d](https://github.com/aquasecurity/trivy/commit/fd8348d610f20c6c33da81cd7b0e7d5504ce26be))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aws:** handle ECR repositories in different regions ([#6217](https://github.com/aquasecurity/trivy/issues/6217)) ([feaef96](https://github.com/aquasecurity/trivy/commit/feaef9699df5d8ca399770e701a59d7c0ff979a3))
|
||||
* **flag:** incorrect behavior for deprected flag `--clear-cache` ([#7281](https://github.com/aquasecurity/trivy/issues/7281)) ([2a0e529](https://github.com/aquasecurity/trivy/commit/2a0e529c36057b572119815af59c28e4790034ca))
|
||||
* **helm:** explicitly define `kind` and `apiVersion` of `volumeClaimTemplate` element ([#7362](https://github.com/aquasecurity/trivy/issues/7362)) ([da4ebfa](https://github.com/aquasecurity/trivy/commit/da4ebfa1a741f3f8b0b43289b4028afe763f7d43))
|
||||
* **java:** Return error when trying to find a remote pom to avoid segfault ([#7275](https://github.com/aquasecurity/trivy/issues/7275)) ([49d5270](https://github.com/aquasecurity/trivy/commit/49d5270163e305f88fedcf50412973736e69dc69))
|
||||
* **license:** add license handling to JUnit template ([#7409](https://github.com/aquasecurity/trivy/issues/7409)) ([f80183c](https://github.com/aquasecurity/trivy/commit/f80183c1139b21bb95bc64e216358f4a76001a65))
|
||||
* logger initialization before flags parsing ([#7372](https://github.com/aquasecurity/trivy/issues/7372)) ([c929290](https://github.com/aquasecurity/trivy/commit/c929290c3c0e4e91337264d69e75ccb60522bc65))
|
||||
* **misconf:** change default TLS values for the Azure storage account ([#7345](https://github.com/aquasecurity/trivy/issues/7345)) ([aadb090](https://github.com/aquasecurity/trivy/commit/aadb09078843250c66087f46db9a2aa48094a118))
|
||||
* **misconf:** do not filter Terraform plan JSON by name ([#7406](https://github.com/aquasecurity/trivy/issues/7406)) ([9d7264a](https://github.com/aquasecurity/trivy/commit/9d7264af8e85bcc0dba600b8366d0470d455251c))
|
||||
* **misconf:** do not recreate filesystem map ([#7416](https://github.com/aquasecurity/trivy/issues/7416)) ([3a5d091](https://github.com/aquasecurity/trivy/commit/3a5d091759564496992a83fb2015a21c84a22213))
|
||||
* **misconf:** do not register Rego libs in checks registry ([#7420](https://github.com/aquasecurity/trivy/issues/7420)) ([a5aa63e](https://github.com/aquasecurity/trivy/commit/a5aa63eff7e229744090f9ad300c1bec3259397e))
|
||||
* **misconf:** do not set default value for default_cache_behavior ([#7234](https://github.com/aquasecurity/trivy/issues/7234)) ([f0ed5e4](https://github.com/aquasecurity/trivy/commit/f0ed5e4ced7e60af35c88d5d084aa4b7237f4973))
|
||||
* **misconf:** fix infer type for null value ([#7424](https://github.com/aquasecurity/trivy/issues/7424)) ([0cac3ac](https://github.com/aquasecurity/trivy/commit/0cac3ac7075017628a21a7990941df04cbc16dbe))
|
||||
* **misconf:** init frameworks before updating them ([#7376](https://github.com/aquasecurity/trivy/issues/7376)) ([b65b32d](https://github.com/aquasecurity/trivy/commit/b65b32ddfa6fc62ac81ad9fa580e1f5a327864f5))
|
||||
* **misconf:** load only submodule if it is specified in source ([#7112](https://github.com/aquasecurity/trivy/issues/7112)) ([a4180bd](https://github.com/aquasecurity/trivy/commit/a4180bddd43d86e479edf0afe0c362021d071482))
|
||||
* **misconf:** support deprecating for Go checks ([#7377](https://github.com/aquasecurity/trivy/issues/7377)) ([2a6c7ab](https://github.com/aquasecurity/trivy/commit/2a6c7ab3b338ce4a8f99d6ac3508c2531dcbe812))
|
||||
* **misconf:** use module to log when metadata retrieval fails ([#7405](https://github.com/aquasecurity/trivy/issues/7405)) ([0799770](https://github.com/aquasecurity/trivy/commit/0799770b8827a8276ad0d6d9ac7e0381c286757c))
|
||||
* **misconf:** wrap Azure PortRange in iac types ([#7357](https://github.com/aquasecurity/trivy/issues/7357)) ([c5c62d5](https://github.com/aquasecurity/trivy/commit/c5c62d5ff05420321f9cdbfb93e2591e0866a342))
|
||||
* **nodejs:** check all `importers` to detect dev deps from pnpm-lock.yaml file ([#7387](https://github.com/aquasecurity/trivy/issues/7387)) ([fd9ed3a](https://github.com/aquasecurity/trivy/commit/fd9ed3a330bc66e229bcbdc262dc296a3bf01f54))
|
||||
* **plugin:** do not call GitHub content API for releases and tags ([#7274](https://github.com/aquasecurity/trivy/issues/7274)) ([b3ee6da](https://github.com/aquasecurity/trivy/commit/b3ee6dac269bd7847674f3ce985a5ff7f8f0ba38))
|
||||
* **report:** escape `Message` field in `asff.tpl` template ([#7401](https://github.com/aquasecurity/trivy/issues/7401)) ([dd9733e](https://github.com/aquasecurity/trivy/commit/dd9733e950d3127aa2ac90c45ec7e2b88a2b47ca))
|
||||
* safely check if the directory exists ([#7353](https://github.com/aquasecurity/trivy/issues/7353)) ([05a8297](https://github.com/aquasecurity/trivy/commit/05a829715f99cd90b122c64cd2f40157854e467b))
|
||||
* **sbom:** use `NOASSERTION` for licenses fields in SPDX formats ([#7403](https://github.com/aquasecurity/trivy/issues/7403)) ([c96dcdd](https://github.com/aquasecurity/trivy/commit/c96dcdd440a14cdd1b01ac473b2c15e4698e387b))
|
||||
* **secret:** use `.eyJ` keyword for JWT secret ([#7410](https://github.com/aquasecurity/trivy/issues/7410)) ([bf64003](https://github.com/aquasecurity/trivy/commit/bf64003ac8b209f34b88f228918a96d4f9dac5e0))
|
||||
* **secret:** use only line with secret for long secret lines ([#7412](https://github.com/aquasecurity/trivy/issues/7412)) ([391448a](https://github.com/aquasecurity/trivy/commit/391448aba9fcb0a4138225e5ab305e4e6707c603))
|
||||
* **terraform:** add aws_region name to presets ([#7184](https://github.com/aquasecurity/trivy/issues/7184)) ([bb2e26a](https://github.com/aquasecurity/trivy/commit/bb2e26a0ab707b718f6a890cbc87e2492298b6e5))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **misconf:** do not convert contents of a YAML file to string ([#7292](https://github.com/aquasecurity/trivy/issues/7292)) ([85dadf5](https://github.com/aquasecurity/trivy/commit/85dadf56265647c000191561db10b08a4948c140))
|
||||
* **misconf:** optimize work with context ([#6968](https://github.com/aquasecurity/trivy/issues/6968)) ([2b6d8d9](https://github.com/aquasecurity/trivy/commit/2b6d8d9227fb6ecc9386a14333964c23c0370a52))
|
||||
* **misconf:** use json.Valid to check validity of JSON ([#7308](https://github.com/aquasecurity/trivy/issues/7308)) ([c766831](https://github.com/aquasecurity/trivy/commit/c766831069e188226efafeec184e41498685ed85))
|
||||
|
||||
## [0.54.0](https://github.com/aquasecurity/trivy/compare/v0.53.0...v0.54.0) (2024-07-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `log.FilePath()` function for logger ([#7080](https://github.com/aquasecurity/trivy/issues/7080)) ([1f5f348](https://github.com/aquasecurity/trivy/commit/1f5f34895823fae81bf521fc939bee743a50e304))
|
||||
* add openSUSE tumbleweed detection and scanning ([#6965](https://github.com/aquasecurity/trivy/issues/6965)) ([17b5dbf](https://github.com/aquasecurity/trivy/commit/17b5dbfa12180414b87859c6c46bfe6cc5ecf7ba))
|
||||
* **cli:** rename `--vuln-type` flag to `--pkg-types` flag ([#7104](https://github.com/aquasecurity/trivy/issues/7104)) ([7cbdb0a](https://github.com/aquasecurity/trivy/commit/7cbdb0a0b5dff33e506e1c1f3119951fa241b432))
|
||||
* **mariner:** Add support for Azure Linux ([#7186](https://github.com/aquasecurity/trivy/issues/7186)) ([5cbc452](https://github.com/aquasecurity/trivy/commit/5cbc452a09822d1bf300ead88f0d613d4cf0349a))
|
||||
* **misconf:** enabled China configuration for ACRs ([#7156](https://github.com/aquasecurity/trivy/issues/7156)) ([d1ec89d](https://github.com/aquasecurity/trivy/commit/d1ec89d1db4b039f0e31076ccd1ca969fb15628e))
|
||||
* **nodejs:** add license parser to pnpm analyser ([#7036](https://github.com/aquasecurity/trivy/issues/7036)) ([03ac93d](https://github.com/aquasecurity/trivy/commit/03ac93dc208f1b40896f3fa11fa1d45293176dca))
|
||||
* **sbom:** add image labels into `SPDX` and `CycloneDX` reports ([#7257](https://github.com/aquasecurity/trivy/issues/7257)) ([4a2f492](https://github.com/aquasecurity/trivy/commit/4a2f492c6e685ff577fb96a7006cd0c43755baf4))
|
||||
* **sbom:** add vulnerability support for SPDX formats ([#7213](https://github.com/aquasecurity/trivy/issues/7213)) ([efb1f69](https://github.com/aquasecurity/trivy/commit/efb1f6938321eec3529ef4fea6608261f6771ae0))
|
||||
* share build-in rules ([#7207](https://github.com/aquasecurity/trivy/issues/7207)) ([bff317c](https://github.com/aquasecurity/trivy/commit/bff317c77bf4a5f615a80d9875d129213bd52f6d))
|
||||
* **vex:** retrieve VEX attestations from OCI registries ([#7249](https://github.com/aquasecurity/trivy/issues/7249)) ([c2fd2e0](https://github.com/aquasecurity/trivy/commit/c2fd2e0d89567a0ccd996dda8790f3c3305ea6f7))
|
||||
* **vex:** VEX Repository support ([#7206](https://github.com/aquasecurity/trivy/issues/7206)) ([88ba460](https://github.com/aquasecurity/trivy/commit/88ba46047c93e6046292523ae701de774dfdc4dc))
|
||||
* **vuln:** add `--pkg-relationships` ([#7237](https://github.com/aquasecurity/trivy/issues/7237)) ([5c37361](https://github.com/aquasecurity/trivy/commit/5c37361600d922db27dd594b2a80c010a19b3a6e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add dependencyManagement exclusions to the child exclusions ([#6969](https://github.com/aquasecurity/trivy/issues/6969)) ([dc68a66](https://github.com/aquasecurity/trivy/commit/dc68a662a701980d6529f61a65006f1e4728a3e5))
|
||||
* add missing platform and type to spec ([#7149](https://github.com/aquasecurity/trivy/issues/7149)) ([c8a7abd](https://github.com/aquasecurity/trivy/commit/c8a7abd3b508975fcf10c254d13d1a2cd42da657))
|
||||
* **cli:** error on missing config file ([#7154](https://github.com/aquasecurity/trivy/issues/7154)) ([7fa5e7d](https://github.com/aquasecurity/trivy/commit/7fa5e7d0ab67f20d434b2922725988695e32e6af))
|
||||
* close file when failed to open gzip ([#7164](https://github.com/aquasecurity/trivy/issues/7164)) ([2a577a7](https://github.com/aquasecurity/trivy/commit/2a577a7bae37e5731dceaea8740683573b6b70a5))
|
||||
* **dotnet:** don't include non-runtime libraries into report for `*.deps.json` files ([#7039](https://github.com/aquasecurity/trivy/issues/7039)) ([5bc662b](https://github.com/aquasecurity/trivy/commit/5bc662be9a8f072599f90abfd3b400c8ab055ed6))
|
||||
* **dotnet:** show `nuget package dir not found` log only when checking `nuget` packages ([#7194](https://github.com/aquasecurity/trivy/issues/7194)) ([d76feba](https://github.com/aquasecurity/trivy/commit/d76febaee107c645e864da0f4d74a8f6ae4ad232))
|
||||
* ignore nodes when listing permission is not allowed ([#7107](https://github.com/aquasecurity/trivy/issues/7107)) ([25f8143](https://github.com/aquasecurity/trivy/commit/25f8143f120965c636c5ea8386398b211b082398))
|
||||
* **java:** avoid panic if deps from `pom` in `it` dir are not found ([#7245](https://github.com/aquasecurity/trivy/issues/7245)) ([4e54a7e](https://github.com/aquasecurity/trivy/commit/4e54a7e84c33c1be80c52c6db78c634bc3911715))
|
||||
* **java:** use `go-mvn-version` to remove `Package` duplicates ([#7088](https://github.com/aquasecurity/trivy/issues/7088)) ([a7a304d](https://github.com/aquasecurity/trivy/commit/a7a304d53e1ce230f881c28c4f35885774cf3b9a))
|
||||
* **misconf:** do not evaluate TF when a load error occurs ([#7109](https://github.com/aquasecurity/trivy/issues/7109)) ([f27c236](https://github.com/aquasecurity/trivy/commit/f27c236d6e155cb366aeef619b6ea96d20fb93da))
|
||||
* **nodejs:** detect direct dependencies when using `latest` version for files `yarn.lock` + `package.json` ([#7110](https://github.com/aquasecurity/trivy/issues/7110)) ([54bb8bd](https://github.com/aquasecurity/trivy/commit/54bb8bdfb934d114b5570005853bf4bc0d40c609))
|
||||
* **report:** hide empty table when all secrets/license/misconfigs are ignored ([#7171](https://github.com/aquasecurity/trivy/issues/7171)) ([c3036de](https://github.com/aquasecurity/trivy/commit/c3036de6d7719323d306a9666ccc8d928d936f9a))
|
||||
* **secret:** skip regular strings contain secret patterns ([#7182](https://github.com/aquasecurity/trivy/issues/7182)) ([174b1e3](https://github.com/aquasecurity/trivy/commit/174b1e3515a6394cf8d523216d6267c1aefb820a))
|
||||
* **secret:** trim excessively long lines ([#7192](https://github.com/aquasecurity/trivy/issues/7192)) ([92b13be](https://github.com/aquasecurity/trivy/commit/92b13be668bd20f8e9dac2f0cb8e5a2708b9b3b5))
|
||||
* **secret:** update length of `hugging-face-access-token` ([#7216](https://github.com/aquasecurity/trivy/issues/7216)) ([8c87194](https://github.com/aquasecurity/trivy/commit/8c87194f0a6b194bc5d340c8a65bd99a3132d973))
|
||||
* **server:** pass license categories to options ([#7203](https://github.com/aquasecurity/trivy/issues/7203)) ([9d52018](https://github.com/aquasecurity/trivy/commit/9d5201808da89607ae43570bdf1f335b482a6b79))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **debian:** use `bytes.Index` in `emptyLineSplit` to cut allocation ([#7065](https://github.com/aquasecurity/trivy/issues/7065)) ([acbec05](https://github.com/aquasecurity/trivy/commit/acbec053c985388a26d899e73b4b7f5a6d1fa210))
|
||||
|
||||
## [0.53.0](https://github.com/aquasecurity/trivy/compare/v0.52.0...v0.53.0) (2024-07-01)
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
"Region": "{{ env "AWS_REGION" }}",
|
||||
"Details": {
|
||||
"Other": {
|
||||
"Message": "{{ .Message }}",
|
||||
"Message": "{{ escapeString .Message }}",
|
||||
"Filename": "{{ $target }}",
|
||||
"StartLine": "{{ .CauseMetadata.StartLine }}",
|
||||
"EndLine": "{{ .CauseMetadata.EndLine }}"
|
||||
|
||||
@@ -33,5 +33,16 @@
|
||||
</testcase>
|
||||
{{- end }}
|
||||
</testsuite>
|
||||
|
||||
{{- if .Licenses }}
|
||||
{{- $licenses := len .Licenses }}
|
||||
<testsuite tests="{{ $licenses }}" failures="{{ $licenses }}" name="{{ .Target }}" time="0">{{ range .Licenses }}
|
||||
<testcase classname="{{ .PkgName }}" name="[{{ .Severity }}] {{ .Name }}">
|
||||
<failure/>
|
||||
</testcase>
|
||||
{{- end }}
|
||||
</testsuite>
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
</testsuites>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Thank you for taking interest in contributing to Trivy!
|
||||
|
||||
1. Every Pull Request should have an associated bug or feature issue unless you are fixing a trivial documentation issue.
|
||||
1. Please add the associated Issue link in the PR description.
|
||||
1. Every Pull Request should have an associated GitHub issue link in the PR description. Note that issues are created by Trivy maintainers based on feedback provided in a GitHub discussion. Please refer to the [issue](./issue.md) and [discussion](./discussion.md) pages for explanation about this process. If you think your change is trivial enough, you can skip the issue and instead add justification and explanation in the PR description.
|
||||
1. Your PR is more likely to be accepted if it focuses on just one change.
|
||||
1. There's no need to add or tag reviewers.
|
||||
1. If a reviewer commented on your code or asked for changes, please remember to respond with comment. Do not mark discussion as resolved. It's up to reviewer to mark it resolved (in case if suggested fix addresses problem properly). PRs with unresolved issues should not be merged (even if the comment is unclear or requires no action from your side).
|
||||
@@ -122,7 +121,7 @@ os:
|
||||
- redhat
|
||||
- alma
|
||||
- rocky
|
||||
- mariner
|
||||
- azure
|
||||
- oracle
|
||||
- debian
|
||||
- ubuntu
|
||||
|
||||
@@ -16,9 +16,10 @@ For detailed behavior, please refer to [the GitHub Actions configuration][workfl
|
||||
The release flow consists of the following main steps:
|
||||
|
||||
1. Creating the release PR (automatically or manually)
|
||||
1. Drafting the release notes
|
||||
1. Drafting the release notes in GitHub Discussions
|
||||
1. Merging the release PR
|
||||
1. Updating the release notes
|
||||
1. Updating the release notes in GitHub Discussions
|
||||
1. Navigating to the release notes in GitHub Releases page
|
||||
|
||||
### Automatic Release PR Creation
|
||||
When a releasable commit (a commit with `feat` or `fix` prefix) is merged, a release PR is automatically created.
|
||||
@@ -57,6 +58,23 @@ When the PR is merged, a tag is automatically created, and [GoReleaser][goreleas
|
||||
If the release completes without errors, a page for the release notes is created in GitHub Discussions (e.g., https://github.com/aquasecurity/trivy/discussions/6622).
|
||||
Copy the draft release notes, adjust the formatting, and finalize the release notes.
|
||||
|
||||
### Navigating to the Release Notes
|
||||
To navigate to the release highlights and summary in GitHub Discussions, place a link in the GitHub Releases page as below:
|
||||
|
||||
```
|
||||
## ⚡Release highlights and summary⚡
|
||||
|
||||
👉 https://github.com/aquasecurity/trivy/discussions/6838
|
||||
|
||||
## Changelog
|
||||
https://github.com/aquasecurity/trivy/blob/main/CHANGELOG.md#0520-2024-06-03
|
||||
```
|
||||
|
||||
Replace URLs with appropriate ones.
|
||||
|
||||
Example: https://github.com/aquasecurity/trivy/releases/tag/v0.52.0
|
||||
|
||||
|
||||
The release is now complete.
|
||||
|
||||
[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/
|
||||
|
||||
@@ -1,142 +1,162 @@
|
||||
# Air-Gapped Environment
|
||||
# Advanced Network Scenarios
|
||||
|
||||
Trivy can be used in air-gapped environments. Note that an allowlist is [here][allowlist].
|
||||
Trivy needs to connect to the internet occasionally in order to download relevant content. This document explains the network connectivity requirements of Trivy and setting up Trivy in particular scenarios.
|
||||
|
||||
## Air-Gapped Environment for vulnerabilities
|
||||
## Network requirements
|
||||
|
||||
### Download the vulnerability database
|
||||
At first, you need to download the vulnerability database for use in air-gapped environments.
|
||||
Trivy's databases are distributed as OCI images via GitHub Container registry (GHCR):
|
||||
|
||||
=== "Trivy"
|
||||
- <https://ghcr.io/aquasecurity/trivy-db>
|
||||
- <https://ghcr.io/aquasecurity/trivy-java-db>
|
||||
- <https://ghcr.io/aquasecurity/trivy-checks>
|
||||
|
||||
```
|
||||
TRIVY_TEMP_DIR=$(mktemp -d)
|
||||
trivy --cache-dir $TRIVY_TEMP_DIR image --download-db-only
|
||||
tar -cf ./db.tar.gz -C $TRIVY_TEMP_DIR/db metadata.json trivy.db
|
||||
rm -rf $TRIVY_TEMP_DIR
|
||||
```
|
||||
The following hosts are required in order to fetch them:
|
||||
|
||||
=== "oras >= v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
- `ghcr.io`
|
||||
- `pkg-containers.githubusercontent.com`
|
||||
|
||||
Download `db.tar.gz`:
|
||||
The databases are pulled by Trivy using the [OCI Distribution](https://github.com/opencontainers/distribution-spec) specification, which is a simple HTTPS-based protocol.
|
||||
|
||||
```
|
||||
$ oras pull ghcr.io/aquasecurity/trivy-db:2
|
||||
```
|
||||
[VEX Hub](https://github.com/aquasecurity/vexhub) is distributed from GitHub over HTTPS.
|
||||
The following hosts are required in order to fetch it:
|
||||
|
||||
=== "oras < v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
- `api.github.com`
|
||||
- `codeload.github.com`
|
||||
|
||||
Download `db.tar.gz`:
|
||||
## Running Trivy in air-gapped environment
|
||||
|
||||
```
|
||||
$ oras pull -a ghcr.io/aquasecurity/trivy-db:2
|
||||
```
|
||||
An air-gapped environment refers to situations where the network connectivity from the machine Trivy runs on is blocked or restricted.
|
||||
|
||||
### Download the Java index database[^1]
|
||||
Java users also need to download the Java index database for use in air-gapped environments.
|
||||
In an air-gapped environment it is your responsibility to update the Trivy databases on a regular basis.
|
||||
|
||||
!!! note
|
||||
You container image may contain JAR files even though you don't use Java directly.
|
||||
In that case, you also need to download the Java index database.
|
||||
## Offline Mode
|
||||
|
||||
=== "Trivy"
|
||||
By default, Trivy will attempt to download latest databases. If it fails, the scan might fail. To avoid this behavior, you can tell Trivy to not attempt to download database files:
|
||||
|
||||
```
|
||||
TRIVY_TEMP_DIR=$(mktemp -d)
|
||||
trivy --cache-dir $TRIVY_TEMP_DIR image --download-java-db-only
|
||||
tar -cf ./javadb.tar.gz -C $TRIVY_TEMP_DIR/java-db metadata.json trivy-java.db
|
||||
rm -rf $TRIVY_TEMP_DIR
|
||||
```
|
||||
=== "oras >= v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
- `--skip-db-update` to skip updating the main vulnerability database.
|
||||
- `--skip-java-db-update` to skip updating the Java vulnerability database.
|
||||
- `--skip-check-update` to skip updating the misconfiguration database.
|
||||
|
||||
Download `javadb.tar.gz`:
|
||||
|
||||
```
|
||||
$ oras pull ghcr.io/aquasecurity/trivy-java-db:1
|
||||
```
|
||||
|
||||
=== "oras < v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
|
||||
Download `javadb.tar.gz`:
|
||||
|
||||
```
|
||||
$ oras pull -a ghcr.io/aquasecurity/trivy-java-db:1
|
||||
```
|
||||
|
||||
|
||||
### Transfer the DB files into the air-gapped environment
|
||||
The way of transfer depends on the environment.
|
||||
|
||||
=== "Vulnerability db"
|
||||
```
|
||||
$ rsync -av -e ssh /path/to/db.tar.gz [user]@[host]:dst
|
||||
```
|
||||
|
||||
=== "Java index db[^1]"
|
||||
```
|
||||
$ rsync -av -e ssh /path/to/javadb.tar.gz [user]@[host]:dst
|
||||
```
|
||||
|
||||
### Put the DB files in Trivy's cache directory
|
||||
You have to know where to put the DB files. The following command shows the default cache directory.
|
||||
|
||||
```
|
||||
$ ssh user@host
|
||||
$ trivy -h | grep cache
|
||||
--cache-dir value cache directory (default: "/home/myuser/.cache/trivy") [$TRIVY_CACHE_DIR]
|
||||
```
|
||||
=== "Vulnerability db"
|
||||
Put the DB file in the cache directory + `/db`.
|
||||
|
||||
```
|
||||
$ mkdir -p /home/myuser/.cache/trivy/db
|
||||
$ cd /home/myuser/.cache/trivy/db
|
||||
$ tar xvf /path/to/db.tar.gz -C /home/myuser/.cache/trivy/db
|
||||
x trivy.db
|
||||
x metadata.json
|
||||
$ rm /path/to/db.tar.gz
|
||||
```
|
||||
|
||||
=== "Java index db[^1]"
|
||||
Put the DB file in the cache directory + `/java-db`.
|
||||
|
||||
```
|
||||
$ mkdir -p /home/myuser/.cache/trivy/java-db
|
||||
$ cd /home/myuser/.cache/trivy/java-db
|
||||
$ tar xvf /path/to/javadb.tar.gz -C /home/myuser/.cache/trivy/java-db
|
||||
x trivy-java.db
|
||||
x metadata.json
|
||||
$ rm /path/to/javadb.tar.gz
|
||||
```
|
||||
|
||||
|
||||
|
||||
In an air-gapped environment it is your responsibility to update the Trivy databases on a regular basis, so that the scanner can detect recently-identified vulnerabilities.
|
||||
|
||||
### Run Trivy with the specific flags.
|
||||
In an air-gapped environment, you have to specify `--skip-db-update` and `--skip-java-db-update`[^1] so that Trivy doesn't attempt to download the latest database files.
|
||||
In addition, if you want to scan `pom.xml` dependencies, you need to specify `--offline-scan` since Trivy tries to issue API requests for scanning Java applications by default.
|
||||
|
||||
```
|
||||
$ trivy image --skip-db-update --skip-java-db-update --offline-scan alpine:3.12
|
||||
```shell
|
||||
trivy image --skip-db-update --skip-java-db-update --offline-scan --skip-check-update myimage
|
||||
```
|
||||
|
||||
## Air-Gapped Environment for misconfigurations
|
||||
## Self-Hosting
|
||||
|
||||
No special measures are required to detect misconfigurations in an air-gapped environment.
|
||||
### OCI Databases
|
||||
|
||||
### Run Trivy with `--skip-check-update` option
|
||||
In an air-gapped environment, specify `--skip-check-update` so that Trivy doesn't attempt to download the latest misconfiguration checks.
|
||||
You can host the databases on your own local OCI registry.
|
||||
|
||||
```
|
||||
$ trivy conf --skip-policy-update /path/to/conf
|
||||
First, make a copy of the databases in a container registry that is accessible to Trivy. The databases are in:
|
||||
|
||||
- `ghcr.io/aquasecurity/trivy-db:2`
|
||||
- `ghcr.io/aquasecurity/trivy-java-db:1`
|
||||
- `ghcr.io/aquasecurity/trivy-checks:0`
|
||||
|
||||
Then, tell Trivy to use the local registry:
|
||||
|
||||
```shell
|
||||
trivy image \
|
||||
--db-repository myregistry.local/trivy-db \
|
||||
--java-db-repository myregistry.local/trivy-java-db \
|
||||
--checks-bundle-repository myregistry.local/trivy-checks \
|
||||
myimage
|
||||
```
|
||||
|
||||
[allowlist]: ../references/troubleshooting.md
|
||||
[oras]: https://oras.land/docs/installation
|
||||
#### Authentication
|
||||
|
||||
[^1]: This is only required to scan `jar` files. More information about `Java index db` [here](../coverage/language/java.md)
|
||||
If the registry requires authentication, you can configure it as described in the [private registry authentication document](../advanced/private-registries/index.md).
|
||||
|
||||
### VEX Hub
|
||||
|
||||
You can host a copy of VEX Hub on your own internal server.
|
||||
|
||||
First, make a copy of VEX Hub in a location that is accessible to Trivy.
|
||||
|
||||
1. Download the [VEX Hub](https://github.com/aquasecurity/vexhub) archive from: <https://github.com/aquasecurity/vexhub/archive/refs/heads/main.zip>.
|
||||
1. Download the [VEX Hub Repository Manifest](https://github.com/aquasecurity/vex-repo-spec#2-repository-manifest) file from: <https://github.com/aquasecurity/vexhub/blob/main/vex-repository.json>.
|
||||
1. Create or identify an internal HTTP server that can serve the VEX Hub repository in your environment (e.g `https://server.local`).
|
||||
1. Make the downloaded archive file available for serving from your server (e.g `https://server.local/main.zip`).
|
||||
1. Modify the downloaded manifest file's [Location URL](https://github.com/aquasecurity/vex-repo-spec?tab=readme-ov-file#locations-subfields) field to the URL of the archive file on your server (e.g `url: https://server.local/main.zip`).
|
||||
1. Make the manifest file available for serving from your server under the `/.well-known` path (e.g `https://server.local/.well-known/vex-repository.json`).
|
||||
|
||||
Then, tell Trivy to use the local VEX Repository:
|
||||
|
||||
1. Locate your [Trivy VEX configuration file](../supply-chain/vex/repo/#configuration-file) by running `trivy vex repo init`. Make the following changes to the file.
|
||||
1. Disable the default VEX Hub repo (`enabled: false`)
|
||||
1. Add your internal VEX Hub repository as a [custom repository](../supply-chain/vex/repo/#custom-repositories) with the URL pointing to your local server (e.g `url: https://server.local`).
|
||||
|
||||
#### Authentication
|
||||
|
||||
If your server requires authentication, you can configure it as described in the [VEX Repository Authentication document](../supply-chain/vex/repo/#authentication).
|
||||
|
||||
## Manual cache population
|
||||
|
||||
You can also download the databases files manually and surgically populate the Trivy cache directory with them.
|
||||
|
||||
### Downloading the DB files
|
||||
|
||||
On a machine with internet access, pull the database container archive from the public registry into your local workspace:
|
||||
|
||||
Note that these examples operate in the current working directory.
|
||||
|
||||
=== "Using ORAS"
|
||||
This example uses [ORAS](https://oras.land), but you can use any other container registry manipulation tool.
|
||||
|
||||
```shell
|
||||
oras pull ghcr.io/aquasecurity/trivy-db:2
|
||||
```
|
||||
|
||||
You should now have a file called `db.tar.gz`. Next, extract it to reveal the db files:
|
||||
|
||||
```shell
|
||||
tar -xzf db.tar.gz
|
||||
```
|
||||
|
||||
You should now have 2 new files, `metadata.json` and `trivy.db`. These are the Trivy DB files.
|
||||
|
||||
=== "Using Trivy"
|
||||
This example uses Trivy to pull the database container archive. The `--cache-dir` flag makes Trivy download the database files into our current working directory. The `--download-db-only` flag tells Trivy to only download the database files, not to scan any images.
|
||||
|
||||
```shell
|
||||
trivy image --cache-dir . --download-db-only
|
||||
```
|
||||
|
||||
You should now have 2 new files, `metadata.json` and `trivy.db`. These are the Trivy DB files, copy them over to the air-gapped environment.
|
||||
|
||||
### Populating the Trivy Cache
|
||||
|
||||
In order to populate the cache, you need to identify the location of the cache directory. If it is under the default location, you can run the following command to find it:
|
||||
|
||||
```shell
|
||||
trivy -h | grep cache
|
||||
```
|
||||
|
||||
For the example, we will assume the `TRIVY_CACHE_DIR` variable holds the cache location:
|
||||
|
||||
```shell
|
||||
TRIVY_CACHE_DIR=/home/user/.cache/trivy
|
||||
```
|
||||
|
||||
Put the Trivy DB files in the Trivy cache directory under a `db` subdirectory:
|
||||
|
||||
```shell
|
||||
# ensure cache db directory exists
|
||||
mkdir -p ${TRIVY_CACHE_DIR}/db
|
||||
# copy the db files
|
||||
cp /path/to/trivy.db /path/to/metadata.json ${TRIVY_CACHE_DIR}/db/
|
||||
```
|
||||
|
||||
### Java DB
|
||||
|
||||
For Java DB the process is the same, except for the following:
|
||||
|
||||
1. Image location is `ghcr.io/aquasecurity/trivy-java-db:1`
|
||||
2. Archive file name is `javadb.tar.gz`
|
||||
3. DB file name is `trivy-java.db`
|
||||
|
||||
## Misconfigurations scanning
|
||||
|
||||
Note that the misconfigurations checks bundle is also embedded in the Trivy binary (at build time), and will be used as a fallback if the external database is not available. This means that you can still scan for misconfigurations in an air-gapped environment using the Checks from the time of the Trivy release you are using.
|
||||
|
||||
The misconfiguration scanner can be configured to load checks from a local directory, using the `--config-check` flag. In an air-gapped scenario you can copy the checks library from [Trivy checks repository](https://github.com/aquasecurity/trivy-checks) into a local directory, and load it with this flag. See more in the [Misconfiguration scanner documentation](../scanner/misconfiguration/index.md).
|
||||
|
||||
@@ -35,7 +35,7 @@ Additional information is provided below.
|
||||
|
||||
#### 1. Referencing a check that is already part of Trivy
|
||||
|
||||
Trivy has a comprehensive list of checks as part of its misconfiguration scanning. These can be found in the `trivy-policies/checks` directory ([Link](https://github.com/aquasecurity/trivy-checks/tree/main/checks)). If the check is present, the `AVD_ID` and other information from the check has to be used.
|
||||
Trivy has a comprehensive list of checks as part of its misconfiguration scanning. These can be found in the `trivy-checks/checks` directory ([Link](https://github.com/aquasecurity/trivy-checks/tree/main/checks)). If the check is present, the `AVD_ID` and other information from the check has to be used.
|
||||
|
||||
Note: Take a look at the more generic compliance specs that are already available in Trivy. If you are adding new compliance spec to Kubernetes e.g. AWS EKS CIS Benchmarks, chances are high that the check you would like to add to the new spec has already been defined in the general `k8s-ci-v.000.yaml` compliance spec. The same applies for creating specific Cloud Provider Compliance Specs and the [generic compliance specs](https://github.com/aquasecurity/trivy-checks/tree/main/specs/compliance) available.
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# Cache
|
||||
The cache directory includes
|
||||
|
||||
- Cache of previous scans (Scan cache).
|
||||
- [Vulnerability Database][trivy-db][^1]
|
||||
- [Java Index Database][trivy-java-db][^2]
|
||||
- [Misconfiguration Checks][misconf-checks][^3]
|
||||
- Cache of previous scans.
|
||||
- [VEX Repositories](../supply-chain/vex/repo.md)
|
||||
|
||||
The cache option is common to all scanners.
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ Total: 1785 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1680, CRITICAL: 105)
|
||||
</details>
|
||||
|
||||
```bash
|
||||
trivy conf --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
trivy config --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -238,7 +238,7 @@ You can filter the results by
|
||||
To show the suppressed results, use the `--show-suppressed` flag.
|
||||
|
||||
!!! note
|
||||
This flag is currently available only in the table format.
|
||||
It's exported as `ExperimentalModifiedFindings` in the JSON output.
|
||||
|
||||
```bash
|
||||
$ trivy image --vex debian11.csaf.vex --ignorefile .trivyignore.yaml --show-suppressed debian:11
|
||||
@@ -493,7 +493,7 @@ You can find more example checks [here](https://github.com/aquasecurity/trivy/tr
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Please refer to the [VEX documentation](../supply-chain/vex.md) for the details.
|
||||
Please refer to the [VEX documentation](../supply-chain/vex/index.md) for the details.
|
||||
|
||||
|
||||
[^1]: license name is used as id for `.trivyignore.yaml` files.
|
||||
|
||||
@@ -21,7 +21,7 @@ It evaluates properties, functions, and other elements within CloudFormation fil
|
||||
You can provide `cf-params` with path to [CloudFormation Parameters] file to Trivy to scan your CloudFormation code with parameters.
|
||||
|
||||
```bash
|
||||
trivy conf --cf-params params.json ./infrastructure/cf
|
||||
trivy config --cf-params params.json ./infrastructure/cf
|
||||
```
|
||||
|
||||
You can check a [CloudFormation Parameters Example]
|
||||
|
||||
@@ -21,7 +21,7 @@ When override values are passed to the Helm scanner, the values will be used dur
|
||||
Overrides can be set inline on the command line
|
||||
|
||||
```bash
|
||||
trivy conf --helm-set securityContext.runAsUser=0 ./charts/mySql
|
||||
trivy config --helm-set securityContext.runAsUser=0 ./charts/mySql
|
||||
```
|
||||
|
||||
#### Setting value file overrides
|
||||
@@ -35,7 +35,7 @@ securityContext:
|
||||
```
|
||||
|
||||
```bash
|
||||
trivy conf --helm-values overrides.yaml ./charts/mySql
|
||||
trivy config --helm-values overrides.yaml ./charts/mySql
|
||||
```
|
||||
|
||||
#### Setting value as explicit string
|
||||
@@ -49,7 +49,7 @@ trivy config --helm-set-string name=false ./infrastructure/tf
|
||||
Specific override values can come from specific files
|
||||
|
||||
```bash
|
||||
trivy conf --helm-set-file environment=dev.values.yaml ./charts/mySql
|
||||
trivy config --helm-set-file environment=dev.values.yaml ./charts/mySql
|
||||
```
|
||||
|
||||
## Secret
|
||||
|
||||
@@ -8,15 +8,18 @@ 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 |
|
||||
| [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. |
|
||||
| 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, \*.json |
|
||||
| [CloudFormation](cloudformation.md) | \*.yml, \*.yaml, \*.json |
|
||||
| [Azure ARM Template](azure-arm.md) | \*.json |
|
||||
| [Helm](helm.md) | \*.yaml, \*.tpl, \*.tar.gz, etc. |
|
||||
| [YAML][json-and-yaml] | \*.yaml, \*.yml |
|
||||
| [JSON][json-and-yaml] | \*.json |
|
||||
|
||||
[misconf]: ../../scanner/misconfiguration/index.md
|
||||
[secret]: ../../scanner/secret.md
|
||||
[json-and-yaml]: ../../scanner/misconfiguration/index.md#scan-arbitrary-json-and-yaml-configurations
|
||||
|
||||
@@ -18,13 +18,13 @@ It supports the following formats:
|
||||
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
|
||||
trivy config tfplan
|
||||
```
|
||||
|
||||
To scan a Terraform Plan representation in JSON format, run the following command:
|
||||
```bash
|
||||
terraform show -json tfplan > tfplan.json
|
||||
trivy conf tfplan.json
|
||||
trivy config tfplan.json
|
||||
```
|
||||
|
||||
## Misconfiguration
|
||||
@@ -35,7 +35,7 @@ It also evaluates variables, imports, and other elements within Terraform files
|
||||
You can provide `tf-vars` files to Trivy to override default values specified in the Terraform HCL code.
|
||||
|
||||
```bash
|
||||
trivy conf --tf-vars dev.terraform.tfvars ./infrastructure/tf
|
||||
trivy config --tf-vars dev.terraform.tfvars ./infrastructure/tf
|
||||
```
|
||||
|
||||
### Exclude Downloaded Terraform Modules
|
||||
@@ -43,8 +43,37 @@ By default, downloaded modules are also scanned.
|
||||
If you don't want to scan them, you can use the `--tf-exclude-downloaded-modules` flag.
|
||||
|
||||
```bash
|
||||
trivy conf --tf-exclude-downloaded-modules ./configs
|
||||
trivy config --tf-exclude-downloaded-modules ./configs
|
||||
```
|
||||
|
||||
## Secret
|
||||
The secret scan is performed on plain text files, with no special treatment for Terraform.
|
||||
The secret scan is performed on plain text files, with no special treatment for Terraform.
|
||||
|
||||
## Limitations
|
||||
|
||||
### Terraform Plan JSON
|
||||
|
||||
#### For each and count objects in expression
|
||||
|
||||
The plan created by Terraform does not provide complete information about references in expressions that use `each` or `count` objects. For this reason, in some situations it is not possible to establish references between resources that are needed for checks when detecting misconfigurations. An example of such a configuration is:
|
||||
|
||||
```hcl
|
||||
locals {
|
||||
buckets = toset(["test"])
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket" "this" {
|
||||
for_each = local.buckets
|
||||
bucket = each.key
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_acl" "this" {
|
||||
for_each = local.buckets
|
||||
bucket = aws_s3_bucket.this[each.key].id
|
||||
acl = "private"
|
||||
}
|
||||
```
|
||||
|
||||
With this configuration, the plan will not contain information about which attribute of the `aws_s3_bucket` resource is referenced by the `aws_s3_bucket_acl` resource.
|
||||
|
||||
See more [here](https://github.com/hashicorp/terraform/issues/30826).
|
||||
@@ -11,9 +11,9 @@ The following scanners are supported.
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
|
||||
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|
||||
|-------------------------|--------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|
|
||||
| [Dart][dart-repository] | pubspec.lock | ✓ | Included | ✓ | - |
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | [Detection Priority][detection-priority] |
|
||||
|-------------------------|--------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|:----------------------------------------:|
|
||||
| [Dart][dart-repository] | pubspec.lock | ✓ | Included | ✓ | - | ✓ |
|
||||
|
||||
## Dart
|
||||
In order to detect dependencies, Trivy searches for `pubspec.lock`.
|
||||
@@ -22,11 +22,13 @@ Trivy marks indirect dependencies, but `pubspec.lock` file doesn't have options
|
||||
So Trivy includes all dependencies in report.
|
||||
|
||||
### SDK dependencies
|
||||
Dart uses version `0.0.0` for SDK dependencies (e.g. Flutter). It is not possible to accurately determine the versions of these dependencies.
|
||||
Dart uses version `0.0.0` for SDK dependencies (e.g. Flutter).
|
||||
It is not possible to accurately determine the versions of these dependencies.
|
||||
Trivy just treats them as `0.0.0`.
|
||||
|
||||
Therefore, we use the first version of the constraint for the SDK.
|
||||
If [--detection-priority comprehensive][detection-priority] is passed, Trivy uses the minimum version of the constraint for the SDK.
|
||||
For example, in the following case, the version of `flutter` would be `3.3.0`:
|
||||
|
||||
For example in this case the version of `flutter` should be `3.3.0`:
|
||||
```yaml
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
@@ -40,6 +42,7 @@ sdks:
|
||||
|
||||
### Dependency tree
|
||||
To build `dependency tree` Trivy parses [cache directory][cache-directory]. Currently supported default directories and `PUB_CACHE` environment (absolute path only).
|
||||
|
||||
!!! note
|
||||
Make sure the cache directory contains all the dependencies installed in your application. To download missing dependencies, use `dart pub get` command.
|
||||
|
||||
@@ -47,3 +50,4 @@ To build `dependency tree` Trivy parses [cache directory][cache-directory]. Curr
|
||||
[dart-repository]: https://pub.dev/
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[cache-directory]: https://dart.dev/tools/pub/glossary#system-cache
|
||||
[detection-priority]: ../../scanner/vulnerability.md#detection-priority
|
||||
@@ -21,6 +21,9 @@ The following table provides an outline of the features Trivy offers.
|
||||
## *.deps.json
|
||||
Trivy parses `*.deps.json` files. Trivy currently excludes dev dependencies from the report.
|
||||
|
||||
!!! note
|
||||
Trivy only includes runtime dependencies in the report.
|
||||
|
||||
## packages.config
|
||||
Trivy only finds dependency names and versions from `packages.config` files. To build dependency graph, it is better to use `packages.lock.json` files.
|
||||
|
||||
|
||||
@@ -16,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] | Stdlib |
|
||||
|----------|:-----------:|:-----------------|:------------------------------------:|:------:|
|
||||
| Modules | ✅ | Include | ✅[^2] | - |
|
||||
| Binaries | ✅ | Exclude | - | ✅[^4] |
|
||||
| Artifact | Offline[^1] | Dev dependencies | [Dependency graph][dependency-graph] | Stdlib | [Detection Priority][detection-priority] |
|
||||
|----------|:-----------:|:-----------------|:------------------------------------:|:------:|:----------------------------------------:|
|
||||
| Modules | ✅ | Include | ✅[^2] | ✅[^6] | [✅](#stdlib) |
|
||||
| Binaries | ✅ | Exclude | - | ✅[^4] | Not needed |
|
||||
|
||||
!!! note
|
||||
Trivy scans only dependencies of the Go project.
|
||||
@@ -65,6 +65,23 @@ To identify licenses and dependency relationships, you need to download modules
|
||||
such as `go mod download`, `go mod tidy`, etc.
|
||||
Trivy traverses `$GOPATH/pkg/mod` and collects those extra information.
|
||||
|
||||
#### stdlib
|
||||
If [--detection-priority comprehensive][detection-priority] is passed, Trivy determines the minimum version of `Go` and saves it as a `stdlib` dependency.
|
||||
|
||||
By default, `Go` selects the higher version from of `toolchan` or local version of `Go`.
|
||||
See [toolchain] for more details.
|
||||
|
||||
To obtain reproducible scan results Trivy doesn't check the local version of `Go`.
|
||||
Trivy shows the minimum required version for the `go.mod` file, obtained from `toolchain` line (or from the `go` line, if `toolchain` line is omitted).
|
||||
|
||||
!!! note
|
||||
Trivy detects `stdlib` only for `Go` 1.21 or higher.
|
||||
|
||||
The version from the `go` line (for `Go` 1.20 or early) is not a minimum required version.
|
||||
For details, see [this](https://go.googlesource.com/proposal/+/master/design/57001-gotoolchain.md).
|
||||
|
||||
|
||||
|
||||
### Go binaries
|
||||
Trivy scans binaries built by Go, which include [module information](https://tip.golang.org/doc/go1.18#go-version).
|
||||
If there is a Go binary in your container image, Trivy automatically finds and scans it.
|
||||
@@ -93,5 +110,8 @@ empty if it cannot do so[^5]. For the second case, the version of such packages
|
||||
[^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
|
||||
[^6]: Only available if `toolchain` directive exists
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[toolchain]: https://go.dev/doc/toolchain
|
||||
[detection-priority]: ../../scanner/vulnerability.md#detection-priority
|
||||
|
||||
@@ -12,12 +12,12 @@ Each artifact supports the following scanners:
|
||||
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
|
||||
| Artifact | Internet access | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|
||||
|------------------|:---------------------:|:----------------:|:------------------------------------:|:--------:|
|
||||
| JAR/WAR/PAR/EAR | Trivy Java DB | Include | - | - |
|
||||
| pom.xml | Maven repository [^1] | Exclude | ✓ | ✓[^7] |
|
||||
| *gradle.lockfile | - | Exclude | ✓ | ✓ |
|
||||
| *.sbt.lock | - | Exclude | - | ✓ |
|
||||
| Artifact | Internet access | Dev dependencies | [Dependency graph][dependency-graph] | Position | [Detection Priority][detection-priority] |
|
||||
|------------------|:---------------------:|:------------------:|:------------------------------------:|:--------:|:----------------------------------------:|
|
||||
| JAR/WAR/PAR/EAR | Trivy Java DB | Include | - | - | Not needed |
|
||||
| pom.xml | Maven repository [^1] | [Exclude](#scopes) | ✓ | ✓[^7] | - |
|
||||
| *gradle.lockfile | - | Exclude | ✓ | ✓ | Not needed |
|
||||
| *.sbt.lock | - | Exclude | - | ✓ | Not needed |
|
||||
|
||||
These may be enabled or disabled depending on the target.
|
||||
See [here](./index.md) for the detail.
|
||||
@@ -69,6 +69,11 @@ 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.
|
||||
|
||||
### scopes
|
||||
Trivy supports `runtime`, `compile`, `test` and `import` (for `dependencyManagement`) [dependency scopes][dependency-scopes].
|
||||
Dependencies without scope are also detected.
|
||||
|
||||
By default, Trivy doesn't report dependencies with `test` scope. Use the `--include-dev-deps` flag to include them.
|
||||
|
||||
### 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.
|
||||
@@ -119,3 +124,5 @@ Make sure that you have cache[^8] directory to find licenses from `*.pom` depend
|
||||
[maven-central]: https://repo.maven.apache.org/maven2/
|
||||
[maven-pom-repos]: https://maven.apache.org/settings.html#repositories
|
||||
[sbt-dependency-lock]: https://stringbean.github.io/sbt-dependency-lock
|
||||
[detection-priority]: ../../scanner/vulnerability.md#detection-priority
|
||||
[dependency-scopes]: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
|
||||
|
||||
@@ -8,7 +8,7 @@ The following scanners are supported.
|
||||
|----------|:----:|:-------------:|:-------:|
|
||||
| npm | ✓ | ✓ | ✓ |
|
||||
| Yarn | ✓ | ✓ | ✓ |
|
||||
| pnpm | ✓ | ✓ | - |
|
||||
| pnpm | ✓ | ✓ | ✓ |
|
||||
| Bun | ✓ | ✓ | ✓ |
|
||||
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
@@ -54,6 +54,7 @@ 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.
|
||||
To identify licenses, you need to download dependencies to `node_modules` beforehand. Trivy analyzes `node_modules` for licenses.
|
||||
|
||||
#### lock file v9 version
|
||||
Trivy supports `Dev` field for `pnpm-lock.yaml` v9 or later. Use the `--include-dev-deps` flag to include the developer's dependencies in the result.
|
||||
|
||||
@@ -21,11 +21,11 @@ The following scanners are supported for Python packages.
|
||||
|
||||
The following table provides an outline of the features Trivy offers.
|
||||
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position |
|
||||
|-----------------|------------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|
|
||||
| pip | requirements.txt | - | Include | - | ✓ |
|
||||
| Pipenv | Pipfile.lock | ✓ | Include | - | ✓ |
|
||||
| Poetry | poetry.lock | ✓ | Exclude | ✓ | - |
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | [Detection Priority][detection-priority] |
|
||||
|-----------------|------------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|:----------------------------------------:|
|
||||
| pip | requirements.txt | - | Include | - | ✓ | ✓ |
|
||||
| Pipenv | Pipfile.lock | ✓ | Include | - | ✓ | Not needed |
|
||||
| Poetry | poetry.lock | ✓ | Exclude | ✓ | - | Not needed |
|
||||
|
||||
|
||||
| Packaging | Dependency graph |
|
||||
@@ -42,8 +42,17 @@ Trivy parses your files generated by package managers in filesystem/repository s
|
||||
### pip
|
||||
|
||||
#### Dependency detection
|
||||
Trivy only parses [version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#id4) with `==` comparison operator and without `.*`.
|
||||
To convert unsupported version specifiers - use the `pip freeze` command.
|
||||
By default, Trivy only parses [version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#id5) with `==` comparison operator and without `.*`.
|
||||
|
||||
Using the [--detection-priority comprehensive](#detection-priority) option ensures that the tool establishes a minimum version, which is particularly useful in scenarios where identifying the exact version is challenging.
|
||||
In such case Trivy parses specifiers `>=`,`~=` and a trailing `.*`.
|
||||
|
||||
```
|
||||
keyring >= 4.1.1 # Minimum version 4.1.1
|
||||
Mopidy-Dirble ~= 1.1 # Minimum version 1.1
|
||||
python-gitlab==2.0.* # Minimum version 2.0.0
|
||||
```
|
||||
Also, there is a way to convert unsupported version specifiers - use the `pip freeze` command.
|
||||
|
||||
```bash
|
||||
$ cat requirements.txt
|
||||
@@ -119,7 +128,7 @@ License detection is not supported for `Poetry`.
|
||||
|
||||
## Packaging
|
||||
Trivy parses the manifest files of installed packages in container image scanning and so on.
|
||||
See [here](https://packaging.python.org/en/latest/discussions/wheel-vs-egg/) for the detail.
|
||||
See [here](https://packaging.python.org/en/latest/discussions/package-formats/) for the detail.
|
||||
|
||||
### Egg
|
||||
Trivy looks for `*.egg-info`, `*.egg-info/PKG-INFO`, `*.egg` and `EGG-INFO/PKG-INFO` to identify Python packages.
|
||||
@@ -130,3 +139,4 @@ Trivy looks for `.dist-info/META-DATA` to identify Python packages.
|
||||
[^1]: Trivy checks `python`, `python3`, `python2` and `python.exe` file names.
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[detection-priority]: ../../scanner/vulnerability.md#detection-priority
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
# CBL-Mariner
|
||||
# Azure Linux (CBL-Mariner)
|
||||
|
||||
*CBL-Mariner was rebranded to Azure Linux for version 3.0 onwards.*
|
||||
|
||||
Trivy supports the following scanners for OS packages.
|
||||
|
||||
| Version | SBOM | Vulnerability | License |
|
||||
@@ -7,6 +10,8 @@ Trivy supports the following scanners for OS packages.
|
||||
| 1.0 (Distroless) | ✔ | ✔ | |
|
||||
| 2.0 | ✔ | ✔ | ✔ |
|
||||
| 2.0 (Distroless) | ✔ | ✔ | |
|
||||
| 3.0 | ✔ | ✔ | ✔ |
|
||||
| 3.0 (Distroless) | ✔ | ✔ | |
|
||||
|
||||
|
||||
The following table provides an outline of the targets Trivy supports.
|
||||
@@ -15,6 +20,7 @@ The following table provides an outline of the targets Trivy supports.
|
||||
| ------- | :-------------: | :-------------: | :----------: |
|
||||
| 1.0 | ✔ | ✔ | amd64, arm64 |
|
||||
| 2.0 | ✔ | ✔ | amd64, arm64 |
|
||||
| 3.0 | ✔ | ✔ | amd64, arm64 |
|
||||
|
||||
The table below outlines the features offered by Trivy.
|
||||
|
||||
@@ -24,22 +30,22 @@ The table below outlines the features offered by Trivy.
|
||||
| [Dependency graph][dependency-graph] | ✓ |
|
||||
|
||||
## SBOM
|
||||
Trivy detects packages that have been installed through package managers such as `dnf` and `yum`.
|
||||
Trivy detects packages that have been installed through package managers such as `tdnf`, `dnf` and `yum`.
|
||||
|
||||
## Vulnerability
|
||||
CBL-Mariner offers its own security advisories, and these are utilized when scanning CBL-Mariner for vulnerabilities.
|
||||
Azure Linux offers its own security advisories, and these are utilized when scanning Azure Linux for vulnerabilities.
|
||||
|
||||
### Data Source
|
||||
See [here](../../scanner/vulnerability.md#data-sources).
|
||||
|
||||
### Fixed Version
|
||||
Trivy takes fixed versions from [CBL-Mariner OVAL][oval].
|
||||
Trivy takes fixed versions from [Azure Linux OVAL][oval].
|
||||
|
||||
### Severity
|
||||
Trivy calculates the severity of an issue based on the severity provided in [CBL-Mariner OVAL][oval].
|
||||
Trivy calculates the severity of an issue based on the severity provided in [Azure Linux OVAL][oval].
|
||||
|
||||
### Status
|
||||
Trivy supports the following [vulnerability statuses] for CBL-Mariner.
|
||||
Trivy supports the following [vulnerability statuses] for Azure Linux.
|
||||
|
||||
| Status | Supported |
|
||||
| :-----------------: | :-------: |
|
||||
@@ -55,12 +61,11 @@ Trivy supports the following [vulnerability statuses] for CBL-Mariner.
|
||||
Trivy identifies licenses by examining the metadata of RPM packages.
|
||||
|
||||
!!! note
|
||||
License detection is not supported for CBL-Mariner Distroless.
|
||||
License detection is not supported for Azure Linux Distroless images.
|
||||
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[cbl-mariner]: https://github.com/microsoft/CBL-Mariner
|
||||
|
||||
[oval]: https://github.com/microsoft/CBL-MarinerVulnerabilityData/
|
||||
[oval]: https://github.com/microsoft/AzureLinuxVulnerabilityData/
|
||||
|
||||
[vulnerability statuses]: ../../configuration/filtering.md#by-status
|
||||
@@ -8,6 +8,9 @@ Trivy supports the following scanners for Conda packages.
|
||||
| Vulnerability | - |
|
||||
| License | ✓ |
|
||||
|
||||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | [Detection Priority][detection-priority] |
|
||||
|-----------------|-----------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|:----------------------------------------:|
|
||||
| Conda | environment.yml | - | Include | - | ✓ | - |
|
||||
|
||||
|
||||
## `<package>.json`
|
||||
@@ -41,3 +44,5 @@ To correctly define licenses, make sure your `environment.yml`[^1] contains `pre
|
||||
[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
|
||||
[prefix]: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#specifying-a-location-for-an-environment
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[detection-priority]: ../../scanner/vulnerability.md#detection-priority
|
||||
|
||||
@@ -9,24 +9,25 @@ Trivy supports operating systems for
|
||||
|
||||
## Supported OS
|
||||
|
||||
| OS | Supported Versions | Package Managers |
|
||||
|--------------------------------------|-------------------------------------|------------------|
|
||||
| [Alpine Linux](alpine.md) | 2.2 - 2.7, 3.0 - 3.20, 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 |
|
||||
| OS | Supported Versions | Package Managers |
|
||||
|---------------------------------------|-------------------------------------|------------------|
|
||||
| [Alpine Linux](alpine.md) | 2.2 - 2.7, 3.0 - 3.20, 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 |
|
||||
| [Azure Linux (CBL-Mariner)](azure.md) | 1.0, 2.0, 3.0 | tdnf/dnf/yum/rpm |
|
||||
| [Amazon Linux](amazon.md) | 1, 2, 2023 | dnf/yum/rpm |
|
||||
| [openSUSE Leap](suse.md) | 42, 15 | zypper/rpm |
|
||||
| [openSUSE Tumbleweed](suse.md) | (n/a) | 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
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Trivy supports the following distributions:
|
||||
|
||||
- openSUSE Leap
|
||||
- openSUSE Tumbleweed
|
||||
- SUSE Enterprise Linux (SLE)
|
||||
|
||||
Please see [here](index.md#supported-os) for supported versions.
|
||||
@@ -35,6 +36,6 @@ Trivy identifies licenses by examining the metadata of RPM packages.
|
||||
|
||||
|
||||
[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
|
||||
[cvrf]: http://ftp.suse.com/pub/projects/security/cvrf/
|
||||
[cvrf]: https://ftp.suse.com/pub/projects/security/cvrf/
|
||||
|
||||
[vulnerability statuses]: ../../configuration/filtering.md#by-status
|
||||
[vulnerability statuses]: ../../configuration/filtering.md#by-status
|
||||
|
||||
@@ -56,5 +56,6 @@ trivy [global flags] command [flags] target
|
||||
* [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 vex](trivy_vex.md) - [EXPERIMENTAL] VEX utilities
|
||||
* [trivy vm](trivy_vm.md) - [EXPERIMENTAL] Scan a virtual machine image
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ trivy clean [flags]
|
||||
-h, --help help for clean
|
||||
--java-db remove Java database
|
||||
--scan-cache remove scan cache (container and VM image analysis results)
|
||||
--vex-repo remove VEX repositories
|
||||
--vuln-db remove vulnerability database
|
||||
```
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ trivy config [flags] DIR
|
||||
--compliance string compliance report to generate
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--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
|
||||
@@ -30,7 +31,7 @@ trivy config [flags] DIR
|
||||
-h, --help help for config
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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-json,terraformplan-snapshot])
|
||||
|
||||
@@ -27,9 +27,14 @@ trivy filesystem [flags] PATH
|
||||
--compliance string compliance report to generate
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--custom-headers strings custom headers in client mode
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
@@ -48,7 +53,7 @@ trivy filesystem [flags] PATH
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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:1")
|
||||
@@ -63,6 +68,8 @@ 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.
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -81,6 +88,7 @@ trivy filesystem [flags] PATH
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-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
|
||||
@@ -88,8 +96,7 @@ trivy filesystem [flags] PATH
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@@ -41,9 +41,14 @@ trivy image [flags] IMAGE_NAME
|
||||
--compliance string compliance report to generate (docker-cis-1.6.0)
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--custom-headers strings custom headers in client mode
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
@@ -66,7 +71,7 @@ trivy image [flags] IMAGE_NAME
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--image-config-scanners strings comma-separated list of what security issues to detect on container image configurations (misconfig,secret)
|
||||
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
|
||||
--include-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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:1")
|
||||
@@ -81,6 +86,8 @@ trivy image [flags] IMAGE_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)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--platform string set platform in the form os/arch if image is multi-platform capable
|
||||
--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
|
||||
@@ -102,14 +109,14 @@ trivy image [flags] IMAGE_NAME
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@@ -37,8 +37,13 @@ trivy kubernetes [flags] [CONTEXT]
|
||||
--compliance string compliance report to generate (k8s-nsa-1.0,k8s-cis-1.23,eks-cis-1.4,rke2-cis-1.24,k8s-pss-baseline-0.1,k8s-pss-restricted-0.1)
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
@@ -61,7 +66,7 @@ trivy kubernetes [flags] [CONTEXT]
|
||||
--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-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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'
|
||||
@@ -78,6 +83,8 @@ trivy kubernetes [flags] [CONTEXT]
|
||||
--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.
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -97,13 +104,13 @@ trivy kubernetes [flags] [CONTEXT]
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-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)
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@@ -27,9 +27,14 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--commit string pass the commit hash to be scanned
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--custom-headers strings custom headers in client mode
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
@@ -48,7 +53,7 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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:1")
|
||||
@@ -63,6 +68,8 @@ 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.
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -80,6 +87,7 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
--tag string pass the tag name to be scanned
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
@@ -88,8 +96,7 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@@ -29,9 +29,14 @@ trivy rootfs [flags] ROOTDIR
|
||||
--checks-bundle-repository string OCI registry URL to retrieve checks bundle from (default "ghcr.io/aquasecurity/trivy-checks:0")
|
||||
--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
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--custom-headers strings custom headers in client mode
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
@@ -51,7 +56,7 @@ trivy rootfs [flags] ROOTDIR
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-deprecated-checks include deprecated checks
|
||||
--include-deprecated-checks include deprecated checks (default true)
|
||||
--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:1")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
@@ -65,6 +70,8 @@ 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.
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -82,6 +89,7 @@ trivy rootfs [flags] ROOTDIR
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-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
|
||||
@@ -89,8 +97,7 @@ trivy rootfs [flags] ROOTDIR
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@@ -25,6 +25,10 @@ trivy sbom [flags] SBOM_PATH
|
||||
--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:2")
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
@@ -43,6 +47,8 @@ trivy sbom [flags] SBOM_PATH
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
-o, --output string output file name
|
||||
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -57,11 +63,11 @@ trivy sbom [flags] SBOM_PATH
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-t, --template string output template
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
28
docs/docs/references/configuration/cli/trivy_vex.md
Normal file
28
docs/docs/references/configuration/cli/trivy_vex.md
Normal file
@@ -0,0 +1,28 @@
|
||||
## trivy vex
|
||||
|
||||
[EXPERIMENTAL] VEX utilities
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for vex
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
* [trivy vex repo](trivy_vex_repo.md) - Manage VEX repositories
|
||||
|
||||
44
docs/docs/references/configuration/cli/trivy_vex_repo.md
Normal file
44
docs/docs/references/configuration/cli/trivy_vex_repo.md
Normal file
@@ -0,0 +1,44 @@
|
||||
## trivy vex repo
|
||||
|
||||
Manage VEX repositories
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# Initialize the configuration file
|
||||
$ trivy vex repo init
|
||||
|
||||
# List VEX repositories
|
||||
$ trivy vex repo list
|
||||
|
||||
# Download the VEX repositories
|
||||
$ trivy vex repo download
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for repo
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy vex](trivy_vex.md) - [EXPERIMENTAL] VEX utilities
|
||||
* [trivy vex repo download](trivy_vex_repo_download.md) - Download the VEX repositories
|
||||
* [trivy vex repo init](trivy_vex_repo_init.md) - Initialize a configuration file
|
||||
* [trivy vex repo list](trivy_vex_repo_list.md) - List VEX repositories
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
## trivy vex repo download
|
||||
|
||||
Download the VEX repositories
|
||||
|
||||
### Synopsis
|
||||
|
||||
Downloads enabled VEX repositories. If specific repository names are provided as arguments, only those repositories will be downloaded. Otherwise, all enabled repositories are downloaded.
|
||||
|
||||
```
|
||||
trivy vex repo download [REPO_NAMES] [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for download
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy vex repo](trivy_vex_repo.md) - Manage VEX repositories
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
## trivy vex repo init
|
||||
|
||||
Initialize a configuration file
|
||||
|
||||
```
|
||||
trivy vex repo init [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for init
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy vex repo](trivy_vex_repo.md) - Manage VEX repositories
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
## trivy vex repo list
|
||||
|
||||
List VEX repositories
|
||||
|
||||
```
|
||||
trivy vex repo list [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for list
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy vex repo](trivy_vex_repo.md) - Manage VEX repositories
|
||||
|
||||
@@ -25,9 +25,14 @@ trivy vm [flags] VM_IMAGE
|
||||
--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")
|
||||
--compliance string compliance report to generate
|
||||
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
|
||||
--custom-headers strings custom headers in client mode
|
||||
--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
|
||||
--detection-priority string specify the detection priority:
|
||||
- "precise": Prioritizes precise by minimizing false positives.
|
||||
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
|
||||
(precise,comprehensive) (default "precise")
|
||||
--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
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
@@ -56,6 +61,8 @@ trivy vm [flags] VM_IMAGE
|
||||
-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)
|
||||
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
|
||||
--pkg-types strings list of package types (os,library) (default [os,library])
|
||||
--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
|
||||
@@ -71,12 +78,12 @@ trivy vm [flags] VM_IMAGE
|
||||
--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-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
|
||||
-t, --template string output template
|
||||
--tf-exclude-downloaded-modules exclude misconfigurations for downloaded terraform modules
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--vex string [EXPERIMENTAL] file path to VEX
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,22 @@
|
||||
|
||||
Trivy has client/server mode. Trivy server has vulnerability database and Trivy client doesn't have to download vulnerability database. It is useful if you want to scan images or files at multiple locations and do not want to download the database at every location.
|
||||
|
||||
| Client/Server Mode | Image | Rootfs | Filesystem | Repository | Config | AWS | K8s |
|
||||
|:---------------------:|:-----:|:------:|:----------:|:----------:|:------:|:---:|:---:|
|
||||
| Supported | ✅ | ✅ | ✅ | ✅ | ✅ | X | X |
|
||||
| Client/Server Mode | Image | Rootfs | Filesystem | Repository | Config | K8s |
|
||||
|:------------------:|:-----:|:------:|:----------:|:----------:|:------:|:---:|
|
||||
| Supported | ✅ | ✅ | ✅ | ✅ | - | - |
|
||||
|
||||
Some scanners run on the client side, even in client/server mode.
|
||||
|
||||
| Scanner | Run on Client or Server |
|
||||
|:----------------:|:-----------------------:|
|
||||
| Vulnerability | Server |
|
||||
| Misconfiguration | Client[^1] |
|
||||
| Secret | Client[^2] |
|
||||
| License | Server |
|
||||
|
||||
!!! note
|
||||
Scanning of misconfigurations and licenses is performed on the client side (as in standalone mode).
|
||||
Otherwise, the client would need to send files to the server that may contain sensitive information.
|
||||
|
||||
## Server
|
||||
At first, you need to launch Trivy server. It downloads vulnerability database automatically and continue to fetch the latest DB in the background.
|
||||
@@ -338,3 +351,5 @@ Returns the `200 OK` status if the request was successful.
|
||||
|
||||

|
||||
|
||||
[^1]: The checks bundle is also downloaded on the client side.
|
||||
[^2]: The scan result with masked secrets is sent to the server
|
||||
@@ -203,10 +203,7 @@ Trivy v0.23.0 or later requires Trivy DB v2. Please update your local database o
|
||||
!!! error
|
||||
FATAL failed to download vulnerability DB
|
||||
|
||||
If trivy is running behind corporate firewall, you have to add the following urls to your allowlist.
|
||||
|
||||
- ghcr.io
|
||||
- pkg-containers.githubusercontent.com
|
||||
If Trivy is running behind corporate firewall, refer to the necessary connectivity requirements as described [here][network].
|
||||
|
||||
### Denied
|
||||
|
||||
@@ -271,4 +268,5 @@ $ trivy clean --all
|
||||
```
|
||||
|
||||
[air-gapped]: ../advanced/air-gap.md
|
||||
[network]: ../advanced/air-gap.md#network-requirements
|
||||
[redis-cache]: ../../vulnerability/examples/cache/#cache-backend
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
# 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].
|
||||
## Checks Sources
|
||||
Trivy has an extensive library of misconfiguration checks that is maintained at <https://github.com/aquasecurity/trivy-checks>.
|
||||
Trivy checks are mainly written in [Rego][rego], while some checks are written in Go.
|
||||
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.
|
||||
## Checks Bundle
|
||||
When performing a misconfiguration scan, Trivy will automatically download the relevant Checks bundle. The bundle is cached locally and Trivy will reuse it for subsequent scans on the same machine. Trivy takes care of updating the cache automatically, so normally users can be oblivious to it.
|
||||
|
||||
## 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
|
||||
## Checks Distribution
|
||||
Trivy checks are distributed as an [OPA bundle](opa-bundle) hosted in the following GitHub Container Registry: <https://ghcr.io/aquasecurity/trivy-checks>.
|
||||
Trivy checks for updates to OPA bundle on GHCR every 24 hours and pulls it if there are any updates.
|
||||
|
||||
### External connectivity
|
||||
Trivy needs to connect to the internet to download the bundle. If you are running Trivy in an air-gapped environment, or an tightly controlled network, please refer to the [Advanced Network Scenarios document](../../../advanced/air-gap.md).
|
||||
The Checks bundle is also embedded in the Trivy binary (at build time), and will be used as a fallback if Trivy is unable to download the bundle. This means that you can still scan for misconfigurations in an air-gapped environment using the Checks from the time of the Trivy release you are using.
|
||||
|
||||
[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
|
||||
[opa-bundle]: https://www.openpolicyagent.org/docs/latest/management-bundles/
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
# Custom Data
|
||||
|
||||
Custom checks may require additional data in order to determine an answer.
|
||||
Custom checks may require additional data in order to make a resolution. You can pass arbitrary data files to Trivy to be used when evaluating rego checks using the `--data` flag.
|
||||
Trivy recursively searches the specified data paths for JSON (`*.json`) and YAML (`*.yaml`) files.
|
||||
|
||||
For example, an allowed list of resources that can be created.
|
||||
Instead of hardcoding this information inside your policy, Trivy allows passing paths to data files with the `--data` flag.
|
||||
For example, consider an allowed list of resources that can be created.
|
||||
Instead of hardcoding this information inside your policy, you can maintain the list in a separate file.
|
||||
|
||||
Given the following yaml file:
|
||||
Example data file:
|
||||
|
||||
```bash
|
||||
$ cd examples/misconf/custom-data
|
||||
$ cat data/ports.yaml [~/src/github.com/aquasecurity/trivy/examples/misconf/custom-data]
|
||||
```yaml
|
||||
services:
|
||||
ports:
|
||||
- "20"
|
||||
@@ -19,7 +18,7 @@ services:
|
||||
- "23/tcp"
|
||||
```
|
||||
|
||||
This can be imported into your policy:
|
||||
Example usage in a Rego check:
|
||||
|
||||
```rego
|
||||
import data.services
|
||||
@@ -27,9 +26,8 @@ import data.services
|
||||
ports := services.ports
|
||||
```
|
||||
|
||||
Then, you need to pass data paths through `--data` option.
|
||||
Trivy recursively searches the specified paths for JSON (`*.json`) and YAML (`*.yaml`) files.
|
||||
Example loading the data file:
|
||||
|
||||
```bash
|
||||
$ trivy conf --policy ./policy --data data --namespaces user ./configs
|
||||
```
|
||||
trivy config --config-check ./checks --data ./data --namespaces user ./configs
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@ This will output a large trace from Open Policy Agent like the following:
|
||||
Only failed checks show traces. If you want to debug a passed check, you need to make it fail on purpose.
|
||||
|
||||
```shell
|
||||
$ trivy conf --trace configs/
|
||||
$ trivy config --trace configs/
|
||||
2022-05-16T13:47:58.853+0100 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
## Overview
|
||||
You can write custom checks in [Rego][rego].
|
||||
Once you finish writing custom checks, you can pass the policy files or the directory where those policies are stored with `--policy` option.
|
||||
Once you finish writing custom checks, you can pass the check files or the directory where those checks are stored with --config-check` option.
|
||||
|
||||
``` bash
|
||||
trivy conf --policy /path/to/policy.rego --policy /path/to/custom_policies --namespaces user /path/to/config_dir
|
||||
trivy config --config-check /path/to/policy.rego --config-check /path/to/custom_checks --namespaces user /path/to/config_dir
|
||||
```
|
||||
|
||||
As for `--namespaces` option, the detail is described as below.
|
||||
@@ -93,7 +93,7 @@ By default, only `builtin.*` packages will be evaluated.
|
||||
If you define custom packages, you have to specify the package prefix via `--namespaces` option. By default, Trivy only runs in its own namespace, unless specified by the user. Note that the custom namespace does not have to be `user` as in this example. It could be anything user-defined.
|
||||
|
||||
``` bash
|
||||
trivy conf --policy /path/to/custom_policies --namespaces user /path/to/config_dir
|
||||
trivy config --config-check /path/to/custom_checks --namespaces user /path/to/config_dir
|
||||
```
|
||||
|
||||
In this case, `user.*` will be evaluated.
|
||||
@@ -135,7 +135,7 @@ correct and do not reference incorrect properties/values.
|
||||
|
||||
#### custom.avd_id and custom.id
|
||||
|
||||
The AVD_ID can be used to link the check to the Aqua Vulnerability Database (AVD) entry. For example, the `avd_id` `AVD-AWS-0176` is the ID of the check in the [AWS Vulnerability Database](https://avd.aquasec.com/). If you are [contributing your check to trivy-policies](../../../../community/contribute/checks/overview.md), you need to generate an ID using `make id` in the [trivy-checks](https://github.com/aquasecurity/trivy-checks) repository. The output of the command will provide you the next free IDs for the different providers in Trivy.
|
||||
The AVD_ID can be used to link the check to the Aqua Vulnerability Database (AVD) entry. For example, the `avd_id` `AVD-AWS-0176` is the ID of the check in the [AWS Vulnerability Database](https://avd.aquasec.com/). If you are [contributing your check to trivy-checks](../../../../community/contribute/checks/overview.md), you need to generate an ID using `make id` in the [trivy-checks](https://github.com/aquasecurity/trivy-checks) repository. The output of the command will provide you the next free IDs for the different providers in Trivy.
|
||||
|
||||
The ID is based on the AVD_ID. For instance if the `avd_id` is `AVD-AWS-0176`, the ID is `ID0176`.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Input Schema
|
||||
|
||||
## Overview
|
||||
Policies can be defined with custom schemas that allow inputs to be verified against them. Adding a policy schema
|
||||
Checks 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/tree/main/pkg/iac/rego/schemas)
|
||||
|
||||
@@ -101,13 +101,13 @@ For example, the following example holds IaC files for Terraform, CloudFormation
|
||||
``` bash
|
||||
$ ls iac/
|
||||
Dockerfile deployment.yaml main.tf mysql-8.8.26.tar
|
||||
$ trivy conf --severity HIGH,CRITICAL ./iac
|
||||
$ trivy config --severity HIGH,CRITICAL ./iac
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
```bash
|
||||
2022-06-06T11:01:21.142+0100 INFO Detected config files: 8
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
@@ -315,6 +315,9 @@ Failures: 2 (MEDIUM: 2, HIGH: 0, CRITICAL: 0)
|
||||
This section describes misconfiguration-specific configuration.
|
||||
Other common options are documented [here](../../configuration/index.md).
|
||||
|
||||
### External connectivity
|
||||
Trivy needs to connect to the internet to download the checks bundle. If you are running Trivy in an air-gapped environment, or an tightly controlled network, please refer to the [Advanced Network Scenarios document](../../advanced/air-gap.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.
|
||||
@@ -326,19 +329,74 @@ trivy config --misconfig-scanners=terraform,dockerfile .
|
||||
|
||||
Will only scan for misconfigurations that pertain to Terraform and Dockerfiles.
|
||||
|
||||
### Passing custom checks
|
||||
You can pass policy files or directories including your custom checks through `--policy` option.
|
||||
### Loading custom checks
|
||||
You can load check files or directories including your custom checks using the `--config-check` flag.
|
||||
This can be repeated for specifying multiple files or directories.
|
||||
|
||||
```bash
|
||||
cd examplex/misconf/
|
||||
trivy conf --policy custom-policy/policy --policy combine/policy --policy policy.rego --namespaces user misconf/mixed
|
||||
trivy config --config-check custom-policy/policy --config-check combine/policy --config-check policy.rego --namespaces user myapp
|
||||
```
|
||||
|
||||
For more details, see [Custom Checks](./custom/index.md).
|
||||
You can load checks bundle as OCI Image from a Container Registry using the `--checks-bundle-repository` flag.
|
||||
|
||||
!!! tip
|
||||
You also need to specify `--namespaces` option.
|
||||
```bash
|
||||
trivy config --checks-bundle-repository myregistry.local/mychecks --namespaces user myapp
|
||||
```
|
||||
|
||||
|
||||
### Scan arbitrary JSON and YAML configurations
|
||||
By default, scanning JSON and YAML configurations is disabled, since Trivy does not contain built-in checks for these configurations. To enable it, pass the `json` or `yaml` to `--misconfig-scanners`. See [Enabling a subset of misconfiguration scanners](#enabling-a-subset-of-misconfiguration-scanners) for more information. Trivy will pass each file as is to the checks input.
|
||||
|
||||
|
||||
!!! example
|
||||
```bash
|
||||
$ cat iac/serverless.yaml
|
||||
service: serverless-rest-api-with-pynamodb
|
||||
|
||||
frameworkVersion: ">=2.24.0"
|
||||
|
||||
plugins:
|
||||
- serverless-python-requirements
|
||||
...
|
||||
|
||||
$ cat serverless.rego
|
||||
# METADATA
|
||||
# title: Serverless Framework service name not starting with "aws-"
|
||||
# description: Ensure that Serverless Framework service names start with "aws-"
|
||||
# schemas:
|
||||
# - input: schema["serverless-schema"]
|
||||
# custom:
|
||||
# id: SF001
|
||||
# severity: LOW
|
||||
package user.serverless001
|
||||
|
||||
deny[res] {
|
||||
not startswith(input.service, "aws-")
|
||||
res := result.new(
|
||||
sprintf("Service name %q is not allowed", [input.service]),
|
||||
input.service
|
||||
)
|
||||
}
|
||||
|
||||
$ trivy config --misconfig-scanners=json,yaml --config-check ./serverless.rego --check-namespaces user ./iac
|
||||
serverless.yaml (yaml)
|
||||
|
||||
Tests: 4 (SUCCESSES: 3, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 1, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
LOW: Service name "serverless-rest-api-with-pynamodb" is not allowed
|
||||
═════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
Ensure that Serverless Framework service names start with "aws-"
|
||||
```
|
||||
|
||||
You can also pass schemas using the `config-file-schemas` flag. Trivy will use these schemas for file filtering and type checking in Rego checks. If the file does not match any of the passed schemas, it will be ignored.
|
||||
|
||||
!!! example
|
||||
```bash
|
||||
$ trivy config --misconfig-scanners=json,yaml --config-check ./serverless.rego --check-namespaces user --config-file-schemas ./serverless-schema.json ./iac
|
||||
```
|
||||
|
||||
If the schema is specified in the check metadata and is in the directory specified in the `--config-check` argument, it will be automatically loaded as specified [here](./custom/schema.md#custom-checks-with-custom-schemas), and will only be used for type checking in Rego.
|
||||
|
||||
### Passing custom data
|
||||
You can pass directories including your custom data through `--data` option.
|
||||
@@ -346,7 +404,7 @@ This can be repeated for specifying multiple directories.
|
||||
|
||||
```bash
|
||||
cd examples/misconf/custom-data
|
||||
trivy conf --policy ./policy --data ./data --namespaces user ./configs
|
||||
trivy config --config-check ./my-check --data ./data --namespaces user ./configs
|
||||
```
|
||||
|
||||
For more details, see [Custom Data](./custom/data.md).
|
||||
@@ -357,15 +415,15 @@ If you want to evaluate custom checks in other packages, you have to specify pac
|
||||
This can be repeated for specifying multiple packages.
|
||||
|
||||
``` bash
|
||||
trivy conf --policy ./policy --namespaces main --namespaces user ./configs
|
||||
trivy config --config-check ./my-check --namespaces main --namespaces user ./configs
|
||||
```
|
||||
|
||||
### Private terraform registries
|
||||
Trivy can download terraform code from private registries.
|
||||
### 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):
|
||||
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`.
|
||||
@@ -476,7 +534,7 @@ If you want to ignore multiple resources on different attributes, you can specif
|
||||
#trivy:ignore:aws-ec2-no-public-ingress-sgr[from_port=5432]
|
||||
```
|
||||
|
||||
You can also ignore a resource on multiple attributes:
|
||||
You can also ignore a resource on multiple attributes in the same rule:
|
||||
```tf
|
||||
locals {
|
||||
rules = {
|
||||
@@ -505,10 +563,7 @@ resource "aws_security_group_rule" "example" {
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
Checks can also be ignored by nested attributes:
|
||||
|
||||
```tf
|
||||
#trivy:ignore:*[logging_config.prefix=myprefix]
|
||||
|
||||
@@ -19,22 +19,22 @@ See [here](../coverage/os/index.md#supported-os) for the supported OSes.
|
||||
|
||||
### Data Sources
|
||||
|
||||
| OS | Source |
|
||||
| ------------- | ------------------------------------------------------------ |
|
||||
| Arch Linux | [Vulnerable Issues][arch] |
|
||||
| Alpine Linux | [secdb][alpine] |
|
||||
| Wolfi Linux | [secdb][wolfi] |
|
||||
| Chainguard | [secdb][chainguard] |
|
||||
| Amazon Linux | [Amazon Linux Security Center][amazon] |
|
||||
| Debian | [Security Bug Tracker][debian-tracker] / [OVAL][debian-oval] |
|
||||
| Ubuntu | [Ubuntu CVE Tracker][ubuntu] |
|
||||
| RHEL/CentOS | [OVAL][rhel-oval] / [Security Data][rhel-api] |
|
||||
| AlmaLinux | [AlmaLinux Product Errata][alma] |
|
||||
| Rocky Linux | [Rocky Linux UpdateInfo][rocky] |
|
||||
| Oracle Linux | [OVAL][oracle] |
|
||||
| CBL-Mariner | [OVAL][mariner] |
|
||||
| OpenSUSE/SLES | [CVRF][suse] |
|
||||
| Photon OS | [Photon Security Advisory][photon] |
|
||||
| OS | Source |
|
||||
|---------------------------|--------------------------------------------------------------|
|
||||
| Arch Linux | [Vulnerable Issues][arch] |
|
||||
| Alpine Linux | [secdb][alpine] |
|
||||
| Wolfi Linux | [secdb][wolfi] |
|
||||
| Chainguard | [secdb][chainguard] |
|
||||
| Amazon Linux | [Amazon Linux Security Center][amazon] |
|
||||
| Debian | [Security Bug Tracker][debian-tracker] / [OVAL][debian-oval] |
|
||||
| Ubuntu | [Ubuntu CVE Tracker][ubuntu] |
|
||||
| RHEL/CentOS | [OVAL][rhel-oval] / [Security Data][rhel-api] |
|
||||
| AlmaLinux | [AlmaLinux Product Errata][alma] |
|
||||
| Rocky Linux | [Rocky Linux UpdateInfo][rocky] |
|
||||
| Oracle Linux | [OVAL][oracle] |
|
||||
| Azure Linux (CBL-Mariner) | [OVAL][azure] |
|
||||
| OpenSUSE/SLES | [CVRF][suse] |
|
||||
| Photon OS | [Photon Security Advisory][photon] |
|
||||
|
||||
#### Data Source Selection
|
||||
Trivy **only** consumes security advisories from the sources listed in the above table.
|
||||
@@ -158,53 +158,79 @@ Trivy can detect vulnerabilities in Kubernetes clusters and components by scanni
|
||||
|
||||
[^1]: Some manual triage and correction has been made.
|
||||
|
||||
## Database
|
||||
Trivy downloads [the vulnerability database](https://github.com/aquasecurity/trivy-db) every 6 hours.
|
||||
Trivy uses two types of databases for vulnerability detection:
|
||||
|
||||
- Vulnerability Database
|
||||
- Java Index Database
|
||||
|
||||
This page provides detailed information about these databases.
|
||||
|
||||
### Vulnerability Database
|
||||
Trivy utilizes a database containing vulnerability information.
|
||||
This database is built every six hours on [GitHub](https://github.com/aquasecurity/trivy-db) and is distributed via [GitHub Container registry (GHCR)](https://ghcr.io/aquasecurity/trivy-db).
|
||||
The database is cached and updated as needed.
|
||||
As Trivy updates the database automatically during execution, users don't need to be concerned about it.
|
||||
## Databases
|
||||
Trivy utilizes several databases containing information relevant for vulnerability scanning.
|
||||
When performing a vulnerability scan, Trivy will automatically downloads the relevant databases. The databases are cached locally and Trivy will reuse them for subsequent scans on the same machine. Trivy takes care of updating the databases cache automatically, so normally users can be oblivious to it.
|
||||
|
||||
For CLI flags related to the database, please refer to [this page](../configuration/db.md).
|
||||
|
||||
#### Private Hosting
|
||||
If you host the database on your own OCI registry, you can specify a different repository with the `--db-repository` flag.
|
||||
The default is `ghcr.io/aquasecurity/trivy-db`.
|
||||
|
||||
```shell
|
||||
$ trivy image --db-repository YOUR_REPO YOUR_IMAGE
|
||||
```
|
||||
|
||||
If authentication is required, it can be configured in the same way as for private images.
|
||||
Please refer to [the documentation](../advanced/private-registries/index.md) for more details.
|
||||
### Vulnerability Database
|
||||
This is Trivy's main database which contains vulnerability information, as collected from the datasources mentioned above.
|
||||
It is built every six hours on [GitHub](https://github.com/aquasecurity/trivy-db).
|
||||
|
||||
### Java Index Database
|
||||
This database is only downloaded when scanning JAR files so that Trivy can identify the groupId, artifactId, and version of JAR files.
|
||||
It is built once a day on [GitHub](https://github.com/aquasecurity/trivy-java-db) and distributed via [GitHub Container registry (GHCR)](https://ghcr.io/aquasecurity/trivy-java-db).
|
||||
Like the vulnerability database, it is automatically downloaded and updated when needed, so users don't need to worry about it.
|
||||
When scanning JAR files, Trivy relies on a dedicated database for identifying the groupId, artifactId, and version of the scanned JAR files. This database is only used when scanning JAR files, however your scanned artifacts might contain JAR files that you're not aware of.
|
||||
This database is built once a day on [GitHub](https://github.com/aquasecurity/trivy-java-db).
|
||||
|
||||
#### Private Hosting
|
||||
If you host the database on your own OCI registry, you can specify a different repository with the `--java-db-repository` flag.
|
||||
The default is `ghcr.io/aquasecurity/trivy-java-db`.
|
||||
### External connectivity
|
||||
Trivy needs to connect to the internet to download the databases. If you are running Trivy in an air-gapped environment, or an tightly controlled network, please refer to the [Advanced Network Scenarios document](../advanced/air-gap.md).
|
||||
|
||||
If authentication is required, you need to run `docker login YOUR_REGISTRY`.
|
||||
Currently, specifying a username and password is not supported.
|
||||
## Detection Behavior
|
||||
Trivy prioritizes precision in vulnerability detection, aiming to minimize false positives while potentially accepting some false negatives.
|
||||
This approach is particularly relevant in two key areas:
|
||||
|
||||
- Handling Software Installed via OS Packages
|
||||
- Handling Packages with Unspecified Versions
|
||||
|
||||
### Handling Software Installed via OS Packages
|
||||
For files installed by OS package managers, such as `apt`, Trivy exclusively uses advisories from the OS vendor.
|
||||
This means that even if a JAR file is present in a container image, if it was installed via an OS package manager (e.g., `apt`), Trivy will not analyze the JAR file itself and use upstream security advisories.
|
||||
|
||||
For example, consider the Python `requests` package in Red Hat Universal Base Image 8:
|
||||
|
||||
```bash
|
||||
[root@987ee49dc93d /]# head -n 3 /usr/lib/python3.6/site-packages/requests-2.20.0-py3.6.egg-info/PKG-INFO
|
||||
Metadata-Version: 2.1
|
||||
Name: requests
|
||||
Version: 2.20.0
|
||||
```
|
||||
|
||||
Version 2.20.0 is installed, and this package is installed by `dnf`.
|
||||
|
||||
```bash
|
||||
[root@987ee49dc93d /]# rpm -ql python3-requests | grep PKG-INFO
|
||||
/usr/lib/python3.6/site-packages/requests-2.20.0-py3.6.egg-info/PKG-INFO
|
||||
```
|
||||
|
||||
At first glance, this might seem vulnerable to [CVE-2023-32681], which affects versions of requests prior to v2.31.0.
|
||||
However, Red Hat backported the fix to v2.20.0-3 in [RHSA-2023:4520], and the package is not vulnerable.
|
||||
|
||||
- Upstream (PyPI [requests]): Fixed in v2.31.0
|
||||
- Red Hat (`python-requests`): Backported fix applied in v2.20.0-3 (RHSA-2023:4520)
|
||||
|
||||
If Trivy were to detect CVE-2023-32681 in this case, it would be a false positive.
|
||||
This illustrates why using the correct security advisory is crucial to avoid false detections.
|
||||
To minimize false positives, Trivy trusts the OS vendor's advisory for software installed via OS package managers and does not use upstream advisories for these packages.
|
||||
|
||||
However, this approach may lead to false negatives if the OS vendor's advisories are delayed or missing.
|
||||
In such cases, using [--detection-priority comprehensive](#detection-priority) allows Trivy to consider upstream advisories (e.g., [GitHub Advisory Database][ghsa]), potentially increasing false positives but reducing false negatives.
|
||||
|
||||
### Handling Packages with Unspecified Versions
|
||||
When a package version cannot be uniquely determined (e.g., `package-a: ">=3.0"`), Trivy typically skips vulnerability detection for that package to avoid false positives.
|
||||
If a lock file is present with fixed versions, Trivy will use those for detection.
|
||||
|
||||
To detect potential vulnerabilities even with unspecified versions, use [--detection-priority comprehensive](#detection-priority).
|
||||
This option makes Trivy use the minimum version in the specified range for vulnerability detection.
|
||||
While this may increase false positives if the actual version used is not the minimum, it helps reduce false negatives.
|
||||
|
||||
## Configuration
|
||||
This section describes vulnerability-specific configuration.
|
||||
Other common options are documented [here](../configuration/index.md).
|
||||
|
||||
### Enabling a subset of package types
|
||||
### 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.
|
||||
You can do so by passing the `--pkg-types` option.
|
||||
This flag takes a comma-separated list of package types.
|
||||
|
||||
Available values:
|
||||
@@ -215,7 +241,7 @@ Available values:
|
||||
- Scan language-specific packages (e.g. packages installed by `pip`, `npm`, or `gem`).
|
||||
|
||||
```bash
|
||||
$ trivy image --vuln-type os ruby:2.4.0
|
||||
$ trivy image --pkg-types os ruby:2.4.0
|
||||
```
|
||||
|
||||
|
||||
@@ -268,6 +294,64 @@ Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
|
||||
</details>
|
||||
|
||||
!!! info
|
||||
This flag filters the packages themselves, so it also affects the `--list-all-pkgs` option and SBOM generation.
|
||||
|
||||
### Filtering by Package Relationships
|
||||
|
||||
|
||||
Trivy supports filtering vulnerabilities based on the relationship of packages within a project.
|
||||
This is achieved through the `--pkg-relationships` flag.
|
||||
This feature allows you to focus on vulnerabilities in specific types of dependencies, such as only those in direct dependencies.
|
||||
|
||||
In Trivy, there are four types of package relationships:
|
||||
|
||||
1. `root`: The root package being scanned
|
||||
2. `direct`: Direct dependencies of the root package
|
||||
3. `indirect`: Transitive dependencies
|
||||
4. `unknown`: Packages whose relationship cannot be determined
|
||||
|
||||
The available relationships may vary depending on the ecosystem.
|
||||
To see which relationships are supported for a particular project, you can use the JSON output format and check the `Relationship` field:
|
||||
|
||||
```
|
||||
$ trivy repo -f json --list-all-pkgs /path/to/project
|
||||
```
|
||||
|
||||
To scan only the root package and its direct dependencies, you can use the flag as follows:
|
||||
|
||||
```
|
||||
$ trivy repo --pkg-relationships root,direct /path/to/project
|
||||
```
|
||||
|
||||
By default, all relationships are included in the scan.
|
||||
|
||||
!!! info
|
||||
This flag filters the packages themselves, so it also affects the `--list-all-pkgs` option and SBOM generation.
|
||||
|
||||
!!! warning
|
||||
As it may not provide a complete package list, `--pkg-relationships` cannot be used with `--dependency-tree`, `--vex` or SBOM generation.
|
||||
|
||||
### Detection Priority
|
||||
|
||||
Trivy provides a `--detection-priority` flag to control the balance between false positives and false negatives in vulnerability detection.
|
||||
This concept is similar to the relationship between [precision and recall][precision-recall] in machine learning evaluation.
|
||||
|
||||
```bash
|
||||
$ trivy image --detection-priority {precise|comprehensive} alpine:3.15
|
||||
```
|
||||
|
||||
- `precise`: This mode prioritizes reducing false positives. It results in less noisy vulnerability reports but may miss some potential vulnerabilities.
|
||||
- `comprehensive`: This mode aims to detect more vulnerabilities, potentially including some that might be false positives.
|
||||
It provides broader coverage but may increase the noise in the results.
|
||||
|
||||
The default value is `precise`. Also refer to the [detection behavior](#detection-behavior) section for more information.
|
||||
|
||||
Regardless of the chosen mode, user review of detected vulnerabilities is crucial:
|
||||
|
||||
- `precise`: Review thoroughly, considering potential missed vulnerabilities.
|
||||
- `comprehensive`: Carefully investigate each reported vulnerability due to increased false positive possibility.
|
||||
|
||||
[^1]: https://github.com/GoogleContainerTools/distroless
|
||||
|
||||
[nvd-CVE-2023-0464]: https://nvd.nist.gov/vuln/detail/CVE-2023-0464
|
||||
@@ -288,7 +372,7 @@ Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
[oracle]: https://linux.oracle.com/security/oval/
|
||||
[suse]: http://ftp.suse.com/pub/projects/security/cvrf/
|
||||
[photon]: https://packages.vmware.com/photon/photon_cve_metadata/
|
||||
[mariner]: https://github.com/microsoft/CBL-MarinerVulnerabilityData/
|
||||
[azure]: https://github.com/microsoft/AzureLinuxVulnerabilityData/
|
||||
|
||||
[php-ghsa]: https://github.com/advisories?query=ecosystem%3Acomposer
|
||||
[python-ghsa]: https://github.com/advisories?query=ecosystem%3Apip
|
||||
@@ -313,3 +397,9 @@ Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
[nvd]: https://nvd.nist.gov/vuln
|
||||
|
||||
[k8s-cve]: https://kubernetes.io/docs/reference/issues-security/official-cve-feed/
|
||||
|
||||
[CVE-2023-32681]: https://nvd.nist.gov/vuln/detail/CVE-2023-32681
|
||||
[RHSA-2023:4520]: https://access.redhat.com/errata/RHSA-2023:4520
|
||||
[ghsa]: https://github.com/advisories
|
||||
[requests]: https://pypi.org/project/requests/
|
||||
[precision-recall]: https://developers.google.com/machine-learning/crash-course/classification/precision-and-recall
|
||||
@@ -1,11 +1,11 @@
|
||||
# Vulnerability Exploitability Exchange (VEX)
|
||||
# Local VEX Files
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Trivy supports filtering detected vulnerabilities using [the Vulnerability Exploitability Exchange (VEX)](https://www.ntia.gov/files/ntia/publications/vex_one-page_summary.pdf), a standardized format for sharing and exchanging information about vulnerabilities.
|
||||
By providing VEX during scanning, it is possible to filter vulnerabilities based on their status.
|
||||
Currently, Trivy supports the following three formats:
|
||||
In addition to [VEX repositories](./repo.md), Trivy also supports the use of local VEX files for vulnerability filtering.
|
||||
This method is useful when you have specific VEX documents that you want to apply to your scans.
|
||||
Currently, Trivy supports the following formats:
|
||||
|
||||
- [CycloneDX](https://cyclonedx.org/capabilities/vex/)
|
||||
- [OpenVEX](https://github.com/openvex/spec)
|
||||
35
docs/docs/supply-chain/vex/index.md
Normal file
35
docs/docs/supply-chain/vex/index.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Vulnerability Exploitability Exchange (VEX)
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Trivy supports filtering detected vulnerabilities using the [Vulnerability Exploitability eXchange (VEX)](https://www.ntia.gov/files/ntia/publications/vex_one-page_summary.pdf), a standardized format for sharing and exchanging information about vulnerabilities.
|
||||
By providing VEX during scanning, it is possible to filter vulnerabilities based on their status.
|
||||
|
||||
## VEX Usage Methods
|
||||
|
||||
Trivy currently supports two methods for utilizing VEX:
|
||||
|
||||
1. [VEX Repository](./repo.md)
|
||||
2. [Local VEX Files](./file.md)
|
||||
3. [VEX Attestation](./oci.md)
|
||||
|
||||
### Enabling VEX
|
||||
To enable VEX, use the `--vex` option.
|
||||
You can specify the method to use:
|
||||
|
||||
- To enable the VEX Repository: `--vex repo`
|
||||
- To use a local VEX file: `--vex /path/to/vex-document.json`
|
||||
- To enable VEX attestation discovery in OCI registry: `--vex oci`
|
||||
|
||||
```bash
|
||||
$ trivy image ghcr.io/aquasecurity/trivy:0.52.0 --vex repo
|
||||
```
|
||||
|
||||
You can enable these methods simultaneously.
|
||||
The order of specification determines the priority:
|
||||
|
||||
- `--vex repo --vex /path/to/vex-document.json`: VEX Repository has priority
|
||||
- `--vex /path/to/vex-document.json --vex repo`: Local file has priority
|
||||
|
||||
For detailed information on each method, please refer to each page.
|
||||
121
docs/docs/supply-chain/vex/oci.md
Normal file
121
docs/docs/supply-chain/vex/oci.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# Discover VEX Attestation in OCI Registry
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Trivy can discover VEX attestations for container images.
|
||||
This feature allows you to automatically use VEX during container image scanning.
|
||||
|
||||
## How It Works
|
||||
|
||||
Trivy can automatically discover and utilize VEX attestations for container images during scanning by using the `--vex oci` flag.
|
||||
This process enhances vulnerability detection results by incorporating the information from the VEX attestation.
|
||||
|
||||
To use this feature, follow these three steps:
|
||||
|
||||
1. Create a VEX document
|
||||
2. Generate and upload a VEX attestation to an OCI registry
|
||||
3. Use the VEX attestation with Trivy
|
||||
|
||||
Steps 1 and 2 are not necessary if you are trying to scan a third-party container image and already have VEX attestation attached.
|
||||
|
||||
Let's go through each step in detail.
|
||||
|
||||
!!! note
|
||||
In the following examples, the `cosign` command will write an attestation to a target OCI registry, so you must have permission to write.
|
||||
If you want to avoid writing an OCI registry and only want to see an attestation, add the `--no-upload` option to the cosign command.
|
||||
|
||||
### Step 1: Create a VEX Document
|
||||
|
||||
Currently, Trivy does not have a built-in feature to create VEX documents, so you need to create them manually.
|
||||
You can refer to the [OpenVEX section](./file.md#openvex) for guidance on creating VEX files.
|
||||
|
||||
For container image vulnerabilities, the product ID should be the OCI type in the [PURL][purl] format.
|
||||
For example:
|
||||
|
||||
```
|
||||
pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy
|
||||
```
|
||||
|
||||
This product ID applies the VEX statement to all tags of the `ghcr.io/aquasecurity/trivy` container image.
|
||||
If you want to declare a statement for a specific digest only, you can use:
|
||||
|
||||
```
|
||||
pkg:oci/trivy@sha256:5bd5ab35814f86783561603ebb35d5d5d99006dcdcd5c3f828ea1afb4c12d159?repository_url=ghcr.io/aquasecurity/trivy
|
||||
```
|
||||
|
||||
!!! note
|
||||
Using an image tag, like `pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy&tag=0.50.0`, is not supported in the product ID at the moment.
|
||||
|
||||
Next, specify vulnerable packages as subcomponents, such as `pkg:apk/alpine/busybox`.
|
||||
You can also include the package version and other [qualifiers][qualifiers] (e.g., `arch`) to limit statements, like `pkg:apk/alpine/busybox@1.36.1-r29?arch=x86`.
|
||||
|
||||
Lastly, include the vulnerability IDs.
|
||||
|
||||
Here's an example VEX document:
|
||||
|
||||
```json
|
||||
{
|
||||
"@context": "https://openvex.dev/ns/v0.2.0",
|
||||
"@id": "https://openvex.dev/docs/public/vex-2e67563e128250cbcb3e98930df948dd053e43271d70dc50cfa22d57e03fe96f",
|
||||
"author": "Aqua Security",
|
||||
"timestamp": "2024-07-30T19:07:16.853479631-06:00",
|
||||
"version": 1,
|
||||
"statements": [
|
||||
{
|
||||
"vulnerability": {
|
||||
"name": "CVE-2023-42363"
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:oci/trivy?repository_url=ghcr.io/aquasecurity/trivy",
|
||||
"subcomponents": [
|
||||
{"@id": "pkg:apk/alpine/busybox"},
|
||||
{"@id": "pkg:apk/alpine/busybox-binsh"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_cannot_be_controlled_by_adversary",
|
||||
"impact_statement": "awk is not used"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can also refer to [Trivy's example](https://github.com/aquasecurity/trivy/blob/4e54a7e84c33c1be80c52c6db78c634bc3911715/.vex/oci.openvex.json) for more inspiration.
|
||||
|
||||
### Step 2: Generate and Upload a VEX Attestation to an OCI Registry
|
||||
|
||||
You can use the [Cosign command](https://docs.sigstore.dev/verifying/attestation/) to generate and upload the VEX attestation.
|
||||
Cosign offers methods both with and without keys.
|
||||
For detailed instructions, please refer to the Cosign documentation.
|
||||
|
||||
To generate and attach a VEX attestation to your image, use the following command:
|
||||
|
||||
```
|
||||
$ cosign attest --predicate oci.openvex.json --type openvex <IMAGE>
|
||||
```
|
||||
|
||||
Note that this command attaches the attestation only to the specified image tag.
|
||||
If needed, repeat the process for other tags and digests.
|
||||
|
||||
### Step 3: Use VEX Attestation with Trivy
|
||||
|
||||
Once you've attached the VEX attestation to the container image, Trivy can automatically discover and use it during scanning.
|
||||
Simply add the `--vex oci` flag when scanning a container image:
|
||||
|
||||
```
|
||||
$ trivy image --vex oci <IMAGE>
|
||||
```
|
||||
|
||||
To see which vulnerabilities were filtered by the VEX attestation, use the `--show-suppressed` flag:
|
||||
|
||||
```
|
||||
$ trivy image --vex oci --show-suppressed <IMAGE>
|
||||
```
|
||||
|
||||
The `<IMAGE>` specified in these commands must be the same as the one to which you attached the VEX attestation.
|
||||
|
||||
[purl]: https://github.com/package-url/purl-spec
|
||||
[qualifiers]: https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst
|
||||
210
docs/docs/supply-chain/vex/repo.md
Normal file
210
docs/docs/supply-chain/vex/repo.md
Normal file
@@ -0,0 +1,210 @@
|
||||
# VEX Repository
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
## Using VEX Repository
|
||||
|
||||
Trivy can download and utilize VEX documents from repositories that comply with [the VEX Repository Specification][vex-repo].
|
||||
While it's planned to be enabled by default in the future, currently it can be activated by explicitly specifying `--vex repo`.
|
||||
|
||||
```
|
||||
$ trivy image ghcr.io/aquasecurity/trivy:0.52.0 --vex repo
|
||||
2024-07-20T11:22:58+04:00 INFO [vex] The default repository config has been created
|
||||
file_path="/Users/teppei/.trivy/vex/repository.yaml"
|
||||
2024-07-20T11:23:23+04:00 INFO [vex] Updating repository... repo="default" url="https://github.com/aquasecurity/vexhub"
|
||||
```
|
||||
|
||||
During scanning, Trivy generates PURLs for discovered packages and searches for matching PURLs in the VEX Repository.
|
||||
If a match is found, the corresponding VEX is utilized.
|
||||
|
||||
### Configuration File
|
||||
|
||||
#### Default Configuration
|
||||
|
||||
When `--vex repo` is specified for the first time, a default configuration file is created at `$HOME/.trivy/vex/repository.yaml`.
|
||||
The home directory can be configured through environment variable `$XDG_DATA_HOME`.
|
||||
|
||||
You can also create the configuration file in advance using the `trivy vex repo init` command and edit it.
|
||||
|
||||
The default configuration file looks like this:
|
||||
|
||||
```yaml
|
||||
repositories:
|
||||
- name: default
|
||||
url: https://github.com/aquasecurity/vexhub
|
||||
enabled: true
|
||||
username: ""
|
||||
password: ""
|
||||
token: ""
|
||||
```
|
||||
|
||||
By default, [VEX Hub][vexhub] managed by Aqua Security is used.
|
||||
VEX Hub primarily trusts VEX documents published by the package maintainers.
|
||||
|
||||
#### Show Configuration
|
||||
You can see the config file path and the configured repositories with `trivy vex repo list`:
|
||||
|
||||
```bash
|
||||
$ trivy vex repo list
|
||||
VEX Repositories (config: /home/username/.trivy/vex/repository.yaml)
|
||||
|
||||
- Name: default
|
||||
URL: https://github.com/aquasecurity/vexhub
|
||||
Status: Enabled
|
||||
```
|
||||
|
||||
#### Custom Repositories
|
||||
|
||||
If you want to trust VEX documents published by other organizations or use your own VEX repository, you can specify a custom repository that complies with [the VEX Repository Specification][vex-repo].
|
||||
You can add a custom repository as below:
|
||||
|
||||
```yaml
|
||||
- name: custom
|
||||
url: https://example.com/custom-repo
|
||||
enabled: true
|
||||
```
|
||||
|
||||
|
||||
#### Authentication
|
||||
|
||||
For private repositories:
|
||||
|
||||
- `username`/`password` can be used for Basic authentication
|
||||
- `token` can be used for Bearer authentication
|
||||
|
||||
```yaml
|
||||
- name: custom
|
||||
url: https://example.com/custom-repo
|
||||
enabled: true
|
||||
token: "my-token"
|
||||
```
|
||||
|
||||
#### Repository Priority
|
||||
|
||||
The priority of VEX repositories is determined by their order in the configuration file.
|
||||
You can add repositories with higher priority than the default or even remove the default VEX Hub.
|
||||
|
||||
```yaml
|
||||
- name: repo1
|
||||
url: https://example.com/repo1
|
||||
- name: repo2
|
||||
url: https://example.com/repo2
|
||||
```
|
||||
|
||||
In this configuration, when Trivy detects a vulnerability in a package, it generates a PURL for that package and searches for matching VEX documents in the configured repositories.
|
||||
The search process follows this order:
|
||||
|
||||
1. Trivy first looks for a VEX document matching the package's PURL in `repo1`.
|
||||
2. If no matching VEX document is found in `repo1`, Trivy then searches in `repo2`.
|
||||
3. This process continues through all configured repositories until a match is found.
|
||||
|
||||
If a matching VEX document is found in any repository (e.g., `repo1`), the search stops, and Trivy uses that VEX document.
|
||||
Subsequent repositories (e.g., `repo2`) are not checked for that specific vulnerability and package combination.
|
||||
|
||||
It's important to note that the first matching VEX document found determines the final status of the vulnerability.
|
||||
For example, if `repo1` states that a package is "Affected" by a vulnerability, this status will be used even if `repo2` states that the same package is "Not Affected" for the same vulnerability.
|
||||
The "Affected" status from the higher-priority repository (`repo1`) takes precedence, and Trivy will consider the package as affected by the vulnerability.
|
||||
|
||||
### Repository Updates
|
||||
|
||||
VEX repositories are automatically updated during scanning.
|
||||
Updates are performed based on the update frequency specified by the repository.
|
||||
|
||||
To disable auto-update, pass `--skip-vex-repo-update`.
|
||||
|
||||
```shell
|
||||
$ trivy image ghcr.io/aquasecurity/trivy:0.50.0 --vex repo --skip-vex-repo-update
|
||||
```
|
||||
|
||||
To download VEX repositories in advance without scanning, use `trivy vex repo download`.
|
||||
|
||||
The cache can be cleared with `trivy clean --vex-repo`.
|
||||
|
||||
### Displaying Filtered Vulnerabilities
|
||||
|
||||
To see which vulnerabilities were filtered and why, use the `--show-suppressed` option:
|
||||
|
||||
```shell
|
||||
$ trivy image ghcr.io/aquasecurity/trivy:0.50.0 --vex repo --show-suppressed
|
||||
...
|
||||
|
||||
Suppressed Vulnerabilities (Total: 4)
|
||||
=====================================
|
||||
┌───────────────┬────────────────┬──────────┬──────────────┬───────────────────────────────────────────────────┬──────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Status │ Statement │ Source │
|
||||
├───────────────┼────────────────┼──────────┼──────────────┼───────────────────────────────────────────────────┼──────────────────────────────────────────┤
|
||||
│ busybox │ CVE-2023-42364 │ MEDIUM │ not_affected │ vulnerable_code_cannot_be_controlled_by_adversary │ VEX Repository: default │
|
||||
│ │ │ │ │ │ (https://github.com/aquasecurity/vexhub) │
|
||||
│ ├────────────────┤ │ │ │ │
|
||||
│ │ CVE-2023-42365 │ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
├───────────────┼────────────────┤ │ │ │ │
|
||||
│ busybox-binsh │ CVE-2023-42364 │ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ ├────────────────┤ │ │ │ │
|
||||
│ │ CVE-2023-42365 │ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
└───────────────┴────────────────┴──────────┴──────────────┴───────────────────────────────────────────────────┴──────────────────────────────────────────┘
|
||||
|
||||
```
|
||||
|
||||
## Publishing VEX Documents
|
||||
|
||||
### For OSS Projects
|
||||
|
||||
As an OSS developer or maintainer, you may encounter vulnerabilities in the packages your project depends on.
|
||||
These vulnerabilities might be discovered through your own scans or reported by third parties using your OSS project.
|
||||
|
||||
While Trivy strives to minimize false positives, it doesn't perform code graph analysis, which means it can't evaluate exploitability at the code level.
|
||||
Consequently, Trivy may report vulnerabilities even in cases where:
|
||||
|
||||
1. The vulnerable function in a dependency is never called in your project.
|
||||
2. The vulnerable code cannot be controlled by an attacker in the context of your project.
|
||||
|
||||
If you're confident that a reported vulnerability in a dependency doesn't affect your OSS project or container image, you can publish a VEX document to reduce noise in Trivy scans.
|
||||
To assess exploitability, you have several options:
|
||||
|
||||
1. Manual assessment: As a maintainer, you can read the source code and determine if the vulnerability is exploitable in your project's context.
|
||||
2. Automated assessment: You can use SAST (Static Application Security Testing) tools or similar tools to analyze the code and determine exploitability.
|
||||
|
||||
By publishing VEX documents in the source repository, Trivy can automatically utilize them through VEX Hub.
|
||||
The main steps are:
|
||||
|
||||
1. Generate a VEX document
|
||||
2. Commit the VEX document to the `.vex/` directory in the source repository (e.g., [Trivy's VEX][trivy-vex])
|
||||
3. Register your project's [PURL][purl] in VEX Hub
|
||||
|
||||
Step 3 is only necessary once.
|
||||
After that, updating the VEX file in your repository will automatically be fetched by VEX Hub and utilized by Trivy.
|
||||
See the [VEX Hub repository][vexhub] for more information.
|
||||
|
||||
If you want to issue a VEX for an OSS project that you don't maintain, consider first proposing the VEX publication to the original repository.
|
||||
Many OSS maintainers are open to contributions that improve the security posture of their projects.
|
||||
However, if your proposal is not accepted, or if you want to issue a VEX with statements that differ from the maintainer's judgment, you may want to consider creating a [custom repository](#hosting-custom-repositories).
|
||||
|
||||
### For Private Projects
|
||||
|
||||
If you're working on private software or personal projects, you have several options:
|
||||
|
||||
1. [Local VEX files](./file.md): You can create local VEX files and have Trivy read them during scans. This is suitable for individual use or small teams.
|
||||
2. [.trivyignore](../../configuration/filtering.md#trivyignore): For simpler cases, using a .trivyignore file might be sufficient to suppress specific vulnerabilities.
|
||||
3. [Custom repositories](#hosting-custom-repositories): For large organizations wanting to share VEX information for internally used software across different departments, setting up a custom VEX repository might be the best approach.
|
||||
|
||||
## Hosting Custom Repositories
|
||||
|
||||
While the principle is to store VEX documents for OSS packages in the source repository, it's possible to create a custom repository if that's difficult.
|
||||
|
||||
There are various use cases for providing custom repositories:
|
||||
|
||||
- A Pull Request to add a VEX document upstream was not merged
|
||||
- Consolidating VEX documents output by SAST tools
|
||||
- Publishing vendor-specific VEX documents that differ from OSS maintainer statements
|
||||
- Creating a private VEX repository to publish common VEX for your company
|
||||
|
||||
In these cases, you can create a repository that complies with [the VEX Repository Specification][vex-repo] to make it available for use with Trivy.
|
||||
|
||||
[vex-repo]: https://github.com/aquasecurity/vex-repo-spec
|
||||
[vexhub]: https://github.com/aquasecurity/vexhub
|
||||
[trivy-vex]: https://github.com/aquasecurity/trivy/blob/b76a7250912cfc028cfef743f0f98cd81b39f8aa/.vex/trivy.openvex.json
|
||||
[purl]: https://github.com/package-url/purl-spec
|
||||
@@ -230,7 +230,7 @@ Reference: [VMware Virtual Disk Format 1.1.pdf][vmdk]
|
||||
|-------------------|:-------:|
|
||||
| XFS | ✔ |
|
||||
| EXT4 | ✔ |
|
||||
| EXT2/3 | |
|
||||
| EXT2/3 | ✔ |
|
||||
| ZFS | |
|
||||
|
||||
|
||||
|
||||
@@ -30,3 +30,9 @@ Trivy-Streamlit is a Streamlit application that allows you to quickly parse the
|
||||
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>
|
||||
|
||||
## plopsec.com (Community)
|
||||
|
||||
This project is a web application designed to help you visualize Trivy image scan reports. It enriches the data with additional exploitability metrics from EPSS, Metasploit, and Exploit-DB, updated daily.
|
||||
|
||||
👉 Get it at: <https://plopsec.com> | <https://github.com/pl0psec/plopsec.com>
|
||||
|
||||
@@ -93,7 +93,7 @@ Note that Rego
|
||||
Ensure that you have Trivy installed and run the following command:
|
||||
|
||||
```bash
|
||||
trivy fs --scanners misconf --policy ./docker-check.rego --namespaces custom ./Dockerfile
|
||||
trivy fs --scanners misconf --config-check ./docker-check.rego --namespaces custom ./Dockerfile
|
||||
```
|
||||
|
||||
Please replace:
|
||||
|
||||
@@ -86,7 +86,7 @@ trivy config --severity CRITICAL, MEDIUM terraform-infra
|
||||
You can pass terraform values to Trivy to override default values found in the Terraform HCL code. More information are provided [in the documentation.](https://aquasecurity.github.io/trivy/latest/docs/coverage/iac/terraform/#value-overrides)
|
||||
|
||||
```
|
||||
trivy conf --tf-vars terraform.tfvars ./
|
||||
trivy config --tf-vars terraform.tfvars ./
|
||||
```
|
||||
### Custom Checks
|
||||
|
||||
|
||||
211
go.mod
211
go.mod
@@ -6,8 +6,8 @@ toolchain go1.22.4
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
|
||||
github.com/BurntSushi/toml v1.4.0
|
||||
github.com/CycloneDX/cyclonedx-go v0.9.0
|
||||
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
|
||||
@@ -15,7 +15,7 @@ require (
|
||||
github.com/NYTimes/gziphandler v1.1.1
|
||||
github.com/alecthomas/chroma v0.10.0
|
||||
github.com/alicebob/miniredis/v2 v2.33.0
|
||||
github.com/antchfx/htmlquery v1.3.1
|
||||
github.com/antchfx/htmlquery v1.3.2
|
||||
github.com/apparentlymart/go-cidr v1.1.0
|
||||
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
|
||||
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
|
||||
@@ -23,35 +23,36 @@ require (
|
||||
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
|
||||
github.com/aquasecurity/go-version v0.0.0-20240603093900-cf8a8d29271d
|
||||
github.com/aquasecurity/table v1.8.0
|
||||
github.com/aquasecurity/testdocker v0.0.0-20240613070307-2c3868d658ac
|
||||
github.com/aquasecurity/testdocker v0.0.0-20240730042311-4642e94c7fc8
|
||||
github.com/aquasecurity/tml v0.6.1
|
||||
github.com/aquasecurity/trivy-checks v0.13.0
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20231005141211-4fc651f7ac8d
|
||||
github.com/aquasecurity/trivy-checks v0.13.1-0.20240830230553-53ddbbade784
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20240718084044-d23a6ca8ba04
|
||||
github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48
|
||||
github.com/aquasecurity/trivy-kubernetes v0.6.7-0.20240627095026-cf9d48837f6d
|
||||
github.com/aws/aws-sdk-go-v2 v1.27.2
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.18
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.18
|
||||
github.com/aws/aws-sdk-go-v2/service/ec2 v1.163.1
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.28.5
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.55.1
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 // indirect
|
||||
github.com/aws/smithy-go v1.20.2
|
||||
github.com/aquasecurity/trivy-kubernetes v0.6.7-0.20240707095038-0300bc49b68b
|
||||
github.com/aws/aws-sdk-go-v2 v1.30.4
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.28
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.28
|
||||
github.com/aws/aws-sdk-go-v2/service/ec2 v1.175.1
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.32.1
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.59.0
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 // indirect
|
||||
github.com/aws/smithy-go v1.20.4
|
||||
github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1
|
||||
github.com/cenkalti/backoff/v4 v4.3.0
|
||||
github.com/cheggaaa/pb/v3 v3.1.5
|
||||
github.com/containerd/containerd v1.7.17
|
||||
github.com/containerd/containerd v1.7.21
|
||||
github.com/csaf-poc/csaf_distribution/v3 v3.0.0
|
||||
github.com/docker/docker v26.1.3+incompatible
|
||||
github.com/docker/docker v27.1.1+incompatible
|
||||
github.com/docker/go-connections v0.5.0
|
||||
github.com/fatih/color v1.17.0
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/go-openapi/runtime v0.28.0
|
||||
github.com/go-openapi/strfmt v0.23.0
|
||||
github.com/go-openapi/runtime v0.28.0 // indirect
|
||||
github.com/go-openapi/strfmt v0.23.0 // indirect
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||
github.com/google/go-containerregistry v0.19.2
|
||||
github.com/google/go-containerregistry v0.20.2
|
||||
github.com/google/go-github/v62 v62.0.0
|
||||
github.com/google/licenseclassifier/v2 v2.0.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/google/wire v0.6.0
|
||||
@@ -61,8 +62,8 @@ require (
|
||||
github.com/hashicorp/go-uuid v1.0.3
|
||||
github.com/hashicorp/go-version v1.7.0
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/hashicorp/hc-install v0.7.0
|
||||
github.com/hashicorp/hcl/v2 v2.20.1
|
||||
github.com/hashicorp/hc-install v0.8.0
|
||||
github.com/hashicorp/hcl/v2 v2.21.0
|
||||
github.com/hashicorp/terraform-exec v0.21.0
|
||||
github.com/in-toto/in-toto-golang v0.9.0
|
||||
github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f
|
||||
@@ -75,60 +76,62 @@ require (
|
||||
github.com/liamg/jfather v0.0.7
|
||||
github.com/liamg/memoryfs v1.6.0
|
||||
github.com/magefile/mage v1.15.0
|
||||
github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac
|
||||
github.com/masahiro331/go-disk v0.0.0-20240625071113-56c933208fee
|
||||
github.com/masahiro331/go-ebs-file v0.0.0-20240112135404-d5fbb1d46323
|
||||
github.com/masahiro331/go-ext4-filesystem v0.0.0-20231208112839-4339555a0cd4
|
||||
github.com/masahiro331/go-ext4-filesystem v0.0.0-20240620024024-ca14e6327bbd
|
||||
github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08
|
||||
github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd
|
||||
github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70
|
||||
github.com/masahiro331/go-xfs-filesystem v0.0.0-20231205045356-1b22259a6c44
|
||||
github.com/mattn/go-shellwords v1.0.12
|
||||
github.com/microsoft/go-rustaudit v0.0.0-20220808201409-204dfee52032
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/moby/buildkit v0.13.2
|
||||
github.com/open-policy-agent/opa v0.65.0
|
||||
github.com/moby/buildkit v0.15.1
|
||||
github.com/open-policy-agent/opa v0.67.1
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/image-spec v1.1.0
|
||||
github.com/openvex/discovery v0.1.0
|
||||
github.com/openvex/go-vex v0.2.5
|
||||
github.com/owenrumney/go-sarif/v2 v2.3.1
|
||||
github.com/owenrumney/squealer v1.2.2
|
||||
github.com/owenrumney/go-sarif/v2 v2.3.3
|
||||
github.com/owenrumney/squealer v1.2.3
|
||||
github.com/package-url/packageurl-go v0.1.3
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22
|
||||
github.com/samber/lo v1.39.0
|
||||
github.com/samber/lo v1.46.0
|
||||
github.com/secure-systems-lab/go-securesystemslib v0.8.0
|
||||
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 // v0.5.3 with necessary changes. Can be upgraded to version 0.5.4 after release.
|
||||
github.com/spf13/cast v1.6.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spdx/tools-golang v0.5.5 // v0.5.3 with necessary changes. Can be upgraded to version 0.5.4 after release.
|
||||
github.com/spf13/cast v1.7.0
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/viper v1.19.0
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/testcontainers/testcontainers-go v0.31.0
|
||||
github.com/testcontainers/testcontainers-go/modules/localstack v0.31.0
|
||||
github.com/tetratelabs/wazero v1.7.2
|
||||
github.com/testcontainers/testcontainers-go v0.32.0
|
||||
github.com/testcontainers/testcontainers-go/modules/localstack v0.32.0
|
||||
github.com/tetratelabs/wazero v1.7.3
|
||||
github.com/twitchtv/twirp v8.1.3+incompatible
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/xlab/treeprint v1.2.0
|
||||
github.com/zclconf/go-cty v1.14.4
|
||||
github.com/zclconf/go-cty v1.15.0
|
||||
github.com/zclconf/go-cty-yaml v1.0.3
|
||||
go.etcd.io/bbolt v1.3.10
|
||||
golang.org/x/crypto v0.24.0
|
||||
golang.org/x/crypto v0.26.0
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
|
||||
golang.org/x/mod v0.17.0
|
||||
golang.org/x/net v0.26.0
|
||||
golang.org/x/sync v0.7.0
|
||||
golang.org/x/term v0.21.0
|
||||
golang.org/x/text v0.16.0
|
||||
golang.org/x/mod v0.20.0
|
||||
golang.org/x/net v0.28.0
|
||||
golang.org/x/sync v0.8.0
|
||||
golang.org/x/term v0.23.0
|
||||
golang.org/x/text v0.17.0
|
||||
golang.org/x/vuln v1.1.3
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
|
||||
google.golang.org/protobuf v1.34.1
|
||||
google.golang.org/protobuf v1.34.2
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
helm.sh/helm/v3 v3.15.1
|
||||
k8s.io/api v0.30.2
|
||||
helm.sh/helm/v3 v3.15.3
|
||||
k8s.io/api v0.30.3
|
||||
k8s.io/utils v0.0.0-20231127182322-b307cd553661
|
||||
modernc.org/sqlite v1.30.0
|
||||
modernc.org/sqlite v1.32.0
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -140,7 +143,7 @@ require (
|
||||
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.8.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.29 // indirect
|
||||
@@ -164,43 +167,49 @@ require (
|
||||
github.com/agnivade/levenshtein v1.1.1 // 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/antchfx/xpath v1.3.0 // indirect
|
||||
github.com/antchfx/xpath v1.3.1 // 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.54.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ebs v1.21.7 // 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/presigned-url v1.11.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
|
||||
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||
github.com/briandowns/spinner v1.23.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/chai2010/gettext-go v1.0.2 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/containerd/cgroups/v3 v3.0.2 // indirect
|
||||
github.com/containerd/containerd/api v1.7.19 // indirect
|
||||
github.com/containerd/continuity v0.4.3 // indirect
|
||||
github.com/containerd/errdefs v0.1.0 // indirect
|
||||
github.com/containerd/fifo v1.1.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/platforms v0.2.1 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
|
||||
github.com/containerd/ttrpc v1.2.4 // indirect
|
||||
github.com/containerd/ttrpc v1.2.5 // 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/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
||||
github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // 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/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
|
||||
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/dlclark/regexp2 v1.4.0 // indirect
|
||||
github.com/docker/cli v25.0.3+incompatible // indirect
|
||||
github.com/docker/cli v27.1.1+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.3+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.8.0 // indirect
|
||||
github.com/docker/docker-credential-helpers v0.8.2 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
@@ -213,6 +222,7 @@ require (
|
||||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/go-chi/chi v4.1.2+incompatible // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||
@@ -229,7 +239,6 @@ require (
|
||||
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
|
||||
@@ -237,9 +246,12 @@ require (
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/certificate-transparency-go v1.1.8 // indirect
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/s2a-go v0.1.7 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
@@ -249,25 +261,26 @@ require (
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/gosuri/uitable v0.0.4 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
|
||||
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/golang-lru v0.6.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
|
||||
github.com/hashicorp/terraform-json v0.22.1 // indirect
|
||||
github.com/huandu/xstrings v1.4.0 // indirect
|
||||
github.com/imdario/mergo v0.3.15 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
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/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.17.7 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // 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-20240226150601-1dcf7310316a // indirect
|
||||
@@ -288,7 +301,8 @@ require (
|
||||
github.com/moby/sys/mountinfo v0.7.1 // 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/sys/user v0.3.0 // indirect
|
||||
github.com/moby/sys/userns 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
|
||||
@@ -297,8 +311,9 @@ require (
|
||||
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/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.1.0 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.2.0 // indirect
|
||||
github.com/opencontainers/selinux v1.11.0 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
@@ -308,33 +323,44 @@ require (
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||
github.com/prometheus/client_golang v1.19.1 // indirect
|
||||
github.com/prometheus/client_golang v1.20.1 // 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/prometheus/common v0.55.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // 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/rivo/uniseg v0.4.4 // 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/sassoftware/relic v7.2.1+incompatible // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/shibumi/go-pathspec v1.3.0 // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.24.2 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/sigstore/cosign/v2 v2.2.4 // indirect
|
||||
github.com/sigstore/sigstore v1.8.3 // indirect
|
||||
github.com/sigstore/timestamp-authority v1.2.2 // indirect
|
||||
github.com/skeema/knownhosts v1.2.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/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
||||
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
|
||||
github.com/theupdateframework/go-tuf v0.7.0 // indirect
|
||||
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.13 // indirect
|
||||
github.com/tklauser/numcpus v0.7.0 // indirect
|
||||
github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect
|
||||
github.com/transparency-dev/merkle v0.0.2 // indirect
|
||||
github.com/ulikunitz/xz v0.5.11 // indirect
|
||||
github.com/vbatts/tar-split v0.11.5 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
@@ -344,31 +370,32 @@ require (
|
||||
go.mongodb.org/mongo-driver v1.14.0 // indirect
|
||||
go.opencensus.io v0.24.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.52.0 // indirect
|
||||
go.opentelemetry.io/otel v1.27.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.27.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.27.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.27.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/oauth2 v0.20.0 // indirect
|
||||
golang.org/x/sys v0.21.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
golang.org/x/oauth2 v0.21.0 // indirect
|
||||
golang.org/x/sys v0.23.0 // indirect
|
||||
golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect
|
||||
golang.org/x/time v0.6.0 // indirect
|
||||
golang.org/x/tools v0.23.0 // indirect
|
||||
google.golang.org/api v0.172.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
|
||||
google.golang.org/grpc v1.64.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
|
||||
google.golang.org/grpc v1.65.0 // indirect
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
|
||||
gopkg.in/go-jose/go-jose.v2 v2.6.3 // 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
|
||||
k8s.io/apiextensions-apiserver v0.30.0 // indirect
|
||||
k8s.io/apimachinery v0.30.2 // indirect
|
||||
k8s.io/apimachinery v0.30.3 // indirect
|
||||
k8s.io/apiserver v0.30.0 // indirect
|
||||
k8s.io/cli-runtime v0.30.2 // indirect
|
||||
k8s.io/client-go v0.30.2 // indirect
|
||||
@@ -377,7 +404,7 @@ require (
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
|
||||
k8s.io/kubectl v0.30.1 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
|
||||
modernc.org/libc v1.50.9 // indirect
|
||||
modernc.org/libc v1.55.3 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
@@ -389,3 +416,9 @@ require (
|
||||
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
)
|
||||
|
||||
// cf. https://github.com/openvex/discovery/pull/40
|
||||
replace github.com/openvex/discovery => github.com/knqyf263/discovery v0.1.1-0.20240726113521-97873005fd03
|
||||
|
||||
// see https://github.com/open-policy-agent/opa/pull/6970
|
||||
replace github.com/open-policy-agent/opa => github.com/nikpivkin/opa v0.0.0-20240829080621-16999fcb5464
|
||||
|
||||
@@ -17,7 +17,9 @@ spec:
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: data
|
||||
spec:
|
||||
resources:
|
||||
|
||||
@@ -32,6 +32,7 @@ type csArgs struct {
|
||||
Input string
|
||||
ClientToken string
|
||||
ClientTokenHeader string
|
||||
PathPrefix string
|
||||
ListAllPackages bool
|
||||
Target string
|
||||
secretConfig string
|
||||
@@ -212,6 +213,13 @@ func TestClientServer(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/opensuse-leap-151.json.golden",
|
||||
},
|
||||
{
|
||||
name: "opensuse tumbleweed",
|
||||
args: csArgs{
|
||||
Input: "testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
|
||||
},
|
||||
golden: "testdata/opensuse-tumbleweed.json.golden",
|
||||
},
|
||||
{
|
||||
name: "photon 3.0",
|
||||
args: csArgs{
|
||||
@@ -280,7 +288,7 @@ func TestClientServer(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir)
|
||||
|
||||
if tt.args.secretConfig != "" {
|
||||
osArgs = append(osArgs, "--secret-config", tt.args.secretConfig)
|
||||
@@ -400,7 +408,7 @@ func TestClientServerWithFormat(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Setenv("AWS_REGION", "test-region")
|
||||
t.Setenv("AWS_ACCOUNT_ID", "123456789012")
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir)
|
||||
|
||||
runTest(t, osArgs, tt.golden, "", tt.args.Format, runOptions{
|
||||
override: overrideUID,
|
||||
@@ -428,7 +436,7 @@ func TestClientServerWithCycloneDX(t *testing.T) {
|
||||
addr, cacheDir := setup(t, setupOptions{})
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir)
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatCycloneDX, runOptions{
|
||||
fakeUUID: "3ff14136-e09f-4df9-80ea-%012d",
|
||||
})
|
||||
@@ -436,7 +444,11 @@ func TestClientServerWithCycloneDX(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientServerWithToken(t *testing.T) {
|
||||
func TestClientServerWithCustomOptions(t *testing.T) {
|
||||
token := "token"
|
||||
tokenHeader := "Trivy-Token"
|
||||
pathPrefix := "prefix"
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
args csArgs
|
||||
@@ -444,11 +456,12 @@ func TestClientServerWithToken(t *testing.T) {
|
||||
wantErr string
|
||||
}{
|
||||
{
|
||||
name: "alpine 3.9 with token",
|
||||
name: "alpine 3.9 with token and prefix",
|
||||
args: csArgs{
|
||||
Input: "testdata/fixtures/images/alpine-39.tar.gz",
|
||||
ClientToken: "token",
|
||||
ClientTokenHeader: "Trivy-Token",
|
||||
ClientToken: token,
|
||||
ClientTokenHeader: tokenHeader,
|
||||
PathPrefix: pathPrefix,
|
||||
},
|
||||
golden: "testdata/alpine-39.json.golden",
|
||||
},
|
||||
@@ -457,7 +470,8 @@ func TestClientServerWithToken(t *testing.T) {
|
||||
args: csArgs{
|
||||
Input: "testdata/fixtures/images/distroless-base.tar.gz",
|
||||
ClientToken: "invalidtoken",
|
||||
ClientTokenHeader: "Trivy-Token",
|
||||
ClientTokenHeader: tokenHeader,
|
||||
PathPrefix: pathPrefix,
|
||||
},
|
||||
wantErr: "twirp error unauthenticated: invalid token",
|
||||
},
|
||||
@@ -465,23 +479,33 @@ func TestClientServerWithToken(t *testing.T) {
|
||||
name: "invalid token header",
|
||||
args: csArgs{
|
||||
Input: "testdata/fixtures/images/distroless-base.tar.gz",
|
||||
ClientToken: "token",
|
||||
ClientToken: token,
|
||||
ClientTokenHeader: "Unknown-Header",
|
||||
PathPrefix: pathPrefix,
|
||||
},
|
||||
wantErr: "twirp error unauthenticated: invalid token",
|
||||
},
|
||||
{
|
||||
name: "wrong path prefix",
|
||||
args: csArgs{
|
||||
Input: "testdata/fixtures/images/distroless-base.tar.gz",
|
||||
ClientToken: token,
|
||||
ClientTokenHeader: tokenHeader,
|
||||
PathPrefix: "wrong",
|
||||
},
|
||||
wantErr: "HTTP status code 404",
|
||||
},
|
||||
}
|
||||
|
||||
serverToken := "token"
|
||||
serverTokenHeader := "Trivy-Token"
|
||||
addr, cacheDir := setup(t, setupOptions{
|
||||
token: serverToken,
|
||||
tokenHeader: serverTokenHeader,
|
||||
token: token,
|
||||
tokenHeader: tokenHeader,
|
||||
pathPrefix: pathPrefix,
|
||||
})
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir, tt.golden)
|
||||
osArgs := setupClient(t, tt.args, addr, cacheDir)
|
||||
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{
|
||||
override: overrideUID,
|
||||
wantErr: tt.wantErr,
|
||||
@@ -508,7 +532,7 @@ func TestClientServerWithRedis(t *testing.T) {
|
||||
golden := "testdata/alpine-39.json.golden"
|
||||
|
||||
t.Run("alpine 3.9", func(t *testing.T) {
|
||||
osArgs := setupClient(t, testArgs, addr, cacheDir, golden)
|
||||
osArgs := setupClient(t, testArgs, addr, cacheDir)
|
||||
|
||||
// Run Trivy client
|
||||
runTest(t, osArgs, golden, "", types.FormatJSON, runOptions{
|
||||
@@ -520,7 +544,7 @@ func TestClientServerWithRedis(t *testing.T) {
|
||||
require.NoError(t, redisC.Terminate(ctx))
|
||||
|
||||
t.Run("sad path", func(t *testing.T) {
|
||||
osArgs := setupClient(t, testArgs, addr, cacheDir, golden)
|
||||
osArgs := setupClient(t, testArgs, addr, cacheDir)
|
||||
|
||||
// Run Trivy client
|
||||
runTest(t, osArgs, "", "", types.FormatJSON, runOptions{
|
||||
@@ -532,6 +556,7 @@ func TestClientServerWithRedis(t *testing.T) {
|
||||
type setupOptions struct {
|
||||
token string
|
||||
tokenHeader string
|
||||
pathPrefix string
|
||||
cacheBackend string
|
||||
}
|
||||
|
||||
@@ -549,7 +574,7 @@ func setup(t *testing.T, options setupOptions) (string, string) {
|
||||
addr := fmt.Sprintf("localhost:%d", port)
|
||||
|
||||
go func() {
|
||||
osArgs := setupServer(addr, options.token, options.tokenHeader, cacheDir, options.cacheBackend)
|
||||
osArgs := setupServer(addr, options.token, options.tokenHeader, options.pathPrefix, cacheDir, options.cacheBackend)
|
||||
|
||||
// Run Trivy server
|
||||
require.NoError(t, execute(osArgs))
|
||||
@@ -562,22 +587,20 @@ func setup(t *testing.T, options setupOptions) (string, string) {
|
||||
return addr, cacheDir
|
||||
}
|
||||
|
||||
func setupServer(addr, token, tokenHeader, cacheDir, cacheBackend string) []string {
|
||||
func setupServer(addr, token, tokenHeader, pathPrefix, cacheDir, cacheBackend string) []string {
|
||||
osArgs := []string{
|
||||
"--cache-dir",
|
||||
cacheDir,
|
||||
"server",
|
||||
"--skip-update",
|
||||
"--skip-db-update",
|
||||
"--listen",
|
||||
addr,
|
||||
}
|
||||
if token != "" {
|
||||
osArgs = append(osArgs, []string{
|
||||
"--token",
|
||||
token,
|
||||
"--token-header",
|
||||
tokenHeader,
|
||||
}...)
|
||||
osArgs = append(osArgs, "--token", token, "--token-header", tokenHeader)
|
||||
}
|
||||
if pathPrefix != "" {
|
||||
osArgs = append(osArgs, "--path-prefix", pathPrefix)
|
||||
}
|
||||
if cacheBackend != "" {
|
||||
osArgs = append(osArgs, "--cache-backend", cacheBackend)
|
||||
@@ -585,14 +608,14 @@ func setupServer(addr, token, tokenHeader, cacheDir, cacheBackend string) []stri
|
||||
return osArgs
|
||||
}
|
||||
|
||||
func setupClient(t *testing.T, c csArgs, addr string, cacheDir string, golden string) []string {
|
||||
func setupClient(t *testing.T, c csArgs, addr string, cacheDir string) []string {
|
||||
t.Helper()
|
||||
if c.Command == "" {
|
||||
c.Command = "image"
|
||||
}
|
||||
if c.RemoteAddrOption == "" {
|
||||
c.RemoteAddrOption = "--server"
|
||||
}
|
||||
t.Helper()
|
||||
osArgs := []string{
|
||||
"--cache-dir",
|
||||
cacheDir,
|
||||
@@ -632,6 +655,9 @@ func setupClient(t *testing.T, c csArgs, addr string, cacheDir string, golden st
|
||||
if c.ClientToken != "" {
|
||||
osArgs = append(osArgs, "--token", c.ClientToken, "--token-header", c.ClientTokenHeader)
|
||||
}
|
||||
if c.PathPrefix != "" {
|
||||
osArgs = append(osArgs, "--path-prefix", c.PathPrefix)
|
||||
}
|
||||
if c.Input != "" {
|
||||
osArgs = append(osArgs, "--input", c.Input)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
|
||||
api "github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -192,6 +192,12 @@ func TestDockerEngine(t *testing.T) {
|
||||
input: "testdata/fixtures/images/opensuse-leap-151.tar.gz",
|
||||
golden: "testdata/opensuse-leap-151.json.golden",
|
||||
},
|
||||
{
|
||||
name: "opensuse tumbleweed",
|
||||
imageTag: "ghcr.io/aquasecurity/trivy-test-images:opensuse-tumbleweed",
|
||||
input: "testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
|
||||
golden: "testdata/opensuse-tumbleweed.json.golden",
|
||||
},
|
||||
{
|
||||
name: "photon 3.0",
|
||||
imageTag: "ghcr.io/aquasecurity/trivy-test-images:photon-30",
|
||||
@@ -237,7 +243,7 @@ func TestDockerEngine(t *testing.T) {
|
||||
require.NoError(t, err, tt.name)
|
||||
|
||||
// ensure image doesnt already exists
|
||||
_, _ = cli.ImageRemove(ctx, tt.input, api.ImageRemoveOptions{
|
||||
_, _ = cli.ImageRemove(ctx, tt.input, image.RemoveOptions{
|
||||
Force: true,
|
||||
PruneChildren: true,
|
||||
})
|
||||
@@ -256,11 +262,11 @@ func TestDockerEngine(t *testing.T) {
|
||||
|
||||
// cleanup
|
||||
t.Cleanup(func() {
|
||||
_, _ = cli.ImageRemove(ctx, tt.input, api.ImageRemoveOptions{
|
||||
_, _ = cli.ImageRemove(ctx, tt.input, image.RemoveOptions{
|
||||
Force: true,
|
||||
PruneChildren: true,
|
||||
})
|
||||
_, _ = cli.ImageRemove(ctx, tt.imageTag, api.ImageRemoveOptions{
|
||||
_, _ = cli.ImageRemove(ctx, tt.imageTag, image.RemoveOptions{
|
||||
Force: true,
|
||||
PruneChildren: true,
|
||||
})
|
||||
|
||||
@@ -26,14 +26,15 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/xeipuuv/gojsonschema"
|
||||
|
||||
"github.com/aquasecurity/trivy-db/pkg/db"
|
||||
"github.com/aquasecurity/trivy-db/pkg/metadata"
|
||||
|
||||
"github.com/aquasecurity/trivy/internal/dbtest"
|
||||
"github.com/aquasecurity/trivy/internal/testutil"
|
||||
"github.com/aquasecurity/trivy/pkg/clock"
|
||||
"github.com/aquasecurity/trivy/pkg/commands"
|
||||
"github.com/aquasecurity/trivy/pkg/db"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
"github.com/aquasecurity/trivy/pkg/uuid"
|
||||
"github.com/aquasecurity/trivy/pkg/vex/repo"
|
||||
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
@@ -56,15 +57,9 @@ func initDB(t *testing.T) string {
|
||||
}
|
||||
|
||||
cacheDir := dbtest.InitDB(t, fixtures)
|
||||
defer db.Close()
|
||||
defer dbtest.Close()
|
||||
|
||||
dbDir := filepath.Dir(db.Path(cacheDir))
|
||||
|
||||
metadataFile := filepath.Join(dbDir, "metadata.json")
|
||||
f, err := os.Create(metadataFile)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = json.NewEncoder(f).Encode(metadata.Metadata{
|
||||
err = metadata.NewClient(db.Dir(cacheDir)).Update(metadata.Metadata{
|
||||
Version: db.SchemaVersion,
|
||||
NextUpdate: time.Now().Add(24 * time.Hour),
|
||||
UpdatedAt: time.Now(),
|
||||
@@ -75,6 +70,43 @@ func initDB(t *testing.T) string {
|
||||
return cacheDir
|
||||
}
|
||||
|
||||
func initVEXRepository(t *testing.T, homeDir, cacheDir string) {
|
||||
t.Helper()
|
||||
|
||||
// Copy config directory
|
||||
configSrc := "testdata/fixtures/vex/config/repository.yaml"
|
||||
configDst := filepath.Join(homeDir, ".trivy", "vex", "repository.yaml")
|
||||
testutil.CopyFile(t, configSrc, configDst)
|
||||
|
||||
// Copy repository directory
|
||||
repoSrc := "testdata/fixtures/vex/repositories"
|
||||
repoDst := filepath.Join(cacheDir, "vex", "repositories")
|
||||
testutil.CopyDir(t, repoSrc, repoDst)
|
||||
|
||||
// Copy VEX file
|
||||
vexSrc := "testdata/fixtures/vex/file/openvex.json"
|
||||
repoDir := filepath.Join(repoDst, "default")
|
||||
vexDst := filepath.Join(repoDir, "0.1", "openvex.json")
|
||||
testutil.CopyFile(t, vexSrc, vexDst)
|
||||
|
||||
// Write a dummy cache metadata
|
||||
testutil.MustWriteJSON(t, filepath.Join(repoDir, "cache.json"), repo.CacheMetadata{
|
||||
UpdatedAt: time.Now(),
|
||||
})
|
||||
|
||||
// Verify that necessary files exist
|
||||
requiredFiles := []string{
|
||||
configDst,
|
||||
filepath.Join(repoDir, "vex-repository.json"),
|
||||
filepath.Join(repoDir, "0.1", "index.json"),
|
||||
filepath.Join(repoDir, "0.1", "openvex.json"),
|
||||
}
|
||||
|
||||
for _, file := range requiredFiles {
|
||||
require.FileExists(t, file)
|
||||
}
|
||||
}
|
||||
|
||||
func getFreePort() (int, error) {
|
||||
addr, err := net.ResolveTCPAddr("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
|
||||
111
integration/plugin_test.go
Normal file
111
integration/plugin_test.go
Normal file
@@ -0,0 +1,111 @@
|
||||
//go:build integration
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/utils/fsutils"
|
||||
)
|
||||
|
||||
func TestPlugin(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
plugin string
|
||||
pluginArgs string
|
||||
golden string
|
||||
}{
|
||||
{
|
||||
name: "count plugin installed from `index`",
|
||||
plugin: "count@v0.2.0",
|
||||
golden: "testdata/count-0.2.0-plugin.txt.golden",
|
||||
},
|
||||
{
|
||||
name: "count plugin installed from github archive",
|
||||
plugin: "https://github.com/aquasecurity/trivy-plugin-count/archive/refs/tags/v0.1.0.zip",
|
||||
pluginArgs: "--published-before=2020-01-01",
|
||||
golden: "testdata/count-0.1.0-plugin-with-before-flag.txt.golden",
|
||||
},
|
||||
}
|
||||
|
||||
// Set up testing DB
|
||||
cacheDir := initDB(t)
|
||||
tempStdOut := setTempStdout(t)
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// We can overwrite stdout for `_default_Manager` only once.
|
||||
// So we need to clear the temporary stdout file before each test case.
|
||||
clearFile(t, tempStdOut)
|
||||
|
||||
t.Setenv("XDG_DATA_HOME", t.TempDir())
|
||||
|
||||
// Install plugin
|
||||
err := execute([]string{
|
||||
"plugin",
|
||||
"install",
|
||||
tt.plugin,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// Get list of plugins
|
||||
err = execute([]string{
|
||||
"plugin",
|
||||
"list",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// Run Trivy with plugin as output
|
||||
args := []string{
|
||||
"--cache-dir",
|
||||
cacheDir,
|
||||
"fs",
|
||||
"-f",
|
||||
"json",
|
||||
"-o",
|
||||
"plugin=count",
|
||||
"testdata/fixtures/repo/pip",
|
||||
}
|
||||
|
||||
if tt.pluginArgs != "" {
|
||||
args = append(args, "--output-plugin-arg", tt.pluginArgs)
|
||||
}
|
||||
|
||||
err = execute(args)
|
||||
|
||||
if *update {
|
||||
fsutils.CopyFile(tempStdOut.Name(), tt.golden)
|
||||
}
|
||||
|
||||
compareRawFiles(t, tt.golden, tempStdOut.Name())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func setTempStdout(t *testing.T) *os.File {
|
||||
tmpFile := filepath.Join(t.TempDir(), "output.txt")
|
||||
f, err := os.Create(tmpFile)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Overwrite Stdout to get output of plugin
|
||||
defaultStdout := os.Stdout
|
||||
os.Stdout = f
|
||||
t.Cleanup(func() {
|
||||
os.Stdout = defaultStdout
|
||||
f.Close()
|
||||
})
|
||||
return f
|
||||
}
|
||||
|
||||
func clearFile(t *testing.T, file *os.File) {
|
||||
_, err := file.Seek(0, io.SeekStart)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = file.Write([]byte{})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
@@ -8,9 +8,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/fanal/artifact"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestRepository tests `trivy repo` with the local code repositories
|
||||
@@ -32,6 +33,7 @@ func TestRepository(t *testing.T) {
|
||||
format types.Format
|
||||
includeDevDeps bool
|
||||
parallel int
|
||||
vex string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -74,6 +76,24 @@ func TestRepository(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/gomod.json.golden",
|
||||
},
|
||||
{
|
||||
name: "gomod with local VEX file",
|
||||
args: args{
|
||||
scanner: types.VulnerabilityScanner,
|
||||
input: "testdata/fixtures/repo/gomod",
|
||||
vex: "testdata/fixtures/vex/file/openvex.json",
|
||||
},
|
||||
golden: "testdata/gomod-vex.json.golden",
|
||||
},
|
||||
{
|
||||
name: "gomod with VEX repository",
|
||||
args: args{
|
||||
scanner: types.VulnerabilityScanner,
|
||||
input: "testdata/fixtures/repo/gomod",
|
||||
vex: "repo",
|
||||
},
|
||||
golden: "testdata/gomod-vex.json.golden",
|
||||
},
|
||||
{
|
||||
name: "npm",
|
||||
args: args{
|
||||
@@ -105,8 +125,9 @@ func TestRepository(t *testing.T) {
|
||||
{
|
||||
name: "pnpm",
|
||||
args: args{
|
||||
scanner: types.VulnerabilityScanner,
|
||||
input: "testdata/fixtures/repo/pnpm",
|
||||
scanner: types.VulnerabilityScanner,
|
||||
input: "testdata/fixtures/repo/pnpm",
|
||||
listAllPkgs: true,
|
||||
},
|
||||
golden: "testdata/pnpm.json.golden",
|
||||
},
|
||||
@@ -436,9 +457,15 @@ func TestRepository(t *testing.T) {
|
||||
// Set up testing DB
|
||||
cacheDir := initDB(t)
|
||||
|
||||
// Set a temp dir so that modules will not be loaded
|
||||
// Set up VEX
|
||||
initVEXRepository(t, cacheDir, cacheDir)
|
||||
|
||||
// Set a temp dir so that the VEX config will be loaded and modules will not be loaded
|
||||
t.Setenv("XDG_DATA_HOME", cacheDir)
|
||||
|
||||
// Disable Go license detection
|
||||
t.Setenv("GOPATH", cacheDir)
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
command := "repo"
|
||||
@@ -531,6 +558,10 @@ func TestRepository(t *testing.T) {
|
||||
osArgs = append(osArgs, "--secret-config", tt.args.secretConfig)
|
||||
}
|
||||
|
||||
if tt.args.vex != "" {
|
||||
osArgs = append(osArgs, "--vex", tt.args.vex)
|
||||
}
|
||||
|
||||
runTest(t, osArgs, tt.golden, "", format, runOptions{
|
||||
fakeUUID: "3ff14136-e09f-4df9-80ea-%012d",
|
||||
override: tt.override,
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -15,13 +16,14 @@ import (
|
||||
|
||||
func TestTar(t *testing.T) {
|
||||
type args struct {
|
||||
IgnoreUnfixed bool
|
||||
Severity []string
|
||||
IgnoreIDs []string
|
||||
Format types.Format
|
||||
Input string
|
||||
SkipDirs []string
|
||||
SkipFiles []string
|
||||
IgnoreUnfixed bool
|
||||
Severity []string
|
||||
IgnoreIDs []string
|
||||
Format types.Format
|
||||
Input string
|
||||
SkipDirs []string
|
||||
SkipFiles []string
|
||||
DetectionPriority ftypes.DetectionPriority
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -240,7 +242,7 @@ func TestTar(t *testing.T) {
|
||||
golden: "testdata/centos-7.json.golden",
|
||||
},
|
||||
{
|
||||
name: "centos 7with --ignore-unfixed option",
|
||||
name: "centos 7 with --ignore-unfixed option",
|
||||
args: args{
|
||||
IgnoreUnfixed: true,
|
||||
Format: types.FormatJSON,
|
||||
@@ -274,6 +276,15 @@ func TestTar(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/ubi-7.json.golden",
|
||||
},
|
||||
{
|
||||
name: "ubi 7 with comprehensive priority",
|
||||
args: args{
|
||||
Format: types.FormatJSON,
|
||||
Input: "testdata/fixtures/images/ubi-7.tar.gz",
|
||||
DetectionPriority: ftypes.PriorityComprehensive,
|
||||
},
|
||||
golden: "testdata/ubi-7-comprehensive.json.golden",
|
||||
},
|
||||
{
|
||||
name: "almalinux 8",
|
||||
args: args{
|
||||
@@ -322,6 +333,14 @@ func TestTar(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/opensuse-leap-151.json.golden",
|
||||
},
|
||||
{
|
||||
name: "opensuse tumbleweed",
|
||||
args: args{
|
||||
Format: types.FormatJSON,
|
||||
Input: "testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
|
||||
},
|
||||
golden: "testdata/opensuse-tumbleweed.json.golden",
|
||||
},
|
||||
{
|
||||
name: "photon 3.0",
|
||||
args: args{
|
||||
@@ -372,7 +391,7 @@ func TestTar(t *testing.T) {
|
||||
"-q",
|
||||
"--format",
|
||||
string(tt.args.Format),
|
||||
"--skip-update",
|
||||
"--skip-db-update",
|
||||
}
|
||||
|
||||
if tt.args.IgnoreUnfixed {
|
||||
@@ -403,6 +422,10 @@ func TestTar(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
if tt.args.DetectionPriority != "" {
|
||||
osArgs = append(osArgs, "--detection-priority", string(tt.args.DetectionPriority))
|
||||
}
|
||||
|
||||
// Run Trivy
|
||||
runTest(t, osArgs, tt.golden, "", tt.args.Format, runOptions{})
|
||||
})
|
||||
|
||||
2
integration/testdata/alpine-310.sarif.golden
vendored
2
integration/testdata/alpine-310.sarif.golden
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
|
||||
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",
|
||||
"runs": [
|
||||
{
|
||||
"tool": {
|
||||
|
||||
31
integration/testdata/conan.json.golden
vendored
31
integration/testdata/conan.json.golden
vendored
@@ -171,7 +171,36 @@
|
||||
"FixedVersion": "8.45",
|
||||
"Status": "fixed",
|
||||
"Layer": {},
|
||||
"Severity": "UNKNOWN"
|
||||
"SeveritySource": "nvd",
|
||||
"PrimaryURL": "https://avd.aquasec.com/nvd/cve-2020-14155",
|
||||
"Title": "pcre: Integer overflow when parsing callout numeric arguments",
|
||||
"Description": "libpcre in PCRE before 8.44 allows an integer overflow via a large number after a (?C substring.",
|
||||
"Severity": "MEDIUM",
|
||||
"CweIDs": [
|
||||
"CWE-190"
|
||||
],
|
||||
"VendorSeverity": {
|
||||
"alma": 1,
|
||||
"nvd": 2
|
||||
},
|
||||
"CVSS": {
|
||||
"nvd": {
|
||||
"V2Vector": "AV:N/AC:L/Au:N/C:N/I:N/A:P",
|
||||
"V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
|
||||
"V2Score": 5,
|
||||
"V3Score": 5.3
|
||||
},
|
||||
"redhat": {
|
||||
"V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
|
||||
"V3Score": 5.3
|
||||
}
|
||||
},
|
||||
"References": [
|
||||
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14155",
|
||||
"https://nvd.nist.gov/vuln/detail/CVE-2020-14155"
|
||||
],
|
||||
"PublishedDate": "2020-06-15T17:15:00Z",
|
||||
"LastModifiedDate": "2022-04-28T15:06:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
5
integration/testdata/count-0.1.0-plugin-with-before-flag.txt.golden
vendored
Normal file
5
integration/testdata/count-0.1.0-plugin-with-before-flag.txt.golden
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Installed Plugins:
|
||||
Name: count
|
||||
Version: 0.1.0
|
||||
|
||||
Number of vulnerabilities: 1
|
||||
5
integration/testdata/count-0.2.0-plugin.txt.golden
vendored
Normal file
5
integration/testdata/count-0.2.0-plugin.txt.golden
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Installed Plugins:
|
||||
Name: count
|
||||
Version: 0.2.0
|
||||
|
||||
Number of vulnerabilities: 2
|
||||
6
integration/testdata/dotnet.json.golden
vendored
6
integration/testdata/dotnet.json.golden
vendored
@@ -22,10 +22,11 @@
|
||||
"Type": "dotnet-core",
|
||||
"Packages": [
|
||||
{
|
||||
"ID": "Newtonsoft.Json/9.0.1",
|
||||
"Name": "Newtonsoft.Json",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:nuget/Newtonsoft.Json@9.0.1",
|
||||
"UID": "19955f480b8a6340"
|
||||
"UID": "e678401f5d07418a"
|
||||
},
|
||||
"Version": "9.0.1",
|
||||
"Layer": {},
|
||||
@@ -40,10 +41,11 @@
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "GHSA-5crp-9r3c-p9vr",
|
||||
"PkgID": "Newtonsoft.Json/9.0.1",
|
||||
"PkgName": "Newtonsoft.Json",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:nuget/Newtonsoft.Json@9.0.1",
|
||||
"UID": "19955f480b8a6340"
|
||||
"UID": "e678401f5d07418a"
|
||||
},
|
||||
"InstalledVersion": "9.0.1",
|
||||
"FixedVersion": "13.0.1",
|
||||
|
||||
@@ -9,4 +9,11 @@
|
||||
pairs:
|
||||
- key: "openSUSE-SU-2020:0062-1"
|
||||
value:
|
||||
FixedVersion: 1.1.0i-lp151.8.6.1
|
||||
FixedVersion: 1.1.0i-lp151.8.6.1
|
||||
- bucket: "openSUSE Tumbleweed"
|
||||
pairs:
|
||||
- bucket: libopenssl3
|
||||
pairs:
|
||||
- key: "openSUSE-SU-2024:13065-1"
|
||||
value:
|
||||
FixedVersion: 3.1.5-9.1 # changed for test
|
||||
|
||||
8
integration/testdata/fixtures/db/python.yaml
vendored
8
integration/testdata/fixtures/db/python.yaml
vendored
@@ -14,3 +14,11 @@
|
||||
- 0.11.6
|
||||
VulnerableVersions:
|
||||
- < 0.11.6
|
||||
- bucket: setuptools
|
||||
pairs:
|
||||
- key: CVE-2022-40897
|
||||
value:
|
||||
PatchedVersions:
|
||||
- 65.5.1
|
||||
VulnerableVersions:
|
||||
- < 65.5.1
|
||||
@@ -1340,6 +1340,15 @@
|
||||
- https://nvd.nist.gov/vuln/detail/CVE-2022-24775
|
||||
PublishedDate: "2022-03-25T19:26:33Z"
|
||||
LastModifiedDate: "2022-06-14T20:02:29Z"
|
||||
- key: openSUSE-SU-2024:13065-1
|
||||
value:
|
||||
Title: "libopenssl-3-devel-3.1.1-3.1 on GA media"
|
||||
Description: "These are all security issues fixed in the libopenssl-3-devel-3.1.1-3.1 package on the GA media of openSUSE Tumbleweed."
|
||||
Severity: MEDIUM
|
||||
References:
|
||||
- "https://www.suse.com/security/cve/CVE-2023-2975/"
|
||||
- "https://www.suse.com/security/cve/CVE-2023-3446/"
|
||||
- "https://www.suse.com/support/security/rating/"
|
||||
- key: CVE-2022-22965
|
||||
value:
|
||||
Title: "spring-framework: RCE via Data Binding on JDK 9+"
|
||||
@@ -1364,7 +1373,7 @@
|
||||
V3Vector: "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
|
||||
V3Score: 8.1
|
||||
References:
|
||||
- "https://github.com/advisories/GHSA-36p3-wjmg-h94x",
|
||||
- "https://github.com/advisories/GHSA-36p3-wjmg-h94x"
|
||||
PublishedDate: "2022-04-01T23:15:00Z"
|
||||
LastModifiedDate: "2022-05-19T14:21:00Z"
|
||||
- key: CVE-2020-14155
|
||||
@@ -1387,7 +1396,26 @@
|
||||
V3Vector: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
|
||||
V3Score: 5.3
|
||||
References:
|
||||
- "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14155",
|
||||
- "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14155"
|
||||
- "https://nvd.nist.gov/vuln/detail/CVE-2020-14155"
|
||||
PublishedDate: "2020-06-15T17:15:00Z"
|
||||
LastModifiedDate: "2022-04-28T15:06:00Z"
|
||||
- key: CVE-2022-40897
|
||||
value:
|
||||
Title: "pypa-setuptools: Regular Expression Denial of Service (ReDoS) in package_index.py"
|
||||
Description: "Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py."
|
||||
Severity: MEDIUM
|
||||
CweIDs:
|
||||
- CWE-1333
|
||||
VendorSeverity:
|
||||
ghsa: 3
|
||||
nvd: 2
|
||||
CVSS:
|
||||
nvd:
|
||||
V3Vector: "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
|
||||
V3Score: 5.9
|
||||
References:
|
||||
- "https://access.redhat.com/errata/RHSA-2023:0952"
|
||||
- "https://access.redhat.com/security/cve/CVE-2022-40897"
|
||||
PublishedDate: "2022-12-23T00:15:13.987Z"
|
||||
LastModifiedDate: "2024-06-21T19:15:23.877Z"
|
||||
|
||||
108
integration/testdata/fixtures/repo/pnpm/node_modules/.pnpm/jquery@3.3.9/node_modules/jquery/package.json
generated
vendored
Normal file
108
integration/testdata/fixtures/repo/pnpm/node_modules/.pnpm/jquery@3.3.9/node_modules/jquery/package.json
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"name": "jquery",
|
||||
"title": "jQuery",
|
||||
"description": "JavaScript library for DOM operations",
|
||||
"version": "3.3.9",
|
||||
"main": "dist/jquery.js",
|
||||
"homepage": "https://jquery.com",
|
||||
"author": {
|
||||
"name": "JS Foundation and other contributors",
|
||||
"url": "https://github.com/jquery/jquery/blob/3.3.1/AUTHORS.txt"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jquery/jquery.git"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery",
|
||||
"javascript",
|
||||
"browser",
|
||||
"library"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/jquery/jquery/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"babel-core": "7.0.0-beta.0",
|
||||
"babel-plugin-transform-es2015-for-of": "7.0.0-beta.0",
|
||||
"commitplease": "2.7.10",
|
||||
"core-js": "2.4.1",
|
||||
"eslint-config-jquery": "1.0.1",
|
||||
"grunt": "1.0.1",
|
||||
"grunt-babel": "7.0.0",
|
||||
"grunt-cli": "1.2.0",
|
||||
"grunt-compare-size": "0.4.2",
|
||||
"grunt-contrib-uglify": "3.0.1",
|
||||
"grunt-contrib-watch": "1.0.0",
|
||||
"grunt-eslint": "20.0.0",
|
||||
"grunt-git-authors": "3.2.0",
|
||||
"grunt-jsonlint": "1.1.0",
|
||||
"grunt-karma": "2.0.0",
|
||||
"grunt-newer": "1.3.0",
|
||||
"grunt-npmcopy": "0.1.0",
|
||||
"gzip-js": "0.3.2",
|
||||
"husky": "0.14.3",
|
||||
"insight": "0.8.4",
|
||||
"jsdom": "5.6.1",
|
||||
"karma": "1.7.0",
|
||||
"karma-browserstack-launcher": "1.3.0",
|
||||
"karma-chrome-launcher": "2.2.0",
|
||||
"karma-firefox-launcher": "1.0.1",
|
||||
"karma-qunit": "1.2.1",
|
||||
"load-grunt-tasks": "3.5.2",
|
||||
"native-promise-only": "0.8.1",
|
||||
"promises-aplus-tests": "2.1.2",
|
||||
"q": "1.5.0",
|
||||
"qunit-assert-step": "1.0.3",
|
||||
"qunitjs": "1.23.1",
|
||||
"raw-body": "2.2.0",
|
||||
"requirejs": "2.3.3",
|
||||
"sinon": "2.3.7",
|
||||
"sizzle": "2.3.3",
|
||||
"strip-json-comments": "2.0.1",
|
||||
"testswarm": "1.1.0",
|
||||
"uglify-js": "3.3.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm install && grunt",
|
||||
"start": "grunt watch",
|
||||
"test:browserless": "grunt && grunt test:slow",
|
||||
"test:browser": "grunt && grunt karma:main",
|
||||
"test": "grunt && grunt test:slow && grunt karma:main",
|
||||
"jenkins": "npm run test:browserless",
|
||||
"precommit": "grunt lint:newer qunit_fixture",
|
||||
"commitmsg": "node node_modules/commitplease"
|
||||
},
|
||||
"commitplease": {
|
||||
"nohook": true,
|
||||
"components": [
|
||||
"Docs",
|
||||
"Tests",
|
||||
"Build",
|
||||
"Support",
|
||||
"Release",
|
||||
"Core",
|
||||
"Ajax",
|
||||
"Attributes",
|
||||
"Callbacks",
|
||||
"CSS",
|
||||
"Data",
|
||||
"Deferred",
|
||||
"Deprecated",
|
||||
"Dimensions",
|
||||
"Effects",
|
||||
"Event",
|
||||
"Manipulation",
|
||||
"Offset",
|
||||
"Queue",
|
||||
"Selector",
|
||||
"Serialize",
|
||||
"Traversing",
|
||||
"Wrap"
|
||||
],
|
||||
"markerPattern": "^((clos|fix|resolv)(e[sd]|ing))|^(refs?)",
|
||||
"ticketPattern": "^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])"
|
||||
}
|
||||
}
|
||||
17
integration/testdata/fixtures/repo/pnpm/node_modules/.pnpm/lodash@4.17.4/node_modules/lodash/package.json
generated
vendored
Normal file
17
integration/testdata/fixtures/repo/pnpm/node_modules/.pnpm/lodash@4.17.4/node_modules/lodash/package.json
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "4.17.4",
|
||||
"description": "Lodash modular utilities.",
|
||||
"keywords": "modules, stdlib, util",
|
||||
"homepage": "https://lodash.com/",
|
||||
"repository": "lodash/lodash",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
"license": "MIT",
|
||||
"main": "lodash.js",
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"contributors": [
|
||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
20
integration/testdata/fixtures/repo/pnpm/pnpm-lock.yaml
generated
vendored
20
integration/testdata/fixtures/repo/pnpm/pnpm-lock.yaml
generated
vendored
@@ -1,19 +1,23 @@
|
||||
lockfileVersion: 5.4
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
specifiers:
|
||||
jquery: 3.3.9
|
||||
lodash: 4.17.4
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
dependencies:
|
||||
jquery: 3.3.9
|
||||
lodash: 4.17.4
|
||||
jquery:
|
||||
specifier: ^3.3.9
|
||||
version: 3.3.9
|
||||
lodash:
|
||||
specifier: ^4.17.4
|
||||
version: 4.17.4
|
||||
|
||||
packages:
|
||||
|
||||
/jquery/3.3.9:
|
||||
/jquery@3.3.9:
|
||||
resolution: {integrity: sha512-ggRCXln9zEqv6OqAGXFEcshF5dSBvCkzj6Gm2gzuR5fWawaX8t7cxKVkkygKODrDAzKdoYw3l/e3pm3vlT4IbQ==}
|
||||
dev: false
|
||||
|
||||
/lodash/4.17.4:
|
||||
/lodash@4.17.4:
|
||||
resolution: {integrity: sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=}
|
||||
dev: false
|
||||
|
||||
4
integration/testdata/fixtures/vex/config/repository.yaml
vendored
Normal file
4
integration/testdata/fixtures/vex/config/repository.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
repositories:
|
||||
- name: default
|
||||
url: https://localhost
|
||||
enabled: true
|
||||
23
integration/testdata/fixtures/vex/file/openvex.json
vendored
Normal file
23
integration/testdata/fixtures/vex/file/openvex.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"@context": "https://openvex.dev/ns/v0.2.0",
|
||||
"@id": "aquasecurity/trivy:613fd55abbc2857b5ca28b07a26f3cd4c8b0ddc4c8a97c57497a2d4c4880d7fc",
|
||||
"author": "Aqua Security",
|
||||
"timestamp": "2024-07-09T11:38:00.115697+04:00",
|
||||
"version": 1,
|
||||
"statements": [
|
||||
{
|
||||
"vulnerability": { "@id": "CVE-2022-23628" },
|
||||
"products": [
|
||||
{
|
||||
"@id": "pkg:golang/github.com/testdata/testdata",
|
||||
"subcomponents": [
|
||||
{ "@id": "pkg:golang/github.com/open-policy-agent/opa@0.35.0" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": "not_affected",
|
||||
"justification": "vulnerable_code_not_in_execute_path",
|
||||
"impact_statement": "The vulnerable code isn't called"
|
||||
}
|
||||
]
|
||||
}
|
||||
9
integration/testdata/fixtures/vex/repositories/default/0.1/index.json
vendored
Normal file
9
integration/testdata/fixtures/vex/repositories/default/0.1/index.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 1,
|
||||
"packages": [
|
||||
{
|
||||
"ID": "pkg:golang/github.com/testdata/testdata",
|
||||
"Location": "./openvex.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
integration/testdata/fixtures/vex/repositories/default/vex-repository.json
vendored
Normal file
15
integration/testdata/fixtures/vex/repositories/default/vex-repository.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "Test VEX Repository",
|
||||
"description": "VEX Repository for Testing",
|
||||
"versions": [
|
||||
{
|
||||
"spec_version": "0.1",
|
||||
"locations": [
|
||||
{
|
||||
"url": "never used"
|
||||
}
|
||||
],
|
||||
"update_interval": "24h"
|
||||
}
|
||||
]
|
||||
}
|
||||
148
integration/testdata/gomod-vex.json.golden
vendored
Normal file
148
integration/testdata/gomod-vex.json.golden
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"CreatedAt": "2021-08-25T12:20:30.000000005Z",
|
||||
"ArtifactName": "testdata/fixtures/repo/gomod",
|
||||
"ArtifactType": "repository",
|
||||
"Metadata": {
|
||||
"ImageConfig": {
|
||||
"architecture": "",
|
||||
"created": "0001-01-01T00:00:00Z",
|
||||
"os": "",
|
||||
"rootfs": {
|
||||
"type": "",
|
||||
"diff_ids": null
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
},
|
||||
"Results": [
|
||||
{
|
||||
"Target": "go.mod",
|
||||
"Class": "lang-pkgs",
|
||||
"Type": "gomod",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "GMS-2022-20",
|
||||
"PkgID": "github.com/docker/distribution@v2.7.1+incompatible",
|
||||
"PkgName": "github.com/docker/distribution",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:golang/github.com/docker/distribution@2.7.1%2Bincompatible",
|
||||
"UID": "de19cd663ca047a8"
|
||||
},
|
||||
"InstalledVersion": "2.7.1+incompatible",
|
||||
"FixedVersion": "v2.8.0",
|
||||
"Status": "fixed",
|
||||
"Layer": {},
|
||||
"DataSource": {
|
||||
"ID": "ghsa",
|
||||
"Name": "GitHub Security Advisory Go",
|
||||
"URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
|
||||
},
|
||||
"Title": "OCI Manifest Type Confusion Issue",
|
||||
"Description": "### Impact\n\nSystems that rely on digest equivalence for image attestations may be vulnerable to type confusion.",
|
||||
"Severity": "UNKNOWN",
|
||||
"References": [
|
||||
"https://github.com/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586",
|
||||
"https://github.com/distribution/distribution/security/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/opencontainers/image-spec/pull/411"
|
||||
]
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2021-38561",
|
||||
"PkgID": "golang.org/x/text@v0.3.6",
|
||||
"PkgName": "golang.org/x/text",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:golang/golang.org/x/text@0.3.6",
|
||||
"UID": "825dc613c0f39d45"
|
||||
},
|
||||
"InstalledVersion": "0.3.6",
|
||||
"FixedVersion": "0.3.7",
|
||||
"Status": "fixed",
|
||||
"Layer": {},
|
||||
"PrimaryURL": "https://avd.aquasec.com/nvd/cve-2021-38561",
|
||||
"DataSource": {
|
||||
"ID": "ghsa",
|
||||
"Name": "GitHub Security Advisory Go",
|
||||
"URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
|
||||
},
|
||||
"Description": "Due to improper index calculation, an incorrectly formatted language tag can cause Parse\nto panic via an out of bounds read. If Parse is used to process untrusted user inputs,\nthis may be used as a vector for a denial of service attack.\n",
|
||||
"Severity": "UNKNOWN",
|
||||
"References": [
|
||||
"https://go-review.googlesource.com/c/text/+/340830",
|
||||
"https://go.googlesource.com/text/+/383b2e75a7a4198c42f8f87833eefb772868a56f",
|
||||
"https://pkg.go.dev/vuln/GO-2021-0113"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Target": "submod/go.mod",
|
||||
"Class": "lang-pkgs",
|
||||
"Type": "gomod",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "GMS-2022-20",
|
||||
"PkgID": "github.com/docker/distribution@v2.7.1+incompatible",
|
||||
"PkgName": "github.com/docker/distribution",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:golang/github.com/docker/distribution@2.7.1%2Bincompatible",
|
||||
"UID": "94376dc37054a7e8"
|
||||
},
|
||||
"InstalledVersion": "2.7.1+incompatible",
|
||||
"FixedVersion": "v2.8.0",
|
||||
"Status": "fixed",
|
||||
"Layer": {},
|
||||
"DataSource": {
|
||||
"ID": "ghsa",
|
||||
"Name": "GitHub Security Advisory Go",
|
||||
"URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
|
||||
},
|
||||
"Title": "OCI Manifest Type Confusion Issue",
|
||||
"Description": "### Impact\n\nSystems that rely on digest equivalence for image attestations may be vulnerable to type confusion.",
|
||||
"Severity": "UNKNOWN",
|
||||
"References": [
|
||||
"https://github.com/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586",
|
||||
"https://github.com/distribution/distribution/security/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/opencontainers/image-spec/pull/411"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Target": "submod2/go.mod",
|
||||
"Class": "lang-pkgs",
|
||||
"Type": "gomod",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "GMS-2022-20",
|
||||
"PkgID": "github.com/docker/distribution@v2.7.1+incompatible",
|
||||
"PkgName": "github.com/docker/distribution",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:golang/github.com/docker/distribution@2.7.1%2Bincompatible",
|
||||
"UID": "94306cdcf85fb50a"
|
||||
},
|
||||
"InstalledVersion": "2.7.1+incompatible",
|
||||
"FixedVersion": "v2.8.0",
|
||||
"Status": "fixed",
|
||||
"Layer": {},
|
||||
"DataSource": {
|
||||
"ID": "ghsa",
|
||||
"Name": "GitHub Security Advisory Go",
|
||||
"URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
|
||||
},
|
||||
"Title": "OCI Manifest Type Confusion Issue",
|
||||
"Description": "### Impact\n\nSystems that rely on digest equivalence for image attestations may be vulnerable to type confusion.",
|
||||
"Severity": "UNKNOWN",
|
||||
"References": [
|
||||
"https://github.com/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586",
|
||||
"https://github.com/distribution/distribution/security/advisories/GHSA-qq97-vm5h-rrhg",
|
||||
"https://github.com/opencontainers/image-spec/pull/411"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -527,7 +527,7 @@
|
||||
"IsCause": true,
|
||||
"Annotation": "",
|
||||
"Truncated": false,
|
||||
"Highlighted": "\u001b[0m \u001b[38;5;33mrunAsUser\u001b[0m: \u001b[38;5;37m0",
|
||||
"Highlighted": "\u001b[0m \u001b[38;5;33mrunAsUser\u001b[0m: \u001b[38;5;37m0\u001b[0m",
|
||||
"FirstCause": false,
|
||||
"LastCause": true
|
||||
}
|
||||
|
||||
12
integration/testdata/julia-spdx.json.golden
vendored
12
integration/testdata/julia-spdx.json.golden
vendored
@@ -31,8 +31,8 @@
|
||||
"downloadLocation": "NONE",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "package found in: Manifest.toml",
|
||||
"licenseConcluded": "NONE",
|
||||
"licenseDeclared": "NONE",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "PACKAGE-MANAGER",
|
||||
@@ -54,8 +54,8 @@
|
||||
"downloadLocation": "NONE",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "package found in: Manifest.toml",
|
||||
"licenseConcluded": "NONE",
|
||||
"licenseDeclared": "NONE",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "PACKAGE-MANAGER",
|
||||
@@ -77,8 +77,8 @@
|
||||
"downloadLocation": "NONE",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "package found in: Manifest.toml",
|
||||
"licenseConcluded": "NONE",
|
||||
"licenseDeclared": "NONE",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "PACKAGE-MANAGER",
|
||||
|
||||
8
integration/testdata/mariner-1.0.json.golden
vendored
8
integration/testdata/mariner-1.0.json.golden
vendored
@@ -6,7 +6,7 @@
|
||||
"Metadata": {
|
||||
"OS": {
|
||||
"Family": "cbl-mariner",
|
||||
"Name": "1.0.20220122"
|
||||
"Name": "1.0"
|
||||
},
|
||||
"ImageID": "sha256:8cdcbf18341ed8afa5322e7b0077f8ef3f46896882c921df5f97c51b369f6767",
|
||||
"DiffIDs": [
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
"Results": [
|
||||
{
|
||||
"Target": "testdata/fixtures/images/mariner-1.0.tar.gz (cbl-mariner 1.0.20220122)",
|
||||
"Target": "testdata/fixtures/images/mariner-1.0.tar.gz (cbl-mariner 1.0)",
|
||||
"Class": "os-pkgs",
|
||||
"Type": "cbl-mariner",
|
||||
"Vulnerabilities": [
|
||||
@@ -42,7 +42,7 @@
|
||||
"VulnerabilityID": "CVE-2022-0261",
|
||||
"PkgName": "vim",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
|
||||
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0",
|
||||
"UID": "3f08cd76fa5ba73d"
|
||||
},
|
||||
"InstalledVersion": "8.2.4081-1.cm1",
|
||||
@@ -79,7 +79,7 @@
|
||||
"VulnerabilityID": "CVE-2022-0158",
|
||||
"PkgName": "vim",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
|
||||
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0",
|
||||
"UID": "3f08cd76fa5ba73d"
|
||||
},
|
||||
"InstalledVersion": "8.2.4081-1.cm1",
|
||||
|
||||
94
integration/testdata/opensuse-tumbleweed.json.golden
vendored
Normal file
94
integration/testdata/opensuse-tumbleweed.json.golden
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"CreatedAt": "2021-08-25T12:20:30.000000005Z",
|
||||
"ArtifactName": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
|
||||
"ArtifactType": "container_image",
|
||||
"Metadata": {
|
||||
"OS": {
|
||||
"Family": "opensuse.tumbleweed",
|
||||
"Name": "20240607"
|
||||
},
|
||||
"ImageID": "sha256:580e73f5c823232e6587136e9f5428a89afdf77a123bb8575d08208e0cc34b12",
|
||||
"DiffIDs": [
|
||||
"sha256:7a335bdf2d91d6d158da360054aa7e477d708187d43fe9d0ac20144cdf90f763"
|
||||
],
|
||||
"ImageConfig": {
|
||||
"architecture": "amd64",
|
||||
"author": "Fabian Vogt \u003cfvogt@suse.com\u003e",
|
||||
"created": "2024-06-07T17:19:44Z",
|
||||
"history": [
|
||||
{
|
||||
"author": "Fabian Vogt \u003cfvogt@suse.com\u003e",
|
||||
"created": "2024-06-07T17:19:44Z",
|
||||
"created_by": "KIWI 10.0.19",
|
||||
"comment": "openSUSE Tumbleweed 20240607 Base Container"
|
||||
}
|
||||
],
|
||||
"os": "linux",
|
||||
"rootfs": {
|
||||
"type": "layers",
|
||||
"diff_ids": [
|
||||
"sha256:7a335bdf2d91d6d158da360054aa7e477d708187d43fe9d0ac20144cdf90f763"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"Cmd": [
|
||||
"/bin/bash"
|
||||
],
|
||||
"Labels": {
|
||||
"org.openbuildservice.disturl": "obs://build.opensuse.org/openSUSE:Factory/images/b068e2522114e1c009e9bfa1b5cb1146-opensuse-tumbleweed-image:docker",
|
||||
"org.opencontainers.image.created": "2024-06-07T17:19:38.229693664Z",
|
||||
"org.opencontainers.image.description": "Image containing a minimal environment for containers based on openSUSE Tumbleweed.",
|
||||
"org.opencontainers.image.source": "https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=b068e2522114e1c009e9bfa1b5cb1146",
|
||||
"org.opencontainers.image.title": "openSUSE Tumbleweed Base Container",
|
||||
"org.opencontainers.image.url": "https://www.opensuse.org/",
|
||||
"org.opencontainers.image.vendor": "openSUSE Project",
|
||||
"org.opencontainers.image.version": "20240607.30.45",
|
||||
"org.opensuse.base.created": "2024-06-07T17:19:38.229693664Z",
|
||||
"org.opensuse.base.description": "Image containing a minimal environment for containers based on openSUSE Tumbleweed.",
|
||||
"org.opensuse.base.disturl": "obs://build.opensuse.org/openSUSE:Factory/images/b068e2522114e1c009e9bfa1b5cb1146-opensuse-tumbleweed-image:docker",
|
||||
"org.opensuse.base.reference": "registry.opensuse.org/opensuse/tumbleweed:20240607.30.45",
|
||||
"org.opensuse.base.source": "https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=b068e2522114e1c009e9bfa1b5cb1146",
|
||||
"org.opensuse.base.title": "openSUSE Tumbleweed Base Container",
|
||||
"org.opensuse.base.url": "https://www.opensuse.org/",
|
||||
"org.opensuse.base.vendor": "openSUSE Project",
|
||||
"org.opensuse.base.version": "20240607.30.45",
|
||||
"org.opensuse.reference": "registry.opensuse.org/opensuse/tumbleweed:20240607.30.45"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Results": [
|
||||
{
|
||||
"Target": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz (opensuse.tumbleweed 20240607)",
|
||||
"Class": "os-pkgs",
|
||||
"Type": "opensuse.tumbleweed",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "openSUSE-SU-2024:13065-1",
|
||||
"PkgID": "libopenssl3@3.1.4-9.1.x86_64",
|
||||
"PkgName": "libopenssl3",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/opensuse.tumbleweed/libopenssl3@3.1.4-9.1?arch=x86_64\u0026distro=opensuse.tumbleweed-20240607",
|
||||
"UID": "f051425f385d2b99"
|
||||
},
|
||||
"InstalledVersion": "3.1.4-9.1",
|
||||
"FixedVersion": "3.1.5-9.1",
|
||||
"Status": "fixed",
|
||||
"Layer": {
|
||||
"Digest": "sha256:427d16a14c45614f51357aeebee0dfe209a1cebfc044b3b724b6ea35663b3111",
|
||||
"DiffID": "sha256:7a335bdf2d91d6d158da360054aa7e477d708187d43fe9d0ac20144cdf90f763"
|
||||
},
|
||||
"Title": "libopenssl-3-devel-3.1.1-3.1 on GA media",
|
||||
"Description": "These are all security issues fixed in the libopenssl-3-devel-3.1.1-3.1 package on the GA media of openSUSE Tumbleweed.",
|
||||
"Severity": "MEDIUM",
|
||||
"References": [
|
||||
"https://www.suse.com/security/cve/CVE-2023-2975/",
|
||||
"https://www.suse.com/security/cve/CVE-2023-3446/",
|
||||
"https://www.suse.com/support/security/rating/"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
34
integration/testdata/pnpm.json.golden
vendored
34
integration/testdata/pnpm.json.golden
vendored
@@ -20,6 +20,36 @@
|
||||
"Target": "pnpm-lock.yaml",
|
||||
"Class": "lang-pkgs",
|
||||
"Type": "pnpm",
|
||||
"Packages": [
|
||||
{
|
||||
"ID": "jquery@3.3.9",
|
||||
"Name": "jquery",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:npm/jquery@3.3.9",
|
||||
"UID": "53ca18565a4b6a47"
|
||||
},
|
||||
"Version": "3.3.9",
|
||||
"Licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"Relationship": "direct",
|
||||
"Layer": {}
|
||||
},
|
||||
{
|
||||
"ID": "lodash@4.17.4",
|
||||
"Name": "lodash",
|
||||
"Identifier": {
|
||||
"PURL": "pkg:npm/lodash@4.17.4",
|
||||
"UID": "31eadfcf58a6b128"
|
||||
},
|
||||
"Version": "4.17.4",
|
||||
"Licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"Relationship": "direct",
|
||||
"Layer": {}
|
||||
}
|
||||
],
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "CVE-2019-11358",
|
||||
@@ -27,7 +57,7 @@
|
||||
"PkgName": "jquery",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:npm/jquery@3.3.9",
|
||||
"UID": "d002d4ebac4ee286"
|
||||
"UID": "53ca18565a4b6a47"
|
||||
},
|
||||
"InstalledVersion": "3.3.9",
|
||||
"FixedVersion": "3.4.0",
|
||||
@@ -160,7 +190,7 @@
|
||||
"PkgName": "lodash",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:npm/lodash@4.17.4",
|
||||
"UID": "68507e8301071074"
|
||||
"UID": "31eadfcf58a6b128"
|
||||
},
|
||||
"InstalledVersion": "4.17.4",
|
||||
"FixedVersion": "4.17.12",
|
||||
|
||||
@@ -245,7 +245,9 @@
|
||||
},
|
||||
"References": [
|
||||
"https://github.com/advisories/GHSA-36p3-wjmg-h94x"
|
||||
]
|
||||
],
|
||||
"PublishedDate": "2022-04-01T23:15:00Z",
|
||||
"LastModifiedDate": "2022-05-19T14:21:00Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -245,7 +245,9 @@
|
||||
},
|
||||
"References": [
|
||||
"https://github.com/advisories/GHSA-36p3-wjmg-h94x"
|
||||
]
|
||||
],
|
||||
"PublishedDate": "2022-04-01T23:15:00Z",
|
||||
"LastModifiedDate": "2022-05-19T14:21:00Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
192
integration/testdata/ubi-7-comprehensive.json.golden
vendored
Normal file
192
integration/testdata/ubi-7-comprehensive.json.golden
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
{
|
||||
"SchemaVersion": 2,
|
||||
"CreatedAt": "2021-08-25T12:20:30.000000005Z",
|
||||
"ArtifactName": "testdata/fixtures/images/ubi-7.tar.gz",
|
||||
"ArtifactType": "container_image",
|
||||
"Metadata": {
|
||||
"OS": {
|
||||
"Family": "redhat",
|
||||
"Name": "7.7"
|
||||
},
|
||||
"ImageID": "sha256:6fecccc91c83e11ae4fede6793e9410841221d4779520c2b9e9fb7f7b3830264",
|
||||
"DiffIDs": [
|
||||
"sha256:4468e6d912c76d5b127f3554c3cd83b7dc07cce6107c6b916299ba76fa7d15ac",
|
||||
"sha256:ecb0311889b3478bc9b62660fa9391d5ebf8da4c6ae143cb33434873668f9e36"
|
||||
],
|
||||
"ImageConfig": {
|
||||
"architecture": "amd64",
|
||||
"created": "2019-09-02T12:56:43.939095Z",
|
||||
"docker_version": "1.13.1",
|
||||
"history": [
|
||||
{
|
||||
"created": "2019-09-02T12:56:36.440695936Z",
|
||||
"comment": "Imported from -"
|
||||
},
|
||||
{
|
||||
"created": "2019-09-02T12:56:43.939095Z"
|
||||
}
|
||||
],
|
||||
"os": "linux",
|
||||
"rootfs": {
|
||||
"type": "layers",
|
||||
"diff_ids": [
|
||||
"sha256:4468e6d912c76d5b127f3554c3cd83b7dc07cce6107c6b916299ba76fa7d15ac",
|
||||
"sha256:ecb0311889b3478bc9b62660fa9391d5ebf8da4c6ae143cb33434873668f9e36"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"Cmd": [
|
||||
"/bin/bash"
|
||||
],
|
||||
"Env": [
|
||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
"container=oci"
|
||||
],
|
||||
"Hostname": "0da2e3774382",
|
||||
"Image": "2e9103a7b91a7ffe333e9162ce98ea078263747527571655e93bd4d35ee278f0",
|
||||
"Labels": {
|
||||
"architecture": "x86_64",
|
||||
"authoritative-source-url": "registry.access.redhat.com",
|
||||
"build-date": "2019-09-02T12:56:18.824770",
|
||||
"com.redhat.build-host": "cpt-1005.osbs.prod.upshift.rdu2.redhat.com",
|
||||
"com.redhat.component": "ubi7-container",
|
||||
"com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI",
|
||||
"description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.",
|
||||
"distribution-scope": "public",
|
||||
"io.k8s.description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.",
|
||||
"io.k8s.display-name": "Red Hat Universal Base Image 7",
|
||||
"io.openshift.tags": "base rhel7",
|
||||
"maintainer": "Red Hat, Inc.",
|
||||
"name": "ubi7",
|
||||
"release": "140",
|
||||
"summary": "Provides the latest release of the Red Hat Universal Base Image 7.",
|
||||
"url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/images/7.7-140",
|
||||
"vcs-ref": "4c80c8aa26e69950ab11b87789c8fb7665b1632d",
|
||||
"vcs-type": "git",
|
||||
"vendor": "Red Hat, Inc.",
|
||||
"version": "7.7"
|
||||
},
|
||||
"ArgsEscaped": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"Results": [
|
||||
{
|
||||
"Target": "testdata/fixtures/images/ubi-7.tar.gz (redhat 7.7)",
|
||||
"Class": "os-pkgs",
|
||||
"Type": "redhat",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "CVE-2019-18276",
|
||||
"PkgID": "bash@4.2.46-33.el7.x86_64",
|
||||
"PkgName": "bash",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:rpm/redhat/bash@4.2.46-33.el7?arch=x86_64\u0026distro=redhat-7.7",
|
||||
"UID": "f5b786381193ad1b"
|
||||
},
|
||||
"InstalledVersion": "4.2.46-33.el7",
|
||||
"Status": "will_not_fix",
|
||||
"Layer": {
|
||||
"Digest": "sha256:7b1c937e0f6794db2535be6e4cb6d60a0b668ef78c2576611a3fb9c97a95ccdf",
|
||||
"DiffID": "sha256:4468e6d912c76d5b127f3554c3cd83b7dc07cce6107c6b916299ba76fa7d15ac"
|
||||
},
|
||||
"SeveritySource": "redhat",
|
||||
"PrimaryURL": "https://avd.aquasec.com/nvd/cve-2019-18276",
|
||||
"Title": "bash: when effective UID is not equal to its real UID the saved UID is not dropped",
|
||||
"Description": "An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support \"saved UID\" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use \"enable -f\" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.",
|
||||
"Severity": "LOW",
|
||||
"CweIDs": [
|
||||
"CWE-273"
|
||||
],
|
||||
"VendorSeverity": {
|
||||
"cbl-mariner": 3,
|
||||
"nvd": 3,
|
||||
"oracle-oval": 1,
|
||||
"photon": 3,
|
||||
"redhat": 1,
|
||||
"ubuntu": 1
|
||||
},
|
||||
"CVSS": {
|
||||
"nvd": {
|
||||
"V2Vector": "AV:L/AC:L/Au:N/C:C/I:C/A:C",
|
||||
"V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
|
||||
"V2Score": 7.2,
|
||||
"V3Score": 7.8
|
||||
},
|
||||
"redhat": {
|
||||
"V3Vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
|
||||
"V3Score": 7.8
|
||||
}
|
||||
},
|
||||
"References": [
|
||||
"http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html",
|
||||
"https://access.redhat.com/security/cve/CVE-2019-18276",
|
||||
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18276",
|
||||
"https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff",
|
||||
"https://linux.oracle.com/cve/CVE-2019-18276.html",
|
||||
"https://linux.oracle.com/errata/ELSA-2021-1679.html",
|
||||
"https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E",
|
||||
"https://nvd.nist.gov/vuln/detail/CVE-2019-18276",
|
||||
"https://security.gentoo.org/glsa/202105-34",
|
||||
"https://security.netapp.com/advisory/ntap-20200430-0003/",
|
||||
"https://www.youtube.com/watch?v=-wGtxJ8opa8"
|
||||
],
|
||||
"PublishedDate": "2019-11-28T01:15:00Z",
|
||||
"LastModifiedDate": "2021-05-26T12:15:00Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Target": "Python",
|
||||
"Class": "lang-pkgs",
|
||||
"Type": "python-pkg",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "CVE-2022-40897",
|
||||
"PkgName": "setuptools",
|
||||
"PkgPath": "usr/lib/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info/PKG-INFO",
|
||||
"PkgIdentifier": {
|
||||
"PURL": "pkg:pypi/setuptools@0.9.8",
|
||||
"UID": "3f4c89bf681c1d7a"
|
||||
},
|
||||
"InstalledVersion": "0.9.8",
|
||||
"FixedVersion": "65.5.1",
|
||||
"Status": "fixed",
|
||||
"Layer": {
|
||||
"Digest": "sha256:7b1c937e0f6794db2535be6e4cb6d60a0b668ef78c2576611a3fb9c97a95ccdf",
|
||||
"DiffID": "sha256:4468e6d912c76d5b127f3554c3cd83b7dc07cce6107c6b916299ba76fa7d15ac"
|
||||
},
|
||||
"SeveritySource": "ghsa",
|
||||
"PrimaryURL": "https://avd.aquasec.com/nvd/cve-2022-40897",
|
||||
"DataSource": {
|
||||
"ID": "ghsa",
|
||||
"Name": "GitHub Security Advisory Pip",
|
||||
"URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Apip"
|
||||
},
|
||||
"Title": "pypa-setuptools: Regular Expression Denial of Service (ReDoS) in package_index.py",
|
||||
"Description": "Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py.",
|
||||
"Severity": "HIGH",
|
||||
"CweIDs": [
|
||||
"CWE-1333"
|
||||
],
|
||||
"VendorSeverity": {
|
||||
"ghsa": 3,
|
||||
"nvd": 2
|
||||
},
|
||||
"CVSS": {
|
||||
"nvd": {
|
||||
"V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H",
|
||||
"V3Score": 5.9
|
||||
}
|
||||
},
|
||||
"References": [
|
||||
"https://access.redhat.com/errata/RHSA-2023:0952",
|
||||
"https://access.redhat.com/security/cve/CVE-2022-40897"
|
||||
],
|
||||
"PublishedDate": "2022-12-23T00:15:13.987Z",
|
||||
"LastModifiedDate": "2024-06-21T19:15:23.877Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,17 +9,18 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
fixtures "github.com/aquasecurity/bolt-fixtures"
|
||||
"github.com/aquasecurity/trivy-db/pkg/db"
|
||||
trivydb "github.com/aquasecurity/trivy-db/pkg/db"
|
||||
jdb "github.com/aquasecurity/trivy-java-db/pkg/db"
|
||||
"github.com/aquasecurity/trivy/pkg/db"
|
||||
)
|
||||
|
||||
// InitDB initializes testing database.
|
||||
func InitDB(t *testing.T, fixtureFiles []string) string {
|
||||
// Create a temp dir
|
||||
dir := t.TempDir()
|
||||
cacheDir := t.TempDir()
|
||||
|
||||
dbPath := db.Path(dir)
|
||||
dbDir := filepath.Dir(dbPath)
|
||||
dbDir := db.Dir(cacheDir)
|
||||
dbPath := trivydb.Path(dbDir)
|
||||
err := os.MkdirAll(dbDir, 0700)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -30,9 +31,9 @@ func InitDB(t *testing.T, fixtureFiles []string) string {
|
||||
require.NoError(t, loader.Close())
|
||||
|
||||
// Initialize DB
|
||||
require.NoError(t, db.Init(dir))
|
||||
require.NoError(t, db.Init(dbDir))
|
||||
|
||||
return dir
|
||||
return cacheDir
|
||||
}
|
||||
|
||||
func Close() error {
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/utils/fsutils"
|
||||
)
|
||||
|
||||
func CopyFile(t *testing.T, src, dst string) {
|
||||
MustMkdirAll(t, filepath.Dir(dst))
|
||||
|
||||
_, err := fsutils.CopyFile(src, dst)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
// CopyDir copies the directory content from src to dst.
|
||||
// It supports only simple cases for testing.
|
||||
func CopyDir(t *testing.T, src, dst string) {
|
||||
@@ -34,3 +43,50 @@ func CopyDir(t *testing.T, src, dst string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func MustWriteYAML(t *testing.T, path string, data any) {
|
||||
t.Helper()
|
||||
MustMkdirAll(t, filepath.Dir(path))
|
||||
|
||||
f, err := os.Create(path)
|
||||
require.NoError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
require.NoError(t, yaml.NewEncoder(f).Encode(data))
|
||||
}
|
||||
|
||||
func MustReadYAML(t *testing.T, path string, out any) {
|
||||
t.Helper()
|
||||
f, err := os.Open(path)
|
||||
require.NoError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
require.NoError(t, yaml.NewDecoder(f).Decode(out))
|
||||
}
|
||||
|
||||
func MustMkdirAll(t *testing.T, dir string) {
|
||||
err := os.MkdirAll(dir, 0750)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func MustReadJSON(t *testing.T, filePath string, v any) {
|
||||
b, err := os.ReadFile(filePath)
|
||||
require.NoError(t, err)
|
||||
err = json.Unmarshal(b, v)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func MustWriteJSON(t *testing.T, filePath string, v any) {
|
||||
data, err := json.Marshal(v)
|
||||
require.NoError(t, err)
|
||||
|
||||
MustWriteFile(t, filePath, data)
|
||||
}
|
||||
|
||||
func MustWriteFile(t *testing.T, filePath string, content []byte) {
|
||||
dir := filepath.Dir(filePath)
|
||||
MustMkdirAll(t, dir)
|
||||
|
||||
err := os.WriteFile(filePath, content, 0600)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func AssertRuleFound(t *testing.T, ruleID string, results scan.Results, message
|
||||
meta := &m
|
||||
for meta != nil {
|
||||
assert.NotNil(t, meta.Range(), 0)
|
||||
assert.Greater(t, meta.Range().GetStartLine(), 0)
|
||||
assert.Greater(t, meta.Range().GetEndLine(), 0)
|
||||
assert.Positive(t, meta.Range().GetStartLine())
|
||||
assert.Positive(t, meta.Range().GetEndLine())
|
||||
meta = meta.Parent()
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user