Compare commits

...

226 Commits

Author SHA1 Message Date
DmitriyLewen
f105279989 fix(report): return severity colors in table format (#4969)
* use xio.NopCloser to compare with os.Stdout

* fmt of import
2023-08-10 03:58:42 +00:00
DmitriyLewen
bc2b0ca6c3 build: maximize available disk space for release (#4937)
* remove unneeded bins and archives

* use jlumbroso/free-disk-space

* remove repeating step

* use maximize-build-space

* build: remove unused step

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-08-09 18:18:15 +00:00
simar7
9493c6f087 test(cli): Fix assertion helptext (#4966) 2023-08-09 09:07:45 +00:00
simar7
b0359de664 chore(deps): Bump defsec to v0.91.1 (#4965) 2023-08-09 09:07:13 +00:00
Teppei Fukuda
d3a34e409c test: validate CycloneDX with the JSON schema (#4956)
* test: validate CycloneDX with the JSON schema

* fix(sbom): move licenses to `name` field in Cyclonedx format (#4941)

* use license.Name instead of Expression

* update tests

* test: add uuid package

* test: compare UUID

---------

Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
2023-08-08 12:51:10 +00:00
Nikita Pivkin
798ef1b64a fix(server): add licenses to the Result message (#4955) 2023-08-08 07:21:59 +00:00
Nikita Pivkin
e8cf281471 fix(aws): resolve endpoint if endpoint is passed (#4925)
* fix(aws): resolve endpoint to get identity if endpoint is passed

* resolve endpoint for ami and ebs

* return an error if aws region is missing
2023-08-08 07:19:40 +00:00
DmitriyLewen
f18b0db583 fix(sbom): move licenses to name field in Cyclonedx format (#4941)
* use license.Name instead of Expression

* update tests
2023-08-06 12:50:35 +00:00
DmitriyLewen
a79670156f add only uniq deps in dependsOn (#4943) 2023-08-06 11:39:39 +00:00
Nikita Pivkin
b544e0dea7 use testify instead of gotest.tools (#4946) 2023-08-06 11:33:16 +00:00
Nikita Pivkin
067a0fcb9c fix(nodejs): do not detect lock file in node_modules as an app (#4949)
* fix(npm): do not detect lock file in node_modules as an app

* refactor: add x/path.Contains

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-08-06 08:59:18 +00:00
DmitriyLewen
e6d7705a51 bump go-dep-parser (#4936) 2023-08-06 08:07:30 +00:00
dependabot[bot]
c584dc1768 chore(deps): bump github.com/openvex/go-vex from 0.2.0 to 0.2.1 (#4914)
Bumps [github.com/openvex/go-vex](https://github.com/openvex/go-vex) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/openvex/go-vex/releases)
- [Commits](https://github.com/openvex/go-vex/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: github.com/openvex/go-vex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 13:07:12 +00:00
dependabot[bot]
358d56b6b5 chore(deps): bump helm/kind-action from 1.7.0 to 1.8.0 (#4909)
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](fa81e57adf...dda0770415)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 06:14:49 +00:00
dependabot[bot]
17f3ea9180 chore(deps): bump github.com/Azure/azure-sdk-for-go/sdk/azcore (#4912)
Bumps [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.6.0...sdk/azcore/v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 06:13:41 +00:00
Nikita Pivkin
39ccbf7b58 test(aws): move part of unit tests to integration (#4884)
* test(aws): move part of unit tests to integration

* fix typo

* fix test

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-08-02 15:48:52 +00:00
Will Yardley
6d3ae3bcf2 docs(cli): update help string for file and dir skipping (#4872)
* docs(cli): update help string for file and dir skipping

- Update the contextual help messages
- Add some additional examples (and clarify YAML file configuration) for
  globbing
- Update docs
- Fix broken link in skipping docs

See also #3754

Signed-off-by: William Yardley <wyardley@users.noreply.github.com>

* docs: revert

---------

Signed-off-by: William Yardley <wyardley@users.noreply.github.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-08-02 12:33:59 +00:00
dependabot[bot]
7d7a1ef54a chore(deps): bump sigstore/cosign-installer (#4910)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from ef0e9691595ea19ec990a46b1a591dcafe568f34 to a5d81fb6bdbcbb3d239e864d6552820420254494.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](ef0e969159...a5d81fb6bd)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 11:54:14 +00:00
dependabot[bot]
fc7495017d chore(deps): bump github.com/sosedoff/gitkit from 0.3.0 to 0.4.0 (#4916)
Bumps [github.com/sosedoff/gitkit](https://github.com/sosedoff/gitkit) from 0.3.0 to 0.4.0.
- [Commits](https://github.com/sosedoff/gitkit/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/sosedoff/gitkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 11:41:38 +00:00
dependabot[bot]
b2a68bc06d chore(deps): bump k8s.io/api from 0.27.3 to 0.27.4 (#4918)
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.27.3 to 0.27.4.
- [Commits](https://github.com/kubernetes/api/compare/v0.27.3...v0.27.4)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 11:37:31 +00:00
dependabot[bot]
e5c0c15b6e chore(deps): bump github.com/secure-systems-lab/go-securesystemslib (#4919)
Bumps [github.com/secure-systems-lab/go-securesystemslib](https://github.com/secure-systems-lab/go-securesystemslib) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/secure-systems-lab/go-securesystemslib/releases)
- [Commits](https://github.com/secure-systems-lab/go-securesystemslib/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/secure-systems-lab/go-securesystemslib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 11:37:09 +00:00
dependabot[bot]
da37803d59 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/sts (#4913)
Bumps [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) from 1.19.0 to 1.21.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.19.0...service/s3/v1.21.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 11:31:47 +00:00
dependabot[bot]
9744e6498d chore(deps): bump github.com/magefile/mage from 1.14.0 to 1.15.0 (#4915)
Bumps [github.com/magefile/mage](https://github.com/magefile/mage) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/magefile/mage/releases)
- [Changelog](https://github.com/magefile/mage/blob/master/.goreleaser.yml)
- [Commits](https://github.com/magefile/mage/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/magefile/mage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 10:52:46 +00:00
Teppei Fukuda
99eebc6703 docs: update the discussion template (#4928) 2023-08-02 10:51:51 +00:00
Teppei Fukuda
d19c7d9f29 feat(repo): support local repositories (#4890)
* feat(repo): support local repositories

* fix tests

* test: fix client/server tests

* docs: update

* test: add fs tests

* test: do not update golden files if overridden

* docs: remove a comment about fs deprecation
2023-07-31 11:27:36 +00:00
DmitriyLewen
3c19761875 bump go-dep-parser (#4893) 2023-07-31 11:08:25 +00:00
Nikita Pivkin
e1c2a8c804 fix(misconf): add missing fields to proto (#4861)
* fix(misconf): add missing fields to proto

* mark deleted fields as reserved
2023-07-30 11:15:36 +00:00
Nikita Pivkin
8b8e0e83d1 fix: remove trivy-db package replacement (#4877)
* fix: remove trivy-db package replacement

* fix: remove trivy-db package replacement
2023-07-30 07:37:14 +00:00
Nikita Pivkin
f9efe44fd3 chore(test): bump the integration test timeout to 15m (#4880) 2023-07-30 07:34:48 +00:00
simar7
7271d682fb chore(deps): Update defsec to v0.91.0 (#4886)
* chore(deps): Update defsec to v0.91.0

* update tests

Signed-off-by: Simar <simar@linux.com>

---------

Signed-off-by: Simar <simar@linux.com>
2023-07-30 07:31:34 +00:00
Teppei Fukuda
c3bc67c89a chore: update CODEOWNERS (#4871)
* Update CODEOWNERS

* Add simar7
2023-07-27 07:05:15 +00:00
Teppei Fukuda
232ba823e1 feat(vuln): support vulnerability status (#4867)
* feat: support vulnerability status

* feat: show status in table

* don't add `fixed` status in debian/redhat

* update test golden files

* add Status in rpc

* update docs

* update ignore-status example

* add ignore-status in integration test

* docs: add the explanation for statuses

---------

Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
2023-07-26 11:55:03 +00:00
simar7
11618c9408 feat(misconf): Support custom URLs for policy bundle (#4834)
* feat(misconf): Support custom URLs for policy bundle

This PR adds support for custom policy bundles to be specified
with a flag `--policy-bundle-url` as an option to Trivy.

Fixes: https://github.com/aquasecurity/trivy/issues/4672

Signed-off-by: Simar <simar@linux.com>

* update docs

Signed-off-by: Simar <simar@linux.com>

* rename flag to `--policy-bundle-repository`

Signed-off-by: Simar <simar@linux.com>

* fix field

* rebase and update docs

Signed-off-by: Simar <simar@linux.com>

* set policyBundleRepo on client

Signed-off-by: Simar <simar@linux.com>

---------

Signed-off-by: Simar <simar@linux.com>
2023-07-26 08:45:49 +00:00
Teppei Fukuda
07075696d1 refactor: replace with sortable packages (#4858) 2023-07-24 07:09:14 +00:00
Damian E
fbe1c9eb1f docs: correct license scanning sample command (#4855) 2023-07-24 05:02:55 +00:00
Teppei Fukuda
20c2246a61 fix(report): close the file (#4842)
* fix(report): close the file

* refactor: add the format type

* fix: return errors in version printing

* fix: lint issues

* fix: do not fail on bogus cache dir

---------

Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
2023-07-23 13:37:18 +00:00
DmitriyLewen
24a3e547d9 feat(nodejs): add support for include-dev-deps flag for yarn (#4812)
* add support for include-dev-deps flag

* remove go.mod replace

* refactor

* bump go-dep-parser

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-07-23 13:07:49 +00:00
simar7
a7bd7bb65f feat(misconf): Add support for independently enabling libraries (#4070)
* feat(misconf): Add support for independently enabling libraries

Implements: https://github.com/aquasecurity/trivy/issues/4181

Signed-off-by: Simar <simar@linux.com>

* update tests

Signed-off-by: Simar <simar@linux.com>

* fix lint

Signed-off-by: Simar <simar@linux.com>

* fix tests

Signed-off-by: Simar <simar@linux.com>

* update defsec

Signed-off-by: Simar <simar@linux.com>

* fix test

Signed-off-by: Simar <simar@linux.com>

---------

Signed-off-by: Simar <simar@linux.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-07-23 09:44:59 +00:00
DmitriyLewen
4aa9ea0961 feat(secret): add secret config file for cache calculation (#4837)
* move parse secret config to initScannerConfig + add secret to cache key

* add calc cache test

* just read config file and add to cache

* refactor comments

* refactor
2023-07-23 08:26:22 +00:00
Sogo Kato
5d349d8147 Fix a link in gitlab-ci.md (#4850) 2023-07-23 08:20:29 +00:00
Nikita Pivkin
a61531c1f7 fix(flag): use globalstar to skip directories (#4854) 2023-07-23 06:11:46 +00:00
DmitriyLewen
78cc20937d chore(deps): bump github.com/docker/docker from v23.0.5+incompatible to v23.0.7-0.20230714215826-f00e7af96042+incompatible (#4849)
* use 1.19.10 version for integration tests

* fix go-version field

* revert test workflow changes

* bump docker/docker
2023-07-21 09:00:35 +00:00
afdesk
93996041b2 fix(license): using common way for splitting licenses (#4434)
* fix(license): using common way for splitting licenses

* add test cases

* TEST new regex

* extract function

* fix version detection

---------

Co-authored-by: Nikita Pivkin <nikita.pivkin@smartforce.io>
2023-07-19 08:05:43 +00:00
AliDatadog
3e2416d77c fix(containerd): Use img platform in exporter instead of strict host platform (#4477)
* match with img platform instead of host platform

* client matching pull spec

* use default platform

* pull with platforms default strict

* use withplatform to pull and add debug log

* looks like we are trying to scan a i386 image

* revert changes on test, use the right platform match

* try with Config.Platform

* use spect.platform

* fix function usage

* try another way to retrieve the platform

* fix compilation

* read platforms from config manifest

* use platform from RegistryOptions if available, otherwise get the actual platform

* goimport

* put platform in containerd client

* fix panic

* use DefaultStrict as default
2023-07-19 07:54:24 +00:00
DmitriyLewen
ce77bb46c3 remove govulndb (#4783) 2023-07-19 07:24:35 +00:00
Nikita Pivkin
c05caae43f fix(java): inherit licenses from parents (#4817) 2023-07-19 06:51:58 +00:00
Teppei Fukuda
aca11b95d0 refactor: add allowed values for CLI flags (#4800)
* refactor: rename Value to Default

* refactor: support allowed values for CLI flags

* docs: auto-generate

* test: fix

* test: add tests for flags
2023-07-17 13:13:23 +00:00
DmitriyLewen
4cecd17ea5 add example regex to allow rules (#4827) 2023-07-17 12:36:22 +00:00
simar7
4bc8d29c15 feat(misconf): Support custom data for rego policies for cloud (#4745)
* feat(misconf): Support custom data for cloud policies

Signed-off-by: Simar <simar@linux.com>

* use policyfs

Signed-off-by: Simar <simar@linux.com>

* refactor to reduce cyclomatic complexity

Signed-off-by: Simar <simar@linux.com>

* bump defsec

* update docs

Signed-off-by: Simar <simar@linux.com>

* update test assertion

Signed-off-by: Simar <simar@linux.com>

* update test

Need this as OPA is currently broken on Windows

https://github.com/open-policy-agent/opa/issues/4521

Signed-off-by: Simar <simar@linux.com>

* fix data path

* fix(mapfs): convert volume names into dirs

* revert creating temp dirs

---------

Signed-off-by: Simar <simar@linux.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2023-07-17 12:34:20 +00:00
Anais Urlichs
88243a0ad6 docs: correcting the trivy k8s tutorial (#4815)
* correcting the trivy k8s tutorial

Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>

* docs: fix

---------

Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-07-16 09:06:28 +00:00
Nikita Pivkin
3c7d988d71 feat(cli): add --tf-exclude-downloaded-modules flag (#4810)
* feat(cli): add --tf-exclude-downloaded-modules flag

* fix typo

* generate docs
2023-07-16 08:56:03 +00:00
DmitriyLewen
fd0fd104f8 fix(sbom): cyclonedx recommendations should include fixed versions for each package (#4794)
* add all fixed versions to recommendations

* fix tests
2023-07-13 11:16:11 +00:00
Nikita Pivkin
d0d543b881 feat(misconf): enable --policy flag to accept directory and files both (#4777)
* feat(misconf): enable --policy flag to accept directory and files both

* fix test

* Revert "clarifying a dir path is required for custom policies (#4716)"

This reverts commit 8a1aa448a1.

* update doc

* update the flag description
2023-07-13 10:59:21 +00:00
Nikita Pivkin
b43a3e6237 feat(python): add license fields (#4722)
* bump go-dep-parser

* update tests

* fix testdata
2023-07-13 10:55:36 +00:00
chenk
aef7b148af fix: support trivy k8s-version on k8s sub-command (#4786)
* fix: support trivy k8s-version on k8s sub-command

Signed-off-by: chenk <hen.keinan@gmail.com>

* fix: support last applied configuration

Signed-off-by: chenk <hen.keinan@gmail.com>

---------

Signed-off-by: chenk <hen.keinan@gmail.com>
2023-07-13 08:28:09 +00:00
simar7
5d76abadc9 chore(deps): Update defsec to v0.90.3 (#4793)
* chore(deps): Update defsec to v0.90.2

Signed-off-by: Simar <simar@linux.com>

* go mod tidy

---------

Signed-off-by: Simar <simar@linux.com>
2023-07-07 08:13:56 +00:00
dependabot[bot]
fed446c515 chore(deps): bump google.golang.org/protobuf from 1.30.0 to 1.31.0 (#4752)
Bumps google.golang.org/protobuf from 1.30.0 to 1.31.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 04:56:30 +00:00
dependabot[bot]
df62927e58 chore(deps): bump alpine from 3.18.0 to 3.18.2 (#4748)
Bumps alpine from 3.18.0 to 3.18.2.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 04:05:43 +00:00
dependabot[bot]
1b9b9a84f7 chore(deps): bump github.com/alicebob/miniredis/v2 from 2.30.3 to 2.30.4 (#4758)
Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.3 to 2.30.4.
- [Release notes](https://github.com/alicebob/miniredis/releases)
- [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alicebob/miniredis/compare/v2.30.3...v2.30.4)

---
updated-dependencies:
- dependency-name: github.com/alicebob/miniredis/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 13:23:01 +00:00
zunlongzhou
3c16ca821b docs(image): fix the comment on the soft/hard link (#4740)
* Update tar.go

The comment before the following w.processFile(filePath, tr, hdr.FileInfo(), analyzeFn) call says: // A symbolic/hard link or regular file will reach here. 
But defualt's processing causes the symbolic/hard link to not reach the processFile function location

* Update tar.go

update tar.go comment

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-07-06 10:49:48 +00:00
DmitriyLewen
e5bee5cccd check Type when filling pkgs in vulns (#4776) 2023-07-06 10:45:52 +00:00
Bill Wang
4b9f310b9c feat: add support of linux/ppc64le and linux/s390x architectures for Install.sh script (#4770)
* feat: add support of linux/ppc64le and linux/s390x architectures for Install.sh script #4747

* feat: add support of linux/ppc64le and linux/s390x architectures for Install.sh script #4747
2023-07-06 09:05:37 +00:00
dependabot[bot]
8e7fb7cc84 chore(deps): bump modernc.org/sqlite from 1.20.3 to 1.23.1 (#4756)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.20.3 to 1.23.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.20.3...v1.23.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 19:45:34 +00:00
DmitriyLewen
a9badeaba8 fix(rocky): add architectures support for advisories (#4691)
* add multi-arch support for rocky linux advisories

* feat: comply with the new signagure

* bump trivy-db

* fix tests

* chore(deps): remove fork replace

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-07-03 08:48:57 +00:00
dependabot[bot]
f8ebccc680 chore(deps): bump github.com/opencontainers/image-spec (#4751)
Bumps [github.com/opencontainers/image-spec](https://github.com/opencontainers/image-spec) from 1.1.0-rc3 to 1.1.0-rc4.
- [Release notes](https://github.com/opencontainers/image-spec/releases)
- [Changelog](https://github.com/opencontainers/image-spec/blob/main/RELEASES.md)
- [Commits](https://github.com/opencontainers/image-spec/compare/v1.1.0-rc3...v1.1.0-rc4)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/image-spec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 07:19:56 +00:00
dependabot[bot]
1c81948e03 chore(deps): bump github.com/package-url/packageurl-go (#4754)
Bumps [github.com/package-url/packageurl-go](https://github.com/package-url/packageurl-go) from 0.1.1-0.20220428063043-89078438f170 to 0.1.1.
- [Release notes](https://github.com/package-url/packageurl-go/releases)
- [Commits](https://github.com/package-url/packageurl-go/commits/v0.1.1)

---
updated-dependencies:
- dependency-name: github.com/package-url/packageurl-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 04:06:44 +00:00
dependabot[bot]
497cc10d8e chore(deps): bump golang.org/x/sync from 0.2.0 to 0.3.0 (#4750)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.2.0 to 0.3.0.
- [Commits](https://github.com/golang/sync/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 14:57:57 +00:00
dependabot[bot]
065f0afa54 chore(deps): bump github.com/tetratelabs/wazero from 1.2.0 to 1.2.1 (#4755)
Bumps [github.com/tetratelabs/wazero](https://github.com/tetratelabs/wazero) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/tetratelabs/wazero/releases)
- [Commits](https://github.com/tetratelabs/wazero/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/tetratelabs/wazero
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 14:52:44 +00:00
dependabot[bot]
e2603056dd chore(deps): bump github.com/testcontainers/testcontainers-go (#4759)
Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.20.1 to 0.21.0.
- [Release notes](https://github.com/testcontainers/testcontainers-go/releases)
- [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.20.1...v0.21.0)

---
updated-dependencies:
- dependency-name: github.com/testcontainers/testcontainers-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 13:57:46 +00:00
Alexandre
0621402bf7 fix: documentation about reseting trivy image (#4733) 2023-07-02 12:29:23 +00:00
Dirk Mueller
798fdbc013 fix(suse): Add openSUSE Leap 15.5 eol date as well (#4744)
Taken directly from https://en.opensuse.org/Lifetime
2023-07-02 11:22:26 +00:00
Teppei Fukuda
34a89293d5 fix: update Amazon Linux 1 EOL (#4761) 2023-07-02 11:00:20 +00:00
simar7
600819248d chore(deps): Update defsec to v0.90.1 (#4739)
Fixes: https://github.com/aquasecurity/trivy/issues/4628

Signed-off-by: Simar <simar@linux.com>
2023-06-30 06:48:47 +00:00
Nikita Pivkin
73734eab21 feat(nodejs): support yarn workspaces (#4664)
* feat(nodejs): add the workspaces field to the package

* fix go.mod

* update go.mod

* compare workspaces by length
2023-06-30 06:40:28 +00:00
DmitriyLewen
22463ababd feat(cli): add include-dev-deps flag (#4700)
* add Dev field for Package

* fix integration test

* update docs

* feat(cli): add include-dev flag

* bump go-dep-parser

* update docs

* add integration test

* refactor

* refactor

* fix integration test

* refactor: rename flag to include-dev-deps

* update docs

* update docs

* filter dev deps when scanning packages

* add flag support for server mode

* refactor: remove comment that might confuse

* refactor: move --include-dev-deps to the scanner flag group

* refactor: not return apps

* docs: update

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-06-29 13:15:52 +00:00
Nikita Pivkin
790c8054ec fix(image): pass the secret scanner option to scan the img config (#4735) 2023-06-29 08:37:45 +00:00
chenk
86fec9c4a9 fix: scan job pod it not found on k8s-1.27.x (#4729)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-28 14:38:39 +00:00
Manveer Singh
26bc91160b feat(docker): add support for mTLS authentication when connecting to registry (#4649)
* feat: add support for mTLS authentication when connecting to registry

* feat: add support for mTLS authentication when connecting to registry - added error handling

* feat: add support for mTLS authentication when connecting to registry
- code quality improvements

* feat: add support for mTLS authentication when connecting to registry
- code quality improvements

* wrap errors

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-06-28 11:21:26 +00:00
simar7
d699e8c101 chore(deps): Update defsec to v0.90.0 (#4723)
Signed-off-by: Simar <simar@linux.com>
2023-06-28 08:34:56 +00:00
DmitriyLewen
1777878e83 fix: skip scanning the gpg-pubkey package (#4720) 2023-06-28 07:06:08 +00:00
Makhonin Alexey
9be08253a2 Fix http registry oci pull (#4701)
Signed-off-by: alexey.makhonin <alexey.makhonin@flant.com>
2023-06-26 12:40:40 +00:00
simar7
5d73b47dbc feat(misconf): Support skipping services (#4686)
* feat(misconf): Add support for `--skip-service` flag.

Fixes: https://github.com/aquasecurity/trivy/issues/4619
Signed-off-by: Simar <simar@linux.com>

* update docs

Signed-off-by: Simar <simar@linux.com>

* update go mod

* refactor processOptions to reduce cyclo complexity

Signed-off-by: Simar <simar@linux.com>

* fix a bug with multiple skip services

Signed-off-by: Simar <simar@linux.com>

* refactor tests

Signed-off-by: Simar <simar@linux.com>

* use x/slice and x/xerrors

Signed-off-by: Simar <simar@linux.com>

* go mod tidy

* lint

---------

Signed-off-by: Simar <simar@linux.com>
2023-06-26 11:11:59 +00:00
DmitriyLewen
46e784c8a9 docs: fix supported modes for pubspec.lock files (#4713) 2023-06-26 11:04:45 +00:00
Teppei Fukuda
0f61a84712 fix(misconf): disable the terraform plan analyzer for other scanners (#4714) 2023-06-26 11:03:25 +00:00
Anais Urlichs
8a1aa448a1 clarifying a dir path is required for custom policies (#4716)
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
2023-06-26 10:56:57 +00:00
Sandro
fbab9eea3a chore: update alpine base images (#4715) 2023-06-26 10:34:50 +00:00
AliDatadog
f84417bba0 fix last-history-created (#4697) 2023-06-26 03:57:54 +00:00
chenk
85c681d443 feat: kbom and cyclonedx v1.5 spec support (#4708)
* feat: kbom and cyclonedx v1.5 spec support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kbom and cyclonedx v1.5 spec support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kbom and cyclonedx v1.5 spec support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: feat: kbom and cyclonedx 1.5 spec support

Signed-off-by: chenk <hen.keinan@gmail.com>

* fix: unmarshal bom on v1.5 return invalid specification version

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: cyclonedx-1.5 spec support

Signed-off-by: chenk <hen.keinan@gmail.com>

---------

Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-25 13:47:06 +00:00
Itay Shakury
46748ce6ea docs: add information about Aqua (#4590)
* docs: add information about Aqua

* update link
2023-06-25 10:40:45 +00:00
chenk
c6741bddff fix: k8s escape resource filename on windows os (#4693)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-22 11:16:24 +00:00
Teppei Fukuda
a21acc7e08 ci: ignore merge queue branches (#4696) 2023-06-22 11:02:22 +00:00
dependabot[bot]
32a3a3311c chore(deps): bump actions/checkout from 2.4.0 to 3.5.3 (#4695)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3.5.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 10:56:11 +00:00
dependabot[bot]
cbb47dc7c4 chore(deps): bump aquaproj/aqua-installer from 2.1.1 to 2.1.2 (#4694)
Bumps [aquaproj/aqua-installer](https://github.com/aquaproj/aqua-installer) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/aquaproj/aqua-installer/releases)
- [Commits](https://github.com/aquaproj/aqua-installer/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: aquaproj/aqua-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 10:31:20 +00:00
chenk
e3d10d2512 feat: cyclondx sbom custom property support (#4688)
* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: custom property support

Signed-off-by: chenk <hen.keinan@gmail.com>

---------

Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-22 08:33:27 +00:00
Teppei Fukuda
e1770e046c ci: do not trigger tests in main (#4692) 2023-06-22 08:25:58 +00:00
Dirk Mueller
337c0b70d5 add SUSE Linux Enterprise Server 15 SP5 and update SP4 eol date (#4690)
all dates are taken from https://www.suse.com/lifecycle#suse-linux-enterprise-server-15
2023-06-22 07:34:59 +00:00
DmitriyLewen
5ccee14304 use group field for jar in cyclonedx (#4674) 2023-06-22 07:19:38 +00:00
Nikita Pivkin
96db52c3f6 feat(java): capture licenses from pom.xml (#4681)
* feat(java): capture licenses from pom.xml

* update doc
2023-06-21 13:12:37 +00:00
Leroy Shirto
3e902a57a9 feat(helm): make sessionAffinity configurable (#4623)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-06-21 11:14:36 +00:00
Tung Bui (Leo)
904f1cf24e fix: Show the correct URL of the secret scanning (#4682) 2023-06-21 10:57:54 +00:00
Meisam
7d48c5d5d4 document expected file pattern definition format (#4654) 2023-06-20 14:02:55 +00:00
guangwu
dcc73e964a fix: format arg error (#4642)
* fix: format arg error

* fix: xerrors.Errorf
2023-06-19 10:52:38 +00:00
chenk
35c4262d0b feat(k8s): cyclonedx kbom support (#4557)
* feat: cyclonedx kbom support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: cyclonedx kbom support

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* chore: update sum db

Signed-off-by: chenk <hen.keinan@gmail.com>

* chore: update sum db

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* chore: update sumdb

Signed-off-by: chenk <hen.keinan@gmail.com>

* chore: update sumdb

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

* feat: kubernetes bill of materials

Signed-off-by: chenk <hen.keinan@gmail.com>

---------

Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-19 10:48:26 +00:00
Nikita Pivkin
0e01851e9e fix(nodejs): remove unused fields for the pnpm lockfile (#4630)
* refactor(nodejs): remove unused fields for the pnpm lockfile

* run go mod tidy

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-06-19 03:17:31 +00:00
Masahiro331
4d9b444499 fix(vm): update ext4-filesystem parser for parse multi block extents (#4616)
* chore(deps): update ext4-filesystem parser for parse multi block extents

* test(vm): update integration-vm test fixtures

* test(vm): add gzip decompresser for sparse file

* test(vm): add mage command update golden file for vm integration test

* chore(magefile): [WIP] change test repository

* Revert "chore(magefile): [WIP] change test repository"

This reverts commit c015c8892f.

* fix(test): update fixtures and golden file

* fix(test): revert fixVersion and PkgID
2023-06-18 16:41:55 +00:00
afdesk
c29197ab7d ci: update build IDs (#4641) 2023-06-18 11:24:29 +00:00
Chris Novakovic
d7637adc6b fix(debian): update EOL for Debian 12 (#4647)
* fix(debian): update EOL for Debian 12

Debian 12 was released on 2023-06-10 and will be supported for five
years - see https://www.debian.org/News/2023/20230610.

* Update docs
2023-06-16 04:18:55 +00:00
Teppei Fukuda
ef39eeedf3 chore(deps): bump go-containerregistry (#4639) 2023-06-15 09:44:24 +00:00
guangwu
1ce8bb535a chore: unnecessary use of fmt.Sprintf (S1039) (#4637) 2023-06-15 08:36:15 +00:00
Björn Wenzel
bc9513fc57 fix(db): change argument order in Exists query for JavaDB (#4595) 2023-06-14 02:26:10 +00:00
simar7
aecd2f0bf0 feat(aws): Add support to see successes in results (#4427)
Fixes: https://github.com/aquasecurity/trivy/discussions/4417

Signed-off-by: Simar <simar@linux.com>
2023-06-13 17:36:05 +00:00
dependabot[bot]
2cbf402b6a chore(deps): bump golangci/golangci-lint-action from 3.5.0 to 3.6.0 (#4613)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 13:52:43 +00:00
Teppei Fukuda
0099b20e31 ci: do not trigger tests in main (#4614) 2023-06-12 13:00:32 +00:00
dependabot[bot]
a597a54fb6 chore(deps): bump sigstore/cosign-installer (#4609)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 204a51a57a74d190b284a0ce69b44bc37201f343 to ef0e9691595ea19ec990a46b1a591dcafe568f34.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](204a51a57a...ef0e969159)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 12:16:20 +00:00
dependabot[bot]
b453fbec37 chore(deps): bump CycloneDX/gh-gomod-generate-sbom from 1 to 2 (#4608)
Bumps [CycloneDX/gh-gomod-generate-sbom](https://github.com/CycloneDX/gh-gomod-generate-sbom) from 1 to 2.
- [Release notes](https://github.com/CycloneDX/gh-gomod-generate-sbom/releases)
- [Commits](https://github.com/CycloneDX/gh-gomod-generate-sbom/compare/v1...v2)

---
updated-dependencies:
- dependency-name: CycloneDX/gh-gomod-generate-sbom
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-06-12 11:40:58 +00:00
Teppei Fukuda
0e876d5aa0 ci: bypass the required status checks (#4611) 2023-06-12 14:39:47 +03:00
Teppei Fukuda
a4f27d24a3 ci: support merge queue (#3652) 2023-06-12 11:39:08 +03:00
Teppei Fukuda
9e6411e9f5 ci: matrix build for testing (#4587) 2023-06-12 10:49:13 +03:00
chenk
ef6538a171 feat: trivy k8s private registry support (#4567)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-12 05:40:25 +03:00
Itay Shakury
139f3e1e32 docs: add general coverage page (#3859) 2023-06-11 08:49:29 +03:00
Itay Shakury
479cfdd40e chore: create SECURITY.md (#4601) 2023-06-11 06:16:42 +03:00
afdesk
9a279fa7bb ci: remove 32bit packages (#4585) 2023-06-08 16:52:37 +03:00
Teppei Fukuda
d52b0b7bc0 fix(misconf): deduplicate misconf results (#4588) 2023-06-08 15:15:21 +03:00
Amir Ben Nun
9b531fa27b fix(vm): support sector size of 4096 (#4564)
Co-authored-by: masahiro331 <m_fujimura@r.recruit.co.jp>
2023-06-08 11:31:13 +03:00
Teppei Fukuda
8ca1bfdd23 fix(misconf): terraform relative paths (#4571) 2023-06-08 11:24:52 +03:00
Nikita Pivkin
c20d466044 fix(purl): skip unsupported library type (#4577) 2023-06-08 08:45:32 +03:00
Jonathan Lassoff
52cbe79759 fix(terraform): recursively detect all Root Modules (#4457)
Signed-off-by: Simar <simar@linux.com>
Co-authored-by: Simar <simar@linux.com>
2023-06-08 07:06:00 +03:00
Masahiro331
4a5b915578 fix(vm): support post analyzer for vm command (#4544) 2023-06-07 16:16:27 +03:00
Nikita Pivkin
56cdc55f77 fix(nodejs): change the type of the devDependencies field (#4560) 2023-06-06 15:51:39 +03:00
Nikita Pivkin
17d753676b fix(sbom): export empty dependencies in CycloneDX (#4568) 2023-06-06 15:49:23 +03:00
Teppei Fukuda
2796abe1ed refactor: add composite fs for post-analyzers (#4556) 2023-06-06 08:19:15 +03:00
dependabot[bot]
22a1573807 chore(deps): bump golangci/golangci-lint-action from 3.4.0 to 3.5.0 (#4554) 2023-06-04 16:17:54 +03:00
dependabot[bot]
43586659a1 chore(deps): bump helm/kind-action from 1.5.0 to 1.7.0 (#4526) 2023-06-04 14:50:38 +03:00
dependabot[bot]
5081399659 chore(deps): bump github.com/BurntSushi/toml from 1.2.1 to 1.3.0 (#4528) 2023-06-04 14:48:41 +03:00
dependabot[bot]
e1a38128ab chore(deps): bump github.com/alicebob/miniredis/v2 from 2.30.2 to 2.30.3 (#4529) 2023-06-04 11:19:53 +03:00
dependabot[bot]
283eef6372 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2 (#4536) 2023-06-04 11:13:44 +03:00
dependabot[bot]
bbd7b98741 chore(deps): bump github.com/tetratelabs/wazero from 1.0.0 to 1.2.0 (#4549) 2023-06-04 11:12:49 +03:00
dependabot[bot]
11c81bf2f6 chore(deps): bump github.com/spf13/cast from 1.5.0 to 1.5.1 (#4532) 2023-06-04 11:11:32 +03:00
dependabot[bot]
2d8d63e61a chore(deps): bump github.com/testcontainers/testcontainers-go (#4537) 2023-06-04 09:27:43 +03:00
dependabot[bot]
a46839b1ce chore(deps): bump github.com/go-git/go-git/v5 from 5.6.1 to 5.7.0 (#4530) 2023-06-04 09:25:43 +03:00
dependabot[bot]
19715f5de8 chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#4534) 2023-06-04 09:25:04 +03:00
dependabot[bot]
854b63940a chore(deps): bump github.com/sigstore/rekor from 1.2.0 to 1.2.1 (#4533) 2023-06-02 09:36:08 +03:00
dependabot[bot]
59e1a86643 chore(deps): bump alpine from 3.17.3 to 3.18.0 (#4525) 2023-06-02 09:34:44 +03:00
Teppei Fukuda
9ef01133c8 feat: add SBOM analyzer (#4210)
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
2023-06-02 09:34:07 +03:00
DmitriyLewen
dadd1e10c2 fix(sbom): update logic for work with files in spdx format (#4513)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2023-06-01 12:52:56 +03:00
chenk
1a658210a4 feat: azure workload identity support (#4489)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-06-01 10:16:23 +03:00
DmitriyLewen
411862c908 feat(ubuntu): add eol date for 18.04 ESM (#4524) 2023-06-01 09:48:33 +03:00
simar7
62a1aaf031 fix(misconf): Update required extensions for terraformplan (#4523)
Signed-off-by: Simar <simar@linux.com>
2023-06-01 07:23:37 +03:00
Teppei Fukuda
48b2e15c23 refactor(cyclonedx): add intermediate representation (#4490) 2023-06-01 05:50:47 +03:00
simar7
c15f269a99 fix(misconf): Remove debug print while scanning (#4521)
Signed-off-by: Simar <simar@linux.com>
2023-06-01 05:28:37 +03:00
DmitriyLewen
b6ee08e55d fix(java): remove duplicates of jar libs (#4515)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-05-31 15:09:18 +03:00
DmitriyLewen
d4740401a3 fix(java): fix overwriting project props in pom.xml (#4498) 2023-05-31 13:16:28 +03:00
Tung Bui (Leo)
4cf2f94d0d docs: Update compilation instructions (#4512) 2023-05-31 10:47:56 +03:00
DmitriyLewen
18ce1c3363 fix(nodejs): update logic for parsing pnpm lock files (#4502) 2023-05-31 08:41:08 +03:00
DmitriyLewen
87eed38c6c fix(secret): remove aws-account-id rule (#4494) 2023-05-31 07:00:20 +03:00
LaurentiuNiculae
b0c591ef66 feat(oci): add support for referencing an input image by digest (#4470)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
2023-05-31 06:39:42 +03:00
dependabot[bot]
b84b5ecfc2 chore(deps): bump github.com/cloudflare/circl from 1.1.0 to 1.3.3 (#4338) 2023-05-30 18:50:09 +03:00
Tej Singh Rana
305255a497 docs: fixed the format (#4503) 2023-05-30 16:37:06 +03:00
DmitriyLewen
d586de585e fix(java): add support of * for exclusions for pom.xml files (#4501) 2023-05-30 16:34:54 +03:00
Anais Urlichs
de6eef3b00 feat: adding issue template for documentation (#4453) 2023-05-30 12:23:05 +03:00
DmitriyLewen
83a9c4a4cf docs: switch glad to ghsa for Go (#4493) 2023-05-30 09:46:49 +03:00
simar7
537272257b chore(deps): Update defsec to v0.89.0 (#4474) 2023-05-30 06:06:46 +03:00
simar7
6fcd1538d9 feat(misconf): Add terraformplan support (#4342)
* feat(misconf): Add terraformplan support

Fixes: https://github.com/aquasecurity/trivy/issues/4341

Signed-off-by: Simar <simar@linux.com>

* update defsec

* fix lint

Signed-off-by: Simar <simar@linux.com>

* remove debug prints

Signed-off-by: Simar <simar@linux.com>

* update tests

Signed-off-by: Simar <simar@linux.com>

---------

Signed-off-by: Simar <simar@linux.com>
2023-05-29 14:48:26 -06:00
DmitriyLewen
72e302cf81 feat(debian): add digests for dpkg (#4445)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-05-28 10:30:58 +03:00
dependabot[bot]
7e99d08a13 chore(deps): bump github.com/sigstore/rekor from 1.1.1 to 1.2.0 (#4478) 2023-05-28 06:37:30 +03:00
chenk
12a1789be5 feat(k8s): exclude node scanning by node labels (#4459)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-05-25 14:52:28 +03:00
DmitriyLewen
919e8c92b2 docs: add info about multi-line mode for regexp from custom secret rules (#4159) 2023-05-24 14:59:50 +03:00
Teppei Fukuda
50fe43f14c feat(cli): convert JSON reports into a different format (#4452)
Co-authored-by: Aurelien LAJOIE <aurelien.lajoie@kili-technology.com>
2023-05-24 11:45:26 +03:00
DmitriyLewen
09db1d4389 feat(image): add logic to guess base layer for docker-cis scan (#4344) 2023-05-24 10:43:09 +03:00
afdesk
3f0721ff6e fix(cyclonedx): set original names for packages (#4306) 2023-05-23 12:35:52 +03:00
Teppei Fukuda
0ef0dadb16 feat: group subcommands (#4449) 2023-05-23 08:15:39 +03:00
rlubetkin
3a7717fdeb feat(cli): add retry to cache operations (#4189) 2023-05-22 16:56:18 +03:00
AliDatadog
63cfb2714a fix(vuln): report architecture for apk packages (#4247)
Co-authored-by: Sylvain Baubeau <lebauce@gmail.com>
2023-05-22 16:37:00 +03:00
Teppei Fukuda
e1361368a1 refactor: enable cases where return values are not needed in pipeline (#4443) 2023-05-22 08:11:24 +03:00
Mike Poindexter
29b5f7e8ec fix(image): resolve scan deadlock when error occurs in slow mode (#4336) 2023-05-21 10:48:06 +03:00
simar7
92ed344e8a docs(misconf): Update docs for kubernetes file patterns (#4435)
Signed-off-by: Simar <simar@linux.com>
2023-05-21 10:20:15 +03:00
chenk
16af41be15 test: k8s integration tests (#4423)
Signed-off-by: chenk <hen.keinan@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-05-18 22:41:22 +03:00
DmitriyLewen
cab8569cd7 feat(redhat): add package digest for rpm (#4410) 2023-05-18 14:30:00 +03:00
simar7
92f9e98d04 feat(misconf): Add --reset-policy-bundle for policy bundle (#4167) 2023-05-18 11:54:01 +03:00
guangwu
33fb04763d fix: typo (#4431) 2023-05-18 10:09:26 +03:00
DmitriyLewen
8b162f287f add user instruction to imgconf (#4429) 2023-05-18 08:53:34 +03:00
DmitriyLewen
3b7c9198dd fix(k8s): add image sources (#4411) 2023-05-17 07:01:58 +03:00
simar7
c75d35ff61 docs(scanning): Add versioning banner (#4415) 2023-05-17 06:32:17 +03:00
DmitriyLewen
d298415c09 feat(cli): add mage command to update golden integration test files (#4380) 2023-05-16 13:58:50 +03:00
chenk
1a56295ff8 feat: node-collector custom namespace support (#4407)
Signed-off-by: chenk <hen.keinan@gmail.com>
2023-05-16 13:41:01 +03:00
DmitriyLewen
864ad10a38 chore(deps): bump owenrumney/go-sarif from v2.1.3 to v2.2.0 (#4378) 2023-05-16 09:02:15 +03:00
DmitriyLewen
7a20d96227 refactor(sbom): use multiline json for spdx-json format (#4404) 2023-05-16 08:22:07 +03:00
Chris Novakovic
ea5fd75ffe fix(ubuntu): add EOL date for Ubuntu 23.04 (#4347) 2023-05-16 05:21:45 +03:00
guangwu
56a01ec6f7 refactor: code-optimization (#4214) 2023-05-15 14:48:09 +03:00
Peter Engelbert
6a0e152657 feat(image): Add image-src flag to specify which runtime(s) to use (#4047)
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-05-15 14:42:42 +03:00
DmitriyLewen
50c8b418a9 test: skip wrong update of test golden files (#4379) 2023-05-15 11:35:50 +03:00
DmitriyLewen
51ca6536c3 refactor: don't return error for package.json without version/name (#4377) 2023-05-15 11:30:10 +03:00
guangwu
e5e7ebcdab docs: cmd error (#4376) 2023-05-15 08:58:32 +03:00
DmitriyLewen
6ee4960776 test(cli): add test for config file and env combination (#2666)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2023-05-15 08:56:56 +03:00
afdesk
c067b026e0 fix(report): set a correct file location for license scan output (#4326) 2023-05-14 15:27:13 +03:00
afdesk
ff6374829a ci: rpm repository for all versions and aarch64 (#4077)
Co-authored-by: Franco Gil <45880759+realFranco@users.noreply.github.com>
2023-05-14 14:53:25 +03:00
Eugene Bykov
0009b02bb8 chore(alpine): Update Alpine to 3.18 (#4351) 2023-05-14 14:37:35 +03:00
Chris Novakovic
d61ae8cc73 fix(alpine): add EOL date for Alpine 3.18 (#4308) 2023-05-12 13:30:11 +03:00
dependabot[bot]
636ce808fe chore(deps): bump github.com/docker/distribution (#4337) 2023-05-12 07:59:23 +03:00
Teppei Fukuda
e859d10eef feat: allow root break for mapfs (#4094) 2023-05-11 14:41:17 +03:00
simar7
a6ef37fa3d docs(misconf): Remove examples.md (#4256) 2023-05-10 20:41:18 +03:00
afdesk
dca8c039ed fix(ubuntu): update eol dates for Ubuntu (#4258) 2023-05-10 18:10:12 +03:00
DmitriyLewen
b003f58b2c feat(alpine): add digests for apk packages (#4168) 2023-05-10 16:37:50 +03:00
Teppei Fukuda
86f0016165 chore: add discussion templates (#4190) 2023-05-10 12:06:37 +03:00
simar7
2f318ce97d fix(terraform): Support tfvars (#4123) 2023-05-10 11:18:19 +03:00
Teppei Fukuda
ec3906c24e chore: separate docs:generate (#4242) 2023-05-10 09:08:31 +03:00
dependabot[bot]
37b25d28b2 chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#4246) 2023-05-10 09:06:23 +03:00
Teppei Fukuda
45d5edb0d7 refactor: define vulnerability scanner interfaces (#4117) 2023-05-09 22:25:08 +03:00
chenk
090a00e717 feat: unified k8s scan resources (#4188) 2023-05-09 16:52:02 +03:00
simar7
f2188eb56d chore(deps): Update defsec to v0.88.1 (#4178) 2023-05-09 16:34:29 +03:00
dependabot[bot]
b79850f416 chore(deps): bump github.com/alicebob/miniredis/v2 from 2.30.1 to 2.30.2 (#4141) 2023-05-09 16:01:12 +03:00
guangwu
36acdfa8db chore: trivy bin ignore (#4212) 2023-05-09 12:03:47 +03:00
Teppei Fukuda
55fb723a6e feat(image): enforce image platform (#4083) 2023-05-08 21:04:22 +03:00
dependabot[bot]
9c87cb2710 chore(deps): bump github.com/owenrumney/go-sarif/v2 from 2.1.2 to 2.1.3 (#4143) 2023-05-08 12:07:30 +03:00
dependabot[bot]
21cf179f6b chore(deps): bump github.com/docker/docker (#4144) 2023-05-07 21:56:16 +03:00
dependabot[bot]
fbf7a77aee chore(deps): bump github.com/hashicorp/golang-lru/v2 from 2.0.1 to 2.0.2 (#4146) 2023-05-07 21:55:24 +03:00
dependabot[bot]
547391c224 chore(deps): bump aquaproj/aqua-installer from 2.0.2 to 2.1.1 (#4140) 2023-05-05 12:59:49 +03:00
DmitriyLewen
882bfdd782 fix(ubuntu): fix version selection logic for ubuntu esm (#4171) 2023-05-05 12:59:02 +03:00
dependabot[bot]
949cd10c0c chore(deps): bump github.com/samber/lo from 1.37.0 to 1.38.1 (#4147) 2023-05-05 12:56:59 +03:00
dependabot[bot]
93bc162ca5 chore(deps): bump github.com/hashicorp/go-getter from 1.7.0 to 1.7.1 (#4145) 2023-05-04 15:06:52 +03:00
dependabot[bot]
57993ef673 chore(deps): bump sigstore/cosign-installer from 3.0.1 to 3.0.3 (#4138) 2023-05-04 13:55:10 +03:00
dependabot[bot]
dc4baeb359 chore(deps): bump github.com/testcontainers/testcontainers-go (#4150) 2023-05-04 13:53:27 +03:00
second-frank
25d0255dc3 chore: install.sh support for windows (#4155) 2023-05-04 13:48:58 +03:00
dependabot[bot]
73e54549f1 chore(deps): bump github.com/sigstore/rekor from 1.1.0 to 1.1.1 (#4166) 2023-05-04 13:44:02 +03:00
dependabot[bot]
08de7c613f chore(deps): bump golang.org/x/crypto from 0.7.0 to 0.8.0 (#4149) 2023-05-03 12:23:58 +03:00
Anais Urlichs
ade4730fa7 docs: moving skipping files out of others (#4154)
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
2023-05-03 12:23:21 +03:00
566 changed files with 25313 additions and 10147 deletions

19
.github/CODEOWNERS vendored
View File

@@ -1,24 +1,15 @@
# Global
* @knqyf263
# Docs
/docs/** @knqyf263 @AnaisUrlichs @itaysk
/mkdocs.yml @knqyf263 @AnaisUrlichs @itaysk
/README.md @knqyf263 @AnaisUrlichs @itaysk
# Misconfiguration scanning
docs/docs/scanner/misconfiguration @knqyf263 @simar7
docs/docs/target/aws.md @knqyf263 @simar7
pkg/fanal/analyzer/config @knqyf263 @simar7
pkg/cloud @knqyf263 @simar7
# Helm chart
helm/trivy/ @chen-keinan
# Misconfiguration scanning
examples/misconf/ @knqyf263
docs/docs/misconfiguration @knqyf263
docs/docs/cloud @knqyf263
pkg/fanal/analyzer/config @knqyf263
pkg/fanal/handler/misconf @knqyf263
pkg/cloud @knqyf263
pkg/flag/aws_flags.go @knqyf263
pkg/flag/misconf_flags.go @knqyf263
# Kubernetes scanning
pkg/k8s/ @josedonizetti @chen-keinan @knqyf263
docs/docs/kubernetes/ @josedonizetti @chen-keinan @knqyf263

124
.github/DISCUSSION_TEMPLATE/bugs.yml vendored Normal file
View File

@@ -0,0 +1,124 @@
labels: ["kind/bug"]
body:
- type: markdown
attributes:
value: |
#### Note
Feel free to raise a bug report if something doesn't work as expected.
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
If you see any false positives or false negatives, please file a ticket [here](https://github.com/aquasecurity/trivy/discussions/new?category=false-detection).
**Do not open a GitHub issue, please.** Maintainers triage discussions and then create issues.
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
- type: textarea
attributes:
label: Description
description: Briefly describe the problem you are having in a few paragraphs.
validations:
required: true
- type: textarea
attributes:
label: Desired Behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: What happened instead?
validations:
required: true
- type: textarea
attributes:
label: Reproduction Steps
description: How do you trigger this bug? Please walk us through it step by step.
value: |
1.
2.
3.
...
render: bash
validations:
required: true
- type: dropdown
attributes:
label: Target
description: Which target are you scanning? It is equal to which subcommand you are using.
options:
- Container Image
- Filesystem
- Git Repository
- Virtual Machine Image
- Kubernetes
- AWS
- SBOM
validations:
required: false
- type: dropdown
attributes:
label: Scanner
description: Which scanner are you using?
options:
- Vulnerability
- Misconfiguration
- Secret
- License
validations:
required: false
- type: dropdown
attributes:
label: Output Format
description: Which output format are you using?
options:
- Table
- JSON
- Template
- SARIF
- CycloneDX
- SPDX
validations:
required: false
- type: dropdown
attributes:
label: Mode
description: Which mode are you using? Specify "Standalone" if you are not using `trivy server`.
options:
- Standalone
- Client/Server
validations:
required: false
- type: textarea
attributes:
label: Debug Output
description: Output of run with `--debug`
placeholder: "$ trivy <target> <subject> --debug"
render: bash
validations:
required: true
- type: input
attributes:
label: Operating System
description: On what operating system are you running Trivy?
placeholder: "e.g. macOS Big Sur"
validations:
required: true
- type: textarea
attributes:
label: Version
description: Output of `trivy --version`
placeholder: "$ trivy --version"
render: bash
validations:
required: true
- type: checkboxes
attributes:
label: Checklist
description: Have you tried the following?
options:
- label: Run `trivy image --reset`
- label: Read [the troubleshooting](https://aquasecurity.github.io/trivy/latest/docs/references/troubleshooting/)
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).

View File

@@ -0,0 +1,28 @@
labels: ["kind/documentation"]
body:
- type: markdown
attributes:
value: |
#### Note
Feel free to create a docs report if something doesn't work as expected or is unclear in the documentation.
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
- type: textarea
attributes:
label: Description
description: Briefly describe the what has been unclear in the existing documentation
validations:
required: true
- type: textarea
attributes:
label: Link
description: Please provide a link to the current documentation or where you thought to find the information you were looking for
validations:
required: false
- type: textarea
attributes:
label: Suggestions
description: What would you like to have added or changed in the documentation?
validations:
required: true

View File

@@ -0,0 +1,96 @@
body:
- type: markdown
attributes:
value: |
#### Note
Feel free to raise a bug report if something doesn't work as expected.
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
**Do not open a GitHub issue, please.** Maintainers triage discussions and then create issues.
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
- type: input
attributes:
label: IDs
description: List the IDs of vulnerabilities, misconfigurations, secrets, or licenses that are either not detected or mistakenly detected.
placeholder: "e.g. CVE-2021-44228, CVE-2022-22965"
validations:
required: true
- type: textarea
attributes:
label: Description
description: Describe the false detection.
validations:
required: true
- type: textarea
attributes:
label: Reproduction Steps
description: How do you trigger this bug? Please walk us through it step by step.
value: |
1.
2.
3.
...
render: bash
validations:
required: true
- type: dropdown
attributes:
label: Target
description: Which target are you scanning? It is equal to which subcommand you are using.
options:
- Container Image
- Filesystem
- Git Repository
- Virtual Machine Image
- Kubernetes
- AWS
- SBOM
validations:
required: true
- type: dropdown
attributes:
label: Scanner
description: Which scanner are you using?
options:
- Vulnerability
- Misconfiguration
- Secret
- License
validations:
required: true
- type: input
attributes:
label: Target OS
description: What operating system are you scanning? Fill in this field if the scanning target is an operating system.
placeholder: "Example: Ubuntu 22.04"
validations:
required: false
- type: textarea
attributes:
label: Debug Output
description: Output of run with `--debug`
placeholder: "$ trivy <target> <subject> --debug"
render: bash
validations:
required: true
- type: textarea
attributes:
label: Version
description: Output of `trivy --version`
placeholder: "$ trivy --version"
render: bash
validations:
required: true
- type: checkboxes
attributes:
label: Checklist
options:
- label: Read [the documentation regarding wrong detection](https://aquasecurity.github.io/trivy/dev/community/contribute/discussion/#false-detection)
- label: Ran Trivy with `-f json` that shows data sources and confirmed that the security advisory in data sources was correct
validations:
required: true
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).

47
.github/DISCUSSION_TEMPLATE/ideas.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
labels: ["kind/feature"]
body:
- type: markdown
attributes:
value: |
#### Note
Feel free to share your idea.
Please ensure that you're not creating a duplicate ticket by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
**Do not open a GitHub issue, please.** Maintainers triage discussions and then create issues.
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
- type: textarea
attributes:
label: Description
description: Describe your idea.
validations:
required: true
- type: dropdown
attributes:
label: Target
description: Which target is your idea related to?
options:
- Container Image
- Filesystem
- Git Repository
- Virtual Machine Image
- Kubernetes
- AWS
- SBOM
validations:
required: false
- type: dropdown
attributes:
label: Scanner
description: Which scanner is your idea related to?
options:
- Vulnerability
- Misconfiguration
- Secret
- License
validations:
required: false
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).

84
.github/DISCUSSION_TEMPLATE/q-a.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
labels: ["triage/support"]
body:
- type: markdown
attributes:
value: |
#### Note
If you have any troubles/questions, feel free to ask.
Please ensure that you're not asking a duplicate question by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
**Do not open a GitHub issue, please.** Maintainers triage discussions and then create issues.
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
- type: textarea
attributes:
label: Question
description: What kind of problem are you facing? Or, what questions do you have?
validations:
required: true
- type: dropdown
attributes:
label: Target
description: Which target are you scanning? It is equal to which subcommand you are using.
options:
- Container Image
- Filesystem
- Git Repository
- Virtual Machine Image
- Kubernetes
- AWS
- SBOM
validations:
required: false
- type: dropdown
attributes:
label: Scanner
description: Which scanner are you using?
options:
- Vulnerability
- Misconfiguration
- Secret
- License
validations:
required: false
- type: dropdown
attributes:
label: Output Format
description: Which output format are you using?
options:
- Table
- JSON
- Template
- SARIF
- CycloneDX
- SPDX
validations:
required: false
- type: dropdown
attributes:
label: Mode
description: Which mode are you using? Specify "Standalone" if you are not using `trivy server`.
options:
- Standalone
- Client/Server
validations:
required: false
- type: input
attributes:
label: Operating System
description: What operating system are you using?
placeholder: "Example: macOS Big Sur"
validations:
required: false
- type: textarea
attributes:
label: Version
description: Output of `trivy --version`
placeholder: "$ trivy --version"
render: bash
validations:
required: false
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).

View File

@@ -1,31 +0,0 @@
---
name: Bug Report
labels: kind/bug
about: If something isn't working as expected.
---
## Description
<!--
Briefly describe the problem you are having in a few paragraphs.
-->
## What did you expect to happen?
## What happened instead?
## Output of run with `--debug`:
```
(paste your output here)
```
## Output of `trivy -v`:
```
(paste your output here)
```
## Additional details (base image name, container registry info...):

View File

@@ -1,9 +0,0 @@
---
name: Feature Request
labels: kind/feature
about: I have a suggestion (and might want to implement myself)!
---
<!--
If this is a FEATURE REQUEST, request format does not matter!
-->

View File

@@ -1,10 +0,0 @@
---
name: Support Question
labels: triage/support
about: If you have a question about Trivy.
---
<!--
If you have a trouble, feel free to ask.
Make sure you're not asking duplicate question by searching on the issues lists.
-->

View File

@@ -1,33 +0,0 @@
---
name: Wrong Detection
labels: ["kind/bug"]
about: If Trivy doesn't detect something, or shows false positive detection
---
## Checklist
- [ ] I've read [the documentation regarding wrong detection](https://aquasecurity.github.io/trivy/latest/community/contribute/issue/#wrong-detection).
- [ ] I've confirmed that a security advisory in data sources was correct.
- Run Trivy with `-f json` that shows data sources and make sure that the security advisory is correct.
## Description
<!--
Briefly describe the CVE that aren't detected and information about artifacts with this CVE.
-->
## JSON Output of run with `-debug`:
```
(paste your output here)
```
## Output of `trivy -v`:
```
(paste your output here)
```
## Additional details (base image name, container registry info...):

17
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: Report a false detection
url: https://github.com/aquasecurity/trivy/discussions/new?category=false-detection
about: Report false positives/negatives
- name: Report a bug
url: https://github.com/aquasecurity/trivy/discussions/new?category=bugs
about: Report bugs
- name: Enhance documentation
url: https://github.com/aquasecurity/trivy/discussions/new?category=documentation
about: Make suggestions to the documentation
- name: Request a feature enhancement
url: https://github.com/aquasecurity/trivy/discussions/new?category=ideas
about: Share ideas for new features
- name: Ask the community for help
url: https://github.com/aquasecurity/trivy/discussions/new?category=q-a
about: Ask questions and discuss with other community members

12
.github/workflows/bypass-cla.yaml vendored Normal file
View File

@@ -0,0 +1,12 @@
# This workflow is used to bypass the required status checks in merge queue.
# cf. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks
name: CLA
on:
merge_group:
jobs:
cla:
name: license/cla
runs-on: ubuntu-latest
steps:
- run: 'echo "No test required"'

31
.github/workflows/bypass-test.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
# This workflow is used to bypass the required status checks.
# cf. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks
name: Test
on:
push:
paths:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
pull_request:
paths:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
jobs:
test:
name: Test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- run: 'echo "No test required"'
integration:
name: Integration Test
runs-on: ubuntu-latest
steps:
- run: 'echo "No test required"'

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
persist-credentials: true

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
persist-credentials: true

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Install Helm
@@ -37,7 +37,7 @@ jobs:
id: lint
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76
- name: Setup Kubernetes cluster (KIND)
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140
with:
version: ${{ env.KIND_VERSION }}
image: ${{ env.KIND_IMAGE }}
@@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Install chart-releaser

View File

@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
@@ -35,7 +35,7 @@ jobs:
sudo apt-get -y install rpm reprepro createrepo-c distro-info
- name: Checkout trivy-repo
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
repository: ${{ github.repository_owner }}/trivy-repo
path: trivy-repo

View File

@@ -26,8 +26,17 @@ jobs:
packages: write # For GHCR
contents: read # Not required for public repositories, but for clarity
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v7
with:
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
remove-android: 'true'
remove-docker-images: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
- name: Cosign install
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65
uses: sigstore/cosign-installer@a5d81fb6bdbcbb3d239e864d6552820420254494
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -60,7 +69,7 @@ jobs:
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
@@ -70,7 +79,7 @@ jobs:
go-version-file: go.mod
- name: Generate SBOM
uses: CycloneDX/gh-gomod-generate-sbom@v1
uses: CycloneDX/gh-gomod-generate-sbom@v2
with:
args: mod -licenses -json -output bom.json
version: ^v1

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
- name: Run Trivy vulnerability scanner and create GitHub issues
uses: knqyf263/trivy-issue-action@v0.0.5

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
persist-credentials: true

View File

@@ -1,8 +1,9 @@
name: Test
on:
push:
branches:
- main
branches-ignore:
- 'main'
- 'gh-readonly-queue/**'
paths-ignore:
- '**.md'
- 'docs/**'
@@ -14,6 +15,7 @@ on:
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
merge_group:
jobs:
test:
name: Test
@@ -22,7 +24,7 @@ jobs:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
@@ -39,7 +41,7 @@ jobs:
if: matrix.operating-system == 'ubuntu-latest'
- name: Lint
uses: golangci/golangci-lint-action@v3.4.0
uses: golangci/golangci-lint-action@v3.6.0
with:
version: v1.52
args: --deadline=30m
@@ -47,7 +49,7 @@ jobs:
if: matrix.operating-system == 'ubuntu-latest'
- name: Install tools
uses: aquaproj/aqua-installer@v2.0.2
uses: aquaproj/aqua-installer@v2.1.2
with:
aqua_version: v1.25.0
aqua_opts: ""
@@ -69,7 +71,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
@@ -77,19 +79,19 @@ jobs:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.0.2
uses: aquaproj/aqua-installer@v2.1.2
with:
aqua_version: v1.25.0
- name: Run integration tests
run: mage test:integration
module-test:
name: Module Integration Test
k8s-integration:
name: K8s Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
@@ -97,7 +99,27 @@ jobs:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.0.2
uses: aquaproj/aqua-installer@v2.1.2
with:
aqua_version: v1.25.0
- name: Run k8s integration tests
run: mage test:k8s
module-test:
name: Module Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.1.2
with:
aqua_version: v1.25.0
@@ -106,34 +128,56 @@ jobs:
run: |
mage test:module
vm-test:
name: VM Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.1.2
with:
aqua_version: v1.25.0
- name: Run vm integration tests
run: |
mage test:vm
build-test:
name: Build Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Show available Docker Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Determine GoReleaser ID
id: goreleaser_id
shell: bash
run: |
if [ "${{ matrix.operating-system }}" == "windows-latest" ]; then
echo "id=--id build-windows" >> $GITHUB_OUTPUT
elif [ "${{ matrix.operating-system }}" == "macos-latest" ]; then
echo "id=--id build-macos --id build-bsd" >> $GITHUB_OUTPUT
else
echo "id=--id build-linux" >> $GITHUB_OUTPUT
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.16.2
args: release --skip-sign --snapshot --clean --skip-publish --timeout 90m
env:
GPG_FILE: "nogpg.key"
args: build --snapshot --clean --timeout 90m ${{ steps.goreleaser_id.outputs.id }}

View File

@@ -1,36 +0,0 @@
name: VM Test
on:
push:
branches:
- main
paths:
- 'pkg/fanal/vm/**'
- 'pkg/fanal/walker/vm.go'
- 'pkg/fanal/artifact/vm/**'
- 'integration/vm_test.go'
pull_request:
paths:
- 'pkg/fanal/vm/**'
- 'pkg/fanal/walker/vm.go'
- 'pkg/fanal/artifact/vm/**'
- 'integration/vm_test.go'
jobs:
vm-test:
name: VM Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.0.2
with:
aqua_version: v1.25.0
- name: Run vm integration tests
run: |
mage test:vm

1
.gitignore vendored
View File

@@ -38,3 +38,4 @@ dist
# Signing
gpg.key
cmd/trivy/trivy

View File

@@ -1,4 +1,4 @@
FROM alpine:3.17.3
FROM alpine:3.18.2
RUN apk --no-cache add ca-certificates git
COPY trivy /usr/local/bin/trivy
COPY contrib/*.tpl contrib/

View File

@@ -1,4 +1,4 @@
FROM alpine:3.17.3
FROM alpine:3.18.2
RUN apk --no-cache add ca-certificates git
# binaries were created with GoReleaser

View File

@@ -1,4 +1,4 @@
FROM golang:1.19
FROM --platform=linux/amd64 golang:1.19
# Install protoc (cf. http://google.github.io/proto-lens/installing-protoc.html)
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip

View File

@@ -31,6 +31,8 @@ Scanners (what Trivy can find there):
- Sensitive information and secrets
- Software licenses
Trivy supports most popular programming languages, operating systems, and platforms. For a complete list, see the [Scanning Coverage] page.
To learn more, go to the [Trivy homepage][homepage] for feature highlights, or to the [Documentation site][docs] for detailed information.
## Quick Start
@@ -103,11 +105,21 @@ trivy k8s --report summary cluster
`tri` is pronounced like **tri**gger, `vy` is pronounced like en**vy**.
---
## Want more? Check out Aqua
If you liked Trivy, you will love Aqua which builds on top of Trivy to provide even more enhanced capabilities for a complete security management offering.
You can find a high level comparison table specific to Trivy users [here](https://github.com/aquasecurity/resources/blob/main/trivy-aqua.md).
In addition check out the <https://aquasec.com> website for more information about our products and services.
If you'd like to contact Aqua or request a demo, please use this form: <https://www.aquasec.com/demo>
## Community
Trivy is an [Aqua Security][aquasec] open source project.
Learn about our open source work and portfolio [here][oss].
Contact us about any matter by opening a GitHub Discussion [here][discussions]
Join our [Slack community][slack] to stay up to date with community efforts.
Please ensure to abide by our [Code of Conduct][code-of-conduct] during all interactions.
[test]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml
[test-img]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml/badge.svg
@@ -122,9 +134,12 @@ Contact us about any matter by opening a GitHub Discussion [here][discussions]
[homepage]: https://trivy.dev
[docs]: https://aquasecurity.github.io/trivy
[pronunciation]: #how-to-pronounce-the-name-trivy
[slack]: https://slack.aquasec.com
[code-of-conduct]: https://github.com/aquasecurity/community/blob/main/CODE_OF_CONDUCT.md
[Installation]:https://aquasecurity.github.io/trivy/latest/getting-started/installation/
[Ecosystem]: https://aquasecurity.github.io/trivy/latest/ecosystem/
[Scanning Coverage]: https://aquasecurity.github.io/trivy/latest/getting-started/coverage/
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
[rego]: https://www.openpolicyagent.org/docs/latest/#rego

10
SECURITY.md Normal file
View File

@@ -0,0 +1,10 @@
# Security Policy
## Supported Versions
This is an open source project that is provided as-is without warrenty or liability.
As such no supportability commitment. The maintainers will do the best they can to address any report promptly and responsibly.
## Reporting a Vulnerability
Please use the "Private vulnerability reporting" feature in the GitHub repository (under the "Security" tab).

View File

@@ -7,7 +7,6 @@ cd trivy-repo/deb
for release in ${DEBIAN_RELEASES[@]} ${UBUNTU_RELEASES[@]}; do
echo "Removing deb package of $release"
reprepro -A i386 remove $release trivy
reprepro -A amd64 remove $release trivy
reprepro -A arm64 remove $release trivy
done
@@ -15,7 +14,6 @@ done
for release in ${DEBIAN_RELEASES[@]} ${UBUNTU_RELEASES[@]}; do
echo "Adding deb package to $release"
reprepro includedeb $release ../../dist/*Linux-64bit.deb
reprepro includedeb $release ../../dist/*Linux-32bit.deb
reprepro includedeb $release ../../dist/*Linux-ARM64.deb
done

View File

@@ -2,6 +2,25 @@
TRIVY_VERSION=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
function create_common_rpm_repo () {
rpm_path=$1
ARCHES=("x86_64" "aarch64")
for arch in ${ARCHES[@]}; do
prefix=$arch
if [ "$arch" == "x86_64" ]; then
prefix="64bit"
elif [ "$arch" == "aarch64" ]; then
prefix="ARM64"
fi
mkdir -p $rpm_path/$arch
cp ../dist/*${prefix}.rpm ${rpm_path}/$arch/
createrepo_c -u https://github.com/aquasecurity/trivy/releases/download/ --location-prefix="v"$TRIVY_VERSION --update $rpm_path/$arch
rm ${rpm_path}/$arch/*${prefix}.rpm
done
}
function create_rpm_repo () {
version=$1
rpm_path=rpm/releases/${version}/x86_64
@@ -18,6 +37,9 @@ echo "Create RPM releases for Trivy v$TRIVY_VERSION"
cd trivy-repo
echo "Processing common repository for RHEL/CentOS..."
create_common_rpm_repo rpm/releases
VERSIONS=(5 6 7 8 9)
for version in ${VERSIONS[@]}; do
echo "Processing RHEL/CentOS $version..."

View File

@@ -75,10 +75,12 @@ get_binaries() {
linux/ppc64le) BINARIES="trivy" ;;
linux/arm64) BINARIES="trivy" ;;
linux/armv7) BINARIES="trivy" ;;
linux/s390x) BINARIES="trivy" ;;
openbsd/386) BINARIES="trivy" ;;
openbsd/amd64) BINARIES="trivy" ;;
openbsd/arm64) BINARIES="trivy" ;;
openbsd/armv7) BINARIES="trivy" ;;
windows/amd64) BINARIES="trivy" ;;
*)
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
exit 1
@@ -102,6 +104,9 @@ tag_to_version() {
}
adjust_format() {
# change format (tar.gz or zip) based on OS
case ${OS} in
windows) FORMAT=zip ;;
esac
true
}
adjust_os() {
@@ -111,7 +116,8 @@ adjust_os() {
amd64) OS=64bit ;;
arm) OS=ARM ;;
arm64) OS=ARM64 ;;
ppc64le) OS=PPC64LE ;;
ppc64le) OS=Linux ;;
s390x) OS=Linux ;;
darwin) OS=macOS ;;
dragonfly) OS=DragonFlyBSD ;;
freebsd) OS=FreeBSD ;;
@@ -129,7 +135,8 @@ adjust_arch() {
arm) ARCH=ARM ;;
armv7) ARCH=ARM ;;
arm64) ARCH=ARM64 ;;
ppc64le) OS=PPC64LE ;;
ppc64le) ARCH=PPC64LE ;;
s390x) ARCH=s390x ;;
darwin) ARCH=macOS ;;
dragonfly) ARCH=DragonFlyBSD ;;
freebsd) ARCH=FreeBSD ;;
@@ -218,6 +225,7 @@ uname_arch() {
armv5*) arch="armv5" ;;
armv6*) arch="armv6" ;;
armv7*) arch="armv7" ;;
s390*) arch="s390x" ;;
esac
echo ${arch}
}

View File

@@ -0,0 +1,49 @@
# Discussions
Thank you for taking interest in contributing to Trivy!
Trivy uses [GitHub Discussion](https://github.com/aquasecurity/trivy/discussions) for bug reports, feature requests, and questions.
If maintainers decide to accept a new feature or confirm that it is a bug, they will close the discussion and create a [GitHub Issue](https://github.com/aquasecurity/trivy/issues) associated with that discussion.
- Feel free to open discussions for any reason. When you open a new discussion, you'll have to select a discussion category as described below.
- Please spend a small amount of time giving due diligence to the issue/discussion tracker. Your discussion might be a duplicate. If it is, please add your comment to the existing issue/discussion.
- Remember that users might search for your issue/discussion in the future, so please give it a meaningful title to help others.
- The issue should clearly explain the reason for opening, the proposal if you have any, and any relevant technical information.
There are 4 categories:
- 💡 [Ideas](https://github.com/aquasecurity/trivy/discussions/categories/ideas)
- Share ideas for new features
- 🔎 [False Detection](https://github.com/aquasecurity/trivy/discussions/categories/false-detection)
- Report false positives/negatives
- 🐛 [Bugs](https://github.com/aquasecurity/trivy/discussions/categories/bugs)
- Report something that is not working as expected
- 🙏 [Q&A](https://github.com/aquasecurity/trivy/discussions/categories/q-a)
- Ask the community for help
!!! note
If you find any false positives or false negatives, please make sure to report them under the "False Detection" category, not "Bugs".
## False detection
Trivy depends on [multiple data sources](https://aquasecurity.github.io/trivy/latest/docs/vulnerability/detection/data-source/).
Sometime these databases contain mistakes.
If Trivy can't detect any CVE-IDs or shows false positive result, at first please follow the next steps:
1. Run Trivy with `-f json` that shows data sources.
2. According to the shown data source, make sure that the security advisory in the data source is correct.
If the data source is correct and Trivy shows wrong results, please raise an issue on Trivy.
### GitHub Advisory Database
Visit [here](https://github.com/advisories) and search CVE-ID.
If you find a problem, it'll be nice to fix it: [How to contribute to a GitHub security advisory](https://github.blog/2022-02-22-github-advisory-database-now-open-to-community-contributions/)
### GitLab Advisory Database
Visit [here](https://advisories.gitlab.com/) and search CVE-ID.
If you find a problem, it'll be nice to fix it: [Create an issue to GitLab Advisory Database](https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/issues/new)
### Red Hat CVE Database
Visit [here](https://access.redhat.com/security/security-updates/?cwe=476#/cve) and search CVE-ID.

View File

@@ -1,31 +1,4 @@
# Issues
Thank you for taking interest in contributing to Trivy!
- Feel free to open issues for any reason. When you open a new issue, you'll have to select an issue kind: bug/feature/support and fill the required information based on the selected template.
- Please spend a small amount of time giving due diligence to the issue tracker. Your issue might be a duplicate. If it is, please add your comment to the existing issue.
- Remember that users might search for your issue in the future, so please give it a meaningful title to help others.
- The issue should clearly explain the reason for opening, the proposal if you have any, and any relevant technical information.
## Wrong detection
Trivy depends on [multiple data sources](https://aquasecurity.github.io/trivy/latest/docs/vulnerability/detection/data-source/).
Sometime these databases contain mistakes.
If Trivy can't detect any CVE-IDs or shows false positive result, at first please follow the next steps:
1. Run Trivy with `-f json` that shows data sources.
2. According to the shown data source, make sure that the security advisory in the data source is correct.
If the data source is correct and Trivy shows wrong results, please raise an issue on Trivy.
### GitHub Advisory Database
Visit [here](https://github.com/advisories) and search CVE-ID.
If you find a problem, it'll be nice to fix it: [How to contribute to a GitHub security advisory](https://github.blog/2022-02-22-github-advisory-database-now-open-to-community-contributions/)
### GitLab Advisory Database
Visit [here](https://advisories.gitlab.com/) and search CVE-ID.
If you find a problem, it'll be nice to fix it: [Create an issue to GitLab Advisory Database](https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/issues/new)
### Red Hat CVE Database
Visit [here](https://access.redhat.com/security/security-updates/?cwe=476#/cve) and search CVE-ID.
Trivy uses [GitHub Discussion](./discussion.md) for bug reports, feature requests, and questions.

View File

@@ -2,7 +2,7 @@
Trivy provides various methods for filtering the results.
## Hide Unfixed Vulnerabilities
## By Status
| Scanner | Supported |
|:----------------:|:---------:|
@@ -11,53 +11,70 @@ Trivy provides various methods for filtering the results.
| Secret | |
| License | |
By default, `Trivy` also detects unpatched/unfixed vulnerabilities.
This means you can't fix these vulnerabilities even if you update all packages.
If you would like to ignore them, use the `--ignore-unfixed` option.
Trivy supports the following vulnerability statuses:
- `unknown`
- `not_affected`: this package is not affected by this vulnerability on this platform
- `affected`: this package is affected by this vulnerability on this platform, but there is no patch released yet
- `fixed`: this vulnerability is fixed on this platform
- `under_investigation`: it is currently unknown whether or not this vulnerability affects this package on this platform, and it is under investigation
- `will_not_fix`: this package is affected by this vulnerability on this platform, but there is currently no intention to fix it (this would primarily be for flaws that are of Low or Moderate impact that pose no significant risk to customers)
- `fix_deferred`: this package is affected by this vulnerability on this platform, and may be fixed in the future
- `end_of_life`: this package has been identified to contain the impacted component, but analysis to determine whether it is affected or not by this vulnerability was not performed
Note that vulnerabilities with the `unknown`, `not_affected` or `under_investigation` status are not detected.
These are only defined for comprehensiveness, and you will not have the opportunity to specify these statuses.
Some statuses are supported in limited distributions.
| OS | Fixed | Affected | Under Investigation | Will Not Fix | Fix Deferred | End of Life |
|:----------:|:-----:|:--------:|:-------------------:|:------------:|:------------:|:-----------:|
| Debian | ✓ | ✓ | | | ✓ | ✓ |
| RHEL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Other OSes | ✓ | ✓ | | | | |
To ignore vulnerabilities with specific statuses, use the `--ignore-status <list_of_statuses>` option.
```bash
$ trivy image --ignore-unfixed ruby:2.4.0
$ trivy image --ignore-status affected,fixed ruby:2.4.0
```
<details>
<summary>Result</summary>
```
2019-05-16T12:49:52.656+0900 INFO Updating vulnerability database...
2019-05-16T12:50:14.786+0900 INFO Detecting Debian vulnerabilities...
ruby:2.4.0 (debian 8.7)
=======================
Total: 4730 (UNKNOWN: 1, LOW: 145, MEDIUM: 3487, HIGH: 1014, CRITICAL: 83)
Total: 527 (UNKNOWN: 0, LOW: 276, MEDIUM: 83, HIGH: 158, CRITICAL: 10)
+------------------------------+------------------+----------+----------------------------+----------------------------------+-----------------------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+------------------------------+------------------+----------+----------------------------+----------------------------------+-----------------------------------------------------+
| apt | CVE-2019-3462 | CRITICAL | 1.0.9.8.3 | 1.0.9.8.5 | Incorrect sanitation of the |
| | | | | | 302 redirect field in HTTP |
| | | | | | transport method of... |
+ +------------------+----------+ +----------------------------------+-----------------------------------------------------+
| | CVE-2016-1252 | MEDIUM | | 1.0.9.8.4 | The apt package in Debian |
| | | | | | jessie before 1.0.9.8.4, in |
| | | | | | Debian unstable before... |
+------------------------------+------------------+----------+----------------------------+----------------------------------+-----------------------------------------------------+
| bash | CVE-2019-9924 | HIGH | 4.3-11 | 4.3-11+deb8u2 | bash: BASH_CMD is writable in |
| | | | | | restricted bash shells |
+ +------------------+ + +----------------------------------+-----------------------------------------------------+
| | CVE-2016-7543 | | | 4.3-11+deb8u1 | bash: Specially crafted |
| | | | | | SHELLOPTS+PS4 variables allows |
| | | | | | command substitution |
+ +------------------+----------+ + +-----------------------------------------------------+
| | CVE-2016-0634 | MEDIUM | | | bash: Arbitrary code execution |
| | | | | | via malicious hostname |
+ +------------------+----------+ +----------------------------------+-----------------------------------------------------+
| | CVE-2016-9401 | LOW | | 4.3-11+deb8u2 | bash: popd controlled free |
+------------------------------+------------------+----------+----------------------------+----------------------------------+-----------------------------------------------------+
┌─────────────────────────────┬──────────────────┬──────────┬──────────────┬────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
Library │ Vulnerability │ Severity │ Status │ Installed Version Fixed Version │ Title
├─────────────────────────────┼──────────────────┼──────────┼──────────────┼────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ binutils CVE-2014-9939 CRITICAL │ will_not_fix │ 2.25-5 │ binutils: buffer overflow in ihex.c
│ │ │ https://avd.aquasec.com/nvd/cve-2014-9939
├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
│ CVE-2017-6969 │ │ │ │ binutils: Heap-based buffer over-read in readelf when │
│ │ │ │ processing corrupt RL78 binaries
│ https://avd.aquasec.com/nvd/cve-2017-6969
├──────────────────┤ │ │ ├───────────────┼──────────────────────────────────────────────────────────────┤
...
```
</details>
!!! tip
To skip all unfixed vulnerabilities, you can use the `--ignore-unfixed` flag .
It is a shorthand of `-ignore-status affected,will_not_fix,fix_deferred,end_of_life`.
It displays "fixed" vulnerabilities only.
```bash
$ trivy image --ignore-unfixed ruby:2.4.0
```
## By Severity
| Scanner | Supported |

View File

@@ -17,88 +17,6 @@ If you don't need secret scanning, it can be disabled.
$ trivy image --scanners vuln alpine:3.15
```
## Skip Files
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | ✓ |
| License | ✓ |
By default, Trivy traverses directories and searches for all necessary files for scanning.
You can skip files that you don't maintain using the `--skip-files` flag.
```
$ trivy image --skip-files "/Gemfile.lock" --skip-files "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0/Gemfile.lock" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
```
It's possible to specify globs as part of the value.
```bash
$ trivy image --skip-files "./testdata/*/bar" .
```
Will skip any file named `bar` in the subdirectories of testdata.
## Skip Directories
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | ✓ |
| License | ✓ |
By default, Trivy traverses directories and searches for all necessary files for scanning.
You can skip directories that you don't maintain using the `--skip-dirs` flag.
```
$ trivy image --skip-dirs /var/lib/gems/2.5.0/gems/fluent-plugin-detect-exceptions-0.0.13 --skip-dirs "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
```
It's possible to specify globs as part of the value.
```bash
$ trivy image --skip-dirs "./testdata/*" .
```
Will skip all subdirectories of the testdata directory.
!!! tip
Glob patterns work with any trivy subcommand (image, config, etc.) and can be specified to skip both directories (with `--skip-dirs`) and files (with `--skip-files`).
### Advanced globbing
Trivy also supports the [globstar](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Pattern-Matching) pattern matching.
```bash
$ trivy image --skip-files "**/foo"``` image:tag
```
Will skip the file `foo` that happens to be nested under any parent(s).
## File patterns
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | |
| License | |
When a directory is given as an input, Trivy will recursively look for and test all files based on file patterns.
The default file patterns are [here](../scanner/misconfiguration/custom/index.md).
In addition to the default file patterns, the `--file-patterns` option takes regexp patterns to look for your files.
For example, it may be useful when your file name of Dockerfile doesn't match the default patterns.
This can be repeated for specifying multiple file patterns.
A file pattern contains the analyzer it is used for, and the pattern itself, joined by a semicolon. For example:
```
--file-patterns "dockerfile:.*.docker" --file-patterns "yaml:deployment" --file-patterns "pip:requirements-.*\.txt"
```
The prefixes are listed [here](https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/pkg/fanal/analyzer/const.go)
## Exit Code
| Scanner | Supported |
|:----------------:|:---------:|

View File

@@ -1,5 +1,6 @@
# Reporting
## Supported Formats
Trivy supports the following formats:
- Table
@@ -8,7 +9,7 @@ Trivy supports the following formats:
- Template
- SBOM
## Table (Default)
### Table (Default)
| Scanner | Supported |
|:----------------:|:---------:|
@@ -21,7 +22,7 @@ Trivy supports the following formats:
$ trivy image -f table golang:1.12-alpine
```
### Show origins of vulnerable dependencies
#### Show origins of vulnerable dependencies
| Scanner | Supported |
|:----------------:|:---------:|
@@ -105,7 +106,7 @@ Also, **glob-parent@3.1.0** with some vulnerabilities is included through chain
Then, you can try to update **axios@0.21.4** and **cra-append-sw@2.7.0** to resolve vulnerabilities in **follow-redirects@1.14.6** and **glob-parent@3.1.0**.
## JSON
### JSON
| Scanner | Supported |
|:----------------:|:---------:|
@@ -239,7 +240,7 @@ $ trivy image -f json -o results.json golang:1.12-alpine
`VulnerabilityID`, `PkgName`, `InstalledVersion`, and `Severity` in `Vulnerabilities` are always filled with values, but other fields might be empty.
## SARIF
### SARIF
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
@@ -255,7 +256,7 @@ $ trivy image --format sarif -o report.sarif golang:1.12-alpine
This SARIF file can be uploaded to GitHub code scanning results, and there is a [Trivy GitHub Action][action] for automating this process.
## Template
### Template
| Scanner | Supported |
|:----------------:|:---------:|
@@ -264,7 +265,7 @@ This SARIF file can be uploaded to GitHub code scanning results, and there is a
| Secret | ✓ |
| License | ✓ |
### Custom Template
#### Custom Template
{% raw %}
```
@@ -301,18 +302,18 @@ Critical: 0, High: 2
For other features of sprig, see the official [sprig][sprig] documentation.
### Load templates from a file
#### Load templates from a file
You can load templates from a file prefixing the template path with an @.
```
$ trivy image --format template --template "@/path/to/template" golang:1.12-alpine
```
### Default Templates
#### Default Templates
If Trivy is installed using rpm then default templates can be found at `/usr/local/share/trivy/templates`.
#### JUnit
##### JUnit
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
@@ -325,7 +326,7 @@ In the following example using the template `junit.tpl` XML can be generated.
$ trivy image --format template --template "@contrib/junit.tpl" -o junit-report.xml golang:1.12-alpine
```
#### ASFF
##### ASFF
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
@@ -335,7 +336,7 @@ $ trivy image --format template --template "@contrib/junit.tpl" -o junit-report.
Trivy also supports an [ASFF template for reporting findings to AWS Security Hub][asff]
#### HTML
##### HTML
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
@@ -353,9 +354,34 @@ The following example shows use of default HTML template when Trivy is installed
$ trivy image --format template --template "@/usr/local/share/trivy/templates/html.tpl" -o report.html golang:1.12-alpine
```
## SBOM
### SBOM
See [here](../supply-chain/sbom.md) for details.
## Converting
To generate multiple reports, you can generate the JSON report first and convert it to other formats with the `convert` subcommand.
```shell
$ trivy image --format json -o result.json --list-all-pkgs debian:11
$ trivy convert --format cyclonedx --output result.cdx result.json
```
!!! note
Please note that if you want to convert to a format that requires a list of packages,
such as SBOM, you need to add the `--list-all-pkgs` flag when outputting in JSON.
[Filtering options](./filtering.md) such as `--severity` are also available with `convert`.
```shell
# Output all severities in JSON
$ trivy image --format json -o result.json --list-all-pkgs debian:11
# Output only critical issues in table format
$ trivy convert --format table --severity CRITICAL result.json
```
!!! note
JSON reports from "trivy aws" and "trivy k8s" are not yet supported.
[cargo-auditable]: https://github.com/rust-secure-code/cargo-auditable/
[action]: https://github.com/aquasecurity/trivy-action
[asff]: ../../tutorials/integrations/aws-security-hub.md

View File

@@ -0,0 +1,116 @@
# Skipping Files and Directories
This section details ways to specify the files and directories that Trivy should not scan.
## Skip Files
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | ✓ |
| License | ✓ |
By default, Trivy traverses directories and searches for all necessary files for scanning.
You can skip files that you don't maintain using the `--skip-files` flag, or the equivalent Trivy YAML config option.
Using the `--skip-files` flag:
```bash
$ trivy image --skip-files "/Gemfile.lock" --skip-files "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0/Gemfile.lock" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
```
Using the Trivy YAML configuration:
```yaml
image:
skip-files:
- foo
- "testdata/*/bar"
```
It's possible to specify globs as part of the value.
```bash
$ trivy image --skip-files "./testdata/*/bar" .
```
This will skip any file named `bar` in the subdirectories of testdata.
```bash
$ trivy config --skip-files "./foo/**/*.tf" .
```
This will skip any files with the extension `.tf` in subdirectories of foo at any depth.
## Skip Directories
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | ✓ |
| License | ✓ |
By default, Trivy traverses directories and searches for all necessary files for scanning.
You can skip directories that you don't maintain using the `--skip-dirs` flag, or the equivalent Trivy YAML config option.
Using the `--skip-dirs` flag:
```bash
$ trivy image --skip-dirs /var/lib/gems/2.5.0/gems/fluent-plugin-detect-exceptions-0.0.13 --skip-dirs "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
```
Using the Trivy YAML configuration:
```yaml
image:
skip-dirs:
- foo/bar/
- "**/.terraform"
```
It's possible to specify globs as part of the value.
```bash
$ trivy image --skip-dirs "./testdata/*" .
```
This will skip all subdirectories of the testdata directory.
```bash
$ trivy config --skip-dirs "**/.terraform" .
```
This will skip subdirectories at any depth named `.terraform/`. (Note: this will match `./foo/.terraform` or
`./foo/bar/.terraform`, but not `./.terraform`.)
!!! tip
Glob patterns work with any trivy subcommand (image, config, etc.) and can be specified to skip both directories (with `--skip-dirs`) and files (with `--skip-files`).
### Advanced globbing
Trivy also supports bash style [extended](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Pattern-Matching) glob pattern matching.
```bash
$ trivy image --skip-files "**/foo" image:tag
```
This will skip the file `foo` that happens to be nested under any parent(s).
## File patterns
| Scanner | Supported |
|:----------------:|:---------:|
| Vulnerability | ✓ |
| Misconfiguration | ✓ |
| Secret | |
| License | |
When a directory is given as an input, Trivy will recursively look for and test all files based on file patterns.
The default file patterns are [here](../scanner/misconfiguration/custom/index.md).
In addition to the default file patterns, the `--file-patterns` option takes regexp patterns to look for your files.
For example, it may be useful when your file name of Dockerfile doesn't match the default patterns.
This can be repeated for specifying multiple file patterns.
A file pattern contains the analyzer it is used for, and the pattern itself, joined by a semicolon. For example:
```
--file-patterns "dockerfile:.*.docker" --file-patterns "kubernetes:*.tpl" --file-patterns "pip:requirements-.*\.txt"
```
The prefixes are listed [here](https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/pkg/fanal/analyzer/const.go)

View File

@@ -45,6 +45,7 @@ trivy [global flags] command [flags] target
* [trivy aws](trivy_aws.md) - [EXPERIMENTAL] Scan AWS account
* [trivy config](trivy_config.md) - Scan config files for misconfigurations
* [trivy convert](trivy_convert.md) - Convert Trivy JSON report into a different format
* [trivy filesystem](trivy_filesystem.md) - Scan local filesystem
* [trivy image](trivy_image.md) - Scan a container image
* [trivy kubernetes](trivy_kubernetes.md) - [EXPERIMENTAL] Scan kubernetes cluster

View File

@@ -65,36 +65,40 @@ trivy aws [flags]
### Options
```
--account string The AWS account to scan. It's useful to specify this when reviewing cached results for multiple accounts.
--arn string The AWS ARN to show results for. Useful to filter results once a scan is cached.
--compliance string compliance report to generate (aws-cis-1.2, aws-cis-1.4)
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--endpoint string AWS Endpoint override
--exit-code int specify exit code when any security issues are found
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for aws
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--max-cache-age duration The maximum age of the cloud cache. Cached data will be requeried from the cloud provider if it is older than this. (default 24h0m0s)
-o, --output string output file name
--policy-namespaces strings Rego namespaces
--region string AWS Region to scan
--report string specify a report format for the output. (all,summary) (default "all")
--service strings Only scan AWS Service(s) specified with this flag. Can specify multiple services using --service A --service B etc.
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-policy-update skip fetching rego policy updates
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--trace enable more verbose trace output for custom queries
--update-cache Update the cache for the applicable cloud provider instead of using cached results.
--account string The AWS account to scan. It's useful to specify this when reviewing cached results for multiple accounts.
--arn string The AWS ARN to show results for. Useful to filter results once a scan is cached.
--compliance string compliance report to generate (aws-cis-1.2,aws-cis-1.4)
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--endpoint string AWS Endpoint override
--exit-code int specify exit code when any security issues are found
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for aws
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--max-cache-age duration The maximum age of the cloud cache. Cached data will be requeried from the cloud provider if it is older than this. (default 24h0m0s)
-o, --output string output file name
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--region string AWS Region to scan
--report string specify a report format for the output (all,summary) (default "all")
--reset-policy-bundle remove policy bundle
--service strings Only scan AWS Service(s) specified with this flag. Can specify multiple services using --service A --service B etc.
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-policy-update skip fetching rego policy updates
--skip-service strings Skip selected AWS Service(s) specified with this flag. Can specify multiple services using --skip-service A --skip-service B etc.
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--trace enable more verbose trace output for custom queries
--update-cache Update the cache for the applicable cloud provider instead of using cached results.
```
### Options inherited from parent commands

View File

@@ -9,42 +9,45 @@ trivy config [flags] DIR
### Options
```
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for config
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--report string specify a compliance report format for the output. (all,summary) (default "all")
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-policy-update skip fetching rego policy updates
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--trace enable more verbose trace output for custom queries
--username strings username. Comma-separated usernames allowed.
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for config
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--report string specify a compliance report format for the output (all,summary) (default "all")
--reset-policy-bundle remove policy bundle
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-policy-update skip fetching rego policy updates
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--trace enable more verbose trace output for custom queries
--username strings username. Comma-separated usernames allowed.
```
### Options inherited from parent commands

View File

@@ -0,0 +1,52 @@
## trivy convert
Convert Trivy JSON report into a different format
```
trivy convert [flags] RESULT_JSON
```
### Examples
```
# report conversion
$ trivy image --format json --output result.json --list-all-pkgs debian:11
$ trivy convert --format cyclonedx --output result.cdx result.json
```
### Options
```
--compliance string compliance report to generate
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
-h, --help help for convert
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignorefile string specify .trivyignore file (default ".trivyignore")
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
-o, --output string output file name
--report string specify a report format for the output (all,summary) (default "all")
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
-t, --template string output template
```
### 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

View File

@@ -19,67 +19,72 @@ trivy filesystem [flags] PATH
### Options
```
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for filesystem
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--report string specify a compliance report format for the output. (all,summary) (default "all")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for filesystem
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--report string specify a compliance report format for the output (all,summary) (default "all")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -34,73 +34,78 @@ trivy image [flags] IMAGE_NAME
### Options
```
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate (docker-cis)
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--docker-host string unix domain socket path to use for docker scanning
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for image
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--image-config-scanners string comma-separated list of what security issues to detect on container image configurations (config,secret)
--include-non-failures include successes and exceptions, available with '--scanners config'
--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")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--platform string set platform in the form os/arch if image is multi-platform capable
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine)
--report string specify a format for the compliance report. (default "summary")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate (docker-cis)
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--docker-host string unix domain socket path to use for docker scanning
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for image
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--image-config-scanners strings comma-separated list of what security issues to detect on container image configurations (config,secret)
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
--include-non-failures include successes and exceptions, available with '--scanners config'
--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")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--platform string set platform in the form os/arch if image is multi-platform capable
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine)
--report string specify a format for the compliance report. (all,summary) (default "summary")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -27,63 +27,73 @@ trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg:
### Options
```
-A, --all-namespaces fetch resources from all cluster namespaces
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate (k8s-nsa,k8s-cis, k8s-pss-baseline, k8s-pss-restricted)
--components strings specify which components to scan (default [workload,infra])
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--context string specify a context to scan
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for kubernetes
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
--kubeconfig string specify the kubeconfig file path to use
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
-n, --namespace string specify a namespace to scan
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--parallel int number (between 1-20) of goroutines enabled for parallel scanning (default 5)
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--report string specify a report format for the output. (all,summary) (default "all")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners string comma-separated list of what security issues to detect (vuln,config,secret,license) (default "vuln,config,secret,rbac")
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--tolerations strings specify node-collector job tolerations (example: key1=value1:NoExecute,key2=value2:NoSchedule)
--trace enable more verbose trace output for custom queries
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
-A, --all-namespaces fetch resources from all cluster namespaces
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate (k8s-nsa,k8s-cis,k8s-pss-baseline,k8s-pss-restricted)
--components strings specify which components to scan (workload,infra) (default [workload,infra])
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--context string specify a context to scan
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--exclude-nodes strings indicate the node labels that the node-collector job should exclude from scanning (example: kubernetes.io/arch:arm64,team:dev)
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table,json,cyclonedx) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for kubernetes
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--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-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
--kubeconfig string specify the kubeconfig file path to use
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
-n, --namespace string specify a namespace to scan
--no-progress suppress progress bar
--node-collector-namespace string specify the namespace in which the node-collector job should be deployed (default "trivy-temp")
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--parallel int number (between 1-20) of goroutines enabled for parallel scanning (default 5)
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--report string specify a report format for the output (all,summary) (default "all")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners string comma-separated list of what security issues to detect (vuln,config,secret,license) (default "vuln,config,secret,rbac")
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -16,68 +16,73 @@ trivy repository [flags] REPO_URL
### Options
```
--branch string pass the branch name to be scanned
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--commit string pass the commit hash to be scanned
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for repository
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
--tag string pass the tag name to be scanned
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
--branch string pass the branch name to be scanned
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--commit string pass the commit hash to be scanned
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for repository
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
--tag string pass the tag name to be scanned
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -22,66 +22,70 @@ trivy rootfs [flags] ROOTDIR
### Options
```
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify paths to the Rego policy files directory, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for rootfs
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
--config-policy strings specify the paths to the Rego policy files or to the directories containing them, applying config files
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for rootfs
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignored-licenses strings specify a list of license to ignore
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--license-confidence-level float specify license classifier's confidence level (default 0.9)
--license-full eagerly look for licenses in source code headers and license files
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--policy-namespaces strings Rego namespaces
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--registry-token string registry token
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--skip-policy-update skip fetching rego policy updates
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--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.
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -12,9 +12,6 @@ trivy sbom [flags] SBOM_PATH
# Scan CycloneDX and show the result in tables
$ trivy sbom /path/to/report.cdx
# Scan CycloneDX and generate a CycloneDX report
$ trivy sbom --format cyclonedx /path/to/report.cdx
# Scan CycloneDX-type attestation and show the result in tables
$ trivy sbom /path/to/report.cdx.intoto.jsonl
@@ -34,9 +31,10 @@ trivy sbom [flags] SBOM_PATH
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
-h, --help help for sbom
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignorefile string specify .trivyignore file (default ".trivyignore")
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
@@ -51,19 +49,18 @@ trivy sbom [flags] SBOM_PATH
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--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
--slow scan over time with lower CPU and memory utilization
-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 string comma-separated list of vulnerability types (os,library) (default "os,library")
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -20,57 +20,61 @@ trivy vm [flags] VM_IMAGE
### Options
```
--aws-region string AWS region to scan
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for vm
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-unfixed display only fixed vulnerabilities
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories where the traversal is skipped
--skip-files strings specify the file paths to skip traversal
--skip-java-db-update skip updating Java index database
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-vars strings specify paths to override the Terraform tfvars files
--token string for authentication in client/server mode
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
--aws-region string AWS region to scan
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
--cache-ttl duration cache TTL when using redis as cache backend
--clear-cache clear image caches without scanning
--compliance string compliance report to generate
--custom-headers strings custom headers in client mode
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
--download-db-only download/update vulnerability database but don't run a scan
--download-java-db-only download/update Java index database but don't run a scan
--enable-modules strings [EXPERIMENTAL] module names to enable
--exit-code int specify exit code when any security issues are found
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
--file-patterns strings specify config file patterns
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--helm-values strings specify paths to override the Helm values.yaml files
-h, --help help for vm
--ignore-policy string specify the Rego file path to evaluate each vulnerability
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
--ignore-unfixed display only fixed vulnerabilities
--ignorefile string specify .trivyignore file (default ".trivyignore")
--include-non-failures include successes and exceptions, available with '--scanners config'
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
--no-progress suppress progress bar
--offline-scan do not issue API requests to identify dependencies
-o, --output string output file name
--policy-bundle-repository string OCI registry URL to retrieve policy bundle from (default "ghcr.io/aquasecurity/defsec:0")
--redis-ca string redis ca file location, if using redis as cache backend
--redis-cert string redis certificate file location, if using redis as cache backend
--redis-key string redis key file location, if using redis as cache backend
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
--reset remove all caches and database
--reset-policy-bundle remove policy bundle
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
--server string server address in client mode
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
--skip-db-update skip updating vulnerability database
--skip-dirs strings specify the directories or glob patterns to skip
--skip-files strings specify the files or glob patterns to skip
--skip-java-db-update skip updating Java index database
--slow scan over time with lower CPU and memory utilization
-t, --template string output template
--tf-exclude-downloaded-modules remove results for downloaded modules in .terraform folder
--tf-vars strings specify paths to override the Terraform tfvars files
--token string for authentication in client/server mode
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
```
### Options inherited from parent commands

View File

@@ -243,6 +243,7 @@ rego
policy:
- policy/repository
- policy/custom
- policy/some-policy.rego
# Same as '--config-data'
# Default is empty
@@ -291,6 +292,11 @@ misconfiguration:
vars:
- dev-terraform.tfvars
- common-terraform.tfvars
# Same as '--tf-exclude-downloaded-modules'
# Default is false
terraform:
exclude-downloaded-modules: false
```
## Kubernetes Options

View File

@@ -143,7 +143,7 @@ Trivy has number of configuration flags for use with license scanning;
Trivy license scanning can ignore licenses that are identified to explicitly remove them from the results using the `--ignored-licenses` flag;
```shell
$ trivy image --scanners license --ignored-licenses MPL-2.0,MIT --severity LOW grafana/grafana:latest
$ trivy image --scanners license --ignored-licenses MPL-2.0,MIT --severity HIGH grafana/grafana:latest
2022-07-13T18:15:28.605Z INFO License scanning is enabled
OS Packages (license)

View File

@@ -3,7 +3,7 @@
Custom policies may require additional data in order to determine an answer.
For example, an allowed list of resources that can be created.
Instead of hardcoding this information inside of your policy, Trivy allows passing paths to data files with the `--data` flag.
Instead of hardcoding this information inside your policy, Trivy allows passing paths to data files with the `--data` flag.
Given the following yaml file:

View File

@@ -1,296 +0,0 @@
# Examples
## Custom Policy
### Kubernetes
See [here][k8s].
The custom policy is defined in `user.kubernetes.ID001` package.
You need to pass the package prefix you want to evaluate through `--namespaces` option.
In this case, the package prefix should be `user`, `user.kubernetes`, or `user.kubernetes.ID001`.
### Dockerfile
See [here][dockerfile].
The input will be a dictionary of stages.
#### Single Stage
??? example
Dockerfile
```dockerfile
FROM foo
COPY . /
RUN echo hello
```
Rego Input
```json
{
"stages": {
"foo": [
{
"Cmd": "from",
"EndLine": 1,
"Flags": [],
"JSON": false,
"Original": "FROM foo",
"Stage": 0,
"StartLine": 1,
"SubCmd": "",
"Value": [
"foo"
]
},
{
"Cmd": "copy",
"EndLine": 2,
"Flags": [],
"JSON": false,
"Original": "COPY . /",
"Stage": 0,
"StartLine": 2,
"SubCmd": "",
"Value": [
".",
"/"
]
},
{
"Cmd": "run",
"EndLine": 3,
"Flags": [],
"JSON": false,
"Original": "RUN echo hello",
"Stage": 0,
"StartLine": 3,
"SubCmd": "",
"Value": [
"echo hello"
]
}
]
}
}
```
#### Multi Stage
??? example
Dockerfile
```dockerfile
FROM golang:1.16 AS builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest
RUN apk --no-cache add ca-certificates \
&& apk add --no-cache bash
WORKDIR /root/
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
CMD ["./app"]
```
Rego Input
```json
{
"stages": {
"alpine:latest": [
{
"Cmd": "from",
"EndLine": 7,
"Flags": [],
"JSON": false,
"Original": "FROM alpine:latest",
"Stage": 1,
"StartLine": 7,
"SubCmd": "",
"Value": [
"alpine:latest"
]
},
{
"Cmd": "run",
"EndLine": 9,
"Flags": [],
"JSON": false,
"Original": "RUN apk --no-cache add ca-certificates \u0026\u0026 apk add --no-cache bash",
"Stage": 1,
"StartLine": 8,
"SubCmd": "",
"Value": [
"apk --no-cache add ca-certificates \u0026\u0026 apk add --no-cache bash"
]
},
{
"Cmd": "workdir",
"EndLine": 10,
"Flags": [],
"JSON": false,
"Original": "WORKDIR /root/",
"Stage": 1,
"StartLine": 10,
"SubCmd": "",
"Value": [
"/root/"
]
},
{
"Cmd": "copy",
"EndLine": 11,
"Flags": [
"--from=builder"
],
"JSON": false,
"Original": "COPY --from=builder /go/src/github.com/alexellis/href-counter/app .",
"Stage": 1,
"StartLine": 11,
"SubCmd": "",
"Value": [
"/go/src/github.com/alexellis/href-counter/app",
"."
]
},
{
"Cmd": "cmd",
"EndLine": 12,
"Flags": [],
"JSON": true,
"Original": "CMD [\"./app\"]",
"Stage": 1,
"StartLine": 12,
"SubCmd": "",
"Value": [
"./app"
]
}
],
"golang:1.16 AS builder": [
{
"Cmd": "from",
"EndLine": 1,
"Flags": [],
"JSON": false,
"Original": "FROM golang:1.16 AS builder",
"Stage": 0,
"StartLine": 1,
"SubCmd": "",
"Value": [
"golang:1.16",
"AS",
"builder"
]
},
{
"Cmd": "workdir",
"EndLine": 2,
"Flags": [],
"JSON": false,
"Original": "WORKDIR /go/src/github.com/alexellis/href-counter/",
"Stage": 0,
"StartLine": 2,
"SubCmd": "",
"Value": [
"/go/src/github.com/alexellis/href-counter/"
]
},
{
"Cmd": "run",
"EndLine": 3,
"Flags": [],
"JSON": false,
"Original": "RUN go get -d -v golang.org/x/net/html",
"Stage": 0,
"StartLine": 3,
"SubCmd": "",
"Value": [
"go get -d -v golang.org/x/net/html"
]
},
{
"Cmd": "copy",
"EndLine": 4,
"Flags": [],
"JSON": false,
"Original": "COPY app.go .",
"Stage": 0,
"StartLine": 4,
"SubCmd": "",
"Value": [
"app.go",
"."
]
},
{
"Cmd": "run",
"EndLine": 5,
"Flags": [],
"JSON": false,
"Original": "RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .",
"Stage": 0,
"StartLine": 5,
"SubCmd": "",
"Value": [
"CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app ."
]
}
]
}
}
```
### Docker Compose
See [here][compose].
Docker Compose uses YAML format for configurations. You can apply your Rego policies to `docker-compose.yml`.
### HCL
See [here][hcl].
Trivy parses HCL files and converts into structured data.
!!! warning
Terraform HCL files are not supported yet.
### Terraform Plan
See [here][tfplan].
Use the command [terraform show][terraform-show] to convert the Terraform plan into JSON so that OPA can read the plan.
```bash
$ terraform init
$ terraform plan --out tfplan.binary
$ terraform show -json tfplan.binary > tfplan.json
```
For more details, see also [OPA document][opa-terraform].
### Serverless Framework
See [here][serverless].
Server Framework uses YAML format for configurations. You can apply your Rego policies to `serverless.yaml`.
## Custom Data
See [here][data].
## Combined Input
See [here][combine].
## Go Testing
See [here][go-testing].
[k8s]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/kubernetes/
[dockerfile]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/dockerfile/
[compose]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/docker-compose/
[hcl]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/hcl/
[serverless]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/serverless/
[tfplan]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/terraform-plan/
[terraform-show]: https://www.terraform.io/docs/cli/commands/show.html
[opa-terraform]: https://www.openpolicyagent.org/docs/latest/terraform/
[custom]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy
[data]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-data
[combine]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/combine
[go-testing]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/go-testing

View File

@@ -2,10 +2,10 @@
## Overview
You can write custom policies in [Rego][rego].
Once you finish writing custom policies, you can pass the directory where those policies are stored with `--policy` option.
Once you finish writing custom policies, you can pass the policy files or the directory where those policies are stored with `--policy` option.
``` bash
trivy conf --policy /path/to/custom_policies --namespaces user /path/to/config_dir
trivy conf --policy /path/to/policy.rego --policy /path/to/custom_policies --namespaces user /path/to/config_dir
```
As for `--namespaces` option, the detail is described as below.

View File

@@ -83,8 +83,7 @@ The policies can be placed in a structure as follows
└── barschema.json
```
To use such a policy with Trivy, use the `--config-policy` flag that points to the directory where the schemas and policies
are contained.
To use such a policy with Trivy, use the `--config-policy` flag that points to the policy file or to the directory where the schemas and policies are contained.
```bash
$ trivy --config-policy=/Users/user/my-custom-policies <path/to/iac>

View File

@@ -316,12 +316,12 @@ This section describes misconfiguration-specific configuration.
Other common options are documented [here](../../configuration/index.md).
### Pass custom policies
You can pass directories including your custom policies through `--policy` option.
This can be repeated for specifying multiple directories.
You can pass policy files or directories including your custom policies through `--policy` option.
This can be repeated for specifying multiple files or directories.
```bash
cd examplex/misconf/
trivy conf --policy custom-policy/policy --policy combine/policy --namespaces user misconf/mixed
trivy conf --policy custom-policy/policy --policy combine/policy --policy policy.rego --namespaces user misconf/mixed
```
For more details, see [Custom Policies](./custom/index.md).
@@ -356,6 +356,12 @@ You can pass `tf-vars` files to Trivy to override default values found in the Te
trivy conf --tf-vars dev.terraform.tfvars ./infrastructure/tf
```
### Exclude downloaded Terraform modules
You can remove results for downloaded modules in `.terraform` folder.
```bash
trivy conf --tf-exclude-downloaded-modules ./configs
```
### Helm value overrides
There are a number of options for overriding values in Helm charts. When override values are passed to the Helm scanner, the values will be used during the Manifest rendering process and will become part of the scanned artifact.

View File

@@ -95,6 +95,9 @@ Trivy tries to load `trivy-secret.yaml` in the current directory by default.
If the file doesn't exist, only built-in rules are used.
You can customize the config file path via the `--secret-config` flag.
!!! warning
Trivy uses [Golang regexp package](https://pkg.go.dev/regexp/syntax#hdr-Syntax). To use `^` and `$` as simbols of begin and end of line use multi-line mode -`(?m)`.
### Custom Rules
Trivy allows defining custom rules.

View File

@@ -4,33 +4,33 @@
## Supported languages
| Language | File | Image[^7] | Rootfs[^8] | Filesystem[^9] | Repository[^10] | Dev dependencies | Dependency location[^11] |
|----------------------|--------------------------------------------------------------------------------------------|:---------:|:----------:|:--------------:|:---------------:|------------------|:------------------------:|
| Ruby | Gemfile.lock | - | - | ✅ | ✅ | included | - |
| | gemspec | ✅ | ✅ | - | - | included | - |
| [Python](python.md) | Pipfile.lock | - | - | ✅ | ✅ | excluded | ✅ |
| | poetry.lock | - | - | ✅ | ✅ | excluded | - |
| | requirements.txt | - | - | ✅ | ✅ | included | - |
| | egg package[^1] | ✅ | ✅ | - | - | excluded | - |
| | wheel package[^2] | ✅ | ✅ | - | - | excluded | - |
| [PHP](php.md) | composer.lock | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| [Node.js](nodejs.md) | package-lock.json | - | - | ✅ | ✅ | excluded | ✅ |
| | yarn.lock | - | - | ✅ | ✅ | included | ✅ |
| | pnpm-lock.yaml | - | - | ✅ | ✅ | excluded | - |
| | package.json | ✅ | ✅ | - | - | excluded | - |
| .NET | packages.lock.json | ✅ | ✅ | ✅ | ✅ | included | ✅ |
| | packages.config | ✅ | ✅ | ✅ | ✅ | excluded | - |
| | .deps.json | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| [Java](java.md) | JAR/WAR/PAR/EAR[^3] | ✅ | ✅ | - | - | included | - |
| | pom.xml[^4] | - | - | ✅ | ✅ | excluded | - |
| | *gradle.lockfile | - | - | ✅ | ✅ | excluded | - |
| [Go](golang.md) | Binaries built by Go[^5] | ✅ | ✅ | - | - | excluded | - |
| | go.mod[^6] | - | - | ✅ | ✅ | included | - |
| [Rust](rust.md) | Cargo.lock | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| | Binaries built with [cargo-auditable](https://github.com/rust-secure-code/cargo-auditable) | ✅ | ✅ | - | - | excluded | - |
| C/C++ | conan.lock[^12] | - | - | ✅ | ✅ | excluded | - |
| Elixir | mix.lock[^12] | - | - | ✅ | ✅ | excluded | ✅ |
| Dart | pubspec.lock | | | - | - | included | - |
| Language | File | Image[^7] | Rootfs[^8] | Filesystem[^9] | Repository[^10] | Dev dependencies | Dependency location[^11] |
|----------------------|--------------------------------------------------------------------------------------------|:---------:|:----------:|:--------------:|:---------------:|------------------------------|:------------------------:|
| Ruby | Gemfile.lock | - | - | ✅ | ✅ | included | - |
| | gemspec | ✅ | ✅ | - | - | included | - |
| [Python](python.md) | Pipfile.lock | - | - | ✅ | ✅ | excluded | ✅ |
| | poetry.lock | - | - | ✅ | ✅ | excluded | - |
| | requirements.txt | - | - | ✅ | ✅ | included | - |
| | egg package[^1] | ✅ | ✅ | - | - | excluded | - |
| | wheel package[^2] | ✅ | ✅ | - | - | excluded | - |
| [PHP](php.md) | composer.lock | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| [Node.js](nodejs.md) | package-lock.json | - | - | ✅ | ✅ | [excluded](./nodejs.md#npm) | ✅ |
| | yarn.lock | - | - | ✅ | ✅ | [excluded](./nodejs.md#yarn) | ✅ |
| | pnpm-lock.yaml | - | - | ✅ | ✅ | excluded | - |
| | package.json | ✅ | ✅ | - | - | excluded | - |
| .NET | packages.lock.json | ✅ | ✅ | ✅ | ✅ | included | ✅ |
| | packages.config | ✅ | ✅ | ✅ | ✅ | excluded | - |
| | .deps.json | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| [Java](java.md) | JAR/WAR/PAR/EAR[^3] | ✅ | ✅ | - | - | included | - |
| | pom.xml[^4] | - | - | ✅ | ✅ | excluded | - |
| | *gradle.lockfile | - | - | ✅ | ✅ | excluded | - |
| [Go](golang.md) | Binaries built by Go[^5] | ✅ | ✅ | - | - | excluded | - |
| | go.mod[^6] | - | - | ✅ | ✅ | included | - |
| [Rust](rust.md) | Cargo.lock | ✅ | ✅ | ✅ | ✅ | excluded | ✅ |
| | Binaries built with [cargo-auditable](https://github.com/rust-secure-code/cargo-auditable) | ✅ | ✅ | - | - | excluded | - |
| C/C++ | conan.lock[^12] | - | - | ✅ | ✅ | excluded | - |
| Elixir | mix.lock[^12] | - | - | ✅ | ✅ | excluded | ✅ |
| Dart | pubspec.lock | - | - | | | included | - |
The path of these files does not matter.
@@ -64,8 +64,7 @@ Example: [Dockerfile](https://github.com/aquasecurity/trivy-ci-test/blob/main/Do
| | [GitHub Advisory Database (npm)][nodejs-ghsa] | ✅ | - |
| Java | [GitLab Advisories Community][gitlab] | ✅ | 1 month |
| | [GitHub Advisory Database (Maven)][java-ghsa] | ✅ | - |
| Go | [GitLab Advisories Community][gitlab] | ✅ | 1 month |
| | [The Go Vulnerability Database][go] | ✅ | - |
| Go | [GitHub Advisory Database (Go)][go-ghsa] | ✅ | - |
| Rust | [Open Source Vulnerabilities (crates.io)][rust-osv] | ✅ | - |
| .NET | [GitHub Advisory Database (NuGet)][dotnet-ghsa] | ✅ | - |
| C/C++ | [GitLab Advisories Community][gitlab] | ✅ | 1 month |
@@ -82,12 +81,12 @@ Example: [Dockerfile](https://github.com/aquasecurity/trivy-ci-test/blob/main/Do
[dotnet-ghsa]: https://github.com/advisories?query=ecosystem%3Anuget
[pub-ghsa]: https://github.com/advisories?query=ecosystem%3Apub
[erlang-ghsa]: https://github.com/advisories?query=ecosystem%3Aerlang
[go-ghsa]: https://github.com/advisories?query=ecosystem%3Ago
[php]: https://github.com/FriendsOfPHP/security-advisories
[ruby]: https://github.com/rubysec/ruby-advisory-db
[nodejs]: https://github.com/nodejs/security-wg
[gitlab]: https://gitlab.com/gitlab-org/advisories-community
[go]: https://github.com/golang/vulndb
[python-osv]: https://osv.dev/list?q=&ecosystem=PyPI
[rust-osv]: https://osv.dev/list?q=&ecosystem=crates.io

View File

@@ -4,11 +4,11 @@ Trivy supports three types of Java scanning: `JAR/WAR/PAR/EAR`, `pom.xml` and `*
The following table provides an outline of the features Trivy offers.
| Artifact | Internet access | Dev dependencies |
|------------------|:---------------------:|:-----------------|
| JAR/WAR/PAR/EAR | Trivy Java DB | Include |
| pom.xml | Maven repository [^1] | Exclude |
| *gradle.lockfile | - | Exclude |
| Artifact | Internet access | Dev dependencies | License |
|------------------|:---------------------:|:-----------------|:-------:|
| JAR/WAR/PAR/EAR | Trivy Java DB | Include | - |
| pom.xml | Maven repository [^1] | Exclude | ✅ |
| *gradle.lockfile | - | Exclude | - |
These may be enabled or disabled depending on the target.
See [here](./index.md) for the detail.

View File

@@ -3,11 +3,11 @@
Trivy supports three types of Node.js package managers: `npm`, `Yarn` and `pnpm`.
The following table provides an outline of the features Trivy offers.
| Package manager | File | Transitive dependencies | Dev dependencies | Dependency graph | Position | License |
|:---------------:|-------------------|:-----------------------:|:----------------:|:----------------:|:--------:|:-------:|
| npm | package-lock.json | ✅ | Excluded | ✅ | ✅ | ✅ |
| Yarn | yarn.lock | ✅ | Excluded | ✅ | ✅ | - |
| pnpm | pnpm-lock.yaml | ✅ | Excluded | ✅ | - | - |
| Package manager | File | Transitive dependencies | Dev dependencies | Dependency graph | Position | License |
|:---------------:|-------------------|:-----------------------:|:-----------------:|:----------------:|:--------:|:-------:|
| npm | package-lock.json | ✅ | [Excluded](#npm) | ✅ | ✅ | ✅ |
| Yarn | yarn.lock | ✅ | [Excluded](#yarn) | ✅ | ✅ | - |
| pnpm | pnpm-lock.yaml | ✅ | Excluded | ✅ | - | - |
In addition, Trivy scans installed packages with `package.json`.
@@ -29,10 +29,14 @@ Trivy parses `package-lock.json`.
To identify licenses, you need to download dependencies to `node_modules` beforehand.
Trivy analyzes `node_modules` for licenses.
By default, Trivy doesn't report development dependencies. Use the `--include-dev-deps` flag to include them.
### Yarn
Trivy parses `yarn.lock`, which doesn't contain information about development dependencies.
To exclude devDependencies, `package.json` also needs to be present next to `yarn.lock`.
By default, Trivy doesn't report development dependencies. Use the `--include-dev-deps` flag to include them.
### pnpm
Trivy parses `pnpm-lock.yaml`, then finds production dependencies and builds a [tree] of dependencies with vulnerabilities.

View File

@@ -9,25 +9,25 @@ To hide unfixed/unfixable vulnerabilities, you can use the `--ignore-unfixed` fl
Trivy doesn't support self-compiled packages/binaries, but official packages provided by vendors such as Red Hat and Debian.
| OS | Supported Versions | Target Packages | Detection of unfixed vulnerabilities |
|----------------------------------|-------------------------------------------|-------------------------------|:------------------------------------:|
| Alpine Linux | 2.2 - 2.7, 3.0 - 3.17, edge | Installed by apk | NO |
| Wolfi Linux | (n/a) | Installed by apk | NO |
| Chainguard | (n/a) | Installed by apk | NO |
| Red Hat Universal Base Image[^1] | 7, 8, 9 | Installed by yum/rpm | YES |
| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES |
| CentOS | 6, 7, 8 | Installed by yum/rpm | YES |
| AlmaLinux | 8, 9 | Installed by yum/rpm | NO |
| Rocky Linux | 8, 9 | Installed by yum/rpm | NO |
| Oracle Linux | 5, 6, 7, 8 | Installed by yum/rpm | NO |
| CBL-Mariner | 1.0, 2.0 | Installed by yum/rpm | YES |
| Amazon Linux | 1, 2, 2023 | Installed by yum/rpm | NO |
| openSUSE Leap | 42, 15 | Installed by zypper/rpm | NO |
| SUSE Enterprise Linux | 11, 12, 15 | Installed by zypper/rpm | NO |
| Photon OS | 1.0, 2.0, 3.0, 4.0 | Installed by tdnf/yum/rpm | NO |
| Debian GNU/Linux | wheezy, jessie, stretch, buster, bullseye | Installed by apt/apt-get/dpkg | YES |
| Ubuntu | All versions supported by Canonical | Installed by apt/apt-get/dpkg | YES |
| Distroless[^2] | Any | Installed by apt/apt-get/dpkg | YES |
| OS | Supported Versions | Target Packages | Detection of unfixed vulnerabilities |
|----------------------------------|-------------------------------------|-------------------------------|:------------------------------------:|
| Alpine Linux | 2.2 - 2.7, 3.0 - 3.18, edge | Installed by apk | NO |
| Wolfi Linux | (n/a) | Installed by apk | NO |
| Chainguard | (n/a) | Installed by apk | NO |
| Red Hat Universal Base Image[^1] | 7, 8, 9 | Installed by yum/rpm | YES |
| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES |
| CentOS | 6, 7, 8 | Installed by yum/rpm | YES |
| AlmaLinux | 8, 9 | Installed by yum/rpm | NO |
| Rocky Linux | 8, 9 | Installed by yum/rpm | NO |
| Oracle Linux | 5, 6, 7, 8 | Installed by yum/rpm | NO |
| CBL-Mariner | 1.0, 2.0 | Installed by yum/rpm | YES |
| Amazon Linux | 1, 2, 2023 | Installed by yum/rpm | NO |
| openSUSE Leap | 42, 15 | Installed by zypper/rpm | NO |
| SUSE Enterprise Linux | 11, 12, 15 | Installed by zypper/rpm | NO |
| Photon OS | 1.0, 2.0, 3.0, 4.0 | Installed by tdnf/yum/rpm | NO |
| Debian GNU/Linux | 7, 8, 9, 10, 11, 12 | Installed by apt/apt-get/dpkg | YES |
| Ubuntu | All versions supported by Canonical | Installed by apt/apt-get/dpkg | YES |
| Distroless[^2] | Any | Installed by apt/apt-get/dpkg | YES |
## Data Sources

View File

@@ -1,11 +1,13 @@
# SBOM generation
# SBOM
## Generating
Trivy can generate the following SBOM formats.
- [CycloneDX](#cyclonedx)
- [SPDX](#spdx)
## CLI commands
### CLI commands
To generate SBOM, you can use the `--format` option for each subcommand such as `image`, `fs` and `vm`.
```
@@ -177,7 +179,7 @@ $ trivy fs --format cyclonedx --output result.json /app/myproject
</details>
## Supported packages
### Supported packages
Trivy supports the following packages.
- [OS packages][os_packages]
@@ -196,8 +198,8 @@ In addition to the above packages, Trivy also supports the following packages fo
[^1]: Use `startline == 1 and endline == 1` for unsupported file types
[^2]: `envs/*/conda-meta/*.json`
## Formats
### CycloneDX
### Formats
#### CycloneDX
Trivy can generate SBOM in the [CycloneDX][cyclonedx] format.
Note that XML format is not supported at the moment.
@@ -222,7 +224,7 @@ $ trivy image --format cyclonedx --output result.json alpine:3.15
$ cat result.json | jq .
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"specVersion": "1.5",
"serialNumber": "urn:uuid:2be5773d-7cd3-4b4b-90a5-e165474ddace",
"version": 1,
"metadata": {
@@ -442,7 +444,7 @@ If you want to include vulnerabilities, you can enable vulnerability scanning vi
$ trivy image --scanners vuln --format cyclonedx --output result.json alpine:3.15
```
### SPDX
#### SPDX
Trivy can generate SBOM in the [SPDX][spdx] format.
You can use the regular subcommands (like `image`, `fs` and `rootfs`) and specify `spdx` with the `--format` option.
@@ -737,6 +739,31 @@ $ cat result.spdx.json | jq .
</details>
## Scanning
Trivy can take SBOM documents as input for scanning.
See [here](../target/sbom.md) for more details.
Also, Trivy searches for SBOM files in container images.
```bash
$ trivy image bitnami/elasticsearch:8.7.1
```
For example, [Bitnami images](https://github.com/bitnami/containers) contain SBOM files in `/opt/bitnami` directory.
Trivy automatically detects the SBOM files and uses them for scanning.
It is enabled in the following targets.
| Target | Enabled |
|:---------------:|:-------:|
| Container Image | ✓ |
| Filesystem | |
| Rootfs | ✓ |
| Git Repository | |
| VM Image | ✓ |
| Kubernetes | |
| AWS | |
| SBOM | |
[spdx]: https://spdx.dev/wp-content/uploads/sites/41/2020/08/SPDX-specification-2-2.pdf

View File

@@ -43,7 +43,7 @@ Take a look at the example below.
$ cat <<EOF > trivy.vex.cdx
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"specVersion": "1.5",
"version": 1,
"vulnerabilities": [
{

View File

@@ -103,5 +103,7 @@ Regardless of whether the cache is used or not, rules will be evaluated again wi
You can write custom policies for Trivy to evaluate against your AWS account.
These policies are written in [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/), the same language used by [Open Policy Agent](https://www.openpolicyagent.org/).
See the [Custom Policies](../scanner/misconfiguration/custom/index.md) page for more information.
See the [Custom Policies](../scanner/misconfiguration/custom/index.md) page for more information on how to write custom policies.
Custom policies in cloud scanning also support passing in custom data. This can be useful when you want to selectively enable/disable certain aspects of your cloud policies.
See the [Custom Data](../scanner/misconfiguration/custom/data.md) page for more information on how to provide custom data to custom policies.

View File

@@ -224,6 +224,23 @@ GitHub Personal Access Token
You can see environment variables with `docker inspect`.
## Supported
Trivy will look for the specified image in a series of locations. By default, it
will first look in the local Docker Engine, then Containerd, Podman, and
finally container registry.
This behavior can be modified with the `--image-src` flag. For example, the
command
```bash
trivy image --image-src podman,containerd alpine:3.7.3
```
Will first search in Podman. If the image is found there, it will be scanned
and the results returned. If the image is not found in Podman, then Trivy will
search in Containerd. If the image is not found there either, the scan will
fail and no more image sources will be searched.
### Docker Engine
Trivy tries to looks for the specified image in your local Docker Engine.
It will be skipped if Docker Engine is not running locally.
@@ -375,6 +392,15 @@ $ skopeo copy docker-daemon:alpine:3.11 oci:/path/to/alpine
$ trivy image --input /path/to/alpine
```
Referencing specific images can be done by their tag or by their manifest digest:
```
# Referenced by tag
$ trivy image --input /path/to/alpine:3.15
# Referenced by digest
$ trivy image --input /path/to/alpine@sha256:82389ea44e50c696aba18393b168a833929506f5b29b9d75eb817acceb6d54ba
```
## SBOM
Trivy supports the generation of Software Bill of Materials (SBOM) for container images and the search for SBOMs during vulnerability scanning.

View File

@@ -1,236 +0,0 @@
# Git Repository
Scan your remote git repositories for
- Vulnerabilities
- Misconfigurations
- Secrets
- Licenses
By default, vulnerability and secret scanning are enabled, and you can configure that with `--scanners`.
```bash
$ trivy repo [YOUR_REPO_URL]
```
## Scanners
### Vulnerabilities
It is enabled by default.
Trivy will look for vulnerabilities based on lock files such as Gemfile.lock and package-lock.json.
See [here](../scanner/vulnerability/index.md) for the detail.
```
$ trivy repo https://github.com/knqyf263/trivy-ci-test
```
<details>
<summary>Result</summary>
```
2021-03-09T15:04:19.003+0200 INFO Detecting cargo vulnerabilities...
2021-03-09T15:04:19.005+0200 INFO Detecting pipenv vulnerabilities...
Cargo.lock
==========
Total: 7 (UNKNOWN: 7, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
+----------+-------------------+----------+-------------------+------------------------------+---------------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+----------+-------------------+----------+-------------------+------------------------------+---------------------------------------------+
| ammonia | RUSTSEC-2019-0001 | UNKNOWN | 1.9.0 | >= 2.1.0 | Uncontrolled recursion leads |
| | | | | | to abort in HTML serialization |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2019-0001 |
+----------+-------------------+ +-------------------+------------------------------+---------------------------------------------+
| openssl | RUSTSEC-2016-0001 | | 0.8.3 | >= 0.9.0 | SSL/TLS MitM vulnerability |
| | | | | | due to insecure defaults |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2016-0001 |
+----------+-------------------+ +-------------------+------------------------------+---------------------------------------------+
| smallvec | RUSTSEC-2018-0018 | | 0.6.9 | >= 0.6.13 | smallvec creates uninitialized |
| | | | | | value of any type |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2018-0018 |
+ +-------------------+ + +------------------------------+---------------------------------------------+
| | RUSTSEC-2019-0009 | | | >= 0.6.10 | Double-free and use-after-free |
| | | | | | in SmallVec::grow() |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2019-0009 |
+ +-------------------+ + + +---------------------------------------------+
| | RUSTSEC-2019-0012 | | | | Memory corruption in SmallVec::grow() |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2019-0012 |
+ +-------------------+ + +------------------------------+---------------------------------------------+
| | RUSTSEC-2021-0003 | | | >= 0.6.14, < 1.0.0, >= 1.6.1 | Buffer overflow in SmallVec::insert_many |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2021-0003 |
+----------+-------------------+ +-------------------+------------------------------+---------------------------------------------+
| tempdir | RUSTSEC-2018-0017 | | 0.3.7 | | `tempdir` crate has been |
| | | | | | deprecated; use `tempfile` instead |
| | | | | | -->rustsec.org/advisories/RUSTSEC-2018-0017 |
+----------+-------------------+----------+-------------------+------------------------------+---------------------------------------------+
Pipfile.lock
============
Total: 20 (UNKNOWN: 3, LOW: 0, MEDIUM: 7, HIGH: 5, CRITICAL: 5)
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| django | CVE-2019-19844 | CRITICAL | 2.0.9 | 3.0.1, 2.2.9, 1.11.27 | Django: crafted email address |
| | | | | | allows account takeover |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-19844 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-7471 | | | 3.0.3, 2.2.10, 1.11.28 | django: potential SQL injection |
| | | | | | via StringAgg(delimiter) |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-7471 |
+ +------------------+----------+ +------------------------+---------------------------------------+
| | CVE-2019-6975 | HIGH | | 2.1.6, 2.0.11, 1.11.19 | python-django: memory exhaustion in |
| | | | | | django.utils.numberformat.format() |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-6975 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-9402 | | | 3.0.4, 2.2.11, 1.11.29 | django: potential SQL injection |
| | | | | | via "tolerance" parameter in |
| | | | | | GIS functions and aggregates... |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-9402 |
+ +------------------+----------+ +------------------------+---------------------------------------+
| | CVE-2019-3498 | MEDIUM | | 2.1.5, 2.0.10, 1.11.18 | python-django: Content spoofing |
| | | | | | via URL path in default 404 page |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-3498 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-13254 | | | 3.0.7, 2.2.13 | django: potential data leakage |
| | | | | | via malformed memcached keys |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-13254 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2020-13596 | | | | django: possible XSS via |
| | | | | | admin ForeignKeyRawIdWidget |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-13596 |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| django-cors-headers | pyup.io-37132 | UNKNOWN | 2.5.2 | 3.0.0 | In django-cors-headers |
| | | | | | version 3.0.0, |
| | | | | | ``CORS_ORIGIN_WHITELIST`` |
| | | | | | requires URI schemes, and |
| | | | | | optionally ports. This... |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| djangorestframework | CVE-2020-25626 | MEDIUM | 3.9.2 | 3.11.2 | django-rest-framework: XSS |
| | | | | | Vulnerability in API viewer |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-25626 |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| httplib2 | CVE-2021-21240 | HIGH | 0.12.1 | 0.19.0 | python-httplib2: Regular |
| | | | | | expression denial of |
| | | | | | service via malicious header |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-21240 |
+ +------------------+----------+ +------------------------+---------------------------------------+
| | CVE-2020-11078 | MEDIUM | | 0.18.0 | python-httplib2: CRLF injection |
| | | | | | via an attacker controlled |
| | | | | | unescaped part of uri for... |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-11078 |
+ +------------------+----------+ + +---------------------------------------+
| | pyup.io-38303 | UNKNOWN | | | Httplib2 0.18.0 is an |
| | | | | | important security update to |
| | | | | | patch a CWE-93 CRLF... |
+---------------------+------------------+ +-------------------+------------------------+---------------------------------------+
| jinja2 | pyup.io-39525 | | 2.10.1 | 2.11.3 | This affects the package |
| | | | | | jinja2 from 0.0.0 and before |
| | | | | | 2.11.3. The ReDOS... |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| py | CVE-2020-29651 | HIGH | 1.8.0 | | python-py: ReDoS in the py.path.svnwc |
| | | | | | component via malicious input |
| | | | | | to blame functionality... |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-29651 |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| pyyaml | CVE-2019-20477 | CRITICAL | 5.1 | | PyYAML: command execution |
| | | | | | through python/object/apply |
| | | | | | constructor in FullLoader |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-20477 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-14343 | | | 5.4 | PyYAML: incomplete |
| | | | | | fix for CVE-2020-1747 |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-14343 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-1747 | | | 5.3.1 | PyYAML: arbitrary command |
| | | | | | execution through python/object/new |
| | | | | | when FullLoader is used |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-1747 |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
| urllib3 | CVE-2019-11324 | HIGH | 1.24.1 | 1.24.2 | python-urllib3: Certification |
| | | | | | mishandle when error should be thrown |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-11324 |
+ +------------------+----------+ +------------------------+---------------------------------------+
| | CVE-2019-11236 | MEDIUM | | | python-urllib3: CRLF injection |
| | | | | | due to not encoding the |
| | | | | | '\r\n' sequence leading to... |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-11236 |
+ +------------------+ + +------------------------+---------------------------------------+
| | CVE-2020-26137 | | | 1.25.9 | python-urllib3: CRLF injection |
| | | | | | via HTTP request method |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-26137 |
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
```
</details>
### Misconfigurations
It is disabled by default and can be enabled with `--scanners config`.
See [here](../scanner/misconfiguration/index.md) for the detail.
```shell
$ trivy repo --scanners config [YOUR_REPO_URL]
```
### Secrets
It is enabled by default.
See [here](../scanner/secret.md) for the detail.
```shell
$ trivy repo [YOUR_REPO_URL]
```
### Licenses
It is disabled by default.
See [here](../scanner/license.md) for the detail.
```shell
$ trivy repo --scanners license [YOUR_REPO_URL]
```
## SBOM generation
Trivy can generate SBOM for git repositories.
See [here](../supply-chain/sbom.md) for the detail.
## References
### Scanning a Branch
Pass a `--branch` argument with a valid branch name on the remote repository provided:
```
$ trivy repo --branch <branch-name> <repo-name>
```
### Scanning upto a Commit
Pass a `--commit` argument with a valid commit hash on the remote repository provided:
```
$ trivy repo --commit <commit-hash> <repo-name>
```
### Scanning a Tag
Pass a `--tag` argument with a valid tag on the remote repository provided:
```
$ trivy repo --tag <tag-name> <repo-name>
```
### Scanning Private Repositories
In order to scan private GitHub or GitLab repositories, the environment variable `GITHUB_TOKEN` or `GITLAB_TOKEN` must be set, respectively, with a valid token that has access to the private repository being scanned.
The `GITHUB_TOKEN` environment variable will take precedence over `GITLAB_TOKEN`, so if a private GitLab repository will be scanned, then `GITHUB_TOKEN` must be unset.
You can find how to generate your GitHub Token in the following [GitHub documentation.](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
For example:
```
$ export GITHUB_TOKEN="your_private_github_token"
$ trivy repo <your private GitHub repo URL>
$
$ # or
$ export GITLAB_TOKEN="your_private_gitlab_token"
$ trivy repo <your private GitLab repo URL>
```

View File

@@ -283,6 +283,12 @@ Or, to filter for all other checks besides the infra checks, you can:
$ trivy k8s cluster --report summary --components=workload --scanners=config # scan all components besides infra
```
If you wish to exclude nodes from being scanned, you can use the flag `--exclude-nodes` with the node labels
```
trivy k8s cluster --report summary --exclude-nodes kubernetes.io/arch:arm6
```
### Compliance
This section describes Kubernetes specific compliance reports.
For an overview of Trivy's Compliance feature, including working with custom compliance, check out the [Compliance documentation](../compliance/compliance.md).
@@ -337,3 +343,16 @@ Trivy has a native [Kubernetes Operator][operator] which continuously scans your
[operator]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
[crd]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/
[trivy-operator]: https://aquasecurity.github.io/trivy-operator/latest
## SBOM
Trivy supports the generation of Kubernetes Bill of Materials (KBOM) for kubernetes cluster control plane components, node components and addons.
## KBOM
KBOM, Kubernetes Bill of Materials, is a manifest of all the important components that make up your Kubernetes cluster Control plane components, Node Components, and Addons, including their versions and images. Which “api-server” version are you currently running? Which flavor of “kubelet” is running on each node? What kind of etcd or storage are you currently using? And most importantly are there any vulnerabilities known to affect these components? These are all questions that KBOM can help you answer.
Trivy can generate KBOM in CycloneDX format:
```sh
trivy k8s cluster --format cyclonedx
```

View File

@@ -0,0 +1,155 @@
# Code Repository
Scan your local or remote code repositories for
- Vulnerabilities
- Misconfigurations
- Secrets
- Licenses
By default, vulnerability and secret scanning are enabled, and you can configure that with `--scanners`.
```bash
$ trivy repo (REPO_PATH | REPO_URL)
```
For example, you can scan a local repository as below.
```bash
$ trivy repo ./
```
It's also possible to scan a single file.
```
$ trivy repo ./trivy-ci-test/Pipfile.lock
```
To scan remote code repositories, you need to specify the URL.
```bash
$ trivy repo https://github.com/aquasecurity/trivy-ci-test
```
## Rationale
`trivy repo` is designed to scan code repositories, and it is intended to be used for scanning local/remote repositories in your machine or in your CI environment.
Therefore, unlike container/VM image scanning, it targets lock files such as package-lock.json and does not target artifacts like JAR files, binary files, etc.
See [here](../scanner/vulnerability/language/index.md) for the detail.
## Scanners
### Vulnerabilities
It is enabled by default.
Trivy will look for vulnerabilities based on lock files such as Gemfile.lock and package-lock.json.
See [here](../scanner/vulnerability/index.md) for the detail.
```
$ trivy repo ~/src/github.com/aquasecurity/trivy-ci-test
```
<details>
<summary>Result</summary>
```
2020-06-01T17:06:58.652+0300 WARN OS is not detected and vulnerabilities in OS packages are not detected.
2020-06-01T17:06:58.652+0300 INFO Detecting pipenv vulnerabilities...
2020-06-01T17:06:58.691+0300 INFO Detecting cargo vulnerabilities...
Pipfile.lock
============
Total: 10 (UNKNOWN: 2, LOW: 0, MEDIUM: 6, HIGH: 2, CRITICAL: 0)
+---------------------+------------------+----------+-------------------+------------------------+------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------------------+------------------+----------+-------------------+------------------------+------------------------------------+
| django | CVE-2020-7471 | HIGH | 2.0.9 | 3.0.3, 2.2.10, 1.11.28 | django: potential |
| | | | | | SQL injection via |
| | | | | | StringAgg(delimiter) |
+ +------------------+----------+ +------------------------+------------------------------------+
| | CVE-2019-19844 | MEDIUM | | 3.0.1, 2.2.9, 1.11.27 | Django: crafted email address |
| | | | | | allows account takeover |
+ +------------------+ + +------------------------+------------------------------------+
| | CVE-2019-3498 | | | 2.1.5, 2.0.10, 1.11.18 | python-django: Content |
| | | | | | spoofing via URL path in |
| | | | | | default 404 page |
+ +------------------+ + +------------------------+------------------------------------+
| | CVE-2019-6975 | | | 2.1.6, 2.0.11, 1.11.19 | python-django: |
| | | | | | memory exhaustion in |
| | | | | | django.utils.numberformat.format() |
+---------------------+------------------+----------+-------------------+------------------------+------------------------------------+
...
```
</details>
### Misconfigurations
It is disabled by default and can be enabled with `--scanners config`.
See [here](../scanner/misconfiguration/index.md) for the detail.
```shell
$ trivy repo --scanners config [YOUR_REPO_URL]
```
### Secrets
It is enabled by default.
See [here](../scanner/secret.md) for the detail.
```shell
$ trivy repo [YOUR_REPO_URL]
```
### Licenses
It is disabled by default.
See [here](../scanner/license.md) for the detail.
```shell
$ trivy repo --scanners license [YOUR_REPO_URL]
```
## SBOM generation
Trivy can generate SBOM for code repositories.
See [here](../supply-chain/sbom.md) for the detail.
## References
The following flags and environmental variables are available for remote git repositories.
### Scanning a Branch
Pass a `--branch` argument with a valid branch name on the remote repository provided:
```
$ trivy repo --branch <branch-name> <repo-name>
```
### Scanning upto a Commit
Pass a `--commit` argument with a valid commit hash on the remote repository provided:
```
$ trivy repo --commit <commit-hash> <repo-name>
```
### Scanning a Tag
Pass a `--tag` argument with a valid tag on the remote repository provided:
```
$ trivy repo --tag <tag-name> <repo-name>
```
### Scanning Private Repositories
In order to scan private GitHub or GitLab repositories, the environment variable `GITHUB_TOKEN` or `GITLAB_TOKEN` must be set, respectively, with a valid token that has access to the private repository being scanned.
The `GITHUB_TOKEN` environment variable will take precedence over `GITLAB_TOKEN`, so if a private GitLab repository will be scanned, then `GITHUB_TOKEN` must be unset.
You can find how to generate your GitHub Token in the following [GitHub documentation.](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
For example:
```
$ export GITHUB_TOKEN="your_private_github_token"
$ trivy repo <your private GitHub repo URL>
# or
$ export GITLAB_TOKEN="your_private_gitlab_token"
$ trivy repo <your private GitLab repo URL>
```

View File

@@ -28,10 +28,6 @@ Trivy supports CycloneDX as an input.
$ trivy sbom /path/to/cyclonedx.json
```
!!! note
If you want to generate a CycloneDX report from a CycloneDX input, please be aware that the output stores references to your original CycloneDX report and contains only detected vulnerabilities, not components.
The report is called [BOV](https://cyclonedx.org/capabilities/sbom/).
## SPDX
Trivy supports the SPDX SBOM as an input.

View File

@@ -0,0 +1,58 @@
# Scanning Coverage
Trivy can detect security issues in many different platforms and languages. This page gives a general overview of that coverage, and can help answer the frequently asked question "Does Trivy support X?". For more detailed information about the specific features and options, check the relevant scanner documentation.
## Vulnerabilities & SBOM
### Programming languages
Trivy detects code dependencies for the purpose of SBOM generation and vulnerability detection. The following programming languages have some level of support:
- Ruby
- Python
- PHP
- Node.js
- .NET
- Java
- Go
- Rust
- C/C++
- Elixir
- Dart
- Swift
Some features might be not be universally supported. For a full supportability matrix, [see here](../docs/scanner/vulnerability/language/index.md).
### OS
Trivy detects installed packages for the purpose of vulnerability detection. The following package managers are supported:
- Alpine Linux
- Wolfi Linux
- Chainguard
- Red Hat Universal Base Image
- Red Hat Enterprise Linux
- CentOS
- AlmaLinux
- Rocky Linux
- Oracle Linux
- CBL-Mariner
- Amazon Linux
- openSUSE Leap
- SUSE Enterprise Linux
- Photon OS
- Debian GNU/Linux
- Ubuntu
- Distroless
Some features might be not be universally supported. For a full supportability matrix, [see here](../docs/scanner/vulnerability/os.md).
## IaC & configuration
Trivy reads IaC & configuration languages for the purpose of misconfiguration detection and custom checks.
- Kubernetes
- Dockerfile, Containerfile
- Terraform
- CloudFormation
- Azure ARM Template
- Helm Chart
For more information about checks [see here](../docs/scanner/misconfiguration/policy/builtin.md).

View File

@@ -3,3 +3,23 @@
### How to pronounce the name "Trivy"?
`tri` is pronounced like **tri**gger, `vy` is pronounced like en**vy**.
### Does Trivy support X?
Check out the [Scanning coverage page](./coverage.md)
### Is there a paid version of Trivy?
If you liked Trivy, you will love Aqua which builds on top of Trivy to provide even more enhanced capabilities for a complete security management offering.
You can find a high level comparison table specific to Trivy users [here](https://github.com/aquasecurity/resources/blob/main/trivy-aqua.md).
In addition check out the <https://aquasec.com> website for more information about our products and services.
If you'd like to contact Aqua or request a demo, please use this form: <https://www.aquasec.com/demo>
### How to generate multiple reports?
See [here](../docs/configuration/reporting.md#converting).
### How to run Trivy under air-gapped environment?
See [here](../docs/advanced/air-gap.md).
### Why `trivy fs` and `trivy repo` does not scan JAR files for vulnerabilities?
See [here](../docs/target/repository.md#rationale).

View File

@@ -134,7 +134,7 @@ curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/inst
```bash
git clone --depth 1 --branch {{ git.tag }} https://github.com/aquasecurity/trivy
cd trivy
go install
go install ./cmd/trivy
```
## Use container image

View File

@@ -35,6 +35,8 @@ Scanners (what Trivy can find there):
- Sensitive information and secrets
- Software licenses
Trivy supports most popular programming languages, operating systems, and platforms. For a complete list, see the [Scanning Coverage] page.
To learn more, go to the [Trivy homepage][homepage] for feature highlights, or to the [Documentation site][Docs] for detailed information.
## Quick Start
@@ -108,6 +110,14 @@ trivy k8s --report summary cluster
</figure>
</details>
# Want more? Check out Aqua
If you liked Trivy, you will love Aqua which builds on top of Trivy to provide even more enhanced capabilities for a complete security management offering.
You can find a high level comparison table specific to Trivy users [here](https://github.com/aquasecurity/resources/blob/main/trivy-aqua.md).
In addition check out the <https://aquasec.com> website for more information about our products and services.
If you'd like to contact Aqua or request a demo, please use this form: <https://www.aquasec.com/demo>
---
Trivy is an [Aqua Security][aquasec] open source project.
@@ -117,6 +127,7 @@ Contact us about any matter by opening a GitHub Discussion [here][discussions]
[Ecosystem]: ./ecosystem/index.md
[Installation]: getting-started/installation.md
[pronunciation]: #how-to-pronounce-the-name-trivy
[Scanning Coverage]: getting-started/coverage.md
[aquasec]: https://aquasec.com
[oss]: https://www.aquasec.com/products/open-source-projects/

8
docs/overrides/main.html Normal file
View File

@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}

View File

@@ -7,7 +7,7 @@ The [Certified Kubernetes Security Specialist (CKS) Exam](https://training.linux
- [Trivy Video overview (short)][overview]
- [Example questions from the exam][exam]
- [More example questions][questions]
- [CKS exam study guide](study-guide)
- [CKS exam study guide][study-guide]
- [Docker Image Vulnerabilities & Trivy Image Scanning Demo | K21Academy](https://youtu.be/gHz10UsEdys)
### Aqua Security Blog posts to learn more

View File

@@ -74,8 +74,8 @@ container_scanning:
name: docker.io/aquasec/trivy:latest
entrypoint: [""]
variables:
# No need to clone the repo, we exclusively work on artifacts. See
# https://docs.gitlab.com/ee/ci/runners/README.html#git-strategy
# No need to clone the repo, we exclusively work on artifacts. See
# https://docs.gitlab.com/ee/ci/runners/configure_runners.html#git-strategy
GIT_STRATEGY: none
TRIVY_USERNAME: "$CI_REGISTRY_USER"
TRIVY_PASSWORD: "$CI_REGISTRY_PASSWORD"

View File

@@ -10,19 +10,18 @@ Pro tip: The output of the commands will be even more interesting if you have so
Trivy K8s is great to get an overview of all the vulnerabilities and misconfiguration issues or to scan specific workloads that are running in your cluster. You would want to use the Trivy K8s command either on your own local cluster or in your CI/CD pipeline post deployments.
The Trivy K8s command is part of the Trivy CLI:
The `trivy k8s` command is part of the Trivy CLI.
With the following command, we can scan our entire Kubernetes cluster for vulnerabilities and get a summary of the scan:
```
trivy k8s --report=summary
trivy k8s --report=summary cluster
```
To get detailed information for all your resources, just replace summary with all:
```
trivy k8s --report=all
trivy k8s --report=all cluster
```
However, we recommend displaying all information only in case you scan a specific namespace or resource since you can get overwhelmed with additional details.
@@ -30,19 +29,19 @@ However, we recommend displaying all information only in case you scan a specifi
Furthermore, we can specify the namespace that Trivy is supposed to scan to focus on specific resources in the scan result:
```
trivy k8s -n kube-system --report=summary
trivy k8s -n kube-system --report=summary cluster
```
Again, if youd like to receive additional details, use the --report=all flag:
```
trivy k8s -n kube-system --report=all
trivy k8s -n kube-system --report=all cluster
```
Like with scanning for vulnerabilities, we can also filter in-cluster security issues by severity of the vulnerabilities:
```
trivy k8s --severity=CRITICAL --report=summary
trivy k8s --severity=CRITICAL --report=summary cluster
```
Note that you can use any of the Trivy flags on the Trivy K8s command.
@@ -50,7 +49,7 @@ Note that you can use any of the Trivy flags on the Trivy K8s command.
With the Trivy K8s command, you can also scan specific workloads that are running within your cluster, such as our deployment:
```
trivy k8s n app --report=summary deployments/react-application
trivy k8s --namespace app --report=summary deployments/react-application
```
## Trivy Operator

291
go.mod
View File

@@ -4,18 +4,17 @@ go 1.19
require (
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.28
github.com/Azure/go-autorest/autorest/adal v0.9.23
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
github.com/BurntSushi/toml v1.2.1
github.com/CycloneDX/cyclonedx-go v0.7.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0
github.com/BurntSushi/toml v1.3.2
github.com/CycloneDX/cyclonedx-go v0.7.2-0.20230625092137-07e2f29defc3
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
github.com/Masterminds/sprig/v3 v3.2.3
github.com/NYTimes/gziphandler v1.1.1
github.com/alicebob/miniredis/v2 v2.30.1
github.com/alicebob/miniredis/v2 v2.30.4
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
github.com/aquasecurity/defsec v0.85.0
github.com/aquasecurity/go-dep-parser v0.0.0-20230424082450-f8baca321fbf
github.com/aquasecurity/defsec v0.91.1
github.com/aquasecurity/go-dep-parser v0.0.0-20230803125501-bd9cf68d8636
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
@@ -24,113 +23,117 @@ require (
github.com/aquasecurity/table v1.8.0
github.com/aquasecurity/testdocker v0.0.0-20230111101738-e741bda259da
github.com/aquasecurity/tml v0.6.1
github.com/aquasecurity/trivy-db v0.0.0-20230411140759-3c2ee2168575
github.com/aquasecurity/trivy-db v0.0.0-20230726112157-167ba4f2faeb
github.com/aquasecurity/trivy-java-db v0.0.0-20230209231723-7cddb1406728
github.com/aquasecurity/trivy-kubernetes v0.4.1-0.20230420095211-019a895da295
github.com/aws/aws-sdk-go v1.44.234
github.com/aws/aws-sdk-go-v2 v1.17.7
github.com/aws/aws-sdk-go-v2/config v1.18.15
github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1
github.com/aws/aws-sdk-go-v2/service/sts v1.18.7
github.com/aquasecurity/trivy-kubernetes v0.5.7-0.20230708090141-f44c2292c9a9
github.com/aws/aws-sdk-go v1.44.273
github.com/aws/aws-sdk-go-v2 v1.20.0
github.com/aws/aws-sdk-go-v2/config v1.18.25
github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0
github.com/aws/aws-sdk-go-v2/service/sts v1.21.0
github.com/bmatcuk/doublestar v1.3.4
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cheggaaa/pb/v3 v3.1.2
github.com/containerd/containerd v1.7.0
github.com/docker/docker v23.0.3+incompatible
github.com/docker/docker v23.0.7-0.20230714215826-f00e7af96042+incompatible
github.com/docker/go-connections v0.4.0
github.com/fatih/color v1.14.1
github.com/go-git/go-git/v5 v5.6.1
github.com/go-openapi/runtime v0.25.0
github.com/go-git/go-git/v5 v5.7.0
github.com/go-openapi/runtime v0.26.0
github.com/go-openapi/strfmt v0.21.7
github.com/go-redis/redis/v8 v8.11.5
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.3
github.com/google/go-containerregistry v0.14.0
github.com/google/go-containerregistry v0.15.2
github.com/google/licenseclassifier/v2 v2.0.0
github.com/google/uuid v1.3.0
github.com/google/wire v0.5.0
github.com/hashicorp/go-getter v1.7.0
github.com/hashicorp/go-getter v1.7.1
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru/v2 v2.0.1
github.com/in-toto/in-toto-golang v0.7.0
github.com/hashicorp/golang-lru/v2 v2.0.2
github.com/in-toto/in-toto-golang v0.9.0
github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f
github.com/knqyf263/go-deb-version v0.0.0-20230223133812-3ed183d23422
github.com/knqyf263/go-rpm-version v0.0.0-20220614171824-631e686d1075
github.com/knqyf263/go-rpmdb v0.0.0-20230301153543-ba94b245509b
github.com/knqyf263/go-rpmdb v0.0.0-20230517124904-b97c85e63254
github.com/knqyf263/nested v0.0.1
github.com/kylelemons/godebug v1.1.0
github.com/magefile/mage v1.14.0
github.com/magefile/mage v1.15.0
github.com/mailru/easyjson v0.7.7
github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac
github.com/masahiro331/go-ebs-file v0.0.0-20221225061409-5ef263bb2cc3
github.com/masahiro331/go-ext4-filesystem v0.0.0-20221225060520-c150f5eacfe1
github.com/masahiro331/go-ebs-file v0.0.0-20230228042409-005c81d4ae43
github.com/masahiro331/go-ext4-filesystem v0.0.0-20230612143131-27ccd485b7a1
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-20221225060805-c02764233454
github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/moby/buildkit v0.11.5
github.com/mitchellh/mapstructure v1.5.0
github.com/moby/buildkit v0.11.6
github.com/open-policy-agent/opa v0.45.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221020182949-4df8887994e8
github.com/openvex/go-vex v0.2.0
github.com/owenrumney/go-sarif/v2 v2.1.2
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170
github.com/samber/lo v1.37.0
github.com/opencontainers/image-spec v1.1.0-rc4
github.com/openvex/go-vex v0.2.1
github.com/owenrumney/go-sarif/v2 v2.2.0
github.com/package-url/packageurl-go v0.1.1
github.com/samber/lo v1.38.1
github.com/saracen/walker v0.1.3
github.com/secure-systems-lab/go-securesystemslib v0.5.0
github.com/sigstore/rekor v1.1.0
github.com/sirupsen/logrus v1.9.0
github.com/sosedoff/gitkit v0.3.0
github.com/secure-systems-lab/go-securesystemslib v0.7.0
github.com/sigstore/rekor v1.2.1
github.com/sirupsen/logrus v1.9.3
github.com/sosedoff/gitkit v0.4.0
github.com/spdx/tools-golang v0.5.0
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/testcontainers/testcontainers-go v0.17.0
github.com/tetratelabs/wazero v1.0.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.21.0
github.com/testcontainers/testcontainers-go/modules/localstack v0.21.0
github.com/tetratelabs/wazero v1.2.1
github.com/twitchtv/twirp v8.1.2+incompatible
github.com/xeipuuv/gojsonschema v1.2.0
github.com/xlab/treeprint v1.1.0
go.etcd.io/bbolt v1.3.7
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.7.0
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874
golang.org/x/mod v0.9.0
golang.org/x/sync v0.1.0
golang.org/x/term v0.6.0
golang.org/x/text v0.9.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
golang.org/x/term v0.10.0
golang.org/x/text v0.11.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
google.golang.org/protobuf v1.30.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools v2.2.0+incompatible
k8s.io/api v0.26.3
k8s.io/api v0.27.4
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
modernc.org/sqlite v1.20.3
modernc.org/sqlite v1.23.1
)
require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest v0.11.29 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.22 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/squirrel v1.5.3 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/squirrel v1.5.4 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.10.0-rc.7 // indirect
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
@@ -141,62 +144,63 @@ require (
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.15 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.24 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.25 // indirect
github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/service/apigateway v1.15.24 // indirect
github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.12.18 // indirect
github.com/aws/aws-sdk-go-v2/service/athena v1.18.10 // indirect
github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/service/athena v1.30.4 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudfront v1.20.5 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.24.4 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.21.10 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.27.1 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.26.2 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.15.20 // indirect
github.com/aws/aws-sdk-go-v2/service/codebuild v1.19.17 // indirect
github.com/aws/aws-sdk-go-v2/service/docdb v1.19.11 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ebs v1.15.19 // indirect
github.com/aws/aws-sdk-go-v2/service/ebs v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.17.18 // indirect
github.com/aws/aws-sdk-go-v2/service/ecs v1.18.26 // indirect
github.com/aws/aws-sdk-go-v2/service/efs v1.17.15 // indirect
github.com/aws/aws-sdk-go-v2/service/eks v1.22.1 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticache v1.22.10 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.18.20 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/emr v1.23.4 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.18.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17 // indirect
github.com/aws/aws-sdk-go-v2/service/ecs v1.28.1 // indirect
github.com/aws/aws-sdk-go-v2/service/efs v1.20.3 // indirect
github.com/aws/aws-sdk-go-v2/service/eks v1.27.14 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticache v1.26.8 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.11 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.19.0 // indirect
github.com/aws/aws-sdk-go-v2/service/emr v1.24.4 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.21.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.31 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.2 // indirect
github.com/aws/aws-sdk-go-v2/service/kafka v1.19.4 // indirect
github.com/aws/aws-sdk-go-v2/service/kinesis v1.15.19 // indirect
github.com/aws/aws-sdk-go-v2/service/kms v1.20.8 // indirect
github.com/aws/aws-sdk-go-v2/service/kms v1.23.0 // indirect
github.com/aws/aws-sdk-go-v2/service/lambda v1.24.6 // indirect
github.com/aws/aws-sdk-go-v2/service/mq v1.13.15 // indirect
github.com/aws/aws-sdk-go-v2/service/neptune v1.17.12 // indirect
github.com/aws/aws-sdk-go-v2/service/mq v1.15.0 // indirect
github.com/aws/aws-sdk-go-v2/service/neptune v1.20.7 // indirect
github.com/aws/aws-sdk-go-v2/service/rds v1.26.1 // indirect
github.com/aws/aws-sdk-go-v2/service/redshift v1.27.7 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.33.1 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sns v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sns v1.20.10 // indirect
github.com/aws/aws-sdk-go-v2/service/sqs v1.20.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.13.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/service/workspaces v1.23.0 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/aws/smithy-go v1.14.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/briandowns/spinner v1.23.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/containerd/fifo v1.1.0 // indirect
@@ -204,14 +208,14 @@ require (
github.com/containerd/ttrpc v1.2.1 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/containerd/typeurl/v2 v2.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/docker/cli v23.0.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/cli v23.0.5+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-metrics v0.0.1 // indirect
@@ -224,18 +228,18 @@ require (
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-git/gcfg v1.5.0 // 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.4.1 // indirect
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-gorp/gorp/v3 v3.0.5 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/spec v0.20.8 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/gobwas/glob v0.2.3 // indirect
@@ -248,6 +252,7 @@ require (
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
@@ -261,8 +266,8 @@ require (
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.14.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -271,13 +276,13 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/liamg/iamgo v0.0.9 // indirect
github.com/liamg/jfather v0.0.7 // indirect
github.com/liamg/memoryfs v1.4.3 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/magiconair/properties v1.8.7 // indirect
@@ -291,7 +296,6 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
@@ -299,7 +303,7 @@ require (
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // 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
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
@@ -315,32 +319,32 @@ require (
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rubenv/sql-migrate v1.2.0 // indirect
github.com/rubenv/sql-migrate v1.3.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/vbatts/tar-split v0.11.3 // 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
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yashtewari/glob-intersection v0.1.0 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
@@ -352,48 +356,47 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/api v0.114.0 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/api v0.121.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.55.0 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools/v3 v3.1.0 // indirect
helm.sh/helm/v3 v3.11.1 // indirect
k8s.io/apiextensions-apiserver v0.26.0 // indirect
k8s.io/apimachinery v0.26.3 // indirect
k8s.io/apiserver v0.26.2 // indirect
k8s.io/cli-runtime v0.26.3 // indirect
k8s.io/client-go v0.26.3 // indirect
k8s.io/component-base v0.26.3 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/kubectl v0.26.3 // indirect
helm.sh/helm/v3 v3.12.1 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/apimachinery v0.27.4 // indirect
k8s.io/apiserver v0.27.2 // indirect
k8s.io/cli-runtime v0.27.3 // indirect
k8s.io/client-go v0.27.3 // indirect
k8s.io/component-base v0.27.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kubectl v0.27.3 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
modernc.org/ccgo/v3 v3.16.13 // indirect
modernc.org/libc v1.22.2 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/token v1.0.1 // indirect
oras.land/oras-go v1.2.2 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.13.2 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
// v1.2.0 is taken from github.com/open-policy-agent/opa v0.42.0
// v1.2.0 incompatible with github.com/docker/docker v23.0.0-rc.1+incompatible
replace oras.land/oras-go => oras.land/oras-go v1.1.1
// oras 1.2.2 is incompatible with github.com/docker/docker v23.0.0-rc.1+incompatible
replace oras.land/oras-go => oras.land/oras-go v1.2.3

670
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,38 @@
project_name: trivy
builds:
-
- id: build-linux
main: cmd/trivy/main.go
binary: trivy
ldflags:
- -s -w
- "-extldflags '-static'"
- -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- s390x
- ppc64le
goarm:
- 7
- id: build-bsd
main: cmd/trivy/main.go
binary: trivy
ldflags:
- -s -w
- "-extldflags '-static'"
- -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- freebsd
goarch:
# modernc.org/sqlite doesn't support freebsd/arm64, etc.
- amd64
- id: build-macos
main: cmd/trivy/main.go
binary: trivy
ldflags:
@@ -11,36 +43,26 @@ builds:
- CGO_ENABLED=0
goos:
- darwin
- linux
- freebsd
goarch:
- amd64
- arm64
goarm:
- 7
- id: build-windows
main: cmd/trivy/main.go
binary: trivy
ldflags:
- -s -w
- "-extldflags '-static'"
- -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64
- 386
- arm
- arm64
- s390x
- ppc64le
goarm:
- 7
ignore:
- goos: darwin
goarch: 386
# modernc.org/sqlite doesn't support the following pairs
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: arm64
- goos: windows
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: s390x
- goos: windows
goarch: ppc64le
release:
extra_files:
@@ -66,7 +88,6 @@ nfpms:
{{- else if eq .Os "dragonfly" }}DragonFlyBSD
{{- else}}{{- title .Os }}{{ end }}-
{{- if eq .Arch "amd64" }}64bit
{{- else if eq .Arch "386" }}32bit
{{- else if eq .Arch "arm" }}ARM
{{- else if eq .Arch "arm64" }}ARM64
{{- else if eq .Arch "ppc64le" }}PPC64LE
@@ -79,7 +100,7 @@ nfpms:
key_file: '{{ .Env.GPG_FILE }}'
archives:
-
- id: archive
format: tar.gz
name_template: >-
{{ .ProjectName }}_{{ .Version }}_
@@ -91,7 +112,6 @@ archives:
{{- else if eq .Os "dragonfly" }}DragonFlyBSD
{{- else}}{{- .Os }}{{ end }}-
{{- if eq .Arch "amd64" }}64bit
{{- else if eq .Arch "386" }}32bit
{{- else if eq .Arch "arm" }}ARM
{{- else if eq .Arch "arm64" }}ARM64
{{- else if eq .Arch "ppc64le" }}PPC64LE
@@ -127,7 +147,7 @@ dockers:
goos: linux
goarch: amd64
ids:
- trivy
- build-linux
build_flag_templates:
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=A Fast Vulnerability Scanner for Containers"
@@ -152,7 +172,7 @@ dockers:
goos: linux
goarch: arm64
ids:
- trivy
- build-linux
build_flag_templates:
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=A Fast Vulnerability Scanner for Containers"
@@ -177,7 +197,7 @@ dockers:
goos: linux
goarch: s390x
ids:
- trivy
- build-linux
build_flag_templates:
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=A Fast Vulnerability Scanner for Containers"
@@ -202,7 +222,7 @@ dockers:
goos: linux
goarch: ppc64le
ids:
- trivy
- build-linux
build_flag_templates:
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=A Fast Vulnerability Scanner for Containers"

View File

@@ -81,6 +81,7 @@ The following table lists the configurable parameters of the Trivy chart and the
| `service.name` | If specified, the name used for the Trivy service | |
| `service.type` | Kubernetes service type | `ClusterIP` |
| `service.port` | Kubernetes service port | `4954` |
| `service.sessionAffinity` | Kubernetes service session affinity | `ClientIP` |
| `httpProxy` | The URL of the HTTP proxy server | |
| `httpsProxy` | The URL of the HTTPS proxy server | |
| `noProxy` | The URLs that the proxy settings do not apply to | |

View File

@@ -14,4 +14,5 @@ spec:
protocol: TCP
port: {{ .Values.service.port | default 4954 }}
targetPort: {{ .Values.service.port | default 4954 }}
sessionAffinity: ClientIP
sessionAffinity: {{ .Values.service.sessionAffinity | default "ClientIP" }}

View File

@@ -136,6 +136,8 @@ service:
type: ClusterIP
# port Kubernetes service port
port: 4954
# sessionAffinity Kubernetes service session affinity
sessionAffinity: ClientIP
ingress:
enabled: false

View File

@@ -0,0 +1,102 @@
//go:build integration
package integration
import (
"context"
"fmt"
"testing"
"time"
awscommands "github.com/aquasecurity/trivy/pkg/cloud/aws/commands"
"github.com/aquasecurity/trivy/pkg/flag"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
testcontainers "github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/modules/localstack"
)
func TestAwsCommandRun(t *testing.T) {
tests := []struct {
name string
options flag.Options
envs map[string]string
wantErr string
}{
{
name: "fail without region",
options: flag.Options{
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
},
envs: map[string]string{
"AWS_ACCESS_KEY_ID": "test",
"AWS_SECRET_ACCESS_KEY": "test",
},
wantErr: "aws region is required",
},
{
name: "fail without creds",
options: flag.Options{
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
AWSOptions: flag.AWSOptions{
Region: "us-east-1",
},
},
wantErr: "failed to retrieve credentials",
},
}
ctx := context.Background()
localstackC, addr := setupLocalStack(t, ctx)
defer localstackC.Terminate(ctx)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tt.options.AWSOptions.Endpoint = addr
tt.options.GlobalOptions.Timeout = time.Minute
t.Setenv("AWS_PROFILE", "non-existent-profile")
for k, v := range tt.envs {
t.Setenv(k, v)
}
err := awscommands.Run(context.Background(), tt.options)
if tt.wantErr != "" {
require.Error(t, err)
assert.Contains(t, err.Error(), tt.wantErr, tt.name)
return
}
assert.NoError(t, err)
})
}
}
func setupLocalStack(t *testing.T, ctx context.Context) (*localstack.LocalStackContainer, string) {
t.Helper()
container, err := localstack.RunContainer(ctx, testcontainers.CustomizeRequest(
testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
Image: "localstack/localstack:2.2.0",
},
},
))
require.NoError(t, err)
p, err := container.MappedPort(ctx, "4566/tcp")
require.NoError(t, err)
provider, err := testcontainers.NewDockerProvider()
require.NoError(t, err)
defer provider.Close()
host, err := provider.DaemonHost(ctx)
require.NoError(t, err)
return container, fmt.Sprintf("http://%s:%d", host, p.Int())
}

View File

@@ -4,7 +4,6 @@ package integration
import (
"context"
"encoding/json"
"fmt"
"os"
"path/filepath"
@@ -12,15 +11,14 @@ import (
"testing"
"time"
cdx "github.com/CycloneDX/cyclonedx-go"
"github.com/docker/go-connections/nat"
"github.com/samber/lo"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
testcontainers "github.com/testcontainers/testcontainers-go"
"github.com/aquasecurity/trivy/pkg/clock"
"github.com/aquasecurity/trivy/pkg/report"
"github.com/aquasecurity/trivy/pkg/uuid"
)
type csArgs struct {
@@ -236,21 +234,21 @@ func TestClientServer(t *testing.T) {
golden: "testdata/busybox-with-lockfile.json.golden",
},
{
name: "scan pox.xml with fs command in client/server mode",
name: "scan pox.xml with repo command in client/server mode",
args: csArgs{
Command: "fs",
Command: "repo",
RemoteAddrOption: "--server",
Target: "testdata/fixtures/fs/pom/",
Target: "testdata/fixtures/repo/pom/",
},
golden: "testdata/pom.json.golden",
},
{
name: "scan sample.pem with fs command in client/server mode",
name: "scan sample.pem with repo command in client/server mode",
args: csArgs{
Command: "fs",
Command: "repo",
RemoteAddrOption: "--server",
secretConfig: "testdata/fixtures/fs/secrets/trivy-secret.yaml",
Target: "testdata/fixtures/fs/secrets/",
secretConfig: "testdata/fixtures/repo/secrets/trivy-secret.yaml",
Target: "testdata/fixtures/repo/secrets/",
},
golden: "testdata/secrets.json.golden",
},
@@ -279,7 +277,7 @@ func TestClientServer(t *testing.T) {
err := execute(osArgs)
require.NoError(t, err)
compareReports(t, c.golden, outputFile)
compareReports(t, c.golden, outputFile, nil)
})
}
}
@@ -328,11 +326,11 @@ func TestClientServerWithFormat(t *testing.T) {
{
name: "scan secrets with ASFF template",
args: csArgs{
Command: "fs",
Command: "repo",
RemoteAddrOption: "--server",
Format: "template",
TemplatePath: "@../contrib/asff.tpl",
Target: "testdata/fixtures/fs/secrets/",
Target: "testdata/fixtures/repo/secrets/",
},
golden: "testdata/secrets.asff.golden",
},
@@ -403,10 +401,9 @@ func TestClientServerWithFormat(t *testing.T) {
func TestClientServerWithCycloneDX(t *testing.T) {
tests := []struct {
name string
args csArgs
wantComponentsCount int
wantDependenciesCount int
name string
args csArgs
golden string
}{
{
name: "fluentd with RubyGems with CycloneDX format",
@@ -414,30 +411,23 @@ func TestClientServerWithCycloneDX(t *testing.T) {
Format: "cyclonedx",
Input: "testdata/fixtures/images/fluentd-multiple-lockfiles.tar.gz",
},
wantComponentsCount: 161,
wantDependenciesCount: 80,
golden: "testdata/fluentd-multiple-lockfiles.cdx.json.golden",
},
}
addr, cacheDir := setup(t, setupOptions{})
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
osArgs, outputFile := setupClient(t, tt.args, addr, cacheDir, "")
clock.SetFakeTime(t, time.Date(2020, 9, 10, 14, 20, 30, 5, time.UTC))
uuid.SetFakeUUID(t, "3ff14136-e09f-4df9-80ea-%012d")
osArgs, outputFile := setupClient(t, tt.args, addr, cacheDir, tt.golden)
// Run Trivy client
err := execute(osArgs)
require.NoError(t, err)
f, err := os.Open(outputFile)
require.NoError(t, err)
defer f.Close()
var got cdx.BOM
err = json.NewDecoder(f).Decode(&got)
require.NoError(t, err)
assert.EqualValues(t, tt.wantComponentsCount, len(lo.FromPtr(got.Components)))
assert.EqualValues(t, tt.wantDependenciesCount, len(lo.FromPtr(got.Dependencies)))
compareCycloneDX(t, tt.golden, outputFile)
})
}
}
@@ -498,7 +488,7 @@ func TestClientServerWithToken(t *testing.T) {
}
require.NoError(t, err, c.name)
compareReports(t, c.golden, outputFile)
compareReports(t, c.golden, outputFile, nil)
})
}
}
@@ -525,7 +515,7 @@ func TestClientServerWithRedis(t *testing.T) {
err := execute(osArgs)
require.NoError(t, err)
compareReports(t, golden, outputFile)
compareReports(t, golden, outputFile, nil)
})
// Terminate the Redis container

View File

@@ -18,11 +18,15 @@ import (
)
func TestDockerEngine(t *testing.T) {
if *update {
t.Skipf("This test doesn't update golden files")
}
tests := []struct {
name string
imageTag string
invalidImage bool
ignoreUnfixed bool
ignoreStatus []string
severity []string
ignoreIDs []string
input string
@@ -98,6 +102,13 @@ func TestDockerEngine(t *testing.T) {
input: "testdata/fixtures/images/centos-7.tar.gz",
golden: "testdata/centos-7-ignore-unfixed.json.golden",
},
{
name: "centos 7, with --ignore-status option",
imageTag: "ghcr.io/aquasecurity/trivy-test-images:centos-7",
ignoreStatus: []string{"will_not_fix"},
input: "testdata/fixtures/images/centos-7.tar.gz",
golden: "testdata/centos-7-ignore-unfixed.json.golden",
},
{
name: "centos 7, with --ignore-unfixed option, with medium severity",
imageTag: "ghcr.io/aquasecurity/trivy-test-images:centos-7",
@@ -125,6 +136,13 @@ func TestDockerEngine(t *testing.T) {
input: "testdata/fixtures/images/debian-buster.tar.gz",
golden: "testdata/debian-buster-ignore-unfixed.json.golden",
},
{
name: "debian buster/10, with --ignore-status option",
ignoreStatus: []string{"affected"},
imageTag: "ghcr.io/aquasecurity/trivy-test-images:debian-buster",
input: "testdata/fixtures/images/debian-buster.tar.gz",
golden: "testdata/debian-buster-ignore-unfixed.json.golden",
},
{
name: "debian stretch/9",
imageTag: "ghcr.io/aquasecurity/trivy-test-images:debian-stretch",
@@ -237,6 +255,12 @@ func TestDockerEngine(t *testing.T) {
if tt.ignoreUnfixed {
osArgs = append(osArgs, "--ignore-unfixed")
}
if len(tt.ignoreStatus) != 0 {
osArgs = append(osArgs,
[]string{"--ignore-status", strings.Join(tt.ignoreStatus, ",")}...,
)
}
if len(tt.severity) != 0 {
osArgs = append(osArgs,
[]string{"--severity", strings.Join(tt.severity, ",")}...,
@@ -261,7 +285,7 @@ func TestDockerEngine(t *testing.T) {
assert.NoError(t, err, tt.name)
// check for vulnerability output info
compareReports(t, tt.golden, output)
compareReports(t, tt.golden, output, nil)
// cleanup
_, err = cli.ImageRemove(ctx, tt.input, api.ImageRemoveOptions{

View File

@@ -1,4 +1,4 @@
//go:build integration || vm_integration || module_integration
//go:build integration || vm_integration || module_integration || k8s_integration
package integration
@@ -11,18 +11,20 @@ import (
"os"
"path/filepath"
"sort"
"strings"
"testing"
"time"
cdx "github.com/CycloneDX/cyclonedx-go"
"github.com/samber/lo"
spdxjson "github.com/spdx/tools-golang/json"
"github.com/spdx/tools-golang/spdx"
"github.com/stretchr/testify/assert"
"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/pkg/commands"
"github.com/aquasecurity/trivy/pkg/dbtest"
"github.com/aquasecurity/trivy/pkg/types"
@@ -138,10 +140,7 @@ func readCycloneDX(t *testing.T, filePath string) *cdx.BOM {
err = decoder.Decode(bom)
require.NoError(t, err)
// We don't compare values which change each time an SBOM is generated
bom.Metadata.Timestamp = ""
bom.Metadata.Component.BOMRef = ""
bom.SerialNumber = ""
// Sort components
if bom.Components != nil {
sort.Slice(*bom.Components, func(i, j int) bool {
return (*bom.Components)[i].Name < (*bom.Components)[j].Name
@@ -153,12 +152,6 @@ func readCycloneDX(t *testing.T, filePath string) *cdx.BOM {
})
}
}
if bom.Dependencies != nil {
for j := range *bom.Dependencies {
(*bom.Dependencies)[j].Ref = ""
(*bom.Dependencies)[j].Dependencies = nil
}
}
return bom
}
@@ -178,6 +171,10 @@ func readSpdxJson(t *testing.T, filePath string) *spdx.Document {
return bom.Relationships[i].RefB.ElementRefID < bom.Relationships[j].RefB.ElementRefID
})
sort.Slice(bom.Files, func(i, j int) bool {
return bom.Files[i].FileSPDXIdentifier < bom.Files[j].FileSPDXIdentifier
})
// We don't compare values which change each time an SBOM is generated
bom.CreationInfo.Created = ""
bom.DocumentNamespace = ""
@@ -195,9 +192,12 @@ func execute(osArgs []string) error {
return app.Execute()
}
func compareReports(t *testing.T, wantFile, gotFile string) {
func compareReports(t *testing.T, wantFile, gotFile string, override func(*types.Report)) {
want := readReport(t, wantFile)
got := readReport(t, gotFile)
if override != nil {
override(&want)
}
assert.Equal(t, want, got)
}
@@ -205,6 +205,20 @@ func compareCycloneDX(t *testing.T, wantFile, gotFile string) {
want := readCycloneDX(t, wantFile)
got := readCycloneDX(t, gotFile)
assert.Equal(t, want, got)
// Validate CycloneDX output against the JSON schema
schemaLoader := gojsonschema.NewReferenceLoader(got.JSONSchema)
documentLoader := gojsonschema.NewGoLoader(got)
result, err := gojsonschema.Validate(schemaLoader, documentLoader)
require.NoError(t, err)
if valid := result.Valid(); !valid {
errs := lo.Map(result.Errors(), func(err gojsonschema.ResultError, _ int) string {
return err.String()
})
assert.True(t, valid, strings.Join(errs, "\n"))
}
}
func compareSpdxJson(t *testing.T, wantFile, gotFile string) {

112
integration/k8s_test.go Normal file
View File

@@ -0,0 +1,112 @@
//go:build k8s_integration
package integration
import (
"encoding/json"
"os"
"path/filepath"
"testing"
cdx "github.com/CycloneDX/cyclonedx-go"
"github.com/aquasecurity/trivy/pkg/k8s/report"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/samber/lo"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// Note: the test required k8s (kind) cluster installed.
// "mage test:k8s" will run this test.
func TestK8s(t *testing.T) {
t.Run("misconfig and vulnerability scan", func(t *testing.T) {
// Set up the output file
outputFile := filepath.Join(t.TempDir(), "output.json")
osArgs := []string{
"k8s",
"cluster",
"--report",
"summary",
"-q",
"--timeout",
"5m0s",
"--format",
"json",
"--components",
"workload",
"--context",
"kind-kind-test",
"--output",
outputFile,
}
// Run Trivy
err := execute(osArgs)
require.NoError(t, err)
var got report.ConsolidatedReport
f, err := os.Open(outputFile)
require.NoError(t, err)
defer f.Close()
err = json.NewDecoder(f).Decode(&got)
require.NoError(t, err)
// Flatten findings
results := lo.FlatMap(got.Findings, func(resource report.Resource, _ int) []types.Result {
return resource.Results
})
// Has vulnerabilities
assert.True(t, lo.SomeBy(results, func(r types.Result) bool {
return len(r.Vulnerabilities) > 0
}))
// Has misconfigurations
assert.True(t, lo.SomeBy(results, func(r types.Result) bool {
return len(r.Misconfigurations) > 0
}))
})
t.Run("kbom cycloneDx", func(t *testing.T) {
// Set up the output file
outputFile := filepath.Join(t.TempDir(), "output.json")
osArgs := []string{
"k8s",
"cluster",
"--format",
"cyclonedx",
"-q",
"--context",
"kind-kind-test",
"--output",
outputFile,
}
// Run Trivy
err := execute(osArgs)
require.NoError(t, err)
var got *cdx.BOM
f, err := os.Open(outputFile)
require.NoError(t, err)
defer f.Close()
err = json.NewDecoder(f).Decode(&got)
require.NoError(t, err)
assert.Equal(t, got.Metadata.Component.Name, "kind-kind-test")
assert.Equal(t, got.Metadata.Component.Type, cdx.ComponentType("platform"))
// Has components
assert.True(t, len(*got.Components) > 0)
// Has dependecies
assert.True(t, lo.SomeBy(*got.Dependencies, func(r cdx.Dependency) bool {
return len(*r.Dependencies) > 0
}))
})
}

View File

@@ -1,4 +1,5 @@
//go:build module_integration
package integration
import (
@@ -70,7 +71,7 @@ func TestModule(t *testing.T) {
}()
// Compare want and got
compareReports(t, tt.golden, outputFile)
compareReports(t, tt.golden, outputFile, nil)
})
}
}

View File

@@ -1,5 +1,4 @@
//go:build integration
// +build integration
package integration
@@ -8,17 +7,21 @@ import (
"path/filepath"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aquasecurity/trivy/pkg/clock"
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
"github.com/aquasecurity/trivy/pkg/types"
"github.com/aquasecurity/trivy/pkg/uuid"
)
func TestFilesystem(t *testing.T) {
// TestRepository tests `trivy repo` with the local code repositories
func TestRepository(t *testing.T) {
type args struct {
scanner types.Scanner
severity []string
ignoreIDs []string
policyPaths []string
namespaces []string
@@ -31,18 +34,20 @@ func TestFilesystem(t *testing.T) {
skipFiles []string
skipDirs []string
command string
format string
format types.Format
includeDevDeps bool
}
tests := []struct {
name string
args args
golden string
name string
args args
golden string
override func(*types.Report)
}{
{
name: "gomod",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/gomod",
input: "testdata/fixtures/repo/gomod",
},
golden: "testdata/gomod.json.golden",
},
@@ -50,8 +55,8 @@ func TestFilesystem(t *testing.T) {
name: "gomod with skip files",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/gomod",
skipFiles: []string{"testdata/fixtures/fs/gomod/submod2/go.mod"},
input: "testdata/fixtures/repo/gomod",
skipFiles: []string{"testdata/fixtures/repo/gomod/submod2/go.mod"},
},
golden: "testdata/gomod-skip.json.golden",
},
@@ -59,8 +64,8 @@ func TestFilesystem(t *testing.T) {
name: "gomod with skip dirs",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/gomod",
skipDirs: []string{"testdata/fixtures/fs/gomod/submod2"},
input: "testdata/fixtures/repo/gomod",
skipDirs: []string{"testdata/fixtures/repo/gomod/submod2"},
},
golden: "testdata/gomod-skip.json.golden",
},
@@ -68,16 +73,26 @@ func TestFilesystem(t *testing.T) {
name: "npm",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/npm",
input: "testdata/fixtures/repo/npm",
listAllPkgs: true,
},
golden: "testdata/npm.json.golden",
},
{
name: "npm with dev deps",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/repo/npm",
listAllPkgs: true,
includeDevDeps: true,
},
golden: "testdata/npm-with-dev.json.golden",
},
{
name: "yarn",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/yarn",
input: "testdata/fixtures/repo/yarn",
listAllPkgs: true,
},
golden: "testdata/yarn.json.golden",
@@ -86,7 +101,7 @@ func TestFilesystem(t *testing.T) {
name: "pnpm",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/pnpm",
input: "testdata/fixtures/repo/pnpm",
},
golden: "testdata/pnpm.json.golden",
},
@@ -95,7 +110,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/pip",
input: "testdata/fixtures/repo/pip",
},
golden: "testdata/pip.json.golden",
},
@@ -104,7 +119,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/pipenv",
input: "testdata/fixtures/repo/pipenv",
},
golden: "testdata/pipenv.json.golden",
},
@@ -113,7 +128,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/poetry",
input: "testdata/fixtures/repo/poetry",
},
golden: "testdata/poetry.json.golden",
},
@@ -121,7 +136,7 @@ func TestFilesystem(t *testing.T) {
name: "pom",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/pom",
input: "testdata/fixtures/repo/pom",
},
golden: "testdata/pom.json.golden",
},
@@ -129,7 +144,7 @@ func TestFilesystem(t *testing.T) {
name: "gradle",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/fs/gradle",
input: "testdata/fixtures/repo/gradle",
},
golden: "testdata/gradle.json.golden",
},
@@ -138,7 +153,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/conan",
input: "testdata/fixtures/repo/conan",
},
golden: "testdata/conan.json.golden",
},
@@ -147,7 +162,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/nuget",
input: "testdata/fixtures/repo/nuget",
},
golden: "testdata/nuget.json.golden",
},
@@ -156,7 +171,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/dotnet",
input: "testdata/fixtures/repo/dotnet",
},
golden: "testdata/dotnet.json.golden",
},
@@ -165,7 +180,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/cocoapods",
input: "testdata/fixtures/repo/cocoapods",
},
golden: "testdata/cocoapods.json.golden",
},
@@ -174,7 +189,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/pubspec",
input: "testdata/fixtures/repo/pubspec",
},
golden: "testdata/pubspec.lock.json.golden",
},
@@ -183,7 +198,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/mixlock",
input: "testdata/fixtures/repo/mixlock",
},
golden: "testdata/mix.lock.json.golden",
},
@@ -192,7 +207,7 @@ func TestFilesystem(t *testing.T) {
args: args{
scanner: types.VulnerabilityScanner,
listAllPkgs: true,
input: "testdata/fixtures/fs/composer",
input: "testdata/fixtures/repo/composer",
},
golden: "testdata/composer.lock.json.golden",
},
@@ -200,7 +215,7 @@ func TestFilesystem(t *testing.T) {
name: "dockerfile",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/dockerfile",
input: "testdata/fixtures/repo/dockerfile",
namespaces: []string{"testing"},
},
golden: "testdata/dockerfile.json.golden",
@@ -209,7 +224,7 @@ func TestFilesystem(t *testing.T) {
name: "dockerfile with custom file pattern",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/dockerfile_file_pattern",
input: "testdata/fixtures/repo/dockerfile_file_pattern",
namespaces: []string{"testing"},
filePatterns: []string{"dockerfile:Customfile"},
},
@@ -219,8 +234,8 @@ func TestFilesystem(t *testing.T) {
name: "dockerfile with rule exception",
args: args{
scanner: types.MisconfigScanner,
policyPaths: []string{"testdata/fixtures/fs/rule-exception/policy"},
input: "testdata/fixtures/fs/rule-exception",
policyPaths: []string{"testdata/fixtures/repo/rule-exception/policy"},
input: "testdata/fixtures/repo/rule-exception",
},
golden: "testdata/dockerfile-rule-exception.json.golden",
},
@@ -228,8 +243,8 @@ func TestFilesystem(t *testing.T) {
name: "dockerfile with namespace exception",
args: args{
scanner: types.MisconfigScanner,
policyPaths: []string{"testdata/fixtures/fs/namespace-exception/policy"},
input: "testdata/fixtures/fs/namespace-exception",
policyPaths: []string{"testdata/fixtures/repo/namespace-exception/policy"},
input: "testdata/fixtures/repo/namespace-exception",
},
golden: "testdata/dockerfile-namespace-exception.json.golden",
},
@@ -237,9 +252,9 @@ func TestFilesystem(t *testing.T) {
name: "dockerfile with custom policies",
args: args{
scanner: types.MisconfigScanner,
policyPaths: []string{"testdata/fixtures/fs/custom-policy/policy"},
policyPaths: []string{"testdata/fixtures/repo/custom-policy/policy"},
namespaces: []string{"user"},
input: "testdata/fixtures/fs/custom-policy",
input: "testdata/fixtures/repo/custom-policy",
},
golden: "testdata/dockerfile-custom-policies.json.golden",
},
@@ -247,7 +262,7 @@ func TestFilesystem(t *testing.T) {
name: "tarball helm chart scanning with builtin policies",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/helm",
input: "testdata/fixtures/repo/helm",
},
golden: "testdata/helm.json.golden",
},
@@ -255,7 +270,7 @@ func TestFilesystem(t *testing.T) {
name: "helm chart directory scanning with builtin policies",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/helm_testchart",
input: "testdata/fixtures/repo/helm_testchart",
},
golden: "testdata/helm_testchart.json.golden",
},
@@ -263,7 +278,7 @@ func TestFilesystem(t *testing.T) {
name: "helm chart directory scanning with value overrides using set",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/helm_testchart",
input: "testdata/fixtures/repo/helm_testchart",
helmSet: []string{"securityContext.runAsUser=0"},
},
golden: "testdata/helm_testchart.overridden.json.golden",
@@ -272,8 +287,8 @@ func TestFilesystem(t *testing.T) {
name: "helm chart directory scanning with value overrides using value file",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/helm_testchart",
helmValuesFile: []string{"testdata/fixtures/fs/helm_values/values.yaml"},
input: "testdata/fixtures/repo/helm_testchart",
helmValuesFile: []string{"testdata/fixtures/repo/helm_values/values.yaml"},
},
golden: "testdata/helm_testchart.overridden.json.golden",
},
@@ -281,7 +296,7 @@ func TestFilesystem(t *testing.T) {
name: "helm chart directory scanning with builtin policies and non string Chart name",
args: args{
scanner: types.MisconfigScanner,
input: "testdata/fixtures/fs/helm_badname",
input: "testdata/fixtures/repo/helm_badname",
},
golden: "testdata/helm_badname.json.golden",
},
@@ -289,8 +304,8 @@ func TestFilesystem(t *testing.T) {
name: "secrets",
args: args{
scanner: "vuln,secret",
input: "testdata/fixtures/fs/secrets",
secretConfig: "testdata/fixtures/fs/secrets/trivy-secret.yaml",
input: "testdata/fixtures/repo/secrets",
secretConfig: "testdata/fixtures/repo/secrets/trivy-secret.yaml",
},
golden: "testdata/secrets.json.golden",
},
@@ -299,7 +314,7 @@ func TestFilesystem(t *testing.T) {
args: args{
command: "rootfs",
format: "cyclonedx",
input: "testdata/fixtures/fs/conda",
input: "testdata/fixtures/repo/conda",
},
golden: "testdata/conda-cyclonedx.json.golden",
},
@@ -308,10 +323,37 @@ func TestFilesystem(t *testing.T) {
args: args{
command: "rootfs",
format: "spdx-json",
input: "testdata/fixtures/fs/conda",
input: "testdata/fixtures/repo/conda",
},
golden: "testdata/conda-spdx.json.golden",
},
{
name: "gomod with fs subcommand",
args: args{
command: "fs",
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/repo/gomod",
skipFiles: []string{"testdata/fixtures/repo/gomod/submod2/go.mod"},
},
golden: "testdata/gomod-skip.json.golden",
override: func(report *types.Report) {
report.ArtifactType = ftypes.ArtifactFilesystem
},
},
{
name: "dockerfile with fs subcommand",
args: args{
command: "fs",
scanner: types.MisconfigScanner,
policyPaths: []string{"testdata/fixtures/repo/custom-policy/policy"},
namespaces: []string{"user"},
input: "testdata/fixtures/repo/custom-policy",
},
golden: "testdata/dockerfile-custom-policies.json.golden",
override: func(report *types.Report) {
report.ArtifactType = ftypes.ArtifactFilesystem
},
},
}
// Set up testing DB
@@ -323,12 +365,12 @@ func TestFilesystem(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
command := "fs"
command := "repo"
if tt.args.command != "" {
command = tt.args.command
}
format := "json"
format := types.FormatJSON
if tt.args.format != "" {
format = tt.args.format
}
@@ -341,7 +383,7 @@ func TestFilesystem(t *testing.T) {
"--skip-db-update",
"--skip-policy-update",
"--format",
format,
string(format),
"--offline-scan",
}
@@ -361,10 +403,6 @@ func TestFilesystem(t *testing.T) {
}
}
if len(tt.args.severity) != 0 {
osArgs = append(osArgs, "--severity", strings.Join(tt.args.severity, ","))
}
if len(tt.args.ignoreIDs) != 0 {
trivyIgnore := ".trivyignore"
err := os.WriteFile(trivyIgnore, []byte(strings.Join(tt.args.ignoreIDs, "\n")), 0444)
@@ -404,7 +442,7 @@ func TestFilesystem(t *testing.T) {
// Setup the output file
outputFile := filepath.Join(t.TempDir(), "output.json")
if *update {
if *update && tt.override == nil {
outputFile = tt.golden
}
@@ -412,6 +450,10 @@ func TestFilesystem(t *testing.T) {
osArgs = append(osArgs, "--list-all-pkgs")
}
if tt.args.includeDevDeps {
osArgs = append(osArgs, "--include-dev-deps")
}
if tt.args.secretConfig != "" {
osArgs = append(osArgs, "--secret-config", tt.args.secretConfig)
}
@@ -419,18 +461,21 @@ func TestFilesystem(t *testing.T) {
osArgs = append(osArgs, "--output", outputFile)
osArgs = append(osArgs, tt.args.input)
// Run "trivy fs"
clock.SetFakeTime(t, time.Date(2020, 9, 10, 14, 20, 30, 5, time.UTC))
uuid.SetFakeUUID(t, "3ff14136-e09f-4df9-80ea-%012d")
// Run "trivy repo"
err := execute(osArgs)
require.NoError(t, err)
// Compare want and got
switch format {
case "cyclonedx":
case types.FormatCycloneDX:
compareCycloneDX(t, tt.golden, outputFile)
case "spdx-json":
case types.FormatSPDXJSON:
compareSpdxJson(t, tt.golden, outputFile)
case "json":
compareReports(t, tt.golden, outputFile)
case types.FormatJSON:
compareReports(t, tt.golden, outputFile, tt.override)
default:
require.Fail(t, "invalid format", "format: %s", format)
}

View File

@@ -30,28 +30,56 @@ func TestSBOM(t *testing.T) {
name: "centos7 cyclonedx",
args: args{
input: "testdata/fixtures/sbom/centos-7-cyclonedx.json",
format: "cyclonedx",
format: "json",
artifactType: "cyclonedx",
},
golden: "testdata/centos-7-cyclonedx.json.golden",
golden: "testdata/centos-7.json.golden",
override: types.Report{
ArtifactName: "testdata/fixtures/sbom/centos-7-cyclonedx.json",
ArtifactType: ftypes.ArtifactType("cyclonedx"),
Results: types.Results{
{
Target: "testdata/fixtures/sbom/centos-7-cyclonedx.json (centos 7.6.1810)",
Vulnerabilities: []types.DetectedVulnerability{
{PkgRef: "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810"},
{PkgRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"},
{PkgRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"},
},
},
},
},
},
{
name: "fluentd-multiple-lockfiles cyclonedx",
args: args{
input: "testdata/fixtures/sbom/fluentd-multiple-lockfiles-cyclonedx.json",
format: "cyclonedx",
format: "json",
artifactType: "cyclonedx",
},
golden: "testdata/fluentd-multiple-lockfiles-cyclonedx.json.golden",
golden: "testdata/fluentd-multiple-lockfiles.json.golden",
},
{
name: "centos7 in in-toto attestation",
args: args{
input: "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl",
format: "cyclonedx",
format: "json",
artifactType: "cyclonedx",
},
golden: "testdata/centos-7-cyclonedx.json.golden",
golden: "testdata/centos-7.json.golden",
override: types.Report{
ArtifactName: "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl",
ArtifactType: ftypes.ArtifactType("cyclonedx"),
Results: types.Results{
{
Target: "testdata/fixtures/sbom/centos-7-cyclonedx.intoto.jsonl (centos 7.6.1810)",
Vulnerabilities: []types.DetectedVulnerability{
{PkgRef: "pkg:rpm/centos/bash@4.2.46-31.el7?arch=x86_64&distro=centos-7.6.1810"},
{PkgRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"},
{PkgRef: "pkg:rpm/centos/openssl-libs@1.0.2k-16.el7?arch=x86_64&epoch=1&distro=centos-7.6.1810"},
},
},
},
},
},
{
name: "centos7 spdx tag-value",
@@ -131,8 +159,6 @@ func TestSBOM(t *testing.T) {
// Compare want and got
switch tt.args.format {
case "cyclonedx":
compareCycloneDX(t, tt.golden, outputFile)
case "json":
compareSBOMReports(t, tt.golden, outputFile, tt.override)
default:
@@ -146,8 +172,12 @@ func TestSBOM(t *testing.T) {
func compareSBOMReports(t *testing.T, wantFile, gotFile string, overrideWant types.Report) {
want := readReport(t, wantFile)
want.ArtifactName = overrideWant.ArtifactName
want.ArtifactType = overrideWant.ArtifactType
if overrideWant.ArtifactName != "" {
want.ArtifactName = overrideWant.ArtifactName
}
if overrideWant.ArtifactType != "" {
want.ArtifactType = overrideWant.ArtifactType
}
want.Metadata.ImageID = ""
want.Metadata.ImageConfig = v1.ConfigFile{}
want.Metadata.DiffIDs = nil

View File

@@ -134,9 +134,12 @@ func TestTar(t *testing.T) {
name: "alpine 3.9 with high and critical severity",
testArgs: args{
IgnoreUnfixed: true,
Severity: []string{"HIGH", "CRITICAL"},
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
Severity: []string{
"HIGH",
"CRITICAL",
},
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
},
golden: "testdata/alpine-39-high-critical.json.golden",
},
@@ -144,9 +147,12 @@ func TestTar(t *testing.T) {
name: "alpine 3.9 with .trivyignore",
testArgs: args{
IgnoreUnfixed: false,
IgnoreIDs: []string{"CVE-2019-1549", "CVE-2019-14697"},
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
IgnoreIDs: []string{
"CVE-2019-1549",
"CVE-2019-14697",
},
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
},
golden: "testdata/alpine-39-ignore-cveids.json.golden",
},
@@ -358,7 +364,15 @@ func TestTar(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
osArgs := []string{"--cache-dir", cacheDir, "image", "-q", "--format", tt.testArgs.Format, "--skip-update"}
osArgs := []string{
"--cache-dir",
cacheDir,
"image",
"-q",
"--format",
tt.testArgs.Format,
"--skip-update",
}
if tt.testArgs.IgnoreUnfixed {
osArgs = append(osArgs, "--ignore-unfixed")
@@ -394,14 +408,187 @@ func TestTar(t *testing.T) {
outputFile = tt.golden
}
osArgs = append(osArgs, []string{"--output", outputFile}...)
osArgs = append(osArgs, []string{
"--output",
outputFile,
}...)
// Run Trivy
err := execute(osArgs)
require.NoError(t, err)
// Compare want and got
compareReports(t, tt.golden, outputFile)
compareReports(t, tt.golden, outputFile, nil)
})
}
}
func TestTarWithEnv(t *testing.T) {
type args struct {
IgnoreUnfixed bool
Severity []string
Format string
Input string
SkipDirs []string
}
tests := []struct {
name string
testArgs args
golden string
}{
{
name: "alpine 3.9 with skip dirs",
testArgs: args{
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
SkipDirs: []string{
"/etc",
},
},
golden: "testdata/alpine-39-skip.json.golden",
},
{
name: "alpine 3.9 with high and critical severity",
testArgs: args{
IgnoreUnfixed: true,
Severity: []string{
"HIGH",
"CRITICAL",
},
Format: "json",
Input: "testdata/fixtures/images/alpine-39.tar.gz",
},
golden: "testdata/alpine-39-high-critical.json.golden",
},
{
name: "debian buster/10 with --ignore-unfixed option",
testArgs: args{
IgnoreUnfixed: true,
Format: "json",
Input: "testdata/fixtures/images/debian-buster.tar.gz",
},
golden: "testdata/debian-buster-ignore-unfixed.json.golden",
},
}
// Set up testing DB
cacheDir := initDB(t)
// Set a temp dir so that modules will not be loaded
t.Setenv("XDG_DATA_HOME", cacheDir)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
osArgs := []string{"image"}
t.Setenv("TRIVY_FORMAT", tt.testArgs.Format)
t.Setenv("TRIVY_CACHE_DIR", cacheDir)
t.Setenv("TRIVY_QUIET", "true")
t.Setenv("TRIVY_SKIP_UPDATE", "true")
if tt.testArgs.IgnoreUnfixed {
t.Setenv("TRIVY_IGNORE_UNFIXED", "true")
}
if len(tt.testArgs.Severity) != 0 {
t.Setenv("TRIVY_SEVERITY", strings.Join(tt.testArgs.Severity, ","))
}
if tt.testArgs.Input != "" {
osArgs = append(osArgs, "--input", tt.testArgs.Input)
}
if len(tt.testArgs.SkipDirs) != 0 {
t.Setenv("TRIVY_SKIP_DIRS", strings.Join(tt.testArgs.SkipDirs, ","))
}
// Set up the output file
outputFile := filepath.Join(t.TempDir(), "output.json")
osArgs = append(osArgs, []string{
"--output",
outputFile,
}...)
// Run Trivy
err := execute(osArgs)
require.NoError(t, err)
// Compare want and got
compareReports(t, tt.golden, outputFile, nil)
})
}
}
func TestTarWithConfigFile(t *testing.T) {
tests := []struct {
name string
input string
configFile string
golden string
}{
{
name: "alpine 3.9 with high and critical severity",
input: "testdata/fixtures/images/alpine-39.tar.gz",
configFile: `quiet: true
format: json
severity:
- HIGH
- CRITICAL
vulnerability:
type:
- os
cache:
dir: /should/be/overwritten
`,
golden: "testdata/alpine-39-high-critical.json.golden",
},
{
name: "debian buster/10 with --ignore-unfixed option",
input: "testdata/fixtures/images/debian-buster.tar.gz",
configFile: `quiet: true
format: json
vulnerability:
ignore-unfixed: true
cache:
dir: /should/be/overwritten
`,
golden: "testdata/debian-buster-ignore-unfixed.json.golden",
},
}
// Set up testing DB
cacheDir := initDB(t)
// Set a temp dir so that modules will not be loaded
t.Setenv("XDG_DATA_HOME", cacheDir)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tmpDir := t.TempDir()
outputFile := filepath.Join(tmpDir, "output.json")
configPath := filepath.Join(tmpDir, "trivy.yaml")
err := os.WriteFile(configPath, []byte(tt.configFile), 0600)
require.NoError(t, err)
osArgs := []string{
"--cache-dir",
cacheDir,
"image",
"--skip-db-update",
"--config",
configPath,
"--input",
tt.input,
"--output",
outputFile,
}
// Run Trivy
err = execute(osArgs)
require.NoError(t, err)
// Compare want and got
compareReports(t, tt.golden, outputFile, nil)
})
}
}

View File

@@ -57,6 +57,7 @@
"PkgName": "openssl-libs",
"InstalledVersion": "1:1.1.1k-4.el8",
"FixedVersion": "1:1.1.1k-5.el8_5",
"Status": "fixed",
"Layer": {
"Digest": "sha256:a1f18d9dc5496c63197eb9a4f1d4bf5cc88c6a34f64f0fe11ea233070392ce48",
"DiffID": "sha256:124d41c237c5e823577dda97e87cebaecce62d585c725d07e709ce410681de4d"

View File

@@ -1,6 +1,6 @@
{
"SchemaVersion": 2,
"ArtifactName": "localhost:63577/alpine:3.10",
"ArtifactName": "localhost:55844/alpine:3.10",
"ArtifactType": "container_image",
"Metadata": {
"OS": {
@@ -13,10 +13,10 @@
"sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
],
"RepoTags": [
"localhost:63577/alpine:3.10"
"localhost:55844/alpine:3.10"
],
"RepoDigests": [
"localhost:63577/alpine@sha256:d9b1a0d4fab413443a22e550cb8720de487295cebca3f9b2fcbf8882192a9bf9"
"localhost:55844/alpine@sha256:b1c5a500182b21d0bfa5a584a8526b56d8be316f89e87d951be04abed2446e60"
],
"ImageConfig": {
"architecture": "amd64",
@@ -55,7 +55,7 @@
},
"Results": [
{
"Target": "localhost:63577/alpine:3.10 (alpine 3.10.2)",
"Target": "localhost:55844/alpine:3.10 (alpine 3.10.2)",
"Class": "os-pkgs",
"Type": "alpine",
"Vulnerabilities": [
@@ -65,8 +65,9 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:3489774ebf88fb1f0b08e0abb45826a3cbd9d0eb6458d5fc54729197feddffb9",
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
},
"SeveritySource": "nvd",
@@ -125,8 +126,9 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:3489774ebf88fb1f0b08e0abb45826a3cbd9d0eb6458d5fc54729197feddffb9",
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
},
"SeveritySource": "nvd",
@@ -195,8 +197,9 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:3489774ebf88fb1f0b08e0abb45826a3cbd9d0eb6458d5fc54729197feddffb9",
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
},
"SeveritySource": "nvd",
@@ -255,8 +258,9 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:3489774ebf88fb1f0b08e0abb45826a3cbd9d0eb6458d5fc54729197feddffb9",
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
},
"SeveritySource": "nvd",
@@ -322,4 +326,4 @@
]
}
]
}
}

View File

@@ -59,6 +59,7 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
@@ -119,6 +120,7 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
@@ -189,6 +191,7 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
@@ -249,6 +252,7 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1c-r0",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",
"DiffID": "sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"

View File

@@ -1,6 +1,6 @@
{
"version": "2.1.0",
"$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
"runs": [
{
"tool": {

View File

@@ -59,6 +59,7 @@
"PkgName": "musl",
"InstalledVersion": "1.1.20-r4",
"FixedVersion": "1.1.20-r5",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -97,6 +98,7 @@
"PkgName": "musl-utils",
"InstalledVersion": "1.1.20-r4",
"FixedVersion": "1.1.20-r5",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"

View File

@@ -59,6 +59,7 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -129,6 +130,7 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"

View File

@@ -59,6 +59,7 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -119,6 +120,7 @@
"PkgName": "libcrypto1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -189,6 +191,7 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -249,6 +252,7 @@
"PkgName": "libssl1.1",
"InstalledVersion": "1.1.1b-r1",
"FixedVersion": "1.1.1d-r2",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -319,6 +323,7 @@
"PkgName": "musl",
"InstalledVersion": "1.1.20-r4",
"FixedVersion": "1.1.20-r5",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"
@@ -357,6 +362,7 @@
"PkgName": "musl-utils",
"InstalledVersion": "1.1.20-r4",
"FixedVersion": "1.1.20-r5",
"Status": "fixed",
"Layer": {
"Digest": "sha256:e7c96db7181be991f19a9fb6975cdbbd73c65f4a2681348e63a141a2192a5f10",
"DiffID": "sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81"

View File

@@ -54,6 +54,7 @@
"PkgName": "git",
"InstalledVersion": "2.35.1-r2",
"FixedVersion": "2.35.2-r0",
"Status": "fixed",
"Layer": {
"Digest": "sha256:6c6f69aa25501b090c54c62a9c17e978064c2f1328f67a7ef88c81ce5f2d7983",
"DiffID": "sha256:89da7cc836da4b53ab1ceb572576458c005e7e444b8bb79abda196668a2f0c92"

View File

@@ -58,6 +58,7 @@
"PkgName": "curl",
"InstalledVersion": "7.61.1-11.91.amzn1",
"FixedVersion": "7.61.1-12.93.amzn1",
"Status": "fixed",
"Layer": {
"Digest": "sha256:105ff6bf468b1422ad7c47ea9d63eae82f875c93310cb8d34551951e754ef43b",
"DiffID": "sha256:984fe1509738f6f00f34d9be7398b07ebeb8b98dda077ff6be2cdb87111b73cf"

Some files were not shown because too many files have changed in this diff Show More