mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-06 04:41:18 -08:00
Compare commits
531 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
600819248d | ||
|
|
73734eab21 | ||
|
|
22463ababd | ||
|
|
790c8054ec | ||
|
|
86fec9c4a9 | ||
|
|
26bc91160b | ||
|
|
d699e8c101 | ||
|
|
1777878e83 | ||
|
|
9be08253a2 | ||
|
|
5d73b47dbc | ||
|
|
46e784c8a9 | ||
|
|
0f61a84712 | ||
|
|
8a1aa448a1 | ||
|
|
fbab9eea3a | ||
|
|
f84417bba0 | ||
|
|
85c681d443 | ||
|
|
46748ce6ea | ||
|
|
c6741bddff | ||
|
|
a21acc7e08 | ||
|
|
32a3a3311c | ||
|
|
cbb47dc7c4 | ||
|
|
e3d10d2512 | ||
|
|
e1770e046c | ||
|
|
337c0b70d5 | ||
|
|
5ccee14304 | ||
|
|
96db52c3f6 | ||
|
|
3e902a57a9 | ||
|
|
904f1cf24e | ||
|
|
7d48c5d5d4 | ||
|
|
dcc73e964a | ||
|
|
35c4262d0b | ||
|
|
0e01851e9e | ||
|
|
4d9b444499 | ||
|
|
c29197ab7d | ||
|
|
d7637adc6b | ||
|
|
ef39eeedf3 | ||
|
|
1ce8bb535a | ||
|
|
bc9513fc57 | ||
|
|
aecd2f0bf0 | ||
|
|
2cbf402b6a | ||
|
|
0099b20e31 | ||
|
|
a597a54fb6 | ||
|
|
b453fbec37 | ||
|
|
0e876d5aa0 | ||
|
|
a4f27d24a3 | ||
|
|
9e6411e9f5 | ||
|
|
ef6538a171 | ||
|
|
139f3e1e32 | ||
|
|
479cfdd40e | ||
|
|
9a279fa7bb | ||
|
|
d52b0b7bc0 | ||
|
|
9b531fa27b | ||
|
|
8ca1bfdd23 | ||
|
|
c20d466044 | ||
|
|
52cbe79759 | ||
|
|
4a5b915578 | ||
|
|
56cdc55f77 | ||
|
|
17d753676b | ||
|
|
2796abe1ed | ||
|
|
22a1573807 | ||
|
|
43586659a1 | ||
|
|
5081399659 | ||
|
|
e1a38128ab | ||
|
|
283eef6372 | ||
|
|
bbd7b98741 | ||
|
|
11c81bf2f6 | ||
|
|
2d8d63e61a | ||
|
|
a46839b1ce | ||
|
|
19715f5de8 | ||
|
|
854b63940a | ||
|
|
59e1a86643 | ||
|
|
9ef01133c8 | ||
|
|
dadd1e10c2 | ||
|
|
1a658210a4 | ||
|
|
411862c908 | ||
|
|
62a1aaf031 | ||
|
|
48b2e15c23 | ||
|
|
c15f269a99 | ||
|
|
b6ee08e55d | ||
|
|
d4740401a3 | ||
|
|
4cf2f94d0d | ||
|
|
18ce1c3363 | ||
|
|
87eed38c6c | ||
|
|
b0c591ef66 | ||
|
|
b84b5ecfc2 | ||
|
|
305255a497 | ||
|
|
d586de585e | ||
|
|
de6eef3b00 | ||
|
|
83a9c4a4cf | ||
|
|
537272257b | ||
|
|
6fcd1538d9 | ||
|
|
72e302cf81 | ||
|
|
7e99d08a13 | ||
|
|
12a1789be5 | ||
|
|
919e8c92b2 | ||
|
|
50fe43f14c | ||
|
|
09db1d4389 | ||
|
|
3f0721ff6e | ||
|
|
0ef0dadb16 | ||
|
|
3a7717fdeb | ||
|
|
63cfb2714a | ||
|
|
e1361368a1 | ||
|
|
29b5f7e8ec | ||
|
|
92ed344e8a | ||
|
|
16af41be15 | ||
|
|
cab8569cd7 | ||
|
|
92f9e98d04 | ||
|
|
33fb04763d | ||
|
|
8b162f287f | ||
|
|
3b7c9198dd | ||
|
|
c75d35ff61 | ||
|
|
d298415c09 | ||
|
|
1a56295ff8 | ||
|
|
864ad10a38 | ||
|
|
7a20d96227 | ||
|
|
ea5fd75ffe | ||
|
|
56a01ec6f7 | ||
|
|
6a0e152657 | ||
|
|
50c8b418a9 | ||
|
|
51ca6536c3 | ||
|
|
e5e7ebcdab | ||
|
|
6ee4960776 | ||
|
|
c067b026e0 | ||
|
|
ff6374829a | ||
|
|
0009b02bb8 | ||
|
|
d61ae8cc73 | ||
|
|
636ce808fe | ||
|
|
e859d10eef | ||
|
|
a6ef37fa3d | ||
|
|
dca8c039ed | ||
|
|
b003f58b2c | ||
|
|
86f0016165 | ||
|
|
2f318ce97d | ||
|
|
ec3906c24e | ||
|
|
37b25d28b2 | ||
|
|
45d5edb0d7 | ||
|
|
090a00e717 | ||
|
|
f2188eb56d | ||
|
|
b79850f416 | ||
|
|
36acdfa8db | ||
|
|
55fb723a6e | ||
|
|
9c87cb2710 | ||
|
|
21cf179f6b | ||
|
|
fbf7a77aee | ||
|
|
547391c224 | ||
|
|
882bfdd782 | ||
|
|
949cd10c0c | ||
|
|
93bc162ca5 | ||
|
|
57993ef673 | ||
|
|
dc4baeb359 | ||
|
|
25d0255dc3 | ||
|
|
73e54549f1 | ||
|
|
08de7c613f | ||
|
|
ade4730fa7 | ||
|
|
1be1e2e638 | ||
|
|
45bc9e0de4 | ||
|
|
3334e78fa3 | ||
|
|
27fb1bfdee | ||
|
|
845ae31e5d | ||
|
|
11a5b91a1a | ||
|
|
5eab464987 | ||
|
|
a00d00eb94 | ||
|
|
9bc326909f | ||
|
|
8559841677 | ||
|
|
0650e0e1d5 | ||
|
|
43b6496274 | ||
|
|
9181bc1f70 | ||
|
|
48e021ea6b | ||
|
|
107752df65 | ||
|
|
bd0c60364a | ||
|
|
76662d5dd7 | ||
|
|
be47b688c7 | ||
|
|
cc18f92cf3 | ||
|
|
572a6193e7 | ||
|
|
914c6f0921 | ||
|
|
3f02feeff3 | ||
|
|
57bb77c060 | ||
|
|
b19b56c341 | ||
|
|
b43b19ba54 | ||
|
|
14805002d3 | ||
|
|
83bb97ab13 | ||
|
|
79a1ba32d5 | ||
|
|
ff1c43a791 | ||
|
|
b608b116cc | ||
|
|
2c3b60f4c9 | ||
|
|
a6b8642134 | ||
|
|
90b80662c6 | ||
|
|
dcefc6bf3c | ||
|
|
601e25fb2f | ||
|
|
0bebec19f0 | ||
|
|
707ea94234 | ||
|
|
8e1fe769e4 | ||
|
|
4b36e97dce | ||
|
|
f0df725c5a | ||
|
|
009675c825 | ||
|
|
3ed86aa3d0 | ||
|
|
f31dea4bd6 | ||
|
|
d37c50a2b3 | ||
|
|
693d20516b | ||
|
|
65d89b99d1 | ||
|
|
a119ef86ea | ||
|
|
c8283cebde | ||
|
|
6c8b042548 | ||
|
|
c42f360f57 | ||
|
|
20c21caccf | ||
|
|
54388ffd16 | ||
|
|
99a2519816 | ||
|
|
d113b93139 | ||
|
|
5ab6d25880 | ||
|
|
0767cb8443 | ||
|
|
428ee19cae | ||
|
|
3e00dc346f | ||
|
|
cf2f0b2d1c | ||
|
|
70f507e1af | ||
|
|
befabc6b99 | ||
|
|
ee69abb78f | ||
|
|
8901f7be62 | ||
|
|
4e6bbbc8cc | ||
|
|
d70f346f53 | ||
|
|
3efb2fdeda | ||
|
|
ed590966a3 | ||
|
|
a2f39a34c5 | ||
|
|
5a10631023 | ||
|
|
4072115e5a | ||
|
|
7cad265b7a | ||
|
|
f8b5733112 | ||
|
|
10796a2910 | ||
|
|
abff1398c2 | ||
|
|
b40f60c405 | ||
|
|
67236f6aac | ||
|
|
00de24b16e | ||
|
|
5976d1fa07 | ||
|
|
f14bed4532 | ||
|
|
1ee05189f0 | ||
|
|
0000252ce4 | ||
|
|
ca0d972cdb | ||
|
|
0336555773 | ||
|
|
dd9cd9528f | ||
|
|
edb06826b4 | ||
|
|
c02b15b371 | ||
|
|
63ef760c69 | ||
|
|
3fa703c034 | ||
|
|
4d78747c40 | ||
|
|
67572dff6d | ||
|
|
e76d5ff98a | ||
|
|
011ea60db4 | ||
|
|
6445309de4 | ||
|
|
6e9c2c36da | ||
|
|
18eeea2f62 | ||
|
|
02b6914212 | ||
|
|
79096e1161 | ||
|
|
fc2e80cfe0 | ||
|
|
5f8d69d72e | ||
|
|
7916aafffb | ||
|
|
1b1ed39c7d | ||
|
|
234a360a7a | ||
|
|
b864b3b926 | ||
|
|
ad34c989de | ||
|
|
7148de3252 | ||
|
|
927acf9579 | ||
|
|
33074cfab3 | ||
|
|
ba9b0410c9 | ||
|
|
a754a04e2b | ||
|
|
9e4b57fb43 | ||
|
|
09fd299f96 | ||
|
|
09e13022c2 | ||
|
|
52cbfebcdd | ||
|
|
d6a2d6369a | ||
|
|
a12f58be57 | ||
|
|
ee518350c5 | ||
|
|
3987a679f9 | ||
|
|
2bb25e766b | ||
|
|
00c763bc10 | ||
|
|
cac5881bbb | ||
|
|
bd9c6e613e | ||
|
|
20f10673b9 | ||
|
|
1fac7bf1ba | ||
|
|
aaf265881e | ||
|
|
f8307635ad | ||
|
|
1aa3b7dc28 | ||
|
|
57904c0f97 | ||
|
|
bdccf72338 | ||
|
|
800473a8bc | ||
|
|
e6ab389f9e | ||
|
|
6614398ab4 | ||
|
|
1dc6fee781 | ||
|
|
3357ed096b | ||
|
|
1064636b3d | ||
|
|
60b7ef5a55 | ||
|
|
497c955a4b | ||
|
|
5d54310d76 | ||
|
|
44cf1e2f57 | ||
|
|
743b4b0d97 | ||
|
|
6de43855f8 | ||
|
|
9a0ceef166 | ||
|
|
0501b46d48 | ||
|
|
ee3004d292 | ||
|
|
5c8e604f56 | ||
|
|
bc0836623c | ||
|
|
23cdac02ee | ||
|
|
302c8ae24c | ||
|
|
34120f4201 | ||
|
|
e399ed8439 | ||
|
|
ef7b762e48 | ||
|
|
00daebc161 | ||
|
|
98d1031552 | ||
|
|
b791362871 | ||
|
|
719fdb1b11 | ||
|
|
3ff5699b4b | ||
|
|
33909d9df3 | ||
|
|
d85a3e087b | ||
|
|
551899c24e | ||
|
|
3aaa2cfb75 | ||
|
|
9d1300c3e7 | ||
|
|
793cc43d4c | ||
|
|
6a3294e476 | ||
|
|
e9dc21d88a | ||
|
|
12976d42df | ||
|
|
1dc2b349c6 | ||
|
|
92eaf636ca | ||
|
|
9af436b999 | ||
|
|
88ee68d0c6 | ||
|
|
75c96bd968 | ||
|
|
baea3997d2 | ||
|
|
7ca0db17ea | ||
|
|
866999e454 | ||
|
|
b7bfb9a207 | ||
|
|
9badef27ac | ||
|
|
d856595b8e | ||
|
|
fe7c26a741 | ||
|
|
f251dfc5ce | ||
|
|
9be8062c10 | ||
|
|
370098dbf4 | ||
|
|
32acd293fd | ||
|
|
aa8e185e03 | ||
|
|
86603bb9c5 | ||
|
|
7b1e173f51 | ||
|
|
85d5d61bc7 | ||
|
|
2c17260ba8 | ||
|
|
c54f1aa8f0 | ||
|
|
625ea58122 | ||
|
|
623c7f9432 | ||
|
|
d291c34f51 | ||
|
|
6cac6c917f | ||
|
|
12b563b974 | ||
|
|
72a14c67af | ||
|
|
4c01d73fb7 | ||
|
|
10dd5d1a95 | ||
|
|
439c541fd3 | ||
|
|
200e04a767 | ||
|
|
a533ca87e6 | ||
|
|
4bccbe6e1c | ||
|
|
d0562085df | ||
|
|
f5e65749b4 | ||
|
|
d3da459d45 | ||
|
|
7f8868b7d8 | ||
|
|
364379b7b2 | ||
|
|
0205475fa9 | ||
|
|
e9d2af9174 | ||
|
|
b169424089 | ||
|
|
7bf1e192ec | ||
|
|
023e45b896 | ||
|
|
0fe62a93df | ||
|
|
0373e0822d | ||
|
|
a2e21f9b5c | ||
|
|
7d778b75f7 | ||
|
|
9e9dbea717 | ||
|
|
d99a7b82f7 | ||
|
|
cb5af0b33b | ||
|
|
6eec9ac0a4 | ||
|
|
1eca973cbf | ||
|
|
fb0d8f3f30 | ||
|
|
501d424d1f | ||
|
|
475dc17bc8 | ||
|
|
ed173b8295 | ||
|
|
1b368be367 | ||
|
|
66a83d5cdb | ||
|
|
81bee0f11e | ||
|
|
e1076085d9 | ||
|
|
aaf845d02e | ||
|
|
ed5bb0ba92 | ||
|
|
3158bfe605 | ||
|
|
85b6c4aa15 | ||
|
|
60bddae64c | ||
|
|
e0bb04c915 | ||
|
|
c25e826bb5 | ||
|
|
07ddc85a46 | ||
|
|
e88507c999 | ||
|
|
e2dfee208f | ||
|
|
c575d6f7de | ||
|
|
036d5a8233 | ||
|
|
e6d7f15762 | ||
|
|
a1d4427c8b | ||
|
|
682351a131 | ||
|
|
ff0c4516db | ||
|
|
ee12442b8d | ||
|
|
2033e05b6b | ||
|
|
6bc564e887 | ||
|
|
b3b8d4dd6e | ||
|
|
b88bccae6e | ||
|
|
fbd8a13d54 | ||
|
|
0f545cfa96 | ||
|
|
76c883dc43 | ||
|
|
a8b671bc29 | ||
|
|
a5919ca363 | ||
|
|
89016da21e | ||
|
|
c3759c6d83 | ||
|
|
044fb9761e | ||
|
|
ad2e648b33 | ||
|
|
ad25a776cc | ||
|
|
9039df4993 | ||
|
|
60cf4fe49f | ||
|
|
9470e3cd27 | ||
|
|
d274d1568a | ||
|
|
2a870f8a82 | ||
|
|
5974023b7f | ||
|
|
02aa8c2c50 | ||
|
|
6e6171fead | ||
|
|
066f27792f | ||
|
|
8cc3284106 | ||
|
|
8d71346143 | ||
|
|
5b944d20ac | ||
|
|
9c645b99e2 | ||
|
|
e2cd782d3a | ||
|
|
4813cf5cfd | ||
|
|
025e5099d2 | ||
|
|
4d59a1ef9b | ||
|
|
eaa5bcf7d2 | ||
|
|
a888440922 | ||
|
|
62b369ee39 | ||
|
|
c110c4e028 | ||
|
|
bc759efdc3 | ||
|
|
fe3831e0fe | ||
|
|
b0cebec324 | ||
|
|
a66d3fe3f0 | ||
|
|
5190f9566b | ||
|
|
b00f3c60f6 | ||
|
|
a70f885113 | ||
|
|
1ec1fe64e8 | ||
|
|
68eda79357 | ||
|
|
b95d435a6a | ||
|
|
ac6b7c3354 | ||
|
|
cfabdf9138 | ||
|
|
56e3d8de09 | ||
|
|
bbccb4484a | ||
|
|
e879b0697c | ||
|
|
e92266f2c8 | ||
|
|
01c7fb14bc | ||
|
|
23d0613879 | ||
|
|
407c2407d1 | ||
|
|
93c5d2dc71 | ||
|
|
2809794964 | ||
|
|
08b55c3347 | ||
|
|
52300e6069 | ||
|
|
a7ac6acaa2 | ||
|
|
4436a202ff | ||
|
|
34d505ad14 | ||
|
|
ea956026c8 | ||
|
|
aea298b3dc | ||
|
|
c67fe17b4e | ||
|
|
f907255672 | ||
|
|
8f95743502 | ||
|
|
8744534c28 | ||
|
|
c278d86614 | ||
|
|
fa2281f723 | ||
|
|
a3eece4fef | ||
|
|
7a6cf5a27c | ||
|
|
dd26bd2306 | ||
|
|
cbba6d101a | ||
|
|
fa2e3ac2c1 | ||
|
|
5c434753ce | ||
|
|
d29b0edcc7 | ||
|
|
967e32f4a2 | ||
|
|
947741660b | ||
|
|
97ce61eef0 | ||
|
|
17e13c4dbd | ||
|
|
b1a2c4e9c8 | ||
|
|
bd30e983e3 | ||
|
|
22d92e4ad6 | ||
|
|
531eaa8f06 | ||
|
|
8569d43a7a | ||
|
|
604a73d325 | ||
|
|
7594b1f041 | ||
|
|
fd5cafb26d | ||
|
|
6ab9380b29 | ||
|
|
4a5d64355c | ||
|
|
2206e008ea | ||
|
|
861bc03e2d | ||
|
|
f115895d30 | ||
|
|
cc8cef1936 | ||
|
|
a0033f6b61 | ||
|
|
cb5744dcaf | ||
|
|
1ddd6d30b8 | ||
|
|
30c8d75674 | ||
|
|
8e7b44f720 | ||
|
|
dfff371f84 | ||
|
|
eb571fdc40 | ||
|
|
757178341d | ||
|
|
01df475852 | ||
|
|
6b3be150f1 | ||
|
|
9ebdc51d3a | ||
|
|
42e81ad0a6 | ||
|
|
55ec898953 | ||
|
|
0644ceba1b | ||
|
|
50af7a2f46 | ||
|
|
c455d14209 | ||
|
|
8fb9d31617 | ||
|
|
8562b8cf33 | ||
|
|
aff9a3e0d9 | ||
|
|
001671ed79 | ||
|
|
4e7ab4842c | ||
|
|
a6091a7e43 | ||
|
|
6da148cca8 | ||
|
|
df9cf88163 | ||
|
|
32fe108c0a | ||
|
|
8fcca9c8cf | ||
|
|
02f77bc120 | ||
|
|
aa3ff09ad9 | ||
|
|
f26b45294d | ||
|
|
3b6d7d8cb1 | ||
|
|
e9a2549955 | ||
|
|
3aa19122f4 | ||
|
|
fc820570b7 | ||
|
|
3a1f05e331 | ||
|
|
7912f585a3 | ||
|
|
9468056c0f | ||
|
|
7cc83cc2f6 | ||
|
|
5b975de234 | ||
|
|
b6cef12534 | ||
|
|
07651480fa | ||
|
|
9e649b87b5 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
23
.github/CODEOWNERS
vendored
23
.github/CODEOWNERS
vendored
@@ -1,18 +1,23 @@
|
||||
# Global
|
||||
* @knqyf263
|
||||
|
||||
# Docs
|
||||
/docs/** @knqyf263 @AnaisUrlichs @itaysk
|
||||
/mkdocs.yml @knqyf263 @AnaisUrlichs @itaysk
|
||||
/README.md @knqyf263 @AnaisUrlichs @itaysk
|
||||
|
||||
# Helm chart
|
||||
helm/trivy/ @krol3
|
||||
helm/trivy/ @chen-keinan
|
||||
|
||||
# Misconfiguration scanning
|
||||
examples/misconf/ @owenrumney @liamg @knqyf263
|
||||
docs/docs/misconfiguration @owenrumney @liamg @knqyf263
|
||||
docs/docs/cloud @owenrumney @liamg @knqyf263
|
||||
pkg/fanal/analyzer/config @owenrumney @liamg @knqyf263
|
||||
pkg/fanal/handler/misconf @owenrumney @liamg @knqyf263
|
||||
pkg/cloud @owenrumney @liamg @knqyf263
|
||||
pkg/flag/aws_flags.go @owenrumney @liamg @knqyf263
|
||||
pkg/flag/misconf_flags.go @owenrumney @liamg @knqyf263
|
||||
examples/misconf/ @knqyf263
|
||||
docs/docs/misconfiguration @knqyf263
|
||||
docs/docs/cloud @knqyf263
|
||||
pkg/fanal/analyzer/config @knqyf263
|
||||
pkg/fanal/handler/misconf @knqyf263
|
||||
pkg/cloud @knqyf263
|
||||
pkg/flag/aws_flags.go @knqyf263
|
||||
pkg/flag/misconf_flags.go @knqyf263
|
||||
|
||||
# Kubernetes scanning
|
||||
pkg/k8s/ @josedonizetti @chen-keinan @knqyf263
|
||||
|
||||
122
.github/DISCUSSION_TEMPLATE/bugs.yml
vendored
Normal file
122
.github/DISCUSSION_TEMPLATE/bugs.yml
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
labels: ["kind/bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
#### Note
|
||||
Feel free to raise a bug report if something doesn't work as expected.
|
||||
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
|
||||
If you see any false positives or false negatives, please file a ticket [here](https://github.com/aquasecurity/trivy/discussions/new?category=false-detection).
|
||||
|
||||
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Briefly describe the problem you are having in a few paragraphs.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Desired Behavior
|
||||
description: What did you expect to happen?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual Behavior
|
||||
description: What happened instead?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Reproduction Steps
|
||||
description: How do you trigger this bug? Please walk us through it step by step.
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
...
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Target
|
||||
description: Which target are you scanning? It is equal to which subcommand you are using.
|
||||
options:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git Repository
|
||||
- Virtual Machine Image
|
||||
- Kubernetes
|
||||
- AWS
|
||||
- SBOM
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Scanner
|
||||
description: Which scanner are you using?
|
||||
options:
|
||||
- Vulnerability
|
||||
- Misconfiguration
|
||||
- Secret
|
||||
- License
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Output Format
|
||||
description: Which output format are you using?
|
||||
options:
|
||||
- Table
|
||||
- JSON
|
||||
- Template
|
||||
- SARIF
|
||||
- CycloneDX
|
||||
- SPDX
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Mode
|
||||
description: Which mode are you using? Specify "Standalone" if you are not using `trivy server`.
|
||||
options:
|
||||
- Standalone
|
||||
- Client/Server
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Debug Output
|
||||
description: Output of run with `--debug`
|
||||
placeholder: "$ trivy <target> <subject> --debug"
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: On what operating system are you running Trivy?
|
||||
placeholder: "e.g. macOS Big Sur"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Version
|
||||
description: Output of `trivy --version`
|
||||
placeholder: "$ trivy --version"
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
description: Have you tried the following?
|
||||
options:
|
||||
- label: Run `trivy --reset`
|
||||
- label: Read [the troubleshooting](https://aquasecurity.github.io/trivy/latest/docs/references/troubleshooting/)
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
|
||||
28
.github/DISCUSSION_TEMPLATE/documentation.yml
vendored
Normal file
28
.github/DISCUSSION_TEMPLATE/documentation.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
labels: ["kind/documentation"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
#### Note
|
||||
Feel free to create a docs report if something doesn't work as expected or is unclear in the documentation.
|
||||
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
|
||||
|
||||
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Briefly describe the what has been unclear in the existing documentation
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Link
|
||||
description: Please provide a link to the current documentation or where you thought to find the information you were looking for
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Suggestions
|
||||
description: What would you like to have added or changed in the documentation?
|
||||
validations:
|
||||
required: true
|
||||
94
.github/DISCUSSION_TEMPLATE/false-detection.yml
vendored
Normal file
94
.github/DISCUSSION_TEMPLATE/false-detection.yml
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
#### Note
|
||||
Feel free to raise a bug report if something doesn't work as expected.
|
||||
Please ensure that you're not creating a duplicate report by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
|
||||
|
||||
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
|
||||
- type: input
|
||||
attributes:
|
||||
label: IDs
|
||||
description: List the IDs of vulnerabilities, misconfigurations, secrets, or licenses that are either not detected or mistakenly detected.
|
||||
placeholder: "e.g. CVE-2021-44228, CVE-2022-22965"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe the false detection.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Reproduction Steps
|
||||
description: How do you trigger this bug? Please walk us through it step by step.
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
...
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Target
|
||||
description: Which target are you scanning? It is equal to which subcommand you are using.
|
||||
options:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git Repository
|
||||
- Virtual Machine Image
|
||||
- Kubernetes
|
||||
- AWS
|
||||
- SBOM
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Scanner
|
||||
description: Which scanner are you using?
|
||||
options:
|
||||
- Vulnerability
|
||||
- Misconfiguration
|
||||
- Secret
|
||||
- License
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Target OS
|
||||
description: What operating system are you scanning? Fill in this field if the scanning target is an operating system.
|
||||
placeholder: "Example: Ubuntu 22.04"
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Debug Output
|
||||
description: Output of run with `--debug`
|
||||
placeholder: "$ trivy <target> <subject> --debug"
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Version
|
||||
description: Output of `trivy --version`
|
||||
placeholder: "$ trivy --version"
|
||||
render: bash
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
options:
|
||||
- label: Read [the documentation regarding wrong detection](https://aquasecurity.github.io/trivy/dev/community/contribute/discussion/#false-detection)
|
||||
- label: Ran Trivy with `-f json` that shows data sources and confirmed that the security advisory in data sources was correct
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
|
||||
45
.github/DISCUSSION_TEMPLATE/ideas.yml
vendored
Normal file
45
.github/DISCUSSION_TEMPLATE/ideas.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
labels: ["kind/feature"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
#### Note
|
||||
Feel free to share your idea.
|
||||
Please ensure that you're not creating a duplicate ticket by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
|
||||
|
||||
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe your idea.
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Target
|
||||
description: Which target is your idea related to?
|
||||
options:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git Repository
|
||||
- Virtual Machine Image
|
||||
- Kubernetes
|
||||
- AWS
|
||||
- SBOM
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Scanner
|
||||
description: Which scanner is your idea related to?
|
||||
options:
|
||||
- Vulnerability
|
||||
- Misconfiguration
|
||||
- Secret
|
||||
- License
|
||||
validations:
|
||||
required: false
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
|
||||
82
.github/DISCUSSION_TEMPLATE/q-a.yml
vendored
Normal file
82
.github/DISCUSSION_TEMPLATE/q-a.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
labels: ["triage/support"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
#### Note
|
||||
If you have any troubles/questions, feel free to ask.
|
||||
Please ensure that you're not asking a duplicate question by searching the [issues](https://github.com/aquasecurity/trivy/issues)/[discussions](https://github.com/aquasecurity/trivy/discussions) beforehand.
|
||||
|
||||
Please also check [our contribution guidelines](https://aquasecurity.github.io/trivy/latest/community/contribute/discussion/).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Question
|
||||
description: What kind of problem are you facing? Or, what questions do you have?
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Target
|
||||
description: Which target are you scanning? It is equal to which subcommand you are using.
|
||||
options:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git Repository
|
||||
- Virtual Machine Image
|
||||
- Kubernetes
|
||||
- AWS
|
||||
- SBOM
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Scanner
|
||||
description: Which scanner are you using?
|
||||
options:
|
||||
- Vulnerability
|
||||
- Misconfiguration
|
||||
- Secret
|
||||
- License
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Output Format
|
||||
description: Which output format are you using?
|
||||
options:
|
||||
- Table
|
||||
- JSON
|
||||
- Template
|
||||
- SARIF
|
||||
- CycloneDX
|
||||
- SPDX
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Mode
|
||||
description: Which mode are you using? Specify "Standalone" if you are not using `trivy server`.
|
||||
options:
|
||||
- Standalone
|
||||
- Client/Server
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: What operating system are you using?
|
||||
placeholder: "Example: macOS Big Sur"
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Version
|
||||
description: Output of `trivy --version`
|
||||
placeholder: "$ trivy --version"
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
|
||||
53
.github/DISCUSSION_TEMPLATE/show-and-tell.yml
vendored
Normal file
53
.github/DISCUSSION_TEMPLATE/show-and-tell.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
title: "<company name> "
|
||||
labels: ["adopters"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: links
|
||||
attributes:
|
||||
label: "Share Links"
|
||||
description: "If you would like to share a link to your project or company, please paste it below 🌐"
|
||||
value: |
|
||||
...
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: logo
|
||||
attributes:
|
||||
label: "Share Logo"
|
||||
description: "If you have a link to your logo, please provide it in the following text-box 🌐"
|
||||
value: |
|
||||
...
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Please select all the scan targets that you are using
|
||||
options:
|
||||
- label: Container Images
|
||||
- label: Filesystem
|
||||
- label: Git Repository
|
||||
- label: Virtual Machine Images
|
||||
- label: Kubernetes
|
||||
- label: AWS
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Which scanners are you using on those scan targets?
|
||||
options:
|
||||
- label: OS packages and software dependencies in use (SBOM)
|
||||
- label: Known vulnerabilities (CVEs)
|
||||
- label: IaC issues and misconfigurations
|
||||
- label: Sensitive information and secrets
|
||||
- label: Software licenses
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: info
|
||||
attributes:
|
||||
label: "Additional Information"
|
||||
description: "Please tell us more about your use case of Trivy -- anything that you would like to share 🎉"
|
||||
value: |
|
||||
...
|
||||
validations:
|
||||
required: false
|
||||
31
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
31
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@@ -1,31 +0,0 @@
|
||||
---
|
||||
name: Bug Report
|
||||
labels: kind/bug
|
||||
about: If something isn't working as expected.
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!--
|
||||
Briefly describe the problem you are having in a few paragraphs.
|
||||
-->
|
||||
|
||||
## What did you expect to happen?
|
||||
|
||||
|
||||
## What happened instead?
|
||||
|
||||
|
||||
## Output of run with `-debug`:
|
||||
|
||||
```
|
||||
(paste your output here)
|
||||
```
|
||||
|
||||
## Output of `trivy -v`:
|
||||
|
||||
```
|
||||
(paste your output here)
|
||||
```
|
||||
|
||||
## Additional details (base image name, container registry info...):
|
||||
9
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
9
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
@@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Feature Request
|
||||
labels: kind/feature
|
||||
about: I have a suggestion (and might want to implement myself)!
|
||||
---
|
||||
|
||||
<!--
|
||||
If this is a FEATURE REQUEST, request format does not matter!
|
||||
-->
|
||||
10
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
10
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Support Question
|
||||
labels: triage/support
|
||||
about: If you have a question about Trivy.
|
||||
---
|
||||
|
||||
<!--
|
||||
If you have a trouble, feel free to ask.
|
||||
Make sure you're not asking duplicate question by searching on the issues lists.
|
||||
-->
|
||||
33
.github/ISSUE_TEMPLATE/WRONG_DETECTION.md
vendored
33
.github/ISSUE_TEMPLATE/WRONG_DETECTION.md
vendored
@@ -1,33 +0,0 @@
|
||||
---
|
||||
name: Wrong Detection
|
||||
labels: ["kind/bug"]
|
||||
about: If Trivy doesn't detect something, or shows false positive detection
|
||||
---
|
||||
|
||||
## Checklist
|
||||
- [ ] I've read [the documentation regarding wrong detection](https://aquasecurity.github.io/trivy/latest/community/contribute/issue/#wrong-detection).
|
||||
- [ ] I've confirmed that a security advisory in data sources was correct.
|
||||
- Run Trivy with `-f json` that shows data sources and make sure that the security advisory is correct.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
<!--
|
||||
Briefly describe the CVE that aren't detected and information about artifacts with this CVE.
|
||||
-->
|
||||
|
||||
## JSON Output of run with `-debug`:
|
||||
|
||||
```
|
||||
(paste your output here)
|
||||
```
|
||||
|
||||
## Output of `trivy -v`:
|
||||
|
||||
```
|
||||
(paste your output here)
|
||||
```
|
||||
|
||||
## Additional details (base image name, container registry info...):
|
||||
|
||||
|
||||
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Report a false detection
|
||||
url: https://github.com/aquasecurity/trivy/discussions/new?category=false-detection
|
||||
about: Report false positives/negatives
|
||||
- name: Report a bug
|
||||
url: https://github.com/aquasecurity/trivy/discussions/new?category=bugs
|
||||
about: Report bugs
|
||||
- name: Enhance documentation
|
||||
url: https://github.com/aquasecurity/trivy/discussions/new?category=documentation
|
||||
about: Make suggestions to the documentation
|
||||
- name: Request a feature enhancement
|
||||
url: https://github.com/aquasecurity/trivy/discussions/new?category=ideas
|
||||
about: Share ideas for new features
|
||||
- name: Ask the community for help
|
||||
url: https://github.com/aquasecurity/trivy/discussions/new?category=q-a
|
||||
about: Ask questions and discuss with other community members
|
||||
12
.github/workflows/bypass-cla.yaml
vendored
Normal file
12
.github/workflows/bypass-cla.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# This workflow is used to bypass the required status checks in merge queue.
|
||||
# cf. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks
|
||||
name: CLA
|
||||
on:
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
cla:
|
||||
name: license/cla
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: 'echo "No test required"'
|
||||
31
.github/workflows/bypass-test.yaml
vendored
Normal file
31
.github/workflows/bypass-test.yaml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# This workflow is used to bypass the required status checks.
|
||||
# cf. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
- 'LICENSE'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
- 'LICENSE'
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- run: 'echo "No test required"'
|
||||
|
||||
integration:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: 'echo "No test required"'
|
||||
5
.github/workflows/canary.yaml
vendored
5
.github/workflows/canary.yaml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
- 'main'
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'go.mod'
|
||||
- 'Dockerfile.canary'
|
||||
- '.github/workflows/canary.yaml'
|
||||
workflow_dispatch:
|
||||
@@ -15,7 +16,7 @@ jobs:
|
||||
uses: ./.github/workflows/reusable-release.yaml
|
||||
with:
|
||||
goreleaser_config: goreleaser-canary.yml
|
||||
goreleaser_options: '--snapshot --rm-dist --timeout 60m' # will not release
|
||||
goreleaser_options: '--snapshot --clean --timeout 60m' # will not release
|
||||
secrets: inherit
|
||||
|
||||
upload-binaries:
|
||||
@@ -24,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.0.9
|
||||
uses: actions/cache@v3.3.1
|
||||
with:
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
|
||||
4
.github/workflows/mkdocs-dev.yaml
vendored
4
.github/workflows/mkdocs-dev.yaml
vendored
@@ -9,10 +9,10 @@ on:
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy the dev documentation
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
4
.github/workflows/mkdocs-latest.yaml
vendored
4
.github/workflows/mkdocs-latest.yaml
vendored
@@ -11,10 +11,10 @@ on:
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy the latest documentation
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
10
.github/workflows/publish-chart.yaml
vendored
10
.github/workflows/publish-chart.yaml
vendored
@@ -22,11 +22,11 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@b5b231a831f96336bbfeccc1329990f0005c5bb1
|
||||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78
|
||||
with:
|
||||
version: v3.5.0
|
||||
- name: Set up python
|
||||
@@ -35,9 +35,9 @@ jobs:
|
||||
python-version: 3.7
|
||||
- name: Setup Chart Linting
|
||||
id: lint
|
||||
uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec
|
||||
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76
|
||||
- name: Setup Kubernetes cluster (KIND)
|
||||
uses: helm/kind-action@9e8295d178de23cbfbd8fa16cf844eec1d773a07
|
||||
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
image: ${{ env.KIND_IMAGE }}
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install chart-releaser
|
||||
|
||||
12
.github/workflows/release.yaml
vendored
12
.github/workflows/release.yaml
vendored
@@ -10,21 +10,21 @@ jobs:
|
||||
uses: ./.github/workflows/reusable-release.yaml
|
||||
with:
|
||||
goreleaser_config: goreleaser.yml
|
||||
goreleaser_options: '--rm-dist --timeout 90m'
|
||||
goreleaser_options: '--clean --timeout 90m'
|
||||
secrets: inherit
|
||||
|
||||
deploy-packages:
|
||||
name: Deploy rpm/dep packages
|
||||
needs: release # run this job after 'release' job completes
|
||||
runs-on: ubuntu-18.04 # 20.04 doesn't provide createrepo for now
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.0.9
|
||||
uses: actions/cache@v3.3.1
|
||||
with:
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
@@ -32,10 +32,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install rpm reprepro createrepo distro-info
|
||||
sudo apt-get -y install rpm reprepro createrepo-c distro-info
|
||||
|
||||
- name: Checkout trivy-repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/trivy-repo
|
||||
path: trivy-repo
|
||||
|
||||
33
.github/workflows/reusable-release.yaml
vendored
33
.github/workflows/reusable-release.yaml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
contents: read # Not required for public repositories, but for clarity
|
||||
steps:
|
||||
- name: Cosign install
|
||||
uses: sigstore/cosign-installer@ced07f21fb1da67979f539bbc6304c16c0677e76
|
||||
uses: sigstore/cosign-installer@ef0e9691595ea19ec990a46b1a591dcafe568f34
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -60,34 +60,47 @@ jobs:
|
||||
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Generate SBOM
|
||||
uses: CycloneDX/gh-gomod-generate-sbom@v1
|
||||
uses: CycloneDX/gh-gomod-generate-sbom@v2
|
||||
with:
|
||||
args: mod -licenses -json -output bom.json
|
||||
version: ^v1
|
||||
|
||||
- name: "save gpg key"
|
||||
env:
|
||||
GPG_KEY: ${{ secrets.GPG_KEY }}
|
||||
run: |
|
||||
echo "$GPG_KEY" > gpg.key
|
||||
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v3
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
version: v1.4.1
|
||||
version: v1.16.2
|
||||
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
NFPM_DEFAULT_RPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
GPG_FILE: "gpg.key"
|
||||
|
||||
## push images to registries
|
||||
## only for canary build
|
||||
- name: "remove gpg key"
|
||||
run: |
|
||||
rm gpg.key
|
||||
|
||||
# Push images to registries (only for canary build)
|
||||
# The custom Dockerfile.canary is necessary
|
||||
# because GoReleaser Free doesn't support pushing images with the `--snapshot` flag.
|
||||
- name: Build and push
|
||||
if: ${{ inputs.goreleaser_config == 'goreleaser-canary.yml' }}
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
platforms: linux/amd64, linux/arm64
|
||||
file: ./Dockerfile.canary # path to Dockerfile
|
||||
@@ -99,7 +112,7 @@ jobs:
|
||||
public.ecr.aws/aquasecurity/trivy:canary
|
||||
|
||||
- name: Cache Trivy binaries
|
||||
uses: actions/cache@v3.0.9
|
||||
uses: actions/cache@v3.3.1
|
||||
with:
|
||||
path: dist/
|
||||
# use 'github.sha' to create a unique cache folder for each run.
|
||||
|
||||
79
.github/workflows/roadmap.yaml
vendored
Normal file
79
.github/workflows/roadmap.yaml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: Add issues to the roadmap project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
add-issue-to-roadmap-project:
|
||||
name: Add issue to the roadmap project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 'kind/feature' AND 'priority/backlog' labels -> 'Backlog' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
labeled: kind/feature, priority/backlog
|
||||
label-operator: AND
|
||||
id: add-backlog-issue
|
||||
- uses: titoportas/update-project-fields@v0.1.0 # change Priority(column) of added issue
|
||||
if: ${{ steps.add-backlog-issue.outputs.itemId }}
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
item-id: ${{ steps.add-backlog-issue.outputs.itemId }} # Use the item-id output of the previous step
|
||||
field-keys: Priority
|
||||
field-values: Backlog
|
||||
|
||||
# 'kind/feature' AND 'priority/important-longterm' labels -> 'Important (long-term)' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
labeled: kind/feature, priority/important-longterm
|
||||
label-operator: AND
|
||||
id: add-longterm-issue
|
||||
- uses: titoportas/update-project-fields@v0.1.0 # change Priority(column) of added issue
|
||||
if: ${{ steps.add-longterm-issue.outputs.itemId }}
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
item-id: ${{ steps.add-longterm-issue.outputs.itemId }} # Use the item-id output of the previous step
|
||||
field-keys: Priority
|
||||
field-values: Important (long-term)
|
||||
|
||||
# 'kind/feature' AND 'priority/important-soon' labels -> 'Important (soon)' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
labeled: kind/feature, priority/important-soon
|
||||
label-operator: AND
|
||||
id: add-soon-issue
|
||||
- uses: titoportas/update-project-fields@v0.1.0 # change Priority(column) of added issue
|
||||
if: ${{ steps.add-soon-issue.outputs.itemId }}
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
item-id: ${{ steps.add-soon-issue.outputs.itemId }} # Use the item-id output of the previous step
|
||||
field-keys: Priority
|
||||
field-values: Important (soon)
|
||||
|
||||
# 'kind/feature' AND 'priority/critical-urgent' labels -> 'Urgent' column
|
||||
- uses: actions/add-to-project@v0.4.1 # add new issue to project
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
labeled: kind/feature, priority/critical-urgent
|
||||
label-operator: AND
|
||||
id: add-urgent-issue
|
||||
- uses: titoportas/update-project-fields@v0.1.0 # change Priority(column) of added issue
|
||||
if: ${{ steps.add-urgent-issue.outputs.itemId }}
|
||||
with:
|
||||
project-url: https://github.com/orgs/aquasecurity/projects/25
|
||||
github-token: ${{ secrets.ORG_PROJECT_TOKEN }}
|
||||
item-id: ${{ steps.add-urgent-issue.outputs.itemId }} # Use the item-id output of the previous step
|
||||
field-keys: Priority
|
||||
field-values: Urgent
|
||||
6
.github/workflows/scan.yaml
vendored
6
.github/workflows/scan.yaml
vendored
@@ -10,14 +10,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Run Trivy vulnerability scanner and create GitHub issues
|
||||
uses: knqyf263/trivy-issue-action@v0.0.4
|
||||
uses: knqyf263/trivy-issue-action@v0.0.5
|
||||
with:
|
||||
assignee: knqyf263
|
||||
severity: CRITICAL
|
||||
skip-dirs: integration,examples
|
||||
skip-dirs: integration,examples,pkg
|
||||
label: kind/security
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
22
.github/workflows/semantic-pr.yaml
vendored
22
.github/workflows/semantic-pr.yaml
vendored
@@ -12,11 +12,11 @@ jobs:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v4
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
types:
|
||||
types: |
|
||||
feat
|
||||
fix
|
||||
docs
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
revert
|
||||
BREAKING
|
||||
|
||||
scopes:
|
||||
scopes: |
|
||||
vuln
|
||||
misconf
|
||||
secret
|
||||
@@ -42,8 +42,12 @@ jobs:
|
||||
sbom
|
||||
server
|
||||
k8s
|
||||
aws
|
||||
vm
|
||||
|
||||
alpine
|
||||
wolfi
|
||||
chainguard
|
||||
redhat
|
||||
alma
|
||||
rocky
|
||||
@@ -55,6 +59,7 @@ jobs:
|
||||
suse
|
||||
photon
|
||||
distroless
|
||||
windows
|
||||
|
||||
ruby
|
||||
php
|
||||
@@ -65,8 +70,10 @@ jobs:
|
||||
java
|
||||
go
|
||||
c
|
||||
c++
|
||||
|
||||
c\+\+
|
||||
elixir
|
||||
dart
|
||||
|
||||
os
|
||||
lang
|
||||
|
||||
@@ -82,11 +89,12 @@ jobs:
|
||||
|
||||
cli
|
||||
flag
|
||||
|
||||
|
||||
cyclonedx
|
||||
spdx
|
||||
purl
|
||||
|
||||
helm
|
||||
report
|
||||
db
|
||||
deps
|
||||
deps
|
||||
|
||||
2
.github/workflows/stale-issues.yaml
vendored
2
.github/workflows/stale-issues.yaml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
timeout-minutes: 1
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v6
|
||||
- uses: actions/stale@v8
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been labeled with inactivity.'
|
||||
|
||||
28
.github/workflows/test-docs.yaml
vendored
Normal file
28
.github/workflows/test-docs.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Test docs
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
jobs:
|
||||
build-documents:
|
||||
name: Documentation Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3.5.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r docs/build/requirements.txt
|
||||
- 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
|
||||
174
.github/workflows/test.yaml
vendored
174
.github/workflows/test.yaml
vendored
@@ -1,27 +1,35 @@
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches-ignore:
|
||||
- 'main'
|
||||
- 'gh-readonly-queue/**'
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
- 'LICENSE'
|
||||
pull_request:
|
||||
env:
|
||||
TINYGO_VERSION: "0.25.0"
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
- 'LICENSE'
|
||||
merge_group:
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
go-version: oldstable
|
||||
|
||||
- name: go mod tidy
|
||||
run: |
|
||||
@@ -30,106 +38,146 @@ jobs:
|
||||
echo "Run 'go mod tidy' and push it"
|
||||
exit 1
|
||||
fi
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3.2.0
|
||||
uses: golangci/golangci-lint-action@v3.6.0
|
||||
with:
|
||||
version: v1.49
|
||||
version: v1.52
|
||||
args: --deadline=30m
|
||||
skip-cache: true # https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052197778
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Install TinyGo
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.1.2
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
aqua_opts: ""
|
||||
|
||||
- name: Check if CLI references are up-to-date
|
||||
run: |
|
||||
wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb
|
||||
sudo dpkg -i tinygo_${TINYGO_VERSION}_amd64.deb
|
||||
mage docs:generate
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Run 'mage docs:generate' and push it"
|
||||
exit 1
|
||||
fi
|
||||
if: matrix.operating-system == 'ubuntu-latest'
|
||||
|
||||
- name: Run unit tests
|
||||
run: make test
|
||||
run: mage test:unit
|
||||
|
||||
integration:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.1.2
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
- name: Run integration tests
|
||||
run: make test-integration
|
||||
run: mage test:integration
|
||||
|
||||
k8s-integration:
|
||||
name: K8s Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.1.2
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
- name: Run k8s integration tests
|
||||
run: mage test:k8s
|
||||
|
||||
module-test:
|
||||
name: Module Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install TinyGo
|
||||
run: |
|
||||
wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb
|
||||
sudo dpkg -i tinygo_${TINYGO_VERSION}_amd64.deb
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.1.2
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
|
||||
- name: Run module integration tests
|
||||
shell: bash
|
||||
run: |
|
||||
make test-module-integration
|
||||
mage test:module
|
||||
|
||||
vm-test:
|
||||
name: VM Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- name: Install tools
|
||||
uses: aquaproj/aqua-installer@v2.1.2
|
||||
with:
|
||||
aqua_version: v1.25.0
|
||||
- name: Run vm integration tests
|
||||
run: |
|
||||
mage test:vm
|
||||
|
||||
build-test:
|
||||
name: Build Test
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Show available Docker Buildx platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v3
|
||||
with:
|
||||
version: v1.4.1
|
||||
args: release --skip-sign --snapshot --rm-dist --skip-publish --timeout 90m
|
||||
- name: Determine GoReleaser ID
|
||||
id: goreleaser_id
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ matrix.operating-system }}" == "windows-latest" ]; then
|
||||
echo "id=--id build-windows" >> $GITHUB_OUTPUT
|
||||
elif [ "${{ matrix.operating-system }}" == "macos-latest" ]; then
|
||||
echo "id=--id build-macos --id build-bsd" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "id=--id build-linux" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build-documents:
|
||||
name: Documentation Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r docs/build/requirements.txt
|
||||
- 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
|
||||
version: v1.16.2
|
||||
args: build --snapshot --clean --timeout 90m ${{ steps.goreleaser_id.outputs.id }}
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -25,6 +25,7 @@ thumbs.db
|
||||
# test fixtures
|
||||
coverage.txt
|
||||
integration/testdata/fixtures/images
|
||||
integration/testdata/fixtures/vm-images
|
||||
|
||||
# SBOMs generated during CI
|
||||
/bom.json
|
||||
@@ -34,3 +35,7 @@ dist
|
||||
|
||||
# WebAssembly
|
||||
*.wasm
|
||||
|
||||
# Signing
|
||||
gpg.key
|
||||
cmd/trivy/trivy
|
||||
|
||||
@@ -21,6 +21,7 @@ linters-settings:
|
||||
local-prefixes: github.com/aquasecurity
|
||||
gosec:
|
||||
excludes:
|
||||
- G101
|
||||
- G114
|
||||
- G204
|
||||
- G402
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.16.2
|
||||
FROM alpine:3.18.2
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
COPY trivy /usr/local/bin/trivy
|
||||
COPY contrib/*.tpl contrib/
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
FROM alpine:3.16.2
|
||||
FROM alpine:3.18.0
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
|
||||
# binaries were created with GoReleaser
|
||||
# need to copy binaries from folder with correct architecture
|
||||
# example architecture folder: dist/trivy_canary_build_linux_arm64/trivy
|
||||
# GoReleaser adds _v* to the folder name, but only when GOARCH is amd64
|
||||
ARG TARGETARCH
|
||||
COPY "dist/trivy_canary_build_linux_${TARGETARCH}/trivy" /usr/local/bin/trivy
|
||||
COPY "dist/trivy_canary_build_linux_${TARGETARCH}*/trivy" /usr/local/bin/trivy
|
||||
COPY contrib/*.tpl contrib/
|
||||
ENTRYPOINT ["trivy"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.19.1
|
||||
FROM golang:1.19
|
||||
|
||||
# Install protoc (cf. http://google.github.io/proto-lens/installing-protoc.html)
|
||||
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
|
||||
@@ -10,3 +10,6 @@ RUN curl --retry 5 -OL https://github.com/protocolbuffers/protobuf/releases/down
|
||||
|
||||
RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0
|
||||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
|
||||
RUN go install github.com/magefile/mage@v1.14.0
|
||||
|
||||
ENV TRIVY_PROTOC_CONTAINER=true
|
||||
|
||||
124
Makefile
124
Makefile
@@ -1,124 +0,0 @@
|
||||
VERSION := $(patsubst v%,%,$(shell git describe --tags --always)) #Strips the v prefix from the tag
|
||||
LDFLAGS := -ldflags "-s -w -X=main.version=$(VERSION)"
|
||||
|
||||
GOPATH := $(shell go env GOPATH)
|
||||
GOBIN := $(GOPATH)/bin
|
||||
GOSRC := $(GOPATH)/src
|
||||
|
||||
TEST_MODULE_DIR := pkg/module/testdata
|
||||
TEST_MODULE_SRCS := $(wildcard $(TEST_MODULE_DIR)/*/*.go)
|
||||
TEST_MODULES := $(patsubst %.go,%.wasm,$(TEST_MODULE_SRCS))
|
||||
|
||||
EXAMPLE_MODULE_DIR := examples/module
|
||||
EXAMPLE_MODULE_SRCS := $(wildcard $(EXAMPLE_MODULE_DIR)/*/*.go)
|
||||
EXAMPLE_MODULES := $(patsubst %.go,%.wasm,$(EXAMPLE_MODULE_SRCS))
|
||||
|
||||
MKDOCS_IMAGE := aquasec/mkdocs-material:dev
|
||||
MKDOCS_PORT := 8000
|
||||
|
||||
u := $(if $(update),-u)
|
||||
|
||||
# Tools
|
||||
$(GOBIN)/wire:
|
||||
go install github.com/google/wire/cmd/wire@v0.5.0
|
||||
|
||||
$(GOBIN)/crane:
|
||||
go install github.com/google/go-containerregistry/cmd/crane@v0.9.0
|
||||
|
||||
$(GOBIN)/golangci-lint:
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.49.0
|
||||
|
||||
$(GOBIN)/labeler:
|
||||
go install github.com/knqyf263/labeler@latest
|
||||
|
||||
$(GOBIN)/easyjson:
|
||||
go install github.com/mailru/easyjson/...@v0.7.7
|
||||
|
||||
.PHONY: wire
|
||||
wire: $(GOBIN)/wire
|
||||
wire gen ./pkg/commands/... ./pkg/rpc/...
|
||||
|
||||
.PHONY: mock
|
||||
mock: $(GOBIN)/mockery
|
||||
mockery -all -inpkg -case=snake -dir $(DIR)
|
||||
|
||||
.PHONY: deps
|
||||
deps:
|
||||
go get ${u} -d
|
||||
go mod tidy
|
||||
|
||||
.PHONY: generate-test-modules
|
||||
generate-test-modules: $(TEST_MODULES)
|
||||
|
||||
# Compile WASM modules for unit and integration tests
|
||||
%.wasm:%.go
|
||||
@if !(type "tinygo" > /dev/null 2>&1); then \
|
||||
echo "Need to install TinyGo. Follow https://tinygo.org/getting-started/install/"; \
|
||||
exit 1; \
|
||||
fi
|
||||
go generate $<
|
||||
|
||||
# Run unit tests
|
||||
.PHONY: test
|
||||
test: $(TEST_MODULES)
|
||||
go test -v -short -coverprofile=coverage.txt -covermode=atomic ./...
|
||||
|
||||
integration/testdata/fixtures/images/*.tar.gz: $(GOBIN)/crane
|
||||
mkdir -p integration/testdata/fixtures/images/
|
||||
integration/scripts/download-images.sh
|
||||
|
||||
# Run integration tests
|
||||
.PHONY: test-integration
|
||||
test-integration: integration/testdata/fixtures/images/*.tar.gz
|
||||
go test -v -tags=integration ./integration/... ./pkg/fanal/test/integration/...
|
||||
|
||||
# Run WASM integration tests
|
||||
.PHONY: test-module-integration
|
||||
test-module-integration: integration/testdata/fixtures/images/*.tar.gz $(EXAMPLE_MODULES)
|
||||
go test -v -tags=module_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
|
||||
|
||||
# Create labels on GitHub
|
||||
.PHONY: label
|
||||
label: $(GOBIN)/labeler
|
||||
labeler apply misc/triage/labels.yaml -r aquasecurity/trivy -l 5
|
||||
|
||||
# Run MkDocs development server to preview the documentation page
|
||||
.PHONY: mkdocs-serve
|
||||
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)
|
||||
|
||||
# Generate JSON marshaler/unmarshaler for TinyGo/WebAssembly as TinyGo doesn't support encoding/json.
|
||||
.PHONY: easyjson
|
||||
easyjson: $(GOBIN)/easyjson
|
||||
easyjson pkg/module/serialize/types.go
|
||||
114
README.md
114
README.md
@@ -5,56 +5,69 @@
|
||||
[![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]
|
||||
[![GitHub Downloads][github-downloads-img]][release]
|
||||
![Docker Pulls][docker-pulls]
|
||||
|
||||
[📖 Documentation][docs]
|
||||
</div>
|
||||
|
||||
Trivy (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a comprehensive security scanner. It is reliable, fast, extremely easy to use, and it works wherever you need it.
|
||||
Trivy ([pronunciation][pronunciation]) is a comprehensive and versatile security scanner.
|
||||
Trivy has *scanners* that look for security issues, and *targets* where it can find those issues.
|
||||
|
||||
Trivy has different *scanners* that look for different security issues, and different *targets* where it can find those issues.
|
||||
Targets (what Trivy can scan):
|
||||
|
||||
Targets:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git repository (remote)
|
||||
- Kubernetes cluster or resource
|
||||
- Git Repository (remote)
|
||||
- Virtual Machine Image
|
||||
- Kubernetes
|
||||
- AWS
|
||||
|
||||
Scanners (what Trivy can find there):
|
||||
|
||||
Scanners:
|
||||
- OS packages and software dependencies in use (SBOM)
|
||||
- Known vulnerabilities (CVEs)
|
||||
- IaC misconfigurations
|
||||
- IaC issues and misconfigurations
|
||||
- Sensitive information and secrets
|
||||
- Software licenses
|
||||
|
||||
Much more scanners and targets are coming up. Missing something? Let us know!
|
||||
Trivy supports most popular programming languages, operating systems, and platforms. For a complete list, see the [Scanning Coverage] page.
|
||||
|
||||
Read more in the [Trivy Documentation][docs]
|
||||
To learn more, go to the [Trivy homepage][homepage] for feature highlights, or to the [Documentation site][docs] for detailed information.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Get Trivy
|
||||
|
||||
Get Trivy by your favorite installation method. See [installation] section in the documentation for details. For example:
|
||||
Trivy is available in most common distribution channels. The full list of installation options is available in the [Installation] page. Here are a few popular examples:
|
||||
|
||||
- `apt-get install trivy`
|
||||
- `yum install trivy`
|
||||
- `pacman -S trivy`
|
||||
- `brew install aquasecurity/trivy/trivy`
|
||||
- `sudo port install trivy`
|
||||
- `brew install trivy`
|
||||
- `docker run aquasec/trivy`
|
||||
- Download binary from https://github.com/aquasecurity/trivy/releases/latest/
|
||||
- Download binary from <https://github.com/aquasecurity/trivy/releases/latest/>
|
||||
- See [Installation] for more
|
||||
|
||||
Trivy is integrated with many popular platforms and applications. The complete list of integrations is available in the [Ecosystem] page. Here are a few popular examples:
|
||||
|
||||
- [GitHub Actions](https://github.com/aquasecurity/trivy-action)
|
||||
- [Kubernetes operator](https://github.com/aquasecurity/trivy-operator)
|
||||
- [VS Code plugin](https://github.com/aquasecurity/trivy-vscode-extension)
|
||||
- See [Ecosystem] for more
|
||||
|
||||
### Canary builds
|
||||
There are canary builds ([Docker Hub](https://hub.docker.com/r/aquasec/trivy/tags?page=1&name=canary), [GitHub](https://github.com/aquasecurity/trivy/pkgs/container/trivy/75776514?tag=canary), [ECR](https://gallery.ecr.aws/aquasecurity/trivy#canary) images and [binaries](https://github.com/aquasecurity/trivy/actions/workflows/canary.yaml)) as generated every push to main branch.
|
||||
|
||||
Please be aware: canary builds might have critical bugs, it's not recommended for use in production.
|
||||
|
||||
### General usage
|
||||
|
||||
```bash
|
||||
trivy <target> [--security-checks <scanner1,scanner2>] TARGET_NAME
|
||||
trivy <target> [--scanners <scanner1,scanner2>] <subject>
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```bash
|
||||
$ trivy image python:3.4-alpine
|
||||
trivy image python:3.4-alpine
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -65,7 +78,7 @@ https://user-images.githubusercontent.com/1161307/171013513-95f18734-233d-45d3-a
|
||||
</details>
|
||||
|
||||
```bash
|
||||
$ trivy fs --security-checks vuln,secret,config myproject/
|
||||
trivy fs --scanners vuln,secret,config myproject/
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -76,7 +89,7 @@ https://user-images.githubusercontent.com/1161307/171013917-b1f37810-f434-465c-b
|
||||
</details>
|
||||
|
||||
```bash
|
||||
$ trivy k8s --report summary cluster
|
||||
trivy k8s --report summary cluster
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -86,43 +99,27 @@ $ trivy k8s --report summary cluster
|
||||
|
||||
</details>
|
||||
|
||||
Note that you can also receive a detailed scan, scan only a specific namespace, resource and more.
|
||||
## FAQ
|
||||
|
||||
Find out more in the [Trivy Documentation][docs] - [Getting Started][getting-started]
|
||||
### How to pronounce the name "Trivy"?
|
||||
|
||||
`tri` is pronounced like **tri**gger, `vy` is pronounced like en**vy**.
|
||||
|
||||
## Highlights
|
||||
## Want more? Check out Aqua
|
||||
|
||||
- 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)
|
||||
- High accuracy, especially [Alpine Linux][alpine] and RHEL/CentOS
|
||||
- Supply chain security (SBOM support)
|
||||
- Support CycloneDX
|
||||
- Support SPDX
|
||||
- Misconfiguration detection (IaC scanning)
|
||||
- Wide variety of security checks are provided **out of the box**
|
||||
- Kubernetes, Docker, Terraform, and more
|
||||
- User-defined policies using [OPA Rego][rego]
|
||||
- Secret detection
|
||||
- A wide variety of built-in rules are provided **out of the box**
|
||||
- User-defined patterns
|
||||
- Efficient scanning of container images
|
||||
- Simple
|
||||
- Available in apt, yum, brew, dockerhub
|
||||
- **No pre-requisites** such as a database, system libraries, or eny environmental requirements. The binary runs anywhere.
|
||||
- The first scan will finish within 10 seconds (depending on your network). Consequent scans will finish instantaneously.
|
||||
- Fits your workflow
|
||||
- **Great for CI** such as GitHub Actions, Jenkins, GitLab CI, etc.
|
||||
- Available as extension for IDEs such as vscode, jetbrains, vim
|
||||
- Available as extension for Docker Desktop, Rancher Desktop
|
||||
- See [integrations] section in the documentation.
|
||||
If you liked Trivy, you will love Aqua which builds on top of Trivy to provide even more enhanced capabilities for a complete security management offering.
|
||||
You can find a high level comparison table specific to Trivy users [here](https://github.com/aquasecurity/resources/blob/main/trivy-aqua.md).
|
||||
In addition check out the <https://aquasec.com> website for more information about our products and services.
|
||||
If you'd like to contact Aqua or request a demo, please use this form: <https://www.aquasec.com/demo>
|
||||
|
||||
---
|
||||
## Community
|
||||
|
||||
Trivy is an [Aqua Security][aquasec] open source project.
|
||||
Learn about our open source work and portfolio [here][oss].
|
||||
Contact us about any matter by opening a GitHub Discussion [here][discussions]
|
||||
Join our [Slack community][slack] to stay up to date with community efforts.
|
||||
|
||||
Please ensure to abide by our [Code of Conduct][code-of-conduct] during all interactions.
|
||||
|
||||
[test]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml
|
||||
[test-img]: https://github.com/aquasecurity/trivy/actions/workflows/test.yaml/badge.svg
|
||||
@@ -130,19 +127,24 @@ Contact us about any matter by opening a GitHub Discussion [here][discussions]
|
||||
[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
|
||||
[github-downloads-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
|
||||
|
||||
|
||||
[getting-started]: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
|
||||
[homepage]: https://trivy.dev
|
||||
[docs]: https://aquasecurity.github.io/trivy
|
||||
[integrations]:https://aquasecurity.github.io/trivy/latest/tutorials/integrations/
|
||||
[installation]:https://aquasecurity.github.io/trivy/latest/getting-started/installation/
|
||||
[releases]: https://github.com/aquasecurity/trivy/releases
|
||||
[pronunciation]: #how-to-pronounce-the-name-trivy
|
||||
[slack]: https://slack.aquasec.com
|
||||
[code-of-conduct]: https://github.com/aquasecurity/community/blob/main/CODE_OF_CONDUCT.md
|
||||
|
||||
[Installation]:https://aquasecurity.github.io/trivy/latest/getting-started/installation/
|
||||
[Ecosystem]: https://aquasecurity.github.io/trivy/latest/ecosystem/
|
||||
[Scanning Coverage]: https://aquasecurity.github.io/trivy/latest/getting-started/coverage/
|
||||
|
||||
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/#rego
|
||||
[sigstore]: https://www.sigstore.dev/
|
||||
|
||||
[aquasec]: https://aquasec.com
|
||||
[oss]: https://www.aquasec.com/products/open-source-projects/
|
||||
[discussions]: https://github.com/aquasecurity/trivy/discussions
|
||||
|
||||
10
SECURITY.md
Normal file
10
SECURITY.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
This is an open source project that is provided as-is without warrenty or liability.
|
||||
As such no supportability commitment. The maintainers will do the best they can to address any report promptly and responsibly.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please use the "Private vulnerability reporting" feature in the GitHub repository (under the "Security" tab).
|
||||
10
aqua.yaml
Normal file
10
aqua.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# aqua - Declarative CLI Version Manager
|
||||
# https://aquaproj.github.io/
|
||||
registries:
|
||||
- type: standard
|
||||
ref: v3.157.0 # renovate: depName=aquaproj/aqua-registry
|
||||
packages:
|
||||
- name: tinygo-org/tinygo@v0.27.0
|
||||
- name: WebAssembly/binaryen@version_112
|
||||
- name: magefile/mage@v1.14.0
|
||||
@@ -7,7 +7,6 @@ cd trivy-repo/deb
|
||||
|
||||
for release in ${DEBIAN_RELEASES[@]} ${UBUNTU_RELEASES[@]}; do
|
||||
echo "Removing deb package of $release"
|
||||
reprepro -A i386 remove $release trivy
|
||||
reprepro -A amd64 remove $release trivy
|
||||
reprepro -A arm64 remove $release trivy
|
||||
done
|
||||
@@ -15,7 +14,6 @@ done
|
||||
for release in ${DEBIAN_RELEASES[@]} ${UBUNTU_RELEASES[@]}; do
|
||||
echo "Adding deb package to $release"
|
||||
reprepro includedeb $release ../../dist/*Linux-64bit.deb
|
||||
reprepro includedeb $release ../../dist/*Linux-32bit.deb
|
||||
reprepro includedeb $release ../../dist/*Linux-ARM64.deb
|
||||
done
|
||||
|
||||
|
||||
@@ -1,20 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
TRIVY_VERSION=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
|
||||
|
||||
function create_common_rpm_repo () {
|
||||
rpm_path=$1
|
||||
|
||||
ARCHES=("x86_64" "aarch64")
|
||||
for arch in ${ARCHES[@]}; do
|
||||
prefix=$arch
|
||||
if [ "$arch" == "x86_64" ]; then
|
||||
prefix="64bit"
|
||||
elif [ "$arch" == "aarch64" ]; then
|
||||
prefix="ARM64"
|
||||
fi
|
||||
|
||||
mkdir -p $rpm_path/$arch
|
||||
cp ../dist/*${prefix}.rpm ${rpm_path}/$arch/
|
||||
createrepo_c -u https://github.com/aquasecurity/trivy/releases/download/ --location-prefix="v"$TRIVY_VERSION --update $rpm_path/$arch
|
||||
rm ${rpm_path}/$arch/*${prefix}.rpm
|
||||
done
|
||||
}
|
||||
|
||||
function create_rpm_repo () {
|
||||
version=$1
|
||||
rpm_path=rpm/releases/${version}/x86_64
|
||||
|
||||
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}
|
||||
cp ../dist/*64bit.rpm ${rpm_path}/
|
||||
|
||||
createrepo --update $rpm_path
|
||||
createrepo_c -u https://github.com/aquasecurity/trivy/releases/download/ --location-prefix="v"$TRIVY_VERSION --update $rpm_path
|
||||
|
||||
rm ${rpm_path}/*64bit.rpm
|
||||
}
|
||||
|
||||
echo "Create RPM releases for Trivy v$TRIVY_VERSION"
|
||||
|
||||
cd trivy-repo
|
||||
|
||||
echo "Processing common repository for RHEL/CentOS..."
|
||||
create_common_rpm_repo rpm/releases
|
||||
|
||||
VERSIONS=(5 6 7 8 9)
|
||||
for version in ${VERSIONS[@]}; do
|
||||
echo "Processing RHEL/CentOS $version..."
|
||||
@@ -22,6 +47,5 @@ for version in ${VERSIONS[@]}; do
|
||||
done
|
||||
|
||||
git add .
|
||||
git commit -m "Update rpm packages"
|
||||
git commit -m "Update rpm packages for Trivy v$TRIVY_VERSION"
|
||||
git push origin main
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"github.com/aquasecurity/trivy/pkg/commands"
|
||||
"github.com/aquasecurity/trivy/pkg/log"
|
||||
"github.com/aquasecurity/trivy/pkg/plugin"
|
||||
|
||||
_ "modernc.org/sqlite" // sqlite driver for RPM DB and Java DB
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"Severity": {
|
||||
"Label": "{{ $severity }}"
|
||||
},
|
||||
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}",
|
||||
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}, related to {{ .PkgName }}",
|
||||
"Description": {{ escapeString $description | printf "%q" }},
|
||||
{{ if not (empty .PrimaryURL) -}}
|
||||
"Remediation": {
|
||||
@@ -119,6 +119,43 @@
|
||||
"RecordState": "ACTIVE"
|
||||
}
|
||||
{{- end -}}
|
||||
{{- range .Secrets -}}
|
||||
{{- if $t_first -}}{{- $t_first = false -}}{{- else -}},{{- end -}}
|
||||
{{- $severity := .Severity -}}
|
||||
{{- if eq $severity "UNKNOWN" -}}
|
||||
{{- $severity = "INFORMATIONAL" -}}
|
||||
{{- end -}}
|
||||
{
|
||||
"SchemaVersion": "2018-10-08",
|
||||
"Id": "{{ $target }}",
|
||||
"ProductArn": "arn:aws:securityhub:{{ env "AWS_DEFAULT_REGION" }}::product/aquasecurity/aquasecurity",
|
||||
"GeneratorId": "Trivy",
|
||||
"AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}",
|
||||
"Types": [ "Sensitive Data Identifications" ],
|
||||
"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 secret in {{ $target }}: {{ .Title }}",
|
||||
"Description": "Trivy found a secret in {{ $target }}: {{ .Title }}",
|
||||
"ProductFields": { "Product Name": "Trivy" },
|
||||
"Resources": [
|
||||
{
|
||||
"Type": "Other",
|
||||
"Id": "{{ $target }}",
|
||||
"Partition": "aws",
|
||||
"Region": "{{ env "AWS_DEFAULT_REGION" }}",
|
||||
"Details": {
|
||||
"Other": {
|
||||
"Filename": "{{ $target }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"RecordState": "ACTIVE"
|
||||
}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ get_binaries() {
|
||||
openbsd/amd64) BINARIES="trivy" ;;
|
||||
openbsd/arm64) BINARIES="trivy" ;;
|
||||
openbsd/armv7) BINARIES="trivy" ;;
|
||||
windows/amd64) BINARIES="trivy" ;;
|
||||
*)
|
||||
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
|
||||
exit 1
|
||||
@@ -102,6 +103,9 @@ tag_to_version() {
|
||||
}
|
||||
adjust_format() {
|
||||
# change format (tar.gz or zip) based on OS
|
||||
case ${OS} in
|
||||
windows) FORMAT=zip ;;
|
||||
esac
|
||||
true
|
||||
}
|
||||
adjust_os() {
|
||||
@@ -127,6 +131,7 @@ adjust_arch() {
|
||||
386) ARCH=32bit ;;
|
||||
amd64) ARCH=64bit ;;
|
||||
arm) ARCH=ARM ;;
|
||||
armv7) ARCH=ARM ;;
|
||||
arm64) ARCH=ARM64 ;;
|
||||
ppc64le) OS=PPC64LE ;;
|
||||
darwin) ARCH=macOS ;;
|
||||
|
||||
49
docs/community/contribute/discussion.md
Normal file
49
docs/community/contribute/discussion.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Discussions
|
||||
Thank you for taking interest in contributing to Trivy!
|
||||
|
||||
Trivy uses [GitHub Discussion](https://github.com/aquasecurity/trivy/discussions) for bug reports, feature requests, and questions.
|
||||
If maintainers decide to accept a new feature or confirm that it is a bug, they will close the discussion and create a [GitHub Issue](https://github.com/aquasecurity/trivy/issues) associated with that discussion.
|
||||
|
||||
- Feel free to open discussions for any reason. When you open a new discussion, you'll have to select a discussion category as described below.
|
||||
- Please spend a small amount of time giving due diligence to the issue/discussion tracker. Your discussion might be a duplicate. If it is, please add your comment to the existing issue/discussion.
|
||||
- Remember that users might search for your issue/discussion in the future, so please give it a meaningful title to help others.
|
||||
- The issue should clearly explain the reason for opening, the proposal if you have any, and any relevant technical information.
|
||||
|
||||
There are 4 categories:
|
||||
|
||||
- 💡 [Ideas](https://github.com/aquasecurity/trivy/discussions/categories/ideas)
|
||||
- Share ideas for new features
|
||||
- 🔎 [False Detection](https://github.com/aquasecurity/trivy/discussions/categories/false-detection)
|
||||
- Report false positives/negatives
|
||||
- 🐛 [Bugs](https://github.com/aquasecurity/trivy/discussions/categories/bugs)
|
||||
- Report something that is not working as expected
|
||||
- 🙏 [Q&A](https://github.com/aquasecurity/trivy/discussions/categories/q-a)
|
||||
- Ask the community for help
|
||||
|
||||
!!! note
|
||||
If you find any false positives or false negatives, please make sure to report them under the "False Detection" category, not "Bugs".
|
||||
|
||||
## False detection
|
||||
Trivy depends on [multiple data sources](https://aquasecurity.github.io/trivy/latest/docs/vulnerability/detection/data-source/).
|
||||
Sometime these databases contain mistakes.
|
||||
|
||||
If Trivy can't detect any CVE-IDs or shows false positive result, at first please follow the next steps:
|
||||
|
||||
1. Run Trivy with `-f json` that shows data sources.
|
||||
2. According to the shown data source, make sure that the security advisory in the data source is correct.
|
||||
|
||||
If the data source is correct and Trivy shows wrong results, please raise an issue on Trivy.
|
||||
|
||||
### GitHub Advisory Database
|
||||
Visit [here](https://github.com/advisories) and search CVE-ID.
|
||||
|
||||
If you find a problem, it'll be nice to fix it: [How to contribute to a GitHub security advisory](https://github.blog/2022-02-22-github-advisory-database-now-open-to-community-contributions/)
|
||||
|
||||
### GitLab Advisory Database
|
||||
Visit [here](https://advisories.gitlab.com/) and search CVE-ID.
|
||||
|
||||
If you find a problem, it'll be nice to fix it: [Create an issue to GitLab Advisory Database](https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/issues/new)
|
||||
|
||||
### Red Hat CVE Database
|
||||
Visit [here](https://access.redhat.com/security/security-updates/?cwe=476#/cve) and search CVE-ID.
|
||||
|
||||
@@ -1,31 +1,4 @@
|
||||
# Issues
|
||||
Thank you for taking interest in contributing to Trivy!
|
||||
|
||||
- Feel free to open issues for any reason. When you open a new issue, you'll have to select an issue kind: bug/feature/support and fill the required information based on the selected template.
|
||||
- Please spend a small amount of time giving due diligence to the issue tracker. Your issue might be a duplicate. If it is, please add your comment to the existing issue.
|
||||
- Remember that users might search for your issue in the future, so please give it a meaningful title to help others.
|
||||
- The issue should clearly explain the reason for opening, the proposal if you have any, and any relevant technical information.
|
||||
|
||||
## Wrong detection
|
||||
Trivy depends on [multiple data sources](https://aquasecurity.github.io/trivy/latest/docs/vulnerability/detection/data-source/).
|
||||
Sometime these databases contain mistakes.
|
||||
|
||||
If Trivy can't detect any CVE-IDs or shows false positive result, at first please follow the next steps:
|
||||
|
||||
1. Run Trivy with `-f json` that shows data sources.
|
||||
2. According to the shown data source, make sure that the security advisory in the data source is correct.
|
||||
|
||||
If the data source is correct and Trivy shows wrong results, please raise an issue on Trivy.
|
||||
|
||||
### GitHub Advisory Database
|
||||
Visit [here](https://github.com/advisories) and search CVE-ID.
|
||||
|
||||
If you find a problem, it'll be nice to fix it: [How to contribute to a GitHub security advisory](https://github.blog/2022-02-22-github-advisory-database-now-open-to-community-contributions/)
|
||||
|
||||
### GitLab Advisory Database
|
||||
Visit [here](https://advisories.gitlab.com/) and search CVE-ID.
|
||||
|
||||
If you find a problem, it'll be nice to fix it: [Create an issue to GitLab Advisory Database](https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/issues/new)
|
||||
|
||||
### Red Hat CVE Database
|
||||
Visit [here](https://access.redhat.com/security/security-updates/?cwe=476#/cve) and search CVE-ID.
|
||||
|
||||
Trivy uses [GitHub Discussion](./discussion.md) for bug reports, feature requests, and questions.
|
||||
@@ -9,11 +9,66 @@ Thank you for taking interest in contributing to Trivy!
|
||||
1. 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!).
|
||||
1. If your PR affects the user experience in some way, please update the README.md and the CLI help accordingly.
|
||||
|
||||
### Title
|
||||
## Development
|
||||
Install the necessary tools for development by following their respective installation instructions.
|
||||
|
||||
- [Go](https://go.dev/doc/install)
|
||||
- [Mage](https://magefile.org/)
|
||||
|
||||
### Build
|
||||
After making changes to the Go source code, build the project with the following command:
|
||||
|
||||
```shell
|
||||
$ mage build
|
||||
$ ./trivy -h
|
||||
```
|
||||
|
||||
### Lint
|
||||
You must pass the linter checks:
|
||||
|
||||
```shell
|
||||
$ mage lint
|
||||
```
|
||||
|
||||
Additionally, you need to have run `go mod tidy`, so execute the following command as well:
|
||||
|
||||
```shell
|
||||
$ mage tidy
|
||||
```
|
||||
|
||||
### Unit tests
|
||||
Your PR must pass all the unit tests. You can test it as below.
|
||||
|
||||
```
|
||||
$ mage test:unit
|
||||
```
|
||||
|
||||
### Integration tests
|
||||
Your PR must pass all the integration tests. You can test it as below.
|
||||
|
||||
```
|
||||
$ mage test:integration
|
||||
```
|
||||
|
||||
### Documentation
|
||||
If you update CLI flags, you need to generate the CLI references.
|
||||
The test will fail if they are not up-to-date.
|
||||
|
||||
```shell
|
||||
$ mage docs:generate
|
||||
```
|
||||
|
||||
You can build the documents as below and view it at http://localhost:8000.
|
||||
|
||||
```
|
||||
$ mage docs:serve
|
||||
```
|
||||
|
||||
## 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
|
||||
### Format of the title
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
@@ -50,7 +105,10 @@ mode:
|
||||
- fs
|
||||
- repo
|
||||
- sbom
|
||||
- k8s
|
||||
- server
|
||||
- aws
|
||||
- vm
|
||||
|
||||
os:
|
||||
|
||||
@@ -77,6 +135,8 @@ language:
|
||||
- dotnet
|
||||
- java
|
||||
- go
|
||||
- elixir
|
||||
- dart
|
||||
|
||||
vuln:
|
||||
|
||||
@@ -102,6 +162,12 @@ cli:
|
||||
- cli
|
||||
- flag
|
||||
|
||||
SBOM:
|
||||
|
||||
- cyclonedx
|
||||
- spdx
|
||||
- purl
|
||||
|
||||
others:
|
||||
|
||||
- helm
|
||||
@@ -111,7 +177,7 @@ others:
|
||||
|
||||
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
|
||||
### Example titles
|
||||
|
||||
```
|
||||
feat(alma): add support for AlmaLinux
|
||||
@@ -132,33 +198,15 @@ 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.
|
||||
## Commits
|
||||
|
||||
```
|
||||
$ 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 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](https://github.com/aquasecurity/vuln-list) is a vulnerability 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.
|
||||
- [go-dep-parser](https://github.com/aquasecurity/go-dep-parser) is a library for parsing lock files such as package-lock.json and Gemfile.lock.
|
||||
|
||||
@@ -5,6 +5,8 @@ Trivy can be used in air-gapped environments. Note that an allowlist is [here][a
|
||||
## Air-Gapped Environment for vulnerabilities
|
||||
|
||||
### Download the vulnerability database
|
||||
At first, you need to download the vulnerability database for use in air-gapped environments.
|
||||
|
||||
=== "Trivy"
|
||||
|
||||
```
|
||||
@@ -15,7 +17,6 @@ Trivy can be used in air-gapped environments. Note that an allowlist is [here][a
|
||||
```
|
||||
|
||||
=== "oras >= v0.13.0"
|
||||
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`:
|
||||
@@ -25,7 +26,6 @@ Trivy can be used in air-gapped environments. Note that an allowlist is [here][a
|
||||
```
|
||||
|
||||
=== "oras < v0.13.0"
|
||||
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`:
|
||||
@@ -34,41 +34,95 @@ Trivy can be used in air-gapped environments. Note that an allowlist is [here][a
|
||||
$ oras pull -a ghcr.io/aquasecurity/trivy-db:2
|
||||
```
|
||||
|
||||
### Transfer the DB file into the air-gapped environment
|
||||
### Download the Java index database[^1]
|
||||
Java users also need to download the Java index database for use in air-gapped environments.
|
||||
|
||||
!!! note
|
||||
You container image may contain JAR files even though you don't use Java directly.
|
||||
In that case, you also need to download the Java index database.
|
||||
|
||||
=== "Trivy"
|
||||
|
||||
```
|
||||
TRIVY_TEMP_DIR=$(mktemp -d)
|
||||
trivy --cache-dir $TRIVY_TEMP_DIR image --download-java-db-only
|
||||
tar -cf ./javadb.tar.gz -C $TRIVY_TEMP_DIR/java-db metadata.json trivy-java.db
|
||||
rm -rf $TRIVY_TEMP_DIR
|
||||
```
|
||||
=== "oras >= v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
|
||||
Download `javadb.tar.gz`:
|
||||
|
||||
```
|
||||
$ oras pull ghcr.io/aquasecurity/trivy-java-db:1
|
||||
```
|
||||
|
||||
=== "oras < v0.13.0"
|
||||
Please follow [oras installation instruction][oras].
|
||||
|
||||
Download `javadb.tar.gz`:
|
||||
|
||||
```
|
||||
$ oras pull -a ghcr.io/aquasecurity/trivy-java-db:1
|
||||
```
|
||||
|
||||
|
||||
### Transfer the DB files into the air-gapped environment
|
||||
The way of transfer depends on the environment.
|
||||
|
||||
```
|
||||
$ rsync -av -e ssh /path/to/db.tar.gz [user]@[host]:dst
|
||||
```
|
||||
=== "Vulnerability db"
|
||||
```
|
||||
$ 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.
|
||||
=== "Java index db[^1]"
|
||||
```
|
||||
$ rsync -av -e ssh /path/to/javadb.tar.gz [user]@[host]:dst
|
||||
```
|
||||
|
||||
### Put the DB files in Trivy's cache directory
|
||||
You have to know where to put the DB files. The following command shows the default cache directory.
|
||||
|
||||
```
|
||||
$ ssh user@host
|
||||
$ trivy -h | grep cache
|
||||
--cache-dir value cache directory (default: "/home/myuser/.cache/trivy") [$TRIVY_CACHE_DIR]
|
||||
```
|
||||
=== "Vulnerability db"
|
||||
Put the DB file in the cache directory + `/db`.
|
||||
|
||||
```
|
||||
$ mkdir -p /home/myuser/.cache/trivy/db
|
||||
$ cd /home/myuser/.cache/trivy/db
|
||||
$ tar xvf /path/to/db.tar.gz -C /home/myuser/.cache/trivy/db
|
||||
x trivy.db
|
||||
x metadata.json
|
||||
$ rm /path/to/db.tar.gz
|
||||
```
|
||||
|
||||
Put the DB file in the cache directory + `/db`.
|
||||
=== "Java index db[^1]"
|
||||
Put the DB file in the cache directory + `/java-db`.
|
||||
|
||||
```
|
||||
$ mkdir -p /home/myuser/.cache/trivy/java-db
|
||||
$ cd /home/myuser/.cache/trivy/java-db
|
||||
$ tar xvf /path/to/javadb.tar.gz -C /home/myuser/.cache/trivy/java-db
|
||||
x trivy-java.db
|
||||
x metadata.json
|
||||
$ rm /path/to/javadb.tar.gz
|
||||
```
|
||||
|
||||
|
||||
|
||||
In an air-gapped environment it is your responsibility to update the Trivy databases on a regular basis, so that the scanner can detect recently-identified vulnerabilities.
|
||||
|
||||
### Run Trivy with the specific flags.
|
||||
In an air-gapped environment, you have to specify `--skip-db-update` and `--skip-java-db-update`[^1] so that Trivy doesn't attempt to download the latest database files.
|
||||
In addition, if you want to scan `pom.xml` dependencies, you need to specify `--offline-scan` since Trivy tries to issue API requests for scanning Java applications by default.
|
||||
|
||||
```
|
||||
$ 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
|
||||
$ trivy image --skip-db-update --skip-java-db-update --offline-scan alpine:3.12
|
||||
```
|
||||
|
||||
## Air-Gapped Environment for misconfigurations
|
||||
@@ -84,3 +138,5 @@ $ trivy conf --skip-policy-update /path/to/conf
|
||||
|
||||
[allowlist]: ../references/troubleshooting.md
|
||||
[oras]: https://oras.land/cli/
|
||||
|
||||
[^1]: This is only required to scan `jar` files. More information about `Java index db` [here](../scanner/vulnerability/language/java.md)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# containerd
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Scan your image in [containerd][containerd] running locally.
|
||||
|
||||
```bash
|
||||
$ nerdctl images
|
||||
REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZE
|
||||
aquasec/nginx latest 2bcabc23b454 3 hours ago linux/amd64 149.1 MiB 54.1 MiB
|
||||
$ trivy image aquasec/nginx
|
||||
```
|
||||
|
||||
If your containerd socket is not the default path (`//run/containerd/containerd.sock`), you can override it via `CONTAINERD_ADDRESS`.
|
||||
|
||||
```bash
|
||||
$ export CONTAINERD_ADDRESS=/run/k3s/containerd/containerd.sock
|
||||
$ trivy image aquasec/nginx
|
||||
```
|
||||
|
||||
[containerd]: https://containerd.io/
|
||||
@@ -1,17 +0,0 @@
|
||||
# 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
|
||||
```
|
||||
@@ -1,28 +0,0 @@
|
||||
# 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
|
||||
@@ -42,6 +42,11 @@ For example, to download the Kubernetes Trivy plugin you can execute the followi
|
||||
```bash
|
||||
$ trivy plugin install github.com/aquasecurity/trivy-plugin-kubectl
|
||||
```
|
||||
Also, Trivy plugin can be installed from a local archive:
|
||||
```bash
|
||||
$ trivy plugin install myplugin.tar.gz
|
||||
```
|
||||
|
||||
## 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.
|
||||
@@ -162,6 +167,21 @@ 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.
|
||||
|
||||
A plugin should be archived `*.tar.gz`.
|
||||
|
||||
```bash
|
||||
$ tar -czvf myplugin.tar.gz plugin.yaml script.py
|
||||
plugin.yaml
|
||||
script.py
|
||||
|
||||
$ trivy plugin install myplugin.tar.gz
|
||||
2023-03-03T19:04:42.026+0600 INFO Installing the plugin from myplugin.tar.gz...
|
||||
2023-03-03T19:04:42.026+0600 INFO Loading the plugin metadata...
|
||||
|
||||
$ trivy myplugin
|
||||
Hello from Trivy demo plugin!
|
||||
```
|
||||
|
||||
## Example
|
||||
https://github.com/aquasecurity/trivy-plugin-kubectl
|
||||
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
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}
|
||||
```
|
||||
See [here](./index.md) for the detail.
|
||||
You don't need to provide a credential when download from public repository.
|
||||
|
||||
@@ -2,3 +2,34 @@ 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
|
||||
|
||||
### AWS private registry permissions
|
||||
|
||||
You may need to grant permissions to allow Trivy to pull images from private ECR.
|
||||
|
||||
It depends on how you want to provide AWS Role to trivy.
|
||||
|
||||
- [IAM Role Service account](https://github.com/aws/amazon-eks-pod-identity-webhook)
|
||||
- [Kube2iam](https://github.com/jtblin/kube2iam) or [Kiam](https://github.com/uswitch/kiam)
|
||||
|
||||
#### IAM Role Service account
|
||||
|
||||
Add the AWS role in trivy's service account annotations:
|
||||
|
||||
```yaml
|
||||
trivy:
|
||||
|
||||
serviceAccount:
|
||||
annotations: {}
|
||||
# eks.amazonaws.com/role-arn: arn:aws:iam::ACCOUNT_ID:role/IAM_ROLE_NAME
|
||||
```
|
||||
|
||||
#### Kube2iam or Kiam
|
||||
|
||||
Add the AWS role to pod's annotations:
|
||||
|
||||
```yaml
|
||||
podAnnotations: {}
|
||||
## kube2iam/kiam annotation
|
||||
# iam.amazonaws.com/role: arn:aws:iam::ACCOUNT_ID:role/IAM_ROLE_NAME
|
||||
```
|
||||
|
||||
@@ -1,4 +1,49 @@
|
||||
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.
|
||||
Trivy can download images from a private registry without the need for installing Docker or any other 3rd party tools.
|
||||
This makes it easy to run within a CI process.
|
||||
|
||||
All you have to do is install `Trivy` and set ENV vars.
|
||||
## Credential
|
||||
To use Trivy with private images, simply install it and provide your credentials:
|
||||
|
||||
```shell
|
||||
$ TRIVY_USERNAME=YOUR_USERNAME TRIVY_PASSWORD=YOUR_PASSWORD trivy image YOUR_PRIVATE_IMAGE
|
||||
```
|
||||
|
||||
Trivy also supports providing credentials through CLI flags:
|
||||
|
||||
```shell
|
||||
$ TRIVY_PASSWORD=YOUR_PASSWORD trivy image --username YOUR_USERNAME YOUR_PRIVATE_IMAGE
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The CLI flag `--password` is available, but its use is not recommended for security reasons.
|
||||
|
||||
You can also store your credentials in `trivy.yaml`.
|
||||
For more information, please refer to [the documentation](../../references/configuration/config-file.md).
|
||||
|
||||
It can handle multiple sets of credentials as well:
|
||||
|
||||
```shell
|
||||
$ export TRIVY_USERNAME=USERNAME1,USERNAME2
|
||||
$ export TRIVY_PASSWORD=PASSWORD1,PASSWORD2
|
||||
$ trivy image YOUR_PRIVATE_IMAGE
|
||||
```
|
||||
|
||||
In the example above, Trivy attempts to use two pairs of credentials:
|
||||
|
||||
- USERNAME1/PASSWORD1
|
||||
- USERNAME2/PASSWORD2
|
||||
|
||||
Please note that the number of usernames and passwords must be the same.
|
||||
|
||||
## docker login
|
||||
If you have Docker configured locally and have set up the credentials, Trivy can access them.
|
||||
|
||||
```shell
|
||||
$ docker login ghcr.io
|
||||
Username:
|
||||
Password:
|
||||
$ trivy image ghcr.io/your/private_image
|
||||
```
|
||||
|
||||
!!! note
|
||||
`docker login` can be used with any container runtime, such as Podman.
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
# Amazon Web Services
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
The Trivy AWS CLI allows you to scan your AWS account for misconfigurations. You can either run the CLI locally or integrate it into your CI/CD pipeline.
|
||||
|
||||
Whilst you can already scan the infrastructure-as-code that defines your AWS resources with `trivy config`, you can now scan your live AWS account(s) directly too.
|
||||
|
||||
The included checks cover all of the aspects of the [AWS CIS 1.2](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-cis.html) automated benchmarks.
|
||||
|
||||
Trivy uses the same [authentication methods](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) as the AWS CLI to configure and authenticate your access to the AWS platform.
|
||||
|
||||
You will need permissions configured to read all AWS resources - we recommend using a group/role with the `ReadOnlyAccess` policy attached.
|
||||
|
||||
Once you've scanned your account, you can run additional commands to filter the results without having to run the entire scan again - infrastructure information is cached locally per AWS account/region.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
Scan a full AWS account (all supported services):
|
||||
|
||||
```shell
|
||||
trivy aws --region us-east-1
|
||||
```
|
||||
|
||||
You can allow Trivy to determine the AWS region etc. by using the standard AWS configuration files and environment variables. The `--region` flag overrides these.
|
||||
|
||||

|
||||
|
||||
The summary view is the default when scanning multiple services.
|
||||
|
||||
Scan a specific service:
|
||||
|
||||
```shell
|
||||
trivy aws --service s3
|
||||
```
|
||||
|
||||
Scan multiple services:
|
||||
|
||||
```shell
|
||||
# --service s3,ec2 works too
|
||||
trivy aws --service s3 --service ec2
|
||||
```
|
||||
|
||||
Show results for a specific AWS resource:
|
||||
|
||||
```shell
|
||||
trivy aws --service s3 --arn arn:aws:s3:::example-bucket
|
||||
```
|
||||
|
||||
All ARNs with detected issues will be displayed when showing results for their associated service.
|
||||
|
||||
## Cached Results
|
||||
|
||||
By default, Trivy will cache a representation of each AWS service for 24 hours. This means you can filter and view results for a service without having to wait for the entire scan to run again. If you want to force the cache to be refreshed with the latest data, you can use `--update-cache`. Or if you'd like to use cached data for a different timeframe, you can specify `--max-cache-age` (e.g. `--max-cache-age 2h`.). Regardless of whether the cache is used or not, rules will be evaluated again with each run of `trivy aws`.
|
||||
|
||||
## Custom Policies
|
||||
|
||||
You can write custom policies for Trivy to evaluate against your AWS account. These policies are written in [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/), the same language used by [Open Policy Agent](https://www.openpolicyagent.org/). See the [Custom Policies](../../misconfiguration/custom/index.md) page for more information.
|
||||
@@ -1,8 +1,70 @@
|
||||
# Compliance Reports
|
||||
|
||||
Trivy support producing compliance reports.
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
## Supported reports
|
||||
Trivy’s compliance flag lets you curate a specific set of checks into a report. In a typical Trivy scan, there are hundreds of different checks for many different components and configurations, but sometimes you already know which specific checks you are interested in. Often this would be an industry accepted set of checks such as CIS, or some vendor specific guideline, or your own organization policy that you want to comply with. These are all possible using the flexible compliance infrastructure that's built into Trivy. Compliance reports are defined as simple YAML documents that select checks to include in the report.
|
||||
|
||||
- [NSA, CISA Kubernetes Hardening Guidance v1.0](../kubernetes/cli/compliance.md)
|
||||
## Usage
|
||||
|
||||
Compliance report is currently supported in the following targets (trivy sub-commands):
|
||||
|
||||
- `trivy image`
|
||||
- `trivy aws`
|
||||
- `trivy k8s`
|
||||
|
||||
Add the `--compliance` flag to the command line, and set it's value to desired report.
|
||||
For example: `trivy k8s cluster --compliance k8s-nsa` (see below for built-in and custom reports)
|
||||
|
||||
### Options
|
||||
|
||||
The following flags are compatible with `--compliance` flag and allows customizing it's output:
|
||||
|
||||
| flag | effect |
|
||||
|--------------------|--------------------------------------------------------------------------------------|
|
||||
| `--report summary` | shows a summary of the results. for every control shows the number of failed checks. |
|
||||
| `--report all` | shows fully detailed results. for every control shows where it failed and why. |
|
||||
| `--format table` | shows results in textual table format (good for human readability). |
|
||||
| `--format json` | shows results in json format (good for machine readability). |
|
||||
|
||||
## Built-in compliance
|
||||
|
||||
Trivy has a number of built-in compliance reports that you can asses right out of the box.
|
||||
to specify a built-in compliance report, select it by ID like `trivy --compliance <compliance_id>`.
|
||||
|
||||
For the list of built-in compliance reports, please see the relevant section:
|
||||
|
||||
- [Docker compliance](../target/container_image.md#compliance)
|
||||
- [Kubernetes compliance](../target/kubernetes.md#compliance)
|
||||
- [AWS compliance](../target/aws.md#compliance)
|
||||
|
||||
## Custom compliance
|
||||
|
||||
You can create your own custom compliance report. A compliance report is a simple YAML document in the following format:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
id: "k8s-myreport" # report unique identifier. this should not container spaces.
|
||||
title: "My custom Kubernetes report" # report title. Any one-line title.
|
||||
description: "Describe your report" # description of the report. Any text.
|
||||
relatedResources :
|
||||
- https://some.url # useful references. URLs only.
|
||||
version: "1.0" # spec version (string)
|
||||
controls:
|
||||
- name: "Non-root containers" # Name for the control (appears in the report as is). Any one-line name.
|
||||
description: 'Check that container is not running as root' # Description (appears in the report as is). Any text.
|
||||
id: "1.0" # control identifier (string)
|
||||
checks: # list of existing Trivy checks that define the control
|
||||
- id: AVD-KSV-0012 # check ID. Must start with `AVD-` or `CVE-`
|
||||
severity: "MEDIUM" # Severity for the control (note that checks severity isn't used)
|
||||
- name: "Immutable container file systems"
|
||||
description: 'Check that container root file system is immutable'
|
||||
id: "1.1"
|
||||
checks:
|
||||
- id: AVD-KSV-0014
|
||||
severity: "LOW"
|
||||
```
|
||||
|
||||
The check id field (`controls[].checks[].id`) is referring to existing check by it's "AVD ID". This AVD ID is easily located in the check's source code metadata header, or by browsing [Aqua vulnerability DB](https://avd.aquasec.com/), specifically in the [Misconfigurations](https://avd.aquasec.com/misconfig/) and [Vulnerabilities](https://avd.aquasec.com/nvd) sections.
|
||||
|
||||
Once you have a compliance spec, you can select it by file path: `trivy --compliance @</path/to/compliance.yaml>` (note the `@` indicating file path instead of report id).
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
# Cache
|
||||
The cache directory includes
|
||||
|
||||
- [Vulnerability Database][trivy-db][^1]
|
||||
- [Java Index Database][trivy-java-db][^2]
|
||||
- [Misconfiguration Policies][misconf-policies][^3]
|
||||
- Cache of previous scans.
|
||||
|
||||
The cache option is common to all scanners.
|
||||
|
||||
## Clear Caches
|
||||
The `--clear-cache` option removes caches.
|
||||
@@ -44,7 +52,14 @@ Two options:
|
||||
$ trivy server --cache-backend redis://localhost:6379
|
||||
```
|
||||
|
||||
Trivy also support for connecting to Redis using TLS, you only need to specify `--redis-ca` , `--redis-cert` , and `--redis-key` option.
|
||||
If you want to use TLS with Redis, you can enable it by specifying the `--redis-tls` flag.
|
||||
|
||||
```shell
|
||||
$ trivy server --cache-backend redis://localhost:6379 --redis-tls
|
||||
```
|
||||
|
||||
Trivy also supports for connecting to Redis with your certificates.
|
||||
You need to specify `--redis-ca` , `--redis-cert` , and `--redis-key` options.
|
||||
|
||||
```
|
||||
$ trivy server --cache-backend redis://localhost:6379 \
|
||||
@@ -53,4 +68,10 @@ $ trivy server --cache-backend redis://localhost:6379 \
|
||||
--redis-key /path/to/key.pem
|
||||
```
|
||||
|
||||
TLS option for redis is hidden from Trivy command-line flag, but you still can use it.
|
||||
[trivy-db]: ./db.md#vulnerability-database
|
||||
[trivy-java-db]: ./db.md#java-index-database
|
||||
[misconf-policies]: ../scanner/misconfiguration/policy/builtin.md
|
||||
|
||||
[^1]: Downloaded when scanning for vulnerabilities
|
||||
[^2]: Downloaded when scanning `jar/war/par/ear` files
|
||||
[^3]: Downloaded when scanning for misconfigurations
|
||||
@@ -1,9 +1,19 @@
|
||||
# Vulnerability DB
|
||||
# DB
|
||||
|
||||
## Skip update of vulnerability DB
|
||||
`Trivy` downloads its vulnerability database every 12 hours when it starts operating.
|
||||
This is usually fast, as the size of the DB is only 10~30MB.
|
||||
But if you want to skip even that, use the `--skip-db-update` option.
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
The vulnerability database and the Java index database are needed only for vulnerability scanning.
|
||||
See [here](../scanner/vulnerability/index.md) for the detail.
|
||||
|
||||
## Vulnerability Database
|
||||
|
||||
### Skip update of vulnerability DB
|
||||
If you want to skip downloading the vulnerability database, use the `--skip-db-update` option.
|
||||
|
||||
```
|
||||
$ trivy image --skip-db-update python:3.4-alpine3.9
|
||||
@@ -29,7 +39,7 @@ Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
</details>
|
||||
|
||||
## Only download vulnerability database
|
||||
### Only download vulnerability database
|
||||
You can also ask `Trivy` to simply retrieve the vulnerability database.
|
||||
This is useful to initialize workers in Continuous Integration systems.
|
||||
|
||||
@@ -37,9 +47,26 @@ This is useful to initialize workers in Continuous Integration systems.
|
||||
$ trivy image --download-db-only
|
||||
```
|
||||
|
||||
## DB Repository
|
||||
### DB Repository
|
||||
`Trivy` could also download the vulnerability database from an external OCI registry by using `--db-repository` option.
|
||||
|
||||
```
|
||||
$ trivy image --db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-db
|
||||
```
|
||||
|
||||
## Java Index Database
|
||||
The same options are also available for the Java index DB, which is used for scanning Java applications.
|
||||
Skipping an update can be done by using the `--skip-java-db-update` option, while `--download-java-db-only` can be used to only download the Java index DB.
|
||||
|
||||
Downloading the Java index DB from an external OCI registry can be done by using the `--java-db-repository` option.
|
||||
|
||||
```
|
||||
$ trivy image --java-db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-java-db --download-java-db-only
|
||||
```
|
||||
|
||||
## Remove DBs
|
||||
The `--reset` flag removes all caches and databases.
|
||||
|
||||
```
|
||||
$ trivy image --reset
|
||||
```
|
||||
@@ -1,8 +1,18 @@
|
||||
# Filter Vulnerabilities
|
||||
# Filtering
|
||||
Trivy provides various methods for filtering the results.
|
||||
|
||||
|
||||
## Hide Unfixed Vulnerabilities
|
||||
|
||||
By default, `Trivy` also detects unpatched/unfixed vulnerabilities. This means you can't fix these vulnerabilities even if you update all packages.
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
By default, `Trivy` also detects unpatched/unfixed vulnerabilities.
|
||||
This means you can't fix these vulnerabilities even if you update all packages.
|
||||
If you would like to ignore them, use the `--ignore-unfixed` option.
|
||||
|
||||
```bash
|
||||
@@ -50,6 +60,13 @@ Total: 4730 (UNKNOWN: 1, LOW: 145, MEDIUM: 3487, HIGH: 1014, CRITICAL: 83)
|
||||
|
||||
## By Severity
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
Use `--severity` option.
|
||||
|
||||
```bash
|
||||
@@ -113,7 +130,69 @@ Total: 1785 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1680, CRITICAL: 105)
|
||||
|
||||
</details>
|
||||
|
||||
## By Vulnerability IDs
|
||||
```bash
|
||||
trivy conf --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```shell
|
||||
2022-05-16T13:50:42.718+0100 INFO Detected config files: 3
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 17 (SUCCESSES: 16, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
HIGH: Last USER command in Dockerfile should not be 'root'
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ds002
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:3
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
3 [ USER root
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 8 (SUCCESSES: 8, FAILURES: 0, EXCEPTIONS: 0)
|
||||
Failures: 0 (HIGH: 0, CRITICAL: 0)
|
||||
|
||||
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 0, CRITICAL: 1)
|
||||
|
||||
CRITICAL: Classic resources should not be used.
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
AWS Classic resources run in a shared environment with infrastructure owned by other AWS customers. You should run
|
||||
resources in a VPC instead.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/avd-aws-0081
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
main.tf:2-4
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
2 ┌ resource "aws_db_security_group" "sg" {
|
||||
3 │
|
||||
4 └ }
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
</details>
|
||||
|
||||
## By Finding IDs
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | |
|
||||
|
||||
Use `.trivyignore`.
|
||||
|
||||
@@ -128,6 +207,15 @@ CVE-2019-14697 exp:2023-01-01
|
||||
# No impact in our settings
|
||||
CVE-2019-1543
|
||||
|
||||
# Ignore misconfigurations
|
||||
AVD-DS-0002
|
||||
|
||||
# Ignore secrets
|
||||
generic-unwanted-rule
|
||||
aws-account-id
|
||||
```
|
||||
|
||||
```bash
|
||||
$ trivy image python:3.4-alpine3.9
|
||||
```
|
||||
|
||||
@@ -146,7 +234,14 @@ Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
</details>
|
||||
|
||||
## By Type
|
||||
## By Vulnerability Target
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Use `--vuln-type` option.
|
||||
|
||||
```bash
|
||||
@@ -154,6 +249,7 @@ $ trivy image --vuln-type os ruby:2.4.0
|
||||
```
|
||||
|
||||
Available values:
|
||||
|
||||
- library
|
||||
- os
|
||||
|
||||
@@ -169,7 +265,8 @@ Available values:
|
||||
2019-05-22T19:36:53.406+0200 [34mINFO[0m Detecting pipenv vulnerabilities...
|
||||
|
||||
ruby:2.4.0 (debian 8.7)
|
||||
Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
|
||||
=======================
|
||||
Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
|
||||
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
@@ -180,23 +277,6 @@ Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
|
||||
| | CVE-2018-16839 | HIGH | | 7.61.1-r1 | curl: Integer overflow leading |
|
||||
| | | | | | to heap-based buffer overflow in |
|
||||
| | | | | | Curl_sasl_create_plain_message() |
|
||||
+ +------------------+ + +---------------+----------------------------------+
|
||||
| | CVE-2019-3822 | | | 7.61.1-r2 | curl: NTLMv2 type-3 header |
|
||||
| | | | | | stack buffer overflow |
|
||||
+ +------------------+ + +---------------+----------------------------------+
|
||||
| | CVE-2018-16840 | | | 7.61.1-r1 | curl: Use-after-free when |
|
||||
| | | | | | closing "easy" handle in |
|
||||
| | | | | | Curl_close() |
|
||||
+ +------------------+----------+ +---------------+----------------------------------+
|
||||
| | CVE-2019-3823 | MEDIUM | | 7.61.1-r2 | curl: SMTP end-of-response |
|
||||
| | | | | | out-of-bounds read |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2018-16890 | | | | curl: NTLM type-2 heap |
|
||||
| | | | | | out-of-bounds buffer read |
|
||||
+ +------------------+ + +---------------+----------------------------------+
|
||||
| | CVE-2018-16842 | | | 7.61.1-r1 | curl: Heap-based buffer |
|
||||
| | | | | | over-read in the curl tool |
|
||||
| | | | | | warning formatting |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| git | CVE-2018-17456 | HIGH | 2.15.2-r0 | 2.15.3-r0 | git: arbitrary code execution |
|
||||
| | | | | | via .gitmodules |
|
||||
@@ -208,67 +288,6 @@ Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
|
||||
| libssh2 | CVE-2019-3855 | CRITICAL | 1.8.0-r2 | 1.8.1-r0 | libssh2: Integer overflow in |
|
||||
| | | | | | transport read resulting in |
|
||||
| | | | | | out of bounds write... |
|
||||
+ +------------------+----------+ + +----------------------------------+
|
||||
| | CVE-2019-3861 | MEDIUM | | | libssh2: Out-of-bounds reads |
|
||||
| | | | | | with specially crafted SSH |
|
||||
| | | | | | packets |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3857 | | | | libssh2: Integer overflow in |
|
||||
| | | | | | SSH packet processing channel |
|
||||
| | | | | | resulting in out of... |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3856 | | | | libssh2: Integer overflow in |
|
||||
| | | | | | keyboard interactive handling |
|
||||
| | | | | | resulting in out of bounds... |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3863 | | | | libssh2: Integer overflow |
|
||||
| | | | | | in user authenticate |
|
||||
| | | | | | keyboard interactive allows |
|
||||
| | | | | | out-of-bounds writes |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3862 | | | | libssh2: Out-of-bounds memory |
|
||||
| | | | | | comparison with specially |
|
||||
| | | | | | crafted message channel |
|
||||
| | | | | | request |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3860 | | | | libssh2: Out-of-bounds reads |
|
||||
| | | | | | with specially crafted SFTP |
|
||||
| | | | | | packets |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3858 | | | | libssh2: Zero-byte allocation |
|
||||
| | | | | | with a specially crafted SFTP |
|
||||
| | | | | | packed leading to an... |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-3859 | | | | libssh2: Unchecked use of |
|
||||
| | | | | | _libssh2_packet_require and |
|
||||
| | | | | | _libssh2_packet_requirev |
|
||||
| | | | | | resulting in out-of-bounds |
|
||||
| | | | | | read |
|
||||
+---------+------------------+ +-------------------+---------------+----------------------------------+
|
||||
| libxml2 | CVE-2018-14404 | | 2.9.7-r0 | 2.9.8-r1 | libxml2: NULL pointer |
|
||||
| | | | | | dereference in |
|
||||
| | | | | | xpath.c:xmlXPathCompOpEval() |
|
||||
| | | | | | can allow attackers to cause |
|
||||
| | | | | | a... |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2018-14567 | | | | libxml2: Infinite loop when |
|
||||
| | | | | | --with-lzma is used allows for |
|
||||
| | | | | | denial of service... |
|
||||
+ +------------------+----------+ + +----------------------------------+
|
||||
| | CVE-2018-9251 | LOW | | | libxml2: infinite loop in |
|
||||
| | | | | | xz_decomp function in xzlib.c |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| openssh | CVE-2019-6109 | MEDIUM | 7.5_p1-r9 | 7.5_p1-r10 | openssh: Missing character |
|
||||
| | | | | | encoding in progress display |
|
||||
| | | | | | allows for spoofing of scp... |
|
||||
+ +------------------+ + + +----------------------------------+
|
||||
| | CVE-2019-6111 | | | | openssh: Improper validation |
|
||||
| | | | | | of object names allows |
|
||||
| | | | | | malicious server to overwrite |
|
||||
| | | | | | files... |
|
||||
+ +------------------+----------+ + +----------------------------------+
|
||||
| | CVE-2018-20685 | LOW | | | openssh: scp client improper |
|
||||
| | | | | | directory name validation |
|
||||
+---------+------------------+----------+-------------------+---------------+----------------------------------+
|
||||
| sqlite | CVE-2018-20346 | MEDIUM | 3.21.0-r1 | 3.25.3-r0 | CVE-2018-20505 CVE-2018-20506 |
|
||||
| | | | | | sqlite: Multiple flaws in |
|
||||
@@ -283,13 +302,20 @@ Total: 4751 (UNKNOWN: 1, LOW: 150, MEDIUM: 3504, HIGH: 1013, CRITICAL: 83)
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## By Open Policy Agent
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Trivy supports Open Policy Agent (OPA) to filter vulnerabilities. You can specify a Rego file with `--ignore-policy` option.
|
||||
Trivy supports Open Policy Agent (OPA) to filter vulnerabilities.
|
||||
You can specify a Rego file with `--ignore-policy` option.
|
||||
|
||||
The Rego package name must be `trivy` and it must include a rule called `ignore` which determines if each individual vulnerability should be excluded (ignore=true) or not (ignore=false). In the policy, each vulnerability will be available for inspection as the `input` variable. The structure of each vulnerability input is the same as for the Trivy JSON output.
|
||||
There is a built-in Rego library with helper functions that you can import into your policy using: `import data.lib.trivy`. For more info about the helper functions, look at the library [here][helper]
|
||||
@@ -357,3 +383,28 @@ Total: 9 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 4, CRITICAL: 5)
|
||||
|
||||
[helper]: https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/pkg/result/module.go
|
||||
[policy]: https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/contrib/example_policy
|
||||
|
||||
## By Inline Comments
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Some configuration file formats (e.g. Terraform) support inline comments.
|
||||
|
||||
In cases where trivy can detect comments of a specific format immediately adjacent to resource definitions, it is possible to filter/ignore findings from a single point of resource definition (in contrast to `.trivyignore`, which has a directory-wide scope on all of the files scanned).
|
||||
|
||||
The format for these comments is `trivy:ignore:<Vulnerability ID>` immediately following the format-specific line-comment token.
|
||||
|
||||
For example, to filter a Vulnerability ID "AVD-GCP-0051" in a Terraform HCL file:
|
||||
|
||||
```terraform
|
||||
#trivy:ignore:AVD-GCP-0051
|
||||
resource "google_container_cluster" "one_off_test" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
}
|
||||
```
|
||||
31
docs/docs/configuration/index.md
Normal file
31
docs/docs/configuration/index.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Configuration
|
||||
Trivy can be configured using the following ways. Each item takes precedence over the item below it:
|
||||
|
||||
- CLI flags
|
||||
- Environment variables
|
||||
- Configuration file
|
||||
|
||||
## CLI Flags
|
||||
You can view the list of available flags using the `--help` option.
|
||||
For more details, please refer to [the CLI reference](../references/configuration/cli/trivy.md).
|
||||
|
||||
## Environment Variables
|
||||
Trivy can be customized by environment variables.
|
||||
The environment variable key is the flag name converted by the following procedure.
|
||||
|
||||
- Add `TRIVY_` prefix
|
||||
- Make it all uppercase
|
||||
- Replace `-` with `_`
|
||||
|
||||
For example,
|
||||
|
||||
- `--debug` => `TRIVY_DEBUG`
|
||||
- `--cache-dir` => `TRIVY_CACHE_DIR`
|
||||
|
||||
```
|
||||
$ TRIVY_DEBUG=true TRIVY_SEVERITY=CRITICAL trivy image alpine:3.15
|
||||
```
|
||||
|
||||
## Configuration File
|
||||
By default, Trivy reads the `trivy.yaml` file.
|
||||
For more details, please refer to [the page](../references/configuration/config-file.md).
|
||||
119
docs/docs/configuration/others.md
Normal file
119
docs/docs/configuration/others.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# Others
|
||||
|
||||
## Enable/Disable Scanners
|
||||
You can enable/disable scanners with the `--scanners` flag.
|
||||
|
||||
Supported values:
|
||||
|
||||
- vuln
|
||||
- config
|
||||
- secret
|
||||
- license
|
||||
|
||||
For example, container image scanning enables vulnerability and secret scanners by default.
|
||||
If you don't need secret scanning, it can be disabled.
|
||||
|
||||
``` shell
|
||||
$ trivy image --scanners vuln alpine:3.15
|
||||
```
|
||||
|
||||
## Exit Code
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
By default, `Trivy` exits with code 0 even when security issues are detected.
|
||||
Use the `--exit-code` option if you want to exit with a non-zero exit code.
|
||||
|
||||
```
|
||||
$ trivy image --exit-code 1 python:3.4-alpine3.9
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2019-05-16T12:51:43.500+0900 INFO Updating vulnerability database...
|
||||
2019-05-16T12:52:00.387+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>
|
||||
|
||||
This option is useful for CI/CD. In the following example, the test will fail only when a critical vulnerability is found.
|
||||
|
||||
```
|
||||
$ trivy image --exit-code 0 --severity MEDIUM,HIGH ruby:2.4.0
|
||||
$ trivy image --exit-code 1 --severity CRITICAL ruby:2.4.0
|
||||
```
|
||||
|
||||
## Exit on EOL
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
Sometimes you may surprisingly get 0 vulnerabilities in an old image:
|
||||
|
||||
- Enabling `--ignore-unfixed` option while all packages have no fixed versions.
|
||||
- Scanning a rather outdated OS (e.g. Ubuntu 10.04).
|
||||
|
||||
An OS at the end of service/life (EOL) usually gets into this situation, which is definitely full of vulnerabilities.
|
||||
`--exit-on-eol` can fail scanning on EOL OS with a non-zero code.
|
||||
This flag is available with the following targets.
|
||||
|
||||
- Container images (`trivy image`)
|
||||
- Virtual machine images (`trivy vm`)
|
||||
- SBOM (`trivy sbom`)
|
||||
- Root filesystem (`trivy rootfs`)
|
||||
|
||||
```
|
||||
$ trivy image --exit-on-eol 1 alpine:3.10
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2023-03-01T11:07:15.455+0200 INFO Vulnerability scanning is enabled
|
||||
...
|
||||
2023-03-01T11:07:17.938+0200 WARN This OS version is no longer supported by the distribution: alpine 3.10.9
|
||||
2023-03-01T11:07:17.938+0200 WARN The vulnerability detection may be insufficient because security updates are not provided
|
||||
|
||||
alpine:3.10 (alpine 3.10.9)
|
||||
===========================
|
||||
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 1)
|
||||
|
||||
┌───────────┬────────────────┬──────────┬───────────────────┬───────────────┬─────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├───────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────────┤
|
||||
│ apk-tools │ CVE-2021-36159 │ CRITICAL │ 2.10.6-r0 │ 2.10.7-r0 │ libfetch before 2021-07-26, as used in apk-tools, xbps, and │
|
||||
│ │ │ │ │ │ other products, mishandles... │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2021-36159 │
|
||||
└───────────┴────────────────┴──────────┴───────────────────┴───────────────┴─────────────────────────────────────────────────────────────┘
|
||||
2023-03-01T11:07:17.941+0200 ERROR Detected EOL OS: alpine 3.10.9
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
This option is useful for CI/CD.
|
||||
The following example will fail when a critical vulnerability is found or the OS is EOSL:
|
||||
|
||||
```
|
||||
$ trivy image --exit-code 1 --exit-on-eol 1 --severity CRITICAL alpine:3.16.3
|
||||
```
|
||||
@@ -1,12 +1,35 @@
|
||||
# Report Formats
|
||||
# Reporting
|
||||
|
||||
## Table (Default)
|
||||
## Supported Formats
|
||||
Trivy supports the following formats:
|
||||
|
||||
- Table
|
||||
- JSON
|
||||
- [SARIF](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning)
|
||||
- Template
|
||||
- SBOM
|
||||
|
||||
### Table (Default)
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
```
|
||||
$ trivy image -f table golang:1.12-alpine
|
||||
```
|
||||
|
||||
### Show origins of vulnerable dependencies
|
||||
#### Show origins of vulnerable dependencies
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
@@ -17,8 +40,28 @@ In some cases, vulnerable dependencies are not linked directly, and it requires
|
||||
To make this task simpler Trivy can show a dependency origin tree with the `--dependency-tree` flag.
|
||||
This flag is only available with the `--format table` flag.
|
||||
|
||||
!!! note
|
||||
Only Node.js (package-lock.json) and Rust Binaries built with [cargo-auditable][cargo-auditable] are supported at the moment.
|
||||
The following packages/languages are currently supported:
|
||||
|
||||
- OS packages
|
||||
- apk
|
||||
- dpkg
|
||||
- rpm
|
||||
- Node.js
|
||||
- npm: package-lock.json
|
||||
- pnpm: pnpm-lock.yaml
|
||||
- yarn: yarn.lock
|
||||
- .NET
|
||||
- NuGet: packages.lock.json
|
||||
- Python
|
||||
- Poetry: poetry.lock
|
||||
- Ruby
|
||||
- Bundler: Gemfile.lock
|
||||
- Rust
|
||||
- Binaries built with [cargo-auditable][cargo-auditable]
|
||||
- Go
|
||||
- Modules: go.mod
|
||||
- PHP
|
||||
- Composer
|
||||
|
||||
This tree is the reverse of the npm list command.
|
||||
However, if you want to resolve a vulnerability in a particular indirect dependency, the reversed tree is useful to know where that dependency comes from and identify which package you actually need to update.
|
||||
@@ -43,8 +86,8 @@ Total: 2 (HIGH: 1, CRITICAL: 1)
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2020-28469 │
|
||||
└──────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────────────┘
|
||||
|
||||
Dependency Origin Tree
|
||||
======================
|
||||
Dependency Origin Tree (Reversed)
|
||||
=================================
|
||||
package-lock.json
|
||||
├── follow-redirects@1.14.6, (HIGH: 1, CRITICAL: 0)
|
||||
│ └── axios@0.21.4
|
||||
@@ -63,15 +106,19 @@ Also, **glob-parent@3.1.0** with some vulnerabilities is included through chain
|
||||
|
||||
Then, you can try to update **axios@0.21.4** and **cra-append-sw@2.7.0** to resolve vulnerabilities in **follow-redirects@1.14.6** and **glob-parent@3.1.0**.
|
||||
|
||||
## JSON
|
||||
### JSON
|
||||
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
```
|
||||
$ trivy image -f json -o results.json golang:1.12-alpine
|
||||
```
|
||||
|
||||
!!! caution
|
||||
v0.20.0 changes the JSON schema. For more details, see [here][new-json].
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
@@ -193,8 +240,15 @@ $ trivy image -f json -o results.json golang:1.12-alpine
|
||||
|
||||
`VulnerabilityID`, `PkgName`, `InstalledVersion`, and `Severity` in `Vulnerabilities` are always filled with values, but other fields might be empty.
|
||||
|
||||
## SARIF
|
||||
[Sarif][sarif] can be generated with the `--format sarif` option.
|
||||
### SARIF
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | |
|
||||
|
||||
[SARIF][sarif] can be generated with the `--format sarif` flag.
|
||||
|
||||
```
|
||||
$ trivy image --format sarif -o report.sarif golang:1.12-alpine
|
||||
@@ -202,9 +256,16 @@ $ trivy image --format sarif -o report.sarif golang:1.12-alpine
|
||||
|
||||
This SARIF file can be uploaded to GitHub code scanning results, and there is a [Trivy GitHub Action][action] for automating this process.
|
||||
|
||||
## Template
|
||||
### Template
|
||||
|
||||
### Custom Template
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
#### Custom Template
|
||||
|
||||
{% raw %}
|
||||
```
|
||||
@@ -241,27 +302,47 @@ Critical: 0, High: 2
|
||||
|
||||
For other features of sprig, see the official [sprig][sprig] documentation.
|
||||
|
||||
### Load templates from a file
|
||||
#### Load templates from a file
|
||||
You can load templates from a file prefixing the template path with an @.
|
||||
|
||||
```
|
||||
$ trivy image --format template --template "@/path/to/template" golang:1.12-alpine
|
||||
```
|
||||
|
||||
### Default Templates
|
||||
#### Default Templates
|
||||
|
||||
If Trivy is installed using rpm then default templates can be found at `/usr/local/share/trivy/templates`.
|
||||
|
||||
#### XML
|
||||
##### JUnit
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
In the following example using the template `junit.tpl` XML can be generated.
|
||||
```
|
||||
$ trivy image --format template --template "@contrib/junit.tpl" -o junit-report.xml golang:1.12-alpine
|
||||
```
|
||||
|
||||
#### ASFF
|
||||
##### ASFF
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | |
|
||||
|
||||
Trivy also supports an [ASFF template for reporting findings to AWS Security Hub][asff]
|
||||
|
||||
#### HTML
|
||||
##### HTML
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
```
|
||||
$ trivy image --format template --template "@contrib/html.tpl" -o report.html golang:1.12-alpine
|
||||
@@ -273,9 +354,36 @@ The following example shows use of default HTML template when Trivy is installed
|
||||
$ trivy image --format template --template "@/usr/local/share/trivy/templates/html.tpl" -o report.html golang:1.12-alpine
|
||||
```
|
||||
|
||||
### SBOM
|
||||
See [here](../supply-chain/sbom.md) for details.
|
||||
|
||||
## Converting
|
||||
To generate multiple reports, you can generate the JSON report first and convert it to other formats with the `convert` subcommand.
|
||||
|
||||
```shell
|
||||
$ trivy image --format json -o result.json --list-all-pkgs debian:11
|
||||
$ trivy convert --format cyclonedx --output result.cdx result.json
|
||||
```
|
||||
|
||||
!!! note
|
||||
Please note that if you want to convert to a format that requires a list of packages,
|
||||
such as SBOM, you need to add the `--list-all-pkgs` flag when outputting in JSON.
|
||||
|
||||
[Filtering options](./filtering.md) such as `--severity` are also available with `convert`.
|
||||
|
||||
```shell
|
||||
# Output all severities in JSON
|
||||
$ trivy image --format json -o result.json --list-all-pkgs debian:11
|
||||
|
||||
# Output only critical issues in table format
|
||||
$ trivy convert --format table --severity CRITICAL result.json
|
||||
```
|
||||
|
||||
!!! note
|
||||
JSON reports from "trivy aws" and "trivy k8s" are not yet supported.
|
||||
|
||||
[cargo-auditable]: https://github.com/rust-secure-code/cargo-auditable/
|
||||
[new-json]: https://github.com/aquasecurity/trivy/discussions/1050
|
||||
[action]: https://github.com/aquasecurity/trivy-action
|
||||
[asff]: https://github.com/aquasecurity/trivy/blob/main/docs/docs/integrations/aws-security-hub.md
|
||||
[asff]: ../../tutorials/integrations/aws-security-hub.md
|
||||
[sarif]: https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-results-from-code-scanning
|
||||
[sprig]: http://masterminds.github.io/sprig/
|
||||
85
docs/docs/configuration/skipping.md
Normal file
85
docs/docs/configuration/skipping.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# Skipping Files and Directories
|
||||
|
||||
This section details ways to specify the files and directories that Trivy should not scan.
|
||||
|
||||
## Skip Files
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
By default, Trivy traverses directories and searches for all necessary files for scanning.
|
||||
You can skip files that you don't maintain using the `--skip-files` flag.
|
||||
|
||||
```
|
||||
$ trivy image --skip-files "/Gemfile.lock" --skip-files "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0/Gemfile.lock" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
|
||||
```
|
||||
|
||||
It's possible to specify globs as part of the value.
|
||||
|
||||
```bash
|
||||
$ trivy image --skip-files "./testdata/*/bar" .
|
||||
```
|
||||
|
||||
Will skip any file named `bar` in the subdirectories of testdata.
|
||||
|
||||
## Skip Directories
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | ✓ |
|
||||
| License | ✓ |
|
||||
|
||||
By default, Trivy traverses directories and searches for all necessary files for scanning.
|
||||
You can skip directories that you don't maintain using the `--skip-dirs` flag.
|
||||
|
||||
```
|
||||
$ trivy image --skip-dirs /var/lib/gems/2.5.0/gems/fluent-plugin-detect-exceptions-0.0.13 --skip-dirs "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0" quay.io/fluentd_elasticsearch/fluentd:v2.9.0
|
||||
```
|
||||
|
||||
It's possible to specify globs as part of the value.
|
||||
|
||||
```bash
|
||||
$ trivy image --skip-dirs "./testdata/*" .
|
||||
```
|
||||
|
||||
Will skip all subdirectories of the testdata directory.
|
||||
|
||||
!!! tip
|
||||
Glob patterns work with any trivy subcommand (image, config, etc.) and can be specified to skip both directories (with `--skip-dirs`) and files (with `--skip-files`).
|
||||
|
||||
|
||||
### Advanced globbing
|
||||
Trivy also supports the [globstar](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Pattern-Matching) pattern matching.
|
||||
|
||||
```bash
|
||||
$ trivy image --skip-files "**/foo" image:tag
|
||||
```
|
||||
|
||||
Will skip the file `foo` that happens to be nested under any parent(s).
|
||||
|
||||
## File patterns
|
||||
| Scanner | Supported |
|
||||
|:----------------:|:---------:|
|
||||
| Vulnerability | ✓ |
|
||||
| Misconfiguration | ✓ |
|
||||
| Secret | |
|
||||
| License | |
|
||||
|
||||
When a directory is given as an input, Trivy will recursively look for and test all files based on file patterns.
|
||||
The default file patterns are [here](../scanner/misconfiguration/custom/index.md).
|
||||
|
||||
In addition to the default file patterns, the `--file-patterns` option takes regexp patterns to look for your files.
|
||||
For example, it may be useful when your file name of Dockerfile doesn't match the default patterns.
|
||||
|
||||
This can be repeated for specifying multiple file patterns.
|
||||
|
||||
A file pattern contains the analyzer it is used for, and the pattern itself, joined by a semicolon. For example:
|
||||
```
|
||||
--file-patterns "dockerfile:.*.docker" --file-patterns "kubernetes:*.tpl" --file-patterns "pip:requirements-.*\.txt"
|
||||
```
|
||||
|
||||
The prefixes are listed [here](https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/pkg/fanal/analyzer/const.go)
|
||||
@@ -1,72 +1,5 @@
|
||||
# Docs
|
||||
|
||||
This documentation details how to use Trivy to access the features listed below.
|
||||
In this section you can find the complete reference documentation for all of the different features and settings that Trivy has to offer.
|
||||
|
||||
## 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, pnpm, 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])
|
||||
- **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][sbom] (Software Bill of Materials) support
|
||||
- CycloneDX
|
||||
- SPDX
|
||||
- GitHub Dependency Snapshots
|
||||
|
||||
Please see [LICENSE][license] for Trivy licensing information.
|
||||
|
||||
[installation]: ../index.md
|
||||
[vuln]: ../docs/vulnerability/scanning/index.md
|
||||
[misconf]: ../docs/misconfiguration/scanning.md
|
||||
[kubernetesoperator]: ../docs/kubernetes/operator/index.md
|
||||
[container]: ../docs/vulnerability/scanning/image.md
|
||||
[rootfs]: ../docs/vulnerability/scanning/rootfs.md
|
||||
[filesystem]: ../docs/vulnerability/scanning/filesystem.md
|
||||
[repo]: ../docs/vulnerability/scanning/git-repository.md
|
||||
[kubernetes]: ../docs/kubernetes/cli/scanning.md
|
||||
|
||||
[standalone]: ../docs/references/modes/standalone.md
|
||||
[client-server]: ../docs/references/modes/client-server.md
|
||||
[integrations]: ../tutorials/integrations/index.md
|
||||
|
||||
[os]: ../docs/vulnerability/detection/os.md
|
||||
[lang]: ../docs/vulnerability/detection/language.md
|
||||
|
||||
[builtin]: ../docs/misconfiguration/policy/builtin.md
|
||||
[quickstart]: ../getting-started/quickstart.md
|
||||
[podman]: ../docs/advanced/container/podman.md
|
||||
|
||||
[sbom]: ../docs/sbom/index.md
|
||||
|
||||
[oci]: https://github.com/opencontainers/image-spec
|
||||
[license]: https://github.com/aquasecurity/trivy/blob/main/LICENSE
|
||||
👈 Please use the side-navigation on the left in order to browse the different topics.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Woodpecker CI
|
||||
|
||||
This is a simple example configuration `.woodpecker/trivy.yml` that shows how you could get started:
|
||||
|
||||
```yml
|
||||
pipeline:
|
||||
securitycheck:
|
||||
image: aquasec/trivy:latest
|
||||
commands:
|
||||
# use any trivy command, if exit code is 0 woodpecker marks it as passed, else it assumes it failed
|
||||
- trivy fs --exit-code 1 --skip-dirs web/ --skip-dirs docs/ --severity MEDIUM,HIGH,CRITICAL .
|
||||
```
|
||||
|
||||
Woodpecker does use Trivy itself so you can see an [Example][example] run at its [Repository][repository] and how it was [added](https://github.com/woodpecker-ci/woodpecker/pull/1163).
|
||||
|
||||
[example]: https://ci.woodpecker-ci.org/woodpecker-ci/woodpecker/build/3520/37
|
||||
[repository]: https://github.com/woodpecker-ci/woodpecker
|
||||
@@ -1,68 +0,0 @@
|
||||
# Kubernetes Compliance
|
||||
|
||||
## NSA Complaince Report
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
The Trivy K8s CLI allows you to scan your Kubernetes cluster resources and generate the `NSA, CISA Kubernetes Hardening Guidance` report
|
||||
|
||||
[NSA, CISA Kubernetes Hardening Guidance v1.2](https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF) cybersecurity technical report is produced by trivy and validate the following control checks :
|
||||
|
||||
| NAME | DESCRIPTION | |
|
||||
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------------|
|
||||
| Non-root containers | Check that container is not running as root |
|
||||
| Immutable container file systems | Check that container root file system is immutable |
|
||||
| Preventing privileged containers | Controls whether Pods can run privileged containers |
|
||||
| Share containers process namespaces | Controls whether containers can share process namespaces |
|
||||
| Share host process namespaces | Controls whether share host process namespaces |
|
||||
| Use the host network | Controls whether containers can use the host network |
|
||||
| Run with root privileges or with root group membership | Controls whether container applications can run with <br/>root privileges or with root group membership |
|
||||
| Restricts escalation to root privileges | Control check restrictions escalation to root privileges |
|
||||
| Sets the SELinux context of the container | Control checks if pod sets the SELinux context of the container |
|
||||
| Restrict a container's access to resources with AppArmor | Control checks the restriction of containers access to resources with AppArmor |
|
||||
| Sets the seccomp profile used to sandbox containers | Control checks the sets the seccomp profile used to sandbox containers |
|
||||
| Protecting Pod service account tokens | Control check whether disable secret token been mount ,automountServiceAccountToken: false |
|
||||
| Namespace kube-system should not be used by users | Control check whether Namespace kube-system is not be used by users |
|
||||
| Pod and/or namespace Selectors usage | Control check validate the pod and/or namespace Selectors usage |
|
||||
| Use CNI plugin that supports NetworkPolicy API | Control check whether check cni plugin installed |
|
||||
| Use ResourceQuota policies to limit resources | Control check the use of ResourceQuota policy to limit aggregate resource usage within namespace |
|
||||
| Use LimitRange policies to limit resources | Control check the use of LimitRange policy limit resource usage for namespaces or nodes |
|
||||
| Control plan disable insecure port | Control check whether control plan disable insecure port |
|
||||
| Encrypt etcd communication | Control check whether etcd communication is encrypted |
|
||||
| Ensure kube config file permission | Control check whether kube config file permissions |
|
||||
| Check that encryption resource has been set | Control checks whether encryption resource has been set |
|
||||
| Check encryption provider | Control checks whether encryption provider has been set |
|
||||
| Make sure anonymous-auth is unset | Control checks whether anonymous-auth is unset |
|
||||
| Make sure -authorization-mode=RBAC | Control check whether RBAC permission is in use |
|
||||
| Audit policy is configure | Control check whether audit policy is configure |
|
||||
| Audit log path is configure | Control check whether audit log path is configure |
|
||||
| Audit log aging | Control check whether audit log aging is configure |
|
||||
|
||||
## CLI Commands
|
||||
|
||||
Scan a full cluster and generate a complliance NSA summary report:
|
||||
|
||||
```
|
||||
$ trivy k8s cluster --compliance=nsa --report summary
|
||||
```
|
||||
|
||||

|
||||
|
||||
***Note*** : The `compliance` column represent the calculation of all tests pass vs. fail for all resources per control check in percentage format.
|
||||
|
||||
Example: if I have two resources in cluster and one resource scan result show pass while the other one show fail for `1.0 Non-root Containers` then it compliance will show 50%
|
||||
|
||||
An additional report is supported to get all of the detail the output contains, use `--report all`
|
||||
```
|
||||
$ trivy k8s cluster --compliance=nsa --report all
|
||||
```
|
||||
Report also supported in json format examples :
|
||||
|
||||
```
|
||||
$ trivy k8s cluster --compliance=nsa --report summary --format json
|
||||
```
|
||||
|
||||
```
|
||||
$ trivy k8s cluster --compliance=nsa --report all --format json
|
||||
```
|
||||
@@ -1,14 +0,0 @@
|
||||
# Trivy Operator
|
||||
|
||||
Trivy has a native [Kubernetes Operator][operator] which continuously scans your Kubernetes cluster for security issues, and generates security reports as Kubernetes [Custom Resources][crd]. It does it by watching Kubernetes for state changes and automatically triggering scans in response to changes, for example initiating a vulnerability scan when a new Pod is created.
|
||||
|
||||
|
||||
> Kubernetes-native security toolkit. ([Documentation][trivy-operator]).
|
||||
|
||||
<figure>
|
||||
<figcaption>Workload reconcilers discover K8s controllers, manage scan jobs, and create VulnerabilityReport and ConfigAuditReport objects.</figcaption>
|
||||
</figure>
|
||||
|
||||
[operator]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
|
||||
[crd]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/
|
||||
[trivy-operator]: https://aquasecurity.github.io/trivy-operator/latest
|
||||
@@ -1,24 +0,0 @@
|
||||
# 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 | :material-check: | :material-close: |
|
||||
| Policy Metadata[^1] | :material-check: | :material-check: |
|
||||
| Show Successes | :material-check: | :material-check: |
|
||||
| Disable Policies | :material-check: | :material-check: |
|
||||
| Show Issue Lines | :material-check: | :material-check: |
|
||||
| View Statistics | :material-close: | :material-check: |
|
||||
| Filtering by Severity | :material-check: | :material-close: |
|
||||
| Supported Formats | Dockerfile, JSON, YAML, Terraform, CloudFormation etc. | CloudFormation JSON and YAML |
|
||||
|
||||
[^1]: 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
|
||||
@@ -1,43 +0,0 @@
|
||||
# vs Conftest
|
||||
[Conftest][conftest] is a really nice tool to help you write tests against structured configuration data.
|
||||
Misconfiguration detection in Trivy is heavily inspired by Conftest and provides similar features Conftest has.
|
||||
This section describes the differences between Trivy and Conftest.
|
||||
|
||||
| Feature | Trivy | Conftest |
|
||||
| --------------------------- | -------------------- | -------------------- |
|
||||
| Support Rego Language | :material-check: | :material-check: |
|
||||
| Built-in Policies | :material-check: | :material-close: |
|
||||
| Custom Policies | :material-check: | :material-check: |
|
||||
| Custom Data | :material-check: | :material-check: |
|
||||
| Combine | :material-check: | :material-check: |
|
||||
| Combine per Policy | :material-check: | :material-close: |
|
||||
| Policy Input Selector[^1] | :material-check: | :material-close: |
|
||||
| Policy Metadata[^2] | :material-check: | :material-close:[^3] |
|
||||
| Filtering by Severity | :material-check: | :material-close: |
|
||||
| Rule-based Exceptions | :material-check: | :material-check: |
|
||||
| Namespace-based Exceptions | :material-check: | :material-close: |
|
||||
| Sharing Policies | :material-close: | :material-check: |
|
||||
| Show Successes | :material-check: | :material-close: |
|
||||
| Flexible Exit Code | :material-check: | :material-close: |
|
||||
| Rego Unit Tests | :material-close:[^4] | :material-check: |
|
||||
| Go Testing | :material-check: | :material-close: |
|
||||
| Verbose Trace | :material-check: | :material-check: |
|
||||
| Supported Formats | 6 formats[^5] | 14 formats[^6] |
|
||||
|
||||
Trivy offers built-in policies and a variety of options, while Conftest only supports custom policies.
|
||||
In other words, Conftest is simpler and lighter.
|
||||
|
||||
Conftest is a general testing tool for configuration files, and Trivy is more security-focused.
|
||||
People who need an out-of-the-box misconfiguration scanner should use Trivy.
|
||||
People who don't need built-in policies and write your policies should use Conftest.
|
||||
|
||||
[^1]: Pass only the types of configuration file as input, specified in selector
|
||||
[^2]: To enrich the results such as ID, Title, Description, etc.
|
||||
[^3]: Conftest supports [structured errors in rules][conftest-structured], but they are free format and not natively supported by Conftest.
|
||||
[^4]: Trivy is not able to run `*_test.rego` like `conftest verify`.
|
||||
[^5]: Dockerfile, HCL, HCL2, JSON, TOML, and YAML
|
||||
[^6]: CUE, Dockerfile, EDN, HCL, HCL2, HOCON, Ignore files, INI, JSON, Jsonnet, TOML, VCL, XML, and YAML
|
||||
|
||||
|
||||
[conftest-structured]: https://github.com/open-policy-agent/conftest/pull/243
|
||||
[conftest]: https://github.com/open-policy-agent/conftest
|
||||
@@ -1,25 +0,0 @@
|
||||
# vs tfsec
|
||||
[tfsec][tfsec] uses static analysis of your Terraform templates to spot potential security issues.
|
||||
Trivy uses tfsec internally to scan Terraform HCL files, but Trivy doesn't support some features provided by tfsec.
|
||||
This section describes the differences between Trivy and tfsec.
|
||||
|
||||
| Feature | Trivy | tfsec |
|
||||
|-----------------------|--------------------------------------------------------|----------------------|
|
||||
| Built-in Policies | :material-check: | :material-check: |
|
||||
| Custom Policies | Rego | Rego, JSON, and YAML |
|
||||
| Policy Metadata[^1] | :material-check: | :material-check: |
|
||||
| Show Successes | :material-check: | :material-check: |
|
||||
| Disable Policies | :material-check: | :material-check: |
|
||||
| Show Issue Lines | :material-check: | :material-check: |
|
||||
| Support .tfvars | :material-close: | :material-check: |
|
||||
| View Statistics | :material-close: | :material-check: |
|
||||
| Filtering by Severity | :material-check: | :material-check: |
|
||||
| Supported Formats | Dockerfile, JSON, YAML, Terraform, CloudFormation etc. | Terraform |
|
||||
|
||||
[^1]: To enrich the results such as ID, Title, Description, Severity, etc.
|
||||
|
||||
tfsec is designed for Terraform.
|
||||
People who use only Terraform should use tfsec.
|
||||
People who want to scan a wide range of configuration files should use Trivy.
|
||||
|
||||
[tfsec]: https://github.com/aquasecurity/tfsec
|
||||
@@ -1,296 +0,0 @@
|
||||
# Examples
|
||||
|
||||
## Custom Policy
|
||||
### Kubernetes
|
||||
See [here][k8s].
|
||||
|
||||
The custom policy is defined in `user.kubernetes.ID001` package.
|
||||
You need to pass the package prefix you want to evaluate through `--namespaces` option.
|
||||
In this case, the package prefix should be `user`, `user.kubernetes`, or `user.kubernetes.ID001`.
|
||||
|
||||
### Dockerfile
|
||||
See [here][dockerfile].
|
||||
|
||||
The input will be a dictionary of stages.
|
||||
|
||||
#### Single Stage
|
||||
|
||||
??? example
|
||||
Dockerfile
|
||||
```dockerfile
|
||||
FROM foo
|
||||
COPY . /
|
||||
RUN echo hello
|
||||
```
|
||||
|
||||
Rego Input
|
||||
```json
|
||||
{
|
||||
"stages": {
|
||||
"foo": [
|
||||
{
|
||||
"Cmd": "from",
|
||||
"EndLine": 1,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "FROM foo",
|
||||
"Stage": 0,
|
||||
"StartLine": 1,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"foo"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "copy",
|
||||
"EndLine": 2,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "COPY . /",
|
||||
"Stage": 0,
|
||||
"StartLine": 2,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
".",
|
||||
"/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "run",
|
||||
"EndLine": 3,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "RUN echo hello",
|
||||
"Stage": 0,
|
||||
"StartLine": 3,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"echo hello"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Multi Stage
|
||||
|
||||
??? example
|
||||
Dockerfile
|
||||
```dockerfile
|
||||
FROM golang:1.16 AS builder
|
||||
WORKDIR /go/src/github.com/alexellis/href-counter/
|
||||
RUN go get -d -v golang.org/x/net/html
|
||||
COPY app.go .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add ca-certificates \
|
||||
&& apk add --no-cache bash
|
||||
WORKDIR /root/
|
||||
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
|
||||
CMD ["./app"]
|
||||
```
|
||||
|
||||
Rego Input
|
||||
```json
|
||||
{
|
||||
"stages": {
|
||||
"alpine:latest": [
|
||||
{
|
||||
"Cmd": "from",
|
||||
"EndLine": 7,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "FROM alpine:latest",
|
||||
"Stage": 1,
|
||||
"StartLine": 7,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"alpine:latest"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "run",
|
||||
"EndLine": 9,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "RUN apk --no-cache add ca-certificates \u0026\u0026 apk add --no-cache bash",
|
||||
"Stage": 1,
|
||||
"StartLine": 8,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"apk --no-cache add ca-certificates \u0026\u0026 apk add --no-cache bash"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "workdir",
|
||||
"EndLine": 10,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "WORKDIR /root/",
|
||||
"Stage": 1,
|
||||
"StartLine": 10,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"/root/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "copy",
|
||||
"EndLine": 11,
|
||||
"Flags": [
|
||||
"--from=builder"
|
||||
],
|
||||
"JSON": false,
|
||||
"Original": "COPY --from=builder /go/src/github.com/alexellis/href-counter/app .",
|
||||
"Stage": 1,
|
||||
"StartLine": 11,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"/go/src/github.com/alexellis/href-counter/app",
|
||||
"."
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "cmd",
|
||||
"EndLine": 12,
|
||||
"Flags": [],
|
||||
"JSON": true,
|
||||
"Original": "CMD [\"./app\"]",
|
||||
"Stage": 1,
|
||||
"StartLine": 12,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"./app"
|
||||
]
|
||||
}
|
||||
],
|
||||
"golang:1.16 AS builder": [
|
||||
{
|
||||
"Cmd": "from",
|
||||
"EndLine": 1,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "FROM golang:1.16 AS builder",
|
||||
"Stage": 0,
|
||||
"StartLine": 1,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"golang:1.16",
|
||||
"AS",
|
||||
"builder"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "workdir",
|
||||
"EndLine": 2,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "WORKDIR /go/src/github.com/alexellis/href-counter/",
|
||||
"Stage": 0,
|
||||
"StartLine": 2,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"/go/src/github.com/alexellis/href-counter/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "run",
|
||||
"EndLine": 3,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "RUN go get -d -v golang.org/x/net/html",
|
||||
"Stage": 0,
|
||||
"StartLine": 3,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"go get -d -v golang.org/x/net/html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "copy",
|
||||
"EndLine": 4,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "COPY app.go .",
|
||||
"Stage": 0,
|
||||
"StartLine": 4,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"app.go",
|
||||
"."
|
||||
]
|
||||
},
|
||||
{
|
||||
"Cmd": "run",
|
||||
"EndLine": 5,
|
||||
"Flags": [],
|
||||
"JSON": false,
|
||||
"Original": "RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .",
|
||||
"Stage": 0,
|
||||
"StartLine": 5,
|
||||
"SubCmd": "",
|
||||
"Value": [
|
||||
"CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app ."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
See [here][compose].
|
||||
|
||||
Docker Compose uses YAML format for configurations. You can apply your Rego policies to `docker-compose.yml`.
|
||||
|
||||
### HCL
|
||||
See [here][hcl].
|
||||
|
||||
Trivy parses HCL files and converts into structured data.
|
||||
|
||||
!!! warning
|
||||
Terraform HCL files are not supported yet.
|
||||
|
||||
### Terraform Plan
|
||||
See [here][tfplan].
|
||||
|
||||
Use the command [terraform show][terraform-show] to convert the Terraform plan into JSON so that OPA can read the plan.
|
||||
|
||||
```bash
|
||||
$ terraform init
|
||||
$ terraform plan --out tfplan.binary
|
||||
$ terraform show -json tfplan.binary > tfplan.json
|
||||
```
|
||||
|
||||
For more details, see also [OPA document][opa-terraform].
|
||||
|
||||
### Serverless Framework
|
||||
See [here][serverless].
|
||||
|
||||
Server Framework uses YAML format for configurations. You can apply your Rego policies to `serverless.yaml`.
|
||||
|
||||
## Custom Data
|
||||
See [here][data].
|
||||
|
||||
## Combined Input
|
||||
See [here][combine].
|
||||
|
||||
## Go Testing
|
||||
See [here][go-testing].
|
||||
|
||||
[k8s]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/kubernetes/
|
||||
[dockerfile]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/dockerfile/
|
||||
[compose]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/docker-compose/
|
||||
[hcl]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/hcl/
|
||||
[serverless]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/serverless/
|
||||
[tfplan]:https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy/terraform-plan/
|
||||
[terraform-show]: https://www.terraform.io/docs/cli/commands/show.html
|
||||
[opa-terraform]: https://www.openpolicyagent.org/docs/latest/terraform/
|
||||
|
||||
[custom]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-policy
|
||||
[data]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/custom-data
|
||||
[combine]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/combine
|
||||
[go-testing]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/go-testing
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# Filter Misconfigurations
|
||||
|
||||
## By Severity
|
||||
|
||||
Use `--severity` option.
|
||||
|
||||
```bash
|
||||
trivy conf --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```shell
|
||||
2022-05-16T13:50:42.718+0100 INFO Detected config files: 3
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 17 (SUCCESSES: 16, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
HIGH: Last USER command in Dockerfile should not be 'root'
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ds002
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:3
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
3 [ USER root
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 8 (SUCCESSES: 8, FAILURES: 0, EXCEPTIONS: 0)
|
||||
Failures: 0 (HIGH: 0, CRITICAL: 0)
|
||||
|
||||
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 0, CRITICAL: 1)
|
||||
|
||||
CRITICAL: Classic resources should not be used.
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
AWS Classic resources run in a shared environment with infrastructure owned by other AWS customers. You should run
|
||||
resources in a VPC instead.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/avd-aws-0081
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
main.tf:2-4
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
2 ┌ resource "aws_db_security_group" "sg" {
|
||||
3 │
|
||||
4 └ }
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
</details>
|
||||
@@ -1,4 +0,0 @@
|
||||
# Others
|
||||
|
||||
!!! hint
|
||||
See also [Others](../../vulnerability/examples/others.md) in Vulnerability section.
|
||||
@@ -1,35 +0,0 @@
|
||||
# Policy
|
||||
|
||||
## Pass custom policies
|
||||
You can pass directories including your custom policies through `--policy` option.
|
||||
This can be repeated for specifying multiple directories.
|
||||
|
||||
```bash
|
||||
cd examplex/misconf/
|
||||
trivy conf --policy custom-policy/policy --policy combine/policy --namespaces user misconf/mixed
|
||||
```
|
||||
|
||||
For more details, see [Custom Policies](../custom/index.md).
|
||||
|
||||
!!! tip
|
||||
You also need to specify `--namespaces` option.
|
||||
|
||||
## Pass custom data
|
||||
You can pass directories including your custom data through `--data` option.
|
||||
This can be repeated for specifying multiple directories.
|
||||
|
||||
```bash
|
||||
cd examples/misconf/custom-data
|
||||
trivy conf --policy ./policy --data ./data --namespaces user ./configs
|
||||
```
|
||||
|
||||
For more details, see [Custom Data](../custom/data.md).
|
||||
|
||||
## Pass namespaces
|
||||
By default, Trivy evaluates policies defined in `builtin.*`.
|
||||
If you want to evaluate custom policies in other packages, you have to specify package prefixes through `--namespaces` option.
|
||||
This can be repeated for specifying multiple packages.
|
||||
|
||||
``` bash
|
||||
trivy conf --policy ./policy --namespaces main --namespaces user ./configs
|
||||
```
|
||||
@@ -1,6 +0,0 @@
|
||||
# Report Formats
|
||||
|
||||
See [Reports Formats](../../vulnerability/examples/report.md) in Vulnerability section.
|
||||
|
||||
!!! caution
|
||||
Misconfiguration scanning doesn't support default templates such as XML for now.
|
||||
@@ -1,48 +0,0 @@
|
||||
# Value Overrides
|
||||
|
||||
Value files can be passed for supported scannable config files.
|
||||
|
||||
## Terraform value overrides
|
||||
You can pass `tf-vars` files to Trivy to override default values found in the Terraform HCL code.
|
||||
|
||||
```bash
|
||||
trivy conf --tf-vars dev.terraform.tfvars ./infrastructure/tf
|
||||
```
|
||||
|
||||
## Helm value overrides
|
||||
There are a number of options for overriding values in Helm charts. When override values are passed to the Helm scanner, the values will be used during the Manifest rendering process and will become part of the scanned artifact.
|
||||
|
||||
### Setting inline value overrides
|
||||
Overrides can be set inline on the command line
|
||||
|
||||
```bash
|
||||
trivy conf --helm-set securityContext.runAsUser=0 ./charts/mySql
|
||||
```
|
||||
|
||||
### Setting value file overrides
|
||||
Overrides can be in a file that has the key=value set.
|
||||
|
||||
```yaml
|
||||
# Example override file (overrides.yaml)
|
||||
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
```
|
||||
|
||||
```bash
|
||||
trivy conf --helm-values overrides.yaml ./charts/mySql
|
||||
```
|
||||
|
||||
### Setting value as explicit string
|
||||
the `--helm-set-string` is the same as `--helm-set` but explicitly retains the value as a string
|
||||
|
||||
```bash
|
||||
trivy config --helm-set-string name=false ./infrastructure/tf
|
||||
```
|
||||
|
||||
### Setting specific values from files
|
||||
Specific override values can come from specific files
|
||||
|
||||
```bash
|
||||
trivy conf --helm-set-file environment=dev.values.yaml ./charts/mySql
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
# Client
|
||||
|
||||
```bash
|
||||
Usage:
|
||||
trivy client [flags] IMAGE_NAME
|
||||
|
||||
Aliases:
|
||||
client, c
|
||||
|
||||
Scan Flags
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--security-checks string comma-separated list of what security issues to detect (vuln,config,secret) (default "vuln,secret")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--dependency-tree show dependency origin tree (EXPERIMENTAL)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
--report string specify a report format for the output. (all,summary) (default "all")
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Misconfiguration Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--file-patterns strings specify config file patterns, available with '--security-checks config'
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--remote string server address (default "http://localhost:4954")
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,49 +0,0 @@
|
||||
# Config
|
||||
|
||||
``` bash
|
||||
Scan config files for misconfigurations
|
||||
|
||||
Usage:
|
||||
trivy config [flags] DIR
|
||||
|
||||
Aliases:
|
||||
config, conf
|
||||
|
||||
Scan Flags
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
Misconfiguration Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--file-patterns strings specify config file patterns, available with '--security-checks config'
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,85 +0,0 @@
|
||||
# Filesystem
|
||||
|
||||
```bash
|
||||
Scan local filesystem
|
||||
|
||||
Usage:
|
||||
trivy filesystem [flags] PATH
|
||||
|
||||
Aliases:
|
||||
filesystem, fs
|
||||
|
||||
Examples:
|
||||
# Scan a local project including language-specific files
|
||||
$ trivy fs /path/to/your_project
|
||||
|
||||
# Scan a single file
|
||||
$ trivy fs ./trivy-ci-test/Pipfile.lock
|
||||
|
||||
Scan Flags
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--security-checks string comma-separated list of what security issues to detect (vuln,config,secret) (default "vuln,secret")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--dependency-tree show dependency origin tree (EXPERIMENTAL)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Misconfiguration Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--file-patterns strings specify config file patterns, available with '--security-checks config'
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Secret Flags
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
|
||||
License Flags
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--server string server address in client mode
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,103 +0,0 @@
|
||||
# Image
|
||||
|
||||
```bash
|
||||
Scan a container image
|
||||
|
||||
Usage:
|
||||
trivy image [flags] IMAGE_NAME
|
||||
|
||||
Aliases:
|
||||
image, i
|
||||
|
||||
Examples:
|
||||
# Scan a container image
|
||||
$ trivy image python:3.4-alpine
|
||||
|
||||
# Scan a container image from a tar archive
|
||||
$ trivy image --input ruby-3.1.tar
|
||||
|
||||
# Filter by severities
|
||||
$ trivy image --severity HIGH,CRITICAL alpine:3.15
|
||||
|
||||
# Ignore unfixed/unpatched vulnerabilities
|
||||
$ trivy image --ignore-unfixed alpine:3.15
|
||||
|
||||
# Scan a container image in client mode
|
||||
$ trivy image --server http://127.0.0.1:4954 alpine:latest
|
||||
|
||||
# Generate json result
|
||||
$ trivy image --format json --output result.json alpine:3.15
|
||||
|
||||
# Generate a report in the CycloneDX format
|
||||
$ trivy image --format cyclonedx --output result.cdx alpine:3.15
|
||||
|
||||
Scan Flags
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--security-checks string comma-separated list of what security issues to detect (vuln,config,secret) (default "vuln,secret")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Image Flags
|
||||
--input string input file path instead of image name
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine)
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Misconfiguration Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--file-patterns strings specify config file patterns, available with '--security-checks config'
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Secret Flags
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
|
||||
License Flags
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--server string server address in client mode
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,50 +0,0 @@
|
||||
Trivy has several sub commands, image, fs, repo, client and server.
|
||||
|
||||
``` bash
|
||||
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues and hard-coded secrets
|
||||
|
||||
Usage:
|
||||
trivy [global flags] command [flags] target
|
||||
trivy [command]
|
||||
|
||||
Examples:
|
||||
# Scan a container image
|
||||
$ trivy image python:3.4-alpine
|
||||
|
||||
# Scan a container image from a tar archive
|
||||
$ trivy image --input ruby-3.1.tar
|
||||
|
||||
# Scan local filesystem
|
||||
$ trivy fs .
|
||||
|
||||
# Run in server mode
|
||||
$ trivy server
|
||||
|
||||
Available Commands:
|
||||
config Scan config files for misconfigurations
|
||||
filesystem Scan local filesystem
|
||||
help Help about any command
|
||||
image Scan a container image
|
||||
kubernetes scan kubernetes cluster
|
||||
module Manage modules
|
||||
plugin Manage plugins
|
||||
repository Scan a remote repository
|
||||
rootfs Scan rootfs
|
||||
sbom Scan SBOM for vulnerabilities
|
||||
server Server mode
|
||||
version Print the version
|
||||
|
||||
Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
-f, --format string version format (json)
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
-h, --help help for trivy
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
|
||||
Use "trivy [command] --help" for more information about a command.
|
||||
```
|
||||
@@ -1,34 +0,0 @@
|
||||
# Plugin
|
||||
|
||||
```bash
|
||||
Manage plugins
|
||||
|
||||
Usage:
|
||||
trivy plugin [command]
|
||||
|
||||
Aliases:
|
||||
plugin, p
|
||||
|
||||
Available Commands:
|
||||
info Show information about the specified plugin
|
||||
install Install a plugin
|
||||
list List installed plugin
|
||||
run Run a plugin on the fly
|
||||
uninstall Uninstall a plugin
|
||||
update Update an existing plugin
|
||||
|
||||
Flags:
|
||||
-h, --help help for plugin
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
|
||||
Use "trivy plugin [command] --help" for more information about a command.
|
||||
```
|
||||
@@ -1,87 +0,0 @@
|
||||
# Repository
|
||||
|
||||
```bash
|
||||
Scan a remote repository
|
||||
|
||||
Usage:
|
||||
trivy repository [flags] REPO_URL
|
||||
|
||||
Aliases:
|
||||
repository, repo
|
||||
|
||||
Examples:
|
||||
# Scan your remote git repository
|
||||
$ trivy repo https://github.com/knqyf263/trivy-ci-test
|
||||
|
||||
Scan Flags
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--security-checks string comma-separated list of what security issues to detect (vuln,config,secret) (default "vuln,secret")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--dependency-tree show dependency origin tree (EXPERIMENTAL)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Misconfiguration Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--file-patterns strings specify config file patterns, available with '--security-checks config'
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Secret Flags
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
|
||||
License Flags
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--server string server address in client mode
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Repository Flags
|
||||
--branch string pass the branch name to be scanned
|
||||
--commit string pass the commit hash to be scanned
|
||||
--tag string pass the tag name to be scanned
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,94 +0,0 @@
|
||||
# Rootfs
|
||||
|
||||
```bash
|
||||
Scan rootfs
|
||||
|
||||
Usage:
|
||||
trivy rootfs [flags] ROOTDIR
|
||||
|
||||
Examples:
|
||||
# Scan unpacked filesystem
|
||||
$ docker export $(docker create alpine:3.10.2) | tar -C /tmp/rootfs -xvf -
|
||||
$ trivy rootfs /tmp/rootfs
|
||||
|
||||
# Scan from inside a container
|
||||
$ docker run --rm -it alpine:3.11
|
||||
/ # curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
|
||||
/ # trivy rootfs /
|
||||
|
||||
Scan Flags
|
||||
--file-patterns strings specify config file patterns
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (rekor)
|
||||
--security-checks strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--dependency-tree show dependency origin tree (EXPERIMENTAL)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Misconfiguration Flags
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
--include-non-failures include successes and exceptions, available with '--security-checks config'
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
|
||||
Secret Flags
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
|
||||
License Flags
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
|
||||
Rego Flags
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--trace enable more verbose trace output for custom queries
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--server string server address in client mode
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
# SBOM
|
||||
|
||||
```bash
|
||||
Scan SBOM for vulnerabilities
|
||||
|
||||
Usage:
|
||||
trivy sbom [flags] SBOM_PATH
|
||||
|
||||
Examples:
|
||||
# Scan CycloneDX and show the result in tables
|
||||
$ trivy sbom /path/to/report.cdx
|
||||
|
||||
# Scan CycloneDX and generate a CycloneDX report
|
||||
$ trivy sbom --format cyclonedx /path/to/report.cdx
|
||||
|
||||
# Scan CycloneDX-type attestation and show the result in tables
|
||||
$ trivy sbom /path/to/report.cdx.intoto.jsonl
|
||||
|
||||
|
||||
Scan Flags
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
--security-checks string comma-separated list of what security issues to detect (vuln,config,secret) (default "vuln,secret")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
|
||||
Report Flags
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, sarif, template, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Vulnerability Flags
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--vuln-type string comma-separated list of vulnerability types (os,library) (default "os,library")
|
||||
|
||||
Client/Server Flags
|
||||
--custom-headers strings custom headers in client mode
|
||||
--server string server address in client mode
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
@@ -1,49 +0,0 @@
|
||||
# Server
|
||||
|
||||
```bash
|
||||
Server mode
|
||||
|
||||
Usage:
|
||||
trivy server [flags]
|
||||
|
||||
Aliases:
|
||||
server, s
|
||||
|
||||
Examples:
|
||||
# Run a server
|
||||
$ trivy server
|
||||
|
||||
# Listen on 0.0.0.0:10000
|
||||
$ trivy server --listen 0.0.0.0:10000
|
||||
|
||||
|
||||
Cache Flags
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
|
||||
DB Flags
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--no-progress suppress progress bar
|
||||
--reset remove all caches and database
|
||||
--skip-db-update skip updating vulnerability database
|
||||
|
||||
Client/Server Flags
|
||||
--listen string listen address in server mode (default "localhost:4954")
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
60
docs/docs/references/configuration/cli/trivy.md
Normal file
60
docs/docs/references/configuration/cli/trivy.md
Normal file
@@ -0,0 +1,60 @@
|
||||
## trivy
|
||||
|
||||
Unified security scanner
|
||||
|
||||
### Synopsis
|
||||
|
||||
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues and hard-coded secrets
|
||||
|
||||
```
|
||||
trivy [global flags] command [flags] target
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# Scan a container image
|
||||
$ trivy image python:3.4-alpine
|
||||
|
||||
# Scan a container image from a tar archive
|
||||
$ trivy image --input ruby-3.1.tar
|
||||
|
||||
# Scan local filesystem
|
||||
$ trivy fs .
|
||||
|
||||
# Run in server mode
|
||||
$ trivy server
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
-f, --format string version format (json)
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
-h, --help help for trivy
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy aws](trivy_aws.md) - [EXPERIMENTAL] Scan AWS account
|
||||
* [trivy config](trivy_config.md) - Scan config files for misconfigurations
|
||||
* [trivy convert](trivy_convert.md) - Convert Trivy JSON report into a different format
|
||||
* [trivy filesystem](trivy_filesystem.md) - Scan local filesystem
|
||||
* [trivy image](trivy_image.md) - Scan a container image
|
||||
* [trivy kubernetes](trivy_kubernetes.md) - [EXPERIMENTAL] Scan kubernetes cluster
|
||||
* [trivy module](trivy_module.md) - Manage modules
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
* [trivy repository](trivy_repository.md) - Scan a remote repository
|
||||
* [trivy rootfs](trivy_rootfs.md) - Scan rootfs
|
||||
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities
|
||||
* [trivy server](trivy_server.md) - Server mode
|
||||
* [trivy version](trivy_version.md) - Print the version
|
||||
* [trivy vm](trivy_vm.md) - [EXPERIMENTAL] Scan a virtual machine image
|
||||
|
||||
118
docs/docs/references/configuration/cli/trivy_aws.md
Normal file
118
docs/docs/references/configuration/cli/trivy_aws.md
Normal file
@@ -0,0 +1,118 @@
|
||||
## trivy aws
|
||||
|
||||
[EXPERIMENTAL] Scan AWS account
|
||||
|
||||
### Synopsis
|
||||
|
||||
Scan an AWS account for misconfigurations. Trivy uses the same authentication methods as the AWS CLI. See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
|
||||
|
||||
The following services are supported:
|
||||
- accessanalyzer
|
||||
- api-gateway
|
||||
- athena
|
||||
- cloudfront
|
||||
- cloudtrail
|
||||
- cloudwatch
|
||||
- codebuild
|
||||
- documentdb
|
||||
- dynamodb
|
||||
- ec2
|
||||
- ecr
|
||||
- ecs
|
||||
- efs
|
||||
- eks
|
||||
- elasticache
|
||||
- elasticsearch
|
||||
- elb
|
||||
- emr
|
||||
- iam
|
||||
- kinesis
|
||||
- kms
|
||||
- lambda
|
||||
- mq
|
||||
- msk
|
||||
- neptune
|
||||
- rds
|
||||
- redshift
|
||||
- s3
|
||||
- sns
|
||||
- sqs
|
||||
- ssm
|
||||
- workspaces
|
||||
|
||||
|
||||
```
|
||||
trivy aws [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# basic scanning
|
||||
$ trivy aws --region us-east-1
|
||||
|
||||
# limit scan to a single service:
|
||||
$ trivy aws --region us-east-1 --service s3
|
||||
|
||||
# limit scan to multiple services:
|
||||
$ trivy aws --region us-east-1 --service s3 --service ec2
|
||||
|
||||
# force refresh of cache for fresh results
|
||||
$ trivy aws --region us-east-1 --update-cache
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--account string The AWS account to scan. It's useful to specify this when reviewing cached results for multiple accounts.
|
||||
--arn string The AWS ARN to show results for. Useful to filter results once a scan is cached.
|
||||
--compliance string compliance report to generate (aws-cis-1.2, aws-cis-1.4)
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--endpoint string AWS Endpoint override
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
-h, --help help for aws
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners config'
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--max-cache-age duration The maximum age of the cloud cache. Cached data will be requeried from the cloud provider if it is older than this. (default 24h0m0s)
|
||||
-o, --output string output file name
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--region string AWS Region to scan
|
||||
--report string specify a report format for the output. (all,summary) (default "all")
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--service strings Only scan AWS Service(s) specified with this flag. Can specify multiple services using --service A --service B etc.
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--skip-service strings Skip selected AWS Service(s) specified with this flag. Can specify multiple services using --skip-service A --skip-service B etc.
|
||||
-t, --template string output template
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--update-cache Update the cache for the applicable cloud provider instead of using cached results.
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
67
docs/docs/references/configuration/cli/trivy_config.md
Normal file
67
docs/docs/references/configuration/cli/trivy_config.md
Normal file
@@ -0,0 +1,67 @@
|
||||
## trivy config
|
||||
|
||||
Scan config files for misconfigurations
|
||||
|
||||
```
|
||||
trivy config [flags] DIR
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
-h, --help help for config
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-non-failures include successes and exceptions, available with '--scanners config'
|
||||
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
-o, --output string output file name
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--registry-token string registry token
|
||||
--report string specify a compliance report format for the output. (all,summary) (default "all")
|
||||
--reset-policy-bundle remove policy bundle
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
-t, --template string output template
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
52
docs/docs/references/configuration/cli/trivy_convert.md
Normal file
52
docs/docs/references/configuration/cli/trivy_convert.md
Normal file
@@ -0,0 +1,52 @@
|
||||
## trivy convert
|
||||
|
||||
Convert Trivy JSON report into a different format
|
||||
|
||||
```
|
||||
trivy convert [flags] RESULT_JSON
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# report conversion
|
||||
$ trivy image --format json --output result.json --list-all-pkgs debian:11
|
||||
$ trivy convert --format cyclonedx --output result.cdx result.json
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--compliance string compliance report to generate
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
|
||||
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
-h, --help help for convert
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-o, --output string output file name
|
||||
--report string specify a report format for the output. (all,summary) (default "all")
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
-t, --template string output template
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
103
docs/docs/references/configuration/cli/trivy_filesystem.md
Normal file
103
docs/docs/references/configuration/cli/trivy_filesystem.md
Normal file
@@ -0,0 +1,103 @@
|
||||
## trivy filesystem
|
||||
|
||||
Scan local filesystem
|
||||
|
||||
```
|
||||
trivy filesystem [flags] PATH
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# Scan a local project including language-specific files
|
||||
$ trivy fs /path/to/your_project
|
||||
|
||||
# Scan a single file
|
||||
$ trivy fs ./trivy-ci-test/Pipfile.lock
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
-h, --help help for filesystem
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--include-dev-deps include development dependencies in the report (supported: npm)
|
||||
--include-non-failures include successes and exceptions, available with '--scanners config'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
-o, --output string output file name
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--registry-token string registry token
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--report string specify a compliance report format for the output. (all,summary) (default "all")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--slow scan over time with lower CPU and memory utilization
|
||||
-t, --template string output template
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
124
docs/docs/references/configuration/cli/trivy_image.md
Normal file
124
docs/docs/references/configuration/cli/trivy_image.md
Normal file
@@ -0,0 +1,124 @@
|
||||
## trivy image
|
||||
|
||||
Scan a container image
|
||||
|
||||
```
|
||||
trivy image [flags] IMAGE_NAME
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# Scan a container image
|
||||
$ trivy image python:3.4-alpine
|
||||
|
||||
# Scan a container image from a tar archive
|
||||
$ trivy image --input ruby-3.1.tar
|
||||
|
||||
# Filter by severities
|
||||
$ trivy image --severity HIGH,CRITICAL alpine:3.15
|
||||
|
||||
# Ignore unfixed/unpatched vulnerabilities
|
||||
$ trivy image --ignore-unfixed alpine:3.15
|
||||
|
||||
# Scan a container image in client mode
|
||||
$ trivy image --server http://127.0.0.1:4954 alpine:latest
|
||||
|
||||
# Generate json result
|
||||
$ trivy image --format json --output result.json alpine:3.15
|
||||
|
||||
# Generate a report in the CycloneDX format
|
||||
$ trivy image --format cyclonedx --output result.cdx alpine:3.15
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate (docker-cis)
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--custom-headers strings custom headers in client mode
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--docker-host string unix domain socket path to use for docker scanning
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table, json, template, sarif, cyclonedx, spdx, spdx-json, github, cosign-vuln) (default "table")
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
-h, --help help for image
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignored-licenses strings specify a list of license to ignore
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--image-config-scanners string comma-separated list of what security issues to detect on container image configurations (config,secret)
|
||||
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
|
||||
--include-non-failures include successes and exceptions, available with '--scanners config'
|
||||
--input string input file path instead of image name
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--license-confidence-level float specify license classifier's confidence level (default 0.9)
|
||||
--license-full eagerly look for licenses in source code headers and license files
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
--no-progress suppress progress bar
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
-o, --output string output file name
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--platform string set platform in the form os/arch if image is multi-platform capable
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--registry-token string registry token
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine)
|
||||
--report string specify a format for the compliance report. (default "summary")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners strings comma-separated list of what security issues to detect (vuln,config,secret,license) (default [vuln,secret])
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
--server string server address in client mode
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--slow scan over time with lower CPU and memory utilization
|
||||
-t, --template string output template
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
--token string for authentication in client/server mode
|
||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
112
docs/docs/references/configuration/cli/trivy_kubernetes.md
Normal file
112
docs/docs/references/configuration/cli/trivy_kubernetes.md
Normal file
@@ -0,0 +1,112 @@
|
||||
## trivy kubernetes
|
||||
|
||||
[EXPERIMENTAL] Scan kubernetes cluster
|
||||
|
||||
```
|
||||
trivy kubernetes [flags] { cluster | all | specific resources like kubectl. eg: pods, pod/NAME }
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# cluster scanning
|
||||
$ trivy k8s --report summary cluster
|
||||
|
||||
# namespace scanning:
|
||||
$ trivy k8s -n kube-system --report summary all
|
||||
|
||||
# resources scanning:
|
||||
$ trivy k8s --report=summary deploy
|
||||
$ trivy k8s --namespace=kube-system --report=summary deploy,configmaps
|
||||
|
||||
# resource scanning:
|
||||
$ trivy k8s deployment/orion
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-A, --all-namespaces fetch resources from all cluster namespaces
|
||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||
--cache-ttl duration cache TTL when using redis as cache backend
|
||||
--clear-cache clear image caches without scanning
|
||||
--compliance string compliance report to generate (k8s-nsa,k8s-cis, k8s-pss-baseline, k8s-pss-restricted)
|
||||
--components strings specify which components to scan (default [workload,infra])
|
||||
--config-data strings specify paths from which data for the Rego policies will be recursively loaded
|
||||
--config-policy strings specify paths to the Rego policy files directory, applying config files
|
||||
--context string specify a context to scan
|
||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
|
||||
--download-db-only download/update vulnerability database but don't run a scan
|
||||
--download-java-db-only download/update Java index database but don't run a scan
|
||||
--exclude-nodes strings indicate the node labels that the node-collector job should exclude from scanning (example: kubernetes.io/arch:arm64,team:dev)
|
||||
--exit-code int specify exit code when any security issues are found
|
||||
--file-patterns strings specify config file patterns
|
||||
-f, --format string format (table, json, cyclonedx) (default "table")
|
||||
--helm-set strings specify Helm values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-set-file strings specify Helm values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
|
||||
--helm-set-string strings specify Helm string values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
|
||||
--helm-values strings specify paths to override the Helm values.yaml files
|
||||
-h, --help help for kubernetes
|
||||
--ignore-policy string specify the Rego file path to evaluate each vulnerability
|
||||
--ignore-unfixed display only fixed vulnerabilities
|
||||
--ignorefile string specify .trivyignore file (default ".trivyignore")
|
||||
--image-src strings image source(s) to use, in priority order (docker,containerd,podman,remote) (default [docker,containerd,podman,remote])
|
||||
--include-non-failures include successes and exceptions, available with '--scanners config'
|
||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
||||
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
|
||||
--kubeconfig string specify the kubeconfig file path to use
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability
|
||||
-n, --namespace string specify a namespace to scan
|
||||
--no-progress suppress progress bar
|
||||
--node-collector-namespace string specify the namespace in which the node-collector job should be deployed (default "trivy-temp")
|
||||
--offline-scan do not issue API requests to identify dependencies
|
||||
-o, --output string output file name
|
||||
--parallel int number (between 1-20) of goroutines enabled for parallel scanning (default 5)
|
||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||
--policy-namespaces strings Rego namespaces
|
||||
--redis-ca string redis ca file location, if using redis as cache backend
|
||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||
--redis-key string redis key file location, if using redis as cache backend
|
||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||
--registry-token string registry token
|
||||
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
|
||||
--report string specify a report format for the output. (all,summary) (default "all")
|
||||
--reset remove all caches and database
|
||||
--reset-policy-bundle remove policy bundle
|
||||
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
|
||||
--scanners string comma-separated list of what security issues to detect (vuln,config,secret,license) (default "vuln,config,secret,rbac")
|
||||
--secret-config string specify a path to config file for secret scanning (default "trivy-secret.yaml")
|
||||
-s, --severity string severities of security issues to be displayed (comma separated) (default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL")
|
||||
--skip-db-update skip updating vulnerability database
|
||||
--skip-dirs strings specify the directories where the traversal is skipped
|
||||
--skip-files strings specify the file paths to skip traversal
|
||||
--skip-java-db-update skip updating Java index database
|
||||
--skip-policy-update skip fetching rego policy updates
|
||||
--slow scan over time with lower CPU and memory utilization
|
||||
-t, --template string output template
|
||||
--tf-vars strings specify paths to override the Terraform tfvars files
|
||||
--tolerations strings specify node-collector job tolerations (example: key1=value1:NoExecute,key2=value2:NoSchedule)
|
||||
--trace enable more verbose trace output for custom queries
|
||||
--username strings username. Comma-separated usernames allowed.
|
||||
--vuln-type strings comma-separated list of vulnerability types (os,library) (default [os,library])
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
|
||||
31
docs/docs/references/configuration/cli/trivy_module.md
Normal file
31
docs/docs/references/configuration/cli/trivy_module.md
Normal file
@@ -0,0 +1,31 @@
|
||||
## trivy module
|
||||
|
||||
Manage modules
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
-h, --help help for module
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
* [trivy module install](trivy_module_install.md) - Install a module
|
||||
* [trivy module uninstall](trivy_module_uninstall.md) - Uninstall a module
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
## trivy module install
|
||||
|
||||
Install a module
|
||||
|
||||
```
|
||||
trivy module install [flags] REPOSITORY
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for install
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy module](trivy_module.md) - Manage modules
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
## trivy module uninstall
|
||||
|
||||
Uninstall a module
|
||||
|
||||
```
|
||||
trivy module uninstall [flags] REPOSITORY
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for uninstall
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy module](trivy_module.md) - Manage modules
|
||||
|
||||
33
docs/docs/references/configuration/cli/trivy_plugin.md
Normal file
33
docs/docs/references/configuration/cli/trivy_plugin.md
Normal file
@@ -0,0 +1,33 @@
|
||||
## trivy plugin
|
||||
|
||||
Manage plugins
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for plugin
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy](trivy.md) - Unified security scanner
|
||||
* [trivy plugin info](trivy_plugin_info.md) - Show information about the specified plugin
|
||||
* [trivy plugin install](trivy_plugin_install.md) - Install a plugin
|
||||
* [trivy plugin list](trivy_plugin_list.md) - List installed plugin
|
||||
* [trivy plugin run](trivy_plugin_run.md) - Run a plugin on the fly
|
||||
* [trivy plugin uninstall](trivy_plugin_uninstall.md) - Uninstall a plugin
|
||||
* [trivy plugin update](trivy_plugin_update.md) - Update an existing plugin
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
# Module
|
||||
## trivy plugin info
|
||||
|
||||
```bash
|
||||
Manage modules
|
||||
Show information about the specified plugin
|
||||
|
||||
Usage:
|
||||
trivy module [command]
|
||||
```
|
||||
trivy plugin info PLUGIN_NAME
|
||||
```
|
||||
|
||||
Aliases:
|
||||
module, m
|
||||
### Options
|
||||
|
||||
Available Commands:
|
||||
install Install a module
|
||||
uninstall Uninstall a module
|
||||
```
|
||||
-h, --help help for info
|
||||
```
|
||||
|
||||
Flags:
|
||||
-h, --help help for module
|
||||
### Options inherited from parent commands
|
||||
|
||||
Global Flags:
|
||||
--cache-dir string cache directory (default "/Users/teppei/Library/Caches/trivy")
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections when using TLS
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
|
||||
Use "trivy module [command] --help" for more information about a command.
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
## trivy plugin install
|
||||
|
||||
Install a plugin
|
||||
|
||||
```
|
||||
trivy plugin install URL | FILE_PATH
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for install
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
|
||||
31
docs/docs/references/configuration/cli/trivy_plugin_list.md
Normal file
31
docs/docs/references/configuration/cli/trivy_plugin_list.md
Normal file
@@ -0,0 +1,31 @@
|
||||
## trivy plugin list
|
||||
|
||||
List installed plugin
|
||||
|
||||
```
|
||||
trivy plugin list
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for list
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
|
||||
31
docs/docs/references/configuration/cli/trivy_plugin_run.md
Normal file
31
docs/docs/references/configuration/cli/trivy_plugin_run.md
Normal file
@@ -0,0 +1,31 @@
|
||||
## trivy plugin run
|
||||
|
||||
Run a plugin on the fly
|
||||
|
||||
```
|
||||
trivy plugin run URL | FILE_PATH
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for run
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
## trivy plugin uninstall
|
||||
|
||||
Uninstall a plugin
|
||||
|
||||
```
|
||||
trivy plugin uninstall PLUGIN_NAME
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for uninstall
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--cache-dir string cache directory (default "/path/to/cache")
|
||||
-c, --config string config path (default "trivy.yaml")
|
||||
-d, --debug debug mode
|
||||
--generate-default-config write the default config to trivy-default.yaml
|
||||
--insecure allow insecure server connections
|
||||
-q, --quiet suppress progress bar and log output
|
||||
--timeout duration timeout (default 5m0s)
|
||||
-v, --version show version
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [trivy plugin](trivy_plugin.md) - Manage plugins
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user