Compare commits

...

739 Commits

Author SHA1 Message Date
afdesk
06659f1509 fix(docker): Getting images without a tag (#1852) 2022-03-17 21:05:41 +02:00
SIPR
a91cc50df7 docs(gitlab-ci): Use environment variables TRIVY_CACHE_DIR and TRIVY_NO_PROGRESS (#1801) 2022-03-17 19:16:06 +02:00
DmitriyLewen
4b8bf874d8 chore(issue labels): added new labels (#1839)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2022-03-16 14:38:47 +02:00
Furkan Türkal
5040caefc8 refactor: clarify db update warning messages (#1808)
Signed-off-by: Furkan <furkan.turkal@trendyol.com>

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-03-16 14:35:40 +02:00
DmitriyLewen
28cd5a5537 chore(ci): change trivy vulnerability scan for every day (#1838) 2022-03-16 13:00:12 +02:00
Zach Stone
b2f554eb2a feat(helm): make Trivy service name configurable (#1825) 2022-03-16 10:38:45 +02:00
DmitriyLewen
7a44a7a344 chore(deps): updated sprig to version v3.2.2. (#1814) 2022-03-14 14:40:52 +02:00
DmitriyLewen
18842fbe04 chore(deps): updated testcontainers-go to version v0.12.0 (#1822) 2022-03-14 14:13:29 +02:00
MaineK00n
12ca3ca6da docs: add packages.config for .NET (#1823) 2022-03-14 13:57:53 +02:00
Batuhan Apaydın
728a3db6c6 build: sign container image (#1668)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-03-13 15:35:43 +02:00
dependabot[bot]
4e7b5ca365 chore(deps): bump github.com/CycloneDX/cyclonedx-go from 0.4.0 to 0.5.0 (#1778)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: masahiro331 <m_fujimura@r.recruit.co.jp>
2022-03-13 14:10:36 +02:00
Ricardo
0fca2cda91 docs: fix Installation documentation (#1804)
* Add missing `image` argument in the Installation docs->Docker section for MacOS.
2022-03-13 11:59:01 +02:00
Cyrille Pontvieux
e50839bb40 fix(report): ensure json report got a final new line (#1797) 2022-03-13 11:58:21 +02:00
Owen Rumney
f95a0f0d52 fix(terraform): resolve panics in defsec (#1811) 2022-03-09 18:37:02 +02:00
Malte Swart
e5bf3d1e30 feat(docker): Label images based on OCI image spec (#1793)
The Label Schema Convention has been deprecated in favor of the OCI
image spec.

Update the gorelease config to use the new replacement fields.

This is not considered a breaking change, as it only touches metadata
and the Label Schema Convention is deprecated for over two years (March
2019).

Most fields only need to be renamed. `org.label-schema.schema-version`
could be removed without replacement.
`org.opencontainers.image.documentation` was added to link to the
Github page documentation in the exact version.
`org.opencontainers.image.url` was added pointing to the Aqua Security
product page of trivy.
Further labels were considered but not added (unclear purpose or value).
2022-03-06 20:00:24 +02:00
Will Dowling
2193fb3c44 fix(helm): indentation for ServiceAccount annotations (#1795) 2022-03-06 09:34:38 +02:00
bestgopher
bbccb5a69d fix(hcl): fix panic in hcl2json (#1791) 2022-03-03 18:21:18 +02:00
Kaito Ii
a625455f1c chore(helm): remove psp from helm manifest (#1315) 2022-03-03 15:38:53 +02:00
Yuval Goldberg
7e69f4820e build: Replace make protoc with for loop to return an error (#1655)
Find the `*.proto` files and run in a `for loop` to run `protoc`
for each file in a separated command. If fail, `|| exit` will exit
with the returned error.

The POSIX standard specifies that the return status of `find` is 0
unless an error occurred while traversing the directories;
the return status of executed commands doesn't enter into it.

To overcome this limitation, the `-exec ... +` pattern could be used
From the docs (https://man7.org/linux/man-pages/man1/find.1.html):
"If any invocation with the `+' form returns a non-zero
value as exit status, then find returns a non-zero exit
status."

But as well, "This variant of the -exec action runs the specified command
on the selected files, but the command line is built by appending each selected
file name at the end;"

Unfortunately, at the moment `protoc-gen-twirp` plugin doesn't
support multiple files from different packages when the `go_package` option
is explicitly mentioned.
https://github.com/twitchtv/twirp/blob/main/protoc-gen-twirp/generator.go#L181-L185

Signed-off-by: Yuval Goldberg <yuvigoldi@gmail.com>
2022-03-03 15:35:51 +02:00
Amndeep Singh Mann
f6c986b6c0 fix: ASFF template to match ASFF schema (#1685)
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
2022-03-03 15:28:20 +02:00
Eric Bailey
aab6f0bf20 feat(helm): Add support for server token (#1734) 2022-03-03 14:38:20 +02:00
Teppei Fukuda
eebf9c8f58 fix(pom): keep an order of dependencies (#1784) 2022-03-03 12:36:21 +02:00
Teppei Fukuda
971092b847 chore: bump up Go to 1.17 (#1781) 2022-03-03 10:30:36 +02:00
dependabot[bot]
2f2d8222e4 chore(deps): bump actions/setup-python from 2 to 3 (#1776)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-03-02 14:11:29 +02:00
dependabot[bot]
a2afd6e683 chore(deps): bump golangci/golangci-lint-action from 2 to 3.1.0 (#1777) 2022-03-02 10:43:16 +02:00
afdesk
a423b99312 fix(python): correct handling pip package names with a hyphen (#1771) 2022-02-27 17:47:53 +02:00
benterris
a069ad7818 doc(docker): fix command to run trivy with docker on linux (#1761) 2022-02-25 10:56:47 +02:00
Edvin N
015055e1f5 feat(helm): Add support for custom labels (#1767)
Solves #1766
2022-02-25 09:07:25 +02:00
Edvin N
cbaa363990 chore(helm): bump chart to trivy 0.24.0 (#1762)
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2022-02-25 09:06:56 +02:00
Owen Rumney
bec02f098d docs: remove erroneous command (#1763) 2022-02-24 14:21:10 +02:00
dependabot[bot]
d7f8b92a27 chore(deps): bump github.com/spf13/afero from 1.6.0 to 1.8.1 (#1708) 2022-02-22 22:49:01 +02:00
Teppei Fukuda
59ea0d5781 fix(option): warn list-all-pkgs only with the table format (#1755) 2022-02-22 22:48:39 +02:00
DmitriyLewen
c788676f87 feat(option): warn "--list-all-pkgs" with "--format table" (#1632)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-22 18:41:25 +02:00
Masahiro331
58ade462b4 feat(report): add support for CycloneDX (#1081)
Co-authored-by: tspearconquest <81998567+tspearconquest@users.noreply.github.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-22 18:01:15 +02:00
Owen Rumney
77cab6e0b9 chore(deps): update the defsec and tfsec versions (#1747) 2022-02-22 16:42:24 +02:00
AndreyLevchenko
2ede15d358 fix(scanner): fix skip of language-specific files when scanning rootf… (#1751) 2022-02-22 08:48:25 +02:00
dependabot[bot]
d266c74941 chore(deps): bump github.com/google/wire from 0.4.0 to 0.5.0 (#1712) 2022-02-21 18:46:55 +02:00
Guy Ben-Aharon
4423396bcc feat(report): considering App.Writer when printing results (#1722)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-21 16:47:42 +02:00
afdesk
356ae30c7e chore(deps): replace satori version and skipping examples folder (#1745)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-21 15:58:45 +02:00
skuethe
477dc7d5f9 build: add s390x container images (#1726)
Signed-off-by: skuethe <56306041+skuethe@users.noreply.github.com>
2022-02-21 11:31:07 +02:00
Oran Moshai
89b8d7ff30 feat(template) Add misconfigurations to junit report (#1724)
Co-authored-by: oranmoshai <oran.moshai@aquasec.com>
2022-02-20 11:54:24 +02:00
dependabot[bot]
219b71b4fd chore(deps): bump github.com/twitchtv/twirp (#1709) 2022-02-14 10:25:28 +02:00
Christian Zunker
aa6e1eb6f9 feat(client): configure TLS InsecureSkipVerify for server connection (#1287)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-13 11:34:34 +02:00
Ankush K
de6c3cbb6c fix(rpc): Supports RPC calls for new identifier CustomResource (#1605) 2022-02-13 11:20:51 +02:00
dependabot[bot]
b7d4d1ead4 chore(deps): bump go.uber.org/zap from 1.20.0 to 1.21.0 (#1705) 2022-02-13 11:18:07 +02:00
dependabot[bot]
e6c029d08a chore(deps): bump github.com/caarlos0/env/v6 from 6.0.0 to 6.9.1 (#1707) 2022-02-13 10:13:06 +02:00
Will Dowling
ec6cb1a642 feat(helm): Parameterise ServiceAccount annotations (#1677) 2022-02-13 09:48:01 +02:00
dependabot[bot]
7dfc16cf21 chore(deps): bump github.com/hashicorp/go-getter from 1.5.2 to 1.5.11 (#1710) 2022-02-13 09:47:11 +02:00
dependabot[bot]
42d8fd6638 chore(deps): bump github.com/cheggaaa/pb/v3 from 3.0.3 to 3.0.8 (#1704) 2022-02-11 20:09:23 +02:00
dependabot[bot]
c3ef2035b5 chore(deps): bump github.com/open-policy-agent/opa from 0.36.1 to 0.37.2 (#1711) 2022-02-11 18:04:44 +02:00
Teppei Fukuda
274103e883 chore(dependabot): enable gomod monthly (#1699) 2022-02-11 14:24:25 +02:00
Konstantinos Koukopoulos
e618d83dae fix(gitlab tpl): escape double quote (#1635) 2022-02-10 17:29:10 +02:00
Yuval Goldberg
3b0b2ed4ce build: Make make protoc be consistent (#1682)
Signed-off-by: Yuval Goldberg <yuvigoldi@gmail.com>
2022-02-10 11:07:30 +02:00
Masahiro331
5c8d098324 feat(purl): add generate purl package utilities (#1574) 2022-02-09 20:35:36 +02:00
Teppei Fukuda
11f4f81123 refactor: move result structs under types (#1696) 2022-02-09 19:31:12 +02:00
Teppei Fukuda
6db2092c72 feat(mariner): add support for CBL-Mariner 2.0 (#1694) 2022-02-09 14:45:39 +02:00
Sven Haardiek
8898bb0937 docs(gitlab-ci): fix Script in GitLab CI Example #1688
This patch changes the command line order to still work with the latest version
of trivy.

Signed-off-by: Sven Haardiek <sven.haardiek@uni-muenster.de>
2022-02-08 13:31:10 +02:00
Carol Valencia
33d0833717 chore: Upgrade helm chart version (#1683)
Co-authored-by: carolina valencia <krol3@users.noreply.github.com>
2022-02-08 12:45:11 +02:00
tspearconquest
13874d866c chore(mod): update Go dependencies (#1681)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-02-07 14:12:45 +02:00
Greg Myers
f26a06b980 docs: fix typos in markdown docs (#1674) 2022-02-04 22:05:30 +02:00
Rory McCune
e2821a4fba docs: update documentation for image scanning of tar files to use a tag present on Docker Hub (#1671) 2022-02-04 22:04:53 +02:00
Teppei Fukuda
ef8a1afcdb fix(repo): --no-progress suppresses git output (#1669) 2022-02-03 09:02:39 +02:00
Teppei Fukuda
449add24af docs: add ACR navigator (#1651) 2022-01-31 16:19:19 +02:00
John A Stevenson
cb9afc8441 fix: update example Rego files and docs (#1628) 2022-01-31 16:18:24 +02:00
Teppei Fukuda
78b2b899a0 feat(option): show a link to GitHub Discussions for --light deprecation (#1650) 2022-01-31 15:26:43 +02:00
afdesk
52fd3c2e0a fix(sarif): fix the warning message (#1647) 2022-01-31 10:11:27 +02:00
Teppei Fukuda
8d5882be03 refactor: migrate to prefixed buckets (#1644) 2022-01-31 10:05:38 +02:00
Masahiro331
84dd33f7e9 feat(mariner): add support for CBL-Mariner (#1640)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-29 22:53:07 +02:00
Teppei Fukuda
9e903a1d88 docs: commercial use available (#1641) 2022-01-29 21:26:16 +02:00
Christian Groschupp
f4c746a2d2 feat: support azure acr (#1611)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-28 22:50:28 +02:00
afdesk
420f8ab13e feat(os-pkg): add data sources (#1636) 2022-01-28 20:41:40 +02:00
Teppei Fukuda
d2827cba06 feat(redhat): support build info in RHEL (#807) 2022-01-28 18:35:00 +02:00
DmitriyLewen
ce703ce4a5 fix: change links in pull_request_template to static URLs (#1634) 2022-01-27 15:47:37 +02:00
Teppei Fukuda
50bb938a21 feat(lang-pkg): add data sources (#1625) 2022-01-27 14:22:06 +02:00
Teppei Fukuda
a31ddbe971 feat(detector): support custom detector (#1615) 2022-01-25 09:06:28 +02:00
AndreyLevchenko
3a4e18ac82 docs(contribution): change role who should resolve comments (#1618) 2022-01-24 15:11:03 +02:00
DmitriyLewen
8ba68361bd docs: add PR template (#1602)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-23 10:36:03 +02:00
MaineK00n
f5c5573936 feat(rocky): support Rocky Linux (#1570)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-20 11:43:43 +02:00
MarkusTeufelberger
eab2b425db Add the ability to set dockerhub credentials in the helm chart (#1569) 2022-01-20 07:51:07 +02:00
Taufik Mulyana
cabd18daae feat(cache): redis TLS support (#1297) 2022-01-18 15:16:00 +02:00
DmitriyLewen
02c3c3659d feat(java): add support for PAR files (#1599) 2022-01-18 13:26:46 +02:00
DmitriyLewen
4f7b768369 refactor(rust): move rust-advisory-db to OSV (#1591) 2022-01-17 15:38:35 +02:00
rethab
d754cb8c6f feat: log ignored vulnerabilities on debug (#1378)
* feat: log ignored vulnerabilities

* feat: show IDs in an ignore file

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-17 08:38:08 +02:00
AndreyLevchenko
a936e675c9 chore(mod): hcl2json deps update (#1585)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-16 21:09:04 +02:00
DmitriyLewen
af116d3c9e fix(rpm): do not ignore installed files via third-party rpm (#1594) 2022-01-16 20:34:19 +02:00
jerbob92
b507360075 feat(fs): allow scanning a single file (#1578)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-16 16:32:31 +02:00
Teppei Fukuda
7fcbf44bb8 refactor(python): drop Safety DB (#1580) 2022-01-16 15:23:49 +02:00
DmitriyLewen
478d279919 feat: added insecure tls skip to scan git repo (#1528)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-14 11:25:45 +02:00
Yuval Goldberg
33bd41b40f Supress git clone output (#1590) 2022-01-14 08:59:49 +02:00
MaineK00n
39a10089fc fix(alma): skip modular package because MODULARITYLABEL is not set (#1588) 2022-01-13 17:30:20 +02:00
DmitriyLewen
37abd612aa feat(photon os): added EOL dates check (#1587)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2022-01-13 16:20:32 +02:00
DmitriyLewen
78de33e8ea docs: update supported os (#1586) 2022-01-13 13:53:13 +02:00
Teppei Fukuda
22054626f3 BREAKING: remove root command (#1579) 2022-01-12 16:13:13 +02:00
MaineK00n
28ddcf1ae8 docs: add Rust to Language-specific Packages Table (#1577) 2022-01-12 15:42:48 +02:00
rizwan-kh
df134c73f8 docs: update int doc for gitlab ci (#1575) 2022-01-12 11:17:29 +02:00
afdesk
8da20c8c92 BREAKING: migrate the sarif template to Go code (#1437)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2022-01-12 08:49:47 +02:00
Teppei Fukuda
714b5ca246 refactor: remove unused field (#1567) 2022-01-11 19:47:52 +02:00
dependabot[bot]
51e152b01c chore(deps): bump helm/chart-testing-action from 2.1.0 to 2.2.0 (#1554)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com
2022-01-11 14:58:23 +02:00
Stan0304
884daff429 docs: gitlab integration (#1381) 2022-01-10 15:38:32 +02:00
MaineK00n
2a8336b9aa feat(alma): support AlmaLinux (#1238)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2022-01-06 22:26:09 +02:00
Sourabh Gupta
1e171af165 docs: added note about default template path when Trivy installed using rpm (#1551) 2022-01-06 20:36:39 +02:00
Teppei Fukuda
e65274e0ef BREAKING: Trivy DB from GHCR (#1539) 2022-01-06 20:08:40 +02:00
Liam Galvin
db35450bbb feat(cli): Do not set default commands when a plugin is being run (#1549) 2022-01-06 19:10:16 +02:00
Maria Kotlyarevskaya
24254d19f6 fix: add fingerprint field to codequality template (#1541)
Signed-off-by: Jasstkn <mariia.kotliarevskaia@gmail.com>
2022-01-06 15:12:24 +02:00
afdesk
2ee074568c fix(image): correct handling of uncompressed layers (#1544)
Fixes #1527
2022-01-05 20:38:08 +02:00
Carol Valencia
0aef82c58e chore: helm chart app version 0.22.0 (#1535)
Co-authored-by: carolina valencia <krol3@users.noreply.github.com>
2022-01-04 22:24:39 +02:00
Teppei Fukuda
8b2a799721 test(integration): use fixtures (#1532) 2021-12-30 20:53:03 +02:00
Teppei Fukuda
42f795fa34 fix(java/pom): ignore unsupported requirements (#1514) 2021-12-24 23:37:28 +02:00
Teppei Fukuda
8f737cc6eb feat(cli): warning for root command (#1516) 2021-12-24 23:02:19 +02:00
Teppei Fukuda
76249bdcf0 BREAKING: disable JAR detection in fs/repo scanning (#1512)
Co-authored-by: Andrey Levchenko <levchenko.andrey@gmail.com>
2021-12-24 16:14:50 +02:00
Teppei Fukuda
59957d4c6b feat(scan): support --offline-scan option (#1511) 2021-12-24 12:20:21 +02:00
Teppei Fukuda
da8b72d2e7 fix: improve memory usage (#1509) 2021-12-24 08:33:43 +02:00
Teppei Fukuda
b713ad0fd3 feat(java): support pom.xml (#1501) 2021-12-23 16:45:38 +02:00
yuriShafet
56115e9d4f docs: fixing rust link to security advisory (#1504) 2021-12-22 17:52:35 +02:00
Owen Rumney
7f859afacb Add missing IacMetdata (#1505)
- Provider and Service added to IacMetadata on misconfiguration
2021-12-22 17:06:25 +02:00
Teppei Fukuda
628a7964d5 feat(jar): add file path (#1498) 2021-12-21 08:52:33 +02:00
Teppei Fukuda
82fba77141 feat(rpm): support NDB (#1497) 2021-12-21 07:57:06 +02:00
DmitriyLewen
d5269da5ee feat: added misconfiguration field for html.tpl (#1444)
* feat: added misconfiguration field for html.tpl

* feat: added message field for html.tpl

* fix: fixed integration test error
2021-12-20 17:14:00 +02:00
Chetan Goti
8e57dee86b fix(docs): typo (#1488) 2021-12-19 11:24:22 +02:00
Owen Rumney
8bfbc84a41 feat(plugin): Add option to update plugin (#1462)
* Add option to update plugin

- add plugin update [pluginName] to update
- add supporting test

* refactor: wrap errors
2021-12-16 13:30:19 +02:00
DmitriyLewen
1e811de263 fix: fixed skipFiles/skipDirs flags for relative path (#1482) 2021-12-16 13:21:22 +02:00
Owen Rumney
8b5796f770 feat (plugin): add list and info command for plugin (#1452)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-12-15 22:36:08 +02:00
afdesk
a2199bb417 fix: set up a vulnerability severity (#1458) 2021-12-15 21:28:29 +02:00
geyingqi
279e76f704 chore: add arm64 deb package (#1480) 2021-12-15 20:08:05 +02:00
Tomas Fernandez
5262590831 Link to trivy tutorial on Semaphore (#1449)
* Link to trivy tutorial on Semaphore

* Move tutorial to Advanced > Community > Tools
2021-12-12 05:33:00 +02:00
abdennour
c275a841fd refactor(helm): externalize env vars to configMap (#1345)
\#1343

Signed-off-by: abdennour <mail@abdennoor.com>
2021-12-08 08:37:05 +02:00
nobletrout
7beed30170 docs: provide more information on scanning Google's GCR (#1426)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-12-07 03:28:46 +02:00
DmitriyLewen
f50e1f42a1 docs(misconfiguration): added instruction for misconfiguration detection (#1428)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-12-06 13:56:41 +02:00
Guilherme Macedo
3ae4de5869 Update git-repository.md (#1430)
Update instructions on how to scan private git repositories, as according to https://github.com/aquasecurity/fanal/pull/253 .
2021-12-06 13:04:03 +02:00
AndreyLevchenko
6e35b8f53c fix(hooks): exclude unrelated lib types from system files filtering (#1431) 2021-12-06 10:53:34 +02:00
afdesk
beb60b05f3 chore: run go fmt (#1429) 2021-12-02 17:52:57 +09:00
afdesk
582e7fd1ba fix(sarif): change help field in the sarif template. (#1423) 2021-12-02 14:23:26 +09:00
Owen Rumney
11bc290111 Update fanal with cfsec version update (#1425)
- new version of cfsec brought in with latest fanal
  - fixes issue where cfsec treats files as CloudFormation when they
    arent
  - fixes issuee where invalid content errors are surfaced to Trivy
- Gets addition of service and provider on the IaC results - this is not
  visible to others
2021-12-01 04:15:26 +02:00
Nilushan Costa
392f68926c Replace deprecated option in goreleaser (#1406)
* Replace deprecated docker.use_buildx with docker.use

* Bump goreleaser GitHub action to v0.183.0
2021-11-29 05:31:16 +02:00
Huang Huang
101d576025 feat(alpine): support 3.15 (#1422) 2021-11-29 05:30:44 +02:00
Carol Valencia
bd3ba68cce chore: test the helm chart in the PR and used the commit hash (#1414)
Co-authored-by: carolina valencia <krol3@users.noreply.github.com>
2021-11-29 05:29:01 +02:00
dependabot[bot]
3860d6e4e9 chore(deps): bump alpine from 3.14 to 3.15.0 (#1417)
Bumps alpine from 3.14 to 3.15.0.

---
updated-dependencies:
- dependency-name: alpine
  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>
2021-11-28 09:48:31 +02:00
afdesk
4f82673a61 chore(release): add ubuntu older versions to deploy script (#1416)
* chore(release): add ubuntu older versions to deploy script

`ubuntu-distro-info --supported` returns only versions: `bionic`, `focal`, `hirsute`, `impish` and `jammy`.

`ubuntu-distro-info --supported-esm` returns another versions: `trusty`, `xenial`, `bionic`, `focal` and `jammy`.

for the release script we should use the union of these sets.

Fixes #1194

* change `uniq` command to `-u` parameter
2021-11-28 09:43:07 +02:00
Teppei Fukuda
b9a51de862 chore(mod): tidy (#1415) 2021-11-26 06:36:55 +02:00
AndreyLevchenko
7f248341cc fix(rpc): fix nil layer transmit (#1410)
* fix(rpc): fix nil layer transmit

Closes #1400

* added tests
2021-11-24 10:29:13 +02:00
Naimuddin Shaik
af3eaefdb2 Lang advisory order (#1409)
* chore(advisory reorder)

Reorder language advisory.

* fixed integration tests.
2021-11-24 10:27:12 +02:00
Raul Cabello Martin
07c9200eb7 chore: add support for s390x arch (#1304) 2021-11-21 11:38:47 +02:00
Carol Valencia
8bc8a4ad60 fix(chart): ingress helm manifest-update trivy image (#1323)
* fix: ingress helm manifest-update trivy image

* chore: helm ingress Capabilities.apiVersion

* feat: helm chart test gh

Co-authored-by: carolina valencia <krol3@users.noreply.github.com>
2021-11-21 09:57:30 +02:00
Owen Rumney
9076a49b0f docs: Add comparison for cfsec (#1388)
* Add cfsec comparison

* Add to mkdocs.yml
2021-11-17 16:42:17 +02:00
naoyukis
bb316d93ca remove: delete unused functions in utils package (#1379) 2021-11-16 14:12:18 +02:00
AndreyLevchenko
efdb29d0d4 fix(sarif): fix validation errors (#1376) 2021-11-15 16:36:51 +02:00
Teppei Fukuda
9bcf9e72f5 docs: add Bitbucket Pipelines (#1374) 2021-11-14 11:31:21 +02:00
Teppei Fukuda
3147097daf docs: add community integrations (#1361)
Co-authored-by: Carsten Hoffmann <choffmann87@googlemail.com>
2021-11-14 10:28:26 +02:00
Simon Engledew
33f74b3acb Use a stable SARIF identifier (#1230) 2021-11-11 20:02:40 +02:00
rahul2393
5915ffb42b fix(python): fix parsing of requirements.txt with hash checking mode available in pip since version 8.0 2021-11-11 13:18:31 +02:00
Owen Rumney
ae4c42b975 feat(iac): Add line information (#1366)
* feat(iac): Adding resource and Line data

- adding line in file information to the misconfiguration result
- updating tfsec and cfsec versions to provide this additional info

* Add usage of IaC metadata

* update the fanal version
2021-11-11 08:00:13 +02:00
Owen Rumney
19747d0535 feat(cloudformation): Adding support for cfsec IaC scanning (#1360) 2021-11-09 17:42:44 +02:00
Jamie
da45061f4d chore: send debug and info logs to stdout in install.sh, not stderr. (#1264)
The current install.sh script logs all messages to stderr via ```echoerr()``` function. Since godownloader is no longer maintained, it seems reasonable to update install.sh here.
2021-11-09 16:54:42 +02:00
tspearconquest
cb1a4ed3a1 Update containerd to v1.5.7 and docker-cli to v20.10.9 (#1356)
Signed-off-by: Thomas Spear <tspear@conquestcyber.com>
2021-11-09 16:00:41 +02:00
Vinod Anandan
69dae54aa1 chore: update SBOM generation (#1349) 2021-11-01 16:44:14 +02:00
Simar
5dc8cfe55d docs: update builtin.md (#1335) 2021-10-25 21:22:13 +03:00
psibre
798b564ee3 chore: fix issues with Homebrew formula (#1329) 2021-10-25 20:34:32 +03:00
psibre
21bf5e58f7 chore: bump GoReleaser to v0.183.0 (#1328) 2021-10-25 20:33:35 +03:00
Simar
e0f4ebd7cb docs: update iac.md for a typo (#1326) 2021-10-25 19:40:47 +03:00
Rory McCune
23a9a5e319 docs: typo fix (#1308)
Just fixing a typo in the docs "Filesysetm" --> "Filesystem
2021-10-25 19:39:34 +03:00
Christian Zunker
1f5d17fe13 Add new networking API features to Ingress (#1262)
* Add new networking API features to Ingress

This PR adds `v1` of the networking API introduced with k8s 1.19.
It also adds the new field `ingressClassName` introduced with k8s 1.18.

Fixes #1261

* Also query for the Kind in the capabilities

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2021-10-20 18:59:12 +03:00
Teppei Fukuda
bcfa0287b9 chore(release): bump up GoReleaser to v0.182.1 (#1299) 2021-10-16 06:48:44 +03:00
Teppei Fukuda
681ab1b889 fix(yarn): support quoted version (#1298) 2021-10-15 08:22:40 +03:00
Ankush K
46051d5ec8 feat(custom-forward): Forward the extended advisory data (#1247)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-10-14 21:57:30 +03:00
santhosh1729
d8d692b8ba feat(javascript) : Initialize npm driver for javascript packages (#1289) 2021-10-10 08:37:15 +03:00
besdollma
cc344dfbe3 fix(cli): fix incorrect comparision of DB metadata type. (#1286)
-- Incorrect Db metadata type comparision resulted in wrong
print in show version.

This fixes #1275.

Signed-off-by: Bes Dollma <besi7dollma@gmail.com>
2021-10-08 19:16:46 +03:00
Itay Shakury
0dec17fc3f docs: add footer to readme (#1281)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-10-07 10:18:38 +03:00
Teppei Fukuda
f12446d3ba feat(report): add package path (#1274) 2021-10-06 10:28:48 +03:00
Teppei Fukuda
1c9ccb5e03 feat(command): add rootfs command (#1271) 2021-10-04 21:03:34 +03:00
Huang Huang
a463e794ce fix: update fanal (#1272)
Fixes #1251 Fixes #1183 Fixes #1172
2021-10-04 17:47:00 +03:00
Teppei Fukuda
e0ca5eff38 feat(commands): remove deprecated options (#1270) 2021-10-04 15:49:04 +03:00
Masahiro331
1ebb3296ee Aggregate jar result for table (#1269)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-10-04 11:30:12 +03:00
Teppei Fukuda
b37f682ee2 BREAKING(report): migrate to new json schema (#1265) 2021-10-04 10:22:24 +03:00
Teppei Fukuda
da905108b4 feat: improve --skip-dirs and --skip-files (#1249) 2021-10-03 13:08:09 +03:00
Teppei Fukuda
bd57b4f9b5 fix(gobinary): skip large files (#1259) 2021-10-01 19:54:47 +03:00
Fabian Windheuser
9027dc3252 Disable library analyzer for OS only scan type (#1191) 2021-09-29 11:54:46 +03:00
fnishe
5750cc2e1a chore: update trivy version (#1252) 2021-09-29 10:56:44 +03:00
Eng Zer Jun
bbcce9f7b7 refactor: move from io/ioutil to io and os package (#1245)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-29 10:17:02 +03:00
Minchao
6bcb4af10f fix: brew test command (#1253) 2021-09-27 07:25:30 +03:00
Naimuddin Shaik
8d13234554 fix:added layer info in packages (#1248)
* added layer info in packages

* fixed unit cases
2021-09-22 17:17:16 +03:00
Teppei Fukuda
982f35b424 fix(go/binary): improve debug messages (#1244) 2021-09-20 10:28:02 +03:00
洋仔
2e170cd15a Update db.go (#1199)
fix args name error
2021-09-19 20:38:22 +03:00
AndreyLevchenko
cc6c67d81c fix(deps): fix CVE-2021-32760 for github.com/containerd/containerd (#1243)
Closes #1226
2021-09-19 09:49:15 +03:00
Teppei Fukuda
669fd1fd1d feat(debian): support the versions that reached EOL (#1237)
* refactor(debian): aggregate oval and json api into salsa

* fix(vulnerability): use package-specific severity

* chore(mod): update trivy-db
2021-09-17 13:59:46 +03:00
Teppei Fukuda
8cd7de276e feat(alpine): support unfixed vulnerabilities (#1235) 2021-09-16 22:20:59 +03:00
Teppei Fukuda
3bf3a46cd4 feat(report): add image config (#1231)
* feat(report): add image config

* chore(mod): update fanal

* test(scanner): fix type
2021-09-15 22:19:37 +03:00
Ankush K
8edcc62a8d feat(nodejs): support package.json (#1225)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-09-15 14:23:35 +03:00
Teppei Fukuda
31c45ffc52 refactor: use testing DB instead of mock (#1234) 2021-09-15 10:06:01 +03:00
Ankush K
d8cc8b550b feat(ruby): support gemspec (#1224)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-09-14 23:16:19 +03:00
Ankush K
dbc7a83e8c feat(python): add packaging detector and respective hook (#1223)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-09-13 20:59:11 +03:00
Ankush K
19c0b70d26 feat(license): Added support to new License field of go-dep-parser's library (#1167) 2021-09-09 14:32:50 +03:00
afdesk
9d617777d5 fix(oracle): handle advisories contain ksplice versions (#1209)
* fix(oracle): handle advisories contain ksplice versions

Improve a handling of advisories contain ksplice versions:
* when one of them doesn't have ksplice, we'll also skip it
* extract kspliceX and compare it with kspliceY in advisories
* if kspliceX and kspliceY are different, we will skip the advisory.

Fixes #1205

* fix(oracle): handle advisories contain ksplice versions

simplify code and remove duplicated tests

Fixes #1205

* run go fmt
2021-09-05 11:29:13 +03:00
afdesk
5d57deaa4f fix(docs): remove OSVDB advisories (#1215)
Trivy no longer depends on OSVDB and can use "Ruby Advisory Database" for commercial usage.

Fixes #1208
2021-09-05 08:39:10 +03:00
Guilherme Macedo
b5955597a4 docs: fix typos in CONTRIBUTING.md (#1181)
* Fix typos in CONTRIBUTING.md

Fix small typos in CONTRIBUTING.md

* Fix typos in CONTRIBUTING.md

Fix small typos in CONTRIBUTING.md
2021-09-02 14:51:57 +03:00
Huang Huang
b1410b27b8 Update EOL of Debian 11 (#1180)
https://bits.debian.org/2021/08/bullseye-released.html
2021-09-02 14:32:47 +03:00
afdesk
0e777d386e fix(plugin): resolve a closure (#1207)
There is a closure inside a function for Action field: variable p always refers on the last plugin.
solution: redefine variable inside the for loop.

Fixes #1086
2021-09-02 14:29:54 +03:00
Pascal Borreli
b6d9c30eea docs: fix typo (#1206) 2021-09-01 18:03:14 +03:00
afdesk
5160a2eb53 fix(detector): change an argument for trivy-db getter (#1203)
use a package name instead of SrcName for getting of advisories
about Oracle packages.

Fixes #1170
2021-09-01 14:27:14 +03:00
Teppei Fukuda
40ed227c23 chore(mod): update fanal (#1179)
* chore(mod): update fanal

* test(integration): fix error message

* test(integration): skip reaper
2021-08-15 15:19:22 +03:00
santhosh1729
2a4400c147 Add license info to package data (#1176) 2021-08-15 13:05:37 +03:00
Tauseef
82eb630be7 feat(nuget): support packages.config (#1095)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-08-12 15:27:13 +03:00
AndreyLevchenko
4a8db20a9a feat(python): add support for requirements.txt (#1169) 2021-08-11 11:14:37 +03:00
thiago-gitlab
8db9b6a2a6 GitLab CI integration documentation (#1168)
Recommend the native GitLab integration.
2021-08-08 14:10:16 +03:00
AndreyLevchenko
c159501d0d chore(gorelease) change goreleaser config to include template examples (#1138)
Closes #1123
2021-07-28 11:05:14 +03:00
dependabot[bot]
76e63d1124 chore(deps): bump dmnemec/copy_file_to_another_repo_action (#1153)
Bumps [dmnemec/copy_file_to_another_repo_action](https://github.com/dmnemec/copy_file_to_another_repo_action) from 1.0.4 to 1.1.1.
- [Release notes](https://github.com/dmnemec/copy_file_to_another_repo_action/releases)
- [Commits](https://github.com/dmnemec/copy_file_to_another_repo_action/compare/v1.0.4...v1.1.1)

---
updated-dependencies:
- dependency-name: dmnemec/copy_file_to_another_repo_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>
2021-07-28 10:57:32 +03:00
dependabot[bot]
79b6684840 chore(deps): bump actions/stale from 3 to 4 (#1152)
Bumps [actions/stale](https://github.com/actions/stale) from 3 to 4.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/stale
  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>
2021-07-28 10:56:09 +03:00
AndreyLevchenko
214fe82c7e feat(report): add end of service life flag to OS metadata (#1142)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-07-27 17:08:57 +03:00
Matthieu MOREL
c489e31f5d chore: set up Dependabot for github-actions and docker (#1128) 2021-07-27 16:03:43 +03:00
MaineK00n
efd812cb1a docs: fix typo (#1149) 2021-07-27 16:00:54 +03:00
Teppei Fukuda
3a920dc401 docs: add some external links (#1147) 2021-07-27 15:39:55 +03:00
AndreyLevchenko
7cb1598991 chore (release): add ubuntu esm versions to deploy script (#1151) 2021-07-26 12:49:42 +03:00
AndreyLevchenko
6a8800286e docs(troubleshooting) add urls which are required to download vuls db (#1137) 2021-07-21 11:07:57 +03:00
Simran Munot
f3f3029014 Updated the Alpine Image to 3.14 (latest) (#1130) 2021-07-20 13:27:43 +03:00
Simran Munot
0e52fde047 Added EOL for Ubuntu 21.10 (#1131)
As per (https://wiki.ubuntu.com/Releases) and (https://ubuntu.com/about/release-cycle), Ubuntu 21.10 is supported until July 2022
2021-07-20 13:25:01 +03:00
AndreyLevchenko
9b3fba04f9 fix(image): disabled scanning of config files within container images (#1133) 2021-07-20 10:15:45 +03:00
mustafa-rean
1101634f6a docs: fixed typo (#1124) 2021-07-18 12:18:39 +03:00
Niklas
499b7a6ecf update cyclonedx github action to v0.3.0 (#1127)
use version `^v0` instead of `latest` to avoid breaking the build when cyclonedx-gomod introduces breaking changes in a new major version. See https://github.com/CycloneDX/gh-gomod-generate-sbom/releases/tag/v0.3.0

Signed-off-by: nscuro <nscuro@protonmail.com>
2021-07-18 11:59:55 +03:00
Teppei Fukuda
cea9b0bc78 fix(policy): fix panic on the first run (#1116) 2021-07-12 21:38:20 +03:00
Teppei Fukuda
dea3428804 docs(misconf): add comparison with Conftest and tfsec (#1111) 2021-07-12 13:43:39 +03:00
Teppei Fukuda
47d600a9b4 feat(report): add schema version (#1110) 2021-07-12 12:27:27 +03:00
Teppei Fukuda
eae4bafff3 fix(scan): change unknown os from info to debug (#1109) 2021-07-12 12:26:48 +03:00
Teppei Fukuda
9e08bd44fb docs: add misconfiguration (#1101)
Co-authored-by: Itay Shakury <itay@itaysk.com>
2021-07-12 03:14:17 +03:00
Teppei Fukuda
d9883e4442 fix(config): rename include-successes with include-non-failures (#1107) 2021-07-11 16:55:13 +03:00
Teppei Fukuda
e6f7e556e8 feat(config): support --trace (#1106) 2021-07-11 16:07:30 +03:00
Teppei Fukuda
4b84e79cc3 fix(policy): reduce the Internet access (#1105)
* fix(policy): send a request only when it needs update

* fix(policy): update DownloadedAt after fetching image manifest
2021-07-10 23:17:04 +03:00
Teppei Fukuda
05ae22a85c chore: bump golangci-lint to v1.41.1 (#1104) 2021-07-10 21:23:00 +03:00
Teppei Fukuda
a0e5c3a2e2 feat: support config scanning (#931) 2021-07-09 08:18:53 +03:00
Teppei Fukuda
712f9eba35 feat(report): add artifact metadata (#1079) 2021-06-30 12:53:33 +03:00
Vinod Anandan
803b2f9a93 Generate SBOM (#1076)
* Generate SBOM

Generate and publish SBOM as part of the release.

* Publish bom.json

* Ignore SBOMs generated during CI
2021-06-22 09:53:08 +03:00
Teppei Fukuda
92f980f4b7 fix(db): multiple prefixed data sources (#1070) 2021-06-20 16:23:26 +03:00
Chris Novakovic
52e98f1bd9 Add EOL date for Alpine 3.14 (#1072)
Per https://alpinelinux.org/releases/, Alpine 3.14 is supported until
2023-05-01.

Closes #1071.
2021-06-20 11:15:22 +03:00
Dirk Mueller
6cd9a328a4 suse: mark sle 15.3 as maintained, add opensuse 15.3 (#1059)
SLE 15.3 is about to be released and will be maintained until
6 months after 15.4. this allows us to guess the 15 SP2 EOL date,
so updating that as well.
2021-06-17 12:09:46 +03:00
Teppei Fukuda
03a73667db docs: improve data sources (#1069)
* docs: improve data sources

* docs: add os data sources

* refactor
2021-06-16 16:43:42 +03:00
Teppei Fukuda
a29d6d8c5b chore(label): add kind/security-advisory (#1068) 2021-06-16 15:33:06 +03:00
Teppei Fukuda
2a08969ddc fix(asff): replace slice with substr (#1058) 2021-06-10 16:19:28 +03:00
Abhinav Khanna
3a94b7399b fix(helm-chart): parametrized ingress host path (#1049)
Signed-off-by: Abhinav Khanna <abhinav.khanna@salesforce.com>
2021-06-10 16:03:48 +03:00
Tauseef
41d000c97e feat: support Google Artifact Repository (#1055)
* Update Fanal library reference

This commit updates Fanal library version to latest which
includes support for Google artifact repository.

* chore(mod): tidy

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-06-10 12:19:40 +03:00
David Wittman
78da283c1b Update ASFF template to use label for severity (#1047)
* Update ASFF template to use label for severity

Use of the `Normalized` and `Product` fields is deprecated in the [ASFF spec](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format-attributes.html#asff-severity). Instead, we should just provide the severity as a `Label`, which simplifies the logic in this template quite a bit as well.

* fix(asff): use severity var

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-06-10 12:12:53 +03:00
Teppei Fukuda
e362843705 BREAKING: migrate to a new JSON schema (#782)
* feat: introduce a new JSON schema

* test: update

* chore(mod): update fanal

* refactor: add a comment

* test(report): fix

* refactor(writer): add omitempty

* refactor: replace url

* test(scanner): fix
2021-06-08 18:03:24 +03:00
David Wittman
097b8d4881 docs: Fix link to AWS Security Hub template (#1046) 2021-06-07 10:14:18 +03:00
Teppei Fukuda
3b6122f86d refactor(server): support gzip (#1045) 2021-06-06 17:54:12 +03:00
Teppei Fukuda
f75a36945c chore(rpc): update protoc and twirp (#1044) 2021-06-06 16:33:25 +03:00
tonaim
e4c32cdb77 Added support for list all packages flag in client (#1032)
* Added support for list all packages flag in client

This commit is to support --list-all_pkgs argument in client command
Example command: trivy -d client --list-all-pkgs --remote http://localhost:8080 ubuntu:18.04.

* Updated argument in client.md

* Fixed all format issues
2021-06-03 22:47:48 +03:00
Carol Valencia
fb19abd09a chore: chart with 0.18.3 (#1033)
Co-authored-by: krol3 <krol3@users.noreply.github.com>
2021-06-01 08:29:21 +03:00
bmagistro
d2afc206b2 feat: add gitlab codequality template (#895)
* Add gitlab codequality template

* add unit test for gitlab codequality template

* update line endings to msdos (\r\n) from unix

* update gitlab docs for codeclimate template
2021-05-31 11:20:59 +03:00
Teppei Fukuda
43ff5f93e8 feat(plugin): add aqua plugin (#1029) 2021-05-31 10:54:46 +03:00
rahul2393
5e6a50b2f9 fix(go): if patchedVersion is empty mark it as vulnerable (#1030)
* fix(go): if patchedVersion is empty mark it as vulnerable

* fix(go): skip checking for vulnerable version if empty

* fix(go): refactored empty check at start of match

* fix(go): added unit test for empty patched/vulnerable version
2021-05-30 15:43:14 +03:00
Teppei Fukuda
23b9533791 docs(ubuntu): fix supported versions (#1028) 2021-05-30 14:13:45 +03:00
Huang Huang
d1f8cfcfdc Support Ubuntu 21.04 (#1027) 2021-05-30 11:10:19 +03:00
Teppei Fukuda
aa2336be92 chore: remove codecov (#1016) 2021-05-27 09:25:37 +03:00
Tomoya Amachi
e64617212e fix typo on github-actions.md (#1022) 2021-05-27 09:10:46 +03:00
Teppei Fukuda
85e45cad95 chore(ci): change to more granular tokens (#1014) 2021-05-24 02:35:44 +03:00
rahul2393
9fa512a652 chore(ci): add Go scanning and update dependencies (#1001)
* Fixed dependency

* Scan repo action added

* only check for Critical with exit-code=1

* Fix vulnerability in go.sum

* more fixes
2021-05-23 11:21:23 +03:00
skovati
349371bbc9 docs: Add HIGH severity to Trivy command in GitLab CI example to match comment (#1013)
* Add HIGH severity to Trivy command in GitLab CI example to match comment

* Change comment to accurately reflect Trivy command that fails only on CRITICAL vulnerabilities
2021-05-23 04:55:46 +03:00
Teppei Fukuda
4446961167 fix(image): disable go.sum scanning (#1007) 2021-05-20 10:01:19 +03:00
Teppei Fukuda
04473ada48 fix(gomod): handle go.sum with an empty line (#1006) 2021-05-20 09:39:06 +03:00
Teppei Fukuda
1b66b77f69 feat: prepare for config scanning (#1005)
* temp: disable config scanning
2021-05-20 09:05:36 +03:00
gboer
8fc6ea6489 Clarify that dev dependencies are excluded (#986)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-05-19 05:47:05 +03:00
rahul2393
eaf2da20a6 Include target value in Sarif template ruleID (#991)
* Include target value in Sarif template ruleID

* Fix format
2021-05-13 20:10:34 +03:00
rahul2393
083c157b05 chore(mkdocs): allow workflow_dispatch (#989)
* Updated docs for go libraries.

* Add option to manually trigger doc publish
2021-05-12 19:57:14 +03:00
rahul2393
e26e39a7f8 fix(vuln) unique vulnerabilities from different data sources (#984)
* Fix duplicate Rule in sarif template

* Fix integration tests

* Fixed tests

* Update certs validity upto 2100

* Moved deduplication logic to Filter

* Fix linting issue

* Fix liniting issue

* fix: deduplicate vulnerabilities

* refactor

* fix: add installed versions to uniq keys

* Fix tests

* Fix Unit tests.

* Revert port change

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-05-12 13:10:05 +03:00
rahul2393
04e7ccabea feat(go): added support of gomod analyzer (#978)
* Added support of gomod analyzer.

* add imports

* fix gocyclo

* Ran go fmt
2021-05-11 04:18:13 +03:00
rahul2393
415e1d8ea3 Upgrade fanal dependency (#976) 2021-05-01 13:14:08 +03:00
Teppei Fukuda
3bb8852ef7 docs: mention upx binaries (#974) 2021-05-01 04:39:42 +03:00
rahul2393
c0fddd9467 Upgrade alpine to fix git and libcurl vulnerabilities in trivy docker image scan (#971)
* Upgrade alpine to fix git and libcurl vulnerabilities in trivy docker image scan

* remove patch version
2021-04-30 11:06:57 +03:00
Teppei Fukuda
41c066d4c8 fix(fs): skip dirs (#969) 2021-04-30 07:50:07 +03:00
Teppei Fukuda
2316931e3b chore(ci): replace GITHUB_TOKEN with ORG_GITHUB_TOKEN (#965) 2021-04-29 21:57:43 +03:00
Teppei Fukuda
77f3d55149 chore(ci): clone trivy-repo after releasing binaries (#963) 2021-04-29 21:15:11 +03:00
Teppei Fukuda
b319579b78 docs: add golang support (#962) 2021-04-29 20:53:12 +03:00
Teppei Fukuda
0c0febe28a fix(table): skip zero vulnerabilities on java (#961) 2021-04-29 20:52:55 +03:00
Teppei Fukuda
d41736b828 chore(ci): create a release discussion (#959)
* chore(ci): create a release discussion

* chore(ci): bump up goreleaser version
2021-04-29 19:53:39 +03:00
Masahiro331
c88bbbd6cc feat(go): support binary scan (#948)
* feature(gobinary) support gobinary scan

* chore(mod): update fanal

* update(go.mod) update trivy-db

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-04-29 19:47:50 +03:00
Masahiro331
d88b7cfb08 feat(java): support GitLab Advisory Database (#917)
* feature(maven) support requirements

* test(maven) fix test name

* update(go.mod) update fanal

* refactor(maven compare) fix test

* update(go.mod) update go-mvn-version
2021-04-29 18:40:51 +03:00
Teppei Fukuda
1385fa4190 feat: show help message when the context's deadline passes (#955) 2021-04-27 17:13:01 +03:00
Teppei Fukuda
0346a106f8 chore(mkdocs): replace github token (#954) 2021-04-27 14:43:54 +03:00
Yong Yan
60a4e7e5d4 Update SARIF report template (#935)
* Update SARIF repot template

* Update test data sarif.golden

* Fix golangci-lint issue

* Add test cases

* Address review feedbacks

* Inline value in assert statement

* Fix location Uri format issue
2021-04-19 13:35:30 -07:00
Henry Jenkins
39ab6bd630 Update install docs to make commands consistent (#933)
* Update install docs to make commands consistent

Removed `$` prefixes from code blocks to make them constant across the page and make the commands copypasta-able.

* Revert change on docs which need manual changes
2021-04-12 10:04:59 +03:00
Drew Robinson
0518d2785f Docker multi-platform image build with buildx, using Goreleaser (#915)
* Minimal WIP cross platform build with goreleaser

* Add Docker manifest, update docker image tags

* Update GH release workflow

* Comment out ECR image repo and RPM/DEB generation

* Enable and set up Docker Buildx for multi-platform builds

Also add caching of Go modules

* Add Docker Buildx support, re-enable parent repo workflows

* Add Docker Buildx support for multi-arch image builds

* Added Docker Buildx setup into `build-test` job of `test` workflow

Otherwise the `test` workflow will fail.
Also updated `setup-go` GH action to latest version, v2, per request
of @krol3
2021-03-29 11:53:28 +03:00
Paul T
a6b8ec3134 Fix JUnit template for AWS CodeBuild compatibility (#904)
* #902 ensure the number of tests matches the number of failures

* #902 tidy up the template and ensure test is aligned
2021-03-29 11:53:09 +03:00
Teppei Fukuda
6d22387727 break(cli): use StringSliceFlag for skip-dirs/files (#916)
* fix(cli): use StringSliceFlag for skip-dirs/files

* test(scanner): rename

* test(integration): fix
2021-03-29 10:25:30 +03:00
Teppei Fukuda
7221579340 docs: add white logo (#914) 2021-03-24 13:04:17 +02:00
rahul2393
ee29ffaf4f add package name in ruleID (#913) 2021-03-23 17:27:58 -07:00
Carol Valencia
8935aa6523 feat: gh-action for stale issues (#908)
* feat: gh-action for stale issues

* Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Update .github/workflows/stale-issues.yaml

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Co-authored-by: krol3 <krol3@users.noreply.github.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2021-03-21 17:39:59 +02:00
Teppei Fukuda
288481ffe1 chore(triage): add lifecycle/active label (#909) 2021-03-21 17:36:14 +02:00
Carol Valencia
f961e9912e feat: publish helm repository (#888)
* feat: publish helm repository

* chore: docs about helm installation

Co-authored-by: krol3 <krol3@users.noreply.github.com>
2021-03-19 11:00:51 +02:00
Stephan
0edf73bf3d Fix Documentation Typo (#901) 2021-03-19 10:59:19 +02:00
Teppei Fukuda
f5b060a9f1 docs: migrate README to MkDocs (#884)
* docs: slim README

* docs: add images

* docs: update README

* docs: add futher reading

* docs: add docs for maintainers

* docs: fix links

* docs: add notes

* Update docs/further.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* Update docs/further.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* Update docs/further.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* Update docs/index.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* Update docs/index.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* Update docs/index.md

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* docs: update mkdocs.yml

* chore: add a mkdocs target to Makefile

* docs(installation): use git.tag

* chore(Makefile): fix the tag of the mkdocs image

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>
2021-03-17 07:19:34 +02:00
Teppei Fukuda
c26a3e481f refactor(internal): export internal packages (#887)
* refactor: export internal packages

* refactor(server): define Server

* refactor: fix lint issues

* test(integration): fix imports
2021-03-14 17:04:01 +02:00
Teppei Fukuda
8b3b5d0290 feat: support plugins (#878)
* fix(log): set the default logger

* feat: support plugins

* feat(plugin): add run command

* feat(plugin): add uninstall command

* test(plugin): add tests

* chore(ci): pin go version

* chore(ci): disable G204

* refactor: fix lint issues

* feat(plugin): skip downloading installed plugins

* feat: add TRIVY_RUN_AS_PLUGIN

* support Ubuntu 20.10 (#876)

* docs(README): update ubuntu versions (#877)

* add MkDocs implementation (#870)

* mkdocs: add top level nav

* mkdocs: add installation nav

* mkdocs: add quick-start nav

* mkdocs: add examples nav

* mkdocs: add CI nav

* mkdocs: add vuln-detection nav

* mkdocs: add comparison nav

* mkdocs: add usage nav

* mkdocs: add migration nav

* mkdocs: add FAQ nav

* mkdocs: add mkdocs.yml

* mkdocs: add github workflow

* docs: update documents

* fix links

* chore(ci): use ORG_GITHUB_TOKEN

* chore(mkdocs): use mike

* chore(ci): support dev

* chore(ci): documentation test

Co-authored-by: knqyf263 <knqyf263@gmail.com>

* docs: add plugins

* chore: remove stale workflow

* refactor: fix lint issues

Co-authored-by: Huang Huang <mozillazg101@gmail.com>
Co-authored-by: aprp <doelaudi@gmail.com>
2021-03-10 21:44:08 +02:00
Teppei Fukuda
37edc66418 chore(ci): deploy dev docs only for the main branch (#882)
* chore(ci): deploy dev docs only for the main branch

* chore(ci): add mkdocs.yml
2021-03-10 17:55:16 +02:00
aprp
becd5088df add MkDocs implementation (#870)
* mkdocs: add top level nav

* mkdocs: add installation nav

* mkdocs: add quick-start nav

* mkdocs: add examples nav

* mkdocs: add CI nav

* mkdocs: add vuln-detection nav

* mkdocs: add comparison nav

* mkdocs: add usage nav

* mkdocs: add migration nav

* mkdocs: add FAQ nav

* mkdocs: add mkdocs.yml

* mkdocs: add github workflow

* docs: update documents

* fix links

* chore(ci): use ORG_GITHUB_TOKEN

* chore(mkdocs): use mike

* chore(ci): support dev

* chore(ci): documentation test

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2021-03-09 20:05:37 +02:00
Teppei Fukuda
e517bef17f docs(README): update ubuntu versions (#877) 2021-03-07 08:35:26 +02:00
Huang Huang
da2b28a3bb support Ubuntu 20.10 (#876) 2021-03-07 07:10:23 +02:00
Teppei Fukuda
965bb6d08a feat(cache): introduce versioned cache (#865)
* refactor(scan): rename image to artifact

* refactor(scan): trim version suffixes for debug info

* chore(mod): update fanal

* refactor: reduce complexity

* chore(mod): update fanal

* refactor(scan): early return
2021-02-28 12:18:56 +02:00
Teppei Fukuda
049728665f chore: bump up Go to 1.16 (#861)
* chore: bump up Go to 1.16

* chore(release): support darwin/arm64
2021-02-25 19:04:13 +02:00
Teppei Fukuda
fcb9a93d05 fix: allow the latest tag (#864)
* fix: allow the latest tag

* docs: update README
2021-02-25 16:23:11 +02:00
Teppei Fukuda
425eaf8a2a feat: disable analyzers (#846)
* feat: pass disabled analyzers

* refactor(run): split into functions

* feat(run): pass disabled analyzers

* chore(mod): update fanal

* chore(mod): update fanal

* refactor
2021-02-24 11:02:24 +02:00
Teppei Fukuda
47ce996d36 chore(ci): push the official image to public ECR (#855) 2021-02-23 07:35:31 +02:00
Teppei Fukuda
e890ae02c2 chore(ci): migrate CircleCI to GitHub Actions (#850) 2021-02-22 06:56:17 +02:00
shorty-at-next
9bc3565af1 adds example with multistage build (#853) 2021-02-21 08:42:38 +02:00
aprp
a0cd5d70ae remove SARIF helpUri if empty (#841) (#845)
* remove SARIF helpUri if empty (#841)

* add tests for primary url
2021-02-19 12:24:11 -08:00
Nils Bokermann
3170dc3e63 Add Sprig to Template Engine (#832)
* Add sprig template function to template writer

* gofmt corrected

* includes corrected

* GoFMT corrected

* Added accidentically removed template functions

* Corrected use of template-file

* Add sprig test

* Add short example for sprig.
2021-02-18 08:39:22 +02:00
Andreas Härpfer
10ad2edd3c Fix "GitLab CI using Trivy container" usage example (fixes #843) (#844) 2021-02-15 11:24:48 +02:00
Teppei Fukuda
c9f22f4e55 feat(java): support jar/war/ear (#837)
* refactor(server): remove Detect endpoint

* refactor(library): do not use interface

* refactor: add dbtest package

* test: add bolt fixtures

* feat: support jar scanning

* refactor: rename node to npm

* refactor: fix lint issues

* test(maven): remove some tests

* chore(mod): update fanal

* docs: update README

* chore(mod): update trivy-db

* fix(library/drive): add ecosystem

* fix: do not display 0 vulnerabilities

* refactor(table): split method

* Update README.md (#838)

* fix(app): increase the default value of timeout (#842)

* feat(maven): use go-mvn-version

* test(maven): update tests

* fix(scan): skip files and dirs before vulnerability detection

* fix: display log messages only once per type

* docs(README): add file suffixes

* chore(mod): update go-mvn-version

* feat(log): set go-dep-parser logger

* chore(mod): update fanal

* docs: update README

* docs(README): add java source

* test(maven): fix invalid case
2021-02-14 18:19:42 +02:00
Teppei Fukuda
3047c524d9 fix(app): increase the default value of timeout (#842) 2021-02-14 08:15:53 +02:00
Teppei Fukuda
89e5295421 Update README.md (#838) 2021-02-11 14:37:17 +02:00
Maximilian Schlosser
cdabe7fc9e Fix compatibility for Jenkins xunit plugin (#820)
* Compatibility for Jenkins xunit plugin

* fix test
2021-02-08 11:10:06 +02:00
Denis Pisarev
b0fe439309 README: add Gitlab job that uses a container with trivy (#823) 2021-02-08 11:08:57 +02:00
Teppei Fukuda
6685cd4e21 feat: support Podman (#825)
* docs(README): add Podman support

* chore(mod): update fanal

* docs: update README

* docs(README): add how to build images
2021-01-28 16:53:08 +02:00
Kota Kanbe
7a683bd02e fix(eol): update EOL dates (#824) 2021-01-27 07:46:22 +02:00
Teppei Fukuda
6ed03a83a5 fix(python): follow PEP 440 (#816)
* feat(python): replace go-version with go-pep440-version

* chore(mod): add go-pep440-version

* refactor: add trick for golangci-lint

* refactor: rename test functions
2021-01-25 14:44:07 +02:00
Huang Huang
182cb800a8 Support alpine 3.13 (#819) 2021-01-24 13:59:19 +02:00
Paul Mossman
2acd1cafd0 Changed the output string to "Using your github token". (#814) 2021-01-21 09:10:33 +02:00
Clemens Buchacher
dd35bfd1a1 Align comment with code (#812) 2021-01-21 09:09:42 +02:00
Christian Zunker
1f17e71dce Parse redis backend url (#804)
As suggested by the go-redis client, parse the url to get the config.
This will fix problems, when the url contains a username and/or password.

Fixes #798

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2021-01-21 09:08:53 +02:00
Teppei Fukuda
0954f6b1bb Update README.md (#810) 2021-01-19 06:06:12 +02:00
Carlos Tolon
6b29bf1c71 Added nodeSelector, affinity and tolerations to helm chart (#803)
* Added nodeSelector, affinity and tolerations to helm chart

* Updated helm README.md and bumped version
2021-01-11 16:33:35 +02:00
Oran Moshai
f6afdf0145 Fix readme typo in policy flag (#805)
Co-authored-by: oranmoshai <oran.moshai@aquasec.com>
2021-01-11 16:32:33 +02:00
Damien Carol
412847d6a2 Fix errors in SARIF format (#801)
* Fix errors in SARIF format

* Fix one golden file for integration tests

* Fix golden file

* Fix golden again :>

* Update sarif.tpl

* Update alpine-310.sarif.golden
2021-01-08 14:16:35 -08:00
Christian Zunker
5b2786213a Fix env variable for github token (#796)
Fixes #795

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2021-01-07 15:51:20 +02:00
Teppei Fukuda
6ed25c19e6 fix(vulnerability): set unknown severity for empty values (#793)
* fix(vulnerability): set unknown severity for empty values

* chore(mod): update trivy-db
2021-01-07 06:48:32 +02:00
Robert Jacob
e2c483f856 Remove global flags from filesystem command (#772)
* Remove global flags from subcommands

If the global flags are added to the subcommand as well as being used
globally, their value will be overwritten when the arguments for the
subcommand are parsed. This leads to the value passed to the flag at the
global position being lost.

* Update readme
2021-01-05 12:49:39 +02:00
Christian Zunker
5c5e0cb86d Add imagePullSecrets to helm Chart (#789)
* Add imagePullSecrets to helm Chart

Fixes #787

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>

* use only one imagePullSecret

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>

* Bugfix

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2021-01-05 12:41:42 +02:00
Christian Zunker
b9b84cd963 Add redis cache backend configuration options (#784)
You can now specify redis as caching as backend.
The default is still the filesystem.

In case redis is added as caching backend, the cache-dir is still
used for the vulnerability database.

Fixes #781

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2021-01-04 11:42:05 +02:00
justfortee
e517bcc2b2 Update README.md (#735)
Grammatical error.
2021-01-03 12:23:42 +02:00
Teppei Fukuda
7f5a6d479e feat(redhat): support modular packages (#790) 2020-12-31 19:40:25 +02:00
Christian Zunker
8de09ddf37 Fix formatting of log message (#785)
Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2020-12-25 16:26:23 +02:00
Teppei Fukuda
e08ae8d01d chore(ci): migrate unit tests to GitHub Actions (#779) 2020-12-22 06:20:05 +02:00
Yashvardhan Kukreja
a00d719ed2 shifted: brews.github to brews.tap (#780) 2020-12-21 16:28:19 +02:00
Johannes
08ca1b00b7 Feat: NuGet Scanner (#686)
* Initial nuget advisory detector code.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Added nuget package to scan.go

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Removed nuget advisory file and instead added csharp/nuget as a driver in driver.go.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Removed nuget package from driver. Added ghasnuget as a source in vulnerability.go

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Updated nuget driver to use correct name and to initialize with the new generic scanner.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* refactor: cut out to a separate method

* chore(mod): update trivy-db

* fix(driver): add a general driver

* test(ghsa): add nuget

* chore: update README

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-12-21 10:17:15 +02:00
Teppei Fukuda
7b86f81e29 feat(cache): support Redis (#770)
* feat(config): add --cache-backend

* feat(operation): embed cache.Cache into operation.Cache

* feat(cache): support redis://

* test(integration): add redis test

* chore(README): add --cache-backend

* chore(mod): update

* chore: add disclaimer
2020-12-21 08:26:19 +02:00
Masahiro331
8cd4afeaf1 fix(redhat): skip module packages (#776)
* remove cbinding

* skip modular packages

* add debug log

* Fix clomatic complexity 11

* Add comment

* Fix test release

* chore(mod): update

* refactor(redhat): rename a method

* test(redhat): refactor

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-12-18 07:52:13 +02:00
Teppei Fukuda
b606b621e5 chore: migrate from master to main (#778) 2020-12-17 17:27:36 +02:00
Teppei Fukuda
5c2b14b910 chore(circleci): remove gofmt (#777) 2020-12-17 15:35:11 +02:00
Teppei Fukuda
a19a023f1f chore(README): remove experimental (#775) 2020-12-16 06:06:17 +02:00
Simarpreet Singh
e6cef75162 NVD: Add timestamps. (#761)
* (feat): Add NVD published and modified dates

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

* (test): Fix golden files.

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

* (test): Fix registry_test.go golden files.

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

* (test): Fix distroless-base-ignore-unfixed.json.golden with ignore-unfixed option.

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

* (test): Fix fluentd-multiple-lockfiles.json.golden.

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

* (test): Fix alpine-310.html.golden file.

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

* fix(convert): fix disparency between standalone and client/server

* test(integration): update trivy.db

* test(integration): update golden files

* (test): Add a check for non nil date types.

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

* (test): Add a unit test for ConvertFromRPCResults.

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

* (test): Add a nil date case for ConvertFromRPCResults.

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

* refactor: sort imports

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-12-14 13:21:09 -08:00
Simarpreet Singh
1371f72cfb (fix): Make the table output less wide. (#763)
* (fix): Make the table output less wide.

Currently the table outupt can be as long as 200 characters wide in some
images like nginx:1.16

This PR merges the Title and the URL columns to shorten it.

With this change the longest column has reduced from 200 -> 162 (-19%).

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

* (fix): Remove Debian TEMP-* links.

These links are quite wide. Removing them makes it 200 -> 143 (-28.5%) shorter for table output.

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

* Revert "(fix): Remove Debian TEMP-* links."

This reverts commit 228540f7c3.
2020-12-08 11:08:30 -08:00
Christian Zunker
8ecaa2f057 Add gitHubToken to prevent rate limit problems (#769)
And remove unnecessary config parameters.

Fixes #768

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2020-12-08 09:39:22 +02:00
Christian Zunker
8132174754 Add helm chart to install trivy in server mode. (#751)
Fixes #688

Signed-off-by: Christian Zunker <christian.zunker@codecentric.cloud>
2020-12-06 13:21:19 +02:00
Jack Kelly
bcc285095d chore(docs): add nix install (#762) 2020-12-04 14:45:31 -08:00
irrandon
cb369727cd HTML template (#567)
* add html template

* test(integration): use JSONEq only for JSON folden files

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-12-02 10:50:45 +02:00
Teppei Fukuda
9bdbeaba66 feat: remove rpm dependency (#753)
* chore(docker): remove rpm

* chore(README): remove rpm

* fix(scanner): replace rpmcmd with rpm

* chore(goreleaser): remove rpm

* chore(mod): update fanal

* chore(mod): update fanal
2020-12-02 07:24:43 +02:00
Teppei Fukuda
d85cb77123 fix(vulnerability): make an empty severity UNKNOWN (#759) 2020-12-02 07:24:02 +02:00
Teppei Fukuda
1bee83ccc4 chore(README): add TRIVY_INSECURE (#760)
* chore(README): add TRIVY_INSECURE

* chore(README): replace server with registry
2020-11-30 16:43:33 +02:00
Teppei Fukuda
4d1894327e feat(vulnerability): add primary URLs (#752)
* refactor(vulnerability): rename a method

* feat(vulnerability): add primary url

* fix(templates): add primary links

* feat(writer): add url

* refactor(convert): remove an unnecessary function

* feat(rpc): add primary_url

* test(integration): update golden files
2020-11-26 06:06:26 +02:00
Teppei Fukuda
1391b3bf47 fix(oracle): handle ksplice advisories (#745) 2020-11-18 20:14:01 +02:00
Teppei Fukuda
b6d5b82c48 fix: version comparison (#740)
* feat: add comparer

* refactor: rename lang with ecosystem

* feat(bundler): add comparer

* feat(node): add comparer

* feat(bundler): integrate comparer

* feat(cargo): integrate comparer

* feat(composer): add comparer

* feat(ghsa): integrate comparer

* feat(node): integrate comparer

* feat(python): integrate comparer

* test(bundler): add tests

* test(cargo): add tests

* test(composer): add tests

* test(ghsa): add tests

* test(node): add tests

* test(python): add tests

* refactor(utils): remove unnecessary functions

* test(utils): add tests

* test: rename bucket prefixes

* fix(detect): use string

* chore: update dependencies

* docs: add comments

* fix(cargo): handle unpatched vulnerability

* test(db): update trivy-db for integration tests

* test(integration): update a golden file

* test(cargo): Add a case for missing patched version

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

* refactor(advisory): update comments

* refactor(node/advisory): change the receiver

* chore(mod): update dependencies

* refactor(comparer): unexport MatchVersion

* refactor: fix maligned structs

* test(node): add empty value

* refactor

* refactor: sort imports

* chore(mod): update trivy-db

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-11-17 11:38:58 +02:00
Gianni Carafa
9dfb0fe3a9 updated Readme.md (#737)
removed unused env var TRIVY_AUTH_URL
2020-11-12 21:16:42 -08:00
Dirk Mueller
455546975c Add suse sles 15.2 to the EOL list as well (#734)
without that you get this arning:
  WARN	This OS version is not on the EOL list: suse linux enterprise server 15.2

which is actually misleading because 15.2 is the most current release,
we just don't know when it ends. we can however assume that it runs
for at least another year.

Signed-off-by: Dirk Mueller <dirk@dmllr.de>
Signed-off-by: Dirk Mueller <dmueller@suse.com>
2020-10-30 16:42:48 -07:00
Sinith
c189aa6a0a Update README.md (#731) 2020-10-29 12:24:21 -07:00
Dax McDonald
8442528fa7 Warn when a user attempts to use trivy without a detectable lockfile (#729)
* Warn when a user attempts to use trivy without a detectable lockfile

* Update pkg/scanner/local/scan.go

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-10-29 12:45:59 +02:00
Dax McDonald
d09787e150 Add back support for FreeBSD & OpenBSD (#728)
Reverts 7fc94ad95c
2020-10-29 07:21:49 +02:00
Carlos Eduardo
0285a89c7c Add support for ppc64le architecture (#724) 2020-10-26 17:08:14 -07:00
Evgeniy Kosov
7d7784fecb Skip packages from unsupported repository (remi) (#695)
* Skip packages from unsupported repository (remi)

* Use HasSuffix instead of regexp match
2020-10-26 13:14:46 +02:00
Huang Huang
ca6f196001 Skip downloading DB if a remote DB is not updated (#717)
* Skip downloading DB if a remote DB is not updated

* Apply suggestions from code review

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

* update github.com/aquasecurity/trivy-db version

* fix lint

* Use UTC datetime

* display DownloadedAt info in debug log

* refactor(db): merge isLatestDB into isNewDB

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-10-26 09:07:30 +02:00
Huang Huang
e621cf2bc1 Sunsetting VendorVectors (#718) 2020-10-25 13:45:56 +02:00
Teppei Fukuda
906ab5483e Add GitHub Container Registry to README (#712) 2020-10-25 13:17:16 +02:00
Pascal Andy
1549c25709 update BUG_REPORT.md using H2 instead of bold formatting (#714) 2020-10-22 14:15:20 -07:00
Teppei Fukuda
fe1d07e58c fix(ci/deb): do not remove old packages for EOL versions (#706) 2020-10-22 06:52:42 +03:00
rahul2393
793a1aa3c8 Add linter check support (#679)
* add linter supports

* add only minor version

* use latest version

* Fix println with format issue

* Fix test

* Fix tests

* For slice with unknown length, preallocating the array

* fix code-coverage

* Removed linter rules

* Reverting linter fixes, adding TODO for later

* Ignore linter error for import

* Remove another err var.

* Ignore shadow error

* Fixes

* Fix issue

* Add back goimports local-prefixes

* Update local prefixes

* Removed extra spaces and merge the imports

* more refactoring

* Update photon.go

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-10-20 15:20:04 +03:00
Jeff Rescignano
4a94477532 Optimize images (#696) 2020-10-20 08:13:33 +03:00
Teppei Fukuda
9bc2b1949c Update triage.md (#701) 2020-10-20 08:12:47 +03:00
Aron Moore
49691ba85e ci(circle): update remote docker version (#683) 2020-10-13 15:39:01 +03:00
Dirk Mueller
87ff0c1bbc suse: update end of life dates for SLES service packs (#676)
All synced with https://www.suse.com/lifecycle/ as of today

Signed-off-by: Dirk Mueller <dirk@dmllr.de>
Signed-off-by: Dirk Mueller <dmueller@suse.com>
2020-10-11 10:30:28 +03:00
Karan Thanvi
de30c3f8d6 update readme for parallel run issue (#660)
* update readme for parallel run

* move to Q&A
2020-10-11 10:24:19 +03:00
Neha Viswanathan
4c3bfb89a4 fix link for Clear images section in README (#659) 2020-10-05 13:59:01 -07:00
Neha Viswanathan
8b21cfe7eb add link to Gitlab CI pipeline in README (#658) 2020-10-05 13:47:49 -07:00
Teppei Fukuda
46700f7b74 test: add tests for mux (#645) 2020-09-30 09:10:33 +03:00
Teppei Fukuda
014be7e143 chore: bump up Go to 1.15 (#646)
* chore: bump up Go to 1.15

* chore(goreleaser): ignore darwin/386
2020-09-24 08:00:08 +03:00
Alexander Lauster
b3ff2c35ea Add contrib/ to the release chain for Docker (#638)
* Add contrib/ to the release chain for Docker

Add the complete contrib/ folder to the release chain

* Include all template files to the tar.gz archives
2020-09-23 10:49:22 +03:00
Huang Huang
9c786de8f9 Add health check endpoint to trivy server (#644) 2020-09-21 16:30:45 +03:00
Teppei Fukuda
188e108d7c fix(cli): show help for subcommands (#629) 2020-09-21 14:03:25 +03:00
Huang Huang
7d7842f2f3 Add --skip-update option to fs and repo subcommand (#641) 2020-09-18 14:49:47 -07:00
Manuel Rüger
901a3715cb goreleaser.yml: Add all templates to archive (#636)
Fixes: https://github.com/aquasecurity/trivy/issues/631

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2020-09-15 16:09:38 -07:00
Masahiro331
095b5ce97c fix(cli): show help when no argument is passed (#628)
* Fix subcommands help

* refactor: call ShowAppHelpAndExit

* refactor: remove an unused error

* test: remove exit cases

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-09-08 17:32:20 +03:00
Teppei Fukuda
1d3f70e07f chore(image): push the official image to GitHub Container Registry as well (#627) 2020-09-08 15:06:32 +03:00
Teppei Fukuda
5e308da81a feat(cli): add --skip-files option (#624)
* feat(cli): add --skip-files

* test(integration): add --skip-files and --skip-dirs

* chore(docs): update README

* chore(docs): correct a grammar mistake
2020-09-08 15:04:56 +03:00
Teppei Fukuda
2231e4068d chore(docs): update comparison table (#623)
* chore(docs): update README

* use 
2020-09-02 16:56:30 +03:00
Simarpreet Singh
b3680f0016 logo: Add new Trivy logo (#615)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-09-02 12:41:11 +03:00
Carol Valencia
89527796f6 fix(Readme) - Results using a template (#622)
Co-authored-by: Carol Valencia <krol3@users.noreply.github.com>
2020-09-02 12:40:05 +03:00
Chris Aumann
165d593fdb Improve Gitlab CI installation step in README (#621)
This improves the installation step in `.gitlab-ci.yml`. 

- Removes unnecessary installation and use of `curl` (replaces it with `wget`)
- Removes storing the intermediate file by using a pipe to `tar`
2020-09-02 12:39:05 +03:00
Teppei Fukuda
d8b09628f0 feat(rpc): add CWE-ID (#614) 2020-09-02 07:42:32 +03:00
Alexander Lauster
d35e8ec351 Add all templates to the docker image (#619)
Before this change, only a subset of templates were included in the docker image.
Now all templates which are part of the git repo will be included when the docker image will be build, a future commit for every new template is not needed anymore
2020-08-31 11:16:22 +03:00
Teppei Fukuda
f50b0ce8af feat(library): support a custom data source (#613)
* chore(mod): update trivy-db

* refactor(detector/library): use programming language instead of package
manager

* feat(library): add general advisory

* test(utils): add a util function initializing DB

* test(advisory): add tests

* chore: use aquasecurity/bolt-fixtures

* refactor: add comments

* chore(mod): revert fanal version

* chore(mod): update trivy-db

* refactor: update the comment
2020-08-30 10:11:32 +03:00
Teppei Fukuda
ed8607b710 fix(alpine): use source package (#607)
* chore(mod): update fanal

* fix(integration): support -update flag

* fix(alpine): use source package for vulnerability detection

* test(integration): update golden files

* chore(mod): update fanal
2020-08-25 13:01:49 +03:00
Teppei Fukuda
ea28d3b6f3 test(vulnerability): fix usages of new trivy-db refactor changes (#611)
* mod: Update trivy-db

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

* vulnerability_test: Fix usages of new trivy-db refactor changes

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

* chore(mod): update trivy-db

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-08-25 12:21:15 +03:00
Teppei Fukuda
827cea3245 refactor(bundler): remove unnecessary code (#610) 2020-08-24 13:22:11 +03:00
Simarpreet Singh
b2a0d83518 codecov: Move into root directory (#608)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-08-20 10:21:52 -07:00
rahul2393
85e0139f32 Fix: fullDescription field in SARIF output is not correctly escaped (#605)
* Fixed sarif template fullDescription escape

* Added fix to other possible places

* Added test for escaping character
2020-08-19 10:23:04 -07:00
Teppei Fukuda
80d5df0ceb chore(docs): add AWS Security Hub (#598)
* chore(docs): add AWS Security Hub

* Update docs/integration/security-hub.md

Co-authored-by: Simarpreet Singh <simar@linux.com>

* Update README.md

Co-authored-by: Liz Rice <liz@lizrice.com>

Co-authored-by: Simarpreet Singh <simar@linux.com>
Co-authored-by: Liz Rice <liz@lizrice.com>
2020-08-19 13:19:24 +03:00
Teppei Fukuda
3a54e5b644 refactor(writer): define the constructor for TemplateWriter (#597) 2020-08-17 09:06:50 +03:00
Simarpreet Singh
acc6a9bd01 circleci: Allow coverage changes without a failure (#599)
Ref: https://github.com/testground/testground/pull/430

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-08-13 10:13:49 +03:00
Teppei Fukuda
96af6dc499 feat: add --skip-directories option (#595)
* feat: add --skip-directories option

* chore(README): update

* refactor: rename skip-directories to skip-dirs

* Update internal/app.go

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>

* refactor: add some context in the warning message

* chore(README): update

Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>
2020-08-12 14:03:12 +03:00
rahul2393
675e1b4118 Added test and support of ASFF template (#594)
* Added test and support of ASFF template

* Improve test coverage

* Fixed/Improved tests

* Removed extra space

* Added NVD score/vectors, Added logic to trim description due to file size restriction

* Included quotations around AccountID
2020-08-12 13:25:58 +03:00
Carol Valencia
8ca484f538 fix: remove error using no options (#539)
* fix: remove error using no options

* chore: return error in Init

* chore: return custom error ErrNoTarget

* Update internal/config/artifact.go

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

* Update internal/config/artifact.go

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

* Update internal/artifact/image.go

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>

* chore - remove error using no options

* fix(config): typo

* test(config): change the log level

* test(config): revert removed tests

Co-authored-by: Carol <krol3@users.noreply.github.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-08-09 10:39:27 +03:00
Sebastian Gumprich
9a25f4fbe4 Fix comparison table to use words instead of symbols (#587)
fixes #301
2020-08-05 10:38:45 +03:00
Simarpreet Singh
467ec46cd3 sarif: Remove extra periods from short descriptions (#590)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-08-04 22:28:11 -07:00
rahul2393
52feff2213 Added template fucntion to escape string before output (#583)
* Added template fucntion to escape string before output

* Fixed tests
2020-07-31 10:12:49 -07:00
rahul2393
add65f2f0c Revert Dockerfile changes (#581) 2020-07-30 22:04:31 +03:00
rahul2393
20f2bae49b Fix non-root directory permission denied error (#578)
* Fix non-root directory permission denied error

* Updated Readme

* Fixed Readme

* Updated readme to use latest tag for QA error

* updated Dockerfile

* Moved error to others section
2020-07-30 12:57:44 +03:00
Simarpreet Singh
8eb9df8447 .circleci: Add code coverage (#572)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-07-29 15:09:27 -07:00
rahul2393
88aaffa957 Added support of list-all-packages (#574)
* Added support of list-all-packages

* updated Readme

* Added library packages and fixed import name

* updated env var name

* Sorting packages in scan
2020-07-29 22:11:38 +03:00
Moch. Lutfi
469c0b41df fix: only show severity total from filter flags (#559)
* Add filter table output by severity flags

* Simplify filter output

* Fix unit test

* add filter unique severities

* remove wrong comment

* Remove utils and update logic

* chore(mod): tidy

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-07-29 10:54:51 +03:00
Teppei Fukuda
4a34f72f22 Update README.md (#575) 2020-07-29 10:31:49 +03:00
Simarpreet Singh
4d721e1410 SARIF: Tweak format for GitHub UI (#571)
* sarif: Tweak format for GitHub UI

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

* sarif: Make sarif easier to use with a default template

This will help us use Trivy in places like GitHub Actions where
we cannot specify a template as input.

$ trivy image --format=sarif alpine:3.10.1

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

* Revert "sarif: Make sarif easier to use with a default template"

This reverts commit 5b5d1c8f7d.

* .dockerignore: Add un-needed large directories

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

* Dockerfile: Add sarif template.

This will let users run and save the output through the docker image

Example:
```
docker run --rm -it -v $(pwd):/tmp aquasec/trivy:latest image -f template --template "@contrib/sarif.tpl" --output="/tmp/sarif.test" alpine:3.10.2
```

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-07-28 11:22:03 -07:00
rahul2393
9c91da8a2b Add non root user (#570) 2020-07-28 12:37:43 +03:00
Simarpreet Singh
5b9d942313 rpc: Add CVSS information to client/server (#564)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-07-26 15:06:25 +03:00
rahul2393
d6b37cb87e Fix --timeout flag (#569)
* Wrapped scan call inside context timeout

* timeout has default value
2020-07-22 21:33:30 +03:00
Teppei Fukuda
9c6f077818 feat(report): support OPA to filter vulnerabilities (#562)
* feat(cli): add --filter option

* feat(opa): support OPA

* test(opa): add a test case with OPA

* test: update a mock

* chore(mod): update dependencies

* chore(filter): add example Rego files

* chore(README): update

* chore(rego): apply opa fmt

* refactor: replace filter with policy

* chore(policy): update rego files

* fix(vulnerability): evaluate each vulnerability

* chore(README): update

* Update README.md

Co-authored-by: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-authored-by: Itay Shakury <itay@itaysk.com>

* chore(README): update a TOC link

* fix: replace allow with ignore

* chore(README): update

Co-authored-by: Itay Shakury <itay@itaysk.com>
2020-07-22 21:10:44 +03:00
rahul2393
0b5d936dbe Fixed case when pre-release is in suffix (#565)
* Fixed case when pre-release is in suffix

* moved regex to global scope

* removed not needed code

* Update error to debug

* skip constraint when empty
2020-07-22 08:57:19 +03:00
rahul2393
6eebed33b2 improve ruby comparison version check. (#552)
* Implemented ruby comparison version check.

* Added semver package to validate and check version

* Added more tests

* Replaced go-version with semver

* Removing go-version from dependency

* Added check for ruby gem version format

* Updated semver model and patch rewrite process

* Refactoring
2020-07-19 18:03:56 +03:00
rahul2393
43085a80bc Added sarif template (#558)
* Added sarif template

* Updated readme

* fixed tests

* Added integration tests and fixed all sarif validations issues

* Added tests for endWithPeriod

* Fixed tests, and added sarif golden file

* removed optional newline sequence
2020-07-17 11:08:50 -07:00
Teppei Fukuda
4f90b114ea feat(vulnerability): add CWE-ID (#561)
* chore(mod): update dependency

* test(vulnerability): add CweIDs
2020-07-16 11:07:27 +03:00
Michal Slusarczyk
d9fa353a06 Fixing Error retrieving template from path when --format is not template but template is provided (#556) 2020-07-13 14:01:08 +03:00
Michal Slusarczyk
9a1d7460f6 Adding contrib/junit.tpl to docker image (#554) 2020-07-09 09:23:31 +03:00
Simarpreet Singh
d18d17b861 db: Update trivy-db to include CVSS score info (#530)
* mod: Update trivy-db to include CVSS score info

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

* mod: Update go.mod

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

* mod: Update trivy-db to latest

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-07-07 08:16:42 -07:00
Liz Rice
4b57c0d4e6 docs: fix markdown (#553)
Correct markdown for MicroScanner link
2020-07-07 16:27:51 +03:00
rahul2393
ccd9b2d2c5 Added function to escape string in failure message title and descriptions (#551)
* Added function to escape string in failure message title and descriptions

* updated template to use xml.EscapeText

* Renamed template function
2020-07-06 12:43:11 +03:00
rahul2393
ec770cd819 Added JUNIT support (#541)
* added template for junit

* updated readme and junit format

* Added severity in testcase name instead of separate failure block
2020-06-25 17:23:04 +03:00
Teppei Fukuda
b7ec633fb2 chore(docs): mention air-gapped environment (#544)
* chore(docs): mention air-gapped environment

* Update docs/air-gap.md

Co-authored-by: Liz Rice <liz@lizrice.com>
2020-06-24 17:15:17 +03:00
Teppei Fukuda
7aabff1236 chore(README): add programming languages (#543) 2020-06-23 20:52:43 +03:00
Teppei Fukuda
9dc1bdffb1 fix(log): write error messages to stderr (#538) 2020-06-23 15:06:42 +03:00
Simarpreet Singh
2ac672a663 Use StoreMetadata from trivy-db (#509)
* db_test: Remove cruft

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

* db: Add StoreMetadata from trivy-db.

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

* mod: Update trivy-db dependency

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

* mod: Bump trivy-db version

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

* db: Eliminate metadata.Store

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

* db: Add a TODO to move things into trivy-db repo

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-06-22 14:29:38 -07:00
Liz Rice
11ae6b29d5 docs: add more CI options to README (#535)
Add GitHub Actions and AWS CodePipeline to CI section of Readme
Correct a broken link to "Data sources"
2020-06-21 11:26:22 +03:00
Teppei Fukuda
f201f59e27 chore(Dockerfile): bump up alpine to 3.12 (#528) 2020-06-15 11:29:38 +03:00
Teppei Fukuda
25d45e1ac5 fix(alpine): replace go-deb-version with go-apk-version (#520)
* fix(alpine): add a failing test with go-deb-version

* fix(alpine): replace go-deb-version with go-apk-version

* chore(mod): update dependencies

* chore(mod): update go-apk-version
2020-06-11 12:55:34 +03:00
Oran Moshai
298ba99b8f fix: MissingBlobs is implemented different in FS and S3 the method log… (#522)
* fix: MissingBlobs is implemented diffrent in FS and S3 the method logic moved to cache.MissingBlobs

* fix(unittest): implement MockArtifactCache instead MockLocalArtifactCache

* fix(gofmt)

* fix naming convention

Co-authored-by: oranmoshai <oran.moshai@aquasec.com>
2020-06-10 10:38:37 +03:00
Teppei Fukuda
65cbe3cac3 fix(alpine): support 3.12 (#517) 2020-06-08 17:17:38 +03:00
Teppei Fukuda
f94e8dcf04 chore(README): prepare for v0.9.0 (#507)
* chore(README): prepare for v0.9.0

* chore(README): replace 'artifacts' with 'containers and other artifacts'

* chore: more detail for filesystem scan

Co-authored-by: Liz Rice <liz@lizrice.com>

* chore: more detail for embedding Trivy in the Dockerfile

Co-authored-by: Liz Rice <liz@lizrice.com>

* Update README.md

Co-authored-by: Liz Rice <liz@lizrice.com>

* Update README.md

Co-authored-by: Liz Rice <liz@lizrice.com>

* chore(README): add a new line

* chore(README): revert TOC and add blog links

* chore(README): add Microscanner link

Co-authored-by: Liz Rice <liz@lizrice.com>
2020-06-08 16:20:44 +03:00
Teppei Fukuda
9629303a0f fix(config): transpose arguments (#516) 2020-06-08 15:47:20 +03:00
Teppei Fukuda
020c4a3b14 fix(app): add ArgsUsage (#508) 2020-06-02 21:28:14 +03:00
Teppei Fukuda
2f2d1a908b feat: support repository and filesystem scan (#503)
* refactor: embed config

* refactor: replace image and layer with artifact and blob

* feat(config): add ArtifactConfig

* fix(scanner): use Artifact

* test(scanner): update mocks

* feat: add repo and fs subcommands

* chore(mod): update

* refactor: fix warn message

* feat(cli): add --no-progress to repo and fs

* mod: Update fanal dependency

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

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-05-30 19:46:12 +03:00
Masahiro331
03ad8a3cd0 Add GHSA support (#467)
* Change library advisory use github security advisory

* Add java scanner

* Add multi vulnsrc support

* Fix null pointer exception

* Add ghsa mock test

* Delete nuget & java

* Update README

* Fix bug

* refactor: add ghsa

* refactor: Add multi scanner in driver.go

* fix go.mod

* Add scanner.go

* Add parse lockfile

* unexport Driver & delete parse lockfile

* Fix scanner struct

* refactor: scanner -> advisory

* Add Driver

* delete Driver interface

* Add new drivers

* delete types.go

* Fix review

* Merge driver.go ← advisory.go

* Change NewDriver interface

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-05-30 09:34:00 +03:00
Teppei Fukuda
1218e111ef refactor: define common options and embed them into the option for subcommand (#502)
* refactor: embed config

* config_test: Add some missing cases for custom headers

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

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-05-29 22:09:30 +03:00
Simarpreet Singh
78b7529172 Add image subcommand (#493)
* config_test: Add missing assertions for TestNew

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

* integration: Add integration tests for image subcommand.

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

* refactor: bump up urfave/cli to v2.0

* refactor: apply DIY to image flags

* refactor: reorder sub commands

* feat: set hidden to global image options

* test(integration): insert --cache-dir before sub command

* README: update readme to reflect new usage

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

* chore(README): add image subcommand

* fix(flags): define aliases according to urfave/cli v2.0 style

Co-authored-by: knqyf263 <knqyf263@gmail.com>
2020-05-25 12:06:15 +03:00
Teppei Fukuda
e2bcb44687 fix: remove help template (#500) 2020-05-25 11:28:29 +03:00
Simarpreet Singh
a57c27eeec vulnerability: Add CVSS Vectors to JSON output. (#484)
* vulnerability: Add CVSS Vectors to JSON output.

Now Trivy will display the CVSS Vectors presented by various
vendors as part of the JSON output. This can be seen as follows:

```
      {
        "VulnerabilityID": "CVE-2019-9923",
        "PkgName": "tar",
        "InstalledVersion": "1.30+dfsg-6",
        "Layer": {
          "Digest": "sha256:90fe46dd819953eb995f9cc9c326130abe9dd0b3993a998e12c01d0218a0b831",
          "DiffID": "sha256:e40d297cf5f89a9822af4c2f63caa2f2085d5aa188137506918e603774b083cb"
        },
        "SeveritySource": "debian",
        "Title": "tar: null-pointer dereference in pax_decode_header in sparse.c",
        "Description": "pax_decode_header in sparse.c in GNU Tar before 1.32 had a NULL pointer dereference when parsing certain archives that have malformed extended headers.",
        "Severity": "LOW",
        "VendorVectors": {
          "nvd": {
            "v2": "AV:N/AC:L/Au:N/C:N/I:N/A:P",
            "v3": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
          },
          "redhat": {
            "v3": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L"
          }
        },
        "References": [
          "http://git.savannah.gnu.org/cgit/tar.git/commit/?id=cb07844454d8cc9fb21f53ace75975f91185a120",
          "http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00077.html",
          "http://savannah.gnu.org/bugs/?55369",
          "https://bugs.launchpad.net/ubuntu/+source/tar/+bug/1810241"
        ]
      },
```

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

* mod: Update to latest master of trivy-db

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

* vulnerability_test: Fix tests for new struct type

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-05-21 14:22:14 -07:00
Teppei Fukuda
926f323a72 feat: support registry token (#482)
* feat: support registry token

* chore(mod): update

* test(integration): add registry tests

* chore(mod): update

* test(integration): comment in terminate

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-05-19 20:49:27 +03:00
Teppei Fukuda
aa20adb22b chore: bump up urfave/cli to v2 (#499) 2020-05-18 14:43:06 +03:00
Teppei Fukuda
3e0779a78d chore(doc): update README (#490) 2020-05-12 15:17:06 +03:00
Teppei Fukuda
09442d65f2 chore(ci): move integration tests to GitHub Actions (#485)
* fix(standalone): add defer to close databases

* test(client/server): launch a server only once

* test(docker_engine): remove the duplicated case

* test(docker_engine): copy a database only once

* test(standalone): copy a database only once

* test(server): fix tests according to updated mock

* chore(mod): update

* chore(ci): add integration tests to GitHub Actions

* chore(ci): bump up Go to 1.14

* chore(ci): remove integration tests from CircleCI

* chore(ci): add name

* chore(ci): add new lines
2020-05-05 11:14:28 +03:00
Teppei Fukuda
415b99dab3 feat: support OCI Image Format (#475)
* chore(wire): specify package names

* fix(extractor): remove types.GetDockerOption

* chore(README): mention OCI support

* chore(mod): update dependencies

* test(integration): fix an error message

* test(integration): revert the error message

* chore(mod): tidy

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-05-03 11:30:49 +03:00
Teppei Fukuda
35b038edd3 chore(github): fix issue templates (#483) 2020-05-03 10:28:13 +03:00
Manuel Rüger
34a95c1556 contrib/gitlab.tpl: Add new id field (#468)
* contrib/gitlab.tpl: Add new id field

https://docs.gitlab.com/ee/user/application_security/container_scanning/#reports-json-format

vulnerabilities[].id	Unique identifier of the vulnerability.
vulnerabilities[].cve	(DEPRECATED - use vulnerabilities[].id instead) A fingerprint string value that represents a concrete occurrence of the vulnerability. It’s used to determine whether two vulnerability occurrences are same or different. May not be 100% accurate. This is NOT a CVE.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>

* Update integration test for Gitlab

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-04-30 20:22:14 +03:00
Teppei Fukuda
b2821420fd chore(docs): add triage.md (#473)
* chore(docs): add triage.md

* chore(labels): manage labels as code

* chore(triage): mention a milestone

* chore(triage): fix

Co-Authored-By: Liz Rice <liz@lizrice.com>

* chore(labels): remove rotten

* chore(labels): remove lifecycle/active

* chore(labels): sort priority labels

* chore(docs): add help-wanted.md

* chore(docs): move documents to contrib dir

Co-authored-by: Liz Rice <liz@lizrice.com>
2020-04-30 14:07:23 +03:00
Teppei Fukuda
216a33b4cd fix: handle a scratch/busybox/DockerSlim image gracefully (#476)
* fix: handle unknown OS and no package errors

* chore(mod): update dependencies

* integration: add busybox

* update depdendencies and fix tests

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

* chore(mod): use the latest trivy-db

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-04-30 12:48:28 +03:00
Simarpreet Singh
ad0bb7ce23 rpc: Fix output to use templates when in client server mode. (#469)
Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-04-22 13:38:48 -07:00
Simarpreet Singh
17b84f6c09 Override with Vendor score if exists (#433)
* wip: Add a failing test to demo severity override

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

* scan.go: Return osFound for use in determining vendor.

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

* pkg: Fix ScanImage return in case an OSFound

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

* scan_test: Include a package-lock.json for happy path

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

* wip: Add a test to include various reportResult types

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

* Makefile: Add a target to generate mocks.

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

* vulnerability: Pass reportType as argument for FillInfo.

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

* vulnerability: Add other types of vulnerabilities.

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

* integration: Update golden files.

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

* ospkg: Fix FillInfo for ospkg/server

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

* rpc: Add os.Family type to Response.

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

* vulnerability_test.go: Add case where no vendor severity exists.

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

* vulnerability: Fallback to NVD if it exists.

Also add tests for other cases.

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

* rpc: Fix a few sites with reportType info and tests.

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

* vulnerability: Remove VendorSeverity from displayed results

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

* vulnerability: Add vulnerability source information.

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

* vulnerability: Add VendorSeverity logic for lightDB as well.

This commit also makes FillInfo logic common to both light and full DBs.

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

* remove some crufty TODOs

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

* vulnerability_test: Add a case for light db for documentation purposes

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

* mod: update trivy-db to point to master

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

* scan_test: Remove cruft and bring back test cases

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

* scan_test: Add pkg Type to mock return

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

* vulnerability: reorder err check after err

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

* client_test: Fix import ordering

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

* convert.go: Use result.Type

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

* convert: Use result.Type and simplify ConvertFromRpcResults signature

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

* vulnerability: Refactor calls to getVendorSeverity

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

* integration: Remove centos-7-critical.json.golden

There's no critical vulnerability in CentOS 7 anymore.
In addition this test was not adding any value that is already
not covered by existing tests cases.

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

* rpc: Include severity source in tests.

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

* integration: Update test db to include VendorSeverity.

Test DB is now a snapshot of full database from trivy-db.

Also update golden files to include SeveritySource.

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

* vulnerability: Make centos7 use RHEL vendor severities

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-04-16 16:58:58 -07:00
Simarpreet Singh
7629f7f0d6 docs: Update installation docs for pointing to Trivy Releases. (#463)
Fixes: https://github.com/aquasecurity/trivy/issues/461
Signed-off-by: Simarpreet Singh <simar@linux.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-04-16 11:44:52 +03:00
Teppei Fukuda
ac5f313129 feat(db): store metadata as a file (#464)
* refactor: wrap errors

* feat(db): add the metadata file

* test(db): re-generate mocks

* fix(app): read metadata from the file in showVersion

* fix: open the database after downloading it

* fix(operation): use UpdateMetadata

* chore(mod): update dependency

* test(integration): fix tests

* fix(conf): rename TRIVY_NONSSL to TRIVY_NON_SSL
2020-04-15 16:07:42 +03:00
Teppei Fukuda
329f245283 fix: replace containers/image with google/go-containerregistry (#456)
* chore(mod): update dependencies

* fix(internal): remove cleanup

* fix: use only diff_id

* fix: use string instead of digest

* fix: replace LayerID with Layer

* test(integration): negotiate API version

* feat(conf): add TRIVY_NONSSL

* test(integration): update golden files

* test(integration): fix the error message

* chore(debian): add comments

* chore(mod): update dependencies
2020-04-14 13:31:13 +03:00
Kapil Thangavelu
d6595ad7c9 add ubuntu 20.04 (#460)
* add ubuntu 20.04

* add fossa to ubuntu.csv misc data

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-04-13 11:50:41 +03:00
Dominik Braun
114df7a345 using STDIN for docker login command (#458) 2020-04-13 11:33:00 +03:00
Alexandre Sieira
e5ff5ec895 Fix CircleCI example in README.md (#451)
After trying to run trivy using CircleCI based on the sample configuration and failing, I want to suggest the following updates:

* `docker:18.09-git` no longer exists and causes workflow to fail, replaced with `stable-git` instead.
* added  `setup_remote_docker` or else the docker commands fail in the rest of the execution, as per https://circleci.com/docs/2.0/building-docker-images/#overview

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-04-01 10:32:00 +03:00
Teppei Fukuda
1bc02f9f6a fix(db): retry downloading the database if it is broken (#452) 2020-03-31 17:56:34 +03:00
Teppei Fukuda
05fa7791dc chore(release): add all supported versions (#445) 2020-03-31 11:51:03 +03:00
Simarpreet Singh
6fbdec6e83 app: Fix a few edge cases with version flag (#443)
* app: Show just version if DB is missing

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

* app: Dont panic if cache-dir is bogus

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

* app: DRY up logic for showVersion

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-03-24 11:09:05 +02:00
Simarpreet Singh
94eb7cc592 Expose Trivy and VulnDB version through --version (#435)
* app: Expose Trivy and VulnDB version through --version

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

* pkg: Use time.Time as value not reference.

Based on: 64db180151

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

* app: Use various formatted outputs

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

* app: Take value of --cache-dir for cacheDir

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

* app: Refactor and test showVersion

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

* library: lighten names by remove version suffix

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

* app: Show types and add parity of table and JSON

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

* app: Switch to show using UTC time

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

* mod: Update to latest trivy-db master.

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

* app: Use c.App.Writer for os.Stdout

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

* app: Replace table output with docker version style output

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

* app: Fix output to show as "Version" for Trivy version.

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

* app: Move VersionInfo struct out to app.go

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-03-20 10:19:44 -07:00
Teppei Fukuda
b847e57991 feat: show origin layer for vulnerabilities (#439)
* chore(mod): update dependencies

* test(integration): update the golden file
2020-03-18 11:00:23 +02:00
Sebastian Ehmann
07a731c4bb Fix filepath separators on Windows (#414)
* Use correct os dependent path separator for test paths

* Use correct os dependent path separator

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-03-16 16:31:50 +02:00
Andrii Soldatenko
4ee7a1e173 fix circleci example (#431)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-03-16 11:56:06 +02:00
Liz Rice
ede778fb7d Merge pull request #434 from aquasecurity/license
Change license to Apache 2.0
2020-03-13 11:08:25 +00:00
Liz Rice
64a07dad38 Merge branch 'master' into license 2020-03-13 10:54:17 +00:00
Liz Rice
623eb79080 Remove outdated license section from README 2020-03-13 10:26:05 +00:00
Liz Rice
51b8fd8393 Change license to Apache 2.0, continued 2020-03-13 09:49:19 +00:00
Liz Rice
6f7776e5ec Change license to Apache 2.0 2020-03-11 18:16:40 +00:00
Teppei Fukuda
a70cee9651 chore(ci): add cross-compile test (#425)
* chore(ci): add cross-compile test

* chore: add --snapshot

* chore(ci): rename job
2020-03-09 18:20:38 +02:00
Teppei Fukuda
5e36cb91de fix(rpm): make it possible to scan non-RHEL images without rpm (#429) 2020-03-06 14:39:55 +02:00
Teppei Fukuda
74bf99b828 fix(token): use the credential from enviroment variable (#427) 2020-03-06 11:43:14 +02:00
Teppei Fukuda
3ed0cfbd5f chore(goreleaser): drop BSD support temporarily (#424) 2020-03-05 17:12:29 +02:00
Teppei Fukuda
aca31dffb3 detector: Add LayerID to detect vulns (#419)
* detector/alpine: Add LayerID to detect vulns

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

* amazon: Add LayerID to DetectedVulns

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

* debian: Add LayerID to DetectVulns + tests

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

* oracle: Add LayerID to DetectVulns + tests

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

* photon: Add LayerID to DetectVulns + tests

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

* redhat: Add LayerID to DetectVulns + tests

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

* suse: Add LayerID to DetectVulns + tests

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

* ubuntu: Add LayerID to DetectVulns + tests

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

* integration: Fix integration tests to include LayerID

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

* fix(rpc): add layer_id

* fix(rpc): insert layer_id to the struct

* fix(extractor): add cleanup function

* fix(library): add layer ID to detected vulnerabilities

* test: update mocks

* chore(mod): point to the feature branch of fanal

* mod: Point to fanal/master

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

* scan_test: Include LayerID as part of the assertion

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

* docker_engine_test.go: Update an error message to conform with fanal/master.

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

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-03-04 19:55:16 +02:00
Teppei Fukuda
18b80e3781 feat(cache): based on JSON (#398)
* refactor(docker_conf): rename and remove unnecessary options

* feat(rpc): define new API

* fix(cli): change default timeout

* fix(import): fix package names

* refactor(vulnerability): remove old mock

* refactor(utils): remove un-needed functions

* feat(cache): implement cache communicating with a server

* refactor(scan): separate scan function as local scanner

* test(scanner): add tests for ScanImage

* refactor(scan): remove unused options

* test(vulnerability): generate mock

* refactor(server): split a file

* feat(server): implement new RPC server

* feat(client): implement new RPC client

* fix(cache): use new cache interface

* fix(standalone): use new scanner

* fix(client): use new scanner

* fix(server): pass cache

* test(integration): make sure an error is not nil before calling the method

* fix(mod): update dependencies

* test(integration): ensure the image load finishes

* feat(docker): support DOCKER_HOST and DOCKER_CERT_PATH

* chore(mod): update dependencies

* refactor(rpc): remove old client

* feat(server): support old API for backward compatibility

* fix(server): check a schema version of JSON cache

* fix(rpc): add a version to packages

* feat(rpc): add PutImage

* test: rename expectations

* refactor(cache): rename LayerCache to ImageCache

* refactor: rename ImageInfo to ImageReference

* fix(applier): pass image_id to ApplyLayer

* feat(cache): handle image cache

* chore(mod): update dependencies

* refactor(server): pass only config

* feat(cli): add -removed-pkgs option

* refactor(err): wrap errors
2020-02-27 23:17:55 +02:00
Teppei Fukuda
b83174f32d chore(README): add explanation for self-compiled binaries/packages (#413) 2020-02-20 10:08:15 +02:00
Takuya N
80bbe47774 fix(gitlab): fix json generation on loop (#409)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-02-18 14:32:56 +02:00
Teppei Fukuda
7726963e86 fix(scanner): pass docker options as an argument (#408) 2020-02-18 14:18:11 +02:00
Takuya N
db2136b17c doc: Add Alpine Linux 3.11 to supported OS docs (#407)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2020-02-18 12:14:06 +02:00
Teppei Fukuda
42043a0888 fix(client): add image name and build time (#402)
* WIP: Add imageName and BuildTime for Remote detector

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

* wip

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

* change name from build_time to created

* remove an unused function

* fix(library): add image_name and created_at

* fix(ospkg): add image_name and created_at

* fix(scan): add image_name and created_at

* fix(library): remove unused param

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-02-16 10:35:53 +02:00
Teppei Fukuda
246793e873 fix(redhat): use binary package name for OVAL (#393)
* fix(redhat): use binary package name for OVAL

* test(redhat): add a test

* test(imtegration): update golden files
2020-01-28 15:59:47 +02:00
Takuya N
692b0f1410 cli: append warning when --template option is ignored (#391)
* test: cli: append warning when --template option is ignored

to avoid --template is silently ignored when --format <table|json>
or no --format is passed.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

* cli: append warning when --template option is ignored

to avoid --template is silently ignored when --format <table|json>
or no --format is passed.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

* test: cli: append warning when --format template is ignored

when --template is not specified

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

* cli: append warning when --format template is ignored

when --template is not specified

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-01-28 13:32:57 +02:00
Teppei Fukuda
0629e1d731 fix(cli): reject multiple images (#392) 2020-01-28 12:02:34 +02:00
Takuya N
9707c7bcb1 Initial GitLab CI template to deeply integrated with GitLab Container Scanning (#376)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2020-01-26 16:08:44 +02:00
Davin Kevin
194fbef73c feat(): include GitLab template inside the docker container (#388)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-01-26 11:09:07 +02:00
Takuya N
f7db00c1eb Modify template for GitLab Container Scanning (#387)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2020-01-26 10:04:27 +02:00
Teppei Fukuda
2f4b31ecc6 chore(goreleaser): bump up to 0.124.1 (#383) 2020-01-23 14:13:01 +02:00
Takuya N
9289624688 doc: Update GitLab CI example documentation (#375)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-01-23 12:08:18 +02:00
Teppei Fukuda
5a8749cd5b chore: add install script (#370)
* chore: add install script

* installer: change perms to include +x

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

Co-authored-by: Simarpreet Singh <simar@linux.com>
2020-01-19 09:13:36 +02:00
Aruneko
4a7fb525d7 fix typo in example of .gitlab-ci.yml (#373) 2020-01-17 12:16:00 +02:00
Teppei Fukuda
8888fcafa7 chore(goreleaser): change name_template to file_name_template (#369) 2020-01-14 12:30:53 +02:00
Manuel Rüger
63a8c6d26b Integrate with Gitlab Container Scanning (#367)
This PR integrates trivy with Gitlab Container Scanning and provides a
similar report. It adds the required template to the release tarball for easy
consumption.

https://docs.gitlab.com/ee/user/application_security/container_scanning/
https://gitlab.com/gitlab-org/gitlab/issues/11947
2020-01-14 11:46:14 +02:00
Teppei Fukuda
fc222bed7c chore: change a licence in goreleaser.yml (#365) 2020-01-13 12:58:22 +02:00
Manuel Rüger
6132ff93a2 template: Load template from paths (#202)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-01-13 11:39:02 +02:00
Manuel Rüger
87556aa741 Dockerfile: Update to alpine 3.11 (#361)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2020-01-13 10:45:55 +02:00
Masahiro Fujimura
43362b2832 Fix inifinite loop when resolving dependencies of packages in Alpine (#364)
* Change fanal ref

* Fix Inifinite loop when resolving dependencies of packages in Alpine
2020-01-12 18:39:21 +02:00
Simarpreet Singh
db2d0c2e9b docker_engine_test: Add more OSes (#358)
* docker_engine_test: Add more OSes

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

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

* integration: Add all OSes for docker mode.

Signed-off-by: Simarpreet Singh <simar@linux.com>
2020-01-10 21:25:43 +02:00
Huang Huang
922d493159 Add EOL Date for alpine 3.11 (#359)
Ref: https://endoflife.date/alpine
2020-01-08 10:33:17 +02:00
Teppei Fukuda
c4811c3104 chore(dep): update (#357) 2020-01-05 22:53:06 +02:00
Teppei Fukuda
0ec840b3b4 feat(client): retry HTTP request when getting an unavailable error (#350)
* feat(client): retry HTTP request when getting an unavailable error

* fix(integration-test): use a snapshot database for Docker mode (#352)

* fix(integration): add a binary name

The first argument is used for the program name. --skip-update was
ignored.

* fix(integration): use a snapshot database

After a new vulnerability is found, this test fails

* chore(integration): add t.Run

* refactor(client): functionalize common processes

* refactor(client): remove unused const
2020-01-05 10:21:18 +02:00
Teppei Fukuda
0b96d08877 fix(integration-test): use a snapshot database for Docker mode (#352)
* fix(integration): add a binary name

The first argument is used for the program name. --skip-update was
ignored.

* fix(integration): use a snapshot database

After a new vulnerability is found, this test fails

* chore(integration): add t.Run
2019-12-30 17:48:15 +02:00
Masahiro Fujimura
7abd41609f Delete requires for release (#345) 2019-12-27 11:24:23 +02:00
Masahiro Fujimura
fcc193b7d1 Support Photon OS (#340)
* Add photon

* test(vulnerability): use generated structs and mock

* test(photon): add integration tests

* test(photon): comment in

* test(integration): add vulnerability details to trivy.db

* chore(mod): update dependencies

* chore(README): add Photon OS

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2019-12-27 10:30:53 +02:00
Teppei Fukuda
44d74a7d8a chore(README): add 0.0.0.0 to the server example (#342) 2019-12-26 16:19:48 +02:00
Teppei Fukuda
4189855fc1 fix(cache): specify a directory to store image cache (#341)
* chore(mod): update dependencies

* fix(scanner): make scanner take a cache client as the argument

* refactor: sort imports

* refactor(cache): create a struct to clear cache

* fix(cache): use a struct to clear cache

* fix(wire): update constructor to take cache struct

* fix(cache): use the constructor generated by wire

* docs(cli): update the option description

* fix(cache): use the cache struct

* fix(cache): split Reset into ClearDB and ClearImages
2019-12-26 16:08:08 +02:00
Simarpreet Singh
77f1abc17d Integration tests for docker mode (#335)
* wip: run trivy after adding image

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

* integration: Add an integration test for docker mode

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

* integration: Add error checks for docker_engine_test

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

* circleci: add specific docker version

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

* circleci: add specific docker version

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

* docker_engine_test: Add a sad path

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

* circleci: Add docker_version by param

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

* circleci: Add more docker versions

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

* test(integration): remove old docker versions

* chore(ci): add requires

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2019-12-26 12:48:17 +02:00
Teppei Fukuda
96d58ccd1b fix(client): clear cache (#339) 2019-12-25 13:47:56 +02:00
Teppei Fukuda
823374b578 feat(client/server): add --token-headers option (#326)
* feat(option): add token-header

* feat(client): add token header

* feat(server): add token header

* test(token): fix tests

* test(token): add integration tests

* feat(client): add --custom-headers
2019-12-24 16:49:56 +02:00
Masahiro Fujimura
b127c1c8a7 Support SUSE (#337)
* Add suse support

* Add suse support

* Add OpenSUSETumbleweed

* mv suse to detector

* Add trivy-db

* Fix suse test

* Add integration test

* Change README.md

* change go.mod

* Fix bug

* Fix integration

* Fix golden file

* update go.mod

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
2019-12-23 21:27:25 +02:00
Liz Rice
b1ea09d901 Merge pull request #272 from aquasecurity/lizrice-patch-1
docs: note that some sources are non-commercial
2019-12-17 21:01:30 +00:00
jerbia
8c1c3df232 Merge branch 'master' into lizrice-patch-1 2019-12-17 22:55:51 +02:00
Teppei Fukuda
cee08c38f4 feat(db): show progress when downloading the DB (#317)
* fix(github): return db size

* fix(github_mock): add size

* feat(indicator): add progress bar

* refactor(config): remove global Quiet

* fix(db): take progress bar as an argument

* fix(progress): inject progress bar
2019-12-16 19:23:08 +02:00
Manuel Rüger
bc8f613ba6 fix(writer): Refactor results struct (#327) 2019-12-16 16:15:47 +02:00
Teppei Fukuda
af584a8517 Revert "change mod genuinetools/reg to vanilla (#297)" (#321)
This reverts commit 1e9dcdb7d1.
2019-12-16 10:18:24 +02:00
jabielecki
1805a956a3 refactor for newest fanal (#305)
Changes for compatilibity with PR aquasecurity/fanal#47

Signed-off-by: Jakub Bielecki <jakub.bielecki@codilime.com>
2019-12-15 10:22:48 +02:00
Teppei Fukuda
74717b888e feat: support client/server mode (#295)
* chore(app): change dir

* feat(rpc): add a proto file and auto-generated files

* chore(dep): add dependencies

* fix(app): fix import path

* fix(integration): fix import path

* fix(protoc): use enum for severity

* chore(Makefile): add fmt andd protoc

* chore(clang): add .clang-format

* refactor: split functions for client/server (#296)

* refactor(db): split db.Download

* refactor(standalone): create a different package

* refactor(vulnerability): split FillAndFilter

* fix(protoc): use enum for severity

* chore(Makefile): add fmt andd protoc

* chore(clang): add .clang-format

* fix(db): remove an unused variable

* fix(db): expose the github client as an argument of constructor

* refactor(vulnerability): add the detail message

* feat(rpc): add rpc client (#302)

* fix(protoc): use enum for severity

* chore(Makefile): add fmt andd protoc

* chore(clang): add .clang-format

* feat(rpc): convert types

* feat(rpc): add rpc client

* token: Refactor to handle bad headers being set

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

* feat(rpc): add rpc server (#303)

* feat(rpc): add rpc server

* feat(utils): add CopyFile

* feat(server/config): add config struct

* feat(detector): add detector

* feat(scanner): delegate procedures to detector

* fix(scanner): fix the interface

* test(mock): add mocks

* test(rpc/server): add tests

* test(rpc/ospkg/server): add tests

* tets(os/detector): add tests

* refactor(library): move directories

* chore(dependency): add google/wire

* refactor(library): introduce google/wire

* refactor(ospkg/detector): move directory

* feat(rpc): add eosl

* refactor(ospkg): introduce google/wire

* refactor(wire): bind an interface

* refactor(client): use wire.Struct

* chore(Makefile): fix wire

* test(server): add AssertExpectations

* test(server): add AssertExpectations

* refactor(server): remove debug log

* refactor(error): add more context messages

* test(server): fix error message

* refactor(test): create a constructor of mock

* refactor(config): remove an unused variable

* test(config): add an assertion to test the config struct

* feat(client/server): add sub commands (#304)

* feat(rpc): add rpc server

* feat(utils): add CopyFile

* feat(server/config): add config struct

* feat(detector): add detector

* feat(scanner): delegate procedures to detector

* fix(scanner): fix the interface

* feat(client/server): add sub commands

* merge(server3)

* test(scan): remove an unused mock

* refactor(client): generate the constructor by wire

* fix(cli): change the default port

* fix(server): use auto-generated constructor

* feat(ospkg): return eosl

* test(integration): add integration tests for client/server (#306)

* fix(server): remove unnecessary options

* test(integration): add integration tests for client/server

* fix(server): wrap an error

* fix(server): change the update interval

* fix(server): display the error detail

* test(config): add an assertion to test the config struct

* fix(client): returns an error when failing to initizlie a logger

* test(ospkg/server): add eosl

* Squashed commit of the following:

* test(server): refactor and add tests (#307)

* test(github): create a mock

* test(db): create a mock

* test(server): add tests for DB hot update

* chore(db): add a log message

* refactor(db): introduce google/wire

* refactor(rpc): move directory

* refactor(injector): fix import name

* refactor(import): remove new lines

* fix(server): display the error detail

* fix(server): change the update interval

* fix(server): wrap an error

* test(integration): add integration tests for client/server

* fix(server): remove unnecessary options

* refactor(server): return an error when failing to initialize a logger

* refactor(server): remove unused error

* fix(client/server): fix default port

* chore(README): add client/server

* chore(README): update
2019-12-13 15:00:11 +02:00
Masahiro Fujimura
24fc88ced2 Fix conduct strategy (#308) 2019-12-09 10:49:35 +02:00
jabielecki
1e9dcdb7d1 change mod genuinetools/reg to vanilla (#297)
Instead of using tomoyamachi's fork we can now use the vanilla upstream
package genuinetools/reg. This package gets better maintenance and is
the same as aquasecurity/fanal uses.

Signed-off-by: Jakub Bielecki <jakub.bielecki@codilime.com>
2019-11-28 09:20:57 +02:00
DDd
7233b5f419 Update Gitlab example for Trivy 0.2.0 (#270)
* Update Gitlab example for Trivy 0.2.0

* updating PR with commented

Also using fixed version of Docker since stable can create issues.
2019-11-26 10:23:58 +02:00
Liz Rice
b9eddafe71 Merge branch 'master' into lizrice-patch-1 2019-11-25 11:59:40 +00:00
Teppei Fukuda
3a53a88139 refactor(app): use internal and separate configurations (#291)
* refactor(cmd): move app to internal

* refactor(config): inject logger

* test(config): add tests
2019-11-21 17:49:43 -08:00
Teppei Fukuda
6cbbb22ab4 fix(alpine): handle rc version (#289)
* fix(alpine): handle rc version

* chore(mod): update dependencies
2019-11-21 11:20:24 +02:00
Teppei Fukuda
b6a8af5b20 chore(windows): remove (#278) 2019-11-20 22:00:04 -08:00
Masahiro Fujimura
30c1a00225 Update readme (#287)
* Add oracle support for README

* Fix amazon linux target packages
2019-11-19 20:53:05 +02:00
Masahiro Fujimura
b345342369 Add oracle linux support (#286)
* Add oracle

* Add oracle

* Add golden json

* Add integration test

* Update go.{mod,sum}

* go mod tidy

* Use k8s/utils clock.Clock interface

* Fix Detect vulnerability oracle
2019-11-19 17:18:25 +02:00
Teppei Fukuda
438680f3e4 fix(reset): reset before initializing DB (#275) 2019-11-17 08:55:13 +02:00
Teppei Fukuda
740c2c4069 chore(log): add debug messages (#284) 2019-11-15 16:30:28 -08:00
Teppei Fukuda
35429e3c46 chore(logo): replace with new logo (#269)
* chore(logo): replace with new logo

* chore(readme): change size
2019-11-15 18:25:32 +02:00
Teppei Fukuda
fb265417d0 chore(clear-cache): add an explanation (#276) 2019-11-15 18:08:58 +02:00
Teppei Fukuda
15af65b9c5 feat(github): add GITHUB_TOKEN for rate limiting (#281) 2019-11-15 16:45:07 +02:00
Teppei Fukuda
c2fdfab3ed fix(lockfile): files under vendor dir (#279) 2019-11-15 16:03:15 +02:00
Liz Rice
bdd1266087 docs: note that some sources are non-commercial 2019-11-15 07:47:29 +00:00
Teppei Fukuda
3cb713c5d7 chore(readme): update (#266)
* chore(readme): update

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README.md

Co-Authored-By: Itay Shakury <itay@itaysk.com>

* Update README
2019-11-14 17:26:36 +02:00
Teppei Fukuda
0106939d30 fix(skip-update): prohibit --skip-update in some situations (#262)
* fix(skip-update): prohibit --skip-update in some situations

* test(db): add some cases
2019-11-14 16:19:00 +02:00
Francois-Guillaume Ribreau
e371747bae doc(README): fix missing Gitlab CI link section in ToC (#263)
* doc(README): fix missing Gitlab CI link section in ToC

* Update README.md

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-11-14 16:10:15 +02:00
Teppei Fukuda
514137ecd5 Merge pull request #253 from aquasecurity/remote_db
feat(db): use pre-built database
2019-11-13 17:43:15 +02:00
knqyf263
4f4019b920 fix(scanner/library): initialize vulnsrc 2019-11-13 17:15:28 +02:00
knqyf263
30fe97339b fix(options): display an warning about deprecated options instead of removing them 2019-11-12 22:25:36 +02:00
knqyf263
c91eb92d7f fix(github): remove authentication 2019-11-12 22:23:36 +02:00
knqyf263
fdeaaee53d test(integration): update vulnerability database 2019-11-12 22:02:56 +02:00
knqyf263
0cf1b70947 test(writer): fix the test for JsonWriter 2019-11-12 22:00:06 +02:00
knqyf263
6a9f4fdce0 chore(option): update the description for light mode 2019-11-12 21:55:44 +02:00
knqyf263
852c47f677 chore(module): update a dependency 2019-11-12 21:52:49 +02:00
knqyf263
8be4af33ee fix(redhat): format fixed versions 2019-11-12 21:44:51 +02:00
knqyf263
daf0d59461 test(integration): update amazon linux results
- Some vulnerabilities were updated
2019-11-12 21:43:58 +02:00
knqyf263
348f2bdde3 test(integration): update distroless results
- Some vulnerabilities were update
- Some vulnerabilities were rejected
- The order was changed
2019-11-12 21:42:15 +02:00
knqyf263
12b18ea7f4 test(integration): update ubi results
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 21:37:29 +02:00
knqyf263
381b80125a test(integration): update centos results
- Some vulnerabilities were updated
- The statuses of some vulnerabilities were changed from affected to
unaffected
- Use OVAL
- Omit empty JSON keys
2019-11-12 21:35:08 +02:00
knqyf263
739b1f33e4 test(integration): update ubuntu results
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 20:44:32 +02:00
knqyf263
d312c0d6b3 test(integration): update debian results
- Some new vulnerabilities were found
- Some vulnerabilities were rejected
- Some vulnerabilities were updated
- Omit empty JSON keys
2019-11-12 20:38:49 +02:00
knqyf263
61ec338ea8 test(integration): fix alpine 3.9 result
02764f1bda
2019-11-12 20:32:17 +02:00
knqyf263
b6cfbad35b test(integration): fix alpine results
A vulnerability information was updated.
6bf646bbc7
2019-11-12 20:25:49 +02:00
knqyf263
41589d5110 chore(gitignore): ignore fixtures 2019-11-12 20:25:39 +02:00
knqyf263
4fcd61c6b1 fix(writer): change the function name from Write to WriteResults 2019-11-10 16:58:07 +02:00
knqyf263
c96ecaae4a fix(github): use GetName 2019-11-10 16:48:50 +02:00
knqyf263
d1f35ffb59 fix(github): use GetPublishedAt 2019-11-10 16:47:39 +02:00
knqyf263
b348dc2b55 test(db): change getMetadata from an slice to an object 2019-11-10 16:40:45 +02:00
knqyf263
119e3098db fix(vulnerability): use warn instead of debug 2019-11-10 16:31:52 +02:00
knqyf263
4bf0615579 test(vulnerability): format 2019-11-10 16:16:37 +02:00
knqyf263
93c7b5e248 test(github): use require 2019-11-10 15:50:23 +02:00
knqyf263
51eb0dd362 Merge branch 'remote_db' of ssh://github.com/aquasecurity/trivy into remote_db 2019-11-10 15:46:11 +02:00
Simarpreet Singh
6a283102f9 writer_test: Test exported Write method for template types
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:44:49 -08:00
Simarpreet Singh
8a5887a4d5 writer_test: Add exported Write testing for table full and light
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:39:14 -08:00
Simarpreet Singh
b605bb4c53 writer_test: Test using exported method Write()
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 12:30:24 -08:00
Simarpreet Singh
23b26e0b48 db_test: Add a happy path for first time run
Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-11-06 11:24:12 -08:00
knqyf263
9efc4214b2 test(db): use require instead of assert 2019-11-06 18:19:13 +02:00
knqyf263
84b759d767 test(db): fix an interface 2019-11-06 18:18:49 +02:00
knqyf263
abac635737 test(db): use require instead of panic 2019-11-06 18:14:50 +02:00
knqyf263
f0ea4be2e0 refactor(db): fix an info message 2019-11-06 18:06:41 +02:00
knqyf263
010a6867f3 refactor(db): add a debug message when skipping DB udpate 2019-11-06 18:04:07 +02:00
knqyf263
ee0d6b1841 refactor(db): initialize Metadata to suppress a warning 2019-11-06 18:01:42 +02:00
knqyf263
0604e363f4 refactor(log): show actual and expected DB version 2019-11-06 17:53:05 +02:00
knqyf263
77d7177627 refactor(log): show CLI version with the error 2019-11-06 17:44:24 +02:00
knqyf263
c44af99c6b Merge branch 'master' into remote_db 2019-11-06 17:18:51 +02:00
Teppei Fukuda
4f92d2942a chore(makefile): add Makefile (#256)
* chore(makefile): add Makefile

* chore(ci): use make

* chore(makefile): add clean

* chore(makefile): fix test commands

* chore(ci): split tests into the unit test and the integration test
2019-11-06 16:46:59 +02:00
knqyf263
6013ed9fd7 Merge branch 'master' into remote_db 2019-11-05 09:25:54 +02:00
Thomas Boerger
8ea2e8c632 Add env variables for every flag (#220)
I have added a mapping to a specific environment variable for every
currently available flag, I have followed the convention to simply
replace dashes within the flag name by an underscore.

There is no further configuration or change required as urfave/cli is
handling all of that for us.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2019-11-03 10:38:49 +02:00
S Dhanya Abhirami
d1615bcdb6 typo fixed and GitHub Profile link added (#236)
* added author repo link

* typo fixes
2019-11-03 09:57:47 +02:00
Alenros
76d920eda7 Grammar (#232) 2019-11-02 21:04:56 +02:00
knqyf263
35a7d9bb15 chore(module): update dependencies 2019-11-01 22:19:54 +02:00
knqyf263
8257e0d455 test(vulnerability): fix test 2019-11-01 22:09:40 +02:00
knqyf263
d47958b7c5 test(bundler_scanner): fix test 2019-11-01 22:08:55 +02:00
knqyf263
380de9fd10 test(writer): fix test 2019-11-01 22:08:33 +02:00
knqyf263
ff4405589d test(integration): add tag 2019-11-01 22:07:52 +02:00
Liz Rice
1f072205a9 docs: typo correction (#252)
CLA-assistant wasn't able to correctly assess my contribution when I made a trivial correction to #250 so it's quicker just to create another PR
2019-11-01 20:32:44 +02:00
Liz Rice
c970018fc7 Merge pull request #190 from NinjaCoderDev/master
Fixed some typos in readme.md
2019-11-01 12:11:47 +00:00
Soumyadeep Sinha
5a3ebc1ba9 Merge branch 'master' into master 2019-11-01 11:52:26 +05:30
knqyf263
a97bbb0f8d feat(option): remove some options 2019-10-31 23:54:14 +02:00
knqyf263
46c7ff7a83 test(db): add tests 2019-10-31 23:53:46 +02:00
Greg Jacobs
f326beb1f2 Fixed broken link and some typos in Readme.md (#228)
* Fixing broken link and grammar in Readme.md

* Avoiding conflicts
2019-10-31 21:53:24 +02:00
knqyf263
55d5c29f38 feat(db): download a db file from GitHub Release 2019-10-31 12:26:02 +02:00
knqyf263
47273ef6da feat(library_scanner): use trivy-db 2019-10-31 12:26:02 +02:00
knqyf263
e5fc57af0e refactor(ospkg_scanner): use trivy-db 2019-10-31 12:26:02 +02:00
knqyf263
2921c25c62 refactor(vulnsrc): transfer code to trivy-db 2019-10-31 12:26:02 +02:00
inductor
e04e90fcbc add new line at eof (#249) 2019-10-31 10:42:10 +02:00
Miguel Bernabeu Diaz
d27eeb2b84 Add option to only download vulnerability database (#172)
* Add flag to download vulnerability database

When the `--download-db-only` flag is supplied, we will just download
the vulnerability database and exit without performing any scans.

If a database had been downloaded before the present run, and
`--only-update` option has been specified, we will only update the
database for the selected distribution and exit.

* Add documentation for `--download-db-only` flag

Add section to README on usage limitations of the new flag.
2019-10-30 17:46:50 +02:00
Manuel Rüger
62ea073bad Enable shell autocompletion (#234)
This allows to enable autocompletion via

https://github.com/urfave/cli/blob/master/docs/v1/manual.md#bash-completion
2019-10-29 10:56:00 +02:00
Bryant Hagadorn
187864a4e4 Added GitLab YML (#223) 2019-10-28 11:03:42 +02:00
James Ward
a666c4a787 massage rubygems version to handle platforms (#230)
the rubygems version includes "platform" within the version
and it gets pulled into version.Version as a pre-release
value.

this means that in the case of something like "ffi",
1.9.25-java is not counted correctly as matching
">= 1.9.25".
2019-10-28 10:53:33 +02:00
James Ward
bda4ee0ad5 add echo to CI gofmt step (#231)
the CI step that runs gofmt doesn't echo out a string
so it causes the step to fail before emitting the "gofmt"
errors that need to be fixed
2019-10-28 10:44:26 +02:00
Soumyadeep Sinha
4925873a67 Merge branch 'master' into master 2019-10-24 17:50:48 +05:30
Vipul Chodankar
63ed4eb77f Fixed Broken README links (#214)
* Fixed Broken README links

* Reverted link change in migration sectioN
2019-10-24 14:07:00 +03:00
Teppei Fukuda
d03a64ced0 Update README (#224)
* Update README

* Add Distroless
2019-10-23 18:23:06 +03:00
Soumyadeep Sinha
615a56353d Merge branch 'master' into master 2019-10-23 20:19:15 +05:30
Soumyadeep Sinha
45db6df1eb Update README.md
Co-Authored-By: Liz Rice <liz@lizrice.com>
2019-10-23 20:17:32 +05:30
Soumyadeep Sinha
ac628f39ec Update README.md
Co-Authored-By: Liz Rice <liz@lizrice.com>
2019-10-23 20:17:23 +05:30
Teppei Fukuda
20babc46a1 Bump Go 1.13 (#218) 2019-10-23 17:00:03 +03:00
Itay Shakury
a6141ed2f0 CI/CD refactor (#209)
* ci refactor, goreleaser upgrade and push to docker

* formatting

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>

* add latest docker tag
2019-10-23 16:12:07 +03:00
Teppei Fukuda
a12bb8d0e2 fix(db): introduce db schema version (#221) 2019-10-23 16:00:04 +03:00
Manuel Rüger
5ae10e0463 Dockerfile: Update runner base to alpine 3.10 (#199)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2019-10-22 11:35:05 +03:00
Teppei Fukuda
ff873a274b Support Amazon Linux (#182)
* Support Amazon Linux

* amazon: Add tests for Scanner Detect functionality

* amazon: Add more test cases for unhappy paths.

This commit also asserts the logged output via observer.

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

* amazon: Add a test case for invalid fixed pkg version

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

* mod: go mod tidy

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

* amazon: Inject dependency seams for exposed db interface and logger.

This commit also exposes an interface for doing db operations.

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

* amazon: Use injected logger for scanner.

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

* amazon_test: Add a sample testdata dir

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

* amazon: Add tests for for Get() for amazon vulns.

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

* vulnsrc_test: Fix invocation call to SetVersion()

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

* amazon_test: Add a test for severirtyFromPriority

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

* amazon_test: Add tests for constructVersion()

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

* amazon: Refactor walkFunc outside for testability purposes

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

* amazon: Refactor walkFn and add tests for it.

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

* amazon: Refactor commitFunc closure and add tests

This commit also introduces an interface for the
vulnerability package to be used as a seam.

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

* Revert "amazon: Use injected logger for scanner."

This reverts commit 5a81e4d824a95f4de4aae2e2b903eedd0f7e241f.

* test(amazon): fix failed tests

* fix(vulnerability): trim references

* test(amazon): add integration test
2019-10-22 09:31:15 +03:00
Sidhya Tikku
7ad94c34e7 Update .gitignore (#215) 2019-10-20 12:11:02 +03:00
Teppei Fukuda
f8509846cf test(integration): add integration tests (#201)
* divide into NewApp function

* sort scan results for idempotency

* chore(integration): add integration tests

* tar_input_test: strengthen assertions

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

* writer_test: Add a happy path for TestReportWriter

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

* writer_test: switch to table test cases

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

* writer_test: Add more scenarios for TestReportWriter_Table

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

* writer: Change back to []Results and add happy path for JSON writer

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

* writer_test: Switch to a table driven format

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

* writer_test: cleanup

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

* scan: Go back to report.Result by value

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

* Revert "scan: Go back to report.Result by value"

This reverts commit 03b6f7abd7d0d22d87c825d0ef3759cca200b9fc.

* switch back to by value for results

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

* writer_test: document a behavior with template inputs

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

* vulnerability: Add a failing test to show unexpected sorting behavior.

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

* report: Simplify []*Result to []Result.

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

* test(template): add happy path

* test(vulnerability): fix expected values

* tar_input_test: Move gunzipDB

Signed-off-by: Simarpreet Singh <simar@linux.com>
2019-10-18 13:58:27 -07:00
Snow-HardWolf
9334e607a0 Changed to be able to specify IgnoreFile as whitelist (#175)
* Add : add option flag to specify ignorefile

* Add : reading flag and pass variable to function

* Add : reading specific ignorefile as trivyIgnore

* Remove extra ignoreFile check from vulnerability.go

Remove check if ignoreFile is empty

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>

* Fix : remove completely ignoreFile check

* Refactor : run gofmt to main.go
2019-10-17 10:40:57 +03:00
Sebastian Ehmann
f198b6eb63 Check errors passed through by filepath.Walk (#208)
In several files, the error passed from filepath.Walk to WalkFunc is
not checked. As the info argument to WalkFn is nil in case of an error,
accessing info can cause a runtime panic.
This commit adds checks for errors passed through to WalkFunc.
2019-10-17 10:34:19 +03:00
Aayush Srivastava
cb1870e7bf Update README.md (#206)
Added and elaborated the correct license details(with the link to the license page) and improved the readability of the README file.
2019-10-17 10:25:21 +03:00
Sebastian Ehmann
384205a8c5 Remove extra double quote (#204) 2019-10-17 10:17:32 +03:00
kapil Israni
d9e64d2cfe Updated README.md (#203)
Added the definition of the term 'Vulnerability' for beginners along with a minor grammatical correction.
2019-10-17 10:11:44 +03:00
Sumit Kharche
5ccb0af867 Added Docker image badge & missing punctuation's (#189)
* Added Docker image badge & missing punctuation's

* Removed extra line
2019-10-15 09:30:41 +03:00
Masahiro Fujimura
da621c3524 Add timeout option (#143)
* Add timeout

* Fix cli.IntFlag -> cli.DurationFlag
2019-10-15 08:58:03 +03:00
Nikita Titov
3a28576e02 added reference for LICENSE (#195) 2019-10-15 08:49:30 +03:00
Sebastian Ehmann
dbb7a555ce Check returned error before deferring file close (#197) 2019-10-15 08:41:57 +03:00
NinjaCoderDev
7a6991c8d9 Fixed typo 2019-10-12 23:37:15 +05:30
NinjaCoderDev
6efac16c80 Fixed some typos 2019-10-12 23:33:05 +05:30
Itay Shakury
a7360a4b34 add contribution guideline
Merge pull request #185 from itaysk/master
2019-10-12 17:43:20 +03:00
Teppei Fukuda
4fb9f0cb74 Merge branch 'master' into master 2019-10-12 11:56:51 +03:00
James George
89f2d48f0f docs: minor tweak (#183) 2019-10-11 22:02:12 +03:00
Itay Shakury
11dcbff707 typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:31 +03:00
Itay Shakury
7a6074721f typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:14 +03:00
Itay Shakury
959e43d8f9 typo
Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 21:00:02 +03:00
Mohamed El Sayed
f933ab4602 Improve ubuntu install (#178)
* Improve ubuntu install

* Add `lsb-release` to install command

Co-Authored-By: Teppei Fukuda <knqyf263@gmail.com>
2019-10-11 00:20:40 +03:00
Parikshit Hooda
af78d2fd69 Update README.md - typo fix (#186)
Typo fix.
Change 'occured' to 'occurred'.
2019-10-11 00:08:41 +03:00
Itay Shakury
6f9c4aa2e0 remove contributing section from readme 2019-10-10 13:45:17 +03:00
Itay Shakury
5efa4a4751 add CONTRIBUTING.md 2019-10-10 13:44:42 +03:00
Liz Rice
cde336ec99 Merge pull request #177 from aquasecurity/rpm-dependency
docs: add more detail on rpm dependency to README
2019-10-03 13:43:44 +02:00
Liz Rice
b8c51c56c2 docs: add more detail on rpm dependency to README 2019-10-03 12:30:56 +01:00
Liz Rice
22c28adc78 Merge pull request #174 from aquasecurity/remove_transfer
Remove the text about transfer and migration
2019-10-02 09:53:00 +02:00
knqyf263
7b04f31566 Remove the text about transfer and migration 2019-10-02 09:20:41 +03:00
Teppei Fukuda
0fff415c2a Support Kaniko (#171) 2019-10-02 08:49:30 +03:00
Teppei Fukuda
987538fc49 Display an error message when rpm not found (#167) 2019-09-26 14:31:15 +03:00
Teppei Fukuda
2642020398 Support distroless and ignore lock files under vendor dir (#166) 2019-09-25 16:40:24 +03:00
Teppei Fukuda
c4a2b762e7 Add rpm to the trivy image (#165) 2019-09-25 14:19:43 +03:00
Stephen Paulger
339d0db240 Add template writer (#141) 2019-09-25 09:37:16 +03:00
Teppei Fukuda
43568ccd69 Update xerrors version (#158) 2019-09-24 21:26:22 +03:00
homoluctus
fbd73f2f17 Modify cache-dir usage comment (#148) 2019-09-20 10:29:07 +03:00
inductor
4a21ad9540 env (#154) 2019-09-19 13:12:50 +03:00
ress
18de7e45e9 README.md is out of date (#145) 2019-09-05 00:02:48 +09:00
Liz Rice
48f66aa3fe Merge pull request #142 from carehart/patch-1
Tweaked some wording for clarity
2019-09-02 16:52:47 +01:00
Charlie Arehart
18274462ff Tweaked some wording for clarity 2019-08-31 15:41:08 -05:00
Teppei Fukuda
90e4c159b1 Add the RHEL8 support to rpm repository (#138)
* Add the RHEL8 support

* Use variable
2019-08-30 21:09:28 +09:00
inductor
4f57216935 use COPY on dockerfile rather than add (#132) 2019-08-24 19:03:00 -10:00
Laurent Commarieu
e6b68305ec fix typo in readme (#130) 2019-08-24 18:16:22 -10:00
inductor
4ce651c0e4 fix gofmt (#131)
* fix gofmt

* add gofmt check script
2019-08-24 18:10:13 -10:00
Liz Rice
db2d4e45eb Merge pull request #128 from aquasecurity/fix/readme
Fix README
2019-08-23 15:22:55 +01:00
Masahiro Fujimura
ab8b73e8f8 Fix libraly cache directotry (#129) 2019-08-22 21:47:39 -10:00
knqyf263
876b8bd795 Update 2019-08-22 16:46:39 -10:00
knqyf263
64ef6b63b7 Fix README 2019-08-22 16:19:03 -10:00
Masato Yamazaki
a77984a381 Suppress log output when --quiet flag is on (#125)
* Add --no-progress flag

* Disable log output when --quiet flag is enabled
2019-08-21 17:19:14 -10:00
skanehira
31a1f5968b Fix cannot found docker image (#123) 2019-08-21 16:26:04 -10:00
Liz Rice
4ca73f0406 Merge pull request #120 from aquasecurity/readme_migration
Add the migration section on README
2019-08-19 12:33:27 +01:00
Liz Rice
0909f94c20 Clarify migration instructions 2019-08-19 12:29:56 +01:00
Liz Rice
d1c01c1ecc Small wording change 2019-08-19 12:12:52 +01:00
Liz Rice
f8cdd608e2 Slight wording change 2019-08-19 12:12:13 +01:00
knqyf263
2e4b83b710 Add migration section on README 2019-08-19 00:04:47 -10:00
Liz Rice
6fbcbb3286 Merge pull request #119 from aquasecurity/transfer
Transfer repositoriy
2019-08-19 09:30:49 +01:00
knqyf263
a843682f7c Transfer repositoriy 2019-08-18 22:22:54 -10:00
Teppei Fukuda
0611bf915b Display a warning for OS that has reached EOL (#118) 2019-08-18 21:34:46 -10:00
Teppei Fukuda
9a9cb016fa Add tests to utils (#116) 2019-08-16 15:31:41 -10:00
Teppei Fukuda
74a66fb68a Add data source (#117) 2019-08-14 17:24:06 -10:00
knqyf263
aedfd3bfb8 Fix README 2019-08-13 14:19:26 -10:00
Teppei Fukuda
a2e13bdeed Remove old results (#115) 2019-08-13 14:16:40 -10:00
Teppei Fukuda
a7d991f3cc Reimplement --cache-dir option (#114) 2019-08-12 22:04:45 -10:00
Teppei Fukuda
11bc00d629 Revert "Allow user specified cache directory (#12)" (#111)
This reverts commit 2d512c5e47.
2019-08-12 20:33:26 -10:00
Luis Perez
5005d7966d Adding instructions for Install in Arch Linux (#107) 2019-08-09 19:13:03 -10:00
Tomoya Amachi
c2a05c71c7 use multiple ISSUE_TEMPLATE (#98) 2019-07-26 09:04:33 +09:00
imlonghao
51bbc1dc95 [docker] Compress binary using upx (#97) 2019-07-25 16:15:43 +09:00
Kazuki Higashiguchi
7b5e3407d1 fix CircleCI link in README (#91)
* fix inner link of README

* fix name CircleCI in README
2019-07-11 11:56:10 +09:00
Artur Kerge
52ab4e9376 Add code snippet reminder on how to print distribution codename (#89) 2019-07-09 13:33:36 +09:00
Teppei Fukuda
9bfbff953b Embed trivy version in Docker (#88) 2019-07-07 16:20:47 +09:00
Teppei Fukuda
6af2d32e10 Support unusual YAML (#87) 2019-07-07 15:58:00 +09:00
Tomoya Amachi
75b944ff50 update go.mod (#86) 2019-07-07 14:24:01 +09:00
Nao YONASHIRO
bbb67198bb feat: improve nvd update (#81)
* test: add update nvd benchmark

* feat: used json.Unmarshal to reduce memory usage
2019-07-01 17:52:30 +09:00
knqyf263
6be2ebde9d Update manual installation 2019-06-27 14:20:43 +09:00
Kota Kanbe
a4f1f25cc4 remove nonsense struct tags (#76) 2019-06-20 13:31:31 +09:00
Teppei Fukuda
c29f6f51da Fix --skip-update (#70) 2019-06-08 00:07:58 +09:00
knqyf263
edb899b9ce Update README 2019-06-07 23:51:56 +09:00
knqyf263
a8f7ecefae Update dependencies 2019-06-07 23:46:55 +09:00
Maxime Sibellas
ec1afc2665 feat: add vulnerability type filter to get only os or packages vulnerabilities (#50)
feat: add vulnerability type filter to get only os or packages vulnerabilities
2019-06-07 23:34:24 +09:00
Masahiro
f12284ab2e Fix debug log (#65) 2019-05-31 17:34:25 +09:00
Tomoya Amachi
a9ff0b5243 add -debug to ISSUE_TEMPLATE (#57) 2019-05-25 09:17:37 +09:00
Kei Kamikawa
0a271a04cc Added alpine into dbnames (#55)
* Fixed alpine

* Fixed to use vulnsrc
2019-05-24 16:19:29 +09:00
Tomoya Amachi
6fa78df282 auth for private docker registry from ENV vars (#52)
* auth for private docker registry from env vars

* fix typo

* delete GCP and AWS ENV vars

* update TOC

* fix typo
2019-05-24 13:26:41 +09:00
Kei Kamikawa
b62536fcdc Added --only-update option (#43)
* Added --only-update flag

* Added feature for --only-update flag

* Added README of --only-update

* Fixed README

* Use only Update function

* Added warning message
2019-05-24 12:52:32 +09:00
Mark Phelps
9741d4ae94 Simpler Homebrew install instructions (#51)
You don't need to tap a repo to install from it with Homebrew it seems. Homebrew will automatically tap it with `brew install`:

```
❯ brew install knqyf263/trivy/trivy
Updating Homebrew...
....
Cloning into '/usr/local/Homebrew/Library/Taps/knqyf263/homebrew-trivy'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Tapped 1 formula (27 files, 23.5KB).
==> Installing trivy from knqyf263/trivy
```
2019-05-22 23:12:28 +09:00
Nao YONASHIRO
68f326d9e1 feat: add --depth option to git clone (#46) 2019-05-22 10:07:42 +09:00
Masahiro
76ee7291d6 Support Poetry (#49)
* Support Poetry

* Fix conflict

* Tidy go.sum
2019-05-22 08:40:10 +09:00
Tomoya Amachi
d31f09035e add ISSUE_TEMPLATE.md (#48) 2019-05-22 01:20:35 +09:00
Tomoya Amachi
8d7c2e6d2a Fix yarn parser (#47)
* update go-dep-parser for yarn bugfix

* fixbug: yarn.lock parse error

* enhanced error messages : detect amazon linux and opensuse
2019-05-22 00:50:53 +09:00
Tomoya Amachi
9269a305fb update readme (#42) 2019-05-21 19:16:09 +09:00
Teppei Fukuda
073b315737 No error on unsupported OS (#40) 2019-05-21 09:24:45 +09:00
Nicolas CARPi
47c46fbe17 Fix some typos in the README or improve phrasing (#38)
also add .circleci to .dockerignore
2019-05-21 08:59:16 +09:00
mitsuyoshi
39572968bb fixed cache bug (#36) 2019-05-21 01:03:33 +09:00
Nao YONASHIRO
4383764cae fix: unknown format case (#35) 2019-05-21 00:17:44 +09:00
Kirill Motkov
e0ef0563ce Some code improvements. (#34)
* Rewrite some if-else chains as a switch statements. Based on Go style
guide: https://golang.org/doc/effective_go.html#switch
* Simplify some functions.
* Some comments formatting.
2019-05-21 00:17:18 +09:00
Teppei Fukuda
d9cf2c487d Update JSON schema (#33)
* Update JSON schema

* Add JSON example to README
2019-05-20 22:43:28 +09:00
Tomoya Amachi
58bf4b21e7 Merge pull request #32 from tomoyamachi/fix_quiet_bug
fix --quiet bug
2019-05-20 07:22:08 +09:00
Tomoya AMACHI
e95c619eaa fix quiet bug 2019-05-20 06:51:31 +09:00
knqyf263
cd04c0bdb2 Update README 2019-05-20 03:55:40 +09:00
Masahiro
fd74926e76 Change README. Use latest trivy version CI example. (#31) 2019-05-20 03:27:47 +09:00
Masahiro
f82ff5a4fd Change log format (#30) 2019-05-20 02:54:41 +09:00
Masahiro
fa72bef8d4 Add auto-refresh option (#29)
* Add auto-refresh option

* Fix review
2019-05-20 02:00:35 +09:00
Masahiro
2f7f1f8e83 Change Dockerfile (#28)
* Change Dockerfile CMD -> ENTRYPOINT

* Change README
2019-05-19 09:54:18 +09:00
Teppei Fukuda
90d083489b Enable --clear-cache and --refresh without specifying an image name (#27) 2019-05-19 08:52:56 +09:00
Teppei Fukuda
295cd29aeb Suppress the warning message when specifying --clear-cache option (#25) 2019-05-19 00:17:44 +09:00
Tomoya Amachi
1c844aad64 show scanned os type if unsupported (#24) 2019-05-18 22:47:55 +09:00
Sandro Jäckel
e0cd18e264 [ImgBot] Optimize images (#22)
*Total -- 1,372.59kb -> 661.35kb (51.82%)

/imgs/usage2.png -- 490.56kb -> 214.83kb (56.21%)
/imgs/usage1.png -- 652.71kb -> 314.83kb (51.77%)
/imgs/centos_include_unfixable.png -- 74.40kb -> 40.77kb (45.2%)
/imgs/alpine.png -- 67.03kb -> 37.37kb (44.26%)
/imgs/centos_only_fixable.png -- 73.59kb -> 43.73kb (40.58%)
/imgs/logo.png -- 14.29kb -> 9.83kb (31.24%)
2019-05-18 22:38:55 +09:00
Sandro Jäckel
9f9faf2215 Suggest putting the apt source in its own file (#21) 2019-05-18 22:36:53 +09:00
knqyf263
3907a60b33 Update README 2019-05-17 19:03:28 +09:00
Naoki Harima
e85e961af6 Update fanal version (#15)
* Update fanal version

* Update fanal version

* do go mod tidy
2019-05-17 19:00:22 +09:00
0xflotus
61cbae2697 fixed provided (#14) 2019-05-17 17:57:27 +09:00
Ken Herner
2d512c5e47 Allow user specified cache directory (#12)
* Added cache-dir flag

The flag cache-dir allows users to specify the cache directory the
database is stored in.

Signed-off-by: Ken Herner <kherner@navistone.com>

* Moved dbDir definition into functions

Need to move dbDir definition into the calling functions as the cache
directory may have been specified.  With dbDir defined at package level,
it would always be instantiated to the default value and would never be
updated to the user specifyed value.

Signed-off-by: Ken Herner <kherner@navistone.com>
2019-05-17 07:13:43 +09:00
knqyf263
936297a6b2 Fix License badge 2019-05-17 07:12:15 +09:00
knqyf263
ad0f9e8cba Update README 2019-05-16 23:25:46 +09:00
Tomoya Amachi
4d20d3f543 check yarn.lock in node scanner (#7)
* check yarn.lock in node scanner

* update README and go tidy
2019-05-16 11:14:10 +09:00
knqyf263
c3e5227992 Update README 2019-05-16 02:38:57 +09:00
knqyf263
ff39445db2 Eliminate color when writing results to a file 2019-05-16 02:10:40 +09:00
knqyf263
77e9b0a6d1 Fix warning message 2019-05-16 01:35:24 +09:00
Teppei Fukuda
cfd85db900 Update LICENSE 2019-05-15 17:36:13 +09:00
knqyf263
948519d460 Update README 2019-05-15 13:20:12 +09:00
knqyf263
9a67f0d1a7 Add reset and clear-cache option 2019-05-14 18:48:55 +09:00
knqyf263
17b5a60247 Use src package 2019-05-14 16:44:23 +09:00
knqyf263
f42895465d Update README 2019-05-14 16:44:21 +09:00
knqyf263
9006dd5d16 Update dependencies 2019-05-13 15:16:47 +09:00
knqyf263
27d776cdf2 Support .trivyignore 2019-05-13 13:56:01 +09:00
knqyf263
1827d3d5c9 Refactor 2019-05-13 10:04:01 +09:00
knqyf263
2b5782c920 Use NVD CVSS score 2019-05-13 04:11:51 +09:00
knqyf263
6284def316 Aanalyze commands 2019-05-13 04:11:34 +09:00
Masahiro
0c11078302 Add Cargo scanner (#5) 2019-05-12 23:08:02 +09:00
knqyf263
507fac9284 Move remic 2019-05-11 14:45:52 +09:00
Masahiro
22abb9dab1 Add options for remic (#4)
* Fix filename

* Add options
2019-05-11 14:36:20 +09:00
knqyf263
6463176bc0 Update README 2019-05-08 19:14:48 +09:00
knqyf263
b208bc4c12 Add --refresh option 2019-05-08 19:10:08 +09:00
539 changed files with 57130 additions and 4264 deletions

View File

@@ -1,50 +0,0 @@
defaults: &defaults
docker :
- image: knqyf263/ci-trivy:latest
environment:
CGO_ENABLED: "0"
jobs:
test:
<<: *defaults
steps:
- checkout
- run:
name: Test
command: go test ./...
release:
<<: *defaults
steps:
- checkout
- run:
name: Release
command: goreleaser --rm-dist
- run:
name: Clone trivy repository
command: git clone git@github.com:knqyf263/trivy-repo.git
- run:
name: Setup git settings
command: |
git config --global user.email "knqyf263@gmail.com"
git config --global user.name "Teppei Fukuda"
- run:
name: Create rpm repository
command: ci/deploy-rpm.sh
- run:
name: Import GPG key
command: echo -e "$GPG_KEY" | gpg --import
- run:
name: Create deb repository
command: ci/deploy-deb.sh
workflows:
version: 2
release:
jobs:
- test
- release:
filters:
branches:
ignore: /.*/
tags:
only: /.*/

5
.clang-format Normal file
View File

@@ -0,0 +1,5 @@
---
Language: Proto
BasedOnStyle: Google
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true

View File

@@ -1 +1,6 @@
.git
.github
.cache
.circleci
integration
imgs

31
.github/ISSUE_TEMPLATE/BUG_REPORT.md vendored Normal file
View File

@@ -0,0 +1,31 @@
---
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

@@ -0,0 +1,9 @@
---
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

@@ -0,0 +1,10 @@
---
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.
-->

15
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: docker
directory: /
schedule:
interval: monthly
- package-ecosystem: gomod
open-pull-requests-limit: 10
directory: /
schedule:
interval: monthly

18
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,18 @@
## Description
## Related issues
- Close #XXX
## Related PRs
- [ ] #XXX
- [ ] #YYY
Remove this section if you don't have related PRs.
## Checklist
- [ ] I've read the [guidelines for contributing](https://github.com/aquasecurity/trivy/blob/main/CONTRIBUTING.md) to this repository.
- [ ] I've followed the [conventions](https://github.com/aquasecurity/trivy/blob/main/CONTRIBUTING.md#title) in the PR title.
- [ ] I've added tests that prove my fix is effective or that my feature works.
- [ ] I've updated the [documentation](https://github.com/aquasecurity/trivy/blob/main/docs) with the relevant information (if needed).
- [ ] I've added usage information (if the PR introduces new options)
- [ ] I've included a "before" and "after" example to the description (if the PR is a user interface change).

34
.github/workflows/mkdocs-dev.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Deploy the dev documentation
on:
push:
paths:
- 'docs/**'
- mkdocs.yml
branches:
- main
jobs:
deploy:
name: Deploy the dev documentation
runs-on: ubuntu-18.04
steps:
- name: Checkout main
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
pip install mike
pip install mkdocs-macros-plugin
env:
GH_TOKEN: ${{ secrets.MKDOCS_AQUA_BOT }}
- name: Configure the git user
run: |
git config user.name "knqyf263"
git config user.email "knqyf263@gmail.com"
- name: Deploy the dev documents
run: mike deploy --push dev

42
.github/workflows/mkdocs-latest.yaml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Deploy the latest documentation
on:
workflow_dispatch:
inputs:
version:
description: Version to be deployed
required: true
push:
tags:
- "v*"
jobs:
deploy:
name: Deploy the latest documentation
runs-on: ubuntu-18.04
steps:
- name: Checkout main
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
pip install mike
pip install mkdocs-macros-plugin
env:
GH_TOKEN: ${{ secrets.MKDOCS_AQUA_BOT }}
- name: Configure the git user
run: |
git config user.name "knqyf263"
git config user.email "knqyf263@gmail.com"
- name: Deploy the latest documents from new tag push
if: ${{ github.event.inputs.version == '' }}
run: |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
mike deploy --push --update-aliases $VERSION latest
- name: Deploy the latest documents from manual trigger
if: ${{ github.event.inputs.version != '' }}
run: mike deploy --push --update-aliases ${{ github.event.inputs.version }} latest

88
.github/workflows/publish-chart.yaml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Publish Helm chart
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'helm/trivy/**'
push:
branches: [main]
paths:
- 'helm/trivy/**'
env:
HELM_REP: helm-charts
GH_OWNER: aquasecurity
CHART_DIR: helm/trivy
KIND_VERSION: "v0.11.1"
KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"
jobs:
test-chart:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #v2.4.0
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab #v1.1
with:
version: v3.5.0
- name: Set up python
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@6b64532d456fa490a3da177fbd181ac4c8192b58 #v2.1.0
- name: Setup Kubernetes cluster (KIND)
uses: helm/kind-action@94729529f85113b88f4f819c17ce61382e6d8478 #v1.2.0
with:
version: ${{ env.KIND_VERSION }}
image: ${{ env.KIND_IMAGE }}
- name: Run chart-testing
run: ct lint-and-install --validate-maintainers=false --charts helm/trivy
- name: Run chart-testing (Ingress enabled)
run: |
sed -i -e '117s,false,'true',g' ./helm/trivy/values.yaml
ct lint-and-install --validate-maintainers=false --charts helm/trivy
publish-chart:
if: github.event_name == 'push'
needs:
- test-chart
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #v2.4.0
with:
fetch-depth: 0
- name: Install chart-releaser
run: |
wget https://github.com/helm/chart-releaser/releases/download/v1.3.0/chart-releaser_1.3.0_linux_amd64.tar.gz
echo "baed2315a9bb799efb71d512c5198a2a3b8dcd139d7f22f878777cffcd649a37 chart-releaser_1.3.0_linux_amd64.tar.gz" | sha256sum -c -
tar xzvf chart-releaser_1.3.0_linux_amd64.tar.gz cr
- name: Package helm chart
run: |
./cr package ${{ env.CHART_DIR }}
- name: Upload helm chart
# Failed with upload the same version: https://github.com/helm/chart-releaser/issues/101
continue-on-error: true
run: |
./cr upload -o ${{ env.GH_OWNER }} -r ${{ env.HELM_REP }} --token ${{ secrets.ORG_REPO_TOKEN }} -p .cr-release-packages
- name: Index helm chart
run: |
./cr index -o ${{ env.GH_OWNER }} -r ${{ env.HELM_REP }} -c https://${{ env.GH_OWNER }}.github.io/${{ env.HELM_REP }}/ -i index.yaml
- name: Push index file
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 #v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.ORG_REPO_TOKEN }}
with:
source_file: 'index.yaml'
destination_repo: '${{ env.GH_OWNER }}/${{ env.HELM_REP }}'
destination_folder: '.'
destination_branch: 'gh-pages'
user_email: aqua-bot@users.noreply.github.com
user_name: 'aqua-bot'

92
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Release
on:
push:
tags:
- "v*"
env:
GO_VERSION: "1.17"
GH_USER: "aqua-bot"
jobs:
release:
name: Release
runs-on: ubuntu-18.04 # 20.04 doesn't provide createrepo for now
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
permissions:
id-token: write # For cosign
packages: write # For GHCR
contents: read # Not required for public repositories, but for clarity
steps:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install rpm reprepro createrepo distro-info
- uses: sigstore/cosign-installer@51f8e5c6fce54e46006ae97d73b2b6315f518752 # pin@v2.0.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Show available Docker Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Login to docker.io registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ghcr.io registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
- name: Generate SBOM
uses: CycloneDX/gh-gomod-generate-sbom@v1
with:
args: mod -licenses -json -output bom.json
version: ^v1
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: v1.4.1
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
- name: Checkout trivy-repo
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/trivy-repo
path: trivy-repo
fetch-depth: 0
token: ${{ secrets.ORG_REPO_TOKEN }}
- name: Setup git settings
run: |
git config --global user.email "knqyf263@gmail.com"
git config --global user.name "Teppei Fukuda"
- name: Create rpm repository
run: ci/deploy-rpm.sh
- name: Import GPG key
run: echo -e "${{ secrets.GPG_KEY }}" | gpg --import
- name: Create deb repository
run: ci/deploy-deb.sh

23
.github/workflows/scan.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Scan vulnerabilities
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
name: Scan Go vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner and create GitHub issues
uses: knqyf263/trivy-issue-action@v0.0.3
with:
assignee: knqyf263
severity: CRITICAL
skip-dirs: integration,examples
label: vulnerability
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

20
.github/workflows/stale-issues.yaml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: "Stale issues"
on:
schedule:
- cron: '0 0 * * *'
jobs:
stale:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been labeled with inactivity.'
stale-pr-message: 'This PR is stale because it has been labeled with inactivity.'
exempt-issue-labels: 'lifecycle/frozen,lifecycle/active,priority/critical-urgent,priority/important-soon,priority/important-longterm,priority/backlog,priority/awaiting-more-evidence'
exempt-pr-labels: 'lifecycle/active'
stale-pr-label: 'lifecycle/stale'
stale-issue-label: 'lifecycle/stale'
days-before-stale: 60
days-before-close: 20

103
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,103 @@
name: Test
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
pull_request:
env:
GO_VERSION: "1.17"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint
uses: golangci/golangci-lint-action@v3.1.0
with:
version: v1.41
args: --deadline=30m
- name: Run unit tests
run: make test
integration:
name: Integration Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run integration tests
run: make test-integration
build-test:
name: Build Test
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Show available Docker Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: v1.4.1
args: release --snapshot --rm-dist --skip-publish
build-documents:
name: Documentation Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install mkdocs-material
pip install mike
pip install mkdocs-macros-plugin
- name: Configure the git user
run: |
git config user.name "knqyf263"
git config user.email "knqyf263@gmail.com"
- name: Deploy the dev documents
run: mike deploy test

18
.gitignore vendored
View File

@@ -4,6 +4,10 @@
*.dll
*.so
*.dylib
/trivy
## chart release
.cr-release-packages
# Test binary, build with `go test -c`
*.test
@@ -12,3 +16,17 @@
*.out
.idea
# Directory Cache Files
.DS_Store
thumbs.db
# test fixtures
coverage.txt
integration/testdata/fixtures/images
# SBOMs generated during CI
/bom.json
# goreleaser output
dist

72
.golangci.yaml Normal file
View File

@@ -0,0 +1,72 @@
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
govet:
check-shadowing: false
gofmt:
simplify: false
revive:
ignore-generated-header: true
gocyclo:
min-complexity: 20
dupl:
threshold: 100
goconst:
min-len: 3
min-occurrences: 3
misspell:
locale: US
goimports:
local-prefixes: github.com/aquasecurity
gosec:
excludes:
- G204
- G402
linters:
disable-all: true
enable:
- structcheck
- ineffassign
- typecheck
- govet
- errcheck
- varcheck
- deadcode
- revive
- gosec
- unconvert
- goconst
- gocyclo
- gofmt
- goimports
- misspell
run:
skip-files:
- ".*._mock.go$"
- ".*._test.go$"
- "integration/*"
issues:
exclude-rules:
- linters:
- gosec
text: "G304: Potential file inclusion"
- linters:
- gosec
text: "Deferring unsafe method"
- linters:
- errcheck
text: "Close` is not checked"
- linters:
- errcheck
text: "os.*` is not checked"
- linters:
- golint
text: "a blank import should be only in a main or test package"
exclude:
- "should have a package comment, unless it's in another file for this package"
exclude-use-default: false
max-same-issues: 0

104
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,104 @@
Thank you for taking interest in contributing to Trivy!
## Issues
- 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.
## Pull Requests
1. Every Pull Request should have an associated bug or feature issue unless you are fixing a trivial documentation issue.
4. Please add the associated Issue link in the PR description.
2. Your PR is more likely to be accepted if it focuses on just one change.
5. There's no need to add or tag reviewers.
6. If a reviewer commented on your code or asked for changes, please remember to respond with comment. Do not mark discussion as resolved. It's up to reviewer to mark it resolved (in case if suggested fix addresses problem properly). PRs with unresolved issues should not be merged (even if the comment is unclear or requires no action from your side).
7. Please include a comment with the results before and after your change.
8. Your PR is more likely to be accepted if it includes tests (We have not historically been very strict about tests, but we would like to improve this!).
9. If your PR affects the user experience in some way, please update the README.md and the CLI help accordingly.
### Title
It is not that strict, but we use the title conventions in this repository.
Each commit message doesn't have to follow the conventions as long as it is clear and descriptive since it will be squashed and merged.
#### Format of the title
```
<type>(<scope>): <subject>
```
The `type` and `scope` should always be lowercase as shown below.
**Allowed `<type>` values:**
- **feat** for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
- **fix** for a bug fix for the user, not a fix to a build script. Such commit will trigger a release bumping a PATCH version.
- **perf** for performance improvements. Such commit will trigger a release bumping a PATCH version.
- **docs** for changes to the documentation.
- **style** for formatting changes, missing semicolons, etc.
- **refactor** for refactoring production code, e.g. renaming a variable.
- **test** for adding missing tests, refactoring tests; no production code change.
- **build** for updating build configuration, development tools or other changes irrelevant to the user.
- **chore** for updates that do not apply to the above, such as dependency updates.
**Example `<scope>` values:**
- alpine
- redhat
- ruby
- python
- terraform
- report
- etc.
The `<scope>` can be empty (e.g. if the change is a global or difficult to assign to a single component), in which case the parentheses are omitted.
#### Example titles
```
feat(alma): add support for AlmaLinux
```
```
fix(oracle): handle advisories with ksplice versions
```
```
docs(misconf): add comparison with Conftest and TFsec
```
```
chore(deps): bump go.uber.org/zap from 1.19.1 to 1.20.0
```
**NOTE**: please do not use `chore(deps): update fanal` and something like that if you add new features or fix bugs in Trivy-related projects.
The PR title should describe what the PR adds or fixes even though it just updates the dependency in Trivy.
### Unit tests
Your PR must pass all the unit tests. You can test it as below.
```
$ make test
```
### Integration tests
Your PR must pass all the integration tests. You can test it as below.
```
$ make test-integration
```
### Documentation
You can build the documents as below and view it at http://localhost:8000.
```
$ make mkdocs-serve
```
## Understand where your pull request belongs
Trivy is composed of several different repositories that work together:
- [Trivy](https://github.com/aquasecurity/trivy) is the client-side, user-facing, command line tool.
- [vuln-list](https://github.com/aquasecurity/vuln-list) is a vulnerabilities database, aggregated from different sources, and normalized for easy consumption. Think of this as the "server" side of the trivy command line tool. **There should be no pull requests to this repo**
- [vuln-list-update](https://github.com/aquasecurity/vuln-list-update) is the code that maintains the vuln-list database.
- [trivy-db](https://github.com/aquasecurity/trivy-db) maintains the vulnerability database pulled by Trivy CLI.
- [fanal](https://github.com/aquasecurity/fanal) is a library for extracting system information from containers. It is being used by Trivy to find testable subjects in the container image.

View File

@@ -1,14 +1,5 @@
FROM golang:1.12-alpine AS builder
ADD go.mod go.sum /app/
WORKDIR /app/
RUN apk --no-cache add git
RUN go mod download
ADD . /app/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /trivy cmd/trivy/main.go
FROM alpine:3.9
FROM alpine:3.15.0
RUN apk --no-cache add ca-certificates git
COPY --from=builder /trivy /usr/local/bin/trivy
RUN chmod +x /usr/local/bin/trivy
CMD ["trivy"]
COPY trivy /usr/local/bin/trivy
COPY contrib/*.tpl contrib/
ENTRYPOINT ["trivy"]

12
Dockerfile.protoc Normal file
View File

@@ -0,0 +1,12 @@
FROM golang:1.17
# Install protoc (cf. http://google.github.io/proto-lens/installing-protoc.html)
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
RUN apt-get update && apt-get install -y unzip
RUN curl --retry 5 -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/$PROTOC_ZIP \
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
&& unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \
&& rm -f $PROTOC_ZIP
RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1

214
LICENSE
View File

@@ -1,21 +1,201 @@
MIT License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2019 Teppei Fukuda
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Definitions.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

84
Makefile Normal file
View File

@@ -0,0 +1,84 @@
VERSION := $(shell git describe --tags)
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)"
GOPATH=$(shell go env GOPATH)
GOBIN=$(GOPATH)/bin
GOSRC=$(GOPATH)/src
MKDOCS_IMAGE := aquasec/mkdocs-material:dev
MKDOCS_PORT := 8000
u := $(if $(update),-u)
$(GOBIN)/wire:
GO111MODULE=off go get github.com/google/wire/cmd/wire
.PHONY: wire
wire: $(GOBIN)/wire
wire gen ./pkg/...
.PHONY: mock
mock: $(GOBIN)/mockery
mockery -all -inpkg -case=snake -dir $(DIR)
.PHONY: deps
deps:
go get ${u} -d
go mod tidy
$(GOBIN)/golangci-lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.41.1
.PHONY: test
test:
go test -v -short -coverprofile=coverage.txt -covermode=atomic ./...
integration/testdata/fixtures/images/*.tar.gz:
git clone https://github.com/aquasecurity/trivy-test-images.git integration/testdata/fixtures/images
.PHONY: test-integration
test-integration: integration/testdata/fixtures/images/*.tar.gz
go test -v -tags=integration ./integration/...
.PHONY: lint
lint: $(GOBIN)/golangci-lint
$(GOBIN)/golangci-lint run --timeout 5m
.PHONY: fmt
fmt:
find ./ -name "*.proto" | xargs clang-format -i
.PHONY: build
build:
go build $(LDFLAGS) ./cmd/trivy
.PHONY: protoc
protoc:
docker build -t trivy-protoc - < Dockerfile.protoc
docker run --rm -it -v ${PWD}:/app -w /app trivy-protoc make _$@
_protoc:
for path in `find ./rpc/ -name "*.proto" -type f`; do \
protoc --twirp_out=. --twirp_opt=paths=source_relative --go_out=. --go_opt=paths=source_relative $${path} || exit; \
done
.PHONY: install
install:
go install $(LDFLAGS) ./cmd/trivy
.PHONY: clean
clean:
rm -rf integration/testdata/fixtures/images
$(GOBIN)/labeler:
go install github.com/knqyf263/labeler@latest
.PHONY: label
label: $(GOBIN)/labeler
labeler apply misc/triage/labels.yaml -r aquasecurity/trivy -l 5
.PHONY: mkdocs-serve
## Runs MkDocs development server to preview the documentation page
mkdocs-serve:
docker build -t $(MKDOCS_IMAGE) -f docs/build/Dockerfile docs/build
docker run --name mkdocs-serve --rm -v $(PWD):/docs -p $(MKDOCS_PORT):8000 $(MKDOCS_IMAGE)

4
NOTICE Normal file
View File

@@ -0,0 +1,4 @@
Trivy
Copyright 2019-2020 Aqua Security Software Ltd.
This product includes software developed by Aqua Security (https://aquasec.com).

422
README.md
View File

@@ -1,229 +1,221 @@
<img src="imgs/logo.png" width="300">
<p align="center">
<img src="docs/imgs/logo.png" width="200">
</p>
[![GitHub release](https://img.shields.io/github/release/knqyf263/trivy.svg)](https://github.com/knqyf263/trivy/releases/latest)
[![CircleCI](https://circleci.com/gh/knqyf263/trivy.svg?style=svg)](https://circleci.com/gh/knqyf263/trivy)
[![Go Report Card](https://goreportcard.com/badge/github.com/knqyf263/trivy)](https://goreportcard.com/report/github.com/knqyf263/trivy)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/knqyf263/trivy/blob/master/LICENSE)
<p align="center">
<a href="https://aquasecurity.github.io/trivy/">Documentation</a>
</p>
<p align="center">
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues
</p>
[![GitHub Release][release-img]][release]
[![Test][test-img]][test]
[![Go Report Card][go-report-img]][go-report]
[![License: Apache-2.0][license-img]][license]
[![GitHub All Releases][github-all-releases-img]][release]
![Docker Pulls][docker-pulls]
A Simple and Comprehensive Vulnerability Scanner for Containers
# Abstract
Scan containers
`Trivy` (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a simple and comprehensive scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues.
`Trivy` detects vulnerabilities of OS packages (Alpine, RHEL, CentOS, etc.) and language-specific packages (Bundler, Composer, npm, yarn, etc.).
In addition, `Trivy` scans Infrastructure as Code (IaC) files such as Terraform, Dockerfile and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack.
`Trivy` is easy to use. Just install the binary and you're ready to scan.
<p align="center">
<img src="docs/imgs/overview.png" width="800" alt="Trivy Overview">
</p>
### Demo: Vulnerability Detection (Container Image)
<p align="center">
<img src="docs/imgs/vuln-demo.gif" width="1000" alt="Vulnerability Detection">
</p>
### Demo: Misconfiguration Detection (IaC Files)
<p align="center">
<img src="docs/imgs/misconf-demo.gif" width="1000" alt="Misconfiguration Detection">
</p>
# Quick Start
## Scan Image for Vulnerabilities
Simply specify an image name (and a tag).
```
$ trivy image [YOUR_IMAGE_NAME]
```
For example:
```
$ trivy image python:3.4-alpine
```
<details>
<summary>Result</summary>
```
2019-05-16T01:20:43.180+0900 INFO Updating vulnerability database...
2019-05-16T01:20:53.029+0900 INFO Detecting Alpine vulnerabilities...
python:3.4-alpine3.9 (alpine 3.9.2)
===================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| openssl | CVE-2019-1543 | MEDIUM | 1.1.1a-r1 | 1.1.1b-r1 | openssl: ChaCha20-Poly1305 |
| | | | | | with long nonces |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
```
</details>
## Scan Filesystem for Vulnerabilities and Misconfigurations
Simply specify a directory to scan.
```bash
$ trivy fs --security-checks vuln,config [YOUR_PROJECT_DIR]
```
For example:
```bash
$ trivy fs --security-checks vuln,config myproject/
```
<details>
<summary>Result</summary>
```bash
2021-07-09T12:03:27.564+0300 INFO Number of language-specific files: 1
2021-07-09T12:03:27.564+0300 INFO Detecting pipenv vulnerabilities...
2021-07-09T12:03:27.566+0300 INFO Detected config files: 1
Pipfile.lock (pipenv)
=====================
Total: 1 (HIGH: 1, CRITICAL: 0)
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
| 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 |
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
Dockerfile (dockerfile)
=======================
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (HIGH: 1, CRITICAL: 0)
+---------------------------+------------+----------------------+----------+------------------------------------------+
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
+---------------------------+------------+----------------------+----------+------------------------------------------+
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
| | | | | Dockerfile should not be 'root' |
| | | | | -->avd.aquasec.com/appshield/ds002 |
+---------------------------+------------+----------------------+----------+------------------------------------------+
```
</details>
## Scan Directory for Misconfigurations
Simply specify a directory containing IaC files such as Terraform and Dockerfile.
```
$ trivy config [YOUR_IAC_DIR]
```
For example:
```
$ ls build/
Dockerfile
$ trivy config ./build
```
<details>
<summary>Result</summary>
```
2021-07-09T10:06:29.188+0300 INFO Need to update the built-in policies
2021-07-09T10:06:29.188+0300 INFO Downloading the built-in policies...
2021-07-09T10:06:30.520+0300 INFO Detected config files: 1
Dockerfile (dockerfile)
=======================
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
+---------------------------+------------+----------------------+----------+------------------------------------------+
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
+---------------------------+------------+----------------------+----------+------------------------------------------+
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
| | | | | Dockerfile should not be 'root' |
| | | | | -->avd.aquasec.com/appshield/ds002 |
+---------------------------+------------+----------------------+----------+------------------------------------------+
```
</details>
# Features
# Installation
- Comprehensive vulnerability detection
- OS packages (Alpine Linux, Red Hat Universal Base Image, Red Hat Enterprise Linux, CentOS, AlmaLinux, Rocky Linux, CBL-Mariner, Oracle Linux, Debian, Ubuntu, Amazon Linux, openSUSE Leap, SUSE Enterprise Linux, Photon OS and Distroless)
- **Language-specific packages** (Bundler, Composer, Pipenv, Poetry, npm, yarn, Cargo, NuGet, Maven, and Go)
- Misconfiguration detection (IaC scanning)
- A wide variety of built-in policies are provided **out of the box**
- Kubernetes, Docker, Terraform, and more coming soon
- Support custom policies
- Simple
- Specify only an image name, a path to config files, or an artifact name
- Fast
- The first scan will finish within 10 seconds (depending on your network). Consequent scans will finish in single seconds.
- Easy installation
- `apt-get install`, `yum install` and `brew install` are possible.
- **No pre-requisites** such as installation of DB, libraries, etc.
- High accuracy
- **Especially [Alpine Linux][alpine] and RHEL/CentOS**
- Other OSes are also high
- DevSecOps
- **Suitable for CI** such as GitHub Actions, Jenkins, GitLab CI, etc.
- Support multiple targets
- container image, local filesystem and remote git repository
- Supply chain security (SBOM support)
- Support CycloneDX
## RHEL/CentOS
# Integrations
- [GitHub Actions][action]
- [Visual Studio Code][vscode]
Add repository setting to `/etc/yum.repos.d`.
# Documentation
The official documentation, which provides detailed installation, configuration, and quick start guides, is available at https://aquasecurity.github.io/trivy/.
```
$ sudo vim /etc/yum.repos.d/trivy.repo
[trivy]
name=Trivy repository
baseurl=https://knqyf263.github.io/trivy-repo/rpm/releases/$releasever/$basearch/
gpgcheck=0
enabled=1
$ sudo yum -y update
$ sudo yum -y install trivy
```
---
or
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]
```
$ rpm -ivh https://github.com/knqyf263/trivy/releases/download/v0.0.3/trivy_0.0.3_Linux-64bit.rpm
```
[test]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml
[test-img]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml/badge.svg
[go-report]: https://goreportcard.com/report/github.com/aquasecurity/trivy
[go-report-img]: https://goreportcard.com/badge/github.com/aquasecurity/trivy
[release]: https://github.com/aquasecurity/trivy/releases
[release-img]: https://img.shields.io/github/release/aquasecurity/trivy.svg?logo=github
[github-all-releases-img]: https://img.shields.io/github/downloads/aquasecurity/trivy/total?logo=github
[docker-pulls]: https://img.shields.io/docker/pulls/aquasec/trivy?logo=docker&label=docker%20pulls%20%2F%20trivy
[license]: https://github.com/aquasecurity/trivy/blob/main/LICENSE
[license-img]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
## Debian/Ubuntu
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
[action]: https://github.com/aquasecurity/trivy-action
[vscode]: https://github.com/aquasecurity/trivy-vscode-extension
Replace `[CODE_NAME]` with your code name
CODE_NAME: wheezy, jessie, stretch, buster, trusty, xenial, bionic
```
$ sudo apt-get install apt-transport-https gnupg
$ wget -qO - https://knqyf263.github.io/trivy-repo/deb/public.key | sudo apt-key add -
$ echo deb https://knqyf263.github.io/trivy-repo/deb [CODE_NAME] main | sudo tee -a /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install trivy
```
or
```
$ sudo apt-get install rpm
$ wget https://github.com/knqyf263/trivy/releases/download/v0.0.3/trivy_0.0.3_Linux-64bit.deb
$ sudo dpkg -i trivy_0.0.3_Linux-64bit.deb
```
## Mac OS X / Homebrew
You can use homebrew on OS X.
```
$ brew tap knqyf263/trivy
$ brew install knqyf263/trivy/trivy
```
## Binary (Including Windows)
Go to [the releases page](https://github.com/knqyf263/trivy/releases), find the version you want, and download the zip file. Unpack the zip file, and put the binary to somewhere you want (on UNIX-y systems, /usr/local/bin or the like). Make sure it has execution bits turned on.
## From source
```sh
$ go get -u github.com/knqyf263/trivy
```
# Examples
## Continuous Integration (CI)
Scan your image built in Travis CI/CircleCI. The test will fail if a vulnerability is found. When you don't want to fail the test, specify `--exit-code 0` .
**Note**: The first time take a while (faster by cache after the second time)
### Travis CI
```
$ cat .travis.yml
services:
- docker
before_install:
- docker build -t trivy-ci-test:latest .
- wget https://github.com/knqyf263/trivy/releases/download/v0.0.3/trivy_0.0.3_Linux-64bit.tar.gz
- tar zxvf trivy_0.0.3_Linux-64bit.tar.gz
script:
- ./trivy --exit-code 1 --quiet trivy-ci-test:latest
cache:
directories:
- $HOME/.cache/trivy
```
example: https://travis-ci.org/knqyf263/trivy-ci-test
repository: https://github.com/knqyf263/trivy-ci-test
### Circle CI
```
$ cat .circleci/config.yml
jobs:
build:
docker:
- image: docker:18.09-git
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: vulnerability-db
- run:
name: Build image
command: docker build -t trivy-ci-test:latest .
- run:
name: Install trivy
command: |
wget https://github.com/knqyf263/trivy/releases/download/v0.0.4/trivy_0.0.4_Linux-64bit.tar.gz
tar zxvf trivy_0.0.4_Linux-64bit.tar.gz
mv trivy /usr/local/bin
- run:
name: Scan the local image with trivy
command: trivy --exit-code 1 --quiet trivy-ci-test:latest
- save_cache:
key: vulnerability-db
paths:
- $HOME/.cache/trivy
workflows:
version: 2
release:
jobs:
- build
```
example: https://circleci.com/gh/knqyf263/trivy-ci-test
repository: https://github.com/knqyf263/trivy-ci-test
# Usage
```
$ trivy -h
NAME:
trivy - A simple and comprehensive vulnerability scanner for containers
USAGE:
main [options] image_name
VERSION:
0.0.3
OPTIONS:
--format value, -f value format (table, json) (default: "table")
--input value, -i value input file path instead of image name
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
--output value, -o value output file name
--exit-code value Exit code when vulnerabilities were found (default: 0)
--skip-update skip db update
--clean, -c clean all cache
--quiet, -q suppress progress bar
--debug, -d debug mode
--help, -h show help
--version, -v print the version
```
# Q&A
## Homebrew
### Error: Your macOS keychain GitHub credentials do not have sufficient scope!
```
$ brew tap knqyf263/trivy
Error: Your macOS keychain GitHub credentials do not have sufficient scope!
Scopes they need: none
Scopes they have:
Create a personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
```
Try:
```
$ printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
```
### Error: knqyf263/trivy/trivy 64 already installed
```
$ brew upgrade
...
Error: knqyf263/trivy/trivy 64 already installed
```
Try:
```
$ brew unlink trivy && brew uninstall trivy
($ rm -rf /usr/local/Cellar/trivy/64)
$ brew install knqyf263/trivy/trivy
```
## Others
### Unknown error
Try again with `--clean` option
```
$ trivy --clean alpine:3.8
```
# Contribute
1. fork a repository: github.com/knqyf263/trivy to github.com/you/repo
2. get original code: `go get github.com/knqyf263/trivy`
3. work on original code
4. add remote to your repo: git remote add myfork https://github.com/you/repo.git
5. push your changes: git push myfork
6. create a new Pull Request
- see [GitHub and Go: forking, pull requests, and go-getting](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
----
# Credits
Special thanks to [Tomoya Amachi](https://github.com/tomoyamachi)
# License
MIT
# Author
Teppei Fukuda (knqyf263)
[aquasec]: https://aquasec.com
[oss]: https://www.aquasec.com/products/open-source-projects/
[discussions]: https://github.com/aquasecurity/trivy/discussions

View File

@@ -1,20 +0,0 @@
FROM bepsays/ci-goreleaser:1.12-2
RUN apt-get -y update \
&& apt-get -y install vim rpm reprepro createrepo \
&& wget https://dl.bintray.com/homebrew/mirror/berkeley-db-18.1.32.tar.gz \
# Berkeley DB
&& tar zxvf berkeley-db-18.1.32.tar.gz \
&& cd db-18.1.32/build_unix \
# Linux
&& ../dist/configure --prefix=/usr/local --host=x86_64-linux \
&& make \
&& make install \
# Darwin
&& make clean \
&& ../dist/configure --prefix=/usr/local --host=x86_64-apple-darwin15 \
&& make \
&& make install

View File

@@ -1,17 +1,24 @@
#!/bin/bash
RELEASES=(wheezy jessie stretch buster trusty xenial bionic)
DEBIAN_RELEASES=$(debian-distro-info --supported)
UBUNTU_RELEASES=$(sort -u <(ubuntu-distro-info --supported-esm) <(ubuntu-distro-info --supported))
cd trivy-repo/deb
for release in ${RELEASES[@]}; do
echo "Adding deb package to $release"
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
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
git add .
git commit -m "Update deb packages"
git push origin master
git push origin main

View File

@@ -1,20 +1,27 @@
#!/bin/sh
#!/bin/bash
RPM_EL6=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el6/' -e 's/-64bit/.x86_64/')
RPM_EL7=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el7/' -e 's/-64bit/.x86_64/')
function create_rpm_repo () {
version=$1
rpm_path=rpm/releases/${version}/x86_64
RPM_EL=$(find ../dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e "s/_/-/g" -e "s/-Linux/.el$version/" -e "s/-64bit/.x86_64/")
echo $RPM_EL
mkdir -p $rpm_path
cp ../dist/*64bit.rpm ${rpm_path}/${RPM_EL}
createrepo --update $rpm_path
}
cd trivy-repo
mkdir -p rpm/releases/6/x86_64
mkdir -p rpm/releases/7/x86_64
cd rpm
cp ../../dist/*64bit.rpm releases/6/x86_64/${RPM_EL6}
cp ../../dist/*64bit.rpm releases/7/x86_64/${RPM_EL7}
createrepo --update releases/6/x86_64/
createrepo --update releases/7/x86_64/
VERSIONS=(5 6 7 8)
for version in ${VERSIONS[@]}; do
echo "Processing RHEL/CentOS $version..."
create_rpm_repo $version
done
git add .
git commit -m "Update rpm packages"
git push origin master
git push origin main

View File

@@ -1,67 +0,0 @@
package main
import (
"os"
"strings"
"github.com/knqyf263/trivy/pkg/vulnsrc/vulnerability"
"github.com/knqyf263/trivy/pkg/remic"
"github.com/urfave/cli"
"github.com/knqyf263/trivy/pkg/log"
)
func main() {
cli.AppHelpTemplate = `NAME:
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}}
USAGE:
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}
VERSION:
{{.Version}}{{end}}{{end}}{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if len .Authors}}
AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
{{range $index, $author := .Authors}}{{if $index}}
{{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}
OPTIONS:
{{range $index, $option := .VisibleFlags}}{{if $index}}
{{end}}{{$option}}{{end}}{{end}}
`
app := cli.NewApp()
app.Name = "remic"
app.Version = "0.0.1"
app.ArgsUsage = "file"
app.Usage = "A simple and fast tool for detecting vulnerabilities in application dependencies"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "format, f",
Value: "table",
Usage: "format (table, json)",
},
cli.StringFlag{
Name: "severity, s",
Value: strings.Join(vulnerability.SeverityNames, ","),
Usage: "severity of vulnerabilities to be displayed",
},
cli.StringFlag{
Name: "output, o",
Usage: "output file name",
},
cli.BoolFlag{
Name: "debug, d",
Usage: "debug mode",
},
}
app.Action = func(c *cli.Context) error {
return remic.Run(c)
}
err := app.Run(os.Args)
if err != nil {
log.Logger.Fatal(err)
}
}

View File

@@ -1,16 +1,10 @@
package main
import (
l "log"
"os"
"strings"
"github.com/knqyf263/trivy/pkg/vulnsrc/vulnerability"
"github.com/urfave/cli"
"github.com/knqyf263/trivy/pkg"
"github.com/knqyf263/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/commands"
"github.com/aquasecurity/trivy/pkg/log"
)
var (
@@ -18,84 +12,9 @@ var (
)
func main() {
cli.AppHelpTemplate = `NAME:
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}}
USAGE:
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}
VERSION:
{{.Version}}{{end}}{{end}}{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if len .Authors}}
AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
{{range $index, $author := .Authors}}{{if $index}}
{{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}
OPTIONS:
{{range $index, $option := .VisibleFlags}}{{if $index}}
{{end}}{{$option}}{{end}}{{end}}
`
app := cli.NewApp()
app.Name = "trivy"
app.Version = version
app.ArgsUsage = "image_name"
app.Usage = "A simple and comprehensive vulnerability scanner for containers"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "format, f",
Value: "table",
Usage: "format (table, json)",
},
cli.StringFlag{
Name: "input, i",
Value: "",
Usage: "input file path instead of image name",
},
cli.StringFlag{
Name: "severity, s",
Value: strings.Join(vulnerability.SeverityNames, ","),
Usage: "severities of vulnerabilities to be displayed (comma separated)",
},
cli.StringFlag{
Name: "output, o",
Usage: "output file name",
},
cli.IntFlag{
Name: "exit-code",
Usage: "Exit code when vulnerabilities were found",
Value: 0,
},
cli.BoolFlag{
Name: "skip-update",
Usage: "skip db update",
},
cli.BoolFlag{
Name: "clean, c",
Usage: "clean all cache",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "suppress progress bar",
},
cli.BoolFlag{
Name: "ignore-unfixed",
Usage: "display only fixed vulnerabilities",
},
cli.BoolFlag{
Name: "debug, d",
Usage: "debug mode",
},
}
app.Action = func(c *cli.Context) error {
return pkg.Run(c)
}
app := commands.NewApp(version)
err := app.Run(os.Args)
if err != nil {
if log.Logger != nil {
log.Logger.Fatal(err)
}
l.Fatal(err)
log.Fatal(err)
}
}

View File

@@ -0,0 +1,29 @@
Trivy_container_scanning:
stage: test
image:
name: alpine:3.11
variables:
# Override the GIT_STRATEGY variable in your `.gitlab-ci.yml` file and set it to `fetch` if you want to provide a `clair-whitelist.yml`
# file. See https://docs.gitlab.com/ee/user/application_security/container_scanning/index.html#overriding-the-container-scanning-template
# for details
GIT_STRATEGY: none
IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
allow_failure: true
before_script:
- export TRIVY_VERSION=${TRIVY_VERSION:-v0.19.2}
- apk add --no-cache curl docker-cli
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${TRIVY_VERSION}
- curl -sSL -o /tmp/trivy-gitlab.tpl https://github.com/aquasecurity/trivy/raw/${TRIVY_VERSION}/contrib/gitlab.tpl
script:
- trivy --exit-code 0 --cache-dir .trivycache/ --no-progress --format template --template "@/tmp/trivy-gitlab.tpl" -o gl-container-scanning-report.json $IMAGE
cache:
paths:
- .trivycache/
artifacts:
reports:
container_scanning: gl-container-scanning-report.json
dependencies: []
only:
refs:
- branches

68
contrib/asff.tpl Normal file
View File

@@ -0,0 +1,68 @@
{
"Findings": [
{{- $t_first := true -}}
{{- range . -}}
{{- $target := .Target -}}
{{- range .Vulnerabilities -}}
{{- if $t_first -}}
{{- $t_first = false -}}
{{- else -}}
,
{{- end -}}
{{- $severity := .Severity -}}
{{- if eq $severity "UNKNOWN" -}}
{{- $severity = "INFORMATIONAL" -}}
{{- end -}}
{{- $description := .Description -}}
{{- if gt (len $description ) 1021 -}}
{{- $description = (substr 0 1021 $description) | printf "%v .." -}}
{{- end}}
{
"SchemaVersion": "2018-10-08",
"Id": "{{ $target }}/{{ .VulnerabilityID }}",
"ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}::product/aquasecurity/aquasecurity",
"GeneratorId": "Trivy",
"AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}",
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
"CreatedAt": "{{ now | date "2006-01-02T15:04:05.999999999Z07:00" }}",
"UpdatedAt": "{{ now | date "2006-01-02T15:04:05.999999999Z07:00" }}",
"Severity": {
"Label": "{{ $severity }}"
},
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}",
"Description": {{ escapeString $description | printf "%q" }},
"Remediation": {
"Recommendation": {
"Text": "More information on this vulnerability is provided in the hyperlink",
"Url": "{{ .PrimaryURL }}"
}
},
"ProductFields": { "Product Name": "Trivy" },
"Resources": [
{
"Type": "Container",
"Id": "{{ $target }}",
"Partition": "aws",
"Region": "{{ env "AWS_REGION" }}",
"Details": {
"Container": { "ImageName": "{{ $target }}" },
"Other": {
"CVE ID": "{{ .VulnerabilityID }}",
"CVE Title": {{ .Title | printf "%q" }},
"PkgName": "{{ .PkgName }}",
"Installed Package": "{{ .InstalledVersion }}",
"Patched Package": "{{ .FixedVersion }}",
"NvdCvssScoreV3": "{{ (index .CVSS (sourceID "nvd")).V3Score }}",
"NvdCvssVectorV3": "{{ (index .CVSS (sourceID "nvd")).V3Vector }}",
"NvdCvssScoreV2": "{{ (index .CVSS (sourceID "nvd")).V2Score }}",
"NvdCvssVectorV2": "{{ (index .CVSS (sourceID "nvd")).V2Vector }}"
}
}
}
],
"RecordState": "ACTIVE"
}
{{- end -}}
{{- end }}
]
}

View File

@@ -0,0 +1,106 @@
package trivy
import data.lib.trivy
default ignore = false
nvd_v3_vector = v {
v := input.CVSS.nvd.V3Vector
}
redhat_v3_vector = v {
v := input.CVSS.redhat.V3Vector
}
# Ignore a vulnerability which requires high privilege
ignore {
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
nvd_cvss_vector.PrivilegesRequired == "High"
# Check against RedHat scores as well as NVD
redhat_cvss_vector := trivy.parse_cvss_vector_v3(redhat_v3_vector)
redhat_cvss_vector.PrivilegesRequired == "High"
}
# Ignore a vulnerability which requires user interaction
ignore {
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
nvd_cvss_vector.UserInteraction == "Required"
# Check against RedHat scores as well as NVD
redhat_cvss_vector := trivy.parse_cvss_vector_v3(redhat_v3_vector)
redhat_cvss_vector.UserInteraction == "Required"
}
ignore {
input.PkgName == "openssl"
# Split CVSSv3 vector
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
# Evaluate Attack Vector
ignore_attack_vectors := {"Physical", "Local"}
nvd_cvss_vector.AttackVector == ignore_attack_vectors[_]
}
ignore {
input.PkgName == "openssl"
# Evaluate severity
input.Severity == {"LOW", "MEDIUM", "HIGH"}[_]
# Evaluate CWE-ID
deny_cwe_ids := {
"CWE-119", # Improper Restriction of Operations within the Bounds of a Memory Buffer
"CWE-200", # Exposure of Sensitive Information to an Unauthorized Actor
}
count({x | x := input.CweIDs[_]; x == deny_cwe_ids[_]}) == 0
}
ignore {
input.PkgName == "bash"
# Split CVSSv3 vector
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
# Evaluate Attack Vector
ignore_attack_vectors := {"Physical", "Local", "Adjacent"}
nvd_cvss_vector.AttackVector == ignore_attack_vectors[_]
# Evaluate severity
input.Severity == {"LOW", "MEDIUM", "HIGH"}[_]
}
ignore {
input.PkgName == "django"
# Split CVSSv3 vector
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
# Evaluate Attack Vector
ignore_attack_vectors := {"Physical", "Local"}
nvd_cvss_vector.AttackVector == ignore_attack_vectors[_]
# Evaluate severity
input.Severity == {"LOW", "MEDIUM"}[_]
# Evaluate CWE-ID
deny_cwe_ids := {
"CWE-89", # SQL Injection
"CWE-78", # OS Command Injection
}
count({x | x := input.CweIDs[_]; x == deny_cwe_ids[_]}) == 0
}
ignore {
input.PkgName == "jquery"
# Split CVSSv3 vector
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
# Evaluate CWE-ID
deny_cwe_ids := {"CWE-79"} # XSS
count({x | x := input.CweIDs[_]; x == deny_cwe_ids[_]}) == 0
}

View File

@@ -0,0 +1,58 @@
package trivy
import data.lib.trivy
default ignore = false
ignore_pkgs := {"bash", "bind-license", "rpm", "vim", "vim-minimal"}
ignore_severities := {"LOW", "MEDIUM"}
nvd_v3_vector = v {
v := input.CVSS.nvd.V3Vector
}
redhat_v3_vector = v {
v := input.CVSS.redhat.V3Vector
}
ignore {
input.PkgName == ignore_pkgs[_]
}
ignore {
input.Severity == ignore_severities[_]
}
# Ignore a vulnerability which is not remotely exploitable
ignore {
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
nvd_cvss_vector.AttackVector != "Network"
redhat_cvss_vector := trivy.parse_cvss_vector_v3(redhat_v3_vector)
redhat_cvss_vector.AttackVector != "Network"
}
# Ignore a vulnerability which requires high privilege
ignore {
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
nvd_cvss_vector.PrivilegesRequired == "High"
redhat_cvss_vector := trivy.parse_cvss_vector_v3(redhat_v3_vector)
redhat_cvss_vector.PrivilegesRequired == "High"
}
# Ignore a vulnerability which requires user interaction
ignore {
nvd_cvss_vector := trivy.parse_cvss_vector_v3(nvd_v3_vector)
nvd_cvss_vector.UserInteraction == "Required"
redhat_cvss_vector := trivy.parse_cvss_vector_v3(redhat_v3_vector)
redhat_cvss_vector.UserInteraction == "Required"
}
# Ignore CSRF
ignore {
# https://cwe.mitre.org/data/definitions/352.html
input.CweIDs[_] == "CWE-352"
}

View File

@@ -0,0 +1,39 @@
{{- /* Template based on https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types */ -}}
[
{{- $t_first := true }}
{{- range . }}
{{- $target := .Target }}
{{- range .Vulnerabilities -}}
{{- if $t_first -}}
{{- $t_first = false -}}
{{ else -}}
,
{{- end }}
{
"type": "issue",
"check_name": "container_scanning",
"categories": [ "Security" ],
"description": {{ list .VulnerabilityID .Title | join ": " | printf "%q" }},
"fingerprint": "{{ .VulnerabilityID | sha1sum }}",
"content": {{ .Description | printf "%q" }},
"severity": {{ if eq .Severity "LOW" -}}
"info"
{{- else if eq .Severity "MEDIUM" -}}
"minor"
{{- else if eq .Severity "HIGH" -}}
"major"
{{- else if eq .Severity "CRITICAL" -}}
"critical"
{{- else -}}
"info"
{{- end }},
"location": {
"path": "{{ .PkgName }}-{{ .InstalledVersion }}",
"lines": {
"begin": 1
}
}
}
{{- end -}}
{{- end }}
]

83
contrib/gitlab.tpl Normal file
View File

@@ -0,0 +1,83 @@
{{- /* Template based on https://docs.gitlab.com/ee/user/application_security/container_scanning/#reports-json-format */ -}}
{
"version": "2.3",
"vulnerabilities": [
{{- $t_first := true }}
{{- range . }}
{{- $target := .Target }}
{{- range .Vulnerabilities -}}
{{- if $t_first -}}
{{- $t_first = false -}}
{{ else -}}
,
{{- end }}
{
"id": "{{ .VulnerabilityID }}",
"category": "container_scanning",
"message": {{ .Title | printf "%q" }},
"description": {{ .Description | printf "%q" }},
{{- /* cve is a deprecated key, use id instead */}}
"cve": "{{ .VulnerabilityID }}",
"severity": {{ if eq .Severity "UNKNOWN" -}}
"Unknown"
{{- else if eq .Severity "LOW" -}}
"Low"
{{- else if eq .Severity "MEDIUM" -}}
"Medium"
{{- else if eq .Severity "HIGH" -}}
"High"
{{- else if eq .Severity "CRITICAL" -}}
"Critical"
{{- else -}}
"{{ .Severity }}"
{{- end }},
{{- /* TODO: Define confidence */}}
"confidence": "Unknown",
"solution": {{ if .FixedVersion -}}
"Upgrade {{ .PkgName }} to {{ .FixedVersion }}"
{{- else -}}
"No solution provided"
{{- end }},
"scanner": {
"id": "trivy",
"name": "trivy"
},
"location": {
"dependency": {
"package": {
"name": "{{ .PkgName }}"
},
"version": "{{ .InstalledVersion }}"
},
{{- /* TODO: No mapping available - https://github.com/aquasecurity/trivy/issues/332 */}}
"operating_system": "Unknown",
"image": "{{ $target }}"
},
"identifiers": [
{
{{- /* TODO: Type not extractable - https://github.com/aquasecurity/trivy-db/pull/24 */}}
"type": "cve",
"name": "{{ .VulnerabilityID }}",
"value": "{{ .VulnerabilityID }}",
"url": "{{ .PrimaryURL }}"
}
],
"links": [
{{- $l_first := true -}}
{{- range .References -}}
{{- if $l_first -}}
{{- $l_first = false }}
{{- else -}}
,
{{- end -}}
{
"url": "{{ . }}"
}
{{- end }}
]
}
{{- end -}}
{{- end }}
],
"remediations": []
}

148
contrib/html.tpl Normal file
View File

@@ -0,0 +1,148 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
{{- if . }}
<style>
* {
font-family: Arial, Helvetica, sans-serif;
}
h1 {
text-align: center;
}
.group-header th {
font-size: 200%;
}
.sub-header th {
font-size: 150%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
white-space: nowrap;
padding: .3em;
}
table {
margin: 0 auto;
}
.severity {
text-align: center;
font-weight: bold;
color: #fafafa;
}
.severity-LOW .severity { background-color: #5fbb31; }
.severity-MEDIUM .severity { background-color: #e9c600; }
.severity-HIGH .severity { background-color: #ff8800; }
.severity-CRITICAL .severity { background-color: #e40000; }
.severity-UNKNOWN .severity { background-color: #747474; }
.severity-LOW { background-color: #5fbb3160; }
.severity-MEDIUM { background-color: #e9c60060; }
.severity-HIGH { background-color: #ff880060; }
.severity-CRITICAL { background-color: #e4000060; }
.severity-UNKNOWN { background-color: #74747460; }
table tr td:first-of-type {
font-weight: bold;
}
.links a,
.links[data-more-links=on] a {
display: block;
}
.links[data-more-links=off] a:nth-of-type(1n+5) {
display: none;
}
a.toggle-more-links { cursor: pointer; }
</style>
<title>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }} </title>
<script>
window.onload = function() {
document.querySelectorAll('td.links').forEach(function(linkCell) {
var links = [].concat.apply([], linkCell.querySelectorAll('a'));
[].sort.apply(links, function(a, b) {
return a.href > b.href ? 1 : -1;
});
links.forEach(function(link, idx) {
if (links.length > 3 && 3 === idx) {
var toggleLink = document.createElement('a');
toggleLink.innerText = "Toggle more links";
toggleLink.href = "#toggleMore";
toggleLink.setAttribute("class", "toggle-more-links");
linkCell.appendChild(toggleLink);
}
linkCell.appendChild(link);
});
});
document.querySelectorAll('a.toggle-more-links').forEach(function(toggleLink) {
toggleLink.onclick = function() {
var expanded = toggleLink.parentElement.getAttribute("data-more-links");
toggleLink.parentElement.setAttribute("data-more-links", "on" === expanded ? "off" : "on");
return false;
};
});
};
</script>
</head>
<body>
<h1>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }}</h1>
<table>
{{- range . }}
<tr class="group-header"><th colspan="6">{{ escapeXML .Type }}</th></tr>
{{- if (eq (len .Vulnerabilities) 0) }}
<tr><th colspan="6">No Vulnerabilities found</th></tr>
{{- else }}
<tr class="sub-header">
<th>Package</th>
<th>Vulnerability ID</th>
<th>Severity</th>
<th>Installed Version</th>
<th>Fixed Version</th>
<th>Links</th>
</tr>
{{- range .Vulnerabilities }}
<tr class="severity-{{ escapeXML .Vulnerability.Severity }}">
<td class="pkg-name">{{ escapeXML .PkgName }}</td>
<td>{{ escapeXML .VulnerabilityID }}</td>
<td class="severity">{{ escapeXML .Vulnerability.Severity }}</td>
<td class="pkg-version">{{ escapeXML .InstalledVersion }}</td>
<td>{{ escapeXML .FixedVersion }}</td>
<td class="links" data-more-links="off">
{{- range .Vulnerability.References }}
<a href={{ escapeXML . | printf "%q" }}>{{ escapeXML . }}</a>
{{- end }}
</td>
</tr>
{{- end }}
{{- end }}
{{- if (eq (len .Misconfigurations ) 0) }}
<tr><th colspan="6">No Misconfigurations found</th></tr>
{{- else }}
<tr class="sub-header">
<th>Type</th>
<th>Misconf ID</th>
<th>Check</th>
<th>Severity</th>
<th>Message</th>
</tr>
{{- range .Misconfigurations }}
<tr class="severity-{{ escapeXML .Severity }}">
<td class="misconf-type">{{ escapeXML .Type }}</td>
<td>{{ escapeXML .ID }}</td>
<td class="misconf-check">{{ escapeXML .Title }}</td>
<td class="severity">{{ escapeXML .Severity }}</td>
<td class="link" data-more-links="off" style="white-space:normal;"">
{{ escapeXML .Message }}
<br>
<a href={{ escapeXML .PrimaryURL | printf "%q" }}>{{ escapeXML .PrimaryURL }}</a>
</br>
</td>
</tr>
{{- end }}
{{- end }}
{{- end }}
</table>
{{- else }}
</head>
<body>
<h1>Trivy Returned Empty Report</h1>
{{- end }}
</body>
</html>

413
contrib/install.sh Executable file
View File

@@ -0,0 +1,413 @@
#!/bin/sh
set -e
# Code generated by godownloader on 2020-01-14T10:03:29Z. DO NOT EDIT.
#
usage() {
this=$1
cat <<EOF
$this: download go binaries for aquasecurity/trivy
Usage: $this [-b] bindir [-d] [tag]
-b sets bindir or installation directory, Defaults to ./bin
-d turns on debug logging
[tag] is a tag from
https://github.com/aquasecurity/trivy/releases
If tag is missing, then the latest will be used.
Generated by godownloader
https://github.com/goreleaser/godownloader
EOF
exit 2
}
parse_args() {
#BINDIR is ./bin unless set be ENV
# over-ridden by flag below
BINDIR=${BINDIR:-./bin}
while getopts "b:dh?x" arg; do
case "$arg" in
b) BINDIR="$OPTARG" ;;
d) log_set_priority 10 ;;
h | \?) usage "$0" ;;
x) set -x ;;
esac
done
shift $((OPTIND - 1))
TAG=$1
}
# this function wraps all the destructive operations
# if a curl|bash cuts off the end of the script due to
# network, either nothing will happen or will syntax error
# out preventing half-done work
execute() {
tmpdir=$(mktemp -d)
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
test ! -d "${BINDIR}" && install -d "${BINDIR}"
for binexe in $BINARIES; do
if [ "$OS" = "windows" ]; then
binexe="${binexe}.exe"
fi
install "${srcdir}/${binexe}" "${BINDIR}/"
log_info "installed ${BINDIR}/${binexe}"
done
rm -rf "${tmpdir}"
}
get_binaries() {
case "$PLATFORM" in
darwin/386) BINARIES="trivy" ;;
darwin/amd64) BINARIES="trivy" ;;
darwin/arm64) BINARIES="trivy" ;;
darwin/armv7) BINARIES="trivy" ;;
freebsd/386) BINARIES="trivy" ;;
freebsd/amd64) BINARIES="trivy" ;;
freebsd/arm64) BINARIES="trivy" ;;
freebsd/armv7) BINARIES="trivy" ;;
linux/386) BINARIES="trivy" ;;
linux/amd64) BINARIES="trivy" ;;
linux/ppc64le) BINARIES="trivy" ;;
linux/arm64) BINARIES="trivy" ;;
linux/armv7) BINARIES="trivy" ;;
openbsd/386) BINARIES="trivy" ;;
openbsd/amd64) BINARIES="trivy" ;;
openbsd/arm64) BINARIES="trivy" ;;
openbsd/armv7) 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
;;
esac
}
tag_to_version() {
if [ -z "${TAG}" ]; then
log_info "checking GitHub for latest tag"
else
log_info "checking GitHub for tag '${TAG}'"
fi
REALTAG=$(github_release "$OWNER/$REPO" "${TAG}") && true
if test -z "$REALTAG"; then
log_crit "unable to find '${TAG}' - use 'latest' or see https://github.com/${PREFIX}/releases for details"
exit 1
fi
# if version starts with 'v', remove it
TAG="$REALTAG"
VERSION=${TAG#v}
}
adjust_format() {
# change format (tar.gz or zip) based on OS
true
}
adjust_os() {
# adjust archive name based on OS
case ${OS} in
386) OS=32bit ;;
amd64) OS=64bit ;;
arm) OS=ARM ;;
arm64) OS=ARM64 ;;
ppc64le) OS=PPC64LE ;;
darwin) OS=macOS ;;
dragonfly) OS=DragonFlyBSD ;;
freebsd) OS=FreeBSD ;;
linux) OS=Linux ;;
netbsd) OS=NetBSD ;;
openbsd) OS=OpenBSD ;;
esac
true
}
adjust_arch() {
# adjust archive name based on ARCH
case ${ARCH} in
386) ARCH=32bit ;;
amd64) ARCH=64bit ;;
arm) ARCH=ARM ;;
arm64) ARCH=ARM64 ;;
ppc64le) OS=PPC64LE ;;
darwin) ARCH=macOS ;;
dragonfly) ARCH=DragonFlyBSD ;;
freebsd) ARCH=FreeBSD ;;
linux) ARCH=Linux ;;
netbsd) ARCH=NetBSD ;;
openbsd) ARCH=OpenBSD ;;
esac
true
}
cat /dev/null <<EOF
------------------------------------------------------------------------
https://github.com/client9/shlib - portable posix shell functions
Public domain - http://unlicense.org
https://github.com/client9/shlib/blob/master/LICENSE.md
but credit (and pull requests) appreciated.
------------------------------------------------------------------------
EOF
is_command() {
command -v "$1" >/dev/null
}
echoerr() {
echo "$@" 1>&2
}
log_prefix() {
echo "$0"
}
_logp=6
log_set_priority() {
_logp="$1"
}
log_priority() {
if test -z "$1"; then
echo "$_logp"
return
fi
[ "$1" -le "$_logp" ]
}
log_tag() {
case $1 in
0) echo "emerg" ;;
1) echo "alert" ;;
2) echo "crit" ;;
3) echo "err" ;;
4) echo "warning" ;;
5) echo "notice" ;;
6) echo "info" ;;
7) echo "debug" ;;
*) echo "$1" ;;
esac
}
log_debug() {
log_priority 7 || return 0
echo "$(log_prefix)" "$(log_tag 7)" "$@"
}
log_info() {
log_priority 6 || return 0
echo "$(log_prefix)" "$(log_tag 6)" "$@"
}
log_err() {
log_priority 3 || return 0
echoerr "$(log_prefix)" "$(log_tag 3)" "$@"
}
log_crit() {
log_priority 2 || return 0
echoerr "$(log_prefix)" "$(log_tag 2)" "$@"
}
uname_os() {
os=$(uname -s | tr '[:upper:]' '[:lower:]')
case "$os" in
cygwin_nt*) os="windows" ;;
mingw*) os="windows" ;;
msys_nt*) os="windows" ;;
esac
echo "$os"
}
uname_arch() {
arch=$(uname -m)
case $arch in
x86_64) arch="amd64" ;;
x86) arch="386" ;;
i686) arch="386" ;;
i386) arch="386" ;;
ppc64le) arch="ppc64le" ;;
aarch64) arch="arm64" ;;
armv5*) arch="armv5" ;;
armv6*) arch="armv6" ;;
armv7*) arch="armv7" ;;
esac
echo ${arch}
}
uname_os_check() {
os=$(uname_os)
case "$os" in
darwin) return 0 ;;
dragonfly) return 0 ;;
freebsd) return 0 ;;
linux) return 0 ;;
android) return 0 ;;
nacl) return 0 ;;
netbsd) return 0 ;;
openbsd) return 0 ;;
plan9) return 0 ;;
solaris) return 0 ;;
windows) return 0 ;;
esac
log_crit "uname_os_check '$(uname -s)' got converted to '$os' which is not a GOOS value. Please file bug at https://github.com/client9/shlib"
return 1
}
uname_arch_check() {
arch=$(uname_arch)
case "$arch" in
386) return 0 ;;
amd64) return 0 ;;
arm64) return 0 ;;
armv5) return 0 ;;
armv6) return 0 ;;
armv7) return 0 ;;
ppc64) return 0 ;;
ppc64le) return 0 ;;
mips) return 0 ;;
mipsle) return 0 ;;
mips64) return 0 ;;
mips64le) return 0 ;;
s390x) return 0 ;;
amd64p32) return 0 ;;
esac
log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib"
return 1
}
untar() {
tarball=$1
case "${tarball}" in
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" ;;
*.zip) unzip "${tarball}" ;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
esac
}
http_download_curl() {
local_file=$1
source_url=$2
header=$3
if [ -z "$header" ]; then
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
else
code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url")
fi
if [ "$code" != "200" ]; then
log_debug "http_download_curl received HTTP status $code"
return 1
fi
return 0
}
http_download_wget() {
local_file=$1
source_url=$2
header=$3
if [ -z "$header" ]; then
wget -q -O "$local_file" "$source_url"
else
wget -q --header "$header" -O "$local_file" "$source_url"
fi
}
http_download() {
log_debug "http_download $2"
if is_command curl; then
http_download_curl "$@"
return
elif is_command wget; then
http_download_wget "$@"
return
fi
log_crit "http_download unable to find wget or curl"
return 1
}
http_copy() {
tmp=$(mktemp)
http_download "${tmp}" "$1" "$2" || return 1
body=$(cat "$tmp")
rm -f "${tmp}"
echo "$body"
}
github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="latest"
giturl="https://github.com/${owner_repo}/releases/${version}"
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
test -z "$version" && return 1
echo "$version"
}
hash_sha256() {
TARGET=${1:-/dev/stdin}
if is_command gsha256sum; then
hash=$(gsha256sum "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command sha256sum; then
hash=$(sha256sum "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command shasum; then
hash=$(shasum -a 256 "$TARGET" 2>/dev/null) || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command openssl; then
hash=$(openssl -dst openssl dgst -sha256 "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f a
else
log_crit "hash_sha256 unable to find command to compute sha-256 hash"
return 1
fi
}
hash_sha256_verify() {
TARGET=$1
checksums=$2
if [ -z "$checksums" ]; then
log_err "hash_sha256_verify checksum file not specified in arg2"
return 1
fi
BASENAME=${TARGET##*/}
want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
if [ -z "$want" ]; then
log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'"
return 1
fi
got=$(hash_sha256 "$TARGET")
if [ "$want" != "$got" ]; then
log_err "hash_sha256_verify checksum for '$TARGET' did not verify ${want} vs $got"
return 1
fi
}
cat /dev/null <<EOF
------------------------------------------------------------------------
End of functions from https://github.com/client9/shlib
------------------------------------------------------------------------
EOF
PROJECT_NAME="trivy"
OWNER=aquasecurity
REPO="trivy"
BINARY=trivy
FORMAT=tar.gz
OS=$(uname_os)
ARCH=$(uname_arch)
PREFIX="$OWNER/$REPO"
# use in logging routines
log_prefix() {
echo "$PREFIX"
}
PLATFORM="${OS}/${ARCH}"
GITHUB_DOWNLOAD=https://github.com/${OWNER}/${REPO}/releases/download
uname_os_check "$OS"
uname_arch_check "$ARCH"
parse_args "$@"
get_binaries
tag_to_version
adjust_format
adjust_os
adjust_arch
log_info "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}"
NAME=${PROJECT_NAME}_${VERSION}_${OS}-${ARCH}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/${TAG}/${TARBALL}
CHECKSUM=${PROJECT_NAME}_${VERSION}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUM}
execute

31
contrib/junit.tpl Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" ?>
<testsuites>
{{- range . -}}
{{- $failures := len .Vulnerabilities }}
<testsuite tests="{{ $failures }}" failures="{{ $failures }}" name="{{ .Target }}" errors="0" skipped="0" time="">
{{- if not (eq .Type "") }}
<properties>
<property name="type" value="{{ .Type }}"></property>
</properties>
{{- end -}}
{{ range .Vulnerabilities }}
<testcase classname="{{ .PkgName }}-{{ .InstalledVersion }}" name="[{{ .Vulnerability.Severity }}] {{ .VulnerabilityID }}" time="">
<failure message="{{ escapeXML .Title }}" type="description">{{ escapeXML .Description }}</failure>
</testcase>
{{- end }}
</testsuite>
{{- $failures := len .Misconfigurations }}
<testsuite tests="{{ $failures }}" failures="{{ $failures }}" name="{{ .Target }}" errors="0" skipped="0" time="">
{{- if not (eq .Type "") }}
<properties>
<property name="type" value="{{ .Type }}"></property>
</properties>
{{- end -}}
{{ range .Misconfigurations }}
<testcase classname="{{ .Type }}" name="[{{ .Severity }}] {{ .ID }}" time="">
<failure message="{{ escapeXML .Title }}" type="description">{{ escapeXML .Description }}</failure>
</testcase>
{{- end }}
</testsuite>
{{- end }}
</testsuites>

113
docs/advanced/air-gap.md Normal file
View File

@@ -0,0 +1,113 @@
# Air-Gapped Environment
Trivy can be used in air-gapped environments. Note that an allowlist is [here][allowlist].
## Air-Gapped Environment for vulnerabilities
### Download the vulnerability database
At first, you need to download the vulnerability database for use in air-gapped environments.
Please follow [oras installation instruction][oras].
Download `db.tar.gz`:
```
$ oras pull ghcr.io/aquasecurity/trivy-db:2 -a
```
### Transfer the DB file into the air-gapped environment
The way of transfer depends on the environment.
```
$ rsync -av -e ssh /path/to/db.tar.gz [user]@[host]:dst
```
### Put the DB file in Trivy's cache directory
You have to know where to put the DB file. The following command shows the default cache directory.
```
$ ssh user@host
$ trivy -h | grep cache
--cache-dir value cache directory (default: "/home/myuser/.cache/trivy") [$TRIVY_CACHE_DIR]
```
Put the DB file in the cache directory + `/db`.
```
$ mkdir -p /home/myuser/.cache/trivy/db
$ cd /home/myuser/.cache/trivy/db
$ tar xvf /path/to/db.tar.gz -C /home/myuser/.cache/trivy/db
x trivy.db
x metadata.json
$ rm /path/to/db.tar.gz
```
In an air-gapped environment it is your responsibility to update the Trivy database on a regular basis, so that the scanner can detect recently-identified vulnerabilities.
### Run Trivy with --skip-update and --offline-scan option
In an air-gapped environment, specify `--skip-update` so that Trivy doesn't attempt to download the latest database file.
In addition, if you want to scan Java dependencies such as JAR and pom.xml, you need to specify `--offline-scan` since Trivy tries to issue API requests for scanning Java applications by default.
```
$ trivy image --skip-update --offline-scan alpine:3.12
```
## Air-Gapped Environment for misconfigurations
### Download misconfiguration policies
At first, you need to download misconfiguration policies for use in air-gapped environments.
Please follow [oras installation instruction][oras].
Download `bundle.tar.gz`:
```
$ oras pull ghcr.io/aquasecurity/appshield:latest -a
```
### Transfer misconfiguration policies into the air-gapped environment
The way of transfer depends on the environment.
```
$ rsync -av -e ssh /path/to/bundle.tar.gz [user]@[host]:dst
```
### Put the misconfiguration policies in Trivy's cache directory
You have to know where to put the misconfiguration policies file. The following command shows the default cache directory.
```
$ ssh user@host
$ trivy -h | grep cache
--cache-dir value cache directory (default: "/home/myuser/.cache/trivy") [$TRIVY_CACHE_DIR]
```
Put the misconfiguration policies file in the cache directory + `/policy/content`.
```
$ mkdir -p /home/myuser/.cache/trivy/policy/content
$ cd /home/myuser/.cache/trivy/policy/content
$ mv /path/to/bundle.tar.gz .
```
Then, decompress it.
`bundle.tar.gz ` file includes two folders: `docker`, `kubernetes` and file: `.manifest`.
```
$ tar xvf bundle.tar.gz
x ./docker/
...
x ./kubernetes/
...
x ./.manifest
$ rm bundle.tar.gz
```
In an air-gapped environment it is your responsibility to update policies on a regular basis, so that the scanner can detect recently-identified misconfigurations.
### Run Trivy with --skip-policy-update option
In an air-gapped environment, specify `--skip-policy-update` so that Trivy doesn't attempt to download the latest misconfiguration policies.
```
$ trivy conf --skip-policy-update /path/to/conf
```
[allowlist]: ../getting-started/troubleshooting.md
[oras]: https://oras.land/cli/

View File

@@ -0,0 +1,19 @@
# External References
There are external blogs and evaluations.
## Blogs
- [the vulnerability remediation lifecycle of Alpine containers][alpine]
- [Continuous Container Vulnerability Testing with Trivy][semaphore]
- [Open Source CVE Scanner Round-Up: Clair vs Anchore vs Trivy][round-up]
- [Docker Image Security: Static Analysis Tool Comparison Anchore Engine vs Clair vs Trivy][tool-comparison]
## Links
- [Research Spike: evaluate Trivy for scanning running containers][gitlab]
- [Istio evaluates scanners][istio]
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
[semaphore]: https://semaphoreci.com/blog/continuous-container-vulnerability-testing-with-trivy
[round-up]: https://boxboat.com/2020/04/24/image-scanning-tech-compared/
[tool-comparison]: https://www.a10o.net/devsecops/docker-image-security-static-analysis-tool-comparison-anchore-engine-vs-clair-vs-trivy/
[gitlab]: https://gitlab.com/gitlab-org/gitlab/-/issues/270888
[istio]: https://github.com/istio/release-builder/pull/687#issuecomment-874938417

View File

@@ -0,0 +1,37 @@
# Community Tools
The open source community has been hard at work developing new tools for Trivy. You can check out some of them here.
Have you created a tool thats not listed? Add the name and description of your integration and open a pull request in the GitHub repository to get your change merged.
## GitHub Actions
| Actions | Description |
| ------------------------------------------ | -------------------------------------------------------------------------------- |
| [gitrivy][gitrivy] | GitHub Issue + Trivy |
| [trivy-github-issues][trivy-github-issues] | GitHub Actions for creating GitHub Issues according to the Trivy scanning result |
## Semaphore
| Name | Description |
| -------------------------------------------------------| ----------------------------------------- |
| [Continuous Vulnerability Testing with Trivy][semaphore-tutorial] | Tutorial on scanning code, containers, infrastructure, and Kubernetes with Semaphore CI/CD. |
## CircleCI
| Orb | Description |
| -----------------------------------------| ----------------------------------------- |
| [fifteen5/trivy-orb][fifteen5/trivy-orb] | Orb for running Trivy, a security scanner |
## Others
| Name | Description |
| -----------------------------------------| ----------------------------------------- |
| [Trivy Vulnerability Explorer][explorer] | Explore trivy vulnerability reports in your browser and create .trivyignore files interactively. Can be integrated in your CI/CD tooling with deep links. |
[trivy-github-issues]: https://github.com/marketplace/actions/trivy-github-issues
[fifteen5/trivy-orb]: https://circleci.com/developer/orbs/orb/fifteen5/trivy-orb
[gitrivy]: https://github.com/marketplace/actions/trivy-action
[explorer]: https://dbsystel.github.io/trivy-vulnerability-explorer/
[semaphore-tutorial]: https://semaphoreci.com/blog/continuous-container-vulnerability-testing-with-trivy

View File

@@ -0,0 +1,28 @@
# Embed in Dockerfile
Scan your image as part of the build process by embedding Trivy in the
Dockerfile. This approach can be used to update Dockerfiles currently using
Aquas [Microscanner][microscanner].
```bash
$ cat Dockerfile
FROM alpine:3.7
RUN apk add curl \
&& curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin \
&& trivy rootfs --exit-code 1 --no-progress /
$ docker build -t vulnerable-image .
```
Alternatively you can use Trivy in a multistage build. Thus avoiding the
insecure `curl | sh`. Also the image is not changed.
```bash
[...]
# Run vulnerability scan on build image
FROM build AS vulnscan
COPY --from=aquasec/trivy:latest /usr/local/bin/trivy /usr/local/bin/trivy
RUN trivy rootfs --exit-code 1 --no-progress /
[...]
```
[microscanner]: https://github.com/aquasecurity/microscanner

View File

@@ -0,0 +1,17 @@
# OCI Image Layout
An image directory compliant with [Open Container Image Layout Specification](https://github.com/opencontainers/image-spec/blob/master/spec.md).
Buildah:
```
$ buildah push docker.io/library/alpine:3.11 oci:/path/to/alpine
$ trivy image --input /path/to/alpine
```
Skopeo:
```
$ skopeo copy docker-daemon:alpine:3.11 oci:/path/to/alpine
$ trivy image --input /path/to/alpine
```

View File

@@ -0,0 +1,28 @@
# Podman
!!! warning "EXPERIMENTAL"
This feature might change without preserving backwards compatibility.
Scan your image in Podman (>=2.0) running locally. The remote Podman is not supported.
Before performing Trivy commands, you must enable the podman.sock systemd service on your machine.
For more details, see [here][sock].
```bash
$ systemctl --user enable --now podman.socket
```
Then, you can scan your image in Podman.
```bash
$ cat Dockerfile
FROM alpine:3.12
RUN apk add --no-cache bash
$ podman build -t test .
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/test latest efc372d4e0de About a minute ago 7.94 MB
$ trivy image test
```
[sock]: https://github.com/containers/podman/blob/master/docs/tutorials/remote_client.md#enable-the-podman-service-on-the-server-machine

View File

@@ -0,0 +1,116 @@
# Unpacked Filesystem
Scan an unpacked container image filesystem.
In this case, Trivy works the same way when scanning containers
```bash
$ docker export $(docker create alpine:3.10.2) | tar -C /tmp/rootfs -xvf -
$ trivy rootfs /tmp/rootfs
```
<details>
<summary>Result</summary>
```bash
2021-03-08T05:22:26.378Z INFO Need to update DB
2021-03-08T05:22:26.380Z INFO Downloading DB...
20.37 MiB / 20.37 MiB [-------------------------------------------------------------------------------------------------------------------------------------] 100.00% 8.24 MiB p/s 2s
2021-03-08T05:22:30.134Z INFO Detecting Alpine vulnerabilities...
/tmp/rootfs (alpine 3.10.2)
===========================
Total: 20 (UNKNOWN: 0, LOW: 2, MEDIUM: 10, HIGH: 8, CRITICAL: 0)
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
| libcrypto1.1 | CVE-2020-1967 | HIGH | 1.1.1c-r0 | 1.1.1g-r0 | openssl: Segmentation |
| | | | | | fault in SSL_check_chain |
| | | | | | causes denial of service |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-1967 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2021-23839 | | | 1.1.1j-r0 | openssl: incorrect SSLv2 |
| | | | | | rollback protection |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23839 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2021-23840 | | | | openssl: integer |
| | | | | | overflow in CipherUpdate |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23840 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2021-23841 | | | | openssl: NULL pointer dereference |
| | | | | | in X509_issuer_and_serial_hash() |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23841 |
+ +------------------+----------+ +---------------+---------------------------------------+
| | CVE-2019-1547 | MEDIUM | | 1.1.1d-r0 | openssl: side-channel weak |
| | | | | | encryption vulnerability |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1547 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2019-1549 | | | | openssl: information |
| | | | | | disclosure in fork() |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1549 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2019-1551 | | | 1.1.1d-r2 | openssl: Integer overflow in RSAZ |
| | | | | | modular exponentiation on x86_64 |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1551 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2020-1971 | | | 1.1.1i-r0 | openssl: EDIPARTYNAME |
| | | | | | NULL pointer de-reference |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-1971 |
+ +------------------+----------+ +---------------+---------------------------------------+
| | CVE-2019-1563 | LOW | | 1.1.1d-r0 | openssl: information |
| | | | | | disclosure in PKCS7_dataDecode |
| | | | | | and CMS_decrypt_set1_pkey |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1563 |
+--------------+------------------+----------+ +---------------+---------------------------------------+
| libssl1.1 | CVE-2020-1967 | HIGH | | 1.1.1g-r0 | openssl: Segmentation |
| | | | | | fault in SSL_check_chain |
| | | | | | causes denial of service |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-1967 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2021-23839 | | | 1.1.1j-r0 | openssl: incorrect SSLv2 |
| | | | | | rollback protection |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23839 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2021-23840 | | | | openssl: integer |
| | | | | | overflow in CipherUpdate |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23840 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2021-23841 | | | | openssl: NULL pointer dereference |
| | | | | | in X509_issuer_and_serial_hash() |
| | | | | | -->avd.aquasec.com/nvd/cve-2021-23841 |
+ +------------------+----------+ +---------------+---------------------------------------+
| | CVE-2019-1547 | MEDIUM | | 1.1.1d-r0 | openssl: side-channel weak |
| | | | | | encryption vulnerability |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1547 |
+ +------------------+ + + +---------------------------------------+
| | CVE-2019-1549 | | | | openssl: information |
| | | | | | disclosure in fork() |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1549 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2019-1551 | | | 1.1.1d-r2 | openssl: Integer overflow in RSAZ |
| | | | | | modular exponentiation on x86_64 |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1551 |
+ +------------------+ + +---------------+---------------------------------------+
| | CVE-2020-1971 | | | 1.1.1i-r0 | openssl: EDIPARTYNAME |
| | | | | | NULL pointer de-reference |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-1971 |
+ +------------------+----------+ +---------------+---------------------------------------+
| | CVE-2019-1563 | LOW | | 1.1.1d-r0 | openssl: information |
| | | | | | disclosure in PKCS7_dataDecode |
| | | | | | and CMS_decrypt_set1_pkey |
| | | | | | -->avd.aquasec.com/nvd/cve-2019-1563 |
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
| musl | CVE-2020-28928 | MEDIUM | 1.1.22-r3 | 1.1.22-r4 | In musl libc through 1.2.1, |
| | | | | | wcsnrtombs mishandles particular |
| | | | | | combinations of destination buffer... |
| | | | | | -->avd.aquasec.com/nvd/cve-2020-28928 |
+--------------+ + + + + +
| musl-utils | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
```
</details>

View File

@@ -0,0 +1,78 @@
# Overview
We use two labels [help wanted](#help-wanted) and [good first
issue](#good-first-issue) to identify issues that have been specially groomed
for new contributors. The `good first issue` label is a subset of `help wanted`
label, indicating that members have committed to providing extra assistance for
new contributors. All `good first issue` items also have the `help wanted`
label.
## Help Wanted
Items marked with the `help wanted` label need to ensure that they are:
- **Low Barrier to Entry**
It should be tractable for new contributors. Documentation on how that type of
change should be made should already exist.
- **Clear Task**
The task is agreed upon and does not require further discussions in the
community. Call out if that area of code is untested and requires new
fixtures.
API / CLI behavior is decided and included in the OP issue, for example: "The
new command syntax is `trivy --format yaml IMAGE_NAME`"_ with
expected validations called out.
- **Goldilocks priority**
Not too high that a core contributor should do it, but not too low that it
isn't useful enough for a core contributor to spend time to review it, answer
questions, help get it into a release, etc.
- **Up-To-Date**
Often these issues become obsolete and have already been done, are no longer
desired, no longer make sense, have changed priority or difficulty , etc.
## Good First Issue
Items marked with the `good first issue` label are intended for _first-time
contributors_. It indicates that members will keep an eye out for these pull
requests and shepherd it through our processes.
These items need to ensure that they follow the guidelines for `help wanted`
labels (above) in addition to meeting the following criteria:
- **No Barrier to Entry**
The task is something that a new contributor can tackle without advanced
setup, or domain knowledge.
- **Solution Explained**
The recommended solution is clearly described in the issue.
- **Provides Context**
If background knowledge is required, this should be explicitly mentioned and a
list of suggested readings included.
- **Gives Examples**
Link to examples of similar implementations so new contributors have a
reference guide for their changes.
- **Identifies Relevant Code**
The relevant code and tests to be changed should be linked in the issue.
- **Ready to Test**
There should be existing tests that can be modified, or existing test cases
fit to be copied. If the area of code doesn't have tests, before labeling the
issue, add a test fixture. This prep often makes a great `help wanted` task!

View File

@@ -0,0 +1,195 @@
Triage is an important part of maintaining the health of the trivy repo.
A well organized repo allows maintainers to prioritize feature requests, fix bugs, and respond to users facing difficulty with the tool as quickly as possible.
Triage includes:
- Labeling issues
- Responding to issues
- Closing issues
# Daily Triage
Daily triage has two goals:
1. Responsiveness for new issues
1. Responsiveness when explicitly requested information was provided
It covers:
1. Issues without a `kind/` or `triage/` label
1. Issues without a `priority/` label
1. `triage/needs-information` issues which the user has followed up on, and now require a response.
## Categorization
The most important level of categorizing the issue is defining what type it is.
We typically want at least one of the following labels on every issue, and some issues may fall into multiple categories:
- `triage/support` - The default for most incoming issues
- `kind/bug` - When its a bug or we arent delivering the best user experience
Other possibilities:
- `kind/feature`- Identify new feature requests
- `kind/testing` - Update or fix unit/integration tests
- `kind/cleanup` - Cleaning up/refactoring the codebase
- `kind/documentation` - Updates or additions to trivy documentation
If the issue is specific to a driver for OS packages or libraries:
**co/[driver for OS packages]**
- `co/alpine`
- `co/amazon`
- `co/debian`
- `co/oracle`
- `co/photon`
- `co/redhat`
- `co/suse`
- `co/ubuntu`
**co/[driver for libraries of programming languages]**
- `co/bundler`
- `co/cargo`
- `co/composer`
- `co/npm`
- `co/yarn`
- `co/pipenv`
- `co/poetry`
**Help wanted?**
`Good First Issue` - bug has a proposed solution, can be implemented w/o further discussion.
`Help wanted` - if the bug could use help from a contributor
## Prioritization
If the issue is not `triage/support`, it needs a priority label.
`priority/critical-urgent` - someones top priority ASAP, such as security issue, user-visible bug, or build breakage. Rarely used.
`priority/important-soon`: in time for the next two releases. It should be attached to a milestone.
`priority/important-longterm`: 2-4 releases from now
`priority/backlog`: agreed that this would be good to have, but no one is available at the moment. Consider tagging as `help wanted`
`priority/awaiting-more-evidence`: may be useful, but there is not yet enough support.
# Weekly Triage
Weekly triage has three goals:
1. Catching up on unresponded issues
1. Reviewing and closing PRs
1. Closing stale issues
## Post-Release Triage
Post-release triage occurs after a major release (around every 4-6 weeks).
It focuses on:
1. Closing bugs that have been resolved by the release
1. Reprioritizing bugs that have not been resolved by the release
1. Letting users know if we believe that there is still an issue
This includes reviewing:
1. Every issue that hasnt been touched in the last 2 days
1. Re-evaluation of long-term issues
1. Re-evaluation of short-term issues
## Responding to Issues
### Needs More Information
A sample response to ask for more info:
> I dont yet have a clear way to replicate this issue. Do you mind adding some additional details. Here is additional information that would be helpful:
>
> \* The exact `trivy` command line used
>
> \* The exact image you want to scan
>
> \* The full output of the `trivy` command, preferably with `--debug` for extra logging.
>
>
> Thank you for sharing your experience!
Then: Label with `triage/needs-information`.
### Issue might be resolved
If you think a release may have resolved an issue, ask the author to see if their issue has been resolved:
> Could you please check to see if trivy <x> addresses this issue? We've made some changes with how this is handled, and improved the trivy logs output to help us debug tricky cases like this.
Then: Label with `triage/needs-information`.
## Closing with Care
Issues typically need to be closed for the following reasons:
- The issue has been addressed
- The issue is a duplicate of an existing issue
- There has been a lack of information over a long period of time
In any of these situations, we aim to be kind when closing the issue, and offer the author action items should they need to reopen their issue or still require a solution.
Samples responses for these situations include:
### Issue has been addressed
>@author: I believe this issue is now addressed by trivy v1.0.0, as it <reason>. If you still see this issue with trivy v1.0 or higher, please reopen this issue.
>
>Thank you for reporting this issue!
Then: Close the issue
### Duplicate Issue
>This issue appears to be a duplicate of #X, do you mind if we move the conversation there?
>
>This way we can centralize the content relating to the issue. If you feel that this issue is not in fact a duplicate, please re-open it. If you have additional information to share, please add it to the new issue.
>
>Thank you for reporting this!
Then: Label with `triage/duplicate` and close the issue.
### Lack of Information
If an issue hasn't been active for more than four weeks, and the author has been pinged at least once, then the issue can be closed.
>Hey @author -- hopefully it's OK if I close this - there wasn't enough information to make it actionable, and some time has already passed. If you are able to provide additional details, you may reopen it at any point.
>
>Here is additional information that may be helpful to us:
>
>\* Whether the issue occurs with the latest trivy release
>
>\* The exact `trivy` command line used
>
>\* The exact image you want to scan
>
>\* The full output of the `trivy` command, preferably with `--debug` for extra logging.
>
>
>Thank you for sharing your experience!
Then: Close the issue.
## Help Wanted issues
We use two labels [help wanted](https://github.com/aquasecurity/trivy/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
and [good first issue](https://github.com/aquasecurity/trivy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
to identify issues that have been specially groomed for new contributors.
We have specific [guidelines](/docs/advanced/contribd/contrib/help-wanted.md)
for how to use these labels. If you see an issue that satisfies these
guidelines, you can add the `help wanted` label and the `good first issue` label.
Please note that adding the `good first issue` label must also
add the `help wanted` label.
If an issue has these labels but does not satisfy the guidelines, please
ask for more details to be added to the issue or remove the labels.

2
docs/advanced/index.md Normal file
View File

@@ -0,0 +1,2 @@
# Advanced
This section describes advanced features, integrations, etc.

View File

@@ -0,0 +1,4 @@
# AWS CodePipeline
See [this blog post][blog] for an example of using Trivy within AWS CodePipeline.
[blog]: https://aws.amazon.com/blogs/containers/scanning-images-with-trivy-in-an-aws-codepipeline/

View File

@@ -0,0 +1,29 @@
# AWS Security Hub
## Upload findings to Security Hub
In the following example using the template `asff.tpl`, [ASFF](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) file can be generated.
```
$ AWS_REGION=us-west-1 AWS_ACCOUNT_ID=123456789012 trivy image --format template --template "@contrib/asff.tpl" -o report.asff golang:1.12-alpine
```
ASFF template needs AWS_REGION and AWS_ACCOUNT_ID from environment variables.
Then, you can upload it with AWS CLI.
```
$ aws securityhub batch-import-findings --findings file://report.asff
```
## Customize
You can customize [asff.tpl](https://github.com/aquasecurity/trivy/blob/main/contrib/asff.tpl)
```
$ export AWS_REGION=us-west-1
$ export AWS_ACCOUNT_ID=123456789012
$ trivy image --format template --template "@your-asff.tpl" -o report.asff golang:1.12-alpine
```
## Reference
https://aws.amazon.com/blogs/security/how-to-build-ci-cd-pipeline-container-vulnerability-scanning-trivy-and-aws-security-hub/

View File

@@ -0,0 +1,5 @@
# Bitbucket Pipelines
See [trivy-pipe][trivy-pipe] for the details.
[trivy-pipe]: https://github.com/aquasecurity/trivy-pipe

View File

@@ -0,0 +1,34 @@
# CircleCI
```
$ cat .circleci/config.yml
jobs:
build:
docker:
- image: docker:stable-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build image
command: docker build -t trivy-ci-test:${CIRCLE_SHA1} .
- run:
name: Install trivy
command: |
apk add --update-cache --upgrade curl
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- run:
name: Scan the local image with trivy
command: trivy image --exit-code 0 --no-progress trivy-ci-test:${CIRCLE_SHA1}
workflows:
version: 2
release:
jobs:
- build
```
[Example][example]
[Repository][repository]
[example]: https://circleci.com/gh/aquasecurity/trivy-ci-test
[repository]: https://github.com/aquasecurity/trivy-ci-test

View File

@@ -0,0 +1,9 @@
# GitHub Actions
- Here is the [Trivy Github Action][action]
- The Microsoft Azure team have written a [container-scan action][azure] that uses Trivy and Dockle
- For full control over the options specified to Trivy, this [blog post][blog] describes adding Trivy into your own GitHub action workflows
[action]: https://github.com/aquasecurity/trivy-action
[azure]: https://github.com/Azure/container-scan
[blog]: https://blog.aquasec.com/devsecops-with-trivy-github-actions

View File

@@ -0,0 +1,163 @@
# GitLab CI
If you're a GitLab Ultimate customer, GitLab 14.0 and above include out-of-the-box integration with Trivy. To enable it for your project, simply add the container scanning template to your `.gitlab-ci.yml` file. For more details, please refer to [GitLab's documentation](https://docs.gitlab.com/ee/user/application_security/container_scanning/).
If you're using an earlier version of GitLab, you can still use the new integration by copying the [contents of the 14.0 template](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/Container-Scanning.gitlab-ci.yml) to your configuration.
Alternatively, you can always use the example configurations below.
```yaml
stages:
- test
trivy:
stage: test
image: docker:stable
services:
- name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# See https://github.com/docker-library/docker/pull/166
DOCKER_TLS_CERTDIR: ""
IMAGE: trivy-ci-test:$CI_COMMIT_SHA
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
before_script:
- export TRIVY_VERSION=$(wget -qO - "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
- echo $TRIVY_VERSION
- wget --no-verbose https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz -O - | tar -zxvf -
allow_failure: true
script:
# Build image
- docker build -t $IMAGE .
# Build report
- ./trivy image --exit-code 0 --format template --template "@contrib/gitlab.tpl" -o gl-container-scanning-report.json $IMAGE
# Print report
- ./trivy image --exit-code 0 --severity HIGH $IMAGE
# Fail on severe vulnerabilities
- ./trivy image --exit-code 1 --severity CRITICAL $IMAGE
cache:
paths:
- .trivycache/
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab EE Ultimate or GitLab.com Gold)
artifacts:
reports:
container_scanning: gl-container-scanning-report.json
```
[Example][example]
[Repository][repository]
### GitLab CI using Trivy container
To scan a previously built image that has already been pushed into the
GitLab container registry the following CI job manifest can be used.
Note that `entrypoint` needs to be unset for the `script` section to work.
In case of a non-public GitLab project Trivy additionally needs to
authenticate to the registry to be able to pull your application image.
Finally, it is not necessary to clone the project repo as we only work
with the container image.
```yaml
container_scanning:
image:
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
GIT_STRATEGY: none
TRIVY_USERNAME: "$CI_REGISTRY_USER"
TRIVY_PASSWORD: "$CI_REGISTRY_PASSWORD"
TRIVY_AUTH_URL: "$CI_REGISTRY"
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
FULL_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- trivy --version
# cache cleanup is needed when scanning images with the same tags, it does not remove the database
- time trivy image --clear-cache
# update vulnerabilities db
- time trivy image --download-db-only
# Builds report and puts it in the default workdir $CI_PROJECT_DIR, so `artifacts:` can take it from there
- time trivy image --exit-code 0 --format template --template "@/contrib/gitlab.tpl"
--output "$CI_PROJECT_DIR/gl-container-scanning-report.json" "$FULL_IMAGE_NAME"
# Prints full report
- time trivy image --exit-code 0 "$FULL_IMAGE_NAME"
# Fail on critical vulnerabilities
- time trivy image --exit-code 1 --severity CRITICAL "$FULL_IMAGE_NAME"
cache:
paths:
- .trivycache/
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab EE Ultimate or GitLab.com Gold)
artifacts:
when: always
reports:
container_scanning: gl-container-scanning-report.json
tags:
- docker-runner
```
[example]: https://gitlab.com/aquasecurity/trivy-ci-test/pipelines
[repository]: https://github.com/aquasecurity/trivy-ci-test
### Gitlab CI alternative template
Depending on the edition of gitlab you have or your desired workflow, the
container scanning template may not meet your needs. As an addition to the
above container scanning template, a template for
[code climate](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html)
has been included. The key things to update from the above examples are
the `template` and `report` type. An updated example is below.
```yaml
stages:
- test
trivy:
stage: test
image: docker:stable
services:
- name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# See https://github.com/docker-library/docker/pull/166
DOCKER_TLS_CERTDIR: ""
IMAGE: trivy-ci-test:$CI_COMMIT_SHA
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
before_script:
- export TRIVY_VERSION=$(wget -qO - "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
- echo $TRIVY_VERSION
- wget --no-verbose https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz -O - | tar -zxvf -
allow_failure: true
script:
# Build image
- docker build -t $IMAGE .
# Build report
- ./trivy image --exit-code 0 --format template --template "@contrib/gitlab-codequality.tpl" -o gl-codeclimate.json $IMAGE
cache:
paths:
- .trivycache/
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab EE Ultimate or GitLab.com Gold)
artifacts:
paths:
- gl-codeclimate.json
reports:
codequality: gl-codeclimate.json
```
Currently gitlab only supports a single code quality report. There is an
open [feature request](https://gitlab.com/gitlab-org/gitlab/-/issues/9014)
to support multiple reports. Until this has been implemented, if you
already have a code quality report in your pipeline, you can use
`jq` to combine reports. Depending on how you name your artifacts, it may
be necessary to rename the artifact if you want to reuse the name. To then
combine the previous artifact with the output of trivy, the following `jq`
command can be used, `jq -s 'add' prev-codeclimate.json trivy-codeclimate.json > gl-codeclimate.json`.

View File

@@ -0,0 +1,2 @@
# Integrations
Scan your image automatically as part of your CI workflow, failing the workflow if a vulnerability is found. When you don't want to fail the test, specify `--exit-code 0`.

View File

@@ -0,0 +1,29 @@
# Travis CI
```
$ cat .travis.yml
services:
- docker
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
before_install:
- docker build -t trivy-ci-test:${COMMIT} .
- export VERSION=$(curl --silent "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
- wget https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
- tar zxvf trivy_${VERSION}_Linux-64bit.tar.gz
script:
- ./trivy image --exit-code 0 --severity HIGH --no-progress trivy-ci-test:${COMMIT}
- ./trivy image --exit-code 1 --severity CRITICAL --no-progress trivy-ci-test:${COMMIT}
cache:
directories:
- $HOME/.cache/trivy
```
[Example][example]
[Repository][repository]
[example]: https://travis-ci.org/aquasecurity/trivy-ci-test
[repository]: https://github.com/aquasecurity/trivy-ci-test

View File

@@ -0,0 +1,59 @@
# Client/Server
Trivy has client/server mode. Trivy server has vulnerability database and Trivy client doesn't have to download vulnerability database. It is useful if you want to scan images at multiple locations and do not want to download the database at every location.
## Server
At first, you need to launch Trivy server. It downloads vulnerability database automatically and continue to fetch the latest DB in the background.
```
$ trivy server --listen localhost:8080
2019-12-12T15:17:06.551+0200 INFO Need to update DB
2019-12-12T15:17:56.706+0200 INFO Reopening DB...
2019-12-12T15:17:56.707+0200 INFO Listening localhost:8080...
```
If you want to accept a connection from outside, you have to specify `0.0.0.0` or your ip address, not `localhost`.
```
$ trivy server --listen 0.0.0.0:8080
```
## Client
Then, specify the remote address.
```
$ trivy client --remote http://localhost:8080 alpine:3.10
```
<details>
<summary>Result</summary>
```
alpine:3.10 (alpine 3.10.2)
===========================
Total: 3 (UNKNOWN: 0, LOW: 1, MEDIUM: 2, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION |
+---------+------------------+----------+-------------------+---------------+
| openssl | CVE-2019-1549 | MEDIUM | 1.1.1c-r0 | 1.1.1d-r0 |
+ +------------------+ + + +
| | CVE-2019-1563 | | | |
+ +------------------+----------+ + +
| | CVE-2019-1547 | LOW | | |
+---------+------------------+----------+-------------------+---------------+
```
</details>
## Authentication
```
$ trivy server --listen localhost:8080 --token dummy
```
```
$ trivy client --remote http://localhost:8080 --token dummy alpine:3.10
```
## Architecture
![architecture](../../imgs/client-server.png)

View File

@@ -0,0 +1,16 @@
# Standalone
`trivy image`, `trivy filesystem`, and `trivy repo` works as standalone mode.
## Image
![standalone](../../imgs/image.png)
## Filesystem
![fs](../../imgs/fs.png)
## Git Repository
![repo](../../imgs/repo.png)

173
docs/advanced/plugins.md Normal file
View File

@@ -0,0 +1,173 @@
# Plugins
Trivy provides a plugin feature to allow others to extend the Trivy CLI without the need to change the Trivycode base.
This plugin system was inspired by the plugin system used in [kubectl][kubectl], [Helm][helm], and [Conftest][conftest].
## Overview
Trivy plugins are add-on tools that integrate seamlessly with Trivy.
They provide a way to extend the core feature set of Trivy, but without requiring every new feature to be written in Go and added to the core tool.
- They can be added and removed from a Trivy installation without impacting the core Trivy tool.
- They can be written in any programming language.
- They integrate with Trivy, and will show up in Trivy help and subcommands.
!!! warning
Trivy plugins available in public are not audited for security.
You should install and run third-party plugins at your own risk, since they are arbitrary programs running on your machine.
## Installing a Plugin
A plugin can be installed using the `trivy plugin install` command.
This command takes a url and will download the plugin and install it in the plugin cache.
Trivy adheres to the XDG specification, so the location depends on whether XDG_DATA_HOME is set.
Trivy will now search XDG_DATA_HOME for the location of the Trivy plugins cache.
The preference order is as follows:
- XDG_DATA_HOME if set and .trivy/plugins exists within the XDG_DATA_HOME dir
- ~/.trivy/plugins
Under the hood Trivy leverages [go-getter][go-getter] to download plugins.
This means the following protocols are supported for downloading plugins:
- OCI Registries
- Local Files
- Git
- HTTP/HTTPS
- Mercurial
- Amazon S3
- Google Cloud Storage
For example, to download the Kubernetes Trivy plugin you can execute the following command:
```bash
$ trivy plugin install github.com/aquasecurity/trivy-plugin-kubectl
```
## Using Plugins
Once the plugin is installed, Trivy will load all available plugins in the cache on the start of the next Trivy execution.
A plugin will be made in the Trivy CLI based on the plugin name.
To display all plugins, you can list them by `trivy --help`
```bash
$ trivy --help
NAME:
trivy - A simple and comprehensive vulnerability scanner for containers
USAGE:
trivy [global options] command [command options] target
VERSION:
dev
COMMANDS:
image, i scan an image
filesystem, fs scan local filesystem
repository, repo scan remote repository
client, c client mode
server, s server mode
plugin, p manage plugins
kubectl scan kubectl resources
help, h Shows a list of commands or help for one command
```
As shown above, `kubectl` subcommand exists in the `COMMANDS` section.
To call the kubectl plugin and scan existing Kubernetes deployments, you can execute the following command:
```
$ trivy kubectl deployment <deployment-id> -- --ignore-unfixed --severity CRITICAL
```
Internally the kubectl plugin calls the kubectl binary to fetch information about that deployment and passes the using images to Trivy.
You can see the detail [here][trivy-plugin-kubectl].
If you want to omit even the subcommand, you can use `TRIVY_RUN_AS_PLUGIN` environment variable.
```bash
$ TRIVY_RUN_AS_PLUGIN=kubectl trivy job your-job -- --format json
```
## Installing and Running Plugins on the fly
`trivy plugin run` installs a plugin and runs it on the fly.
If the plugin is already present in the cache, the installation is skipped.
```bash
trivy plugin run github.com/aquasecurity/trivy-plugin-kubectl pod your-pod -- --exit-code 1
```
## Uninstalling Plugins
Specify a plugin name with `trivy plugin uninstall` command.
```bash
$ trivy plugin uninstall kubectl
```
## Building Plugins
Each plugin has a top-level directory, and then a plugin.yaml file.
```bash
your-plugin/
|
|- plugin.yaml
|- your-plugin.sh
```
In the example above, the plugin is contained inside of a directory named `your-plugin`.
It has two files: plugin.yaml (required) and an executable script, your-plugin.sh (optional).
The core of a plugin is a simple YAML file named plugin.yaml.
Here is an example YAML of trivy-plugin-kubectl plugin that adds support for Kubernetes scanning.
```yaml
name: "kubectl"
repository: github.com/aquasecurity/trivy-plugin-kubectl
version: "0.1.0"
usage: scan kubectl resources
description: |-
A Trivy plugin that scans the images of a kubernetes resource.
Usage: trivy kubectl TYPE[.VERSION][.GROUP] NAME
platforms:
- selector: # optional
os: darwin
arch: amd64
uri: ./trivy-kubectl # where the execution file is (local file, http, git, etc.)
bin: ./trivy-kubectl # path to the execution file
- selector: # optional
os: linux
arch: amd64
uri: https://github.com/aquasecurity/trivy-plugin-kubectl/releases/download/v0.1.0/trivy-kubectl.tar.gz
bin: ./trivy-kubectl
```
The `plugin.yaml` field should contain the following information:
- name: The name of the plugin. This also determines how the plugin will be made available in the Trivy CLI. For example, if the plugin is named kubectl, you can call the plugin with `trivy kubectl`. (required)
- version: The version of the plugin. (required)
- usage: A short usage description. (required)
- description: A long description of the plugin. This is where you could provide a helpful documentation of your plugin. (required)
- platforms: (required)
- selector: The OS/Architecture specific variations of a execution file. (optional)
- os: OS information based on GOOS (linux, darwin, etc.) (optional)
- arch: The architecture information based on GOARCH (amd64, arm64, etc.) (optional)
- uri: Where the executable file is. Relative path from the root directory of the plugin or remote URL such as HTTP and S3. (required)
- bin: Which file to call when the plugin is executed. Relative path from the root directory of the plugin. (required)
The following rules will apply in deciding which platform to select:
- If both `os` and `arch` under `selector` match the current platform, search will stop and the platform will be used.
- If `selector` is not present, the platform will be used.
- If `os` matches and there is no more specific `arch` match, the platform will be used.
- If no `platform` match is found, Trivy will exit with an error.
After determining platform, Trivy will download the execution file from `uri` and store it in the plugin cache.
When the plugin is called via Trivy CLI, `bin` command will be executed.
The plugin is responsible for handling flags and arguments. Any arguments are passed to the plugin from the `trivy` command.
## Example
https://github.com/aquasecurity/trivy-plugin-kubectl
[kubectl]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
[helm]: https://helm.sh/docs/topics/plugins/
[conftest]: https://www.conftest.dev/plugins/
[go-getter]: https://github.com/hashicorp/go-getter
[trivy-plugin-kubectl]: https://github.com/aquasecurity/trivy-plugin-kubectl

View File

@@ -0,0 +1,27 @@
# Requirements
None, Trivy uses Azure SDK for Go. You don't need to install `az` command.
# Privileges
Service principal must have the `AcrPull` permissions.
## Creation of a service principal
```bash
export SP_DATA=$(az ad sp create-for-rbac --name TrivyTest --role AcrPull --scope "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.ContainerRegistry/registries/<registry_name>")
```
# Usage
```bash
# must set TRIVY_USERNAME empty char
export AZURE_CLIENT_ID$(echo $SP_DATA | jq -r .appId)
export AZURE_CLIENT_SECRET$(echo $SP_DATA | jq -r .password)
export AZURE_TENANT_ID$(echo $SP_DATA | jq -r .tenant)
```
# Testing
You can test credentials in the following manner.
```bash
docker run -it --rm -v /tmp:/tmp\
-e AZURE_CLIENT_ID=${AZURE_CLIENT_ID} -e AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET} \
-e AZURE_TENANT_ID=${AZURE_TENANT_ID} aquasec/trivy image your_special_project.azurecr.io/your_special_image:your_special_tag
```

View File

@@ -0,0 +1,7 @@
Docker Hub needs `TRIVY_USERNAME` and `TRIVY_PASSWORD`.
You don't need to set ENV vars when download from public repository.
```bash
export TRIVY_USERNAME={DOCKERHUB_USERNAME}
export TRIVY_PASSWORD={DOCKERHUB_PASSWORD}
```

View File

@@ -0,0 +1,4 @@
Trivy uses AWS SDK. You don't need to install `aws` CLI tool.
You can use [AWS CLI's ENV Vars][env-var].
[env-var]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

View File

@@ -0,0 +1,40 @@
# Requirements
None, Trivy uses Google Cloud SDK. You don't need to install `gcloud` command.
# Privileges
Credential file must have the `roles/storage.objectViewer` permissions.
More information can be found in [Google's documentation](https://cloud.google.com/container-registry/docs/access-control)
## JSON File Format
The JSON file specified should have the following format provided by google's service account mechanisms:
```json
{
"type": "service_account",
"project_id": "your_special_project",
"private_key_id": "XXXXXXXXXXXXXXXXXXXXxx",
"private_key": "-----BEGIN PRIVATE KEY-----\nNONONONO\n-----END PRIVATE KEY-----\n",
"client_email": "somedude@your_special_project.iam.gserviceaccount.com",
"client_id": "1234567890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/somedude%40your_special_project.iam.gserviceaccount.com"
}
```
# Usage
If you want to use target project's repository, you can set them via `GOOGLE_APPLICATION_CREDENTIALS`.
```bash
# must set TRIVY_USERNAME empty char
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credential.json
```
# Testing
You can test credentials in the following manner (assuming they are in `/tmp` on host machine).
```bash
docker run -it --rm -v /tmp:/tmp\
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/service_account.json\
aquasec/trivy image gcr.io/your_special_project/your_special_image:your_special_tag
```

View File

@@ -0,0 +1,4 @@
Trivy can download images from a private registry, without installing `Docker` or any other 3rd party tools.
That's because it's easy to run in a CI process.
All you have to do is install `Trivy` and set ENV vars.

View File

@@ -0,0 +1,9 @@
BasicAuth server needs `TRIVY_USERNAME` and `TRIVY_PASSWORD`.
```bash
export TRIVY_USERNAME={USERNAME}
export TRIVY_PASSWORD={PASSWORD}
# if you want to use 80 port, use NonSSL
export TRIVY_NON_SSL=true
```

View File

@@ -0,0 +1,175 @@
# CycloneDX
Trivy generates JSON reports in the [CycloneDX][cyclonedx] format.
Note that XML format is not supported at the moment.
You can specify `cyclonedx` with the `--format` option.
```
$ trivy image --format cyclonedx --output result.json alpine:3.15
```
<details>
<summary>Result</summary>
```
$ cat result.json | jq .
{
"bomFormat": "CycloneDX",
"specVersion": "1.3",
"serialNumber": "urn:uuid:2be5773d-7cd3-4b4b-90a5-e165474ddace",
"version": 1,
"metadata": {
"timestamp": "2022-02-22T15:11:40.270597Z",
"tools": [
{
"vendor": "aquasecurity",
"name": "trivy",
"version": "dev"
}
],
"component": {
"bom-ref": "pkg:oci/alpine@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300?repository_url=index.docker.io%2Flibrary%2Falpine&arch=amd64",
"type": "container",
"name": "alpine:3.15",
"version": "",
"purl": "pkg:oci/alpine@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300?repository_url=index.docker.io%2Flibrary%2Falpine&arch=amd64",
"properties": [
{
"name": "aquasecurity:trivy:SchemaVersion",
"value": "2"
},
{
"name": "aquasecurity:trivy:ImageID",
"value": "sha256:c059bfaa849c4d8e4aecaeb3a10c2d9b3d85f5165c66ad3a4d937758128c4d18"
},
{
"name": "aquasecurity:trivy:RepoDigest",
"value": "alpine@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300"
},
{
"name": "aquasecurity:trivy:DiffID",
"value": "sha256:8d3ac3489996423f53d6087c81180006263b79f206d3fdec9e66f0e27ceb8759"
},
{
"name": "aquasecurity:trivy:RepoTag",
"value": "alpine:3.15"
}
]
}
},
"components": [
{
"bom-ref": "pkg:apk/alpine/alpine-baselayout@3.2.0-r18?distro=3.15.0",
"type": "library",
"name": "alpine-baselayout",
"version": "3.2.0-r18",
"licenses": [
{
"expression": "GPL-2.0-only"
}
],
"purl": "pkg:apk/alpine/alpine-baselayout@3.2.0-r18?distro=3.15.0",
"properties": [
{
"name": "aquasecurity:trivy:SrcName",
"value": "alpine-baselayout"
},
{
"name": "aquasecurity:trivy:SrcVersion",
"value": "3.2.0-r18"
},
{
"name": "aquasecurity:trivy:LayerDigest",
"value": "sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3"
},
{
"name": "aquasecurity:trivy:LayerDiffID",
"value": "sha256:8d3ac3489996423f53d6087c81180006263b79f206d3fdec9e66f0e27ceb8759"
}
]
},
...(snip)...
{
"bom-ref": "pkg:apk/alpine/zlib@1.2.11-r3?distro=3.15.0",
"type": "library",
"name": "zlib",
"version": "1.2.11-r3",
"licenses": [
{
"expression": "Zlib"
}
],
"purl": "pkg:apk/alpine/zlib@1.2.11-r3?distro=3.15.0",
"properties": [
{
"name": "aquasecurity:trivy:SrcName",
"value": "zlib"
},
{
"name": "aquasecurity:trivy:SrcVersion",
"value": "1.2.11-r3"
},
{
"name": "aquasecurity:trivy:LayerDigest",
"value": "sha256:59bf1c3509f33515622619af21ed55bbe26d24913cedbca106468a5fb37a50c3"
},
{
"name": "aquasecurity:trivy:LayerDiffID",
"value": "sha256:8d3ac3489996423f53d6087c81180006263b79f206d3fdec9e66f0e27ceb8759"
}
]
},
{
"bom-ref": "3da6a469-964d-4b4e-b67d-e94ec7c88d37",
"type": "operating-system",
"name": "alpine",
"version": "3.15.0",
"properties": [
{
"name": "aquasecurity:trivy:Type",
"value": "alpine"
},
{
"name": "aquasecurity:trivy:Class",
"value": "os-pkgs"
}
]
}
],
"dependencies": [
{
"ref": "3da6a469-964d-4b4e-b67d-e94ec7c88d37",
"dependsOn": [
"pkg:apk/alpine/alpine-baselayout@3.2.0-r18?distro=3.15.0",
"pkg:apk/alpine/alpine-keys@2.4-r1?distro=3.15.0",
"pkg:apk/alpine/apk-tools@2.12.7-r3?distro=3.15.0",
"pkg:apk/alpine/busybox@1.34.1-r3?distro=3.15.0",
"pkg:apk/alpine/ca-certificates-bundle@20191127-r7?distro=3.15.0",
"pkg:apk/alpine/libc-utils@0.7.2-r3?distro=3.15.0",
"pkg:apk/alpine/libcrypto1.1@1.1.1l-r7?distro=3.15.0",
"pkg:apk/alpine/libretls@3.3.4-r2?distro=3.15.0",
"pkg:apk/alpine/libssl1.1@1.1.1l-r7?distro=3.15.0",
"pkg:apk/alpine/musl@1.2.2-r7?distro=3.15.0",
"pkg:apk/alpine/musl-utils@1.2.2-r7?distro=3.15.0",
"pkg:apk/alpine/scanelf@1.3.3-r0?distro=3.15.0",
"pkg:apk/alpine/ssl_client@1.34.1-r3?distro=3.15.0",
"pkg:apk/alpine/zlib@1.2.11-r3?distro=3.15.0"
]
},
{
"ref": "pkg:oci/alpine@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300?repository_url=index.docker.io%2Flibrary%2Falpine&arch=amd64",
"dependsOn": [
"3da6a469-964d-4b4e-b67d-e94ec7c88d37"
]
}
]
}
```
</details>
!!! caution
It doesn't support vulnerabilities yet, but installed packages.
[cyclonedx]: https://cyclonedx.org/

9
docs/build/Dockerfile vendored Normal file
View File

@@ -0,0 +1,9 @@
FROM squidfunk/mkdocs-material:7.0.6
## If you want to see exactly the same version as is published to GitHub pages
## use a private image for insiders, which requires authentication.
# docker login -u ${GITHUB_USERNAME} -p ${GITHUB_TOKEN} ghcr.io
# FROM ghcr.io/squidfunk/mkdocs-material-insiders
RUN pip install mike mkdocs-macros-plugin

View File

@@ -0,0 +1,31 @@
# Client
```bash
NAME:
trivy client - client mode
USAGE:
trivy client [command options] image_name
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
--token value for authentication [$TRIVY_TOKEN]
--token-header value specify a header name for token (default: "Trivy-Token") [$TRIVY_TOKEN_HEADER]
--remote value server address (default: "http://localhost:4954") [$TRIVY_REMOTE]
--custom-headers value custom headers [$TRIVY_CUSTOM_HEADERS]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,29 @@
# Config
``` bash
NAME:
trivy config - scan config files
USAGE:
trivy config [command options] dir
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
--reset remove all caches and database (default: false) [$TRIVY_RESET]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--skip-files value specify the file paths to skip traversal [$TRIVY_SKIP_FILES]
--skip-dirs value specify the directories where the traversal is skipped [$TRIVY_SKIP_DIRS]
--policy value, --config-policy value specify paths to the Rego policy files directory, applying config files [$TRIVY_POLICY]
--data value, --config-data value specify paths from which data for the Rego policies will be recursively loaded [$TRIVY_DATA]
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") [$TRIVY_POLICY_NAMESPACES]
--file-patterns value specify file patterns [$TRIVY_FILE_PATTERNS]
--include-successes include successes of misconfigurations (default: false) [$TRIVY_INCLUDE_SUCCESSES]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,35 @@
# Filesystem
```bash
NAME:
trivy filesystem - scan local filesystem
USAGE:
trivy filesystem [command options] dir
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
--skip-files value specify the file paths to skip traversal [$TRIVY_SKIP_FILES]
--skip-dirs value specify the directories where the traversal is skipped [$TRIVY_SKIP_DIRS]
--config-policy value specify paths to the Rego policy files directory, applying config files [$TRIVY_CONFIG_POLICY]
--config-data value specify paths from which data for the Rego policies will be recursively loaded [$TRIVY_CONFIG_DATA]
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") [$TRIVY_POLICY_NAMESPACES]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,34 @@
# Image
```bash
NAME:
trivy image - scan an image
USAGE:
trivy image [command options] image_name
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-update skip db update (default: false) [$TRIVY_SKIP_UPDATE]
--download-db-only download/update vulnerability database but don't run a scan (default: false) [$TRIVY_DOWNLOAD_DB_ONLY]
--reset remove all caches and database (default: false) [$TRIVY_RESET]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
--skip-files value specify the file path to skip traversal [$TRIVY_SKIP_FILES]
--skip-dirs value specify the directory where the traversal is skipped [$TRIVY_SKIP_DIRS]
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,30 @@
Trivy has several sub commands, image, fs, repo, client and server.
``` bash
NAME:
trivy - A simple and comprehensive vulnerability scanner for containers
USAGE:
trivy [global options] command [command options] target
VERSION:
dev
COMMANDS:
image, i scan an image
filesystem, fs scan local filesystem
repository, repo scan remote repository
client, c client mode
server, s server mode
config, conf scan config files
plugin, p manage plugins
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--quiet, -q suppress progress bar and log output (default: false) [$TRIVY_QUIET]
--debug, -d debug mode (default: false) [$TRIVY_DEBUG]
--cache-dir value cache directory (default: "/Users/teppei/Library/Caches/trivy") [$TRIVY_CACHE_DIR]
--help, -h show help (default: false)
--version, -v print the version (default: false)
```

View File

@@ -0,0 +1,33 @@
# Repository
```bash
NAME:
trivy repository - scan remote repository
USAGE:
trivy repository [command options] repo_url
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-update skip db update (default: false) [$TRIVY_SKIP_UPDATE]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
--quiet, -q suppress progress bar and log output (default: false) [$TRIVY_QUIET]
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
--skip-files value specify the file path to skip traversal [$TRIVY_SKIP_FILES]
--skip-dirs value specify the directory where the traversal is skipped [$TRIVY_SKIP_DIRS]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,35 @@
# Rootfs
```bash
NAME:
trivy rootfs - scan rootfs
USAGE:
trivy rootfs [command options] dir
OPTIONS:
--template value, -t value output template [$TRIVY_TEMPLATE]
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
--output value, -o value output file name [$TRIVY_OUTPUT]
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
--skip-files value specify the file paths to skip traversal [$TRIVY_SKIP_FILES]
--skip-dirs value specify the directories where the traversal is skipped [$TRIVY_SKIP_DIRS]
--config-policy value specify paths to the Rego policy files directory, applying config files [$TRIVY_CONFIG_POLICY]
--config-data value specify paths from which data for the Rego policies will be recursively loaded [$TRIVY_CONFIG_DATA]
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") [$TRIVY_POLICY_NAMESPACES]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,19 @@
# Server
```bash
NAME:
trivy server - server mode
USAGE:
trivy server [command options] [arguments...]
OPTIONS:
--skip-update skip db update (default: false) [$TRIVY_SKIP_UPDATE]
--download-db-only download/update vulnerability database but don't run a scan (default: false) [$TRIVY_DOWNLOAD_DB_ONLY]
--reset remove all caches and database (default: false) [$TRIVY_RESET]
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
--token value for authentication [$TRIVY_TOKEN]
--token-header value specify a header name for token (default: "Trivy-Token") [$TRIVY_TOKEN_HEADER]
--listen value listen address (default: "localhost:4954") [$TRIVY_LISTEN]
--help, -h show help (default: false)
```

View File

@@ -0,0 +1,10 @@
# Author
[Teppei Fukuda][knqyf263] (knqyf263)
# Contributors
Thanks to all [contributors][contributors]
[knqyf263]: https://github.com/knqyf263
[contributors]: https://github.com/aquasecurity/trivy/graphs/contributors

View File

@@ -0,0 +1,32 @@
# Further Reading
## Presentations
- Aqua Security YouTube Channel
- [Trivy - container image scanning][intro]
- [Using Trivy in client server mode][server]
- [Tweaking Trivy output to fit your workflow][tweaking]
- [How does a vulnerability scanner identify packages?][identify]
- CNCF Webinar 2020
- [Trivy Open Source Scanner for Container Images Just Download and Run!][cncf]
- KubeCon + CloudNativeCon Europe 2020 Virtual
- [Handling Container Vulnerabilities with Open Policy Agent - Teppei Fukuda, Aqua Security][kubecon]
## Blogs
- [Trivy Vulnerability Scanner Joins the Aqua Open-source Family][join]
- [Trivy Image Vulnerability Scanner Now Under Apache 2.0 License][license]
- [DevSecOps with Trivy and GitHub Actions][actions]
- [Find Image Vulnerabilities Using GitHub and Aqua Security Trivy Action][actions2]
- [Using Trivy to Discover Vulnerabilities in VS Code Projects][vscode]
[intro]: https://www.youtube.com/watch?v=AzOBGm7XxOA
[cncf]: https://www.youtube.com/watch?v=XnYxX9uueoQ
[server]: https://www.youtube.com/watch?v=tNQ-VlahtYM
[kubecon]: https://www.youtube.com/watch?v=WKE2XNZ2zr4
[identify]: https://www.youtube.com/watch?v=PaMnzeHBa8M
[tweaking]: https://www.youtube.com/watch?v=wFIGUjcRLnU
[join]: https://blog.aquasec.com/trivy-vulnerability-scanner-joins-aqua-family
[license]: https://blog.aquasec.com/trivy-open-source-vulnerability-scanner-apache2.0-license
[actions]: https://blog.aquasec.com/devsecops-with-trivy-github-actions
[actions2]: https://blog.aquasec.com/github-vulnerability-scanner-trivy
[vscode]: https://blog.aquasec.com/trivy-open-source-vulnerability-scanner-vs-code

View File

@@ -0,0 +1,201 @@
# Installation
## RHEL/CentOS
=== "Repository"
Add repository setting to `/etc/yum.repos.d`.
``` bash
$ sudo vim /etc/yum.repos.d/trivy.repo
[trivy]
name=Trivy repository
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$releasever/$basearch/
gpgcheck=0
enabled=1
$ sudo yum -y update
$ sudo yum -y install trivy
```
=== "RPM"
``` bash
rpm -ivh https://github.com/aquasecurity/trivy/releases/download/{{ git.tag }}/trivy_{{ git.tag[1:] }}_Linux-64bit.rpm
```
## Debian/Ubuntu
=== "Repository"
Add repository setting to `/etc/apt/sources.list.d`.
``` bash
sudo apt-get install wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy
```
=== "DEB"
``` bash
wget https://github.com/aquasecurity/trivy/releases/download/{{ git.tag }}/trivy_{{ git.tag[1:] }}_Linux-64bit.deb
sudo dpkg -i trivy_{{ git.tag[1:] }}_Linux-64bit.deb
```
## Arch Linux
Package trivy-bin can be installed from the Arch User Repository.
=== "pikaur"
``` bash
pikaur -Sy trivy-bin
```
=== "yay"
``` bash
yay -Sy trivy-bin
```
## Homebrew
You can use homebrew on macOS and Linux.
```bash
brew install aquasecurity/trivy/trivy
```
## Nix/NixOS
You can use nix on Linux or macOS and on others unofficially.
Note that trivy is currently only in the unstable channels.
```bash
nix-env --install trivy
```
Or through your configuration on NixOS or with home-manager as usual
## Install Script
This script downloads Trivy binary based on your OS and architecture.
```bash
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin {{ git.tag }}
```
## Binary
Download the archive file for your operating system/architecture from [here](https://github.com/aquasecurity/trivy/releases/tag/{{ git.tag }}).
Unpack the archive, and put the binary somewhere in your `$PATH` (on UNIX-y systems, /usr/local/bin or the like).
Make sure it has execution bits turned on.
## From source
```bash
mkdir -p $GOPATH/src/github.com/aquasecurity
cd $GOPATH/src/github.com/aquasecurity
git clone --depth 1 --branch {{ git.tag }} https://github.com/aquasecurity/trivy
cd trivy/cmd/trivy/
export GO111MODULE=on
go install
```
## Docker
### Docker Hub
Replace [YOUR_CACHE_DIR] with the cache directory on your machine.
```bash
docker pull aquasec/trivy:{{ git.tag[1:] }}
```
Example:
=== "Linux"
``` bash
docker run --rm -v [YOUR_CACHE_DIR]:/root/.cache/ aquasec/trivy:{{ git.tag[1:] }} image [YOUR_IMAGE_NAME]
```
=== "macOS"
``` bash
docker run --rm -v $HOME/Library/Caches:/root/.cache/ aquasec/trivy:{{ git.tag[1:] }} image [YOUR_IMAGE_NAME
```
If you would like to scan the image on your host machine, you need to mount `docker.sock`.
```bash
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/Library/Caches:/root/.cache/ aquasec/trivy:{{ git.tag[1:] }} python:3.4-alpine
```
Please re-pull latest `aquasec/trivy` if an error occurred.
<details>
<summary>Result</summary>
```bash
2019-05-16T01:20:43.180+0900 INFO Updating vulnerability database...
2019-05-16T01:20:53.029+0900 INFO Detecting Alpine vulnerabilities...
python:3.4-alpine3.9 (alpine 3.9.2)
===================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| openssl | CVE-2019-1543 | MEDIUM | 1.1.1a-r1 | 1.1.1b-r1 | openssl: ChaCha20-Poly1305 |
| | | | | | with long nonces |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
```
</details>
### GitHub Container Registry
The same image is hosted on [GitHub Container Registry][registry] as well.
```bash
docker pull ghcr.io/aquasecurity/trivy:{{ git.tag[1:] }}
```
### Amazon ECR Public
The same image is hosted on [Amazon ECR Public][ecr] as well.
```bash
docker pull public.ecr.aws/aquasecurity/trivy:{{ git.tag[1:] }}
```
## Helm
### Installing from the the Aqua Chart Repository
```
helm repo add aquasecurity https://aquasecurity.github.io/helm-charts/
helm repo update
helm search repo trivy
helm install my-trivy aquasecurity/trivy
```
### Installing the Chart
To install the chart with the release name `my-release`:
```
helm install my-release .
```
The command deploys Trivy on the Kubernetes cluster in the default configuration. The [Parameters][helm]
section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`.
[ecr]: https://gallery.ecr.aws/aquasecurity/trivy
[registry]: https://github.com/orgs/aquasecurity/packages/container/package/trivy
[helm]: https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/helm/trivy

View File

@@ -0,0 +1,82 @@
# Overview
Trivy detects two types of security issues:
- [Vulnerabilities][vuln]
- [Misconfigurations][misconf]
Trivy can scan three different artifacts:
- [Container Images][container]
- [Filesystem][filesystem] and [Rootfs][rootfs]
- [Git Repositories][repo]
Trivy can be run in two different modes:
- [Standalone][standalone]
- [Client/Server][client-server]
It is designed to be used in CI. Before pushing to a container registry or deploying your application, you can scan your local container image and other artifacts easily.
See [Integrations][integrations] for details.
## Features
- Comprehensive vulnerability detection
- [OS packages][os] (Alpine, Red Hat Universal Base Image, Red Hat Enterprise Linux, CentOS, AlmaLinux, Rocky Linux, CBL-Mariner, Oracle Linux, Debian, Ubuntu, Amazon Linux, openSUSE Leap, SUSE Enterprise Linux, Photon OS and Distroless)
- [**Language-specific packages**][lang] (Bundler, Composer, Pipenv, Poetry, npm, yarn, Cargo, NuGet, Maven, and Go)
- Detect IaC misconfigurations
- A wide variety of [built-in policies][builtin] are provided **out of the box**:
- Kubernetes
- Docker
- Terraform
- more coming soon
- Support custom policies
- Simple
- Specify only an image name, a directory containing IaC configs, or an artifact name
- See [Quick Start][quickstart]
- Fast
- The first scan will finish within 10 seconds (depending on your network). Consequent scans will finish in single seconds.
- Unlike other scanners that take long to fetch vulnerability information (~10 minutes) on the first run, and encourage you to maintain a durable vulnerability database, Trivy is stateless and requires no maintenance or preparation.
- Easy installation
- `apt-get install`, `yum install` and `brew install` is possible (See [Installation](installation.md))
- **No pre-requisites** such as installation of DB, libraries, etc.
- High accuracy
- **Especially Alpine Linux and RHEL/CentOS**
- Other OSes are also high
- DevSecOps
- **Suitable for CI** such as Travis CI, CircleCI, Jenkins, GitLab CI, etc.
- See [CI Example][integrations]
- Support multiple formats
- container image
- A local image in Docker Engine which is running as a daemon
- A local image in [Podman][podman] (>=2.0) which is exposing a socket
- A remote image in Docker Registry such as Docker Hub, ECR, GCR and ACR
- A tar archive stored in the `docker save` / `podman save` formatted file
- An image directory compliant with [OCI Image Format][oci]
- local filesystem and rootfs
- remote git repository
- SBOM (Software Bill of Materials) support
- CycloneDX
Please see [LICENSE][license] for Trivy licensing information.
[vuln]: ../vulnerability/scanning/index.md
[misconf]: ../misconfiguration/index.md
[container]: ../vulnerability/scanning/image.md
[rootfs]: ../vulnerability/scanning/rootfs.md
[filesystem]: ../vulnerability/scanning/filesystem.md
[repo]: ../vulnerability/scanning/git-repository.md
[standalone]: ../advanced/modes/standalone.md
[client-server]: ../advanced/modes/client-server.md
[integrations]: ../advanced/integrations/index.md
[os]: ../vulnerability/detection/os.md
[lang]: ../vulnerability/detection/language.md
[builtin]: ../misconfiguration/policy/builtin.md
[quickstart]: quickstart.md
[podman]: ../advanced/container/podman.md
[oci]: https://github.com/opencontainers/image-spec
[license]: https://github.com/aquasecurity/trivy/blob/main/LICENSE

View File

@@ -0,0 +1,83 @@
# Quick Start
## Scan image for vulnerabilities
Simply specify an image name (and a tag).
```
$ trivy image [YOUR_IMAGE_NAME]
```
For example:
```
$ trivy image python:3.4-alpine
```
<details>
<summary>Result</summary>
```
2019-05-16T01:20:43.180+0900 INFO Updating vulnerability database...
2019-05-16T01:20:53.029+0900 INFO Detecting Alpine vulnerabilities...
python:3.4-alpine3.9 (alpine 3.9.2)
===================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| openssl | CVE-2019-1543 | MEDIUM | 1.1.1a-r1 | 1.1.1b-r1 | openssl: ChaCha20-Poly1305 |
| | | | | | with long nonces |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
```
</details>
For more details, see [here][vulnerability].
## Scan directory for misconfigurations
Simply specify a directory containing IaC files such as Terraform and Dockerfile.
```
$ trivy config [YOUR_IAC_DIR]
```
For example:
```
$ ls build/
Dockerfile
$ trivy config ./build
```
<details>
<summary>Result</summary>
```
2021-07-09T10:06:29.188+0300 INFO Need to update the built-in policies
2021-07-09T10:06:29.188+0300 INFO Downloading the built-in policies...
2021-07-09T10:06:30.520+0300 INFO Detected config files: 1
Dockerfile (dockerfile)
=======================
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
+---------------------------+------------+----------------------+----------+------------------------------------------+
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
+---------------------------+------------+----------------------+----------+------------------------------------------+
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
| | | | | Dockerfile should not be 'root' |
| | | | | -->avd.aquasec.com/appshield/ds002 |
+---------------------------+------------+----------------------+----------+------------------------------------------+
```
</details>
For more details, see [here][misconf].
[vulnerability]: ../vulnerability/scanning/index.md
[misconf]: ../misconfiguration/index.md

View File

@@ -0,0 +1,133 @@
# Troubleshooting
## Scan
### Timeout
!!! error
``` bash
$ trivy image ...
...
analyze error: timeout: context deadline exceeded
```
Your scan may time out. Java takes a particularly long time to scan. Try increasing the value of the ---timeout option such as `--timeout 15m`.
### Certification
!!! error
Error: x509: certificate signed by unknown authority
`TRIVY_INSECURE` can be used to allow insecure connections to a container registry when using SSL.
```
$ TRIVY_INSECURE=true trivy image [YOUR_IMAGE]
```
### GitHub Rate limiting
!!! error
``` bash
$ trivy image ...
...
API rate limit exceeded for xxx.xxx.xxx.xxx.
```
Specify GITHUB_TOKEN for authentication
https://developer.github.com/v3/#rate-limiting
```
$ GITHUB_TOKEN=XXXXXXXXXX trivy alpine:3.10
```
### Maven rate limiting
!!! error
``` bash
$ trivy image ...
...
status 403 Forbidden from http://search.maven.org/solrsearch/select
```
Trivy calls Maven API for better detection of JAR files, but many requests may exceed rate limiting.
If it happens frequently, try the `--offline-scan` option to stop Trivy from making API requests.
This option affects only vulnerability scanning. The vulnerability database and builtin policies are downloaded as usual.
If you want to skip them as well, you can try `--skip-update` and `--skip-policy-update`.
Note that a number of vulnerabilities might be fewer than without the `--offline-scan` option.
### Running in parallel takes same time as series run
When running trivy on multiple images simultaneously, it will take same time as running trivy in series.
This is because of a limitation of boltdb.
> Bolt obtains a file lock on the data file so multiple processes cannot open the same database at the same time. Opening an already open Bolt database will cause it to hang until the other process closes it.
Reference : [boltdb: Opening a database][boltdb].
[boltdb]: https://github.com/boltdb/bolt#opening-a-database
### Error downloading vulnerability DB
!!! error
FATAL failed to download vulnerability DB
If trivy is running behind corporate firewall, you have to add the following urls to your allowlist.
- ghcr.io
- pkg-containers.githubusercontent.com
### Old DB schema
!!! error
--skip-update cannot be specified with the old DB schema.
Trivy v0.23.0 or later requires Trivy DB v2. Please update your local database or follow [the instruction of air-gapped environment][air-gapped].
## Homebrew
### Scope error
!!! error
Error: Your macOS keychain GitHub credentials do not have sufficient scope!
```
$ brew tap aquasecurity/trivy
Error: Your macOS keychain GitHub credentials do not have sufficient scope!
Scopes they need: none
Scopes they have:
Create a personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
```
Try:
```
$ printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
```
### Already installed
!!! error
Error: aquasecurity/trivy/trivy 64 already installed
```
$ brew upgrade
...
Error: aquasecurity/trivy/trivy 64 already installed
```
Try:
```
$ brew unlink trivy && brew uninstall trivy
($ rm -rf /usr/local/Cellar/trivy/64)
$ brew install aquasecurity/trivy/trivy
```
## Others
### Unknown error
Try again with `--reset` option:
```
$ trivy image --reset
```
[air-gapped]: ../advanced/air-gap.md

BIN
docs/imgs/client-server.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,397 @@
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"id": "ribsikcWWSf8Aw4M6BOYJ",
"type": "rectangle",
"x": 528.53466796875,
"y": 377.9640197753906,
"width": 169.21945190429688,
"height": 104.2457275390625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 698826281,
"version": 274,
"versionNonce": 942385065,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"JinTKutXOSTzURP969rwo"
]
},
{
"id": "GkrbG--OvBT9zJ-w8E5oQ",
"type": "ellipse",
"x": 496.9409637451172,
"y": 63.6944580078125,
"width": 215.20677185058594,
"height": 152.14088439941406,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 995070601,
"version": 595,
"versionNonce": 1870840679,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY"
]
},
{
"id": "KPLvdnBVoU3U5XGhCch-x",
"type": "text",
"x": 585.4711608886719,
"y": 418.1110534667969,
"width": 48,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 938497417,
"version": 119,
"versionNonce": 1368050313,
"isDeleted": false,
"boundElementIds": null,
"text": "Trivy",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "Ry65W-Cczzy8M9JsouEgZ",
"type": "text",
"x": 558.5760498046875,
"y": 114.79718017578125,
"width": 89,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1676815783,
"version": 368,
"versionNonce": 2034482823,
"isDeleted": false,
"boundElementIds": null,
"text": "GitHub\n(trivy-db)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "eJn9MVaNlcyj8-YPfrBSY",
"type": "arrow",
"x": 608.6504180950899,
"y": 218.69285081443215,
"width": 0.45618097890837817,
"height": 154.16252445127046,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1741763111,
"version": 1069,
"versionNonce": 2093125993,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
0.45618097890837817,
154.16252445127046
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "GkrbG--OvBT9zJ-w8E5oQ",
"focus": -0.035986229233252585,
"gap": 2.9120411440381986
},
"endBinding": {
"elementId": "ribsikcWWSf8Aw4M6BOYJ",
"focus": -0.04563780983822369,
"gap": 5.10864450968802
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "2P02jU3j2eEc92lH0YSwm",
"type": "text",
"x": 637.9371185302734,
"y": 248.28482055664062,
"width": 327,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 501371753,
"version": 360,
"versionNonce": 326653351,
"isDeleted": false,
"boundElementIds": null,
"text": "1. Download Trivy DB\n(including vulnerability information)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "zdNQvzJczyD9GSExNdKS1",
"type": "draw",
"x": 513.9153137207031,
"y": 461.14288330078125,
"width": 72.64572143554688,
"height": 72.18890380859375,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1270145927,
"version": 459,
"versionNonce": 1094761993,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
-39.526153564453125,
16.35540771484375
],
[
-32.219512939453125,
72.170166015625
],
[
30.40386962890625,
72.18890380859375
],
[
33.11956787109375,
32.5743408203125
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
},
{
"id": "YK7xYiSKb1RwCCobsRAXm",
"type": "text",
"x": 391.5774230957031,
"y": 541.0142517089844,
"width": 280,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 2027931817,
"version": 510,
"versionNonce": 1538345895,
"isDeleted": false,
"boundElementIds": null,
"text": "3. Traverse directories\nand look for necessary files",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "Z_DiM_TKY2bBa4Q5VEWgI",
"type": "text",
"x": 684.9671020507812,
"y": 621.1561279296875,
"width": 160,
"height": 25,
"angle": 0,
"strokeColor": "#1864ab",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1365660617,
"version": 564,
"versionNonce": 2113117703,
"isDeleted": false,
"boundElementIds": null,
"text": "Local Filesystem",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "kqEATPhet5tYxzkEOFZng",
"type": "text",
"x": 571.0751342773438,
"y": 494.0994567871094,
"width": 254,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 130557095,
"version": 654,
"versionNonce": 2037434313,
"isDeleted": false,
"boundElementIds": null,
"text": "4. Detect security issues",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "K0XdIaMYVmUP2kGc8Oe1O",
"type": "rectangle",
"x": 360.9377136230469,
"y": 357.07373046875,
"width": 495.45401000976557,
"height": 297.8450317382812,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1367853545,
"version": 339,
"versionNonce": 314224297,
"isDeleted": false,
"boundElementIds": null
},
{
"id": "_vOsyHICDRWn01MF3g7rB",
"type": "draw",
"x": 539.7380981445312,
"y": 501.50762939453125,
"width": 16.976165771484375,
"height": 16.45367431640625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1322966281,
"version": 82,
"versionNonce": 244034663,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
6.905059814453125,
-16.45367431640625
],
[
16.976165771484375,
-5.1099853515625
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
}
],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
}

View File

@@ -0,0 +1,504 @@
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"id": "ribsikcWWSf8Aw4M6BOYJ",
"type": "rectangle",
"x": 528.53466796875,
"y": 359.7196350097656,
"width": 169.21945190429688,
"height": 104.2457275390625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 698826281,
"version": 235,
"versionNonce": 865905065,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"JinTKutXOSTzURP969rwo"
]
},
{
"id": "GkrbG--OvBT9zJ-w8E5oQ",
"type": "ellipse",
"x": 382.4654998779297,
"y": 70.28388977050781,
"width": 215.20677185058594,
"height": 152.14088439941406,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 995070601,
"version": 442,
"versionNonce": 1305668297,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY"
]
},
{
"id": "KPLvdnBVoU3U5XGhCch-x",
"type": "text",
"x": 585.4711608886719,
"y": 399.8666687011719,
"width": 48,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 938497417,
"version": 82,
"versionNonce": 463601353,
"isDeleted": false,
"boundElementIds": null,
"text": "Trivy",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "Ry65W-Cczzy8M9JsouEgZ",
"type": "text",
"x": 445.5017395019531,
"y": 121.72871398925781,
"width": 89,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1676815783,
"version": 306,
"versionNonce": 1721298503,
"isDeleted": false,
"boundElementIds": null,
"text": "GitHub\n(trivy-db)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "eJn9MVaNlcyj8-YPfrBSY",
"type": "arrow",
"x": 497.981827043938,
"y": 226.98470679602065,
"width": 90.39040277767413,
"height": 127.08286800676547,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1741763111,
"version": 591,
"versionNonce": 1564262983,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
90.39040277767413,
127.08286800676547
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "GkrbG--OvBT9zJ-w8E5oQ",
"focus": 0.41046776258752976,
"gap": 4.7596344319156
},
"endBinding": {
"elementId": "ribsikcWWSf8Aw4M6BOYJ",
"focus": 0.1341309277800711,
"gap": 5.652060206979513
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "2P02jU3j2eEc92lH0YSwm",
"type": "text",
"x": 181.22366333007812,
"y": 252.094970703125,
"width": 327,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 501371753,
"version": 281,
"versionNonce": 1175555431,
"isDeleted": false,
"boundElementIds": null,
"text": "1. Download Trivy DB\n(including vulnerability information)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "P3WUTj2Q9se-JE7t3AUeq",
"type": "ellipse",
"x": 635.5376052856445,
"y": 68.77783966064453,
"width": 286.11024475097656,
"height": 152.14088439941406,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#228be6",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1633931305,
"version": 684,
"versionNonce": 1011691465,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"JinTKutXOSTzURP969rwo"
]
},
{
"id": "2q_e-oMWU2gv7ZEClixAx",
"type": "text",
"x": 680.7248458862305,
"y": 102.90502166748047,
"width": 186,
"height": 74,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 866083559,
"version": 676,
"versionNonce": 1669555559,
"isDeleted": false,
"boundElementIds": null,
"text": "Container Registry\nor\nContainer Engine",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 67
},
{
"id": "JinTKutXOSTzURP969rwo",
"type": "arrow",
"x": 725.3393330640303,
"y": 216.94283962355922,
"width": 69.9915382406898,
"height": 134.02688987715163,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1348821927,
"version": 938,
"versionNonce": 1580551495,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
-69.9915382406898,
134.02688987715163
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "P3WUTj2Q9se-JE7t3AUeq",
"focus": 0.10510087993199528,
"gap": 1.4587528984692284
},
"endBinding": {
"elementId": "ribsikcWWSf8Aw4M6BOYJ",
"focus": 0.0931277668871816,
"gap": 8.74990550905477
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "kHnEt-AjbEzMxB61VSDc2",
"type": "text",
"x": 723.4168395996094,
"y": 258.063232421875,
"width": 295,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1080814281,
"version": 613,
"versionNonce": 1064224615,
"isDeleted": false,
"boundElementIds": null,
"text": "2. Pull missing layers in cache",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "zdNQvzJczyD9GSExNdKS1",
"type": "draw",
"x": 524.4000854492188,
"y": 435.25982666015625,
"width": 72.64572143554688,
"height": 72.18890380859375,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1270145927,
"version": 331,
"versionNonce": 1090245193,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
-39.526153564453125,
16.35540771484375
],
[
-32.219512939453125,
72.170166015625
],
[
30.40386962890625,
72.18890380859375
],
[
33.11956787109375,
32.5743408203125
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
},
{
"id": "13A9Y6sL_9DQ1KskiX5Oj",
"type": "draw",
"x": 545.8597412109375,
"y": 483.20318603515625,
"width": 25.76263427734375,
"height": 16.2581787109375,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 788909033,
"version": 85,
"versionNonce": 991433415,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
13.24993896484375,
-16.2581787109375
],
[
25.76263427734375,
-5.01812744140625
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
},
{
"id": "YK7xYiSKb1RwCCobsRAXm",
"type": "text",
"x": 261.88555908203125,
"y": 379.65887451171875,
"width": 249,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 2027931817,
"version": 255,
"versionNonce": 809279785,
"isDeleted": false,
"boundElementIds": null,
"text": "3. Analyze layers &\nStore informatin in cache",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "Z_DiM_TKY2bBa4Q5VEWgI",
"type": "text",
"x": 404.58673095703125,
"y": 522.828125,
"width": 144,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1365660617,
"version": 327,
"versionNonce": 2016944615,
"isDeleted": false,
"boundElementIds": null,
"text": "4. Apply layers",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "kqEATPhet5tYxzkEOFZng",
"type": "text",
"x": 598.8711547851562,
"y": 480.22222900390625,
"width": 257,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 130557095,
"version": 539,
"versionNonce": 562048487,
"isDeleted": false,
"boundElementIds": null,
"text": "5. Detect security issues",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
}
],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
}

View File

@@ -0,0 +1,352 @@
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"type": "rectangle",
"version": 573,
"versionNonce": 2034670720,
"isDeleted": false,
"id": "BkXuq_6BxgqZGZWc8oCtu",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 599.211669921875,
"y": 376.32061767578125,
"strokeColor": "#000000",
"backgroundColor": "#fd7e14",
"width": 867.8921508789062,
"height": 151.39703369140625,
"seed": 1632394695,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 572,
"versionNonce": 425683840,
"isDeleted": false,
"id": "YQURTHNPSe05RPSlYRcok",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 983.89404296875,
"y": 399.98724365234375,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 88,
"height": 45,
"seed": 891391049,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 36,
"fontFamily": 1,
"text": "Trivy",
"baseline": 32,
"textAlign": "left",
"verticalAlign": "top"
},
{
"type": "text",
"version": 822,
"versionNonce": 1061096576,
"isDeleted": false,
"id": "6dpF2EyZBtYgO6MrvGj0-",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 771.2554931640625,
"y": 469.7777099609375,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 507,
"height": 35,
"seed": 687997545,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Vulnerability/Misconfiguration Scanner",
"baseline": 25,
"textAlign": "left",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 763,
"versionNonce": 560331648,
"isDeleted": false,
"id": "cpnTMy7L2AUg9IDJppF4H",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 602.28369140625,
"y": 258.8445587158203,
"strokeColor": "#000000",
"backgroundColor": "#fab005",
"width": 397.493408203125,
"height": 103.28388977050778,
"seed": 77164935,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 1072,
"versionNonce": 212434048,
"isDeleted": false,
"id": "9-blmNVtLesthMSY_f60t",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 630.9301147460938,
"y": 292.4002990722656,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 331,
"height": 35,
"seed": 860091815,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Infrastructure as Code",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 1194,
"versionNonce": 131337088,
"isDeleted": false,
"id": "gugZxhi7ThlcjWY_MFO7q",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1021.5928955078125,
"y": 261.56090545654297,
"strokeColor": "#000000",
"backgroundColor": "#be4bdb",
"width": 441.0702514648438,
"height": 99.05134582519533,
"seed": 1232790121,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 1270,
"versionNonce": 591785088,
"isDeleted": false,
"id": "K48gtpesBxIGJxLTnI2CB",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1173.3179931640625,
"y": 294.12510681152344,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 137,
"height": 35,
"seed": 449264361,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Filesystem",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 1319,
"versionNonce": 1264839808,
"isDeleted": false,
"id": "BYJwfkhd1BilbLQGc973f",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1233.3157348632812,
"y": 168.29967880249023,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 229.03393554687523,
"height": 77.80606079101562,
"seed": 1923498546,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 659,
"versionNonce": 2122259328,
"isDeleted": false,
"id": "eedUyCpr8i1aY_3PHsHAB",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1241.1352844238281,
"y": 191.2939567565918,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 216,
"height": 35,
"seed": 595309038,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Misconfiguration",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1397,
"versionNonce": 20077696,
"isDeleted": false,
"id": "SPkrBrH6DGvkgQXtZQjIJ",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1023.8157043457031,
"y": 168.7816276550293,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"width": 200.7496337890626,
"height": 77.80606079101562,
"seed": 1896460914,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 840,
"versionNonce": 655338368,
"isDeleted": false,
"id": "n06MNIqirDmVZBkDg_UPV",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1040.526611328125,
"y": 194.3111228942871,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 160,
"height": 35,
"seed": 1131832750,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Vulnerability",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1441,
"versionNonce": 1393118080,
"isDeleted": false,
"id": "8SHSNGf7PNddFLi2ZA3Vi",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 673.6463928222656,
"y": 167.8159294128418,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 278.48516845703136,
"height": 77.80606079101562,
"seed": 1986948530,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 851,
"versionNonce": 2114620544,
"isDeleted": false,
"id": "3Z5w3RXdgpvP43dlHqq26",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 701.5146789550781,
"y": 189.60757064819336,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 216,
"height": 35,
"seed": 1077804654,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Misconfiguration",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "middle"
}
],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
}

View File

@@ -0,0 +1,508 @@
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"type": "rectangle",
"version": 476,
"versionNonce": 916788210,
"isDeleted": false,
"id": "BkXuq_6BxgqZGZWc8oCtu",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 599.211669921875,
"y": 376.32061767578125,
"strokeColor": "#000000",
"backgroundColor": "#fd7e14",
"width": 1076.4584350585938,
"height": 151.39703369140625,
"seed": 1632394695,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 423,
"versionNonce": 931200686,
"isDeleted": false,
"id": "YQURTHNPSe05RPSlYRcok",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1119.1937866210938,
"y": 403.56756591796875,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 88,
"height": 45,
"seed": 891391049,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 36,
"fontFamily": 1,
"text": "Trivy",
"baseline": 32,
"textAlign": "left",
"verticalAlign": "top"
},
{
"type": "text",
"version": 758,
"versionNonce": 813811122,
"isDeleted": false,
"id": "6dpF2EyZBtYgO6MrvGj0-",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 922.1328735351562,
"y": 470.18975830078125,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 507,
"height": 35,
"seed": 687997545,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Vulnerability/Misconfiguration Scanner",
"baseline": 25,
"textAlign": "left",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 595,
"versionNonce": 1705780846,
"isDeleted": false,
"id": "cpnTMy7L2AUg9IDJppF4H",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 597.4796142578125,
"y": 258.9286651611328,
"strokeColor": "#000000",
"backgroundColor": "#fab005",
"width": 349.1224975585937,
"height": 103.28388977050778,
"seed": 77164935,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 921,
"versionNonce": 929185650,
"isDeleted": false,
"id": "9-blmNVtLesthMSY_f60t",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 655.6057739257812,
"y": 292.4844055175781,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 238,
"height": 35,
"seed": 860091815,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Container Images",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 853,
"versionNonce": 377039022,
"isDeleted": false,
"id": "gugZxhi7ThlcjWY_MFO7q",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 955.929443359375,
"y": 262.11351776123047,
"strokeColor": "#000000",
"backgroundColor": "#be4bdb",
"width": 359.85211181640625,
"height": 99.05134582519533,
"seed": 1232790121,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 1065,
"versionNonce": 126714162,
"isDeleted": false,
"id": "K48gtpesBxIGJxLTnI2CB",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1064.449462890625,
"y": 296.9230194091797,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 137,
"height": 35,
"seed": 449264361,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Filesystem",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 896,
"versionNonce": 585884398,
"isDeleted": false,
"id": "La6f87LDZ0uEIZB947bXo",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1329.0839233398438,
"y": 264.9097213745117,
"strokeColor": "#000000",
"backgroundColor": "#12b886",
"width": 346.5517578125,
"height": 96.3990020751953,
"seed": 2005637801,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 1186,
"versionNonce": 1013615346,
"isDeleted": false,
"id": "aOgRPVQ81jhOfkvzjWTMF",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1392.300048828125,
"y": 294.1288604736328,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"width": 223,
"height": 35,
"seed": 1284472935,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Git Repositories",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "top"
},
{
"type": "rectangle",
"version": 974,
"versionNonce": 1011959534,
"isDeleted": false,
"id": "BYJwfkhd1BilbLQGc973f",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1141.5093994140625,
"y": 171.09759140014648,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 169.93957519531259,
"height": 77.80606079101562,
"seed": 1923498546,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 403,
"versionNonce": 1635608306,
"isDeleted": false,
"id": "eedUyCpr8i1aY_3PHsHAB",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1149.8379821777344,
"y": 197.31159591674805,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 155,
"height": 25,
"seed": 595309038,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 20,
"fontFamily": 1,
"text": "Misconfiguration",
"baseline": 18,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1035,
"versionNonce": 1646453614,
"isDeleted": false,
"id": "SPkrBrH6DGvkgQXtZQjIJ",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 959.9851989746094,
"y": 170.4835319519043,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"width": 169.93957519531259,
"height": 77.80606079101562,
"seed": 1896460914,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 532,
"versionNonce": 1887556210,
"isDeleted": false,
"id": "n06MNIqirDmVZBkDg_UPV",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 988.8137817382812,
"y": 196.69753646850586,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 114,
"height": 25,
"seed": 1131832750,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 20,
"fontFamily": 1,
"text": "Vulnerability",
"baseline": 18,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1072,
"versionNonce": 789595566,
"isDeleted": false,
"id": "0JP6OL7EFfoH4E4vFARFl",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1508.9087371826172,
"y": 170.7038917541504,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 169.93957519531259,
"height": 77.80606079101562,
"seed": 101784622,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 496,
"versionNonce": 1027781682,
"isDeleted": false,
"id": "jRmlh5MZuRKm3FtbC6qdZ",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1517.237319946289,
"y": 196.91789627075195,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 155,
"height": 25,
"seed": 1950385586,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 20,
"fontFamily": 1,
"text": "Misconfiguration",
"baseline": 18,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1133,
"versionNonce": 882335726,
"isDeleted": false,
"id": "EQRF92xU4o9CfeHHvbd-a",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1327.384536743164,
"y": 170.0898323059082,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"width": 169.93957519531259,
"height": 77.80606079101562,
"seed": 1379493486,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 569,
"versionNonce": 184638962,
"isDeleted": false,
"id": "_04YR8geM-ar9vZhNZtSj",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 1356.213119506836,
"y": 196.30383682250977,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 114,
"height": 25,
"seed": 357105522,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 20,
"fontFamily": 1,
"text": "Vulnerability",
"baseline": 18,
"textAlign": "center",
"verticalAlign": "middle"
},
{
"type": "rectangle",
"version": 1215,
"versionNonce": 650195502,
"isDeleted": false,
"id": "8SHSNGf7PNddFLi2ZA3Vi",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 599.9767150878906,
"y": 169.0025749206543,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"width": 344.1738281250001,
"height": 77.80606079101562,
"seed": 1986948530,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": []
},
{
"type": "text",
"version": 680,
"versionNonce": 113561522,
"isDeleted": false,
"id": "3Z5w3RXdgpvP43dlHqq26",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"angle": 0,
"x": 700.3721618652344,
"y": 190.79421615600586,
"strokeColor": "#000000",
"backgroundColor": "#82c91e",
"width": 160,
"height": 35,
"seed": 1077804654,
"groupIds": [],
"strokeSharpness": "sharp",
"boundElementIds": [],
"fontSize": 28,
"fontFamily": 1,
"text": "Vulnerability",
"baseline": 25,
"textAlign": "center",
"verticalAlign": "middle"
}
],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
}

View File

@@ -0,0 +1,631 @@
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"id": "ribsikcWWSf8Aw4M6BOYJ",
"type": "rectangle",
"x": 458.6370544433594,
"y": 379.5105285644531,
"width": 169.21945190429688,
"height": 104.2457275390625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 698826281,
"version": 360,
"versionNonce": 899087049,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"JinTKutXOSTzURP969rwo",
"nXkZQsrtjmNqPM6SmPxrc"
]
},
{
"id": "GkrbG--OvBT9zJ-w8E5oQ",
"type": "ellipse",
"x": 427.04335021972656,
"y": 65.240966796875,
"width": 215.20677185058594,
"height": 152.14088439941406,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#fa5252",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 995070601,
"version": 679,
"versionNonce": 1333899847,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY"
]
},
{
"id": "KPLvdnBVoU3U5XGhCch-x",
"type": "text",
"x": 515.5735473632812,
"y": 419.6575622558594,
"width": 48,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 938497417,
"version": 202,
"versionNonce": 677296553,
"isDeleted": false,
"boundElementIds": null,
"text": "Trivy",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "Ry65W-Cczzy8M9JsouEgZ",
"type": "text",
"x": 488.6784362792969,
"y": 116.34368896484375,
"width": 89,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1676815783,
"version": 451,
"versionNonce": 490852711,
"isDeleted": false,
"boundElementIds": null,
"text": "GitHub\n(trivy-db)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "eJn9MVaNlcyj8-YPfrBSY",
"type": "arrow",
"x": 538.7528045696993,
"y": 220.23935960349465,
"width": 0.45618097890837817,
"height": 154.16252445127046,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1741763111,
"version": 1292,
"versionNonce": 764124297,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
0.45618097890837817,
154.16252445127046
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "GkrbG--OvBT9zJ-w8E5oQ",
"focus": -0.03598869040285281,
"gap": 2.911871895302724
},
"endBinding": {
"elementId": "ribsikcWWSf8Aw4M6BOYJ",
"focus": -0.04563780983822428,
"gap": 5.10864450968802
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "2P02jU3j2eEc92lH0YSwm",
"type": "text",
"x": 190.61294555664062,
"y": 255.17030334472656,
"width": 327,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 501371753,
"version": 569,
"versionNonce": 2012286087,
"isDeleted": false,
"boundElementIds": null,
"text": "1. Download Trivy DB\n(including vulnerability information)",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "YK7xYiSKb1RwCCobsRAXm",
"type": "text",
"x": 588.7474975585938,
"y": 488.1255798339844,
"width": 280,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 2027931817,
"version": 628,
"versionNonce": 30461609,
"isDeleted": false,
"boundElementIds": null,
"text": "3. Traverse directories\nand look for necessary files",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "Z_DiM_TKY2bBa4Q5VEWgI",
"type": "text",
"x": 877.162353515625,
"y": 618.5094604492188,
"width": 160,
"height": 25,
"angle": 0,
"strokeColor": "#1864ab",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1365660617,
"version": 647,
"versionNonce": 760156423,
"isDeleted": false,
"boundElementIds": null,
"text": "Local Filesystem",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
},
{
"id": "K0XdIaMYVmUP2kGc8Oe1O",
"type": "rectangle",
"x": 360.9377136230469,
"y": 357.07373046875,
"width": 695.5669860839844,
"height": 297.8450317382812,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1367853545,
"version": 417,
"versionNonce": 1598611913,
"isDeleted": false,
"boundElementIds": null
},
{
"id": "9cBakj4Z-FKXwYYdweyW1",
"type": "ellipse",
"x": 774.155647277832,
"y": 56.2083175778389,
"width": 215.20677185058594,
"height": 152.14088439941406,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#4c6ef5",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1010956009,
"version": 673,
"versionNonce": 825999529,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"vGa683rpZ9AztfvrVvEyD"
]
},
{
"id": "5y2AKGYkXhCldwQOecwl6",
"type": "text",
"x": 806.7732543945312,
"y": 106.18511658906937,
"width": 147,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1289267591,
"version": 83,
"versionNonce": 1127203721,
"isDeleted": false,
"boundElementIds": null,
"text": "Remote\nGit Repository",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "vGa683rpZ9AztfvrVvEyD",
"type": "arrow",
"x": 884.4609964246083,
"y": 220.86864013003574,
"width": 0.45618097890837817,
"height": 154.16252445127046,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1762737031,
"version": 1200,
"versionNonce": 457627015,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
0.45618097890837817,
154.16252445127046
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "9cBakj4Z-FKXwYYdweyW1",
"focus": -0.022674122391029432,
"gap": 12.541597764893623
},
"endBinding": {
"elementId": "4_okkFmweGK_2DBTmRp4i",
"focus": 0.047202684587572305,
"gap": 3.295263653270979
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "4_okkFmweGK_2DBTmRp4i",
"type": "rectangle",
"x": 796.4703521728516,
"y": 378.3264282345772,
"width": 169.21945190429688,
"height": 104.2457275390625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "#4c6ef5",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 853231143,
"version": 387,
"versionNonce": 1096837737,
"isDeleted": false,
"boundElementIds": [
"eJn9MVaNlcyj8-YPfrBSY",
"JinTKutXOSTzURP969rwo",
"vGa683rpZ9AztfvrVvEyD",
"nXkZQsrtjmNqPM6SmPxrc"
]
},
{
"id": "zvgwnUmSms_XcbMDespIP",
"type": "text",
"x": 847.181640625,
"y": 404.5675476193428,
"width": 72,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1769283399,
"version": 307,
"versionNonce": 1392544935,
"isDeleted": false,
"boundElementIds": null,
"text": "Git\nProject",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "f0kayc0oXZazxPJKizaM1",
"type": "text",
"x": 916.8968811035156,
"y": 253.85886842012405,
"width": 258,
"height": 50,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 49135625,
"version": 649,
"versionNonce": 1150891337,
"isDeleted": false,
"boundElementIds": null,
"text": "2. Clone Git Repository\n to local temp directory",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 43
},
{
"id": "nXkZQsrtjmNqPM6SmPxrc",
"type": "arrow",
"x": 640.9059448242188,
"y": 429.34260255098343,
"width": 146.4581298828125,
"height": 0.93572998046875,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 2075020231,
"version": 93,
"versionNonce": 1421238215,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
146.4581298828125,
-0.93572998046875
]
],
"lastCommittedPoint": null,
"startBinding": {
"elementId": "ribsikcWWSf8Aw4M6BOYJ",
"focus": -0.031650787945314215,
"gap": 13.0494384765625
},
"endBinding": {
"elementId": "4_okkFmweGK_2DBTmRp4i",
"focus": 0.050151997400131744,
"gap": 9.106277465820312
},
"startArrowhead": null,
"endArrowhead": "arrow"
},
{
"id": "OPRFQTrsfmF5a7us-mxkI",
"type": "draw",
"x": 446.98912048339844,
"y": 467.28928834199905,
"width": 72.64572143554688,
"height": 72.18890380859375,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 1541066697,
"version": 504,
"versionNonce": 1115999975,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
-39.526153564453125,
16.35540771484375
],
[
-32.219512939453125,
72.170166015625
],
[
30.40386962890625,
72.18890380859375
],
[
33.11956787109375,
32.5743408203125
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
},
{
"id": "QzKnYI7o5Yxg_7szebL6Z",
"type": "draw",
"x": 472.81190490722656,
"y": 507.65403443574905,
"width": 16.976165771484375,
"height": 16.45367431640625,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "round",
"seed": 2144447815,
"version": 127,
"versionNonce": 807483145,
"isDeleted": false,
"boundElementIds": null,
"points": [
[
0,
0
],
[
6.905059814453125,
-16.45367431640625
],
[
16.976165771484375,
-5.1099853515625
]
],
"lastCommittedPoint": null,
"startBinding": null,
"endBinding": null,
"startArrowhead": null,
"endArrowhead": null
},
{
"id": "qqbEan2u1uU3loTdTvQ4B",
"type": "text",
"x": 376.983642578125,
"y": 561.5254028439522,
"width": 254,
"height": 25,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"strokeSharpness": "sharp",
"seed": 1619652615,
"version": 718,
"versionNonce": 1190681095,
"isDeleted": false,
"boundElementIds": null,
"text": "4. Detect security issues",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "left",
"verticalAlign": "top",
"baseline": 18
}
],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
}
}

BIN
docs/imgs/fs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
docs/imgs/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

42
docs/imgs/logo-white.svg Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="_x30_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="273.277px" height="312.341px" viewBox="0 0 273.277 312.341" enable-background="new 0 0 273.277 312.341"
xml:space="preserve">
<g display="none">
<g display="inline">
<path id="XMLID_238_" fill="#F6921E" d="M754.885-766.991c-21.65-2.012-36.066-7.554-55.471-17.526
c-34.765-17.865-71.511-25.264-109.482-29.708c-7.552-0.884-15.107-1.971-22.551-3.503c-30.631-6.306-41.022-20.345-31.022-50.036
c8.852-26.284,8.129-51.529,4.062-77.9c-3.886-25.202,5.516-42.009,30.232-49.091c26.958-7.724,46.055-23.279,62.176-45.683
c22.552-31.342,50.43-32.387,75.678-2.592c13.29,15.683,24.5,33.868,33.206,52.53c15.16,32.498,33.741,62.384,56.465,90.012
c8.997,10.939,16.637,23.055,24.312,35.009c14.177,22.079,18.196,45.43,4.449,69.026
C812.894-772.342,790.61-767.179,754.885-766.991z"/>
</g>
</g>
<g>
<path fill="#FFFFFF" d="M134.241,178.01c-14.966-6.734-23.812-21.134-23.341-36.425l-31.99-18.474
c-2.386,17.699,1.426,36.211,11.026,52.252c10.219,17.074,24.977,29.791,44.305,37.154V178.01L134.241,178.01z"/>
<path fill="#FFFFFF" d="M134.241,256.256v-39.66c-20.701-7.561-36.56-21.171-47.443-39.355
c-10.295-17.201-14.212-37.138-11.295-56.097l-29.733-17.17C28.736,166.142,66.954,232.356,134.241,256.256z"/>
<path fill="#FFFFFF" d="M138.623,216.235v40.021c66.042-24.455,105.685-90.553,88.941-152.077l-29.572,17.228
c3.69,20.45,0.473,40.386-9.42,57.065C178.408,195.609,160.66,208.469,138.623,216.235z"/>
<path fill="#FFFFFF" d="M162.732,141.756c0.133,14.847-8.593,27.909-24.109,36.253v34.508c20.619-7.517,37.273-19.844,46.802-35.91
c9.226-15.555,12.364-34.116,9.199-53.238L162.732,141.756z"/>
<path fill="#FFFFFF" d="M167.338,88.702c12.474,6.083,22.634,15.828,29.381,28.179c0.089,0.163,0.172,0.332,0.26,0.496
l29.007-16.751c-0.461-0.581-0.905-1.169-1.269-1.758c-10.641-17.213-24.699-30.163-41.784-38.496
c-48.231-23.521-107.332-5.786-135.568,40.317l28.937,16.703C95.95,85.802,135.501,73.176,167.338,88.702z"/>
<path fill="#FFFFFF" d="M114.557,143.696c0.395,12.594,7.426,24.256,19.684,30.297v-18.6L114.557,143.696z"/>
<path fill="#FFFFFF" d="M158.428,139.64c-0.105-0.216-0.208-0.433-0.321-0.645c-2.395-4.49-6.021-8.015-10.487-10.193
c-11.485-5.598-25.573-0.979-32.947,10.739l21.968,12.68L158.428,139.64z"/>
<path fill="#FFFFFF" d="M149.224,125.515c5.164,2.519,9.351,6.585,12.11,11.758c0.094,0.175,0.175,0.358,0.263,0.537l32.213-18.602
c-0.101-0.19-0.198-0.384-0.301-0.572c-6.381-11.683-15.985-20.898-27.774-26.646c-30.119-14.69-67.578-2.707-86.265,27.232
l32.037,18.492C119.857,124.323,136.011,119.072,149.224,125.515z"/>
<path fill="#FFFFFF" d="M264.965,82.39l-34.137,19.888c18.006,64.017-23.286,133.016-92.204,157.866v43.341l126.341-73.633V82.39z"
/>
<path fill="#FFFFFF" d="M8.319,82.347v147.466l125.922,73.672v-43.341c-70.174-24.263-110.029-93.387-91.739-158.058L9.921,83.271
L8.319,82.347z"/>
<path fill="#FFFFFF" d="M138.623,155.413v18.581c12.219-7.071,19.799-18.339,20.386-30.068L138.623,155.413z"/>
<path fill="#FFFFFF" d="M10.129,79.195l3.72,2.148L44.196,98.86c29.195-47.754,90.394-66.13,140.341-41.775
c17.716,8.64,32.282,22.051,43.292,39.859c0.349,0.563,0.835,1.182,1.362,1.832l33.939-19.599L136.643,6.134L10.129,79.195z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
docs/imgs/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
docs/imgs/misconf-demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

BIN
docs/imgs/misconf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
docs/imgs/overview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 KiB

BIN
docs/imgs/repo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

BIN
docs/imgs/vuln-demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
docs/imgs/vulnerability.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 KiB

49
docs/index.md Normal file
View File

@@ -0,0 +1,49 @@
---
hide:
- navigation
- toc
---
![logo](imgs/logo.png){ align=left }
`Trivy` (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a simple and comprehensive [vulnerability][vulnerability]/[misconfiguration][misconf] scanner for containers and other artifacts.
A software vulnerability is a glitch, flaw, or weakness present in the software or in an Operating System.
`Trivy` detects vulnerabilities of [OS packages][os] (Alpine, RHEL, CentOS, etc.) and [language-specific packages][lang] (Bundler, Composer, npm, yarn, etc.).
In addition, `Trivy` scans [Infrastructure as Code (IaC) files][iac] such as Terraform and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack.
`Trivy` is easy to use. Just install the binary and you're ready to scan.
All you need to do for scanning is to specify a target such as an image name of the container.
<div style="text-align: center">
<img src="imgs/overview.png" width="800">
</div>
<div style="text-align: center; margin-top: 150px">
<h1 id="demo">Demo</h1>
</div>
<figure style="text-aligh: center">
<img src="imgs/vuln-demo.gif" width="1000">
<figcaption>Demo: Vulnerability Detection</figcaption>
</figure>
<figure style="text-aligh: center">
<img src="imgs/misconf-demo.gif" width="1000">
<figcaption>Demo: Misconfiguration Detection</figcaption>
</figure>
---
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]
[vulnerability]: vulnerability/scanning/index.md
[misconf]: misconfiguration/index.md
[os]: vulnerability/detection/os.md
[lang]: vulnerability/detection/language.md
[iac]: misconfiguration/iac.md
[aquasec]: https://aquasec.com
[oss]: https://www.aquasec.com/products/open-source-projects/
[discussions]: https://github.com/aquasecurity/trivy/discussions

View File

@@ -0,0 +1,25 @@
# vs cfsec
[cfsec][cfsec] uses static analysis of your CloudFormation templates to spot potential security issues.
Trivy uses cfsec internally to scan both JSON and YAML configuration files, but Trivy doesn't support some features provided by cfsec.
This section describes the differences between Trivy and cfsec.
| Feature | Trivy | cfsec |
| --------------------------- | --------------------------------------- | -------------------- |
| Built-in Policies | :material-check: | :material-check: |
| Custom Policies | Rego[^1] | :material-close: |
| Policy Metadata[^2] | :material-check: | :material-check: |
| Show Successes | :material-check: | :material-check: |
| Disable Policies | :material-check: | :material-check: |
| Show Issue Lines | :material-close: | :material-check: |
| View Statistics | :material-close: | :material-check: |
| Filtering by Severity | :material-check: | :material-close: |
| Supported Formats | Dockerfile, JSON, YAML, Terraform, etc. | CloudFormation JSON and YAML |
[^1]: CloudFormation files are not supported
[^2]: To enrich the results such as ID, Title, Description, Severity, etc.
cfsec is designed for CloudFormation.
People who use only want to scan their CloudFormation templates should use cfsec.
People who want to scan a wide range of configuration files should use Trivy.
[cfsec]: https://github.com/aquasecurity/cfsec

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