Compare commits
668 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45dae7c2cf | ||
|
|
469028dca5 | ||
|
|
ae9ba340af | ||
|
|
783cf6fe74 | ||
|
|
603825a4f9 | ||
|
|
a3a66df007 | ||
|
|
bb06f6f8cf | ||
|
|
6b501219de | ||
|
|
57192bd5ae | ||
|
|
9f8685c14e | ||
|
|
ed322ac666 | ||
|
|
8d4dba02c9 | ||
|
|
a6685b1bad | ||
|
|
56265a9b98 | ||
|
|
c6f68e361d | ||
|
|
6ae4b360fd | ||
|
|
6def863470 | ||
|
|
e98bde3396 | ||
|
|
736e3f11f7 | ||
|
|
5b7e0a858d | ||
|
|
7699153c66 | ||
|
|
a70fd758ec | ||
|
|
e99bf302b6 | ||
|
|
64854fc850 | ||
|
|
e77cfd6487 | ||
|
|
e778ac3e21 | ||
|
|
aedcf5b58c | ||
|
|
5b821d3b13 | ||
|
|
f0720f3ce5 | ||
|
|
581fe1ed55 | ||
|
|
7a4e0687fc | ||
|
|
422b0fc0f1 | ||
|
|
260756d5b9 | ||
|
|
9b22035967 | ||
|
|
c96090ca2c | ||
|
|
14be70aa51 | ||
|
|
71980feca1 | ||
|
|
d94df3d9be | ||
|
|
d213223044 | ||
|
|
8e0c537392 | ||
|
|
005d0243df | ||
|
|
7de7a1f8f3 | ||
|
|
f64534651a | ||
|
|
164094968f | ||
|
|
6be6f74d5c | ||
|
|
ac2fdc87ae | ||
|
|
fe2ae8edc8 | ||
|
|
0ed39fc805 | ||
|
|
7111301fa4 | ||
|
|
c36a373def | ||
|
|
e060026ec8 | ||
|
|
8d03e5af9f | ||
|
|
938c0d1866 | ||
|
|
6e8b50ede9 | ||
|
|
4a197efcb2 | ||
|
|
e2c3bc4124 | ||
|
|
57ed577459 | ||
|
|
4656850c04 | ||
|
|
c537c91d75 | ||
|
|
ee58d53fc8 | ||
|
|
776ef1a31e | ||
|
|
6ed789e88b | ||
|
|
bc27198d3e | ||
|
|
4c35084f27 | ||
|
|
394c948130 | ||
|
|
6b515bc736 | ||
|
|
25416ae6d8 | ||
|
|
85cca55930 | ||
|
|
b944ac6286 | ||
|
|
9809a07bf1 | ||
|
|
e9831cec2f | ||
|
|
04c01f6297 | ||
|
|
86e19bb677 | ||
|
|
484ddd897d | ||
|
|
9e7404e76d | ||
|
|
6ce9404c16 | ||
|
|
85c6529cb5 | ||
|
|
6c983cbf45 | ||
|
|
1ac4fd8a61 | ||
|
|
094db23a03 | ||
|
|
b6f615b535 | ||
|
|
d6d0a60d16 | ||
|
|
6f1035269d | ||
|
|
396e404eeb | ||
|
|
79e941df0d | ||
|
|
cb76acbd9f | ||
|
|
3d2fc78852 | ||
|
|
3e3c119555 | ||
|
|
685a92e09a | ||
|
|
1e0b03d47f | ||
|
|
6765c77c38 | ||
|
|
644ada1279 | ||
|
|
c9f9a9c917 | ||
|
|
bcc231d3ba | ||
|
|
7cecade3a1 | ||
|
|
a9ddb39d5f | ||
|
|
a02c06bafd | ||
|
|
e85881231f | ||
|
|
8d13f3da95 | ||
|
|
276daae672 | ||
|
|
546e7bd6b1 | ||
|
|
b69c4de757 | ||
|
|
33b8521aee | ||
|
|
c0ad4f705e | ||
|
|
a6f4ab3735 | ||
|
|
8ae754a7d2 | ||
|
|
313ade3386 | ||
|
|
b331e771aa | ||
|
|
bfe5c6f14f | ||
|
|
363a3e40ea | ||
|
|
b213956cea | ||
|
|
efbc968ca8 | ||
|
|
9a601d49ef | ||
|
|
a589353bb3 | ||
|
|
f38f8d66fb | ||
|
|
decad9b429 | ||
|
|
9c531904ad | ||
|
|
2b1de93249 | ||
|
|
5423196f4c | ||
|
|
6fb477097c | ||
|
|
df669592ed | ||
|
|
74fcd3f881 | ||
|
|
d523424fda | ||
|
|
42267f94c5 | ||
|
|
4d382a0302 | ||
|
|
1343996fec | ||
|
|
8a877c5b29 | ||
|
|
59f1a04ba5 | ||
|
|
d5a62c9a5c | ||
|
|
f1c6af3121 | ||
|
|
0977dfcde8 | ||
|
|
6b2cd7e8da | ||
|
|
96ce2db949 | ||
|
|
6c25b8326e | ||
|
|
3912768470 | ||
|
|
a17c3eec2a | ||
|
|
d8b59efea9 | ||
|
|
60a81fcb95 | ||
|
|
c73650d967 | ||
|
|
6cfdffda18 | ||
|
|
510ce1a782 | ||
|
|
92c0452b74 | ||
|
|
1eb73f3fea | ||
|
|
270dc7346f | ||
|
|
a6ff0d12bb | ||
|
|
43997f33c8 | ||
|
|
64c91249ef | ||
|
|
7baccf2088 | ||
|
|
7dd7e2ba00 | ||
|
|
67d94774ba | ||
|
|
3e6dc37728 | ||
|
|
2dc5c9152e | ||
|
|
6daf62ebeb | ||
|
|
f9ee4943b1 | ||
|
|
c3e227b625 | ||
|
|
ca390411f3 | ||
|
|
c676361681 | ||
|
|
126fe0abba | ||
|
|
f7d02538f6 | ||
|
|
f982167c0a | ||
|
|
d3a73e4db7 | ||
|
|
5d5b93ed69 | ||
|
|
36498501bf | ||
|
|
3c0e354743 | ||
|
|
f5e655e22a | ||
|
|
af5882bc3e | ||
|
|
3d2921343b | ||
|
|
df47d1be15 | ||
|
|
ef8d77351f | ||
|
|
e18f38af3c | ||
|
|
0e937b5367 | ||
|
|
911c5e971a | ||
|
|
6fd1887e64 | ||
|
|
4059e94aba | ||
|
|
24005c3ed0 | ||
|
|
84af32a7fe | ||
|
|
193680b1ed | ||
|
|
22db37e9da | ||
|
|
4ab696eaa2 | ||
|
|
b7ec642572 | ||
|
|
1e1ccbec52 | ||
|
|
4ceae2a052 | ||
|
|
4e7e842682 | ||
|
|
089d34e866 | ||
|
|
bfb0f2a193 | ||
|
|
f19243127a | ||
|
|
4c6a866cce | ||
|
|
3ecc65d626 | ||
|
|
6b95d3857f | ||
|
|
894fa25106 | ||
|
|
f6cfcaf193 | ||
|
|
94f999ec07 | ||
|
|
4b4a0c95ba | ||
|
|
6d79fcacfc | ||
|
|
7a84438925 | ||
|
|
f8951f3847 | ||
|
|
afe3292843 | ||
|
|
3d23ad846c | ||
|
|
9822b40862 | ||
|
|
898aaaa11c | ||
|
|
c8682b55e2 | ||
|
|
bb6ff8511b | ||
|
|
f776a91d18 | ||
|
|
3bed96f0cf | ||
|
|
4a7544caea | ||
|
|
267adde71b | ||
|
|
b7fc3dfc98 | ||
|
|
95285015df | ||
|
|
89893a7303 | ||
|
|
dbba0bf152 | ||
|
|
3ef450d9a4 | ||
|
|
f4ec4e7483 | ||
|
|
96a5cb106a | ||
|
|
023e09e3f3 | ||
|
|
b3759f54fa | ||
|
|
dbf4b2dec5 | ||
|
|
2ae8faa7a8 | ||
|
|
5f004f03d9 | ||
|
|
3679bc358c | ||
|
|
0911eea9c0 | ||
|
|
029dd76c30 | ||
|
|
cc5d76b4ee | ||
|
|
be3993b60a | ||
|
|
a39133a13c | ||
|
|
995024f148 | ||
|
|
3487accd99 | ||
|
|
c8e07a4bf8 | ||
|
|
4249a1cadb | ||
|
|
c9f9a346cc | ||
|
|
52934d2340 | ||
|
|
5a58e41476 | ||
|
|
329f071b30 | ||
|
|
154ccc6e35 | ||
|
|
49cfa08d25 | ||
|
|
bcc0218200 | ||
|
|
fbb83c42d9 | ||
|
|
8a4b49ca70 | ||
|
|
7ba773f2bb | ||
|
|
bd94618b34 | ||
|
|
5feabc10ee | ||
|
|
fa03e9e983 | ||
|
|
fa5dcaf8f2 | ||
|
|
6d8ae1959c | ||
|
|
d137df24f7 | ||
|
|
2c57716359 | ||
|
|
d08f3dfd6d | ||
|
|
346496f943 | ||
|
|
6601d2957a | ||
|
|
2e870836dd | ||
|
|
4066b57a84 | ||
|
|
6e2453c2d6 | ||
|
|
7c94df539c | ||
|
|
8c33bae5a8 | ||
|
|
2cdacc1517 | ||
|
|
9acb240fdc | ||
|
|
4b193b4712 | ||
|
|
1f5b26254b | ||
|
|
79d1a0163f | ||
|
|
c1b4b5be16 | ||
|
|
bbe490b162 | ||
|
|
eb0da23d53 | ||
|
|
78286aaff1 | ||
|
|
4f9e46c8d3 | ||
|
|
1a6d9cb1b0 | ||
|
|
acaa8dd0be | ||
|
|
db6eb9a15b | ||
|
|
1d1f8f91c0 | ||
|
|
04040b95f8 | ||
|
|
142d67f296 | ||
|
|
34de675d87 | ||
|
|
4dd5732125 | ||
|
|
1e788040c5 | ||
|
|
ca57d318da | ||
|
|
03b16ea0ba | ||
|
|
bec2e29c59 | ||
|
|
b4ddc80c99 | ||
|
|
2061873f22 | ||
|
|
254a96e1d3 | ||
|
|
dff5dcea70 | ||
|
|
c7e8d201dc | ||
|
|
471e7cd5a4 | ||
|
|
8cd973739a | ||
|
|
67004a2b12 | ||
|
|
528d07ef37 | ||
|
|
065b301414 | ||
|
|
0e28f7ccb6 | ||
|
|
910b8e6017 | ||
|
|
5f69847698 | ||
|
|
3637c00b51 | ||
|
|
8bdd3feb3f | ||
|
|
85351adfa8 | ||
|
|
fbf50203cc | ||
|
|
18fde60392 | ||
|
|
c2f38ee378 | ||
|
|
a545e3af04 | ||
|
|
c039177958 | ||
|
|
86e72c0a43 | ||
|
|
177826a458 | ||
|
|
133c838902 | ||
|
|
da3d588276 | ||
|
|
9766c47042 | ||
|
|
db66572127 | ||
|
|
c3e132ade5 | ||
|
|
b194140c52 | ||
|
|
d048791355 | ||
|
|
005fe25c75 | ||
|
|
aac7cf576e | ||
|
|
fe1f9c916f | ||
|
|
9e3709fb09 | ||
|
|
ee54733e7b | ||
|
|
e913433934 | ||
|
|
483697b416 | ||
|
|
dcadfa883d | ||
|
|
bfd6eef94c | ||
|
|
69be985153 | ||
|
|
4d625c21e6 | ||
|
|
7663c9f902 | ||
|
|
c3279fd9b2 | ||
|
|
7443cba9b5 | ||
|
|
49301ccf6d | ||
|
|
6e222bd809 | ||
|
|
8c522a76af | ||
|
|
7fe75d50a0 | ||
|
|
0e84c4dcbf | ||
|
|
82d9d4b77f | ||
|
|
525aadf14c | ||
|
|
b72fa66c77 | ||
|
|
f2e05d55d0 | ||
|
|
1e9376bea4 | ||
|
|
0805e8667e | ||
|
|
f8eb21d63a | ||
|
|
ed00632796 | ||
|
|
1277e211ca | ||
|
|
5c663d389d | ||
|
|
411e5b8c97 | ||
|
|
327688504c | ||
|
|
b9a7fd1547 | ||
|
|
9825529600 | ||
|
|
4310d51b7e | ||
|
|
c04a638d1a | ||
|
|
ffb5c8520f | ||
|
|
533498f4f0 | ||
|
|
2768c280c9 | ||
|
|
4e8832de4f | ||
|
|
4b6109746e | ||
|
|
c6daf1a896 | ||
|
|
d2a4db8887 | ||
|
|
abf0055634 | ||
|
|
9806fa6f92 | ||
|
|
c4fdc40f82 | ||
|
|
1bb7e4894e | ||
|
|
d081855849 | ||
|
|
ab0cb4f73b | ||
|
|
49a72f216f | ||
|
|
0c8521a856 | ||
|
|
89fa4a27ab | ||
|
|
0d2edbfa36 | ||
|
|
996961a33f | ||
|
|
e9251fe0a8 | ||
|
|
965400a481 | ||
|
|
310dd3f5c0 | ||
|
|
91d4d9e385 | ||
|
|
88094b1142 | ||
|
|
c287239236 | ||
|
|
0a17306666 | ||
|
|
c506f43613 | ||
|
|
7e09a9f84a | ||
|
|
f733307991 | ||
|
|
bb5abd4cc7 | ||
|
|
18d683af15 | ||
|
|
6793d65417 | ||
|
|
776f0ec16d | ||
|
|
0523fbc6be | ||
|
|
95afbb1a11 | ||
|
|
7d550ea025 | ||
|
|
1ac6e8aef6 | ||
|
|
b640ef099c | ||
|
|
a688cdf7af | ||
|
|
0abfcf53e4 | ||
|
|
e0dfc37ef5 | ||
|
|
3f52e32786 | ||
|
|
0dbcb834ef | ||
|
|
6ad9b2558a | ||
|
|
6726d12587 | ||
|
|
41c0dbb767 | ||
|
|
0d03242cfc | ||
|
|
8a6775ad14 | ||
|
|
2674ce89ea | ||
|
|
802cc6fb26 | ||
|
|
b0de7fc645 | ||
|
|
223b1fd118 | ||
|
|
0ad38f33bc | ||
|
|
894d65898d | ||
|
|
7c72035b87 | ||
|
|
1829e36541 | ||
|
|
d974076fe1 | ||
|
|
5eb94f785b | ||
|
|
173b3eb654 | ||
|
|
c80126ab41 | ||
|
|
7e9fd6719c | ||
|
|
b76899c318 | ||
|
|
a2b995a671 | ||
|
|
12463ce1b0 | ||
|
|
9b78112814 | ||
|
|
ad721cf154 | ||
|
|
96f7cc774a | ||
|
|
843813c0f3 | ||
|
|
94460305f3 | ||
|
|
f7329d0d9f | ||
|
|
b04be6834a | ||
|
|
791cf73bcb | ||
|
|
92d1b61b5d | ||
|
|
7f5b5a6aa8 | ||
|
|
dd49885a45 | ||
|
|
eec42da179 | ||
|
|
074587e22a | ||
|
|
9a4e3b1ffa | ||
|
|
f76c806687 | ||
|
|
f21e5919a1 | ||
|
|
1dce67f41b | ||
|
|
8020b0fcfb | ||
|
|
fa57fce6c9 | ||
|
|
08e9240efd | ||
|
|
41c38375b5 | ||
|
|
34c3c46056 | ||
|
|
bb20d89469 | ||
|
|
62ccd79436 | ||
|
|
1c877da6fd | ||
|
|
ff9631b94f | ||
|
|
255bbe1477 | ||
|
|
6c11c0c5a6 | ||
|
|
1ac15af66b | ||
|
|
473fe3a487 | ||
|
|
b01a7b7207 | ||
|
|
beaf89351c | ||
|
|
57eafb5545 | ||
|
|
6434945ee2 | ||
|
|
fd1fbf9c54 | ||
|
|
1352f0e964 | ||
|
|
9a5940cede | ||
|
|
493a383497 | ||
|
|
9763688eca | ||
|
|
d4855d203c | ||
|
|
620831145c | ||
|
|
02c4a51493 | ||
|
|
fbce2901f9 | ||
|
|
ba0aeedfe8 | ||
|
|
3ec380e500 | ||
|
|
0058bafdee | ||
|
|
940367cf2c | ||
|
|
78845b4767 | ||
|
|
d55c687c2e | ||
|
|
e749817ebb | ||
|
|
8eb30c2f02 | ||
|
|
0f8ac99dfc | ||
|
|
380c05baee | ||
|
|
4ca24d9a6f | ||
|
|
e73d250a1d | ||
|
|
adc7ecc159 | ||
|
|
81e4ab54dd | ||
|
|
13823326ed | ||
|
|
c8cfd72cd5 | ||
|
|
0e8ab4f811 | ||
|
|
c0e4e47aba | ||
|
|
9bad4c6cc8 | ||
|
|
8e8274eca7 | ||
|
|
797fd0884f | ||
|
|
5d54332bb0 | ||
|
|
a922042d2a | ||
|
|
c3d5832300 | ||
|
|
959c07688e | ||
|
|
8172518a05 | ||
|
|
07a11744d5 | ||
|
|
3120d6c3e1 | ||
|
|
67b7257660 | ||
|
|
cb66108f4d | ||
|
|
ac56d1c24d | ||
|
|
867eee8499 | ||
|
|
1ab6552f73 | ||
|
|
60c5a04ad1 | ||
|
|
2bb882fdec | ||
|
|
a0f5bdc861 | ||
|
|
4a2b1c09d1 | ||
|
|
6fd4c8951f | ||
|
|
b2dd367f8e | ||
|
|
7141f20e88 | ||
|
|
f6a678c60a | ||
|
|
3cf1f4c972 | ||
|
|
271879331e | ||
|
|
493a70b45c | ||
|
|
b64a526223 | ||
|
|
1a53cbe31a | ||
|
|
34f865d6e5 | ||
|
|
30fc5b97da | ||
|
|
059deda653 | ||
|
|
c813a60b6f | ||
|
|
907e6be7fd | ||
|
|
4f9e51897e | ||
|
|
4a10108d11 | ||
|
|
3f358815c9 | ||
|
|
bac65cb793 | ||
|
|
a20d4811d2 | ||
|
|
7da3f7e57d | ||
|
|
42520f3edf | ||
|
|
b75c6c4158 | ||
|
|
da40228e28 | ||
|
|
91dc954116 | ||
|
|
e17931c273 | ||
|
|
8006d76f5d | ||
|
|
fde2487249 | ||
|
|
b62ebec01e | ||
|
|
66b9842ac9 | ||
|
|
fa1f12776b | ||
|
|
3f64bd6b32 | ||
|
|
c875ba5942 | ||
|
|
0bd417531d | ||
|
|
80595dc426 | ||
|
|
ceb4e47ef1 | ||
|
|
4025117c23 | ||
|
|
d56c477e5f | ||
|
|
717f36c819 | ||
|
|
e8d06ba336 | ||
|
|
81390970cd | ||
|
|
4c77b76406 | ||
|
|
a1e818ac5e | ||
|
|
81526ed0d9 | ||
|
|
83ff3fda25 | ||
|
|
aa4339ca41 | ||
|
|
b22aebf826 | ||
|
|
364cc862f7 | ||
|
|
05ea7f4201 | ||
|
|
8b3289c880 | ||
|
|
fc2f5ddbb2 | ||
|
|
21e1ebf92c | ||
|
|
bf63cc7f34 | ||
|
|
5d7149d6cf | ||
|
|
c63e3aa5d5 | ||
|
|
3ac504288d | ||
|
|
016f45e8d3 | ||
|
|
45ada28e38 | ||
|
|
b0937b624b | ||
|
|
bfa6e76141 | ||
|
|
f0dc9fa748 | ||
|
|
412209b0d1 | ||
|
|
3d55fc5ea6 | ||
|
|
495332ccd1 | ||
|
|
285e1f1bbf | ||
|
|
d3979a0d1f | ||
|
|
c87f30c25e | ||
|
|
d328815939 | ||
|
|
ca5843cec2 | ||
|
|
1d57f7be5c | ||
|
|
68eb4c6c8d | ||
|
|
eaf9fa5e3f | ||
|
|
60a7565870 | ||
|
|
78df35b570 | ||
|
|
162fb42d62 | ||
|
|
7d0165c767 | ||
|
|
7ef1e5f970 | ||
|
|
94f9cf49fb | ||
|
|
bed0a0ebd1 | ||
|
|
0c254184d6 | ||
|
|
306c551fdf | ||
|
|
9c6b9a69c3 | ||
|
|
2cb920d5d9 | ||
|
|
9bf16ae1ba | ||
|
|
3867fc71ee | ||
|
|
3348a0669e | ||
|
|
030687c989 | ||
|
|
a273649227 | ||
|
|
e6a79f7bc7 | ||
|
|
2c08d9d3dc | ||
|
|
673fc374ed | ||
|
|
511e061c0c | ||
|
|
55e97e97ce | ||
|
|
aac55275bb | ||
|
|
9aea551d86 | ||
|
|
72334df0c5 | ||
|
|
72e5ec702d | ||
|
|
971269bac8 | ||
|
|
98341f1e9e | ||
|
|
1e66346f29 | ||
|
|
e41cf57454 | ||
|
|
3813f90496 | ||
|
|
24c612e166 | ||
|
|
d993110d96 | ||
|
|
e4b1b64788 | ||
|
|
a1ea9aeeeb | ||
|
|
3aca6b2d6a | ||
|
|
a183360e76 | ||
|
|
7eb94404a3 | ||
|
|
985442dc1c | ||
|
|
95e89a424e | ||
|
|
728ba00be5 | ||
|
|
177a2b0ad9 | ||
|
|
f9907823b8 | ||
|
|
cf9d00dfc2 | ||
|
|
9e8f0bb4f0 | ||
|
|
83f0e2b08b | ||
|
|
b318dec1e0 | ||
|
|
3841cf6d94 | ||
|
|
cdeb41a58c | ||
|
|
4a9f3d9aa9 | ||
|
|
d5d2729237 | ||
|
|
a5ed21ec13 | ||
|
|
afcb70977c | ||
|
|
c9f8a8546e | ||
|
|
f9a8f80485 | ||
|
|
a8380ab5e5 | ||
|
|
430740f537 | ||
|
|
cef12efc04 | ||
|
|
3a38594cd1 | ||
|
|
6c02a38295 | ||
|
|
4e0c7fc226 | ||
|
|
dd938fd693 | ||
|
|
e41f180236 | ||
|
|
b7debf7f0a | ||
|
|
ce1f557cf7 | ||
|
|
9fa86c550a | ||
|
|
89f6348b9c | ||
|
|
faed25bfec | ||
|
|
856dd3a464 | ||
|
|
cb5b791d13 | ||
|
|
1211b105dc | ||
|
|
e9e2777c32 | ||
|
|
123ee18257 | ||
|
|
224069af28 | ||
|
|
5e96fa6a55 | ||
|
|
d773f56aae | ||
|
|
48a3ac53fb | ||
|
|
1d2fe13f28 | ||
|
|
c8127c458f | ||
|
|
2c3bf38c73 | ||
|
|
1778abe4e3 | ||
|
|
c0563f81bc | ||
|
|
028073bd02 | ||
|
|
8394568aa0 | ||
|
|
1b5c33658f | ||
|
|
808a6459b4 | ||
|
|
05821edb41 | ||
|
|
e55ec73aba | ||
|
|
fefe879691 | ||
|
|
bd57e64268 | ||
|
|
66aac5d640 | ||
|
|
f071cecd5c | ||
|
|
6a2ca8f74f | ||
|
|
5529c83920 | ||
|
|
022b948545 | ||
|
|
f99701585f | ||
|
|
76333a382c | ||
|
|
ed8de8b1aa | ||
|
|
e72e8693ef | ||
|
|
f06501ea2b | ||
|
|
e996e0112a | ||
|
|
f6fe06fd12 | ||
|
|
984ce9bd38 | ||
|
|
c7cf493ebd | ||
|
|
9916efbf5e | ||
|
|
0954e0f44b | ||
|
|
c7208b3efa | ||
|
|
262fee4195 | ||
|
|
9f32fd0525 | ||
|
|
8065c4bf53 | ||
|
|
64d449ee57 | ||
|
|
68cb8ceba4 | ||
|
|
ec2b20dcd8 | ||
|
|
552c4de1a0 | ||
|
|
7b3bf986e8 |
15
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Global
|
||||
* @knqyf263
|
||||
|
||||
# Helm chart
|
||||
helm/trivy/ @krol3
|
||||
|
||||
# Misconfiguration scanning
|
||||
examples/misconf/ @owenrumney @liamg @knqyf263
|
||||
docs/docs/misconfiguration @owenrumney @liamg @knqyf263
|
||||
pkg/fanal/analyzer/config @owenrumney @liamg @knqyf263
|
||||
pkg/fanal/handler/misconf @owenrumney @liamg @knqyf263
|
||||
|
||||
# Kubernetes scanning
|
||||
pkg/k8s/ @josedonizetti @chen-keinan @knqyf263
|
||||
docs/docs/kubernetes/ @josedonizetti @chen-keinan @knqyf263
|
||||
59
.github/workflows/canary.yaml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Canary build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'Dockerfile.canary'
|
||||
- '.github/workflows/canary.yaml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-binaries:
|
||||
name: Build binaries
|
||||
uses: ./.github/workflows/reusable-release.yaml
|
||||
with:
|
||||
goreleaser_config: goreleaser-canary.yml
|
||||
goreleaser_options: '--snapshot --rm-dist --timeout 60m' # will not release
|
||||
secrets: inherit
|
||||
|
||||
upload-binaries:
|
||||
name: Upload binaries
|
||||
needs: build-binaries # run this job after 'build-binaries' job completes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.0.4
|
||||
with:
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload artifacts (trivy_Linux-64bit)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: trivy_Linux-64bit
|
||||
path: dist/trivy_*_Linux-64bit.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_Linux-ARM64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: trivy_Linux-ARM64
|
||||
path: dist/trivy_*_Linux-ARM64.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_macOS-64bit)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: trivy_macOS-64bit
|
||||
path: dist/trivy_*_macOS-64bit.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifacts (trivy_macOS-ARM64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: trivy_macOS-ARM64
|
||||
path: dist/trivy_*_macOS-ARM64.tar.gz
|
||||
if-no-files-found: error
|
||||
2
.github/workflows/mkdocs-dev.yaml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/mkdocs-latest.yaml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
|
||||
4
.github/workflows/publish-chart.yaml
vendored
@@ -30,14 +30,14 @@ jobs:
|
||||
with:
|
||||
version: v3.5.0
|
||||
- name: Set up python
|
||||
uses: actions/setup-python@v3
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Setup Chart Linting
|
||||
id: lint
|
||||
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a
|
||||
- name: Setup Kubernetes cluster (KIND)
|
||||
uses: helm/kind-action@94729529f85113b88f4f819c17ce61382e6d8478
|
||||
uses: helm/kind-action@d08cf6ff1575077dee99962540d77ce91c62387d
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
image: ${{ env.KIND_IMAGE }}
|
||||
|
||||
87
.github/workflows/release.yaml
vendored
@@ -3,76 +3,37 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
env:
|
||||
GO_VERSION: "1.18"
|
||||
GH_USER: "aqua-bot"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
uses: ./.github/workflows/reusable-release.yaml
|
||||
with:
|
||||
goreleaser_config: goreleaser.yml
|
||||
goreleaser_options: '--rm-dist --timeout 60m'
|
||||
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
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
permissions:
|
||||
id-token: write # For cosign
|
||||
packages: write # For GHCR
|
||||
contents: read # Not required for public repositories, but for clarity
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install rpm reprepro createrepo distro-info
|
||||
- uses: sigstore/cosign-installer@51f8e5c6fce54e46006ae97d73b2b6315f518752
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Show available Docker Buildx platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v3.0.1
|
||||
|
||||
- name: Restore Trivy binaries from cache
|
||||
uses: actions/cache@v3.0.4
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
- name: Login to docker.io registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Login to ghcr.io registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ env.GH_USER }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to ECR
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: public.ecr.aws
|
||||
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
|
||||
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
|
||||
- name: Generate SBOM
|
||||
uses: CycloneDX/gh-gomod-generate-sbom@v1
|
||||
with:
|
||||
args: mod -licenses -json -output bom.json
|
||||
version: ^v1
|
||||
- name: Release
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: v1.4.1
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
path: dist/
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install rpm reprepro createrepo distro-info
|
||||
|
||||
- name: Checkout trivy-repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -80,13 +41,17 @@ jobs:
|
||||
path: trivy-repo
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
|
||||
- name: Setup git settings
|
||||
run: |
|
||||
git config --global user.email "knqyf263@gmail.com"
|
||||
git config --global user.name "Teppei Fukuda"
|
||||
|
||||
- name: Create rpm repository
|
||||
run: ci/deploy-rpm.sh
|
||||
|
||||
- name: Import GPG key
|
||||
run: echo -e "${{ secrets.GPG_KEY }}" | gpg --import
|
||||
|
||||
- name: Create deb repository
|
||||
run: ci/deploy-deb.sh
|
||||
run: ci/deploy-deb.sh
|
||||
109
.github/workflows/reusable-release.yaml
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
name: Reusable release
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
goreleaser_config:
|
||||
description: 'file path to GoReleaser config'
|
||||
required: true
|
||||
type: string
|
||||
goreleaser_options:
|
||||
description: 'GoReleaser options separated by spaces'
|
||||
default: ''
|
||||
required: false
|
||||
type: string
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.18"
|
||||
GH_USER: "aqua-bot"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
permissions:
|
||||
id-token: write # For cosign
|
||||
packages: write # For GHCR
|
||||
contents: read # Not required for public repositories, but for clarity
|
||||
steps:
|
||||
- name: Cosign install
|
||||
uses: sigstore/cosign-installer@48866aa521d8bf870604709cd43ec2f602d03ff2
|
||||
|
||||
- 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: Login to docker.io registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to ghcr.io registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ env.GH_USER }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Login to ECR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: public.ecr.aws
|
||||
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
|
||||
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate SBOM
|
||||
uses: CycloneDX/gh-gomod-generate-sbom@v1
|
||||
with:
|
||||
args: mod -licenses -json -output bom.json
|
||||
version: ^v1
|
||||
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v3
|
||||
with:
|
||||
version: v1.4.1
|
||||
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
|
||||
## push images to registries
|
||||
## only for canary build
|
||||
- name: Build and push
|
||||
if: ${{ inputs.goreleaser_config == 'goreleaser-canary.yml' }}
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/amd64, linux/arm64
|
||||
file: ./Dockerfile.canary # path to Dockerfile
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
aquasec/trivy:canary
|
||||
ghcr.io/aquasecurity/trivy:canary
|
||||
public.ecr.aws/aquasecurity/trivy:canary
|
||||
|
||||
- name: Cache Trivy binaries
|
||||
uses: actions/cache@v3.0.4
|
||||
with:
|
||||
path: dist/
|
||||
# use 'github.sha' to create a unique cache folder for each run.
|
||||
# use 'github.workflow' to create a unique cache folder if some runs have same commit sha.
|
||||
# e.g. build and release runs
|
||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
||||
4
.github/workflows/scan.yaml
vendored
@@ -13,11 +13,11 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run Trivy vulnerability scanner and create GitHub issues
|
||||
uses: knqyf263/trivy-issue-action@v0.0.3
|
||||
uses: knqyf263/trivy-issue-action@v0.0.4
|
||||
with:
|
||||
assignee: knqyf263
|
||||
severity: CRITICAL
|
||||
skip-dirs: integration,examples
|
||||
label: vulnerability
|
||||
label: kind/security
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
5
.github/workflows/semantic-pr.yaml
vendored
@@ -34,12 +34,14 @@ jobs:
|
||||
vuln
|
||||
misconf
|
||||
secret
|
||||
license
|
||||
|
||||
image
|
||||
fs
|
||||
repo
|
||||
sbom
|
||||
server
|
||||
k8s
|
||||
|
||||
alpine
|
||||
redhat
|
||||
@@ -78,6 +80,9 @@ jobs:
|
||||
|
||||
cli
|
||||
flag
|
||||
|
||||
cyclonedx
|
||||
spdx
|
||||
|
||||
helm
|
||||
report
|
||||
|
||||
2
.github/workflows/stale-issues.yaml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
timeout-minutes: 1
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v4
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been labeled with inactivity.'
|
||||
|
||||
55
.github/workflows/test.yaml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
pull_request:
|
||||
env:
|
||||
GO_VERSION: "1.18"
|
||||
TINYGO_VERSION: "0.23.0"
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
@@ -19,15 +20,29 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: go mod tidy
|
||||
run: |
|
||||
go mod tidy
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Run 'go mod tidy' and push it"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3.1.0
|
||||
uses: golangci/golangci-lint-action@v3.2.0
|
||||
with:
|
||||
version: v1.45
|
||||
args: --deadline=30m
|
||||
skip-cache: true # https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052197778
|
||||
|
||||
- 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: Run unit tests
|
||||
run: make test
|
||||
@@ -37,7 +52,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
@@ -48,6 +63,28 @@ jobs:
|
||||
- name: Run integration tests
|
||||
run: make test-integration
|
||||
|
||||
module-test:
|
||||
name: Module Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- 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: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run module integration tests
|
||||
run: |
|
||||
make test-module-integration
|
||||
|
||||
build-test:
|
||||
name: Build Test
|
||||
runs-on: ubuntu-latest
|
||||
@@ -55,11 +92,11 @@ jobs:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Show available Docker Buildx platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
@@ -68,15 +105,15 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
uses: goreleaser/goreleaser-action@v3
|
||||
with:
|
||||
version: v1.4.1
|
||||
args: release --snapshot --rm-dist --skip-publish
|
||||
args: release --snapshot --rm-dist --skip-publish --timeout 60m
|
||||
|
||||
build-documents:
|
||||
name: Documentation Test
|
||||
@@ -87,7 +124,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
|
||||
4
.gitignore
vendored
@@ -16,6 +16,7 @@
|
||||
*.out
|
||||
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
# Directory Cache Files
|
||||
.DS_Store
|
||||
@@ -30,3 +31,6 @@ integration/testdata/fixtures/images
|
||||
|
||||
# goreleaser output
|
||||
dist
|
||||
|
||||
# WebAssembly
|
||||
*.wasm
|
||||
|
||||
@@ -31,7 +31,6 @@ linters:
|
||||
- ineffassign
|
||||
- typecheck
|
||||
- govet
|
||||
- errcheck
|
||||
- varcheck
|
||||
- deadcode
|
||||
- revive
|
||||
@@ -49,6 +48,7 @@ run:
|
||||
- ".*._mock.go$"
|
||||
- ".*._test.go$"
|
||||
- "integration/*"
|
||||
- "examples/*"
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.15.4
|
||||
FROM alpine:3.16.0
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
COPY trivy /usr/local/bin/trivy
|
||||
COPY contrib/*.tpl contrib/
|
||||
|
||||
10
Dockerfile.canary
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM alpine:3.16.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
|
||||
ARG TARGETARCH
|
||||
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.18.0
|
||||
FROM golang:1.18.3
|
||||
|
||||
# Install protoc (cf. http://google.github.io/proto-lens/installing-protoc.html)
|
||||
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
|
||||
|
||||
74
Makefile
@@ -1,21 +1,42 @@
|
||||
VERSION := $(shell git describe --tags)
|
||||
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)"
|
||||
VERSION := $(shell git describe --tags --always)
|
||||
LDFLAGS := -ldflags "-s -w -X=main.version=$(VERSION)"
|
||||
|
||||
GOPATH=$(shell go env GOPATH)
|
||||
GOBIN=$(GOPATH)/bin
|
||||
GOSRC=$(GOPATH)/src
|
||||
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:
|
||||
GO111MODULE=off go get github.com/google/wire/cmd/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.45.2
|
||||
|
||||
$(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/...
|
||||
wire gen ./pkg/commands/... ./pkg/rpc/...
|
||||
|
||||
.PHONY: mock
|
||||
mock: $(GOBIN)/mockery
|
||||
@@ -26,19 +47,35 @@ deps:
|
||||
go get ${u} -d
|
||||
go mod tidy
|
||||
|
||||
$(GOBIN)/golangci-lint:
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.41.1
|
||||
.PHONY: 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: $(TEST_MODULES)
|
||||
go test -v -short -coverprofile=coverage.txt -covermode=atomic ./...
|
||||
|
||||
integration/testdata/fixtures/images/*.tar.gz:
|
||||
git clone https://github.com/aquasecurity/trivy-test-images.git integration/testdata/fixtures/images
|
||||
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/...
|
||||
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
|
||||
@@ -70,15 +107,18 @@ install:
|
||||
clean:
|
||||
rm -rf integration/testdata/fixtures/images
|
||||
|
||||
$(GOBIN)/labeler:
|
||||
go install github.com/knqyf263/labeler@latest
|
||||
|
||||
# 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
|
||||
## Runs MkDocs development server to preview the documentation page
|
||||
mkdocs-serve:
|
||||
docker build -t $(MKDOCS_IMAGE) -f docs/build/Dockerfile docs/build
|
||||
docker run --name mkdocs-serve --rm -v $(PWD):/docs -p $(MKDOCS_PORT):8000 $(MKDOCS_IMAGE)
|
||||
|
||||
# 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
|
||||
|
||||
228
README.md
@@ -1,14 +1,5 @@
|
||||
<p align="center">
|
||||
<img src="docs/imgs/logo.png" width="200">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://aquasecurity.github.io/trivy/">Documentation</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues
|
||||
</p>
|
||||
<div align="center">
|
||||
<img src="docs/imgs/logo.png" width="200">
|
||||
|
||||
[![GitHub Release][release-img]][release]
|
||||
[![Test][test-img]][test]
|
||||
@@ -17,77 +8,60 @@ Scanner for vulnerabilities in container images, file systems, and Git repositor
|
||||
[![GitHub All Releases][github-all-releases-img]][release]
|
||||
![Docker Pulls][docker-pulls]
|
||||
|
||||
[📖 Documentation][docs]
|
||||
</div>
|
||||
|
||||
# Abstract
|
||||
`Trivy` (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a simple and comprehensive scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues.
|
||||
`Trivy` detects vulnerabilities of OS packages (Alpine, RHEL, CentOS, etc.) and language-specific packages (Bundler, Composer, npm, yarn, etc.).
|
||||
In addition, `Trivy` scans Infrastructure as Code (IaC) files such as Terraform, Dockerfile and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack.
|
||||
`Trivy` also scans hardcoded secrets like passwords, API keys and tokens.
|
||||
`Trivy` is easy to use. Just install the binary and you're ready to scan.
|
||||
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.
|
||||
|
||||
<figure style="text-aligh: center">
|
||||
<img src="docs/imgs/overview.png" width="800" alt="Trivy Overview">
|
||||
</figure>
|
||||
Trivy has different *scanners* that look for different security issues, and different *targets* where it can find those issues.
|
||||
|
||||
### Demo: Vulnerability Detection (Container Image)
|
||||
<figure style="text-aligh: center">
|
||||
<img src="docs/imgs/vuln-demo.gif" width="1000" alt="Vulnerability Detection">
|
||||
</figure>
|
||||
Targets:
|
||||
- Container Image
|
||||
- Filesystem
|
||||
- Git repository (remote)
|
||||
- Kubernetes cluster or resource
|
||||
|
||||
### Demo: Misconfiguration Detection (IaC Files)
|
||||
<figure style="text-aligh: center">
|
||||
<img src="docs/imgs/misconf-demo.gif" width="1000" alt="Misconfiguration Detection">
|
||||
</figure>
|
||||
Scanners:
|
||||
- OS packages and software dependencies in use (SBOM)
|
||||
- Known vulnerabilities (CVEs)
|
||||
- IaC misconfigurations
|
||||
- Sensitive information and secrets
|
||||
|
||||
### Demo: Secret Detection
|
||||
<figure style="text-aligh: center">
|
||||
<img src="docs/imgs/secret-demo.gif" width="1000">
|
||||
</figure>
|
||||
Much more scanners and targets are coming up. Missing something? Let us know!
|
||||
|
||||
Read more in the [Trivy Documentation][docs]
|
||||
|
||||
# Quick Start
|
||||
## Scan Image for Vulnerabilities and Secrets
|
||||
Simply specify an image name (and a tag).
|
||||
## Quick Start
|
||||
|
||||
```
|
||||
$ trivy image [YOUR_IMAGE_NAME]
|
||||
### Get Trivy
|
||||
|
||||
Get Trivy by your favorite installation method. See [installation] section in the documentation for details. For example:
|
||||
|
||||
- `apt-get install trivy`
|
||||
- `yum install trivy`
|
||||
- `brew install aquasecurity/trivy/trivy`
|
||||
- `docker run aquasec/trivy`
|
||||
- Download binary from https://github.com/aquasecurity/trivy/releases/latest/
|
||||
|
||||
### General usage
|
||||
|
||||
```bash
|
||||
trivy <target> [--security-checks <scanner1,scanner2>] TARGET_NAME
|
||||
```
|
||||
|
||||
For example:
|
||||
Examples:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ trivy image python:3.4-alpine
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2019-05-16T01:20:43.180+0900 INFO Updating vulnerability database...
|
||||
2019-05-16T01:20:53.029+0900 INFO Detecting Alpine vulnerabilities...
|
||||
https://user-images.githubusercontent.com/1161307/171013513-95f18734-233d-45d3-aaf5-d6aec687db0e.mov
|
||||
|
||||
python:3.4-alpine3.9 (alpine 3.9.2)
|
||||
===================================
|
||||
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
+---------+------------------+----------+-------------------+---------------+--------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+---------+------------------+----------+-------------------+---------------+--------------------------------+
|
||||
| openssl | CVE-2019-1543 | MEDIUM | 1.1.1a-r1 | 1.1.1b-r1 | openssl: ChaCha20-Poly1305 |
|
||||
| | | | | | with long nonces |
|
||||
+---------+------------------+----------+-------------------+---------------+--------------------------------+
|
||||
```
|
||||
</details>
|
||||
|
||||
## Scan Filesystem for Vulnerabilities, Secrets and Misconfigurations
|
||||
Simply specify a directory to scan.
|
||||
|
||||
```bash
|
||||
$ trivy fs --security-checks vuln,secret,config [YOUR_PROJECT_DIR]
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ trivy fs --security-checks vuln,secret,config myproject/
|
||||
```
|
||||
@@ -95,116 +69,52 @@ $ trivy fs --security-checks vuln,secret,config myproject/
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```bash
|
||||
2021-07-09T12:03:27.564+0300 INFO Number of language-specific files: 1
|
||||
2021-07-09T12:03:27.564+0300 INFO Detecting pipenv vulnerabilities...
|
||||
2021-07-09T12:03:27.566+0300 INFO Detected config files: 1
|
||||
https://user-images.githubusercontent.com/1161307/171013917-b1f37810-f434-465c-b01a-22de036bd9b3.mov
|
||||
|
||||
Pipfile.lock (pipenv)
|
||||
=====================
|
||||
Total: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| httplib2 | CVE-2021-21240 | HIGH | 0.12.1 | 0.19.0 | python-httplib2: Regular |
|
||||
| | | | | | expression denial of |
|
||||
| | | | | | service via malicious header |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2021-21240 |
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
```
|
||||
</details>
|
||||
|
||||
## Scan Directory for Misconfigurations
|
||||
|
||||
Simply specify a directory containing IaC files such as Terraform and Dockerfile.
|
||||
|
||||
```
|
||||
$ trivy config [YOUR_IAC_DIR]
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
$ ls build/
|
||||
Dockerfile
|
||||
$ trivy config ./build
|
||||
```bash
|
||||
$ trivy k8s --report summary cluster
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2021-07-09T10:06:29.188+0300 INFO Need to update the built-in policies
|
||||
2021-07-09T10:06:29.188+0300 INFO Downloading the built-in policies...
|
||||
2021-07-09T10:06:30.520+0300 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
```
|
||||

|
||||
|
||||
</details>
|
||||
|
||||
Note that you can also receive a detailed scan, scan only a specific namespace, resource and more.
|
||||
|
||||
# Features
|
||||
Find out more in the [Trivy Documentation][docs] - [Getting Started][getting-started]
|
||||
|
||||
|
||||
## Highlights
|
||||
|
||||
- Comprehensive vulnerability detection
|
||||
- OS packages (Alpine Linux, Red Hat Universal Base Image, Red Hat Enterprise Linux, CentOS, AlmaLinux, Rocky Linux, CBL-Mariner, Oracle Linux, Debian, Ubuntu, Amazon Linux, openSUSE Leap, SUSE Enterprise Linux, Photon OS and Distroless)
|
||||
- **Language-specific packages** (Bundler, Composer, Pipenv, Poetry, npm, yarn, Cargo, NuGet, Maven, and Go)
|
||||
- Misconfiguration detection (IaC scanning)
|
||||
- A wide variety of built-in policies are provided **out of the box**
|
||||
- Kubernetes, Docker, Terraform, and more coming soon
|
||||
- Support custom policies
|
||||
- Secret detection
|
||||
- A wide variety of built-in rules are provided **out of the box**
|
||||
- Support custom rules
|
||||
- Scan container images at high speed
|
||||
- Simple
|
||||
- Specify only an image name, a path to config files, or an artifact name
|
||||
- Fast
|
||||
- The first scan will finish within 10 seconds (depending on your network). Consequent scans will finish in single seconds.
|
||||
- Easy installation
|
||||
- `apt-get install`, `yum install` and `brew install` are possible.
|
||||
- **No pre-requisites** such as installation of DB, libraries, etc.
|
||||
- High accuracy
|
||||
- **Especially [Alpine Linux][alpine] and RHEL/CentOS**
|
||||
- Other OSes are also high
|
||||
- DevSecOps
|
||||
- **Suitable for CI** such as GitHub Actions, Jenkins, GitLab CI, etc.
|
||||
- Support multiple targets
|
||||
- container image, local filesystem and remote git repository
|
||||
- High accuracy, especially [Alpine Linux][alpine] and RHEL/CentOS
|
||||
- Supply chain security (SBOM support)
|
||||
- Support CycloneDX
|
||||
|
||||
# Integrations
|
||||
- [GitHub Actions][action]
|
||||
- [Visual Studio Code][vscode]
|
||||
|
||||
# Documentation
|
||||
The official documentation, which provides detailed installation, configuration, and quick start guides, is available at https://aquasecurity.github.io/trivy/.
|
||||
- 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.
|
||||
|
||||
---
|
||||
|
||||
@@ -223,10 +133,14 @@ Contact us about any matter by opening a GitHub Discussion [here][discussions]
|
||||
[license]: https://github.com/aquasecurity/trivy/blob/main/LICENSE
|
||||
[license-img]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
|
||||
|
||||
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
|
||||
[action]: https://github.com/aquasecurity/trivy-action
|
||||
[vscode]: https://github.com/aquasecurity/trivy-vscode-extension
|
||||
|
||||
[getting-started]: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
|
||||
[docs]: https://aquasecurity.github.io/trivy
|
||||
[integrations]:https://aquasecurity.github.io/trivy/latest/docs/integrations/
|
||||
[installation]:https://aquasecurity.github.io/trivy/latest/getting-started/installation/
|
||||
[releases]: https://github.com/aquasecurity/trivy/releases
|
||||
[alpine]: https://ariadne.space/2021/06/08/the-vulnerability-remediation-lifecycle-of-alpine-containers/
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/#rego
|
||||
[aquasec]: https://aquasec.com
|
||||
[oss]: https://www.aquasec.com/products/open-source-projects/
|
||||
[discussions]: https://github.com/aquasecurity/trivy/discussions
|
||||
|
||||
@@ -15,7 +15,7 @@ function create_rpm_repo () {
|
||||
|
||||
cd trivy-repo
|
||||
|
||||
VERSIONS=(5 6 7 8)
|
||||
VERSIONS=(5 6 7 8 9)
|
||||
for version in ${VERSIONS[@]}; do
|
||||
echo "Processing RHEL/CentOS $version..."
|
||||
create_rpm_repo $version
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/commands"
|
||||
"github.com/aquasecurity/trivy/pkg/log"
|
||||
)
|
||||
@@ -13,8 +11,7 @@ var (
|
||||
|
||||
func main() {
|
||||
app := commands.NewApp(version)
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
if err := app.Execute(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +35,14 @@
|
||||
},
|
||||
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}",
|
||||
"Description": {{ escapeString $description | printf "%q" }},
|
||||
{{ if not (empty .PrimaryURL) -}}
|
||||
"Remediation": {
|
||||
"Recommendation": {
|
||||
"Text": "More information on this vulnerability is provided in the hyperlink",
|
||||
"Url": "{{ .PrimaryURL }}"
|
||||
}
|
||||
},
|
||||
{{ end -}}
|
||||
"ProductFields": { "Product Name": "Trivy" },
|
||||
"Resources": [
|
||||
{
|
||||
@@ -66,7 +68,57 @@
|
||||
],
|
||||
"RecordState": "ACTIVE"
|
||||
}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- range .Misconfigurations -}}
|
||||
{{- if $t_first -}}{{- $t_first = false -}}{{- else -}},{{- end -}}
|
||||
{{- $severity := .Severity -}}
|
||||
{{- if eq $severity "UNKNOWN" -}}
|
||||
{{- $severity = "INFORMATIONAL" -}}
|
||||
{{- end -}}
|
||||
{{- $description := .Description -}}
|
||||
{{- if gt (len $description ) 512 -}}
|
||||
{{- $description = (substr 0 512 $description) | printf "%v .." -}}
|
||||
{{- end}}
|
||||
{
|
||||
"SchemaVersion": "2018-10-08",
|
||||
"Id": "{{ $target }}/{{ .ID }}",
|
||||
"ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}::product/aquasecurity/aquasecurity",
|
||||
"GeneratorId": "Trivy/{{ .ID }}",
|
||||
"AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}",
|
||||
"Types": [ "Software and Configuration Checks" ],
|
||||
"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 misconfiguration in {{ $target }}: {{ .Title }}",
|
||||
"Description": {{ escapeString $description | printf "%q" }},
|
||||
"Remediation": {
|
||||
"Recommendation": {
|
||||
"Text": "{{ .Resolution }}",
|
||||
"Url": "{{ .PrimaryURL }}"
|
||||
}
|
||||
},
|
||||
"ProductFields": { "Product Name": "Trivy" },
|
||||
"Resources": [
|
||||
{
|
||||
"Type": "Other",
|
||||
"Id": "{{ $target }}",
|
||||
"Partition": "aws",
|
||||
"Region": "{{ env "AWS_REGION" }}",
|
||||
"Details": {
|
||||
"Other": {
|
||||
"Message": "{{ .Message }}",
|
||||
"Filename": "{{ $target }}",
|
||||
"StartLine": "{{ .CauseMetadata.StartLine }}",
|
||||
"EndLine": "{{ .CauseMetadata.EndLine }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"RecordState": "ACTIVE"
|
||||
}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"location": {
|
||||
"path": "{{ $target }}",
|
||||
"lines": {
|
||||
"begin": {{ .IacMetadata.StartLine }}
|
||||
"begin": {{ .CauseMetadata.StartLine }}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ checks:
|
||||
- vuln
|
||||
- misconf
|
||||
- secret
|
||||
- license
|
||||
|
||||
mode:
|
||||
|
||||
@@ -160,5 +161,4 @@ Trivy is composed of several repositories that work together:
|
||||
- [vuln-list](https://github.com/aquasecurity/vuln-list) is a vulnerabilities database, aggregated from different sources, and normalized for easy consumption. Think of this as the "server" side of the trivy command line tool. **There should be no pull requests to this repo**
|
||||
- [vuln-list-update](https://github.com/aquasecurity/vuln-list-update) is the code that maintains the vuln-list database.
|
||||
- [trivy-db](https://github.com/aquasecurity/trivy-db) maintains the vulnerability database pulled by Trivy CLI.
|
||||
- [fanal](https://github.com/aquasecurity/fanal) is a library for extracting system information from containers. It is being used by Trivy to find testable subjects in the container image.
|
||||
- [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.
|
||||
|
||||
@@ -188,7 +188,7 @@ We use two labels [help wanted](https://github.com/aquasecurity/trivy/issues?q=i
|
||||
and [good first issue](https://github.com/aquasecurity/trivy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
|
||||
to identify issues that have been specially groomed for new contributors.
|
||||
|
||||
We have specific [guidelines](/docs/docs/advanced/contribd/contrib/help-wanted.md)
|
||||
We have specific [guidelines](/docs/community/maintainer/help-wanted.md)
|
||||
for how to use these labels. If you see an issue that satisfies these
|
||||
guidelines, you can add the `help wanted` label and the `good first issue` label.
|
||||
Please note that adding the `good first issue` label must also
|
||||
|
||||
@@ -53,54 +53,7 @@ $ trivy image --skip-update --offline-scan alpine:3.12
|
||||
|
||||
## Air-Gapped Environment for misconfigurations
|
||||
|
||||
### Download misconfiguration policies
|
||||
At first, you need to download misconfiguration policies for use in air-gapped environments.
|
||||
Please follow [oras installation instruction][oras].
|
||||
|
||||
Download `bundle.tar.gz`:
|
||||
|
||||
```
|
||||
$ oras pull ghcr.io/aquasecurity/appshield:latest -a
|
||||
```
|
||||
|
||||
### Transfer misconfiguration policies into the air-gapped environment
|
||||
The way of transfer depends on the environment.
|
||||
|
||||
```
|
||||
$ rsync -av -e ssh /path/to/bundle.tar.gz [user]@[host]:dst
|
||||
```
|
||||
|
||||
### Put the misconfiguration policies in Trivy's cache directory
|
||||
You have to know where to put the misconfiguration policies file. The following command shows the default cache directory.
|
||||
|
||||
```
|
||||
$ ssh user@host
|
||||
$ trivy -h | grep cache
|
||||
--cache-dir value cache directory (default: "/home/myuser/.cache/trivy") [$TRIVY_CACHE_DIR]
|
||||
```
|
||||
|
||||
Put the misconfiguration policies file in the cache directory + `/policy/content`.
|
||||
|
||||
```
|
||||
$ mkdir -p /home/myuser/.cache/trivy/policy/content
|
||||
$ cd /home/myuser/.cache/trivy/policy/content
|
||||
$ mv /path/to/bundle.tar.gz .
|
||||
```
|
||||
|
||||
Then, decompress it.
|
||||
`bundle.tar.gz ` file includes two folders: `docker`, `kubernetes` and file: `.manifest`.
|
||||
|
||||
```
|
||||
$ tar xvf bundle.tar.gz
|
||||
x ./docker/
|
||||
...
|
||||
x ./kubernetes/
|
||||
...
|
||||
x ./.manifest
|
||||
$ rm bundle.tar.gz
|
||||
```
|
||||
|
||||
In an air-gapped environment it is your responsibility to update policies on a regular basis, so that the scanner can detect recently-identified misconfigurations.
|
||||
No special measures are required to detect misconfigurations in an air-gapped environment.
|
||||
|
||||
### Run Trivy with --skip-policy-update option
|
||||
In an air-gapped environment, specify `--skip-policy-update` so that Trivy doesn't attempt to download the latest misconfiguration policies.
|
||||
|
||||
22
docs/docs/advanced/container/containerd.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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/
|
||||
358
docs/docs/advanced/modules.md
Normal file
@@ -0,0 +1,358 @@
|
||||
# Modules
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Trivy provides a module feature to allow others to extend the Trivy CLI without the need to change the Trivy code base.
|
||||
It changes the behavior during scanning by WebAssembly.
|
||||
|
||||
## Overview
|
||||
Trivy modules are add-on tools that integrate seamlessly with Trivy.
|
||||
They provide a way to extend the core feature set of Trivy, but without updating the Trivy binary.
|
||||
|
||||
- They can be added and removed from a Trivy installation without impacting the core Trivy tool.
|
||||
- They can be written in any programming language supporting WebAssembly.
|
||||
- It supports only [TinyGo][tinygo] at the moment.
|
||||
|
||||
You can write your own detection logic.
|
||||
|
||||
- Evaluate complex vulnerability conditions like [Spring4Shell][spring4shell]
|
||||
- Detect a shell script communicating with malicious domains
|
||||
- Detect malicious python install script (setup.py)
|
||||
- Even detect misconfigurations in WordPress setting
|
||||
- etc.
|
||||
|
||||
Then, you can update the scan result however you want.
|
||||
|
||||
- Change a severity
|
||||
- Remove a vulnerability
|
||||
- Add a new vulnerability
|
||||
- etc.
|
||||
|
||||
Modules should be distributed in OCI registries like GitHub Container Registry.
|
||||
|
||||
!!! warning
|
||||
WebAssembly doesn't allow file access and network access by default.
|
||||
Modules can read required files only, but cannot overwrite them.
|
||||
WebAssembly is sandboxed and secure by design, but Trivy modules available in public are not audited for security.
|
||||
You should install and run third-party modules at your own risk even though
|
||||
|
||||
Under the hood Trivy leverages [wazero][wazero] to run WebAssembly modules without CGO.
|
||||
|
||||
## Installing a Module
|
||||
A module can be installed using the `trivy module install` command.
|
||||
This command takes an url. It will download the module and install it in the module cache.
|
||||
|
||||
Trivy adheres to the XDG specification, so the location depends on whether XDG_DATA_HOME is set.
|
||||
Trivy will now search XDG_DATA_HOME for the location of the Trivy modules cache.
|
||||
The preference order is as follows:
|
||||
|
||||
- XDG_DATA_HOME if set and .trivy/plugins exists within the XDG_DATA_HOME dir
|
||||
- $HOME/.trivy/plugins
|
||||
|
||||
For example, to download the WebAssembly module, you can execute the following command:
|
||||
|
||||
```bash
|
||||
$ trivy module install ghcr.io/aquasecurity/trivy-module-spring4shell
|
||||
```
|
||||
|
||||
## Using Modules
|
||||
Once the module is installed, Trivy will load all available modules in the cache on the start of the next Trivy execution.
|
||||
The modules may inject custom logic into scanning and change the result.
|
||||
You can run Trivy as usual and modules are loaded automatically.
|
||||
|
||||
You will see the log messages about WASM modules.
|
||||
|
||||
```shell
|
||||
$ trivy image ghcr.io/aquasecurity/trivy-test-images:spring4shell-jre8
|
||||
2022-06-12T12:57:13.210+0300 INFO Loading ghcr.io/aquasecurity/trivy-module-spring4shell/spring4shell.wasm...
|
||||
2022-06-12T12:57:13.596+0300 INFO Registering WASM module: spring4shell@v1
|
||||
...
|
||||
2022-06-12T12:57:14.865+0300 INFO Module spring4shell: Java Version: 8, Tomcat Version: 8.5.77
|
||||
2022-06-12T12:57:14.865+0300 INFO Module spring4shell: change CVE-2022-22965 severity from CRITICAL to LOW
|
||||
|
||||
Java (jar)
|
||||
|
||||
Total: 9 (UNKNOWN: 1, LOW: 3, MEDIUM: 2, HIGH: 3, CRITICAL: 0)
|
||||
|
||||
┌──────────────────────────────────────────────────────────────┬─────────────────────┬──────────┬───────────────────┬────────────────────────┬────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├──────────────────────────────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────┼────────────────────────────────────────────────────────────┤
|
||||
│ org.springframework.boot:spring-boot (helloworld.war) │ CVE-2022-22965 │ LOW │ 2.6.3 │ 2.5.12, 2.6.6 │ spring-framework: RCE via Data Binding on JDK 9+ │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-22965 │
|
||||
├──────────────────────────────────────────────────────────────┼─────────────────────┼──────────┼───────────────────┼────────────────────────┼────────────────────────────────────────────────────────────┤
|
||||
...(snip)...
|
||||
```
|
||||
|
||||
In the above example, the Spring4Shell module changed the severity from CRITICAL to LOW because the application doesn't satisfy one of conditions.
|
||||
|
||||
## Uninstalling Modules
|
||||
Specify a module repository with `trivy module uninstall` command.
|
||||
|
||||
```bash
|
||||
$ trivy module uninstall ghcr.io/aquasecurity/trivy-module-spring4shell
|
||||
```
|
||||
|
||||
## Building Modules
|
||||
It supports TinyGo only at the moment.
|
||||
|
||||
### TinyGo
|
||||
Trivy provides Go SDK including three interfaces.
|
||||
Your own module needs to implement either or both `Analyzer` and `PostScanner` in addition to `Module`.
|
||||
|
||||
```go
|
||||
type Module interface {
|
||||
Version() int
|
||||
Name() string
|
||||
}
|
||||
|
||||
type Analyzer interface {
|
||||
RequiredFiles() []string
|
||||
Analyze(filePath string) (*serialize.AnalysisResult, error)
|
||||
}
|
||||
|
||||
type PostScanner interface {
|
||||
PostScanSpec() serialize.PostScanSpec
|
||||
PostScan(serialize.Results) (serialize.Results, error)
|
||||
}
|
||||
```
|
||||
|
||||
In the following tutorial, it creates a WordPress module that detects a WordPress version and a critical vulnerability accordingly.
|
||||
|
||||
!!! tips
|
||||
You can use logging functions such as `Debug` and `Info` for debugging.
|
||||
See [examples](#examples) for the detail.
|
||||
|
||||
#### Initialize your module
|
||||
Replace the repository name with yours.
|
||||
|
||||
```
|
||||
$ go mod init github.com/aquasecurity/trivy-module-wordpress
|
||||
```
|
||||
|
||||
#### Module interface
|
||||
`Version()` returns your module version and should be incremented after updates.
|
||||
`Name()` returns your module name.
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
const (
|
||||
version = 1
|
||||
name = "wordpress-module"
|
||||
)
|
||||
|
||||
type WordpressModule struct{
|
||||
// Cannot define fields as modules can't keep state.
|
||||
}
|
||||
|
||||
func (WordpressModule) Version() int {
|
||||
return version
|
||||
}
|
||||
|
||||
func (WordpressModule) Name() string {
|
||||
return name
|
||||
}
|
||||
```
|
||||
|
||||
!!! info
|
||||
A struct cannot have any fields. Each method invocation is performed in different states.
|
||||
|
||||
#### Analyzer interface
|
||||
If you implement the `Analyzer` interface, `Analyze` method is called when the file path is matched to file patterns returned by `RequiredFiles()`.
|
||||
A file pattern must be a regular expression. The syntax detail is [here][regexp].
|
||||
|
||||
`Analyze` takes the matched file path, then the file can be opened by `os.Open()`.
|
||||
|
||||
```go
|
||||
const typeWPVersion = "wordpress-version"
|
||||
|
||||
func (WordpressModule) RequiredFiles() []string {
|
||||
return []string{
|
||||
`wp-includes\/version.php`,
|
||||
}
|
||||
}
|
||||
|
||||
func (WordpressModule) Analyze(filePath string) (*serialize.AnalysisResult, error) {
|
||||
f, err := os.Open(filePath) // e.g. filePath: /usr/src/wordpress/wp-includes/version.php
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
var wpVersion string
|
||||
scanner := bufio.NewScanner(f)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !strings.HasPrefix(line, "$wp_version=") {
|
||||
continue
|
||||
}
|
||||
|
||||
ss := strings.Split(line, "=")
|
||||
if len(ss) != 2 {
|
||||
return nil, fmt.Errorf("invalid wordpress version: %s", line)
|
||||
}
|
||||
|
||||
// NOTE: it is an example; you actually need to handle comments, etc
|
||||
ss[1] = strings.TrimSpace(ss[1])
|
||||
wpVersion = strings.Trim(ss[1], `";`)
|
||||
}
|
||||
|
||||
if err = scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &serialize.AnalysisResult{
|
||||
CustomResources: []serialize.CustomResource{
|
||||
{
|
||||
Type: typeWPVersion,
|
||||
FilePath: filePath,
|
||||
Data: wpVersion,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
```
|
||||
|
||||
!!! tips
|
||||
Trivy caches analysis results according to the module version.
|
||||
We'd recommend cleaning the cache or changing the module version every time you update `Analyzer`.
|
||||
|
||||
|
||||
#### PostScanner interface
|
||||
`PostScan` is called after scanning and takes the scan result as an argument from Trivy.
|
||||
In post scanning, your module can perform one of three actions:
|
||||
|
||||
- Insert
|
||||
- Add a new security finding
|
||||
- e.g. Add a new vulnerability and misconfiguration
|
||||
- Update
|
||||
- Update the detected vulnerability and misconfiguration
|
||||
- e.g. Change a severity
|
||||
- Delete
|
||||
- Delete the detected vulnerability and misconfiguration
|
||||
- e.g. Remove Spring4Shell because it is not actually affected.
|
||||
|
||||
`PostScanSpec()` returns which action the module does.
|
||||
If it is `Update` or `Delete`, it also needs to return IDs such as CVE-ID and misconfiguration ID, which your module wants to update or delete.
|
||||
|
||||
`serialize.Results` contains the filtered results matching IDs you specified.
|
||||
Also, it includes `CustomResources` with the values your `Analyze` returns, so you can modify the scan result according to the custom resources.
|
||||
|
||||
```go
|
||||
func (WordpressModule) PostScanSpec() serialize.PostScanSpec {
|
||||
return serialize.PostScanSpec{
|
||||
Action: api.ActionInsert, // Add new vulnerabilities
|
||||
}
|
||||
}
|
||||
|
||||
func (WordpressModule) PostScan(results serialize.Results) (serialize.Results, error) {
|
||||
// e.g. results
|
||||
// [
|
||||
// {
|
||||
// "Target": "",
|
||||
// "Class": "custom",
|
||||
// "CustomResources": [
|
||||
// {
|
||||
// "Type": "wordpress-version",
|
||||
// "FilePath": "/usr/src/wordpress/wp-includes/version.php",
|
||||
// "Layer": {
|
||||
// "DiffID": "sha256:057649e61046e02c975b84557c03c6cca095b8c9accd3bd20eb4e432f7aec887"
|
||||
// },
|
||||
// "Data": "5.7.1"
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
var wpVersion int
|
||||
for _, result := range results {
|
||||
if result.Class != types.ClassCustom {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, c := range result.CustomResources {
|
||||
if c.Type != typeWPVersion {
|
||||
continue
|
||||
}
|
||||
wpVersion = c.Data.(string)
|
||||
wasm.Info(fmt.Sprintf("WordPress Version: %s", wpVersion))
|
||||
|
||||
...snip...
|
||||
|
||||
if affectedVersion.Check(ver) {
|
||||
vulnerable = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if vulnerable {
|
||||
// Add CVE-2020-36326
|
||||
results = append(results, serialize.Result{
|
||||
Target: wpPath,
|
||||
Class: types.ClassLangPkg,
|
||||
Type: "wordpress",
|
||||
Vulnerabilities: []types.DetectedVulnerability {
|
||||
{
|
||||
VulnerabilityID: "CVE-2020-36326",
|
||||
PkgName: "wordpress",
|
||||
InstalledVersion: wpVersion,
|
||||
FixedVersion: "5.7.2",
|
||||
Vulnerability: dbTypes.Vulnerability{
|
||||
Title: "PHPMailer 6.1.8 through 6.4.0 allows object injection through Phar Deserialization via addAttachment with a UNC pathname.",
|
||||
Severity: "CRITICAL",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
return results, nil
|
||||
}
|
||||
```
|
||||
|
||||
The new vulnerability will be added to the scan results.
|
||||
This example shows how the module inserts a new finding.
|
||||
If you are interested in `Update`, you can see an example of [Spring4Shell][trivy-module-spring4shell].
|
||||
|
||||
In the `Delete` action, `PostScan` needs to return results you want to delete.
|
||||
If `PostScan` returns an empty, Trivy will not delete anything.
|
||||
|
||||
#### Build
|
||||
Follow [the install guide][tinygo-installation] and install TinyGo.
|
||||
|
||||
```bash
|
||||
$ tinygo build -o wordpress.wasm -scheduler=none -target=wasi --no-debug wordpress.go
|
||||
```
|
||||
|
||||
Put the built binary to the module directory that is under the home directory by default.
|
||||
|
||||
```bash
|
||||
$ mkdir -p ~/.trivy/modules
|
||||
$ cp spring4shell.wasm ~/.trivy/modules
|
||||
```
|
||||
|
||||
## Distribute Your Module
|
||||
You can distribute your own module in OCI registries. Please follow [the oras installation instruction][oras].
|
||||
|
||||
```bash
|
||||
oras push ghcr.io/aquasecurity/trivy-module-wordpress:latest wordpress.wasm:application/vnd.module.wasm.content.layer.v1+wasm
|
||||
Uploading 3daa3dac086b wordpress.wasm
|
||||
Pushed ghcr.io/aquasecurity/trivy-module-wordpress:latest
|
||||
Digest: sha256:6416d0199d66ce52ced19f01d75454b22692ff3aa7737e45f7a189880840424f
|
||||
```
|
||||
|
||||
## Examples
|
||||
- [Spring4Shell][trivy-module-spring4shell]
|
||||
- [WordPress][trivy-module-wordpress]
|
||||
|
||||
[regexp]: https://github.com/google/re2/wiki/Syntax
|
||||
|
||||
[tinygo]: https://tinygo.org/
|
||||
[spring4shell]: https://blog.aquasec.com/zero-day-rce-vulnerability-spring4shell
|
||||
[wazero]: https://github.com/tetratelabs/wazero
|
||||
|
||||
[trivy-module-spring4shell]: https://github.com/aquasecurity/trivy/tree/main/examples/module/spring4shell
|
||||
[trivy-module-wordpress]: https://github.com/aquasecurity/trivy-module-wordpress
|
||||
|
||||
[tinygo-installation]: https://tinygo.org/getting-started/install/
|
||||
[oras]: https://oras.land/cli/
|
||||
@@ -5,17 +5,22 @@ Trivy detects two types of security issues:
|
||||
- [Vulnerabilities][vuln]
|
||||
- [Misconfigurations][misconf]
|
||||
|
||||
Trivy can scan three different artifacts:
|
||||
Trivy can scan four different artifacts:
|
||||
|
||||
- [Container Images][container]
|
||||
- [Filesystem][filesystem] and [Rootfs][rootfs]
|
||||
- [Git Repositories][repo]
|
||||
- [Kubernetes][kubernetes]
|
||||
|
||||
Trivy can be run in two different modes:
|
||||
|
||||
- [Standalone][standalone]
|
||||
- [Client/Server][client-server]
|
||||
|
||||
Trivy can be run as a Kubernetes Operator:
|
||||
|
||||
- [Kubernetes Operator][kubernetesoperator]
|
||||
|
||||
It is designed to be used in CI. Before pushing to a container registry or deploying your application, you can scan your local container image and other artifacts easily.
|
||||
See [Integrations][integrations] for details.
|
||||
|
||||
@@ -23,7 +28,7 @@ See [Integrations][integrations] for details.
|
||||
|
||||
- Comprehensive vulnerability detection
|
||||
- [OS packages][os] (Alpine, Red Hat Universal Base Image, Red Hat Enterprise Linux, CentOS, AlmaLinux, Rocky Linux, CBL-Mariner, Oracle Linux, Debian, Ubuntu, Amazon Linux, openSUSE Leap, SUSE Enterprise Linux, Photon OS and Distroless)
|
||||
- [**Language-specific packages**][lang] (Bundler, Composer, Pipenv, Poetry, npm, yarn, Cargo, NuGet, Maven, and Go)
|
||||
- [**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
|
||||
@@ -56,17 +61,21 @@ See [Integrations][integrations] for details.
|
||||
- local filesystem and rootfs
|
||||
- remote git repository
|
||||
- [SBOM][sbom] (Software Bill of Materials) support
|
||||
- CycloneDX
|
||||
- CycloneDX
|
||||
- SPDX
|
||||
- GitHub Dependency Snapshots
|
||||
|
||||
Please see [LICENSE][license] for Trivy licensing information.
|
||||
|
||||
[installation]: ../getting-started/installation.md
|
||||
[vuln]: ../docs/vulnerability/scanning/index.md
|
||||
[misconf]: ../docs/misconfiguration/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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# GitHub Actions
|
||||
|
||||
- Here is the [Trivy Github Action][action]
|
||||
- Here is the [Trivy GitHub Action][action]
|
||||
- The Microsoft Azure team have written a [container-scan action][azure] that uses Trivy and Dockle
|
||||
- For full control over the options specified to Trivy, this [blog post][blog] describes adding Trivy into your own GitHub action workflows
|
||||
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
# GitLab CI
|
||||
|
||||
If you're a GitLab Ultimate customer, GitLab 14.0 and above include out-of-the-box integration with Trivy. To enable it for your project, simply add the container scanning template to your `.gitlab-ci.yml` file. For more details, please refer to [GitLab's documentation](https://docs.gitlab.com/ee/user/application_security/container_scanning/).
|
||||
GitLab 15.0 includes [free](https://gitlab.com/groups/gitlab-org/-/epics/2233) integration with Trivy.
|
||||
|
||||
If you're using an earlier version of GitLab, you can still use the new integration by copying the [contents of the 14.0 template](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/Container-Scanning.gitlab-ci.yml) to your configuration.
|
||||
To [configure container scanning with Trivy in GitLab](https://docs.gitlab.com/ee/user/application_security/container_scanning/#configuration), simply include the CI template in your `.gitlab-ci.yml` file:
|
||||
|
||||
Alternatively, you can always use the example configurations below.
|
||||
```yaml
|
||||
include:
|
||||
- template: Security/Container-Scanning.gitlab-ci.yml
|
||||
```
|
||||
|
||||
If you're a GitLab 14.x Ultimate customer, you can use the same configuration above.
|
||||
|
||||
Alternatively, you can always use the example configurations below. Note that the examples use [`contrib/gitlab.tpl`](https://github.com/aquasecurity/trivy/blob/main/contrib/gitlab.tpl), which does not work with GitLab 15.0 and above (for details, see [issue 1598](https://github.com/aquasecurity/trivy/issues/1598)).
|
||||
|
||||
```yaml
|
||||
stages:
|
||||
@@ -104,7 +111,7 @@ container_scanning:
|
||||
[example]: https://gitlab.com/aquasecurity/trivy-ci-test/pipelines
|
||||
[repository]: https://github.com/aquasecurity/trivy-ci-test
|
||||
|
||||
### Gitlab CI alternative template
|
||||
### GitLab CI alternative template
|
||||
|
||||
Depending on the edition of gitlab you have or your desired workflow, the
|
||||
container scanning template may not meet your needs. As an addition to the
|
||||
@@ -167,8 +174,8 @@ be necessary to rename the artifact if you want to reuse the name. To then
|
||||
combine the previous artifact with the output of trivy, the following `jq`
|
||||
command can be used, `jq -s 'add' prev-codeclimate.json trivy-codeclimate.json > gl-codeclimate.json`.
|
||||
|
||||
### Gitlab CI alternative template example report
|
||||
### GitLab CI alternative template example report
|
||||
|
||||
You'll be able to see a full report in the Gitlab pipeline code quality UI, where filesystem vulnerabilities and misconfigurations include links to the flagged files and image vulnerabilities report the image/os or runtime/library that the vulnerability originates from instead.
|
||||
You'll be able to see a full report in the GitLab pipeline code quality UI, where filesystem vulnerabilities and misconfigurations include links to the flagged files and image vulnerabilities report the image/os or runtime/library that the vulnerability originates from instead.
|
||||
|
||||

|
||||
|
||||
227
docs/docs/kubernetes/cli/scanning.md
Normal file
@@ -0,0 +1,227 @@
|
||||
# Kubernetes
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
The Trivy K8s CLI allows you to scan your Kubernetes cluster for Vulnerabilities, Secrets and Misconfigurations. You can either run the CLI locally or integrate it into your CI/CD pipeline. The difference to the Trivy CLI is that the Trivy K8s CLI allows you to scan running workloads directly within your cluster.
|
||||
|
||||
If you are looking for continuous cluster audit scanning, have a look at the [Trivy K8s operator.](../operator/getting-started.md)
|
||||
|
||||
Trivy uses your local kubectl configuration to access the API server to list artifacts.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
Scan a full cluster and generate a simple summary report:
|
||||
|
||||
```
|
||||
$ trivy k8s --report=summary cluster
|
||||
```
|
||||
|
||||

|
||||
|
||||
The summary report is the default. To get all of the detail the output contains, use `--report all`.
|
||||
|
||||
Filter by severity:
|
||||
|
||||
```
|
||||
$ trivy k8s --severity=CRITICAL --report=all cluster
|
||||
```
|
||||
|
||||
Filter by security check (Vulnerabilities, Secrets or Misconfigurations):
|
||||
|
||||
```
|
||||
$ trivy k8s --security-checks=secret --report=summary cluster
|
||||
# or
|
||||
$ trivy k8s --security-checks=config --report=summary cluster
|
||||
```
|
||||
|
||||
Scan a specific namespace:
|
||||
|
||||
```
|
||||
$ trivy k8s -n kube-system --report=summary all
|
||||
```
|
||||
|
||||
Scan a specific resource and get all the output:
|
||||
|
||||
```
|
||||
$ trivy k8s deployment appname
|
||||
```
|
||||
|
||||
Scan all deploys, or deploys and configmaps:
|
||||
|
||||
```
|
||||
$ trivy k8s --report=summary deployment
|
||||
$ trivy k8s --report=summary deployment,configmaps
|
||||
```
|
||||
|
||||
If you want to pass in flags before scanning specific workloads, you will have to do it before the resource name.
|
||||
For example, scanning a deployment in the app namespace of your Kubernetes cluster for critical vulnerabilities would be done through the following command:
|
||||
|
||||
```
|
||||
$ trivy k8s -n app --severity=CRITICAL deployment/appname
|
||||
```
|
||||
This is specific to all Trivy CLI commands.
|
||||
|
||||
The supported formats are `table`, which is the default, and `json`.
|
||||
To get a JSON output on a full cluster scan:
|
||||
|
||||
```
|
||||
$ trivy k8s --format json -o results.json cluster
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"ClusterName": "minikube",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"Namespace": "default",
|
||||
"Kind": "Deployment",
|
||||
"Name": "app",
|
||||
"Results": [
|
||||
{
|
||||
"Target": "ubuntu:latest (ubuntu 22.04)",
|
||||
"Class": "os-pkgs",
|
||||
"Type": "ubuntu",
|
||||
"Vulnerabilities": [
|
||||
{
|
||||
"VulnerabilityID": "CVE-2016-2781",
|
||||
"PkgName": "coreutils",
|
||||
"InstalledVersion": "8.32-4.1ubuntu1",
|
||||
"Layer": {
|
||||
"Digest": "sha256:125a6e411906fe6b0aaa50fc9d600bf6ff9bb11a8651727ce1ed482dc271c24c",
|
||||
"DiffID": "sha256:e59fc94956120a6c7629f085027578e6357b48061d45714107e79f04a81a6f0c"
|
||||
},
|
||||
"SeveritySource": "ubuntu",
|
||||
"PrimaryURL": "https://avd.aquasec.com/nvd/cve-2016-2781",
|
||||
"DataSource": {
|
||||
"ID": "ubuntu",
|
||||
"Name": "Ubuntu CVE Tracker",
|
||||
"URL": "https://git.launchpad.net/ubuntu-cve-tracker"
|
||||
},
|
||||
"Title": "coreutils: Non-privileged session can escape to the parent session in chroot",
|
||||
"Description": "chroot in GNU coreutils, when used with --userspec, allows local users to escape to the parent session via a crafted TIOCSTI ioctl call, which pushes characters to the terminal's input buffer.",
|
||||
"Severity": "LOW",
|
||||
"CweIDs": [
|
||||
"CWE-20"
|
||||
],
|
||||
"VendorSeverity": {
|
||||
"cbl-mariner": 2,
|
||||
"nvd": 2,
|
||||
"redhat": 2,
|
||||
"ubuntu": 1
|
||||
},
|
||||
"CVSS": {
|
||||
"nvd": {
|
||||
"V2Vector": "AV:L/AC:L/Au:N/C:N/I:P/A:N",
|
||||
"V3Vector": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N",
|
||||
"V2Score": 2.1,
|
||||
"V3Score": 6.5
|
||||
},
|
||||
"redhat": {
|
||||
"V2Vector": "AV:L/AC:H/Au:N/C:C/I:C/A:C",
|
||||
"V3Vector": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H",
|
||||
"V2Score": 6.2,
|
||||
"V3Score": 8.6
|
||||
}
|
||||
},
|
||||
"References": [
|
||||
"http://seclists.org/oss-sec/2016/q1/452",
|
||||
"http://www.openwall.com/lists/oss-security/2016/02/28/2",
|
||||
"http://www.openwall.com/lists/oss-security/2016/02/28/3",
|
||||
"https://access.redhat.com/security/cve/CVE-2016-2781",
|
||||
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2781",
|
||||
"https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E",
|
||||
"https://lore.kernel.org/patchwork/patch/793178/",
|
||||
"https://nvd.nist.gov/vuln/detail/CVE-2016-2781"
|
||||
],
|
||||
"PublishedDate": "2017-02-07T15:59:00Z",
|
||||
"LastModifiedDate": "2021-02-25T17:15:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Misconfigurations": [
|
||||
{
|
||||
"Namespace": "default",
|
||||
"Kind": "Deployment",
|
||||
"Name": "app",
|
||||
"Results": [
|
||||
{
|
||||
"Target": "Deployment/app",
|
||||
"Class": "config",
|
||||
"Type": "kubernetes",
|
||||
"MisconfSummary": {
|
||||
"Successes": 20,
|
||||
"Failures": 19,
|
||||
"Exceptions": 0
|
||||
},
|
||||
"Misconfigurations": [
|
||||
{
|
||||
"Type": "Kubernetes Security Check",
|
||||
"ID": "KSV001",
|
||||
"Title": "Process can elevate its own privileges",
|
||||
"Description": "A program inside the container can elevate its own privileges and run as root, which might give the program control over the container and node.",
|
||||
"Message": "Container 'app' of Deployment 'app' should set 'securityContext.allowPrivilegeEscalation' to false",
|
||||
"Namespace": "builtin.kubernetes.KSV001",
|
||||
"Query": "data.builtin.kubernetes.KSV001.deny",
|
||||
"Resolution": "Set 'set containers[].securityContext.allowPrivilegeEscalation' to 'false'.",
|
||||
"Severity": "MEDIUM",
|
||||
"PrimaryURL": "https://avd.aquasec.com/misconfig/ksv001",
|
||||
"References": [
|
||||
"https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted",
|
||||
"https://avd.aquasec.com/misconfig/ksv001"
|
||||
],
|
||||
"Status": "FAIL",
|
||||
"Layer": {},
|
||||
"IacMetadata": {
|
||||
"Provider": "Kubernetes",
|
||||
"Service": "general",
|
||||
"StartLine": 121,
|
||||
"EndLine": 133
|
||||
}
|
||||
},
|
||||
{
|
||||
"Type": "Kubernetes Security Check",
|
||||
"ID": "KSV003",
|
||||
"Title": "Default capabilities not dropped",
|
||||
"Description": "The container should drop all default capabilities and add only those that are needed for its execution.",
|
||||
"Message": "Container 'app' of Deployment 'app' should add 'ALL' to 'securityContext.capabilities.drop'",
|
||||
"Namespace": "builtin.kubernetes.KSV003",
|
||||
"Query": "data.builtin.kubernetes.KSV003.deny",
|
||||
"Resolution": "Add 'ALL' to containers[].securityContext.capabilities.drop.",
|
||||
"Severity": "LOW",
|
||||
"PrimaryURL": "https://avd.aquasec.com/misconfig/ksv003",
|
||||
"References": [
|
||||
"https://kubesec.io/basics/containers-securitycontext-capabilities-drop-index-all/",
|
||||
"https://avd.aquasec.com/misconfig/ksv003"
|
||||
],
|
||||
"Status": "FAIL",
|
||||
"Layer": {},
|
||||
"IacMetadata": {
|
||||
"Provider": "Kubernetes",
|
||||
"Service": "general",
|
||||
"StartLine": 121,
|
||||
"EndLine": 133
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Namespace": "default",
|
||||
"Kind": "ConfigMap",
|
||||
"Name": "kube-root-ca.crt"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
14
docs/docs/kubernetes/operator/index.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# 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
|
||||
320
docs/docs/licenses/scanning.md
Normal file
@@ -0,0 +1,320 @@
|
||||
# License Scanning
|
||||
|
||||
Trivy scans any container image for license files and offers an opinionated view on the risk associated with the license.
|
||||
|
||||
License are classified using the [Google License Classification][google-license-classification] -
|
||||
|
||||
- Forbidden
|
||||
- Restricted
|
||||
- Reciprocal
|
||||
- Notice
|
||||
- Permissive
|
||||
- Unencumbered
|
||||
- Unknown
|
||||
|
||||
!!! tip
|
||||
Licenses that Trivy fails to recognize are classified as UNKNOWN.
|
||||
As those licenses may be in violation, it is recommended to check those unknown licenses as well.
|
||||
|
||||
By default, Trivy scans licenses for packages installed by `apk`, `apt-get`, `dnf`, `npm`, `pip`, `gem`, etc.
|
||||
To enable extended license scanning, you can use `--license-full`.
|
||||
In addition to package licenses, Trivy scans source code files, Markdown documents, text files and `LICENSE` documents to identify license usage within the image or filesystem.
|
||||
|
||||
!!! note
|
||||
The full license scanning is expensive. It takes a while.
|
||||
|
||||
Currently, the standard license scanning doesn't support filesystem and repository scanning.
|
||||
|
||||
| License scnanning | Image | Rootfs | Filesystem | Repository |
|
||||
|:---------------------:|:-----:|:---------:|:----------:|:----------:|
|
||||
| Standard | ✅ | ✅ | - | - |
|
||||
| Full (--license-full) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
|
||||
License checking classifies the identified licenses and map the classification to severity.
|
||||
|
||||
| Classification | Severity |
|
||||
|----------------|----------|
|
||||
| Forbidden | CRITICAL |
|
||||
| Restricted | HIGH |
|
||||
| Reciprocal | MEDIUM |
|
||||
| Notice | LOW |
|
||||
| Permissive | LOW |
|
||||
| Unencumbered | LOW |
|
||||
| Unknown | UNKNOWN |
|
||||
|
||||
## Quick start
|
||||
This section shows how to scan license in container image and filesystem.
|
||||
|
||||
### Standard scanning
|
||||
Specify an image name with `--security-cheks license`.
|
||||
|
||||
``` shell
|
||||
$ trivy image --security-checks license --severity UNKNOWN,HIGH,CRITICAL alpine:3.15
|
||||
2022-07-13T17:28:39.526+0300 INFO License scanning is enabled
|
||||
|
||||
OS Packages (license)
|
||||
=====================
|
||||
Total: 6 (UNKNOWN: 0, HIGH: 6, CRITICAL: 0)
|
||||
|
||||
┌───────────────────┬─────────┬────────────────┬──────────┐
|
||||
│ Package │ License │ Classification │ Severity │
|
||||
├───────────────────┼─────────┼────────────────┼──────────┤
|
||||
│ alpine-baselayout │ GPL-2.0 │ Restricted │ HIGH │
|
||||
├───────────────────┤ │ │ │
|
||||
│ apk-tools │ │ │ │
|
||||
├───────────────────┤ │ │ │
|
||||
│ busybox │ │ │ │
|
||||
├───────────────────┤ │ │ │
|
||||
│ musl-utils │ │ │ │
|
||||
├───────────────────┤ │ │ │
|
||||
│ scanelf │ │ │ │
|
||||
├───────────────────┤ │ │ │
|
||||
│ ssl_client │ │ │ │
|
||||
└───────────────────┴─────────┴────────────────┴──────────┘
|
||||
```
|
||||
|
||||
### Full scanning
|
||||
Specify `--license-full`
|
||||
|
||||
``` shell
|
||||
$ trivy image --security-checks license --severity UNKNOWN,HIGH,CRITICAL --license-full grafana/grafana
|
||||
2022-07-13T17:48:40.905+0300 INFO Full license scanning is enabled
|
||||
|
||||
OS Packages (license)
|
||||
=====================
|
||||
Total: 20 (UNKNOWN: 9, HIGH: 11, CRITICAL: 0)
|
||||
|
||||
┌───────────────────┬───────────────────┬────────────────┬──────────┐
|
||||
│ Package │ License │ Classification │ Severity │
|
||||
├───────────────────┼───────────────────┼────────────────┼──────────┤
|
||||
│ alpine-baselayout │ GPL-2.0 │ Restricted │ HIGH │
|
||||
├───────────────────┤ │ │ │
|
||||
│ apk-tools │ │ │ │
|
||||
├───────────────────┼───────────────────┤ │ │
|
||||
│ bash │ GPL-3.0 │ │ │
|
||||
├───────────────────┼───────────────────┼────────────────┼──────────┤
|
||||
│ keyutils-libs │ GPL-2.0 │ Restricted │ HIGH │
|
||||
│ ├───────────────────┼────────────────┼──────────┤
|
||||
│ │ LGPL-2.0-or-later │ Non Standard │ UNKNOWN │
|
||||
├───────────────────┼───────────────────┤ │ │
|
||||
│ libaio │ LGPL-2.1-or-later │ │ │
|
||||
├───────────────────┼───────────────────┼────────────────┼──────────┤
|
||||
│ libcom_err │ GPL-2.0 │ Restricted │ HIGH │
|
||||
│ ├───────────────────┼────────────────┼──────────┤
|
||||
│ │ LGPL-2.0-or-later │ Non Standard │ UNKNOWN │
|
||||
├───────────────────┼───────────────────┼────────────────┼──────────┤
|
||||
│ tzdata │ Public-Domain │ Non Standard │ UNKNOWN │
|
||||
└───────────────────┴───────────────────┴────────────────┴──────────┘
|
||||
|
||||
Loose File License(s) (license)
|
||||
===============================
|
||||
Total: 6 (UNKNOWN: 4, HIGH: 0, CRITICAL: 2)
|
||||
|
||||
┌────────────────┬──────────┬──────────────┬──────────────────────────────────────────────────────────────┐
|
||||
│ Classification │ Severity │ License │ File Location │
|
||||
├────────────────┼──────────┼──────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ Forbidden │ CRITICAL │ AGPL-3.0 │ /usr/share/grafana/LICENSE │
|
||||
│ │ │ │ │
|
||||
│ │ │ │ │
|
||||
├────────────────┼──────────┼──────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ Non Standard │ UNKNOWN │ BSD-0-Clause │ /usr/share/grafana/public/build/5069.d6aae9dd11d49c741a80.j- │
|
||||
│ │ │ │ s.LICENSE.txt │
|
||||
│ │ │ ├──────────────────────────────────────────────────────────────┤
|
||||
│ │ │ │ /usr/share/grafana/public/build/6444.d6aae9dd11d49c741a80.j- │
|
||||
│ │ │ │ s.LICENSE.txt │
|
||||
│ │ │ ├──────────────────────────────────────────────────────────────┤
|
||||
│ │ │ │ /usr/share/grafana/public/build/7889.d6aae9dd11d49c741a80.j- │
|
||||
│ │ │ │ s.LICENSE.txt │
|
||||
│ │ │ ├──────────────────────────────────────────────────────────────┤
|
||||
│ │ │ │ /usr/share/grafana/public/build/canvasPanel.d6aae9dd11d49c7- │
|
||||
│ │ │ │ 41a80.js.LICENSE.txt │
|
||||
└────────────────┴──────────┴──────────────┴──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Trivy has number of configuration flags for use with license scanning;
|
||||
|
||||
### Ignored Licenses
|
||||
|
||||
Trivy license scanning can ignore licenses that are identified to explicitly remove them from the results using the `--ignored-licenses` flag;
|
||||
|
||||
```shell
|
||||
$ trivy image --security-checks license --ignored-licenses MPL-2.0,MIT --severity LOW grafana/grafana:latest
|
||||
2022-07-13T18:15:28.605Z INFO License scanning is enabled
|
||||
|
||||
OS Packages (license)
|
||||
=====================
|
||||
Total: 2 (HIGH: 2, CRITICAL: 0)
|
||||
|
||||
┌───────────────────┬─────────┬────────────────┬──────────┐
|
||||
│ Package │ License │ Classification │ Severity │
|
||||
├───────────────────┼─────────┼────────────────┼──────────┤
|
||||
│ alpine-baselayout │ GPL-2.0 │ Restricted │ HIGH │
|
||||
├───────────────────┤ │ │ │
|
||||
│ ssl_client │ │ │ │
|
||||
└───────────────────┴─────────┴────────────────┴──────────┘
|
||||
|
||||
```
|
||||
|
||||
### Custom Classification
|
||||
You can generate the default config by the `--generate-default-config` flag and customize the license classification.
|
||||
For example, if you want to forbid only AGPL-3.0, you can leave it under `forbidden` and move other licenses to another classification.
|
||||
|
||||
```shell
|
||||
$ trivy image --generate-default-config
|
||||
$ vim trivy.yaml
|
||||
license:
|
||||
forbidden:
|
||||
- AGPL-3.0
|
||||
|
||||
restricted:
|
||||
- AGPL-1.0
|
||||
- CC-BY-NC-1.0
|
||||
- CC-BY-NC-2.0
|
||||
- CC-BY-NC-2.5
|
||||
- CC-BY-NC-3.0
|
||||
- CC-BY-NC-4.0
|
||||
- CC-BY-NC-ND-1.0
|
||||
- CC-BY-NC-ND-2.0
|
||||
- CC-BY-NC-ND-2.5
|
||||
- CC-BY-NC-ND-3.0
|
||||
- CC-BY-NC-ND-4.0
|
||||
- CC-BY-NC-SA-1.0
|
||||
- CC-BY-NC-SA-2.0
|
||||
- CC-BY-NC-SA-2.5
|
||||
- CC-BY-NC-SA-3.0
|
||||
- CC-BY-NC-SA-4.0
|
||||
- Commons-Clause
|
||||
- Facebook-2-Clause
|
||||
- Facebook-3-Clause
|
||||
- Facebook-Examples
|
||||
- WTFPL
|
||||
- BCL
|
||||
- CC-BY-ND-1.0
|
||||
- CC-BY-ND-2.0
|
||||
- CC-BY-ND-2.5
|
||||
- CC-BY-ND-3.0
|
||||
- CC-BY-ND-4.0
|
||||
- CC-BY-SA-1.0
|
||||
- CC-BY-SA-2.0
|
||||
- CC-BY-SA-2.5
|
||||
- CC-BY-SA-3.0
|
||||
- CC-BY-SA-4.0
|
||||
- GPL-1.0
|
||||
- GPL-2.0
|
||||
- GPL-2.0-with-autoconf-exception
|
||||
- GPL-2.0-with-bison-exception
|
||||
- GPL-2.0-with-classpath-exception
|
||||
- GPL-2.0-with-font-exception
|
||||
- GPL-2.0-with-GCC-exception
|
||||
- GPL-3.0
|
||||
- GPL-3.0-with-autoconf-exception
|
||||
- GPL-3.0-with-GCC-exception
|
||||
- LGPL-2.0
|
||||
- LGPL-2.1
|
||||
- LGPL-3.0
|
||||
- NPL-1.0
|
||||
- NPL-1.1
|
||||
- OSL-1.0
|
||||
- OSL-1.1
|
||||
- OSL-2.0
|
||||
- OSL-2.1
|
||||
- OSL-3.0
|
||||
- QPL-1.0
|
||||
- Sleepycat
|
||||
|
||||
reciprocal:
|
||||
- APSL-1.0
|
||||
- APSL-1.1
|
||||
- APSL-1.2
|
||||
- APSL-2.0
|
||||
- CDDL-1.0
|
||||
- CDDL-1.1
|
||||
- CPL-1.0
|
||||
- EPL-1.0
|
||||
- EPL-2.0
|
||||
- FreeImage
|
||||
- IPL-1.0
|
||||
- MPL-1.0
|
||||
- MPL-1.1
|
||||
- MPL-2.0
|
||||
- Ruby
|
||||
|
||||
notice:
|
||||
- AFL-1.1
|
||||
- AFL-1.2
|
||||
- AFL-2.0
|
||||
- AFL-2.1
|
||||
- AFL-3.0
|
||||
- Apache-1.0
|
||||
- Apache-1.1
|
||||
- Apache-2.0
|
||||
- Artistic-1.0-cl8
|
||||
- Artistic-1.0-Perl
|
||||
- Artistic-1.0
|
||||
- Artistic-2.0
|
||||
- BSL-1.0
|
||||
- BSD-2-Clause-FreeBSD
|
||||
- BSD-2-Clause-NetBSD
|
||||
- BSD-2-Clause
|
||||
- BSD-3-Clause-Attribution
|
||||
- BSD-3-Clause-Clear
|
||||
- BSD-3-Clause-LBNL
|
||||
- BSD-3-Clause
|
||||
- BSD-4-Clause
|
||||
- BSD-4-Clause-UC
|
||||
- BSD-Protection
|
||||
- CC-BY-1.0
|
||||
- CC-BY-2.0
|
||||
- CC-BY-2.5
|
||||
- CC-BY-3.0
|
||||
- CC-BY-4.0
|
||||
- FTL
|
||||
- ISC
|
||||
- ImageMagick
|
||||
- Libpng
|
||||
- Lil-1.0
|
||||
- Linux-OpenIB
|
||||
- LPL-1.02
|
||||
- LPL-1.0
|
||||
- MS-PL
|
||||
- MIT
|
||||
- NCSA
|
||||
- OpenSSL
|
||||
- PHP-3.01
|
||||
- PHP-3.0
|
||||
- PIL
|
||||
- Python-2.0
|
||||
- Python-2.0-complete
|
||||
- PostgreSQL
|
||||
- SGI-B-1.0
|
||||
- SGI-B-1.1
|
||||
- SGI-B-2.0
|
||||
- Unicode-DFS-2015
|
||||
- Unicode-DFS-2016
|
||||
- Unicode-TOU
|
||||
- UPL-1.0
|
||||
- W3C-19980720
|
||||
- W3C-20150513
|
||||
- W3C
|
||||
- X11
|
||||
- Xnet
|
||||
- Zend-2.0
|
||||
- zlib-acknowledgement
|
||||
- Zlib
|
||||
- ZPL-1.1
|
||||
- ZPL-2.0
|
||||
- ZPL-2.1
|
||||
|
||||
unencumbered:
|
||||
- CC0-1.0
|
||||
- Unlicense
|
||||
- 0BSD
|
||||
|
||||
permissive: []
|
||||
```
|
||||
|
||||
|
||||
[google-license-classification]: https://opensource.google/documentation/reference/thirdparty/licenses
|
||||
@@ -3,20 +3,19 @@
|
||||
Trivy uses cfsec internally to scan both JSON and YAML configuration files, but Trivy doesn't support some features provided by cfsec.
|
||||
This section describes the differences between Trivy and cfsec.
|
||||
|
||||
| Feature | Trivy | cfsec |
|
||||
| --------------------------- | --------------------------------------- | -------------------- |
|
||||
| Built-in Policies | :material-check: | :material-check: |
|
||||
| Custom Policies | Rego[^1] | :material-close: |
|
||||
| Policy Metadata[^2] | :material-check: | :material-check: |
|
||||
| Show Successes | :material-check: | :material-check: |
|
||||
| Disable Policies | :material-check: | :material-check: |
|
||||
| Show Issue Lines | :material-close: | :material-check: |
|
||||
| View Statistics | :material-close: | :material-check: |
|
||||
| Filtering by Severity | :material-check: | :material-close: |
|
||||
| Supported Formats | Dockerfile, JSON, YAML, Terraform, etc. | CloudFormation JSON and YAML |
|
||||
| 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]: CloudFormation files are not supported
|
||||
[^2]: To enrich the results such as ID, Title, Description, Severity, etc.
|
||||
[^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.
|
||||
|
||||
@@ -3,21 +3,20 @@
|
||||
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[^1] | JSON and YAML |
|
||||
| Policy Metadata[^2] | :material-check: | :material-check: |
|
||||
| Show Successes | :material-check: | :material-check: |
|
||||
| Disable Policies | :material-check: | :material-check: |
|
||||
| Show Issue Lines | :material-close: | :material-check: |
|
||||
| Support .tfvars | :material-close: | :material-check: |
|
||||
| View Statistics | :material-close: | :material-check: |
|
||||
| Filtering by Severity | :material-check: | :material-close: |
|
||||
| Supported Formats | Dockerfile, JSON, YAML, Terraform, etc. | Terraform |
|
||||
| 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]: Terraform HCL files are not supported.
|
||||
[^2]: To enrich the results such as ID, Title, Description, Severity, etc.
|
||||
[^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.
|
||||
|
||||
@@ -6,38 +6,209 @@ This will output a large trace from Open Policy Agent like the following:
|
||||
!!! tip
|
||||
Only failed policies show traces. If you want to debug a passed policy, you need to make it fail on purpose.
|
||||
|
||||
```bash
|
||||
```shell
|
||||
$ trivy conf --trace configs/
|
||||
2021-07-11T16:45:58.493+0300 INFO Detected config files: 1
|
||||
2022-05-16T13:47:58.853+0100 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
Tests: 23 (SUCCESSES: 21, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
MEDIUM: Specify a tag in the 'FROM' statement for image 'alpine'
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
When using a 'FROM' statement you should use a specific tag to avoid uncontrolled behavior when the image is updated.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ds001
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:1
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
1 [ FROM alpine:latest
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
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
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
ID: DS001
|
||||
File: Dockerfile
|
||||
Namespace: builtin.dockerfile.DS001
|
||||
Query: data.builtin.dockerfile.DS001.deny
|
||||
Message: Specify a tag in the 'FROM' statement for image 'alpine'
|
||||
TRACE Enter data.builtin.dockerfile.DS001.deny = _
|
||||
TRACE | Eval data.builtin.dockerfile.DS001.deny = _
|
||||
TRACE | Index data.builtin.dockerfile.DS001.deny (matched 1 rule)
|
||||
TRACE | Enter data.builtin.dockerfile.DS001.deny
|
||||
TRACE | | Eval output = data.builtin.dockerfile.DS001.fail_latest[_]
|
||||
TRACE | | Index data.builtin.dockerfile.DS001.fail_latest (matched 1 rule)
|
||||
TRACE | | Enter data.builtin.dockerfile.DS001.fail_latest
|
||||
TRACE | | | Eval output = data.builtin.dockerfile.DS001.image_tags[_]
|
||||
TRACE | | | Index data.builtin.dockerfile.DS001.image_tags (matched 2 rules)
|
||||
TRACE | | | Enter data.builtin.dockerfile.DS001.image_tags
|
||||
TRACE | | | | Eval from = data.lib.docker.from[_]
|
||||
TRACE | | | | Index data.lib.docker.from (matched 1 rule)
|
||||
TRACE | | | | Enter data.lib.docker.from
|
||||
TRACE | | | | | Eval instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "from"
|
||||
TRACE | | | | | Exit data.lib.docker.from
|
||||
TRACE | | | | Redo data.lib.docker.from
|
||||
TRACE | | | | | Redo instruction.Cmd = "from"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "from"
|
||||
TRACE | | | | | Fail instruction.Cmd = "from"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "from"
|
||||
TRACE | | | | | Fail instruction.Cmd = "from"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | Eval name = from.Value[0]
|
||||
TRACE | | | | Eval not startswith(name, "$")
|
||||
TRACE | | | | Enter startswith(name, "$")
|
||||
TRACE | | | | | Eval startswith(name, "$")
|
||||
TRACE | | | | | Fail startswith(name, "$")
|
||||
TRACE | | | | Eval data.builtin.dockerfile.DS001.parse_tag(name, __local505__)
|
||||
TRACE | | | | Index data.builtin.dockerfile.DS001.parse_tag (matched 2 rules)
|
||||
TRACE | | | | Enter data.builtin.dockerfile.DS001.parse_tag
|
||||
TRACE | | | | | Eval split(name, ":", __local504__)
|
||||
TRACE | | | | | Eval [img, tag] = __local504__
|
||||
TRACE | | | | | Exit data.builtin.dockerfile.DS001.parse_tag
|
||||
TRACE | | | | Eval [img, tag] = __local505__
|
||||
TRACE | | | | Eval output = {"cmd": from, "img": img, "tag": tag}
|
||||
TRACE | | | | Exit data.builtin.dockerfile.DS001.image_tags
|
||||
TRACE | | | Redo data.builtin.dockerfile.DS001.image_tags
|
||||
TRACE | | | | Redo output = {"cmd": from, "img": img, "tag": tag}
|
||||
TRACE | | | | Redo [img, tag] = __local505__
|
||||
TRACE | | | | Redo data.builtin.dockerfile.DS001.parse_tag(name, __local505__)
|
||||
TRACE | | | | Redo data.builtin.dockerfile.DS001.parse_tag
|
||||
TRACE | | | | | Redo [img, tag] = __local504__
|
||||
TRACE | | | | | Redo split(name, ":", __local504__)
|
||||
TRACE | | | | Enter data.builtin.dockerfile.DS001.parse_tag
|
||||
TRACE | | | | | Eval tag = "latest"
|
||||
TRACE | | | | | Eval not contains(img, ":")
|
||||
TRACE | | | | | Enter contains(img, ":")
|
||||
TRACE | | | | | | Eval contains(img, ":")
|
||||
TRACE | | | | | | Exit contains(img, ":")
|
||||
TRACE | | | | | Redo contains(img, ":")
|
||||
TRACE | | | | | | Redo contains(img, ":")
|
||||
TRACE | | | | | Fail not contains(img, ":")
|
||||
TRACE | | | | | Redo tag = "latest"
|
||||
TRACE | | | | Redo name = from.Value[0]
|
||||
TRACE | | | | Redo from = data.lib.docker.from[_]
|
||||
TRACE | | | Enter data.builtin.dockerfile.DS001.image_tags
|
||||
TRACE | | | | Eval from = data.lib.docker.from[i]
|
||||
TRACE | | | | Index data.lib.docker.from (matched 1 rule)
|
||||
TRACE | | | | Eval name = from.Value[0]
|
||||
TRACE | | | | Eval cmd_obj = input.stages[j][k]
|
||||
TRACE | | | | Eval possibilities = {"arg", "env"}
|
||||
TRACE | | | | Eval cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Fail cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Redo possibilities = {"arg", "env"}
|
||||
TRACE | | | | Redo cmd_obj = input.stages[j][k]
|
||||
TRACE | | | | Eval possibilities = {"arg", "env"}
|
||||
TRACE | | | | Eval cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Fail cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Redo possibilities = {"arg", "env"}
|
||||
TRACE | | | | Redo cmd_obj = input.stages[j][k]
|
||||
TRACE | | | | Eval possibilities = {"arg", "env"}
|
||||
TRACE | | | | Eval cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Fail cmd_obj.Cmd = possibilities[l]
|
||||
TRACE | | | | Redo possibilities = {"arg", "env"}
|
||||
TRACE | | | | Redo cmd_obj = input.stages[j][k]
|
||||
TRACE | | | | Redo name = from.Value[0]
|
||||
TRACE | | | | Redo from = data.lib.docker.from[i]
|
||||
TRACE | | | Eval __local752__ = output.img
|
||||
TRACE | | | Eval neq(__local752__, "scratch")
|
||||
TRACE | | | Eval __local753__ = output.img
|
||||
TRACE | | | Eval not data.builtin.dockerfile.DS001.is_alias(__local753__)
|
||||
TRACE | | | Enter data.builtin.dockerfile.DS001.is_alias(__local753__)
|
||||
TRACE | | | | Eval data.builtin.dockerfile.DS001.is_alias(__local753__)
|
||||
TRACE | | | | Index data.builtin.dockerfile.DS001.is_alias (matched 1 rule, early exit)
|
||||
TRACE | | | | Enter data.builtin.dockerfile.DS001.is_alias
|
||||
TRACE | | | | | Eval img = data.builtin.dockerfile.DS001.get_aliases[_]
|
||||
TRACE | | | | | Index data.builtin.dockerfile.DS001.get_aliases (matched 1 rule)
|
||||
TRACE | | | | | Enter data.builtin.dockerfile.DS001.get_aliases
|
||||
TRACE | | | | | | Eval from_cmd = data.lib.docker.from[_]
|
||||
TRACE | | | | | | Index data.lib.docker.from (matched 1 rule)
|
||||
TRACE | | | | | | Eval __local749__ = from_cmd.Value
|
||||
TRACE | | | | | | Eval data.builtin.dockerfile.DS001.get_alias(__local749__, __local503__)
|
||||
TRACE | | | | | | Index data.builtin.dockerfile.DS001.get_alias (matched 1 rule)
|
||||
TRACE | | | | | | Enter data.builtin.dockerfile.DS001.get_alias
|
||||
TRACE | | | | | | | Eval __local748__ = values[i]
|
||||
TRACE | | | | | | | Eval lower(__local748__, __local501__)
|
||||
TRACE | | | | | | | Eval "as" = __local501__
|
||||
TRACE | | | | | | | Fail "as" = __local501__
|
||||
TRACE | | | | | | | Redo lower(__local748__, __local501__)
|
||||
TRACE | | | | | | | Redo __local748__ = values[i]
|
||||
TRACE | | | | | | Fail data.builtin.dockerfile.DS001.get_alias(__local749__, __local503__)
|
||||
TRACE | | | | | | Redo __local749__ = from_cmd.Value
|
||||
TRACE | | | | | | Redo from_cmd = data.lib.docker.from[_]
|
||||
TRACE | | | | | Fail img = data.builtin.dockerfile.DS001.get_aliases[_]
|
||||
TRACE | | | | Fail data.builtin.dockerfile.DS001.is_alias(__local753__)
|
||||
TRACE | | | Eval output.tag = "latest"
|
||||
TRACE | | | Exit data.builtin.dockerfile.DS001.fail_latest
|
||||
TRACE | | Redo data.builtin.dockerfile.DS001.fail_latest
|
||||
TRACE | | | Redo output.tag = "latest"
|
||||
TRACE | | | Redo __local753__ = output.img
|
||||
TRACE | | | Redo neq(__local752__, "scratch")
|
||||
TRACE | | | Redo __local752__ = output.img
|
||||
TRACE | | | Redo output = data.builtin.dockerfile.DS001.image_tags[_]
|
||||
TRACE | | Eval __local754__ = output.img
|
||||
TRACE | | Eval sprintf("Specify a tag in the 'FROM' statement for image '%s'", [__local754__], __local509__)
|
||||
TRACE | | Eval msg = __local509__
|
||||
TRACE | | Eval __local755__ = output.cmd
|
||||
TRACE | | Eval data.lib.docker.result(msg, __local755__, __local510__)
|
||||
TRACE | | Index data.lib.docker.result (matched 1 rule)
|
||||
TRACE | | Enter data.lib.docker.result
|
||||
TRACE | | | Eval object.get(cmd, "EndLine", 0, __local470__)
|
||||
TRACE | | | Eval object.get(cmd, "Path", "", __local471__)
|
||||
TRACE | | | Eval object.get(cmd, "StartLine", 0, __local472__)
|
||||
TRACE | | | Eval result = {"endline": __local470__, "filepath": __local471__, "msg": msg, "startline": __local472__}
|
||||
TRACE | | | Exit data.lib.docker.result
|
||||
TRACE | | Eval res = __local510__
|
||||
TRACE | | Exit data.builtin.dockerfile.DS001.deny
|
||||
TRACE | Redo data.builtin.dockerfile.DS001.deny
|
||||
TRACE | | Redo res = __local510__
|
||||
TRACE | | Redo data.lib.docker.result(msg, __local755__, __local510__)
|
||||
TRACE | | Redo data.lib.docker.result
|
||||
TRACE | | | Redo result = {"endline": __local470__, "filepath": __local471__, "msg": msg, "startline": __local472__}
|
||||
TRACE | | | Redo object.get(cmd, "StartLine", 0, __local472__)
|
||||
TRACE | | | Redo object.get(cmd, "Path", "", __local471__)
|
||||
TRACE | | | Redo object.get(cmd, "EndLine", 0, __local470__)
|
||||
TRACE | | Redo __local755__ = output.cmd
|
||||
TRACE | | Redo msg = __local509__
|
||||
TRACE | | Redo sprintf("Specify a tag in the 'FROM' statement for image '%s'", [__local754__], __local509__)
|
||||
TRACE | | Redo __local754__ = output.img
|
||||
TRACE | | Redo output = data.builtin.dockerfile.DS001.fail_latest[_]
|
||||
TRACE | Exit data.builtin.dockerfile.DS001.deny = _
|
||||
TRACE Redo data.builtin.dockerfile.DS001.deny = _
|
||||
TRACE | Redo data.builtin.dockerfile.DS001.deny = _
|
||||
TRACE
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
|
||||
ID: DS002
|
||||
File: Dockerfile
|
||||
Namespace: appshield.dockerfile.DS002
|
||||
Query: data.appshield.dockerfile.DS002.deny
|
||||
Namespace: builtin.dockerfile.DS002
|
||||
Query: data.builtin.dockerfile.DS002.deny
|
||||
Message: Last USER command in Dockerfile should not be 'root'
|
||||
TRACE Enter data.appshield.dockerfile.DS002.deny = _
|
||||
TRACE | Eval data.appshield.dockerfile.DS002.deny = _
|
||||
TRACE | Index data.appshield.dockerfile.DS002.deny matched 2 rules)
|
||||
TRACE | Enter data.appshield.dockerfile.DS002.deny
|
||||
TRACE | | Eval data.appshield.dockerfile.DS002.fail_user_count
|
||||
TRACE | | Index data.appshield.dockerfile.DS002.fail_user_count (matched 1 rule)
|
||||
TRACE | | Enter data.appshield.dockerfile.DS002.fail_user_count
|
||||
TRACE | | | Eval __local559__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Index data.appshield.dockerfile.DS002.get_user (matched 1 rule)
|
||||
TRACE | | | Enter data.appshield.dockerfile.DS002.get_user
|
||||
TRACE Enter data.builtin.dockerfile.DS002.deny = _
|
||||
TRACE | Eval data.builtin.dockerfile.DS002.deny = _
|
||||
TRACE | Index data.builtin.dockerfile.DS002.deny (matched 2 rules)
|
||||
TRACE | Enter data.builtin.dockerfile.DS002.deny
|
||||
TRACE | | Eval data.builtin.dockerfile.DS002.fail_user_count
|
||||
TRACE | | Index data.builtin.dockerfile.DS002.fail_user_count (matched 1 rule, early exit)
|
||||
TRACE | | Enter data.builtin.dockerfile.DS002.fail_user_count
|
||||
TRACE | | | Eval __local771__ = data.builtin.dockerfile.DS002.get_user
|
||||
TRACE | | | Index data.builtin.dockerfile.DS002.get_user (matched 1 rule)
|
||||
TRACE | | | Enter data.builtin.dockerfile.DS002.get_user
|
||||
TRACE | | | | Eval user = data.lib.docker.user[_]
|
||||
TRACE | | | | Index data.lib.docker.user (matched 1 rule)
|
||||
TRACE | | | | Enter data.lib.docker.user
|
||||
@@ -46,180 +217,88 @@ TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | Eval count(__local559__, __local391__)
|
||||
TRACE | | | Eval lt(__local391__, 1)
|
||||
TRACE | | | Fail lt(__local391__, 1)
|
||||
TRACE | | | Redo count(__local559__, __local391__)
|
||||
TRACE | | | Redo __local559__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | Fail data.appshield.dockerfile.DS002.fail_user_count
|
||||
TRACE | Enter data.appshield.dockerfile.DS002.deny
|
||||
TRACE | | Eval data.appshield.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | Index data.appshield.dockerfile.DS002.fail_last_user_root (matched 1 rule)
|
||||
TRACE | | Enter data.appshield.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | | Eval __local560__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Index data.appshield.dockerfile.DS002.get_user (matched 1 rule)
|
||||
TRACE | | | Enter data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Eval user = data.lib.docker.user[_]
|
||||
TRACE | | | | Index data.lib.docker.user (matched 1 rule)
|
||||
TRACE | | | | Enter data.lib.docker.user
|
||||
TRACE | | | | | Eval instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Exit data.builtin.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.builtin.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | Eval cast_array(__local560__, __local392__)
|
||||
TRACE | | | Eval user = __local392__
|
||||
TRACE | | | Eval __local561__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Index data.appshield.dockerfile.DS002.get_user (matched 1 rule)
|
||||
TRACE | | | Enter data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Eval user = data.lib.docker.user[_]
|
||||
TRACE | | | | Index data.lib.docker.user (matched 1 rule)
|
||||
TRACE | | | | Enter data.lib.docker.user
|
||||
TRACE | | | | | Eval instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Exit data.lib.docker.user
|
||||
TRACE | | | | Eval username = user.Value[_]
|
||||
TRACE | | | | Exit data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | | Redo username = user.Value[_]
|
||||
TRACE | | | | Redo user = data.lib.docker.user[_]
|
||||
TRACE | | | | Redo data.lib.docker.user
|
||||
TRACE | | | | | Redo instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | | | Eval instruction.Cmd = "user"
|
||||
TRACE | | | | | Fail instruction.Cmd = "user"
|
||||
TRACE | | | | | Redo instruction = input.stages[_][_]
|
||||
TRACE | | | Eval count(__local561__, __local393__)
|
||||
TRACE | | | Eval len = __local393__
|
||||
TRACE | | | Eval minus(len, 1, __local394__)
|
||||
TRACE | | | Eval user[__local394__] = "root"
|
||||
TRACE | | | Exit data.appshield.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | Eval res = "Last USER command in Dockerfile should not be 'root'"
|
||||
TRACE | | Exit data.appshield.dockerfile.DS002.deny
|
||||
TRACE | Redo data.appshield.dockerfile.DS002.deny
|
||||
TRACE | | Redo res = "Last USER command in Dockerfile should not be 'root'"
|
||||
TRACE | | Redo data.appshield.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | Redo data.appshield.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | | Redo user[__local394__] = "root"
|
||||
TRACE | | | Redo minus(len, 1, __local394__)
|
||||
TRACE | | | Redo len = __local393__
|
||||
TRACE | | | Redo count(__local561__, __local393__)
|
||||
TRACE | | | Redo __local561__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | | | Redo user = __local392__
|
||||
TRACE | | | Redo cast_array(__local560__, __local392__)
|
||||
TRACE | | | Redo __local560__ = data.appshield.dockerfile.DS002.get_user
|
||||
TRACE | Exit data.appshield.dockerfile.DS002.deny = _
|
||||
TRACE Redo data.appshield.dockerfile.DS002.deny = _
|
||||
TRACE | Redo data.appshield.dockerfile.DS002.deny = _
|
||||
TRACE | | | Eval count(__local771__, __local536__)
|
||||
TRACE | | | Eval lt(__local536__, 1)
|
||||
TRACE | | | Fail lt(__local536__, 1)
|
||||
TRACE | | | Redo count(__local771__, __local536__)
|
||||
TRACE | | | Redo __local771__ = data.builtin.dockerfile.DS002.get_user
|
||||
TRACE | | Fail data.builtin.dockerfile.DS002.fail_user_count
|
||||
TRACE | Enter data.builtin.dockerfile.DS002.deny
|
||||
TRACE | | Eval cmd = data.builtin.dockerfile.DS002.fail_last_user_root[_]
|
||||
TRACE | | Index data.builtin.dockerfile.DS002.fail_last_user_root (matched 1 rule)
|
||||
TRACE | | Enter data.builtin.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | | Eval stage_users = data.lib.docker.stage_user[_]
|
||||
TRACE | | | Index data.lib.docker.stage_user (matched 1 rule)
|
||||
TRACE | | | Enter data.lib.docker.stage_user
|
||||
TRACE | | | | Eval stage = input.stages[stage_name]
|
||||
TRACE | | | | Eval users = [cmd | cmd = stage[_]; cmd.Cmd = "user"]
|
||||
TRACE | | | | Enter cmd = stage[_]; cmd.Cmd = "user"
|
||||
TRACE | | | | | Eval cmd = stage[_]
|
||||
TRACE | | | | | Eval cmd.Cmd = "user"
|
||||
TRACE | | | | | Fail cmd.Cmd = "user"
|
||||
TRACE | | | | | Redo cmd = stage[_]
|
||||
TRACE | | | | | Eval cmd.Cmd = "user"
|
||||
TRACE | | | | | Exit cmd = stage[_]; cmd.Cmd = "user"
|
||||
TRACE | | | | Redo cmd = stage[_]; cmd.Cmd = "user"
|
||||
TRACE | | | | | Redo cmd.Cmd = "user"
|
||||
TRACE | | | | | Redo cmd = stage[_]
|
||||
TRACE | | | | | Eval cmd.Cmd = "user"
|
||||
TRACE | | | | | Fail cmd.Cmd = "user"
|
||||
TRACE | | | | | Redo cmd = stage[_]
|
||||
TRACE | | | | Exit data.lib.docker.stage_user
|
||||
TRACE | | | Redo data.lib.docker.stage_user
|
||||
TRACE | | | | Redo users = [cmd | cmd = stage[_]; cmd.Cmd = "user"]
|
||||
TRACE | | | | Redo stage = input.stages[stage_name]
|
||||
TRACE | | | Eval count(stage_users, __local537__)
|
||||
TRACE | | | Eval len = __local537__
|
||||
TRACE | | | Eval minus(len, 1, __local538__)
|
||||
TRACE | | | Eval last = stage_users[__local538__]
|
||||
TRACE | | | Eval user = last.Value[0]
|
||||
TRACE | | | Eval user = "root"
|
||||
TRACE | | | Exit data.builtin.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | Redo data.builtin.dockerfile.DS002.fail_last_user_root
|
||||
TRACE | | | Redo user = "root"
|
||||
TRACE | | | Redo user = last.Value[0]
|
||||
TRACE | | | Redo last = stage_users[__local538__]
|
||||
TRACE | | | Redo minus(len, 1, __local538__)
|
||||
TRACE | | | Redo len = __local537__
|
||||
TRACE | | | Redo count(stage_users, __local537__)
|
||||
TRACE | | | Redo stage_users = data.lib.docker.stage_user[_]
|
||||
TRACE | | Eval msg = "Last USER command in Dockerfile should not be 'root'"
|
||||
TRACE | | Eval data.lib.docker.result(msg, cmd, __local540__)
|
||||
TRACE | | Index data.lib.docker.result (matched 1 rule)
|
||||
TRACE | | Enter data.lib.docker.result
|
||||
TRACE | | | Eval object.get(cmd, "EndLine", 0, __local470__)
|
||||
TRACE | | | Eval object.get(cmd, "Path", "", __local471__)
|
||||
TRACE | | | Eval object.get(cmd, "StartLine", 0, __local472__)
|
||||
TRACE | | | Eval result = {"endline": __local470__, "filepath": __local471__, "msg": msg, "startline": __local472__}
|
||||
TRACE | | | Exit data.lib.docker.result
|
||||
TRACE | | Eval res = __local540__
|
||||
TRACE | | Exit data.builtin.dockerfile.DS002.deny
|
||||
TRACE | Redo data.builtin.dockerfile.DS002.deny
|
||||
TRACE | | Redo res = __local540__
|
||||
TRACE | | Redo data.lib.docker.result(msg, cmd, __local540__)
|
||||
TRACE | | Redo data.lib.docker.result
|
||||
TRACE | | | Redo result = {"endline": __local470__, "filepath": __local471__, "msg": msg, "startline": __local472__}
|
||||
TRACE | | | Redo object.get(cmd, "StartLine", 0, __local472__)
|
||||
TRACE | | | Redo object.get(cmd, "Path", "", __local471__)
|
||||
TRACE | | | Redo object.get(cmd, "EndLine", 0, __local470__)
|
||||
TRACE | | Redo msg = "Last USER command in Dockerfile should not be 'root'"
|
||||
TRACE | | Redo cmd = data.builtin.dockerfile.DS002.fail_last_user_root[_]
|
||||
TRACE | Exit data.builtin.dockerfile.DS002.deny = _
|
||||
TRACE Redo data.builtin.dockerfile.DS002.deny = _
|
||||
TRACE | Redo data.builtin.dockerfile.DS002.deny = _
|
||||
TRACE
|
||||
```
|
||||
@@ -6,7 +6,7 @@ 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.kuberntes`, or `user.kubernetes.ID001`.
|
||||
In this case, the package prefix should be `user`, `user.kubernetes`, or `user.kubernetes.ID001`.
|
||||
|
||||
### Dockerfile
|
||||
See [here][dockerfile].
|
||||
|
||||
@@ -14,26 +14,23 @@ As for `--namespaces` option, the detail is described as below.
|
||||
If a file name matches the following file patterns, Trivy will parse the file and pass it as input to your Rego policy.
|
||||
|
||||
| File format | File pattern |
|
||||
| ------------- | --------------------------------------------------------- |
|
||||
|---------------|-----------------------------------------------------------|
|
||||
| JSON | `*.json` |
|
||||
| YAML | `*.yaml` |
|
||||
| TOML | `*.toml` |
|
||||
| HCL | `*.hcl`, `*.hcl1`, and `*.hcl2` |
|
||||
| YAML | `*.yaml` and `*.yml` |
|
||||
| Dockerfile | `Dockerfile`, `Dockerfile.*`, and `*.Dockerfile` |
|
||||
| Containerfile | `Containerfile`, `Containerfile.*`, and `*.Containerfile` |
|
||||
| Terraform | `*.tf` and `*.tf.json` |
|
||||
|
||||
### Configuration languages
|
||||
In the above general file formats, Trivy automatically identifies the following types of configuration files:
|
||||
|
||||
- Ansible (YAML)
|
||||
- CloudFormation (JSON/YAML)
|
||||
- Kubernetes (JSON/YAML)
|
||||
- Helm (YAML)
|
||||
- Terraform Plan (JSON)
|
||||
|
||||
This is useful for filtering inputs, as described below.
|
||||
|
||||
!!! warning
|
||||
Custom policies do not support Terraform at the moment.
|
||||
|
||||
## Rego format
|
||||
A single package must contain only one policy.
|
||||
|
||||
@@ -41,11 +38,12 @@ A single package must contain only one policy.
|
||||
``` rego
|
||||
package user.kubernetes.ID001
|
||||
|
||||
import lib.result
|
||||
|
||||
__rego_metadata__ := {
|
||||
"id": "ID001",
|
||||
"title": "Deployment not allowed",
|
||||
"severity": "LOW",
|
||||
"type": "Custom Kubernetes Check",
|
||||
"description": "Deployments are not allowed because of some reasons.",
|
||||
}
|
||||
|
||||
@@ -55,9 +53,10 @@ A single package must contain only one policy.
|
||||
],
|
||||
}
|
||||
|
||||
deny[msg] {
|
||||
input.kind == "Deployment"
|
||||
msg = sprintf("Found deployment '%s' but deployments are not allowed", [input.metadata.name])
|
||||
deny[res] {
|
||||
input.kind == "Deployment"
|
||||
msg := sprintf("Found deployment '%s' but deployments are not allowed", [input.metadata.name])
|
||||
res := result.new(msg, input)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -73,6 +72,9 @@ If you add a new custom policy, it must be defined under a new package like `use
|
||||
- MAY include the group name such as `kubernetes` for clarity
|
||||
- Group name has no effect on policy evaluation
|
||||
|
||||
`import data.lib.result` (optional)
|
||||
: - MAY be defined if you would like to embellish your result(s) with line numbers and code highlighting
|
||||
|
||||
`__rego_metadata__` (optional)
|
||||
: - SHOULD be defined for clarity since these values will be displayed in the scan results
|
||||
|
||||
@@ -82,9 +84,11 @@ If you add a new custom policy, it must be defined under a new package like `use
|
||||
`deny` (required)
|
||||
: - SHOULD be `deny` or start with `deny_`
|
||||
- Although `warn`, `warn_*`, `violation`, `violation_` also work for compatibility, `deny` is recommended as severity can be defined in `__rego_metadata__`.
|
||||
- SHOULD return `string`
|
||||
- Although `object` with `msg` field is accepted, other fields are dropped and `string` is recommended.
|
||||
- e.g. `{"msg": "deny message", "details": "something"}`
|
||||
- SHOULD return ONE OF:
|
||||
- The result of a call to `result.new(msg, cause)`. The `msg` is a `string` describing the issue occurrence, and the `cause` is the property/object where the issue occurred. Providing this allows Trivy to ascertain line numbers and highlight code in the output.
|
||||
- A `string` denoting the detected issue
|
||||
- Although `object` with `msg` field is accepted, other fields are dropped and `string` is recommended if `result.new()` is not utilised.
|
||||
- e.g. `{"msg": "deny message", "details": "something"}`
|
||||
|
||||
|
||||
### Package
|
||||
@@ -95,7 +99,7 @@ A package name must be unique per policy.
|
||||
package user.kubernetes.ID001
|
||||
```
|
||||
|
||||
By default, only `appshield.*` packages will be evaluated.
|
||||
By default, only `builtin.*` packages will be evaluated.
|
||||
If you define custom packages, you have to specify the package prefix via `--namespaces` option.
|
||||
|
||||
``` bash
|
||||
@@ -114,7 +118,6 @@ Metadata helps enrich Trivy's scan results with useful information.
|
||||
"id": "ID001",
|
||||
"title": "Deployment not allowed",
|
||||
"severity": "LOW",
|
||||
"type": "Custom Kubernetes Check",
|
||||
"description": "Deployments are not allowed because of some reasons.",
|
||||
"recommended_actions": "Remove Deployment",
|
||||
"url": "https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-resource-requests-and-limits",
|
||||
@@ -123,30 +126,33 @@ Metadata helps enrich Trivy's scan results with useful information.
|
||||
|
||||
All fields under `__rego_metadata__` are optional.
|
||||
|
||||
| Field name | Allowed values | Default value | In table | In JSON |
|
||||
| ------------------ | ------------------------------------| :-----------: | :----------------: |:---------------: |
|
||||
| id | Any characters | N/A | :material-check: | :material-check: |
|
||||
| title | Any characters | N/A | :material-check: | :material-check: |
|
||||
| severity | `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` | UNKNOWN | :material-check: | :material-check: |
|
||||
| type | Any characters | N/A | :material-check: | :material-check: |
|
||||
| description | Any characters | | :material-close: | :material-check: |
|
||||
| recommended_actions| Any characters | | :material-close: | :material-check: |
|
||||
| url | Any characters | | :material-close: | :material-check: |
|
||||
| Field name | Allowed values | Default value | In table | In JSON |
|
||||
|---------------------|-------------------------------------|:-------------:|:----------------:|:----------------:|
|
||||
| id | Any characters | N/A | :material-check: | :material-check: |
|
||||
| title | Any characters | N/A | :material-check: | :material-check: |
|
||||
| severity | `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` | UNKNOWN | :material-check: | :material-check: |
|
||||
| description | Any characters | | :material-close: | :material-check: |
|
||||
| recommended_actions | Any characters | | :material-close: | :material-check: |
|
||||
| url | Any characters | | :material-close: | :material-check: |
|
||||
|
||||
Some fields are displayed in scan results.
|
||||
|
||||
``` bash
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 28 (SUCCESSES: 14, FAILURES: 14, EXCEPTIONS: 0)
|
||||
Failures: 14 (HIGH: 1)
|
||||
k.yaml (kubernetes)
|
||||
───────────────────
|
||||
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| Custom Kubernetes Check | ID001 | Deployment not allowed | LOW | Found deployment 'test' but deployments |
|
||||
| | | | | are not allowed |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
Tests: 32 (SUCCESSES: 31, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 1, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
LOW: Found deployment 'my-deployment' but deployments are not allowed
|
||||
════════════════════════════════════════════════════════════════════════
|
||||
Deployments are not allowed because of some reasons.
|
||||
────────────────────────────────────────────────────────────────────────
|
||||
k.yaml:1-2
|
||||
────────────────────────────────────────────────────────────────────────
|
||||
1 ┌ apiVersion: v1
|
||||
2 └ kind: Deployment
|
||||
────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
|
||||
### Input
|
||||
@@ -164,21 +170,21 @@ All fields under `__rego_input` are optional.
|
||||
```
|
||||
|
||||
`combine` (boolean)
|
||||
: The details is [here](combine.md).
|
||||
: The details are [here](combine.md).
|
||||
|
||||
`selector` (array)
|
||||
: This option filters the input by file formats or configuration languages.
|
||||
: This option filters the input by file format or configuration language.
|
||||
In the above example, Trivy passes only Kubernetes files to this policy.
|
||||
Even if Dockerfile exists in the specified directory, it will not be passed to the policy as input.
|
||||
Even if a Dockerfile exists in the specified directory, it will not be passed to the policy as input.
|
||||
|
||||
When configuration language such as Kubernetes is not identified, file format such as JSON will be used as `type`.
|
||||
When configuration language is identified, it will overwrite `type`.
|
||||
When configuration languages such as Kubernetes are not identified, file formats such as JSON will be used as `type`.
|
||||
When a configuration language is identified, it will overwrite `type`.
|
||||
|
||||
!!! example
|
||||
`pod.yaml` including Kubernetes Pod will be handled as `kubernetes`, not `yaml`.
|
||||
`type` is overwritten by `kubernetes` from `yaml`.
|
||||
|
||||
`type` accepts `kubernetes`, `dockerfile`, `ansible`, `cloudformation`, `json`, `yaml`, `toml`, or `hcl`.
|
||||
`type` accepts `kubernetes`, `dockerfile`, `cloudformation`, `terraform`, `terraformplan`, `json`, or `yaml`.
|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
[package]: https://www.openpolicyagent.org/docs/latest/policy-language/#packages
|
||||
|
||||
@@ -22,7 +22,7 @@ For more details, see [Policy Testing][opa-testing].
|
||||
}
|
||||
```
|
||||
|
||||
To write tests for custom policies, you can refer to existing tests under [AppShield][appshield].
|
||||
To write tests for custom policies, you can refer to existing tests under [defsec][defsec].
|
||||
|
||||
## Go testing
|
||||
[Fanal][fanal] which is a core library of Trivy can be imported as a Go library.
|
||||
@@ -85,6 +85,6 @@ The following example stores allowed and denied configuration files in a directo
|
||||
`Dockerfile.allowed` has one successful result in `Successes`, while `Dockerfile.denied` has one failure result in `Failures`.
|
||||
|
||||
[opa-testing]: https://www.openpolicyagent.org/docs/latest/policy-testing/
|
||||
[appshield]: https://github.com/aquasecurity/appshield
|
||||
[defsec]: https://github.com/aquasecurity/defsec
|
||||
[table]: https://github.com/golang/go/wiki/TableDrivenTests
|
||||
[fanal]: https://github.com/aquasecurity/fanal
|
||||
@@ -1,56 +0,0 @@
|
||||
# Filesystem
|
||||
|
||||
## Quick start
|
||||
|
||||
Trivy scans a filesystem such as a virtual machine to detect misconfigurations.
|
||||
|
||||
You have to specify `--security-checks config` to enable misconfiguration detection.
|
||||
|
||||
```bash
|
||||
$ trivy fs --security-checks config /path/to/dir
|
||||
```
|
||||
|
||||
Internally, it is the same as [config subcommand](iac.md).
|
||||
|
||||
## Vulnerability and Misconfiguration scanning
|
||||
The difference between `fs` and `config` subcommand is that `fs` can detect both vulnerabilities and misconfiguration at the same time.
|
||||
|
||||
You have to specify `--security-checks vuln,config` to enable vulnerability and misconfiguration detection.
|
||||
|
||||
``` bash
|
||||
$ ls myapp/
|
||||
Dockerfile Pipfile.lock
|
||||
$ trivy fs --security-checks vuln,config --severity HIGH,CRITICAL myapp/
|
||||
2021-07-09T12:03:27.564+0300 INFO Detected OS: unknown
|
||||
2021-07-09T12:03:27.564+0300 INFO Number of language-specific files: 1
|
||||
2021-07-09T12:03:27.564+0300 INFO Detecting pipenv vulnerabilities...
|
||||
2021-07-09T12:03:27.566+0300 INFO Detected config files: 1
|
||||
|
||||
Pipfile.lock (pipenv)
|
||||
=====================
|
||||
Total: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| httplib2 | CVE-2021-21240 | HIGH | 0.12.1 | 0.19.0 | python-httplib2: Regular |
|
||||
| | | | | | expression denial of |
|
||||
| | | | | | service via malicious header |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2021-21240 |
|
||||
+----------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
```
|
||||
|
||||
In the above example, Trivy detected vulnerabilities of Python dependencies and misconfigurations in Dockerfile.
|
||||
@@ -1,163 +0,0 @@
|
||||
# Infrastructure as Code (IaC)
|
||||
|
||||
## Quick start
|
||||
|
||||
Simply specify a directory containing IaC files such as Terraform, CloudFormation and Dockerfile.
|
||||
|
||||
``` bash
|
||||
$ trivy config [YOUR_IaC_DIRECTORY]
|
||||
```
|
||||
|
||||
Trivy will automatically fetch the managed policies and will keep them up-to-date in future scans.
|
||||
|
||||
!!! example
|
||||
```
|
||||
$ ls build/
|
||||
Dockerfile
|
||||
$ trivy config ./build
|
||||
2021-07-09T10:06:29.188+0300 INFO Need to update the built-in policies
|
||||
2021-07-09T10:06:29.188+0300 INFO Downloading the built-in policies...
|
||||
2021-07-09T10:06:30.520+0300 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
```
|
||||
|
||||
## Type detection
|
||||
The specified directory can contain mixed types of IaC files.
|
||||
Trivy automatically detects config types and applies relevant policies.
|
||||
|
||||
For example, the following example holds IaC files for Terraform, CloudFormation, Kubernetes, and Dockerfile in the same directory.
|
||||
|
||||
``` bash
|
||||
$ ls iac/
|
||||
Dockerfile deployment.yaml main.tf
|
||||
$ trivy conf --severity HIGH,CRITICAL ./iac
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2021-07-09T11:51:08.212+0300 INFO Need to update the built-in policies
|
||||
2021-07-09T11:51:08.212+0300 INFO Downloading the built-in policies...
|
||||
2021-07-09T11:51:09.527+0300 INFO Detected config files: 3
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 28 (SUCCESSES: 15, FAILURES: 13, EXCEPTIONS: 0)
|
||||
Failures: 13 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------------+----------+------------------------------------------+
|
||||
| Kubernetes Security Check | KSV005 | SYS_ADMIN capability added | HIGH | Container 'hello-kubernetes' of |
|
||||
| | | | | Deployment 'hello-kubernetes' |
|
||||
| | | | | should not include 'SYS_ADMIN' in |
|
||||
| | | | | 'securityContext.capabilities.add' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ksv005 |
|
||||
+---------------------------+------------+----------------------------+----------+------------------------------------------+
|
||||
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 23 (SUCCESSES: 14, FAILURES: 9, EXCEPTIONS: 0)
|
||||
Failures: 9 (HIGH: 6, CRITICAL: 1)
|
||||
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| Terraform Security Check powered by | AWS003 | AWS Classic resource usage. | HIGH | Resource |
|
||||
| tfsec | | | | 'aws_db_security_group.my-group' |
|
||||
| | | | | uses EC2 Classic. Use a VPC instead. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS003/ |
|
||||
+ +------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| | AWS004 | Use of plain HTTP. | CRITICAL | Resource |
|
||||
| | | | | 'aws_alb_listener.my-alb-listener' |
|
||||
| | | | | uses plain HTTP instead of HTTPS. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS004/ |
|
||||
+ +------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| | AWS018 | Missing description for security | HIGH | Resource |
|
||||
| | | group/security group rule. | | 'aws_security_group_rule.my-rule' should |
|
||||
| | | | | include a description for auditing |
|
||||
| | | | | purposes. -->tfsec.dev/docs/aws/AWS018/ |
|
||||
+ +------------+------------------------------------------+ +--------------------------------------------------------+
|
||||
| | AWS025 | API Gateway domain name uses outdated | | Resource |
|
||||
| | | SSL/TLS protocols. | | 'aws_api_gateway_domain_name.empty_security_policy' |
|
||||
| | | | | defines outdated SSL/TLS policies (not using |
|
||||
| | | | | TLS_1_2). -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ + + + +--------------------------------------------------------+
|
||||
| | | | | Resource |
|
||||
| | | | | 'aws_api_gateway_domain_name.missing_security_policy' |
|
||||
| | | | | should include security_policy (defaults to outdated |
|
||||
| | | | | SSL/TLS policy). -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ + + + +--------------------------------------------------------+
|
||||
| | | | | Resource |
|
||||
| | | | | 'aws_api_gateway_domain_name.outdated_security_policy' |
|
||||
| | | | | defines outdated SSL/TLS policies (not using TLS_1_2). |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ +------------+------------------------------------------+ +--------------------------------------------------------+
|
||||
| | AZU003 | Unencrypted managed disk. | | Resource 'azurerm_managed_disk.source' |
|
||||
| | | | | defines an unencrypted managed disk. |
|
||||
| | | | | -->tfsec.dev/docs/azure/AZU003/ |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
You can see the config type next to each file name.
|
||||
|
||||
!!! example
|
||||
``` bash
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
...
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 28 (SUCCESSES: 15, FAILURES: 13, EXCEPTIONS: 0)
|
||||
Failures: 13 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
...
|
||||
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 23 (SUCCESSES: 14, FAILURES: 9, EXCEPTIONS: 0)
|
||||
Failures: 9 (HIGH: 6, CRITICAL: 1)
|
||||
|
||||
...
|
||||
|
||||
bucket.yaml (cloudformation)
|
||||
============================
|
||||
Tests: 9 (SUCCESSES: 3, FAILURES: 6, EXCEPTIONS: 0)
|
||||
Failures: 6 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 4, CRITICAL: 0)
|
||||
|
||||
```
|
||||
|
||||
## Example
|
||||
See [here](https://github.com/aquasecurity/trivy/tree/125c457517f05b6498bc68eaeec6e683dd36c49a/examples/misconf/mixed)
|
||||
@@ -1,8 +0,0 @@
|
||||
# Misconfiguration Scanning
|
||||
Trivy provides built-in policies to detect configuration issues in Docker, Kubernetes and Terraform.
|
||||
Also, you can write your own policies in [Rego][rego] to scan JSON, YAML, HCL, etc, like [Conftest][conftest].
|
||||
|
||||

|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
[conftest]: https://github.com/open-policy-agent/conftest/
|
||||
@@ -11,202 +11,50 @@ trivy conf --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```bash
|
||||
2021-07-10T17:37:13.267+0300 INFO Detected config files: 4
|
||||
```shell
|
||||
2022-05-16T13:50:42.718+0100 INFO Detected config files: 3
|
||||
|
||||
configs/Dockerfile (dockerfile)
|
||||
===============================
|
||||
Tests: 23 (SUCCESSES: 21, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (HIGH: 1, CRITICAL: 0)
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 17 (SUCCESSES: 16, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Specify at least 1 USER |
|
||||
| | | | | command in Dockerfile with |
|
||||
| | | | | non-root user as argument |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
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.
|
||||
|
||||
configs/deployment.yaml (kubernetes)
|
||||
====================================
|
||||
Tests: 28 (SUCCESSES: 14, FAILURES: 14, EXCEPTIONS: 0)
|
||||
Failures: 14 (HIGH: 1, CRITICAL: 0)
|
||||
See https://avd.aquasec.com/misconfig/ds002
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:3
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
3 [ USER root
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| Kubernetes Security Check | KSV006 | docker.sock is mounted to container | HIGH | Deployment 'hello-kubernetes' should |
|
||||
| | | | | not specify '/var/run/docker.socker' in |
|
||||
| | | | | 'spec.template.volumes.hostPath.path' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ksv006 |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
|
||||
configs/main.tf (terraform)
|
||||
===========================
|
||||
Tests: 19 (SUCCESSES: 11, FAILURES: 8, EXCEPTIONS: 0)
|
||||
Failures: 8 (HIGH: 6, CRITICAL: 1)
|
||||
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| Terraform Security Check powered by | AWS003 | AWS Classic resource usage. | HIGH | Resource |
|
||||
| tfsec | | | | 'aws_db_security_group.my-group' |
|
||||
| | | | | uses EC2 Classic. Use a VPC instead. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS003/ |
|
||||
+ +------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| | AWS004 | Use of plain HTTP. | CRITICAL | Resource |
|
||||
| | | | | 'aws_alb_listener.my-alb-listener' |
|
||||
| | | | | uses plain HTTP instead of HTTPS. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS004/ |
|
||||
+ +------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
| | AWS018 | Missing description for security | HIGH | Resource |
|
||||
| | | group/security group rule. | | 'aws_security_group_rule.my-rule' should |
|
||||
| | | | | include a description for auditing |
|
||||
| | | | | purposes. -->tfsec.dev/docs/aws/AWS018/ |
|
||||
+ +------------+------------------------------------------+ +--------------------------------------------------------+
|
||||
| | AWS025 | API Gateway domain name uses outdated | | Resource |
|
||||
| | | SSL/TLS protocols. | | 'aws_api_gateway_domain_name.empty_security_policy' |
|
||||
| | | | | defines outdated SSL/TLS policies (not using |
|
||||
| | | | | TLS_1_2). -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ + + + +--------------------------------------------------------+
|
||||
| | | | | Resource |
|
||||
| | | | | 'aws_api_gateway_domain_name.missing_security_policy' |
|
||||
| | | | | should include security_policy (defaults to outdated |
|
||||
| | | | | SSL/TLS policy). -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ + + + +--------------------------------------------------------+
|
||||
| | | | | Resource |
|
||||
| | | | | 'aws_api_gateway_domain_name.outdated_security_policy' |
|
||||
| | | | | defines outdated SSL/TLS policies (not using TLS_1_2). |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS025/ |
|
||||
+ +------------+------------------------------------------+ +--------------------------------------------------------+
|
||||
| | AZU003 | Unencrypted managed disk. | | Resource 'azurerm_managed_disk.source' |
|
||||
| | | | | defines an unencrypted managed disk. |
|
||||
| | | | | -->tfsec.dev/docs/azure/AZU003/ |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+--------------------------------------------------------+
|
||||
|
||||
configs/variables.tf (terraform)
|
||||
================================
|
||||
Tests: 1 (SUCCESSES: 1, FAILURES: 0, EXCEPTIONS: 0)
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 8 (SUCCESSES: 8, FAILURES: 0, EXCEPTIONS: 0)
|
||||
Failures: 0 (HIGH: 0, CRITICAL: 0)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## By Misconfiguration IDs
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 0, CRITICAL: 1)
|
||||
|
||||
Use `.trivyignore`.
|
||||
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.
|
||||
|
||||
```bash
|
||||
$ cat .trivyignore
|
||||
# Accept the risk
|
||||
AWS003
|
||||
AWS018
|
||||
AWS025
|
||||
|
||||
$ trivy conf --severity HIGH,CRITICAL examples/misconf/mixed
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```bash
|
||||
2021-07-10T17:38:51.306+0300 INFO Detected config files: 4
|
||||
|
||||
configs/Dockerfile (dockerfile)
|
||||
===============================
|
||||
Tests: 23 (SUCCESSES: 21, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Specify at least 1 USER |
|
||||
| | | | | command in Dockerfile with |
|
||||
| | | | | non-root user as argument |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
|
||||
configs/deployment.yaml (kubernetes)
|
||||
====================================
|
||||
Tests: 28 (SUCCESSES: 14, FAILURES: 14, EXCEPTIONS: 0)
|
||||
Failures: 14 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
| Kubernetes Security Check | KSV006 | docker.sock is mounted to container | HIGH | Deployment 'hello-kubernetes' should |
|
||||
| | | | | not specify '/var/run/docker.socker' in |
|
||||
| | | | | 'spec.template.volumes.hostPath.path' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ksv006 |
|
||||
+---------------------------+------------+-------------------------------------+----------+------------------------------------------+
|
||||
|
||||
configs/main.tf (terraform)
|
||||
===========================
|
||||
Tests: 19 (SUCCESSES: 11, FAILURES: 8, EXCEPTIONS: 0)
|
||||
Failures: 8 (HIGH: 1, CRITICAL: 1)
|
||||
|
||||
+------------------------------------------+------------+---------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+------------------------------------------+------------+---------------------------+----------+------------------------------------------+
|
||||
| Terraform Security Check powered by | AWS004 | Use of plain HTTP. | CRITICAL | Resource |
|
||||
| tfsec | | | | 'aws_alb_listener.my-alb-listener' |
|
||||
| | | | | uses plain HTTP instead of HTTPS. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS004/ |
|
||||
+ +------------+---------------------------+----------+------------------------------------------+
|
||||
| | AZU003 | Unencrypted managed disk. | HIGH | Resource 'azurerm_managed_disk.source' |
|
||||
| | | | | defines an unencrypted managed disk. |
|
||||
| | | | | -->tfsec.dev/docs/azure/AZU003/ |
|
||||
+------------------------------------------+------------+---------------------------+----------+------------------------------------------+
|
||||
|
||||
configs/variables.tf (terraform)
|
||||
================================
|
||||
Tests: 1 (SUCCESSES: 1, FAILURES: 0, EXCEPTIONS: 0)
|
||||
Failures: 0 (HIGH: 0, CRITICAL: 0)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## By Exceptions
|
||||
See [Exceptions](../policy/exceptions.md)
|
||||
|
||||
## Show Successes and Exceptions
|
||||
Use `--include-non-failures` option to show successes and exceptions as well as failures.
|
||||
|
||||
```bash
|
||||
trivy conf --severity CRITICAL --include-non-failures examples/misconf/mixed
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
```
|
||||
2021-07-10T17:44:02.049+0300 INFO Detected config files: 4
|
||||
|
||||
configs/Dockerfile (dockerfile)
|
||||
===============================
|
||||
Tests: 23 (SUCCESSES: 21, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+------------------------------------------+----------+--------+-----------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | STATUS | MESSAGE |
|
||||
+---------------------------+------------+------------------------------------------+----------+--------+-----------------+
|
||||
| Dockerfile Security Check | DS006 | COPY '--from' refers to the current | CRITICAL | PASS | No issues found |
|
||||
| | | image | | | |
|
||||
+ +------------+------------------------------------------+ + + +
|
||||
| | DS007 | Multiple ENTRYPOINT instructions are | | | |
|
||||
| | | listed | | | |
|
||||
+ +------------+------------------------------------------+ + + +
|
||||
| | DS008 | Exposed port is out of range | | | |
|
||||
+ +------------+------------------------------------------+ + + +
|
||||
| | DS010 | 'sudo' is used | | | |
|
||||
+ +------------+------------------------------------------+ + + +
|
||||
| | DS011 | COPY with more than two arguments is not | | | |
|
||||
| | | ending with slash | | | |
|
||||
+ +------------+------------------------------------------+ + + +
|
||||
| | DS012 | Duplicate aliases are defined in | | | |
|
||||
| | | different FROMs | | | |
|
||||
+---------------------------+------------+------------------------------------------+----------+--------+-----------------+
|
||||
|
||||
...
|
||||
See https://avd.aquasec.com/misconfig/avd-aws-0081
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
main.tf:2-4
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
2 ┌ resource "aws_db_security_group" "sg" {
|
||||
3 │
|
||||
4 └ }
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
</details>
|
||||
|
||||
@@ -26,63 +26,10 @@ trivy conf --policy ./policy --data ./data --namespaces user ./configs
|
||||
For more details, see [Custom Data](../custom/data.md).
|
||||
|
||||
## Pass namespaces
|
||||
By default, Trivy evaluate policies defined in `appshield.*`.
|
||||
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
|
||||
```
|
||||
|
||||
## Skip update of built-in policies
|
||||
`Trivy` downloads built-in policies when it starts operating.
|
||||
Then, it checks for updates every 24 hours.
|
||||
You can use the `--skip-policy-update` option to skip it.
|
||||
If you skip it the first time, the built-in policies will not be loaded.
|
||||
|
||||
!!! note
|
||||
Even if you specify the option the first time, it will be loaded as Terraform policies are written in Go.
|
||||
|
||||
```
|
||||
trivy conf --skip-policy-update examples/misconf/mixed [~/src/github.com/aquasecurity/trivy]
|
||||
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2021-07-10T18:04:19.083+0300 INFO No builtin policies were loaded
|
||||
2021-07-10T18:04:19.174+0300 INFO Detected config files: 2
|
||||
|
||||
configs/main.tf (terraform)
|
||||
===========================
|
||||
Tests: 19 (SUCCESSES: 11, FAILURES: 8, EXCEPTIONS: 0)
|
||||
Failures: 8 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)
|
||||
|
||||
+------------------------------------------+------------+------------------------------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+------------------------------------------+
|
||||
| Terraform Security Check powered by | AWS004 | Use of plain HTTP. | CRITICAL | Resource |
|
||||
| tfsec | | | | 'aws_alb_listener.my-alb-listener' |
|
||||
| | | | | uses plain HTTP instead of HTTPS. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS004/ |
|
||||
+ +------------+------------------------------------------+----------+------------------------------------------+
|
||||
| | AWS006 | An ingress security group rule allows | MEDIUM | Resource |
|
||||
| | | traffic from /0. | | 'aws_security_group_rule.my-rule' |
|
||||
| | | | | defines a fully open |
|
||||
| | | | | ingress security group rule. |
|
||||
| | | | | -->tfsec.dev/docs/aws/AWS006/ |
|
||||
+ +------------+------------------------------------------+----------+------------------------------------------+
|
||||
| | AZU003 | Unencrypted managed disk. | HIGH | Resource 'azurerm_managed_disk.source' |
|
||||
| | | | | defines an unencrypted managed disk. |
|
||||
| | | | | -->tfsec.dev/docs/azure/AZU003/ |
|
||||
+------------------------------------------+------------+------------------------------------------+----------+------------------------------------------+
|
||||
|
||||
configs/variables.tf (terraform)
|
||||
================================
|
||||
Tests: 1 (SUCCESSES: 1, FAILURES: 0, EXCEPTIONS: 0)
|
||||
Failures: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)
|
||||
```
|
||||
</details>
|
||||
|
||||
|
||||
@@ -2,40 +2,26 @@
|
||||
|
||||
## Policy Sources
|
||||
|
||||
Built-in policies are mainly written in [Rego][rego].
|
||||
Those policies are managed under [AppShield repository][appshield].
|
||||
Terraform policies are currently powered by [tfsec][tfsec] and CloudFormation policies are powered by [cfsec][cfsec].
|
||||
Built-in policies are mainly written in [Rego][rego] and Go.
|
||||
Those policies are managed under [defsec repository][defsec].
|
||||
|
||||
| Config type | Source |
|
||||
| ------------------------- | ----------------------- |
|
||||
| Kubernetes | [AppShield][kubernetes] |
|
||||
| Dockerfile, Containerfile | [AppShield][docker] |
|
||||
| Terraform | [tfsec][tfsec-checks] |
|
||||
| CloudFormation | [cfsec][cfsec-checks] |
|
||||
| Config type | Source |
|
||||
|---------------------------|----------------------|
|
||||
| Kubernetes | [defsec][kubernetes] |
|
||||
| Dockerfile, Containerfile | [defsec][docker] |
|
||||
| Terraform | [defsec][defsec] |
|
||||
| CloudFormation | [defsec][defsec] |
|
||||
| Helm Chart | [defsec][kubernetes] |
|
||||
| RBAC | [defsec][rbac] |
|
||||
|
||||
For suggestions or issues regarding policy content, please open an issue under [AppShield][appshield], [tfsec][tfsec] or [cfsec][cfsec] repository.
|
||||
For suggestions or issues regarding policy content, please open an issue under the [defsec][defsec] repository.
|
||||
|
||||
Ansible are coming soon.
|
||||
Helm Chart scanning will resolve the chart to Kubernetes manifests then run the [kubernetes][kubernetes] checks.
|
||||
|
||||
## Policy Distribution
|
||||
AppShield policies are distributed as an OPA bundle on [GitHub Container Registry][ghcr] (GHCR).
|
||||
When misconfiguration detection is enabled, Trivy pulls the OPA bundle from GHCR as an OCI artifact and stores it in the cache.
|
||||
Those policies are then loaded into Trivy OPA engine and used for detecting misconfigurations.
|
||||
|
||||
## Update Interval
|
||||
Trivy checks for updates to OPA bundle on GHCR every 24 hours and pulls it if there are any updates.
|
||||
Ansible scanning is coming soon.
|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
[appshield]: https://github.com/aquasecurity/appshield
|
||||
[kubernetes]: https://github.com/aquasecurity/appshield/tree/master/kubernetes
|
||||
[docker]: https://github.com/aquasecurity/appshield/tree/master/docker
|
||||
[tfsec-checks]: https://tfsec.dev/
|
||||
[tfsec]: https://github.com/aquasecurity/tfsec
|
||||
[cfsec-checks]: https://cfsec.dev/
|
||||
[cfsec]: https://github.com/aquasecurity/cfsec
|
||||
[ghcr]: https://github.com/aquasecurity/appshield/pkgs/container/appshield
|
||||
|
||||
[dockerfile-bestpractice]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
|
||||
[pss]: https://kubernetes.io/docs/concepts/security/pod-security-standards/
|
||||
[azure]: https://docs.microsoft.com/en-us/azure/security/fundamentals/network-best-practices
|
||||
[kics]: https://github.com/Checkmarx/kics/
|
||||
[defsec]: https://github.com/aquasecurity/defsec
|
||||
[kubernetes]: https://github.com/aquasecurity/defsec/tree/master/internal/rules/kubernetes
|
||||
[kubernetes]: https://github.com/aquasecurity/defsec/tree/master/internal/rules/rbac
|
||||
[docker]: https://github.com/aquasecurity/defsec/tree/master/internal/rules/docker
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Exceptions
|
||||
Exceptions lets you to specify cases where you allow policy violations.
|
||||
Exceptions let you specify cases where you allow policy violations.
|
||||
Trivy supports two types of exceptions.
|
||||
|
||||
!!! info
|
||||
@@ -22,7 +22,7 @@ The `exception` rule must be defined under `namespace.exceptions`.
|
||||
|
||||
exception[ns] {
|
||||
ns := data.namespaces[_]
|
||||
startswith(ns, "appshield")
|
||||
startswith(ns, "builtin.kubernetes")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -79,7 +79,7 @@ If you want to apply rule-based exceptions to built-in policies, you have to def
|
||||
|
||||
!!! example
|
||||
``` rego
|
||||
package appshield.kubernetes.KSV012
|
||||
package builtin.kubernetes.KSV012
|
||||
|
||||
exception[rules] {
|
||||
input.metadata.name == "can-run-as-root"
|
||||
@@ -87,12 +87,12 @@ If you want to apply rule-based exceptions to built-in policies, you have to def
|
||||
}
|
||||
```
|
||||
|
||||
This exception is applied to [KSV012][ksv012] in AppShield.
|
||||
You can get the package names in [AppShield repository][appshield] or the JSON output from Trivy.
|
||||
This exception is applied to [KSV012][ksv012] in defsec.
|
||||
You can get the package names in the [defsec repository][defsec] or the JSON output from Trivy.
|
||||
|
||||
For more details, see [an example][rule-example].
|
||||
|
||||
[ns-example]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/namespace-exception
|
||||
[rule-example]: https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/examples/misconf/rule-exception
|
||||
[ksv012]: https://github.com/aquasecurity/appshield/blob/57bccc1897b2500a731415bda3990b0d4fbc959e/kubernetes/policies/pss/restricted/3_runs_as_root.rego
|
||||
[appshield]: https://github.com/aquasecurity/appshield/
|
||||
[ksv012]: https://github.com/aquasecurity/defsec/blob/master/internal/rules/kubernetes/policies/pss/restricted/3_runs_as_root.rego
|
||||
[defsec]: https://github.com/aquasecurity/defsec/
|
||||
321
docs/docs/misconfiguration/scanning.md
Normal file
@@ -0,0 +1,321 @@
|
||||
# Misconfiguration Scanning
|
||||
Trivy provides built-in policies to detect configuration issues in Docker, Kubernetes, Terraform and CloudFormation.
|
||||
Also, you can write your own policies in [Rego][rego] to scan JSON, YAML, etc, like [Conftest][conftest].
|
||||
|
||||

|
||||
|
||||
## Quick start
|
||||
|
||||
Simply specify a directory containing IaC files such as Terraform, CloudFormation and Dockerfile.
|
||||
|
||||
``` bash
|
||||
$ trivy config [YOUR_IaC_DIRECTORY]
|
||||
```
|
||||
|
||||
|
||||
!!! example
|
||||
```
|
||||
$ ls build/
|
||||
Dockerfile
|
||||
$ trivy config ./build
|
||||
2022-05-16T13:29:29.952+0100 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
MEDIUM: Specify a tag in the 'FROM' statement for image 'alpine'
|
||||
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
When using a 'FROM' statement you should use a specific tag to avoid uncontrolled behavior when the image is updated.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ds001
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:1
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
1 [ FROM alpine:latest
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
|
||||
You can also enable misconfiguration detection in container image, filesystem and git repository scanning via `--security-checks config`.
|
||||
|
||||
```bash
|
||||
$ trivy image --security-checks config IMAGE_NAME
|
||||
```
|
||||
|
||||
```bash
|
||||
$ trivy fs --security-checks config /path/to/dir
|
||||
```
|
||||
|
||||
!!! note
|
||||
Misconfiguration detection is not enabled by default in `image`, `fs` and `repo` subcommands.
|
||||
|
||||
Unlike the `config` subcommand, `image`, `fs` and `repo` subcommands can also scan for vulnerabilities and secrets at the same time.
|
||||
You can specify `--security-checks vuln,config,secret` to enable vulnerability and secret detection as well as misconfiguration detection.
|
||||
|
||||
|
||||
!!! example
|
||||
``` bash
|
||||
$ ls myapp/
|
||||
Dockerfile Pipfile.lock
|
||||
$ trivy fs --security-checks vuln,config,secret --severity HIGH,CRITICAL myapp/
|
||||
2022-05-16T13:42:21.440+0100 INFO Number of language-specific files: 1
|
||||
2022-05-16T13:42:21.440+0100 INFO Detecting pipenv vulnerabilities...
|
||||
2022-05-16T13:42:21.440+0100 INFO Detected config files: 1
|
||||
|
||||
Pipfile.lock (pipenv)
|
||||
=====================
|
||||
Total: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
┌──────────┬────────────────┬──────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├──────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
|
||||
│ httplib2 │ CVE-2021-21240 │ HIGH │ 0.12.1 │ 0.19.0 │ python-httplib2: Regular expression denial of service via │
|
||||
│ │ │ │ │ │ malicious header │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2021-21240 │
|
||||
└──────────┴────────────────┴──────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────────────┘
|
||||
|
||||
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
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
|
||||
In the above example, Trivy detected vulnerabilities of Python dependencies and misconfigurations in Dockerfile.
|
||||
|
||||
## Type detection
|
||||
The specified directory can contain mixed types of IaC files.
|
||||
Trivy automatically detects config types and applies relevant policies.
|
||||
|
||||
For example, the following example holds IaC files for Terraform, CloudFormation, Kubernetes, Helm Charts, and Dockerfile in the same directory.
|
||||
|
||||
``` bash
|
||||
$ ls iac/
|
||||
Dockerfile deployment.yaml main.tf mysql-8.8.26.tar
|
||||
$ trivy conf --severity HIGH,CRITICAL ./iac
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
2022-06-06T11:01:21.142+0100 INFO Detected config files: 8
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
|
||||
Tests: 21 (SUCCESSES: 20, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
HIGH: Specify at least 1 USER command in Dockerfile with non-root user as argument
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
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
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
|
||||
Tests: 20 (SUCCESSES: 15, FAILURES: 5, EXCEPTIONS: 0)
|
||||
Failures: 5 (MEDIUM: 4, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
MEDIUM: Container 'hello-kubernetes' of Deployment 'hello-kubernetes' should set 'securityContext.allowPrivilegeEscalation' to false
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
A program inside the container can elevate its own privileges and run as root, which might give the program control over the container and node.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv001
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
deployment.yaml:16-19
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
16 ┌ - name: hello-kubernetes
|
||||
17 │ image: hello-kubernetes:1.5
|
||||
18 │ ports:
|
||||
19 └ - containerPort: 8080
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
HIGH: Deployment 'hello-kubernetes' should not specify '/var/run/docker.socker' in 'spec.template.volumes.hostPath.path'
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
Mounting docker.sock from the host can give the container full root access to the host.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv006
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
deployment.yaml:6-29
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
6 ┌ replicas: 3
|
||||
7 │ selector:
|
||||
8 │ matchLabels:
|
||||
9 │ app: hello-kubernetes
|
||||
10 │ template:
|
||||
11 │ metadata:
|
||||
12 │ labels:
|
||||
13 │ app: hello-kubernetes
|
||||
14 └ spec:
|
||||
..
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
MEDIUM: Container 'hello-kubernetes' of Deployment 'hello-kubernetes' should set 'securityContext.runAsNonRoot' to true
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
'runAsNonRoot' forces the running image to run as a non-root user to ensure least privileges.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv012
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
deployment.yaml:16-19
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
16 ┌ - name: hello-kubernetes
|
||||
17 │ image: hello-kubernetes:1.5
|
||||
18 │ ports:
|
||||
19 └ - containerPort: 8080
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
MEDIUM: Deployment 'hello-kubernetes' should not set 'spec.template.volumes.hostPath'
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
HostPath volumes must be forbidden.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv023
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
deployment.yaml:6-29
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
6 ┌ replicas: 3
|
||||
7 │ selector:
|
||||
8 │ matchLabels:
|
||||
9 │ app: hello-kubernetes
|
||||
10 │ template:
|
||||
11 │ metadata:
|
||||
12 │ labels:
|
||||
13 │ app: hello-kubernetes
|
||||
14 └ spec:
|
||||
..
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
MEDIUM: Deployment 'hello-kubernetes' should set 'securityContext.sysctl' to the allowed values
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
Sysctls can disable security mechanisms or affect all containers on a host, and should be disallowed except for an allowed 'safe' subset. A sysctl is considered safe if it is namespaced in the container or the Pod, and it is isolated from other Pods or processes on the same Node.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv026
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
deployment.yaml:6-29
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
6 ┌ replicas: 3
|
||||
7 │ selector:
|
||||
8 │ matchLabels:
|
||||
9 │ app: hello-kubernetes
|
||||
10 │ template:
|
||||
11 │ metadata:
|
||||
12 │ labels:
|
||||
13 │ app: hello-kubernetes
|
||||
14 └ spec:
|
||||
..
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
mysql-8.8.26.tar:templates/primary/statefulset.yaml (helm)
|
||||
|
||||
Tests: 20 (SUCCESSES: 18, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (MEDIUM: 2, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
MEDIUM: Container 'mysql' of StatefulSet 'mysql' should set 'securityContext.allowPrivilegeEscalation' to false
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
A program inside the container can elevate its own privileges and run as root, which might give the program control over the container and node.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv001
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
mysql-8.8.26.tar:templates/primary/statefulset.yaml:56-130
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
56 ┌ - name: mysql
|
||||
57 │ image: docker.io/bitnami/mysql:8.0.28-debian-10-r23
|
||||
58 │ imagePullPolicy: "IfNotPresent"
|
||||
59 │ securityContext:
|
||||
60 │ runAsUser: 1001
|
||||
61 │ env:
|
||||
62 │ - name: BITNAMI_DEBUG
|
||||
63 │ value: "false"
|
||||
64 └ - name: MYSQL_ROOT_PASSWORD
|
||||
..
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
MEDIUM: Container 'mysql' of StatefulSet 'mysql' should set 'securityContext.runAsNonRoot' to true
|
||||
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
'runAsNonRoot' forces the running image to run as a non-root user to ensure least privileges.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ksv012
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
mysql-8.8.26.tar:templates/primary/statefulset.yaml:56-130
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
56 ┌ - name: mysql
|
||||
57 │ image: docker.io/bitnami/mysql:8.0.28-debian-10-r23
|
||||
58 │ imagePullPolicy: "IfNotPresent"
|
||||
59 │ securityContext:
|
||||
60 │ runAsUser: 1001
|
||||
61 │ env:
|
||||
62 │ - name: BITNAMI_DEBUG
|
||||
63 │ value: "false"
|
||||
64 └ - name: MYSQL_ROOT_PASSWORD
|
||||
..
|
||||
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
You can see the config type next to each file name.
|
||||
|
||||
!!! example
|
||||
``` bash
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (HIGH: 1, CRITICAL: 0)
|
||||
|
||||
...
|
||||
|
||||
deployment.yaml (kubernetes)
|
||||
============================
|
||||
Tests: 28 (SUCCESSES: 15, FAILURES: 13, EXCEPTIONS: 0)
|
||||
Failures: 13 (MEDIUM: 4, HIGH: 1, CRITICAL: 0)
|
||||
|
||||
...
|
||||
|
||||
main.tf (terraform)
|
||||
===================
|
||||
Tests: 23 (SUCCESSES: 14, FAILURES: 9, EXCEPTIONS: 0)
|
||||
Failures: 9 (HIGH: 6, CRITICAL: 1)
|
||||
|
||||
...
|
||||
|
||||
bucket.yaml (cloudformation)
|
||||
============================
|
||||
Tests: 9 (SUCCESSES: 3, FAILURES: 6, EXCEPTIONS: 0)
|
||||
Failures: 6 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 4, CRITICAL: 0)
|
||||
|
||||
...
|
||||
|
||||
mysql-8.8.26.tar:templates/primary/statefulset.yaml (helm)
|
||||
==========================================================
|
||||
Tests: 20 (SUCCESSES: 18, FAILURES: 2, EXCEPTIONS: 0)
|
||||
Failures: 2 (MEDIUM: 2, HIGH: 0, CRITICAL: 0)
|
||||
```
|
||||
|
||||
## Examples
|
||||
See [here](https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/examples/misconf/mixed)
|
||||
|
||||
[rego]: https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
[conftest]: https://github.com/open-policy-agent/conftest/
|
||||
|
||||
@@ -1,31 +1,69 @@
|
||||
# Client
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy client - client mode
|
||||
Usage:
|
||||
[DEPRECATED] trivy client [flags] IMAGE_NAME
|
||||
|
||||
USAGE:
|
||||
trivy client [command options] image_name
|
||||
Aliases:
|
||||
client, c
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
|
||||
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
|
||||
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
|
||||
--token value for authentication [$TRIVY_TOKEN]
|
||||
--token-header value specify a header name for token (default: "Trivy-Token") [$TRIVY_TOKEN_HEADER]
|
||||
--remote value server address (default: "http://localhost:4954") [$TRIVY_REMOTE]
|
||||
--custom-headers value custom headers [$TRIVY_CUSTOM_HEADERS]
|
||||
--help, -h show help (default: false)
|
||||
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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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
|
||||
--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,29 +1,52 @@
|
||||
# Config
|
||||
|
||||
``` bash
|
||||
NAME:
|
||||
trivy config - scan config files
|
||||
Scan config files for misconfigurations
|
||||
|
||||
USAGE:
|
||||
trivy config [command options] dir
|
||||
Usage:
|
||||
trivy config [flags] DIR
|
||||
|
||||
Aliases:
|
||||
config, conf
|
||||
|
||||
Scan Flags
|
||||
--skip-dirs string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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
|
||||
|
||||
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
|
||||
--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
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
|
||||
--reset remove all caches and database (default: false) [$TRIVY_RESET]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--skip-files value specify the file paths to skip traversal [$TRIVY_SKIP_FILES]
|
||||
--skip-dirs value specify the directories where the traversal is skipped [$TRIVY_SKIP_DIRS]
|
||||
--policy value, --config-policy value specify paths to the Rego policy files directory, applying config files [$TRIVY_POLICY]
|
||||
--data value, --config-data value specify paths from which data for the Rego policies will be recursively loaded [$TRIVY_DATA]
|
||||
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") [$TRIVY_POLICY_NAMESPACES]
|
||||
--file-patterns value specify file patterns [$TRIVY_FILE_PATTERNS]
|
||||
--include-successes include successes of misconfigurations (default: false) [$TRIVY_INCLUDE_SUCCESSES]
|
||||
--help, -h show help (default: false)
|
||||
```
|
||||
|
||||
@@ -1,41 +1,80 @@
|
||||
# Filesystem
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy filesystem - scan local filesystem for language-specific dependencies and config files
|
||||
Scan local filesystem
|
||||
|
||||
USAGE:
|
||||
trivy filesystem [command options] path
|
||||
Usage:
|
||||
trivy filesystem [flags] PATH
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
|
||||
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
|
||||
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
|
||||
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
|
||||
--cache-ttl value cache TTL when using redis as cache backend (default: 0s) [$TRIVY_CACHE_TTL]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
|
||||
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
|
||||
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
|
||||
--db-repository value OCI repository to retrieve trivy-db from (default: "ghcr.io/aquasecurity/trivy-db") [$TRIVY_DB_REPOSITORY]
|
||||
--skip-files value specify the file paths to skip traversal (accepts multiple inputs) [$TRIVY_SKIP_FILES]
|
||||
--skip-dirs value specify the directories where the traversal is skipped (accepts multiple inputs) [$TRIVY_SKIP_DIRS]
|
||||
--config-policy value specify paths to the Rego policy files directory, applying config files (accepts multiple inputs) [$TRIVY_CONFIG_POLICY]
|
||||
--config-data value specify paths from which data for the Rego policies will be recursively loaded (accepts multiple inputs) [$TRIVY_CONFIG_DATA]
|
||||
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") (accepts multiple inputs) [$TRIVY_POLICY_NAMESPACES]
|
||||
--server value server address [$TRIVY_SERVER]
|
||||
--token value for authentication in client/server mode [$TRIVY_TOKEN]
|
||||
--token-header value specify a header name for token in client/server mode (default: "Trivy-Token") [$TRIVY_TOKEN_HEADER]
|
||||
--custom-headers value custom headers in client/server mode (accepts multiple inputs) [$TRIVY_CUSTOM_HEADERS]
|
||||
--help, -h show help (default: false)
|
||||
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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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")
|
||||
|
||||
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
|
||||
--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,39 +1,99 @@
|
||||
# Image
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy image - scan an image
|
||||
Scan a container image
|
||||
|
||||
USAGE:
|
||||
trivy image [command options] image_name
|
||||
Usage:
|
||||
trivy image [flags] IMAGE_NAME
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
|
||||
--download-db-only download/update vulnerability database but don't run a scan (default: false) [$TRIVY_DOWNLOAD_DB_ONLY]
|
||||
--reset remove all caches and database (default: false) [$TRIVY_RESET]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
|
||||
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
|
||||
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
|
||||
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--light deprecated (default: false) [$TRIVY_LIGHT]
|
||||
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
|
||||
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
|
||||
--cache-ttl value cache TTL when using redis as cache backend (default: 0s) [$TRIVY_CACHE_TTL]
|
||||
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
|
||||
--insecure allow insecure server connections when using SSL (default: false) [$TRIVY_INSECURE]
|
||||
--db-repository value OCI repository to retrieve trivy-db from (default: "ghcr.io/aquasecurity/trivy-db") [$TRIVY_DB_REPOSITORY]
|
||||
--skip-files value specify the file paths to skip traversal (accepts multiple inputs) [$TRIVY_SKIP_FILES]
|
||||
--skip-dirs value specify the directories where the traversal is skipped (accepts multiple inputs) [$TRIVY_SKIP_DIRS]
|
||||
--help, -h show help (default: false)
|
||||
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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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")
|
||||
|
||||
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
|
||||
--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,31 +1,49 @@
|
||||
Trivy has several sub commands, image, fs, repo, client and server.
|
||||
|
||||
``` bash
|
||||
NAME:
|
||||
trivy - A simple and comprehensive vulnerability scanner for containers
|
||||
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues and hard-coded secrets
|
||||
|
||||
USAGE:
|
||||
trivy [global options] command [command options] target
|
||||
Usage:
|
||||
trivy [command]
|
||||
|
||||
VERSION:
|
||||
dev
|
||||
Examples:
|
||||
# Scan a container image
|
||||
$ trivy image python:3.4-alpine
|
||||
|
||||
COMMANDS:
|
||||
image, i scan an image
|
||||
filesystem, fs scan local filesystem
|
||||
repository, repo scan remote repository
|
||||
client, c client mode
|
||||
server, s server mode
|
||||
config, conf scan config files
|
||||
plugin, p manage plugins
|
||||
version print the version
|
||||
help, h Shows a list of commands or help for one command
|
||||
# Scan a container image from a tar archive
|
||||
$ trivy image --input ruby-3.1.tar
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--quiet, -q suppress progress bar and log output (default: false) [$TRIVY_QUIET]
|
||||
--debug, -d debug mode (default: false) [$TRIVY_DEBUG]
|
||||
--cache-dir value cache directory (default: "/Users/teppei/Library/Caches/trivy") [$TRIVY_CACHE_DIR]
|
||||
--help, -h show help (default: false)
|
||||
--version, -v print the version (default: false)
|
||||
# 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
|
||||
kubectl scan kubectl resources
|
||||
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)
|
||||
-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.
|
||||
```
|
||||
|
||||
27
docs/docs/references/cli/module.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Module
|
||||
|
||||
```bash
|
||||
Manage modules
|
||||
|
||||
Usage:
|
||||
trivy module [command]
|
||||
|
||||
Aliases:
|
||||
module, m
|
||||
|
||||
Available Commands:
|
||||
install Install a module
|
||||
uninstall Uninstall a module
|
||||
|
||||
Flags:
|
||||
-h, --help help for module
|
||||
|
||||
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
|
||||
--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
|
||||
```
|
||||
31
docs/docs/references/cli/plugin.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Plugin
|
||||
|
||||
```bash
|
||||
Manage plugins
|
||||
|
||||
Usage:
|
||||
trivy plugin [command]
|
||||
|
||||
Aliases:
|
||||
plugin, p
|
||||
|
||||
Available Commands:
|
||||
Uninstall uninstall a plugin
|
||||
info Show information about the specified plugin
|
||||
install Install a plugin
|
||||
list List installed plugin
|
||||
run Run a plugin on the fly
|
||||
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
|
||||
--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,173 +0,0 @@
|
||||
# Plugins
|
||||
Trivy provides a plugin feature to allow others to extend the Trivy CLI without the need to change the Trivycode base.
|
||||
This plugin system was inspired by the plugin system used in [kubectl][kubectl], [Helm][helm], and [Conftest][conftest].
|
||||
|
||||
## Overview
|
||||
Trivy plugins are add-on tools that integrate seamlessly with Trivy.
|
||||
They provide a way to extend the core feature set of Trivy, but without requiring every new feature to be written in Go and added to the core tool.
|
||||
|
||||
- They can be added and removed from a Trivy installation without impacting the core Trivy tool.
|
||||
- They can be written in any programming language.
|
||||
- They integrate with Trivy, and will show up in Trivy help and subcommands.
|
||||
|
||||
!!! warning
|
||||
Trivy plugins available in public are not audited for security.
|
||||
You should install and run third-party plugins at your own risk, since they are arbitrary programs running on your machine.
|
||||
|
||||
|
||||
## Installing a Plugin
|
||||
A plugin can be installed using the `trivy plugin install` command.
|
||||
This command takes a url and will download the plugin and install it in the plugin cache.
|
||||
|
||||
Trivy adheres to the XDG specification, so the location depends on whether XDG_DATA_HOME is set.
|
||||
Trivy will now search XDG_DATA_HOME for the location of the Trivy plugins cache.
|
||||
The preference order is as follows:
|
||||
|
||||
- XDG_DATA_HOME if set and .trivy/plugins exists within the XDG_DATA_HOME dir
|
||||
- ~/.trivy/plugins
|
||||
|
||||
Under the hood Trivy leverages [go-getter][go-getter] to download plugins.
|
||||
This means the following protocols are supported for downloading plugins:
|
||||
|
||||
- OCI Registries
|
||||
- Local Files
|
||||
- Git
|
||||
- HTTP/HTTPS
|
||||
- Mercurial
|
||||
- Amazon S3
|
||||
- Google Cloud Storage
|
||||
|
||||
For example, to download the Kubernetes Trivy plugin you can execute the following command:
|
||||
|
||||
```bash
|
||||
$ trivy plugin install github.com/aquasecurity/trivy-plugin-kubectl
|
||||
```
|
||||
## Using Plugins
|
||||
Once the plugin is installed, Trivy will load all available plugins in the cache on the start of the next Trivy execution.
|
||||
A plugin will be made in the Trivy CLI based on the plugin name.
|
||||
To display all plugins, you can list them by `trivy --help`
|
||||
|
||||
```bash
|
||||
$ trivy --help
|
||||
NAME:
|
||||
trivy - A simple and comprehensive vulnerability scanner for containers
|
||||
|
||||
USAGE:
|
||||
trivy [global options] command [command options] target
|
||||
|
||||
VERSION:
|
||||
dev
|
||||
|
||||
COMMANDS:
|
||||
image, i scan an image
|
||||
filesystem, fs scan local filesystem
|
||||
repository, repo scan remote repository
|
||||
client, c client mode
|
||||
server, s server mode
|
||||
plugin, p manage plugins
|
||||
kubectl scan kubectl resources
|
||||
help, h Shows a list of commands or help for one command
|
||||
```
|
||||
|
||||
As shown above, `kubectl` subcommand exists in the `COMMANDS` section.
|
||||
To call the kubectl plugin and scan existing Kubernetes deployments, you can execute the following command:
|
||||
|
||||
```
|
||||
$ trivy kubectl deployment <deployment-id> -- --ignore-unfixed --severity CRITICAL
|
||||
```
|
||||
|
||||
Internally the kubectl plugin calls the kubectl binary to fetch information about that deployment and passes the using images to Trivy.
|
||||
You can see the detail [here][trivy-plugin-kubectl].
|
||||
|
||||
If you want to omit even the subcommand, you can use `TRIVY_RUN_AS_PLUGIN` environment variable.
|
||||
|
||||
```bash
|
||||
$ TRIVY_RUN_AS_PLUGIN=kubectl trivy job your-job -- --format json
|
||||
```
|
||||
|
||||
## Installing and Running Plugins on the fly
|
||||
`trivy plugin run` installs a plugin and runs it on the fly.
|
||||
If the plugin is already present in the cache, the installation is skipped.
|
||||
|
||||
```bash
|
||||
trivy plugin run github.com/aquasecurity/trivy-plugin-kubectl pod your-pod -- --exit-code 1
|
||||
```
|
||||
|
||||
## Uninstalling Plugins
|
||||
Specify a plugin name with `trivy plugin uninstall` command.
|
||||
|
||||
```bash
|
||||
$ trivy plugin uninstall kubectl
|
||||
```
|
||||
|
||||
## Building Plugins
|
||||
Each plugin has a top-level directory, and then a plugin.yaml file.
|
||||
|
||||
```bash
|
||||
your-plugin/
|
||||
|
|
||||
|- plugin.yaml
|
||||
|- your-plugin.sh
|
||||
```
|
||||
|
||||
In the example above, the plugin is contained inside of a directory named `your-plugin`.
|
||||
It has two files: plugin.yaml (required) and an executable script, your-plugin.sh (optional).
|
||||
|
||||
The core of a plugin is a simple YAML file named plugin.yaml.
|
||||
Here is an example YAML of trivy-plugin-kubectl plugin that adds support for Kubernetes scanning.
|
||||
|
||||
```yaml
|
||||
name: "kubectl"
|
||||
repository: github.com/aquasecurity/trivy-plugin-kubectl
|
||||
version: "0.1.0"
|
||||
usage: scan kubectl resources
|
||||
description: |-
|
||||
A Trivy plugin that scans the images of a kubernetes resource.
|
||||
Usage: trivy kubectl TYPE[.VERSION][.GROUP] NAME
|
||||
platforms:
|
||||
- selector: # optional
|
||||
os: darwin
|
||||
arch: amd64
|
||||
uri: ./trivy-kubectl # where the execution file is (local file, http, git, etc.)
|
||||
bin: ./trivy-kubectl # path to the execution file
|
||||
- selector: # optional
|
||||
os: linux
|
||||
arch: amd64
|
||||
uri: https://github.com/aquasecurity/trivy-plugin-kubectl/releases/download/v0.1.0/trivy-kubectl.tar.gz
|
||||
bin: ./trivy-kubectl
|
||||
```
|
||||
|
||||
The `plugin.yaml` field should contain the following information:
|
||||
|
||||
- name: The name of the plugin. This also determines how the plugin will be made available in the Trivy CLI. For example, if the plugin is named kubectl, you can call the plugin with `trivy kubectl`. (required)
|
||||
- version: The version of the plugin. (required)
|
||||
- usage: A short usage description. (required)
|
||||
- description: A long description of the plugin. This is where you could provide a helpful documentation of your plugin. (required)
|
||||
- platforms: (required)
|
||||
- selector: The OS/Architecture specific variations of a execution file. (optional)
|
||||
- os: OS information based on GOOS (linux, darwin, etc.) (optional)
|
||||
- arch: The architecture information based on GOARCH (amd64, arm64, etc.) (optional)
|
||||
- uri: Where the executable file is. Relative path from the root directory of the plugin or remote URL such as HTTP and S3. (required)
|
||||
- bin: Which file to call when the plugin is executed. Relative path from the root directory of the plugin. (required)
|
||||
|
||||
The following rules will apply in deciding which platform to select:
|
||||
|
||||
- If both `os` and `arch` under `selector` match the current platform, search will stop and the platform will be used.
|
||||
- If `selector` is not present, the platform will be used.
|
||||
- If `os` matches and there is no more specific `arch` match, the platform will be used.
|
||||
- If no `platform` match is found, Trivy will exit with an error.
|
||||
|
||||
After determining platform, Trivy will download the execution file from `uri` and store it in the plugin cache.
|
||||
When the plugin is called via Trivy CLI, `bin` command will be executed.
|
||||
|
||||
The plugin is responsible for handling flags and arguments. Any arguments are passed to the plugin from the `trivy` command.
|
||||
|
||||
## Example
|
||||
https://github.com/aquasecurity/trivy-plugin-kubectl
|
||||
|
||||
[kubectl]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
|
||||
[helm]: https://helm.sh/docs/topics/plugins/
|
||||
[conftest]: https://www.conftest.dev/plugins/
|
||||
[go-getter]: https://github.com/hashicorp/go-getter
|
||||
[trivy-plugin-kubectl]: https://github.com/aquasecurity/trivy-plugin-kubectl
|
||||
|
||||
@@ -1,38 +1,77 @@
|
||||
# Repository
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy repository - scan remote repository
|
||||
Scan a remote repository
|
||||
|
||||
USAGE:
|
||||
trivy repository [command options] repo_url
|
||||
Usage:
|
||||
trivy repository [flags] REPO_URL
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--input value, -i value input file path instead of image name [$TRIVY_INPUT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
|
||||
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
|
||||
--removed-pkgs detect vulnerabilities of removed packages (only for Alpine) (default: false) [$TRIVY_REMOVED_PKGS]
|
||||
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
|
||||
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
|
||||
--cache-ttl value cache TTL when using redis as cache backend (default: 0s) [$TRIVY_CACHE_TTL]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
|
||||
--quiet, -q suppress progress bar and log output (default: false) [$TRIVY_QUIET]
|
||||
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
|
||||
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
|
||||
--insecure allow insecure server connections when using SSL (default: false) [$TRIVY_INSECURE]
|
||||
--db-repository value OCI repository to retrieve trivy-db from (default: "ghcr.io/aquasecurity/trivy-db") [$TRIVY_DB_REPOSITORY]
|
||||
--skip-files value specify the file paths to skip traversal (accepts multiple inputs) [$TRIVY_SKIP_FILES]
|
||||
--skip-dirs value specify the directories where the traversal is skipped (accepts multiple inputs) [$TRIVY_SKIP_DIRS]
|
||||
--help, -h show help (default: false)
|
||||
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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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")
|
||||
|
||||
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
|
||||
--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,35 +1,74 @@
|
||||
# Rootfs
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy rootfs - scan rootfs
|
||||
Scan rootfs
|
||||
|
||||
USAGE:
|
||||
trivy rootfs [command options] dir
|
||||
Usage:
|
||||
trivy rootfs [flags] ROOTDIR
|
||||
|
||||
OPTIONS:
|
||||
--template value, -t value output template [$TRIVY_TEMPLATE]
|
||||
--format value, -f value format (table, json, sarif, template) (default: "table") [$TRIVY_FORMAT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--exit-code value Exit code when vulnerabilities were found (default: 0) [$TRIVY_EXIT_CODE]
|
||||
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
|
||||
--skip-policy-update skip updating built-in policies (default: false) [$TRIVY_SKIP_POLICY_UPDATE]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignore-unfixed display only fixed vulnerabilities (default: false) [$TRIVY_IGNORE_UNFIXED]
|
||||
--vuln-type value comma-separated list of vulnerability types (os,library) (default: "os,library") [$TRIVY_VULN_TYPE]
|
||||
--security-checks value comma-separated list of what security issues to detect (vuln,config) (default: "vuln") [$TRIVY_SECURITY_CHECKS]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--no-progress suppress progress bar (default: false) [$TRIVY_NO_PROGRESS]
|
||||
--ignore-policy value specify the Rego file to evaluate each vulnerability [$TRIVY_IGNORE_POLICY]
|
||||
--list-all-pkgs enabling the option will output all packages regardless of vulnerability (default: false) [$TRIVY_LIST_ALL_PKGS]
|
||||
--offline-scan do not issue API requests to identify dependencies (default: false) [$TRIVY_OFFLINE_SCAN]
|
||||
--skip-files value specify the file paths to skip traversal [$TRIVY_SKIP_FILES]
|
||||
--skip-dirs value specify the directories where the traversal is skipped [$TRIVY_SKIP_DIRS]
|
||||
--config-policy value specify paths to the Rego policy files directory, applying config files [$TRIVY_CONFIG_POLICY]
|
||||
--config-data value specify paths from which data for the Rego policies will be recursively loaded [$TRIVY_CONFIG_DATA]
|
||||
--policy-namespaces value, --namespaces value Rego namespaces (default: "users") [$TRIVY_POLICY_NAMESPACES]
|
||||
--help, -h show help (default: false)
|
||||
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
|
||||
--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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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")
|
||||
|
||||
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
|
||||
--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,19 +1,67 @@
|
||||
# SBOM
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy sbom - generate SBOM for an artifact
|
||||
Scan SBOM for vulnerabilities
|
||||
|
||||
USAGE:
|
||||
trivy sbom [command options] ARTIFACT
|
||||
Usage:
|
||||
trivy sbom [flags] SBOM_PATH
|
||||
|
||||
OPTIONS:
|
||||
--output value, -o value output file name [$TRIVY_OUTPUT]
|
||||
--clear-cache, -c clear image caches without scanning (default: false) [$TRIVY_CLEAR_CACHE]
|
||||
--ignorefile value specify .trivyignore file (default: ".trivyignore") [$TRIVY_IGNOREFILE]
|
||||
--timeout value timeout (default: 5m0s) [$TRIVY_TIMEOUT]
|
||||
--severity value, -s value severities of vulnerabilities to be displayed (comma separated) (default: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL") [$TRIVY_SEVERITY]
|
||||
--artifact-type value, --type value input artifact type (image, fs, repo, archive) (default: "image") [$TRIVY_ARTIFACT_TYPE]
|
||||
--sbom-format value, --format value SBOM format (cyclonedx) (default: "cyclonedx") [$TRIVY_SBOM_FORMAT]
|
||||
--help, -h show help (default: false)
|
||||
```
|
||||
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 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 string specify the directories where the traversal is skipped
|
||||
--skip-files string 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) (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
|
||||
--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,21 +1,48 @@
|
||||
# Server
|
||||
|
||||
```bash
|
||||
NAME:
|
||||
trivy server - server mode
|
||||
Server mode
|
||||
|
||||
USAGE:
|
||||
trivy server [command options] [arguments...]
|
||||
Usage:
|
||||
trivy server [flags]
|
||||
|
||||
OPTIONS:
|
||||
--skip-db-update, --skip-update skip updating vulnerability database (default: false) [$TRIVY_SKIP_UPDATE, $TRIVY_SKIP_DB_UPDATE]
|
||||
--download-db-only download/update vulnerability database but don't run a scan (default: false) [$TRIVY_DOWNLOAD_DB_ONLY]
|
||||
--reset remove all caches and database (default: false) [$TRIVY_RESET]
|
||||
--cache-backend value cache backend (e.g. redis://localhost:6379) (default: "fs") [$TRIVY_CACHE_BACKEND]
|
||||
--cache-ttl value cache TTL when using redis as cache backend (default: 0s) [$TRIVY_CACHE_TTL]
|
||||
--db-repository value OCI repository to retrieve trivy-db from (default: "ghcr.io/aquasecurity/trivy-db") [$TRIVY_DB_REPOSITORY]
|
||||
--token value for authentication in client/server mode [$TRIVY_TOKEN]
|
||||
--token-header value specify a header name for token in client/server mode (default: "Trivy-Token") [$TRIVY_TOKEN_HEADER]
|
||||
--listen value listen address (default: "localhost:4954") [$TRIVY_LISTEN]
|
||||
--help, -h show help (default: false)
|
||||
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
|
||||
--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
|
||||
```
|
||||
|
||||
271
docs/docs/references/customization/config-file.md
Normal file
@@ -0,0 +1,271 @@
|
||||
# Config file
|
||||
|
||||
Trivy can be customized by tweaking a `trivy.yaml` file. The config path can be overridden by the `--config` flag.
|
||||
|
||||
An example is [here][example].
|
||||
|
||||
## Global Options
|
||||
|
||||
```
|
||||
# Same as '--quiet'
|
||||
# Default is false
|
||||
quiet: false
|
||||
|
||||
# Same as '--debug'
|
||||
# Default is false
|
||||
debug: false
|
||||
|
||||
# Same as '--insecure'
|
||||
# Default is false
|
||||
insecure: false
|
||||
|
||||
# Same as '--timeout'
|
||||
# Default is '5m'
|
||||
timeout: 10m
|
||||
|
||||
# Same as '--cache-dir'
|
||||
# Default is your system cache dir
|
||||
cache-dir: $HOME/.cache/trivy
|
||||
```
|
||||
|
||||
## Report Options
|
||||
|
||||
```
|
||||
# Same as '--format'
|
||||
# Default is 'table'
|
||||
format: table
|
||||
|
||||
# Same as '--report' (available with 'trivy k8s')
|
||||
# Default is all
|
||||
report: all
|
||||
|
||||
# Same as '--template'
|
||||
# Default is empty
|
||||
template:
|
||||
|
||||
# Same as '--dependency-tree'
|
||||
# Default is false
|
||||
dependency-tree: false
|
||||
|
||||
# Same as '--list-all-pkgs'
|
||||
# Default is false
|
||||
list-all-pkgs: false
|
||||
|
||||
# Same as '--ignorefile'
|
||||
# Default is '.trivyignore'
|
||||
ignorefile: .trivyignore
|
||||
|
||||
# Same as '--ignore-policy'
|
||||
# Default is empty
|
||||
ignore-policy:
|
||||
|
||||
# Same as '--exit-code'
|
||||
# Default is 0
|
||||
exit-code: 0
|
||||
|
||||
# Same as '--output'
|
||||
# Default is empty (stdout)
|
||||
output:
|
||||
|
||||
# Same as '--severity'
|
||||
# Default is all severities
|
||||
severity:
|
||||
- UNKNOWN
|
||||
- LOW
|
||||
- MEDIUM
|
||||
- HIGH
|
||||
- CRITICAL
|
||||
```
|
||||
|
||||
## Scan Options
|
||||
Available in client/server mode
|
||||
|
||||
```
|
||||
scan:
|
||||
# Same as '--skip-dirs'
|
||||
# Default is empty
|
||||
skip-dirs:
|
||||
- usr/local/
|
||||
- etc/
|
||||
|
||||
# Same as '--skip-files'
|
||||
# Default is empty
|
||||
skip-files:
|
||||
- package-dev.json
|
||||
|
||||
# Same as '--offline-scan'
|
||||
# Default is false
|
||||
offline-scan: false
|
||||
|
||||
# Same as '--security-checks'
|
||||
# Default depends on subcommand
|
||||
security-checks:
|
||||
- vuln
|
||||
- config
|
||||
- secret
|
||||
```
|
||||
|
||||
## Cache Options
|
||||
|
||||
```
|
||||
cache:
|
||||
# Same as '--cache-backend'
|
||||
# Default is 'fs'
|
||||
backend: 'fs'
|
||||
|
||||
# Same as '--cache-ttl'
|
||||
# Default is 0 (no ttl)
|
||||
ttl: 0
|
||||
|
||||
# Redis options
|
||||
redis:
|
||||
# Same as '--redis-ca'
|
||||
# Default is empty
|
||||
ca:
|
||||
|
||||
# Same as '--redis-cert'
|
||||
# Default is empty
|
||||
cert:
|
||||
|
||||
# Same as '--redis-key'
|
||||
# Default is empty
|
||||
key:
|
||||
```
|
||||
|
||||
## DB Options
|
||||
|
||||
```
|
||||
db:
|
||||
# Same as '--skip-db-update'
|
||||
# Default is false
|
||||
skip-update: false
|
||||
|
||||
# Same as '--no-progress'
|
||||
# Default is false
|
||||
no-progress: false
|
||||
|
||||
# Same as '--db-repository'
|
||||
# Default is 'github.com/aquasecurity-trivy-repo'
|
||||
repository: github.com/aquasecurity-trivy-repo
|
||||
```
|
||||
|
||||
## Image Options
|
||||
Available with container image scanning
|
||||
|
||||
```
|
||||
image:
|
||||
# Same as '--input' (available with 'trivy image')
|
||||
# Default is empty
|
||||
input:
|
||||
|
||||
# Same as '--removed-pkgs'
|
||||
# Default is false
|
||||
removed-pkgs: false
|
||||
```
|
||||
|
||||
## Vulnerability Options
|
||||
Available with vulnerability scanning
|
||||
|
||||
```
|
||||
vulnerability:
|
||||
# Same as '--vuln-type'
|
||||
# Default is 'os,library'
|
||||
type:
|
||||
- os
|
||||
- library
|
||||
|
||||
# Same as '--ignore-unfixed'
|
||||
# Default is false
|
||||
ignore-unfixed: false
|
||||
```
|
||||
|
||||
## Secret Options
|
||||
Available with secret scanning
|
||||
|
||||
```
|
||||
secret:
|
||||
# Same as '--secret-config'
|
||||
# Default is 'trivy-secret.yaml'
|
||||
config: config/trivy/secret.yaml
|
||||
```
|
||||
|
||||
|
||||
## Misconfiguration Options
|
||||
Available with misconfiguration scanning
|
||||
|
||||
```
|
||||
misconfiguration:
|
||||
# Same as '--file-patterns'
|
||||
# Default is empty
|
||||
file-patterns:
|
||||
-
|
||||
|
||||
# Same as '--include-non-failures'
|
||||
# Default is false
|
||||
include-non-failures: false
|
||||
|
||||
# Same as '--trace'
|
||||
# Default is false
|
||||
trace: false
|
||||
|
||||
# Same as '--config-policy'
|
||||
# Default is empty
|
||||
policy:
|
||||
- policy/repository
|
||||
- policy/custom
|
||||
|
||||
# Same as '--config-data'
|
||||
# Default is empty
|
||||
data:
|
||||
- data/
|
||||
|
||||
# Same as '--policy-namespaces'
|
||||
# Default is empty
|
||||
namespaces:
|
||||
- opa.examples
|
||||
- users
|
||||
```
|
||||
|
||||
## Kubernetes Options
|
||||
Available with Kubernetes scanning
|
||||
|
||||
```
|
||||
kubernetes:
|
||||
# Same as '--context'
|
||||
# Default is empty
|
||||
context:
|
||||
|
||||
# Same as '--namespace'
|
||||
# Default is empty
|
||||
namespace:
|
||||
```
|
||||
|
||||
## Client/Server Options
|
||||
Available in client/server mode
|
||||
|
||||
```
|
||||
server:
|
||||
# Same as '--server' (available in client mode)
|
||||
# Default is empty
|
||||
addr: http://localhost:4954
|
||||
|
||||
# Same as '--token'
|
||||
# Default is empty
|
||||
token: "something-secret"
|
||||
|
||||
# Same as '--token-header'
|
||||
# Default is 'Trivy-Token'
|
||||
token-header: 'My-Token-Header'
|
||||
|
||||
# Same as '--custom-headers'
|
||||
# Default is empty
|
||||
custom-headers:
|
||||
- scanner: trivy
|
||||
- x-api-token: xxx
|
||||
|
||||
# Same as '--listen' (available in server mode)
|
||||
# Default is 'localhost:4954'
|
||||
listen: 0.0.0.0:10000
|
||||
```
|
||||
|
||||
[example]: https://github.com/aquasecurity/trivy/tree/{{ git.tag }}/examples/trivy-conf/trivy.yaml
|
||||
17
docs/docs/references/customization/envs.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
# Client/Server
|
||||
|
||||
Trivy has client/server mode. Trivy server has vulnerability database and Trivy client doesn't have to download vulnerability database. It is useful if you want to scan images at multiple locations and do not want to download the database at every location.
|
||||
Trivy has client/server mode. Trivy server has vulnerability database and Trivy client doesn't have to download vulnerability database. It is useful if you want to scan images or files at multiple locations and do not want to download the database at every location.
|
||||
|
||||
## Server
|
||||
At first, you need to launch Trivy server. It downloads vulnerability database automatically and continue to fetch the latest DB in the background.
|
||||
@@ -17,11 +17,12 @@ If you want to accept a connection from outside, you have to specify `0.0.0.0` o
|
||||
$ trivy server --listen 0.0.0.0:8080
|
||||
```
|
||||
|
||||
## Client
|
||||
Then, specify the remote address.
|
||||
## Remote image scan
|
||||
Then, specify the server address for `image` command.
|
||||
```
|
||||
$ trivy client --remote http://localhost:8080 alpine:3.10
|
||||
$ trivy image --server http://localhost:8080 alpine:3.10
|
||||
```
|
||||
**Note**: It's important to specify the protocol (http or https).
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
@@ -43,6 +44,137 @@ Total: 3 (UNKNOWN: 0, LOW: 1, MEDIUM: 2, HIGH: 0, CRITICAL: 0)
|
||||
```
|
||||
</details>
|
||||
|
||||
## Remote scan of local filesystem
|
||||
Also, there is a way to scan local file system:
|
||||
```shell
|
||||
$ trivy fs --server http://localhost:8080 --severity CRITICAL ./integration/testdata/fixtures/fs/pom/
|
||||
```
|
||||
**Note**: It's important to specify the protocol (http or https).
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
pom.xml (pom)
|
||||
=============
|
||||
Total: 24 (CRITICAL: 24)
|
||||
|
||||
+---------------------------------------------+------------------+----------+-------------------+--------------------------------+---------------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+---------------------------------------------+------------------+----------+-------------------+--------------------------------+---------------------------------------+
|
||||
| com.fasterxml.jackson.core:jackson-databind | CVE-2017-17485 | CRITICAL | 2.9.1 | 2.8.11, 2.9.4 | jackson-databind: Unsafe |
|
||||
| | | | | | deserialization due to |
|
||||
| | | | | | incomplete black list (incomplete |
|
||||
| | | | | | fix for CVE-2017-15095)... |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2017-17485 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2018-11307 | | | 2.7.9.4, 2.8.11.2, 2.9.6 | jackson-databind: Potential |
|
||||
| | | | | | information exfiltration with |
|
||||
| | | | | | default typing, serialization |
|
||||
| | | | | | gadget from MyBatis |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-11307 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2018-14718 | | | 2.6.7.2, 2.9.7 | jackson-databind: arbitrary code |
|
||||
| | | | | | execution in slf4j-ext class |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-14718 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2018-14719 | | | | jackson-databind: arbitrary |
|
||||
| | | | | | code execution in blaze-ds-opt |
|
||||
| | | | | | and blaze-ds-core classes |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-14719 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2018-14720 | | | | jackson-databind: exfiltration/XXE |
|
||||
| | | | | | in some JDK classes |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-14720 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2018-14721 | | | | jackson-databind: server-side request |
|
||||
| | | | | | forgery (SSRF) in axis2-jaxws class |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-14721 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2018-19360 | | | 2.6.7.3, 2.7.9.5, 2.8.11.3, | jackson-databind: improper |
|
||||
| | | | | 2.9.8 | polymorphic deserialization |
|
||||
| | | | | | in axis2-transport-jms class |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-19360 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2018-19361 | | | | jackson-databind: improper |
|
||||
| | | | | | polymorphic deserialization |
|
||||
| | | | | | in openjpa class |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-19361 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2018-19362 | | | | jackson-databind: improper |
|
||||
| | | | | | polymorphic deserialization |
|
||||
| | | | | | in jboss-common-core class |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-19362 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2018-7489 | | | 2.7.9.3, 2.8.11.1, 2.9.5 | jackson-databind: incomplete fix |
|
||||
| | | | | | for CVE-2017-7525 permits unsafe |
|
||||
| | | | | | serialization via c3p0 libraries |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2018-7489 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-14379 | | | 2.7.9.6, 2.8.11.4, 2.9.9.2 | jackson-databind: default |
|
||||
| | | | | | typing mishandling leading |
|
||||
| | | | | | to remote code execution |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-14379 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-14540 | | | 2.9.10 | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | com.zaxxer.hikari.HikariConfig |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-14540 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-14892 | | | 2.6.7.3, 2.8.11.5, 2.9.10 | jackson-databind: Serialization |
|
||||
| | | | | | gadgets in classes of the |
|
||||
| | | | | | commons-configuration package |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-14892 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-14893 | | | 2.8.11.5, 2.9.10 | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | classes of the xalan package |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-14893 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-16335 | | | 2.9.10 | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | com.zaxxer.hikari.HikariDataSource |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-16335 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-16942 | | | 2.9.10.1 | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | org.apache.commons.dbcp.datasources.* |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-16942 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2019-16943 | | | | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | com.p6spy.engine.spy.P6DataSource |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-16943 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-17267 | | | 2.9.10 | jackson-databind: Serialization |
|
||||
| | | | | | gadgets in classes of |
|
||||
| | | | | | the ehcache package |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-17267 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-17531 | | | 2.9.10.1 | jackson-databind: |
|
||||
| | | | | | Serialization gadgets in |
|
||||
| | | | | | org.apache.log4j.receivers.db.* |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-17531 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2019-20330 | | | 2.8.11.5, 2.9.10.2 | jackson-databind: lacks |
|
||||
| | | | | | certain net.sf.ehcache blocking |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2019-20330 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2020-8840 | | | 2.7.9.7, 2.8.11.5, 2.9.10.3 | jackson-databind: Lacks certain |
|
||||
| | | | | | xbean-reflect/JNDI blocking |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2020-8840 |
|
||||
+ +------------------+ + +--------------------------------+---------------------------------------+
|
||||
| | CVE-2020-9546 | | | 2.7.9.7, 2.8.11.6, 2.9.10.4 | jackson-databind: Serialization |
|
||||
| | | | | | gadgets in shaded-hikari-config |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2020-9546 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2020-9547 | | | | jackson-databind: Serialization |
|
||||
| | | | | | gadgets in ibatis-sqlmap |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2020-9547 |
|
||||
+ +------------------+ + + +---------------------------------------+
|
||||
| | CVE-2020-9548 | | | | jackson-databind: Serialization |
|
||||
| | | | | | gadgets in anteros-core |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2020-9548 |
|
||||
+---------------------------------------------+------------------+----------+-------------------+--------------------------------+---------------------------------------+
|
||||
</details>
|
||||
|
||||
## Authentication
|
||||
|
||||
```
|
||||
@@ -50,7 +182,7 @@ $ trivy server --listen localhost:8080 --token dummy
|
||||
```
|
||||
|
||||
```
|
||||
$ trivy client --remote http://localhost:8080 --token dummy alpine:3.10
|
||||
$ trivy image --server http://localhost:8080 --token dummy alpine:3.10
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -106,7 +106,19 @@ If trivy is running behind corporate firewall, you have to add the following url
|
||||
!!! error
|
||||
--skip-update cannot be specified with the old DB schema.
|
||||
|
||||
Trivy v0.23.0 or later requires Trivy DB v2. Please update your local database or follow [the instruction of air-gapped environment][../advanced/air-gap.md].
|
||||
Trivy v0.23.0 or later requires Trivy DB v2. Please update your local database or follow [the instruction of air-gapped environment][air-gapped].
|
||||
|
||||
### Multiple Trivy servers
|
||||
|
||||
!!! error
|
||||
```
|
||||
$ trivy image --server http://xxx.com:xxxx test-image
|
||||
...
|
||||
- twirp error internal: failed scan, test-image: failed to apply layers: layer cache missing: sha256:*****
|
||||
```
|
||||
To run multiple Trivy servers, you need to use Redis as the cache backend so that those servers can share the cache.
|
||||
Follow [this instruction][redis-cache] to do so.
|
||||
|
||||
|
||||
## Homebrew
|
||||
### Scope error
|
||||
@@ -157,4 +169,5 @@ Try again with `--reset` option:
|
||||
$ trivy image --reset
|
||||
```
|
||||
|
||||
[air-gapped]: ../how-to-guides/air-gap.md
|
||||
[air-gapped]: ../advanced/air-gap.md
|
||||
[redis-cache]: ../../vulnerability/examples/cache/#cache-backend
|
||||
@@ -1,5 +1,6 @@
|
||||
# CycloneDX
|
||||
|
||||
## Reporting
|
||||
Trivy generates JSON reports in the [CycloneDX][cyclonedx] format.
|
||||
Note that XML format is not supported at the moment.
|
||||
|
||||
@@ -230,4 +231,32 @@ $ cat result.json | jq .
|
||||
|
||||
</details>
|
||||
|
||||
## Scanning
|
||||
Trivy can take CycloneDX as an input and scan for vulnerabilities.
|
||||
To scan SBOM, you can use the `sbom` subcommand and pass the path to your CycloneDX report.
|
||||
|
||||
```bash
|
||||
$ trivy sbom /path/to/cyclonedx.json
|
||||
|
||||
cyclonedx.json (alpine 3.7.1)
|
||||
=========================
|
||||
Total: 3 (CRITICAL: 3)
|
||||
|
||||
┌─────────────┬────────────────┬──────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ curl │ CVE-2018-14618 │ CRITICAL │ 7.61.0-r0 │ 7.61.1-r0 │ curl: NTLM password overflow via integer overflow │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2018-14618 │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ libbz2 │ CVE-2019-12900 │ CRITICAL │ 1.0.6-r6 │ 1.0.6-r7 │ bzip2: out-of-bounds write in function BZ2_decompress │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2019-12900 │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ sqlite-libs │ CVE-2019-8457 │ CRITICAL │ 3.21.0-r1 │ 3.25.3-r1 │ sqlite: heap out-of-bound read in function rtreenode() │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2019-8457 │
|
||||
└─────────────┴────────────────┴──────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
!!! note
|
||||
If you want to generate a CycloneDX report from a CycloneDX input, please be aware that the output stores references to your original CycloneDX report and contains only detected vulnerabilities, not components.
|
||||
|
||||
[cyclonedx]: https://cyclonedx.org/
|
||||
@@ -1,7 +1,10 @@
|
||||
# SBOM
|
||||
Trivy currently supports the following SBOM formats.
|
||||
|
||||
## Reporting
|
||||
Trivy can generate the following SBOM formats.
|
||||
|
||||
- [CycloneDX][cyclonedx]
|
||||
- [SPDX][spdx]
|
||||
|
||||
To generate SBOM, you can use the `--format` option for each subcommand such as `image` and `fs`.
|
||||
|
||||
@@ -9,10 +12,8 @@ To generate SBOM, you can use the `--format` option for each subcommand such as
|
||||
$ trivy image --format cyclonedx --output result.json alpine:3.15
|
||||
```
|
||||
|
||||
In addition, you can use the `trivy sbom` subcommand.
|
||||
|
||||
```
|
||||
$ trivy sbom alpine:3.15
|
||||
$ trivy fs --format cyclonedx --output result.json /app/myproject
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -175,17 +176,37 @@ $ trivy sbom alpine:3.15
|
||||
|
||||
</details>
|
||||
|
||||
`fs`, `repo` and `archive` also work with `sbom` subcommand.
|
||||
## Scanning
|
||||
Trivy also can take the following SBOM formats as an input and scan for vulnerabilities.
|
||||
|
||||
```
|
||||
# filesystem
|
||||
$ trivy sbom --artifact-type fs /path/to/project
|
||||
- CycloneDX
|
||||
|
||||
# repository
|
||||
$ trivy sbom --artifact-type repo github.com/aquasecurity/trivy-ci-test
|
||||
To scan SBOM, you can use the `sbom` subcommand and pass the path to the SBOM.
|
||||
|
||||
# container image archive
|
||||
$ trivy sbom --artifact-type archive alpine.tar
|
||||
```bash
|
||||
$ trivy sbom /path/to/cyclonedx.json
|
||||
|
||||
cyclonedx.json (alpine 3.7.1)
|
||||
=========================
|
||||
Total: 3 (CRITICAL: 3)
|
||||
|
||||
┌─────────────┬────────────────┬──────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ curl │ CVE-2018-14618 │ CRITICAL │ 7.61.0-r0 │ 7.61.1-r0 │ curl: NTLM password overflow via integer overflow │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2018-14618 │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ libbz2 │ CVE-2019-12900 │ CRITICAL │ 1.0.6-r6 │ 1.0.6-r7 │ bzip2: out-of-bounds write in function BZ2_decompress │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2019-12900 │
|
||||
├─────────────┼────────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
|
||||
│ sqlite-libs │ CVE-2019-8457 │ CRITICAL │ 3.21.0-r1 │ 3.25.3-r1 │ sqlite: heap out-of-bound read in function rtreenode() │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2019-8457 │
|
||||
└─────────────┴────────────────┴──────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
[cyclonedx]: cyclonedx.md
|
||||
|
||||
!!! note
|
||||
CycloneDX XML and SPDX are not supported at the moment.
|
||||
|
||||
[cyclonedx]: cyclonedx.md
|
||||
[spdx]: spdx.md
|
||||
|
||||
297
docs/docs/sbom/spdx.md
Normal file
@@ -0,0 +1,297 @@
|
||||
# SPDX
|
||||
|
||||
Trivy generates reports in the [SPDX][spdx] format.
|
||||
|
||||
You can use the regular subcommands (like `image`, `fs` and `rootfs`) and specify `spdx` with the `--format` option.
|
||||
|
||||
```
|
||||
$ trivy image --format spdx --output result.spdx alpine:3.15
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
$ cat result.spdx
|
||||
SPDXVersion: SPDX-2.2
|
||||
DataLicense: CC0-1.0
|
||||
SPDXID: SPDXRef-DOCUMENT
|
||||
DocumentName: alpine:3.15
|
||||
DocumentNamespace: http://aquasecurity.github.io/trivy/container_image/alpine:3.15-bebf6b19-a94c-4e2c-af44-065f63923f48
|
||||
Creator: Organization: aquasecurity
|
||||
Creator: Tool: trivy
|
||||
Created: 2022-04-28T07:32:57.142806Z
|
||||
|
||||
##### Package: zlib
|
||||
|
||||
PackageName: zlib
|
||||
SPDXID: SPDXRef-12bc938ac028a5e1
|
||||
PackageVersion: 1.2.12-r0
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: Zlib
|
||||
PackageLicenseDeclared: Zlib
|
||||
|
||||
##### Package: apk-tools
|
||||
|
||||
PackageName: apk-tools
|
||||
SPDXID: SPDXRef-26c274652190d87f
|
||||
PackageVersion: 2.12.7-r3
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: GPL-2.0-only
|
||||
PackageLicenseDeclared: GPL-2.0-only
|
||||
|
||||
##### Package: libretls
|
||||
|
||||
PackageName: libretls
|
||||
SPDXID: SPDXRef-2b021966d19a8211
|
||||
PackageVersion: 3.3.4-r3
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: ISC AND (BSD-3-Clause OR MIT)
|
||||
PackageLicenseDeclared: ISC AND (BSD-3-Clause OR MIT)
|
||||
|
||||
##### Package: busybox
|
||||
|
||||
PackageName: busybox
|
||||
SPDXID: SPDXRef-317ce3476703f20d
|
||||
PackageVersion: 1.34.1-r5
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: GPL-2.0-only
|
||||
PackageLicenseDeclared: GPL-2.0-only
|
||||
|
||||
##### Package: libcrypto1.1
|
||||
|
||||
PackageName: libcrypto1.1
|
||||
SPDXID: SPDXRef-34f407fb4dbd67f4
|
||||
PackageVersion: 1.1.1n-r0
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: OpenSSL
|
||||
PackageLicenseDeclared: OpenSSL
|
||||
|
||||
##### Package: libc-utils
|
||||
|
||||
PackageName: libc-utils
|
||||
SPDXID: SPDXRef-4bbc1cb449d54083
|
||||
PackageVersion: 0.7.2-r3
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: BSD-2-Clause AND BSD-3-Clause
|
||||
PackageLicenseDeclared: BSD-2-Clause AND BSD-3-Clause
|
||||
|
||||
##### Package: alpine-keys
|
||||
|
||||
PackageName: alpine-keys
|
||||
SPDXID: SPDXRef-a3bdd174be1456b6
|
||||
PackageVersion: 2.4-r1
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: MIT
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
##### Package: ca-certificates-bundle
|
||||
|
||||
PackageName: ca-certificates-bundle
|
||||
SPDXID: SPDXRef-ac6472ba26fb991c
|
||||
PackageVersion: 20211220-r0
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: MPL-2.0 AND MIT
|
||||
PackageLicenseDeclared: MPL-2.0 AND MIT
|
||||
|
||||
##### Package: libssl1.1
|
||||
|
||||
PackageName: libssl1.1
|
||||
SPDXID: SPDXRef-b2d1b1d70fe90f7d
|
||||
PackageVersion: 1.1.1n-r0
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: OpenSSL
|
||||
PackageLicenseDeclared: OpenSSL
|
||||
|
||||
##### Package: scanelf
|
||||
|
||||
PackageName: scanelf
|
||||
SPDXID: SPDXRef-c617077ba6649520
|
||||
PackageVersion: 1.3.3-r0
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: GPL-2.0-only
|
||||
PackageLicenseDeclared: GPL-2.0-only
|
||||
|
||||
##### Package: musl
|
||||
|
||||
PackageName: musl
|
||||
SPDXID: SPDXRef-ca80b810029cde0e
|
||||
PackageVersion: 1.2.2-r7
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: MIT
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
##### Package: alpine-baselayout
|
||||
|
||||
PackageName: alpine-baselayout
|
||||
SPDXID: SPDXRef-d782e64751ba9faa
|
||||
PackageVersion: 3.2.0-r18
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: GPL-2.0-only
|
||||
PackageLicenseDeclared: GPL-2.0-only
|
||||
|
||||
##### Package: musl-utils
|
||||
|
||||
PackageName: musl-utils
|
||||
SPDXID: SPDXRef-e5e8a237f6162e22
|
||||
PackageVersion: 1.2.2-r7
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: MIT BSD GPL2+
|
||||
PackageLicenseDeclared: MIT BSD GPL2+
|
||||
|
||||
##### Package: ssl_client
|
||||
|
||||
PackageName: ssl_client
|
||||
SPDXID: SPDXRef-fdf0ce84f6337be4
|
||||
PackageVersion: 1.34.1-r5
|
||||
FilesAnalyzed: false
|
||||
PackageLicenseConcluded: GPL-2.0-only
|
||||
PackageLicenseDeclared: GPL-2.0-only
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
SPDX-JSON format is also supported by using `spdx-json` with the `--format` option.
|
||||
|
||||
```
|
||||
$ trivy image --format spdx-json --output result.spdx.json alpine:3.15
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Result</summary>
|
||||
|
||||
```
|
||||
$ cat result.spdx.json | jq .
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"created": "2022-04-28T08:16:55.328255Z",
|
||||
"creators": [
|
||||
"Tool: trivy",
|
||||
"Organization: aquasecurity"
|
||||
]
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://aquasecurity.github.io/trivy/container_image/alpine:3.15-d9549e3a-a4c5-4ee3-8bde-8c78d451fbe7",
|
||||
"name": "alpine:3.15",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-12bc938ac028a5e1",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "Zlib",
|
||||
"licenseDeclared": "Zlib",
|
||||
"name": "zlib",
|
||||
"versionInfo": "1.2.12-r0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-26c274652190d87f",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "GPL-2.0-only",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"name": "apk-tools",
|
||||
"versionInfo": "2.12.7-r3"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-2b021966d19a8211",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "ISC AND (BSD-3-Clause OR MIT)",
|
||||
"licenseDeclared": "ISC AND (BSD-3-Clause OR MIT)",
|
||||
"name": "libretls",
|
||||
"versionInfo": "3.3.4-r3"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-317ce3476703f20d",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "GPL-2.0-only",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"name": "busybox",
|
||||
"versionInfo": "1.34.1-r5"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-34f407fb4dbd67f4",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "OpenSSL",
|
||||
"licenseDeclared": "OpenSSL",
|
||||
"name": "libcrypto1.1",
|
||||
"versionInfo": "1.1.1n-r0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-4bbc1cb449d54083",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "BSD-2-Clause AND BSD-3-Clause",
|
||||
"licenseDeclared": "BSD-2-Clause AND BSD-3-Clause",
|
||||
"name": "libc-utils",
|
||||
"versionInfo": "0.7.2-r3"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-a3bdd174be1456b6",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "MIT",
|
||||
"licenseDeclared": "MIT",
|
||||
"name": "alpine-keys",
|
||||
"versionInfo": "2.4-r1"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-ac6472ba26fb991c",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "MPL-2.0 AND MIT",
|
||||
"licenseDeclared": "MPL-2.0 AND MIT",
|
||||
"name": "ca-certificates-bundle",
|
||||
"versionInfo": "20211220-r0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-b2d1b1d70fe90f7d",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "OpenSSL",
|
||||
"licenseDeclared": "OpenSSL",
|
||||
"name": "libssl1.1",
|
||||
"versionInfo": "1.1.1n-r0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-c617077ba6649520",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "GPL-2.0-only",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"name": "scanelf",
|
||||
"versionInfo": "1.3.3-r0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-ca80b810029cde0e",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "MIT",
|
||||
"licenseDeclared": "MIT",
|
||||
"name": "musl",
|
||||
"versionInfo": "1.2.2-r7"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-d782e64751ba9faa",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "GPL-2.0-only",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"name": "alpine-baselayout",
|
||||
"versionInfo": "3.2.0-r18"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-e5e8a237f6162e22",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "MIT BSD GPL2+",
|
||||
"licenseDeclared": "MIT BSD GPL2+",
|
||||
"name": "musl-utils",
|
||||
"versionInfo": "1.2.2-r7"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-fdf0ce84f6337be4",
|
||||
"filesAnalyzed": false,
|
||||
"licenseConcluded": "GPL-2.0-only",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"name": "ssl_client",
|
||||
"versionInfo": "1.34.1-r5"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
[spdx]: https://spdx.dev/wp-content/uploads/sites/41/2020/08/SPDX-specification-2-2.pdf
|
||||
@@ -14,8 +14,7 @@ rules:
|
||||
category: general
|
||||
title: Generic Rule
|
||||
severity: HIGH
|
||||
path:
|
||||
- .*\.sh
|
||||
path: .*\.sh
|
||||
keywords:
|
||||
- secret
|
||||
regex: (?i)(?P<key>(secret))(=|:).{0,5}['"](?P<secret>[0-9a-zA-Z\-_=]{8,64})['"]
|
||||
|
||||
@@ -89,11 +89,6 @@ Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
## Configuration
|
||||
Trivy has a set of builtin rules for secret scanning, which can be extended or modified by a configuration file.
|
||||
|
||||
If you don't need secret scanning, you can disable it via the `--security-checks` flag.
|
||||
|
||||
```shell
|
||||
$ trivy image --security-checks vuln alpine:3.15
|
||||
```
|
||||
|
||||
## Recommendation
|
||||
We would recommend specifying `--skip-dirs` for faster secret scanning.
|
||||
@@ -111,6 +106,13 @@ All rules are disabled except for the ones you specify, so it runs very fast.
|
||||
On the other hand, you should use `disable-rules` if you just want to disable some built-in rules.
|
||||
See the [enable-rules][enable-rules] and [disable-rules][disable-rules] sections for the detail.
|
||||
|
||||
If you don't need secret scanning, you can disable it via the `--security-checks` flag.
|
||||
|
||||
```shell
|
||||
$ trivy image --security-checks vuln alpine:3.15
|
||||
```
|
||||
|
||||
|
||||
## Credit
|
||||
This feature is inspired by [gitleaks][gitleaks].
|
||||
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
# OS
|
||||
|
||||
| OS | Source |
|
||||
| ---------------| ---------------------------------------- |
|
||||
| Arch Linux | [Vulnerable Issues][arch] |
|
||||
| Alpine Linux | [secdb][alpine] |
|
||||
| Amazon Linux 1 | [Amazon Linux Security Center][amazon1] |
|
||||
| Amazon Linux 2 | [Amazon Linux Security Center][amazon2] |
|
||||
| Debian | [Security Bug Tracker][debian-tracker] |
|
||||
| | [OVAL][debian-oval] |
|
||||
| Ubuntu | [Ubuntu CVE Tracker][ubuntu] |
|
||||
| RHEL/CentOS | [OVAL][rhel-oval] |
|
||||
| | [Security Data][rhel-api] |
|
||||
| AlmaLinux | [AlmaLinux Product Errata][alma] |
|
||||
| Rocky Linux | [Rocky Linux UpdateInfo][rocky] |
|
||||
| Oracle Linux | [OVAL][oracle] |
|
||||
| CBL-Mariner | [OVAL][mariner] |
|
||||
| OpenSUSE/SLES | [CVRF][suse] |
|
||||
| Photon OS | [Photon Security Advisory][photon] |
|
||||
| OS | Source |
|
||||
|--------------------|---------------------------------------------|
|
||||
| Arch Linux | [Vulnerable Issues][arch] |
|
||||
| Alpine Linux | [secdb][alpine] |
|
||||
| Amazon Linux | [Amazon Linux Security Center][amazon] |
|
||||
| Debian | [Security Bug Tracker][debian-tracker] |
|
||||
| | [OVAL][debian-oval] |
|
||||
| Ubuntu | [Ubuntu CVE Tracker][ubuntu] |
|
||||
| RHEL/CentOS | [OVAL][rhel-oval] |
|
||||
| | [Security Data][rhel-api] |
|
||||
| AlmaLinux | [AlmaLinux Product Errata][alma] |
|
||||
| Rocky Linux | [Rocky Linux UpdateInfo][rocky] |
|
||||
| Oracle Linux | [OVAL][oracle] |
|
||||
| CBL-Mariner | [OVAL][mariner] |
|
||||
| OpenSUSE/SLES | [CVRF][suse] |
|
||||
| Photon OS | [Photon Security Advisory][photon] |
|
||||
|
||||
# Programming Language
|
||||
|
||||
@@ -45,10 +44,19 @@
|
||||
| --------------------------------|------------|
|
||||
| National Vulnerability Database | [NVD][nvd] |
|
||||
|
||||
# Data source selection
|
||||
Trivy **only** consumes security advisories from the sources listed in the following tables.
|
||||
|
||||
As for packages installed from OS package managers (`dpkg`, `yum`, `apk`, etc.), Trivy uses the advisory database from the appropriate **OS vendor**.
|
||||
|
||||
For example: for a python package installed from `yum` (Amazon linux), Trivy will only get advisories from [ALAS][amazon2]. But for a python package installed from another source (e.g. `pip`), Trivy will get advisories from the `GitLab` and `GitHub` databases.
|
||||
|
||||
This advisory selection is essential to avoid getting false positives because OS vendors usually backport upstream fixes, and the fixed version can be different from the upstream fixed version.
|
||||
The severity is from the selected data source. If the data source does not provide severity, it falls back to NVD, and if NVD does not have severity, it will be UNKNOWN.
|
||||
|
||||
[arch]: https://security.archlinux.org/
|
||||
[alpine]: https://secdb.alpinelinux.org/
|
||||
[amazon1]: https://alas.aws.amazon.com/
|
||||
[amazon2]: https://alas.aws.amazon.com/alas2.html
|
||||
[amazon]: https://alas.aws.amazon.com/
|
||||
[debian-tracker]: https://security-tracker.debian.org/tracker/
|
||||
[debian-oval]: https://www.debian.org/security/oval/
|
||||
[ubuntu]: https://ubuntu.com/security/cve
|
||||
|
||||
@@ -2,26 +2,28 @@
|
||||
|
||||
`Trivy` automatically detects the following files in the container and scans vulnerabilities in the application dependencies.
|
||||
|
||||
| Language | File | Image[^7] | Rootfs[^8] | Filesystem[^9] | Repository[^10] |Dev dependencies |
|
||||
|----------|--------------------------|:---------:|:----------:|:--------------:|:--------------:|-----------------|
|
||||
| Ruby | Gemfile.lock | - | - | ✅ | ✅ | included |
|
||||
| | gemspec | ✅ | ✅ | - | - | included |
|
||||
| Python | Pipfile.lock | - | - | ✅ | ✅ | excluded |
|
||||
| | poetry.lock | - | - | ✅ | ✅ | included |
|
||||
| | requirements.txt | - | - | ✅ | ✅ | included |
|
||||
| | egg package[^1] | ✅ | ✅ | - | - | excluded |
|
||||
| | wheel package[^2] | ✅ | ✅ | - | - | excluded |
|
||||
| PHP | composer.lock | ✅ | ✅ | ✅ | ✅ | excluded |
|
||||
| Node.js | package-lock.json | - | - | ✅ | ✅ | excluded |
|
||||
| | yarn.lock | - | - | ✅ | ✅ | included |
|
||||
| | package.json | ✅ | ✅ | - | - | excluded |
|
||||
| .NET | packages.lock.json | ✅ | ✅ | ✅ | ✅ | included |
|
||||
| | packages.config | ✅ | ✅ | ✅ | ✅ | excluded |
|
||||
| Java | JAR/WAR/PAR/EAR[^3][^4] | ✅ | ✅ | - | - | included |
|
||||
| | pom.xml[^5] | - | - | ✅ | ✅ | excluded |
|
||||
| Go | Binaries built by Go[^6] | ✅ | ✅ | - | - | excluded |
|
||||
| | go.sum | - | - | ✅ | ✅ | included |
|
||||
| Rust | Cargo.lock | ✅ | ✅ | ✅ | ✅ | included |
|
||||
| Language | File | Image[^8] | Rootfs[^9] | Filesystem[^10] | Repository[^11] | Dev dependencies |
|
||||
| -------- |-------------------------| :-------: | :--------: | :-------------: | :-------------: | ---------------- |
|
||||
| Ruby | Gemfile.lock | - | - | ✅ | ✅ | included |
|
||||
| | gemspec | ✅ | ✅ | - | - | included |
|
||||
| Python | Pipfile.lock | - | - | ✅ | ✅ | excluded |
|
||||
| | poetry.lock | - | - | ✅ | ✅ | included |
|
||||
| | requirements.txt | - | - | ✅ | ✅ | included |
|
||||
| | egg package[^1] | ✅ | ✅ | - | - | excluded |
|
||||
| | wheel package[^2] | ✅ | ✅ | - | - | excluded |
|
||||
| PHP | composer.lock | ✅ | ✅ | ✅ | ✅ | excluded |
|
||||
| Node.js | package-lock.json | - | - | ✅ | ✅ | excluded |
|
||||
| | yarn.lock | - | - | ✅ | ✅ | included |
|
||||
| | pnpm-lock.yaml | - | - | ✅ | ✅ | excluded |
|
||||
| | package.json | ✅ | ✅ | - | - | excluded |
|
||||
| .NET | packages.lock.json | ✅ | ✅ | ✅ | ✅ | included |
|
||||
| | packages.config | ✅ | ✅ | ✅ | ✅ | excluded |
|
||||
| | .deps.json | ✅ | ✅ | ✅ | ✅ | excluded |
|
||||
| Java | JAR/WAR/PAR/EAR[^3][^4] | ✅ | ✅ | - | - | included |
|
||||
| | pom.xml[^5] | - | - | ✅ | ✅ | excluded |
|
||||
| Go | Binaries built by Go[^6] | ✅ | ✅ | - | - | excluded |
|
||||
| | go.mod[^7] | - | - | ✅ | ✅ | included |
|
||||
| Rust | Cargo.lock | ✅ | ✅ | ✅ | ✅ | included |
|
||||
|
||||
The path of these files does not matter.
|
||||
|
||||
@@ -33,7 +35,8 @@ Example: [Dockerfile](https://github.com/aquasecurity/trivy-ci-test/blob/main/Do
|
||||
[^4]: It requires Internet access
|
||||
[^5]: It requires Internet access when the POM doesn't exist in your local repository
|
||||
[^6]: UPX-compressed binaries don't work
|
||||
[^7]: ✅ means "enabled" and `-` means "disabled" in the image scanning
|
||||
[^8]: ✅ means "enabled" and `-` means "disabled" in the rootfs scanning
|
||||
[^9]: ✅ means "enabled" and `-` means "disabled" in the filesystem scanning
|
||||
[^10]: ✅ means "enabled" and `-` means "disabled" in the git repository scanning
|
||||
[^7]: If smaller than go 1.17, go.sum is also required
|
||||
[^8]: ✅ means "enabled" and `-` means "disabled" in the image scanning
|
||||
[^9]: ✅ means "enabled" and `-` means "disabled" in the rootfs scanning
|
||||
[^10]: ✅ means "enabled" and `-` means "disabled" in the filesystem scanning
|
||||
[^11]: ✅ means "enabled" and `-` means "disabled" in the git repository scanning
|
||||
|
||||
@@ -4,15 +4,15 @@ The unfixed/unfixable vulnerabilities mean that the patch has not yet been provi
|
||||
|
||||
| OS | Supported Versions | Target Packages | Detection of unfixed vulnerabilities |
|
||||
| -------------------------------- |-------------------------------------------| ----------------------------- | :----------------------------------: |
|
||||
| Alpine Linux | 2.2 - 2.7, 3.0 - 3.15, edge | Installed by apk | NO |
|
||||
| Red Hat Universal Base Image[^1] | 7, 8 | Installed by yum/rpm | YES |
|
||||
| Alpine Linux | 2.2 - 2.7, 3.0 - 3.16, edge | Installed by apk | NO |
|
||||
| Red Hat Universal Base Image[^1] | 7, 8, 9 | Installed by yum/rpm | YES |
|
||||
| Red Hat Enterprise Linux | 6, 7, 8 | Installed by yum/rpm | YES |
|
||||
| CentOS | 6, 7, 8 | Installed by yum/rpm | YES |
|
||||
| AlmaLinux | 8 | Installed by yum/rpm | NO |
|
||||
| Rocky Linux | 8 | Installed by yum/rpm | NO |
|
||||
| Oracle Linux | 5, 6, 7, 8 | Installed by yum/rpm | NO |
|
||||
| CBL-Mariner | 1.0, 2.0 | Installed by yum/rpm | YES |
|
||||
| Amazon Linux | 1, 2 | Installed by yum/rpm | NO |
|
||||
| Amazon Linux | 1, 2, 2022 | Installed by yum/rpm | NO |
|
||||
| openSUSE Leap | 42, 15 | Installed by zypper/rpm | NO |
|
||||
| SUSE Enterprise Linux | 11, 12, 15 | Installed by zypper/rpm | NO |
|
||||
| Photon OS | 1.0, 2.0, 3.0, 4.0 | Installed by tdnf/yum/rpm | NO |
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
## Container Runtime
|
||||
- [Docker Engine](https://docs.docker.com/engine/)
|
||||
- [Podman](../../advanced/container/podman.md)
|
||||
- [containerd](../../advanced/container/containerd.md)
|
||||
|
||||
## Container Registry
|
||||
- [Docker Registry HTTP API V2](https://docs.docker.com/registry/spec/api/)
|
||||
|
||||
@@ -6,8 +6,8 @@ The following table provides an outline of the features Trivy offers.
|
||||
|
||||
| Version | Container image | Virtual machine | Distroless | Multi-arch | Unfixed support |
|
||||
|---------|:---------------:|:---------------:|:----------:|:------------:|:---------------:|
|
||||
| 1.0 | ✔ | ✔ | | amd64, arm64 | ✔ |
|
||||
| 2.0 | ✔ | ✔ | | amd64, arm64 | ✔ |
|
||||
| 1.0 | ✔ | ✔ | ✔ | amd64, arm64 | ✔ |
|
||||
| 2.0 | ✔ | ✔ | ✔ | amd64, arm64 | ✔ |
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -122,6 +122,9 @@ $ cat .trivyignore
|
||||
# Accept the risk
|
||||
CVE-2018-14618
|
||||
|
||||
# Accept the risk until 2023-01-01
|
||||
CVE-2019-14697 exp:2023-01-01
|
||||
|
||||
# No impact in our settings
|
||||
CVE-2019-1543
|
||||
|
||||
|
||||
@@ -6,6 +6,63 @@
|
||||
$ trivy image -f table golang:1.12-alpine
|
||||
```
|
||||
|
||||
### Show origins of vulnerable dependencies
|
||||
|
||||
!!! warning "EXPERIMENTAL"
|
||||
This feature might change without preserving backwards compatibility.
|
||||
|
||||
Modern software development relies on the use of third-party libraries.
|
||||
Third-party dependencies also depend on others so a list of dependencies can be represented as a dependency graph.
|
||||
In some cases, vulnerable dependencies are not linked directly, and it requires analyses of the tree.
|
||||
To make this task simpler Trivy can show a dependency origin tree with the `--dependency-tree` flag.
|
||||
This flag is only available with the `fs` or `repo` commands and the `--format table` flag.
|
||||
|
||||
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.
|
||||
|
||||
In table output, it looks like:
|
||||
|
||||
```sh
|
||||
$ trivy fs --severity HIGH,CRITICAL --dependency-tree /path/to/your_node_project
|
||||
|
||||
package-lock.json (npm)
|
||||
=======================
|
||||
Total: 2 (HIGH: 1, CRITICAL: 1)
|
||||
|
||||
┌──────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬────────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├──────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤
|
||||
│ follow-redirects │ CVE-2022-0155 │ HIGH │ 1.14.6 │ 1.14.7 │ follow-redirects: Exposure of Private Personal Information │
|
||||
│ │ │ │ │ │ to an Unauthorized Actor │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-0155 │
|
||||
├──────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤
|
||||
│ glob-parent │ CVE-2020-28469 │ CRITICAL │ 3.1.0 │ 5.1.2 │ nodejs-glob-parent: Regular expression denial of service │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2020-28469 │
|
||||
└──────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────────────┘
|
||||
|
||||
Dependency Origin Tree
|
||||
======================
|
||||
package-lock.json
|
||||
├── follow-redirects@1.14.6, (HIGH: 1, CRITICAL: 0)
|
||||
│ └── axios@0.21.4
|
||||
└── glob-parent@3.1.0, (HIGH: 0, CRITICAL: 1)
|
||||
└── chokidar@2.1.8
|
||||
└── watchpack-chokidar2@2.0.1
|
||||
└── watchpack@1.7.5
|
||||
└── webpack@4.46.0
|
||||
└── cra-append-sw@2.7.0
|
||||
```
|
||||
|
||||
Vulnerable dependencies are shown in the top level of the tree.
|
||||
Lower levels show how those vulnerabilities are introduced.
|
||||
In the example above **axios@0.21.4** included in the project directly depends on the vulnerable **follow-redirects@1.14.6**.
|
||||
Also, **glob-parent@3.1.0** with some vulnerabilities is included through chain of dependencies that is added by **cra-append-sw@2.7.0**.
|
||||
|
||||
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**.
|
||||
|
||||
!!! note
|
||||
Only Node.js (package-lock.json) is supported at the moment.
|
||||
|
||||
## JSON
|
||||
|
||||
```
|
||||
|
||||
@@ -112,7 +112,7 @@ Total: 20 (UNKNOWN: 3, LOW: 0, MEDIUM: 7, HIGH: 5, CRITICAL: 5)
|
||||
| | | | | | 2.11.3. The ReDOS... |
|
||||
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
|
||||
| py | CVE-2020-29651 | HIGH | 1.8.0 | | python-py: ReDoS in the py.path.svnwc |
|
||||
| | | | | | component via mailicious input |
|
||||
| | | | | | component via malicious input |
|
||||
| | | | | | to blame functionality... |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2020-29651 |
|
||||
+---------------------+------------------+----------+-------------------+------------------------+---------------------------------------+
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
## RHEL/CentOS
|
||||
|
||||
|
||||
=== "Repository"
|
||||
Add repository setting to `/etc/yum.repos.d`.
|
||||
|
||||
``` bash
|
||||
RELEASE_VERSION=$(grep -Po '(?<=VERSION_ID=")[0-9]' /etc/os-release)
|
||||
cat << EOF | sudo tee -a /etc/yum.repos.d/trivy.repo
|
||||
[trivy]
|
||||
name=Trivy repository
|
||||
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$releasever/$basearch/
|
||||
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
EOF
|
||||
@@ -44,9 +44,8 @@
|
||||
sudo dpkg -i trivy_{{ git.tag[1:] }}_Linux-64bit.deb
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Arch Linux
|
||||
|
||||
Package trivy-bin can be installed from the Arch User Repository.
|
||||
|
||||
=== "pikaur"
|
||||
@@ -71,18 +70,36 @@ brew install aquasecurity/trivy/trivy
|
||||
|
||||
## Nix/NixOS
|
||||
|
||||
You can use nix on Linux or macOS and on others unofficially.
|
||||
Direct issues installing `trivy` via `nix` through the channels mentioned [here](https://nixos.wiki/wiki/Support)
|
||||
|
||||
Note that trivy is currently only in the unstable channels.
|
||||
You can use `nix` on Linux or macOS and on other platforms unofficially.
|
||||
|
||||
```bash
|
||||
nix-env --install trivy
|
||||
`nix-env --install -A nixpkgs.trivy`
|
||||
|
||||
Or through your configuration as usual
|
||||
|
||||
NixOS:
|
||||
|
||||
```nix
|
||||
# your other config ...
|
||||
environment.systemPackages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
|
||||
Or through your configuration on NixOS or with home-manager as usual
|
||||
home-manager:
|
||||
|
||||
```nix
|
||||
# your other config ...
|
||||
home.packages = with pkgs; [
|
||||
# your other packages ...
|
||||
trivy
|
||||
];
|
||||
```
|
||||
|
||||
## Install Script
|
||||
|
||||
This script downloads Trivy binary based on your OS and architecture.
|
||||
|
||||
```bash
|
||||
@@ -107,7 +124,9 @@ go install
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
### Docker Hub
|
||||
|
||||
Replace [YOUR_CACHE_DIR] with the cache directory on your machine.
|
||||
|
||||
```bash
|
||||
@@ -166,7 +185,6 @@ The same image is hosted on [GitHub Container Registry][registry] as well.
|
||||
docker pull ghcr.io/aquasecurity/trivy:{{ git.tag[1:] }}
|
||||
```
|
||||
|
||||
|
||||
### Amazon ECR Public
|
||||
|
||||
The same image is hosted on [Amazon ECR Public][ecr] as well.
|
||||
@@ -174,7 +192,9 @@ The same image is hosted on [Amazon ECR Public][ecr] as well.
|
||||
```bash
|
||||
docker pull public.ecr.aws/aquasecurity/trivy:{{ git.tag[1:] }}
|
||||
```
|
||||
|
||||
## Helm
|
||||
|
||||
### Installing from the Aqua Chart Repository
|
||||
|
||||
```
|
||||
@@ -195,6 +215,37 @@ helm install my-release .
|
||||
The command deploys Trivy on the Kubernetes cluster in the default configuration. The [Parameters][helm]
|
||||
section lists the parameters that can be configured during installation.
|
||||
|
||||
### AWS private registry permissions
|
||||
|
||||
You may need to grant permissions to allow trivy to pull images from private registry (AWS 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
|
||||
```
|
||||
|
||||
> **Tip**: List all releases using `helm list`.
|
||||
|
||||
[ecr]: https://gallery.ecr.aws/aquasecurity/trivy
|
||||
|
||||
@@ -4,7 +4,7 @@ Trivy detects three types of security issues:
|
||||
|
||||
- [Vulnerabilities][vuln]
|
||||
- [OS packages][os] (Alpine, Red Hat Universal Base Image, Red Hat Enterprise Linux, CentOS, AlmaLinux, Rocky Linux, CBL-Mariner, Oracle Linux, Debian, Ubuntu, Amazon Linux, openSUSE Leap, SUSE Enterprise Linux, Photon OS and Distroless)
|
||||
- [Language-specific packages][lang] (Bundler, Composer, Pipenv, Poetry, npm, yarn, Cargo, NuGet, Maven, and Go)
|
||||
- [Language-specific packages][lang] (Bundler, Composer, Pipenv, Poetry, npm, yarn, pnpm, Cargo, NuGet, Maven, and Go)
|
||||
- [Misconfigurations][misconf]
|
||||
- Kubernetes
|
||||
- Docker
|
||||
@@ -30,7 +30,7 @@ See [Integrations][integrations] for details.
|
||||
[os]: ../docs/vulnerability/detection/os.md
|
||||
[lang]: ../docs/vulnerability/detection/language.md
|
||||
|
||||
[misconf]: ../docs/misconfiguration/index.md
|
||||
[misconf]: ../docs/misconfiguration/scanning.md
|
||||
|
||||
[secret]: ../docs/secret/scanning.md
|
||||
|
||||
|
||||
@@ -12,35 +12,35 @@ For example:
|
||||
|
||||
``` shell
|
||||
$ trivy image myimage:1.0.0
|
||||
2022-04-21T18:56:44.099+0300 INFO Detected OS: alpine
|
||||
2022-04-21T18:56:44.099+0300 INFO Detecting Alpine vulnerabilities...
|
||||
2022-04-21T18:56:44.101+0300 INFO Number of language-specific files: 0
|
||||
2022-05-16T13:25:17.826+0100 INFO Detected OS: alpine
|
||||
2022-05-16T13:25:17.826+0100 INFO Detecting Alpine vulnerabilities...
|
||||
2022-05-16T13:25:17.826+0100 INFO Number of language-specific files: 0
|
||||
|
||||
myimage:1.0.0 (alpine 3.15.0)
|
||||
=============================
|
||||
Total: 6 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 2)
|
||||
myimage:1.0.0 (alpine 3.15.3)
|
||||
|
||||
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
|
||||
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
| busybox | CVE-2022-28391 | CRITICAL | 1.34.1-r3 | 1.34.1-r5 | CVE-2022-28391 affecting |
|
||||
| | | | | | package busybox 1.35.0 |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2022-28391 |
|
||||
+--------------+------------------| |-------------------+---------------+---------------------------------------+
|
||||
| ssl_client | CVE-2022-28391 | | 1.34.1-r3 | 1.34.1-r5 | CVE-2022-28391 affecting |
|
||||
| | | | | | package busybox 1.35.0 |
|
||||
| | | | | | -->avd.aquasec.com/nvd/cve-2022-28391 |
|
||||
+--------------+------------------+----------+-------------------+---------------+---------------------------------------+
|
||||
Total: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 2)
|
||||
|
||||
┌────────────┬────────────────┬──────────┬───────────────────┬───────────────┬─────────────────────────────────────────────────────────┐
|
||||
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
|
||||
├────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
|
||||
│ busybox │ CVE-2022-28391 │ CRITICAL │ 1.34.1-r4 │ 1.34.1-r5 │ busybox: remote attackers may execute arbitrary code if │
|
||||
│ │ │ │ │ │ netstat is used │
|
||||
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-28391 │
|
||||
├────────────┤ │ │ │ │ │
|
||||
│ ssl_client │ │ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
└────────────┴────────────────┴──────────┴───────────────────┴───────────────┴─────────────────────────────────────────────────────────┘
|
||||
|
||||
app/deploy.sh (secrets)
|
||||
=======================
|
||||
|
||||
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 1)
|
||||
|
||||
+----------+-------------------+----------+---------+--------------------------------+
|
||||
| CATEGORY | DESCRIPTION | SEVERITY | LINE NO | MATCH |
|
||||
+----------+-------------------+----------+---------+--------------------------------+
|
||||
| AWS | AWS Access Key ID | CRITICAL | 10 | export AWS_ACCESS_KEY_ID=***** |
|
||||
+----------+-------------------+----------+---------+--------------------------------+
|
||||
┌──────────┬───────────────────┬──────────┬─────────┬────────────────────────────────┐
|
||||
│ Category │ Description │ Severity │ Line No │ Match │
|
||||
├──────────┼───────────────────┼──────────┼─────────┼────────────────────────────────┤
|
||||
│ AWS │ AWS Access Key ID │ CRITICAL │ 3 │ export AWS_ACCESS_KEY_ID=***** │
|
||||
└──────────┴───────────────────┴──────────┴─────────┴────────────────────────────────┘
|
||||
```
|
||||
|
||||
For more details, see [vulnerability][vulnerability] and [secret][secret] pages.
|
||||
@@ -59,26 +59,27 @@ For example:
|
||||
$ ls build/
|
||||
Dockerfile
|
||||
$ trivy config ./build
|
||||
2021-07-09T10:06:29.188+0300 INFO Need to update the built-in policies
|
||||
2021-07-09T10:06:29.188+0300 INFO Downloading the built-in policies...
|
||||
2021-07-09T10:06:30.520+0300 INFO Detected config files: 1
|
||||
2022-05-16T13:29:29.952+0100 INFO Detected config files: 1
|
||||
|
||||
Dockerfile (dockerfile)
|
||||
=======================
|
||||
Tests: 23 (SUCCESSES: 22, FAILURES: 1, EXCEPTIONS: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
|
||||
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
|
||||
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| TYPE | MISCONF ID | CHECK | SEVERITY | MESSAGE |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
| Dockerfile Security Check | DS002 | Image user is 'root' | HIGH | Last USER command in |
|
||||
| | | | | Dockerfile should not be 'root' |
|
||||
| | | | | -->avd.aquasec.com/appshield/ds002 |
|
||||
+---------------------------+------------+----------------------+----------+------------------------------------------+
|
||||
MEDIUM: Specify a tag in the 'FROM' statement for image 'alpine'
|
||||
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
When using a 'FROM' statement you should use a specific tag to avoid uncontrolled behavior when the image is updated.
|
||||
|
||||
See https://avd.aquasec.com/misconfig/ds001
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Dockerfile:1
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
1 [ FROM alpine:latest
|
||||
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
```
|
||||
|
||||
For more details, see [here][misconf].
|
||||
|
||||
[vulnerability]: ../docs/vulnerability/scanning/index.md
|
||||
[misconf]: ../docs/misconfiguration/index.md
|
||||
[misconf]: ../docs/misconfiguration/scanning.md
|
||||
[secret]: ../docs/secret/scanning.md
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"elements": [
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 573,
|
||||
"versionNonce": 2034670720,
|
||||
"version": 791,
|
||||
"versionNonce": 1617738570,
|
||||
"isDeleted": false,
|
||||
"id": "BkXuq_6BxgqZGZWc8oCtu",
|
||||
"fillStyle": "hachure",
|
||||
@@ -24,12 +24,15 @@
|
||||
"seed": 1632394695,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
"boundElements": [],
|
||||
"updated": 1652181399352,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 572,
|
||||
"versionNonce": 425683840,
|
||||
"version": 716,
|
||||
"versionNonce": 910620246,
|
||||
"isDeleted": false,
|
||||
"id": "YQURTHNPSe05RPSlYRcok",
|
||||
"fillStyle": "hachure",
|
||||
@@ -47,18 +50,23 @@
|
||||
"seed": 891391049,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"boundElements": [],
|
||||
"updated": 1652181399352,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 36,
|
||||
"fontFamily": 1,
|
||||
"text": "Trivy",
|
||||
"baseline": 32,
|
||||
"textAlign": "left",
|
||||
"verticalAlign": "top"
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Trivy"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 822,
|
||||
"versionNonce": 1061096576,
|
||||
"version": 1310,
|
||||
"versionNonce": 1854587402,
|
||||
"isDeleted": false,
|
||||
"id": "6dpF2EyZBtYgO6MrvGj0-",
|
||||
"fillStyle": "hachure",
|
||||
@@ -67,27 +75,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 771.2554931640625,
|
||||
"y": 469.7777099609375,
|
||||
"x": 731.2024841308594,
|
||||
"y": 467.7408447265625,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 507,
|
||||
"height": 35,
|
||||
"width": 612,
|
||||
"height": 36,
|
||||
"seed": 687997545,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"boundElements": [],
|
||||
"updated": 1652181399352,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Vulnerability/Misconfiguration Scanner",
|
||||
"text": "Vulnerability/Misconfiguration/Secret Scanner",
|
||||
"baseline": 25,
|
||||
"textAlign": "left",
|
||||
"verticalAlign": "top"
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Vulnerability/Misconfiguration/Secret Scanner"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 763,
|
||||
"versionNonce": 560331648,
|
||||
"version": 1129,
|
||||
"versionNonce": 1307232406,
|
||||
"isDeleted": false,
|
||||
"id": "cpnTMy7L2AUg9IDJppF4H",
|
||||
"fillStyle": "hachure",
|
||||
@@ -96,21 +109,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 602.28369140625,
|
||||
"y": 258.8445587158203,
|
||||
"x": 647.7814331054688,
|
||||
"y": 188.2161407470703,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fab005",
|
||||
"width": 397.493408203125,
|
||||
"height": 103.28388977050778,
|
||||
"width": 248.74017333984375,
|
||||
"height": 77.74984135828628,
|
||||
"seed": 77164935,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
"boundElements": [],
|
||||
"updated": 1652181524751,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1072,
|
||||
"versionNonce": 212434048,
|
||||
"version": 1279,
|
||||
"versionNonce": 1197686422,
|
||||
"isDeleted": false,
|
||||
"id": "9-blmNVtLesthMSY_f60t",
|
||||
"fillStyle": "hachure",
|
||||
@@ -119,27 +135,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 630.9301147460938,
|
||||
"y": 292.4002990722656,
|
||||
"x": 664.1268412090633,
|
||||
"y": 211.45297413880115,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 331,
|
||||
"height": 35,
|
||||
"width": 214.77717842516898,
|
||||
"height": 35.96269034095853,
|
||||
"seed": 860091815,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"fontSize": 28,
|
||||
"boundElements": [],
|
||||
"updated": 1652181521001,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 27.970981376301072,
|
||||
"fontFamily": 1,
|
||||
"text": "Infrastructure as Code",
|
||||
"baseline": 25,
|
||||
"text": "Container image",
|
||||
"baseline": 24.96269034095853,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "top"
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Container image"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1194,
|
||||
"versionNonce": 131337088,
|
||||
"version": 1482,
|
||||
"versionNonce": 773738186,
|
||||
"isDeleted": false,
|
||||
"id": "gugZxhi7ThlcjWY_MFO7q",
|
||||
"fillStyle": "hachure",
|
||||
@@ -148,21 +169,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1021.5928955078125,
|
||||
"y": 261.56090545654297,
|
||||
"x": 907.46728515625,
|
||||
"y": 189.15813446044922,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#be4bdb",
|
||||
"width": 441.0702514648438,
|
||||
"height": 99.05134582519533,
|
||||
"width": 255.61367797851565,
|
||||
"height": 77.69438171386717,
|
||||
"seed": 1232790121,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
"boundElements": [],
|
||||
"updated": 1652181510952,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1270,
|
||||
"versionNonce": 591785088,
|
||||
"version": 1444,
|
||||
"versionNonce": 80370390,
|
||||
"isDeleted": false,
|
||||
"id": "K48gtpesBxIGJxLTnI2CB",
|
||||
"fillStyle": "hachure",
|
||||
@@ -171,8 +195,8 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1173.3179931640625,
|
||||
"y": 294.12510681152344,
|
||||
"x": 963.9347534179688,
|
||||
"y": 212.18040466308594,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 137,
|
||||
@@ -180,70 +204,23 @@
|
||||
"seed": 449264361,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"boundElements": [],
|
||||
"updated": 1652181510952,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Filesystem",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "top"
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Filesystem"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1319,
|
||||
"versionNonce": 1264839808,
|
||||
"isDeleted": false,
|
||||
"id": "BYJwfkhd1BilbLQGc973f",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1233.3157348632812,
|
||||
"y": 168.29967880249023,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 229.03393554687523,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 1923498546,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 659,
|
||||
"versionNonce": 2122259328,
|
||||
"isDeleted": false,
|
||||
"id": "eedUyCpr8i1aY_3PHsHAB",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1241.1352844238281,
|
||||
"y": 191.2939567565918,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 216,
|
||||
"height": 35,
|
||||
"seed": 595309038,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Misconfiguration",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1397,
|
||||
"versionNonce": 20077696,
|
||||
"version": 1545,
|
||||
"versionNonce": 819004246,
|
||||
"isDeleted": false,
|
||||
"id": "SPkrBrH6DGvkgQXtZQjIJ",
|
||||
"fillStyle": "hachure",
|
||||
@@ -252,21 +229,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1023.8157043457031,
|
||||
"y": 168.7816276550293,
|
||||
"x": 1174.8193054199219,
|
||||
"y": 190.58329391479492,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fa5252",
|
||||
"width": 200.7496337890626,
|
||||
"backgroundColor": "#12b886",
|
||||
"width": 250.91937255859386,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 1896460914,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
"boundElements": [],
|
||||
"updated": 1652181500681,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 840,
|
||||
"versionNonce": 655338368,
|
||||
"version": 1036,
|
||||
"versionNonce": 1127482634,
|
||||
"isDeleted": false,
|
||||
"id": "n06MNIqirDmVZBkDg_UPV",
|
||||
"fillStyle": "hachure",
|
||||
@@ -275,27 +255,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1040.526611328125,
|
||||
"y": 194.3111228942871,
|
||||
"x": 1200.8165283203125,
|
||||
"y": 212.65081405639648,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 160,
|
||||
"height": 35,
|
||||
"width": 201,
|
||||
"height": 36,
|
||||
"seed": 1131832750,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"boundElements": [],
|
||||
"updated": 1652181500682,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Vulnerability",
|
||||
"text": "Git Repository",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle"
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Git Repository"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1441,
|
||||
"versionNonce": 1393118080,
|
||||
"version": 1826,
|
||||
"versionNonce": 405213130,
|
||||
"isDeleted": false,
|
||||
"id": "8SHSNGf7PNddFLi2ZA3Vi",
|
||||
"fillStyle": "hachure",
|
||||
@@ -304,21 +289,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 673.6463928222656,
|
||||
"y": 167.8159294128418,
|
||||
"x": 642.0580139160156,
|
||||
"y": 280.92316818237305,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 278.48516845703136,
|
||||
"width": 788.2601318359375,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 1986948530,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": []
|
||||
"boundElements": [],
|
||||
"updated": 1652181559488,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 851,
|
||||
"versionNonce": 2114620544,
|
||||
"version": 1093,
|
||||
"versionNonce": 573822154,
|
||||
"isDeleted": false,
|
||||
"id": "3Z5w3RXdgpvP43dlHqq26",
|
||||
"fillStyle": "hachure",
|
||||
@@ -327,26 +315,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 701.5146789550781,
|
||||
"y": 189.60757064819336,
|
||||
"x": 851.4863586425781,
|
||||
"y": 300.9854393005371,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 216,
|
||||
"height": 35,
|
||||
"width": 339,
|
||||
"height": 36,
|
||||
"seed": 1077804654,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElementIds": [],
|
||||
"boundElements": [],
|
||||
"updated": 1652181415054,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Misconfiguration",
|
||||
"text": "Misconfiguration scanning",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle"
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Misconfiguration scanning"
|
||||
}
|
||||
],
|
||||
"appState": {
|
||||
"gridSize": null,
|
||||
"viewBackgroundColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
"files": {}
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
"elements": [
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 787,
|
||||
"versionNonce": 1318065410,
|
||||
"version": 788,
|
||||
"versionNonce": 555477386,
|
||||
"isDeleted": false,
|
||||
"id": "BkXuq_6BxgqZGZWc8oCtu",
|
||||
"fillStyle": "hachure",
|
||||
@@ -25,14 +25,14 @@
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567161407,
|
||||
"updated": 1652177570112,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 653,
|
||||
"versionNonce": 1863936606,
|
||||
"version": 713,
|
||||
"versionNonce": 44400470,
|
||||
"isDeleted": false,
|
||||
"id": "YQURTHNPSe05RPSlYRcok",
|
||||
"fillStyle": "hachure",
|
||||
@@ -41,8 +41,8 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1137.7821926540798,
|
||||
"y": 764.0207858615452,
|
||||
"x": 1118.2101508246528,
|
||||
"y": 763.5906914605034,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 88,
|
||||
@@ -51,7 +51,7 @@
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567336690,
|
||||
"updated": 1652177702292,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 36,
|
||||
@@ -65,8 +65,8 @@
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1139,
|
||||
"versionNonce": 1994750018,
|
||||
"version": 1191,
|
||||
"versionNonce": 1166344150,
|
||||
"isDeleted": false,
|
||||
"id": "6dpF2EyZBtYgO6MrvGj0-",
|
||||
"fillStyle": "hachure",
|
||||
@@ -75,8 +75,8 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 900.5941772460938,
|
||||
"y": 819.7337171766493,
|
||||
"x": 875.3033447265625,
|
||||
"y": 820.7327100965712,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 612,
|
||||
@@ -85,7 +85,7 @@
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567334181,
|
||||
"updated": 1652177705177,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
@@ -99,8 +99,8 @@
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 805,
|
||||
"versionNonce": 1609410334,
|
||||
"version": 858,
|
||||
"versionNonce": 1118008458,
|
||||
"isDeleted": false,
|
||||
"id": "cpnTMy7L2AUg9IDJppF4H",
|
||||
"fillStyle": "hachure",
|
||||
@@ -110,23 +110,23 @@
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 600.9835205078125,
|
||||
"y": 627.2060089111328,
|
||||
"y": 635.5783640543619,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fab005",
|
||||
"width": 298.6342163085937,
|
||||
"height": 96.74092102050778,
|
||||
"width": 335.3091227213542,
|
||||
"height": 82.36856587727866,
|
||||
"seed": 77164935,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1011,
|
||||
"versionNonce": 477782466,
|
||||
"version": 1077,
|
||||
"versionNonce": 1122201878,
|
||||
"isDeleted": false,
|
||||
"id": "9-blmNVtLesthMSY_f60t",
|
||||
"fillStyle": "hachure",
|
||||
@@ -135,32 +135,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 628.7854614257812,
|
||||
"y": 658.9062805175781,
|
||||
"x": 649.8531494140625,
|
||||
"y": 660.223378499349,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 238,
|
||||
"height": 35,
|
||||
"width": 224,
|
||||
"height": 36,
|
||||
"seed": 860091815,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Container Images",
|
||||
"text": "Container Image",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Container Images"
|
||||
"originalText": "Container Image"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1051,
|
||||
"versionNonce": 1210520414,
|
||||
"version": 1118,
|
||||
"versionNonce": 1679315786,
|
||||
"isDeleted": false,
|
||||
"id": "gugZxhi7ThlcjWY_MFO7q",
|
||||
"fillStyle": "hachure",
|
||||
@@ -169,24 +169,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 911.257568359375,
|
||||
"y": 625.7697677612305,
|
||||
"x": 954.3485412597656,
|
||||
"y": 635.849225362142,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#be4bdb",
|
||||
"width": 452.44976806640636,
|
||||
"height": 99.05134582519533,
|
||||
"width": 409.35879516601574,
|
||||
"height": 82.97188822428383,
|
||||
"seed": 1232790121,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1202,
|
||||
"versionNonce": 842114,
|
||||
"version": 1300,
|
||||
"versionNonce": 1187044950,
|
||||
"isDeleted": false,
|
||||
"id": "K48gtpesBxIGJxLTnI2CB",
|
||||
"fillStyle": "hachure",
|
||||
@@ -195,17 +195,17 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1065.672119140625,
|
||||
"y": 656.4816131591797,
|
||||
"x": 1084.4311319986978,
|
||||
"y": 660.9795074462891,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 137,
|
||||
"height": 35,
|
||||
"width": 139,
|
||||
"height": 36,
|
||||
"seed": 449264361,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
@@ -219,8 +219,8 @@
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 1163,
|
||||
"versionNonce": 1149481794,
|
||||
"version": 1204,
|
||||
"versionNonce": 688085514,
|
||||
"isDeleted": false,
|
||||
"id": "La6f87LDZ0uEIZB947bXo",
|
||||
"fillStyle": "hachure",
|
||||
@@ -230,23 +230,23 @@
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1375.0136108398438,
|
||||
"y": 626.2495651245117,
|
||||
"y": 636.5654322306316,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#12b886",
|
||||
"width": 452.76554361979186,
|
||||
"height": 96.3990020751953,
|
||||
"height": 80.08313496907543,
|
||||
"seed": 2005637801,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567157857,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 1371,
|
||||
"versionNonce": 1552918366,
|
||||
"version": 1432,
|
||||
"versionNonce": 1593746326,
|
||||
"isDeleted": false,
|
||||
"id": "aOgRPVQ81jhOfkvzjWTMF",
|
||||
"fillStyle": "hachure",
|
||||
@@ -255,162 +255,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1490.9330512152778,
|
||||
"y": 654.3717736138237,
|
||||
"x": 1498.8465237087673,
|
||||
"y": 658.0244835747612,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "transparent",
|
||||
"width": 224,
|
||||
"width": 201,
|
||||
"height": 36,
|
||||
"seed": 1284472935,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567166643,
|
||||
"updated": 1652177872265,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Git Repositories",
|
||||
"text": "Git Repository",
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "top",
|
||||
"containerId": null,
|
||||
"originalText": "Git Repositories"
|
||||
"originalText": "Git Repository"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2340,
|
||||
"versionNonce": 1952732126,
|
||||
"isDeleted": false,
|
||||
"id": "p8fn5gPx8DfP8QE1lN98-",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1064.5642678676506,
|
||||
"y": 537.71609717149,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 684019996,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2497,
|
||||
"versionNonce": 832692482,
|
||||
"isDeleted": false,
|
||||
"id": "kFTL0HnUdDs_ngg2xVFbn",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 600.7947366176511,
|
||||
"y": 538.67312842149,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fa5252",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 541443108,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2345,
|
||||
"versionNonce": 1129796482,
|
||||
"isDeleted": false,
|
||||
"id": "KIztJcYHiVtM-GMlZAXAE",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 753.0955178676511,
|
||||
"y": 538.61062842149,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#4c6ef5",
|
||||
"width": 145,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 424425892,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567234562,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2329,
|
||||
"versionNonce": 1518497986,
|
||||
"isDeleted": false,
|
||||
"id": "IWq_LcOearBV5cvqbJ_-o",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 911.3064553676511,
|
||||
"y": 537.97781592149,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fa5252",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 468230812,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2318,
|
||||
"versionNonce": 1504408670,
|
||||
"isDeleted": false,
|
||||
"id": "TXeK066NA0hvyPSeZl1a5",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1218.075986617651,
|
||||
"y": 536.86062842149,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#4c6ef5",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"seed": 1408574372,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2364,
|
||||
"versionNonce": 3868802,
|
||||
"version": 2792,
|
||||
"versionNonce": 183831882,
|
||||
"isDeleted": false,
|
||||
"id": "10WjipxoLx2zzSI91pXbR",
|
||||
"fillStyle": "hachure",
|
||||
@@ -419,24 +289,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1375.544736617651,
|
||||
"y": 537.04812842149,
|
||||
"x": 599.7894943723566,
|
||||
"y": 905.6027750791251,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#fa5252",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"width": 344.482180700969,
|
||||
"height": 83.67398764683533,
|
||||
"seed": 1813731484,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177825759,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2355,
|
||||
"versionNonce": 2067347614,
|
||||
"version": 2771,
|
||||
"versionNonce": 617525398,
|
||||
"isDeleted": false,
|
||||
"id": "M7Cngti6H0_kawKRN8yJ6",
|
||||
"fillStyle": "hachure",
|
||||
@@ -445,58 +315,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1528.868955367651,
|
||||
"y": 535.89187842149,
|
||||
"x": 963.2554264391833,
|
||||
"y": 904.2447769132434,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"width": 402.42137951281796,
|
||||
"height": 86.03696372105414,
|
||||
"seed": 1260603804,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177777585,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 597,
|
||||
"versionNonce": 1519036482,
|
||||
"isDeleted": false,
|
||||
"id": "GHDrLyBOErQtv_WT5Lx3p",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 614.2293679653073,
|
||||
"y": 565.5605338169978,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 114,
|
||||
"height": 25,
|
||||
"seed": 13297180,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontFamily": 1,
|
||||
"text": "Vulnerability",
|
||||
"baseline": 18,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Vulnerability"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 655,
|
||||
"versionNonce": 1728345310,
|
||||
"version": 1057,
|
||||
"versionNonce": 405881110,
|
||||
"isDeleted": false,
|
||||
"id": "Iq57wFRtO1a8AU0rT6lRD",
|
||||
"fillStyle": "hachure",
|
||||
@@ -505,23 +341,23 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1533.6317117153076,
|
||||
"y": 565.2714713169978,
|
||||
"x": 1046.152429428344,
|
||||
"y": 930.8676815998951,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 136.25488281249991,
|
||||
"height": 21.80078124999998,
|
||||
"width": 218,
|
||||
"height": 36,
|
||||
"seed": 1329695396,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177655817,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 17.440624999999976,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Misconfiguration",
|
||||
"baseline": 14.800781249999979,
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
@@ -529,42 +365,8 @@
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 666,
|
||||
"versionNonce": 1364217858,
|
||||
"isDeleted": false,
|
||||
"id": "gjnZl9nxrqzliwPk8sbK-",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1067.4339578090576,
|
||||
"y": 565.8827994419978,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 136.25488281249991,
|
||||
"height": 21.80078124999998,
|
||||
"seed": 290336932,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 17.440624999999976,
|
||||
"fontFamily": 1,
|
||||
"text": "Misconfiguration",
|
||||
"baseline": 14.800781249999979,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Misconfiguration"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 613,
|
||||
"versionNonce": 1721641246,
|
||||
"version": 883,
|
||||
"versionNonce": 969949898,
|
||||
"isDeleted": false,
|
||||
"id": "_cm6xpfcL9Yv2XBK5MBZF",
|
||||
"fillStyle": "hachure",
|
||||
@@ -573,134 +375,32 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1390.1199929653073,
|
||||
"y": 563.8456900669978,
|
||||
"x": 681.3134368986982,
|
||||
"y": 931.5212932384402,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 114,
|
||||
"height": 25,
|
||||
"width": 161,
|
||||
"height": 36,
|
||||
"seed": 807441828,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177624726,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Vulnerability",
|
||||
"baseline": 18,
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Vulnerability"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 635,
|
||||
"versionNonce": 2022375362,
|
||||
"isDeleted": false,
|
||||
"id": "An4-igVUkLzCwSdvDmtZl",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 925.6707742153073,
|
||||
"y": 560.4550650669978,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 114,
|
||||
"height": 25,
|
||||
"seed": 1262859164,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontFamily": 1,
|
||||
"text": "Vulnerability",
|
||||
"baseline": 18,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Vulnerability"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 681,
|
||||
"versionNonce": 1813371650,
|
||||
"isDeleted": false,
|
||||
"id": "p3-AVxdx5KP6eNViMVTLq",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 792.0184304653073,
|
||||
"y": 564.4160025669978,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 65,
|
||||
"height": 25,
|
||||
"seed": 729823772,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567236437,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontFamily": 1,
|
||||
"text": "Secret",
|
||||
"baseline": 18,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Secret"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 692,
|
||||
"versionNonce": 621238878,
|
||||
"isDeleted": false,
|
||||
"id": "7fe9NOM7QTEEW7nyXAMjh",
|
||||
"fillStyle": "hachure",
|
||||
"strokeWidth": 1,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1259.0613992153073,
|
||||
"y": 562.4238150669978,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 65,
|
||||
"height": 25,
|
||||
"seed": 968541220,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567238433,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontFamily": 1,
|
||||
"text": "Secret",
|
||||
"baseline": 18,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
"originalText": "Secret"
|
||||
},
|
||||
{
|
||||
"type": "rectangle",
|
||||
"version": 2417,
|
||||
"versionNonce": 1222703518,
|
||||
"version": 2874,
|
||||
"versionNonce": 1934391254,
|
||||
"isDeleted": false,
|
||||
"id": "Fq7meULupm1A9leboPlko",
|
||||
"fillStyle": "hachure",
|
||||
@@ -709,24 +409,24 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1684.2588079543348,
|
||||
"y": 536.1830067815082,
|
||||
"x": 1389.3043677318824,
|
||||
"y": 903.8533384764222,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#4c6ef5",
|
||||
"width": 144.5880126953128,
|
||||
"height": 77.80606079101562,
|
||||
"width": 437.15079032010976,
|
||||
"height": 84.42746665074158,
|
||||
"seed": 230693534,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567155021,
|
||||
"updated": 1652177785481,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"version": 760,
|
||||
"versionNonce": 503898690,
|
||||
"version": 1121,
|
||||
"versionNonce": 110517002,
|
||||
"isDeleted": false,
|
||||
"id": "OUGk8nZzvgcKUHhKUcQov",
|
||||
"fillStyle": "hachure",
|
||||
@@ -735,23 +435,23 @@
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"angle": 0,
|
||||
"x": 1723.2672240242127,
|
||||
"y": 561.8650424396028,
|
||||
"x": 1556.0451356485157,
|
||||
"y": 930.8040952304675,
|
||||
"strokeColor": "#000000",
|
||||
"backgroundColor": "#82c91e",
|
||||
"width": 65,
|
||||
"height": 25,
|
||||
"width": 91,
|
||||
"height": 36,
|
||||
"seed": 2044527454,
|
||||
"groupIds": [],
|
||||
"strokeSharpness": "sharp",
|
||||
"boundElements": [],
|
||||
"updated": 1650567240607,
|
||||
"updated": 1652177636085,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"fontSize": 20,
|
||||
"fontSize": 28,
|
||||
"fontFamily": 1,
|
||||
"text": "Secret",
|
||||
"baseline": 18,
|
||||
"baseline": 25,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": null,
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.0 MiB |
BIN
docs/imgs/trivy-k8s.png
Normal file
|
After Width: | Height: | Size: 397 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -8,7 +8,7 @@ hide:
|
||||
|
||||
`Trivy` (`tri` pronounced like **tri**gger, `vy` pronounced like en**vy**) is a simple and comprehensive [vulnerability][vulnerability]/[misconfiguration][misconf]/[secret][secret] scanner for containers and other artifacts.
|
||||
`Trivy` detects vulnerabilities of [OS packages][os] (Alpine, RHEL, CentOS, etc.) and [language-specific packages][lang] (Bundler, Composer, npm, yarn, etc.).
|
||||
In addition, `Trivy` scans [Infrastructure as Code (IaC) files][iac] such as Terraform and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack.
|
||||
In addition, `Trivy` scans [Infrastructure as Code (IaC) files][misconf] such as Terraform and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack.
|
||||
`Trivy` also scans [hardcoded secrets][secret] like passwords, API keys and tokens.
|
||||
`Trivy` is easy to use. Just install the binary and you're ready to scan.
|
||||
All you need to do for scanning is to specify a target such as an image name of the container.
|
||||
@@ -22,17 +22,21 @@ All you need to do for scanning is to specify a target such as an image name of
|
||||
<h1 id="demo">Demo</h1>
|
||||
</div>
|
||||
|
||||
<figure style="text-aligh: center">
|
||||
<img src="imgs/vuln-demo.gif" width="1000">
|
||||
<figure style="text-align: center">
|
||||
<video width="1000">
|
||||
<source src="https://user-images.githubusercontent.com/1161307/171013513-95f18734-233d-45d3-aaf5-d6aec687db0e.mov" type="video/mp4" />
|
||||
</video>
|
||||
<figcaption>Demo: Vulnerability Detection</figcaption>
|
||||
</figure>
|
||||
|
||||
<figure style="text-aligh: center">
|
||||
<img src="imgs/misconf-demo.gif" width="1000">
|
||||
<figure style="text-align: center">
|
||||
<video width="1000">
|
||||
<source src="https://user-images.githubusercontent.com/1161307/171013917-b1f37810-f434-465c-b01a-22de036bd9b3.mov" type="video/mp4" />
|
||||
</video>
|
||||
<figcaption>Demo: Misconfiguration Detection</figcaption>
|
||||
</figure>
|
||||
|
||||
<figure style="text-aligh: center">
|
||||
<figure style="text-align: center">
|
||||
<img src="imgs/secret-demo.gif" width="1000">
|
||||
<figcaption>Demo: Secret Detection</figcaption>
|
||||
</figure>
|
||||
@@ -44,11 +48,10 @@ Learn about our open source work and portfolio [here][oss].
|
||||
Contact us about any matter by opening a GitHub Discussion [here][discussions]
|
||||
|
||||
[vulnerability]: docs/vulnerability/scanning/index.md
|
||||
[misconf]: docs/misconfiguration/index.md
|
||||
[misconf]: docs/misconfiguration/scanning.md
|
||||
[secret]: docs/secret/scanning.md
|
||||
[os]: docs/vulnerability/detection/os.md
|
||||
[lang]: docs/vulnerability/detection/language.md
|
||||
[iac]: docs/misconfiguration/iac.md
|
||||
|
||||
[aquasec]: https://aquasec.com
|
||||
[oss]: https://www.aquasec.com/products/open-source-projects/
|
||||
|
||||
@@ -11,7 +11,7 @@ __rego_metadata__ := {
|
||||
__rego_input__ := {"selector": [{"type": "dockerfile"}]}
|
||||
|
||||
deny[res] {
|
||||
add := input.stages[_][_]
|
||||
add := input.Stages[_].Commands[_]
|
||||
add.Cmd == "add"
|
||||
startswith(add.Value[0], "http://")
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package user.dockerfile.ID002
|
||||
|
||||
test_http_denied {
|
||||
r := deny with input as {"stages": {"alpine:3.13": [
|
||||
r := deny with input as {"Stages": [{"Name": "alpine:3.31", "Commands": [
|
||||
{"Cmd": "from", "Value": ["alpine:3.13"]},
|
||||
{"Cmd": "add", "Value": ["http://example.com/big.tar.xz", "/usr/src/things/"]},
|
||||
{"Cmd": "run", "Value": ["tar -xJf /usr/src/things/big.tar.xz -C /usr/src/things"]},
|
||||
]}}
|
||||
]}]}
|
||||
|
||||
count(r) == 1
|
||||
r[_] == "HTTP not allowed: 'http://example.com/big.tar.xz'"
|
||||
}
|
||||
|
||||
test_http_allowed {
|
||||
r := deny with input as {"stages": {"alpine:3.13": [
|
||||
r := deny with input as {"Stages": [{"Name": "alpine:3.31", "Commands": [
|
||||
{"Cmd": "from", "Value": ["alpine:3.13"]},
|
||||
{"Cmd": "add", "Value": ["https://example.com/big.tar.xz", "/usr/src/things/"]},
|
||||
]}}
|
||||
]}]}
|
||||
|
||||
count(r) == 0
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@ module github.com/aquasecurity/trivy/examples/misconf/go-testing
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/aquasecurity/fanal v0.0.0-20210710080753-f728f1973410
|
||||
github.com/stretchr/testify v1.7.0
|
||||
)
|
||||
|
||||
@@ -156,8 +156,6 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/
|
||||
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
|
||||
github.com/aquasecurity/fanal v0.0.0-20210710080753-f728f1973410 h1:b6yRcMDPpkI1S4VLiROgwgXmusvgX8LtgRzAnKd9HSw=
|
||||
github.com/aquasecurity/fanal v0.0.0-20210710080753-f728f1973410/go.mod h1:zl2aczB7UrczEeMgKTRH6Xp/Lf+gxf0W7kXRjaOubrU=
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20210520015931-0dd56983cc62 h1:aahEMQZXrwhpCMlDgXi2d7jJVNDTpYGJOgLyNptGQoY=
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20210520015931-0dd56983cc62/go.mod h1:Cv/FOCXy6gwvDbz/KX48+y//SmbnKroFwW5hquXn5G4=
|
||||
github.com/aquasecurity/testdocker v0.0.0-20210106133225-0b17fe083674/go.mod h1:psfu0MVaiTDLpNxCoNsTeILSKY2EICBwv345f3M+Ffs=
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/aquasecurity/fanal/external"
|
||||
"github.com/aquasecurity/fanal/types"
|
||||
"github.com/aquasecurity/trivy/pkg/fanal/external"
|
||||
"github.com/aquasecurity/trivy/pkg/fanal/types"
|
||||
)
|
||||
|
||||
func TestPolicy(t *testing.T) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Namespace-based exceptions
|
||||
`policy/k8s_exception.rego` exempts all policies with `appshield.kubernetes` prefix.
|
||||
`policy/k8s_exception.rego` exempts all policies with `builtin.kubernetes` prefix.
|
||||
It means all built-in policies for Kubernetes are disabled.
|
||||
|
||||
``` bash
|
||||
|
||||
@@ -4,5 +4,5 @@ import data.namespaces
|
||||
|
||||
exception[ns] {
|
||||
ns := data.namespaces[_]
|
||||
startswith(ns, "appshield.kubernetes")
|
||||
startswith(ns, "builtin.kubernetes")
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package appshield.kubernetes.KSV006
|
||||
package builtin.kubernetes.KSV006
|
||||
|
||||
exception[rules] {
|
||||
input.metadata.labels.mount == "docker.sock"
|
||||
|
||||
40
examples/module/spring4shell/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Spring4Shell module
|
||||
|
||||
This module provides a more in-depth investigation of Spring4Shell detection.
|
||||
|
||||
## Set up
|
||||
|
||||
```
|
||||
$ tinygo build -o spring4shell.wasm -scheduler=none -target=wasi --no-debug spring4shell.go
|
||||
$ mkdir -p ~/.trivy/modules
|
||||
$ cp spring4shell.wasm ~/.trivy/modules
|
||||
```
|
||||
|
||||
It is also available in [GHCR][trivy-module-spring4shell].
|
||||
You can install it via `trivy module install`.
|
||||
|
||||
```bash
|
||||
$ trivy module install ghcr.io/aquasecurity/trivy-module-spring4shell
|
||||
2022-06-13T15:32:21.972+0300 INFO Installing the module from ghcr.io/aquasecurity/trivy-module-spring4shell...
|
||||
```
|
||||
|
||||
## Run Trivy
|
||||
|
||||
```
|
||||
$ trivy image spring-core-rce-jdk8:latest
|
||||
2022-05-29T22:35:04.873+0300 INFO Loading spring4shell.wasm...
|
||||
2022-05-29T22:35:05.348+0300 INFO Registering WASM module: spring4shell@v1
|
||||
2022-05-29T22:35:07.124+0300 INFO Module spring4shell: analyzing /app/tomcat/RELEASE-NOTES...
|
||||
2022-05-29T22:35:07.139+0300 INFO Module spring4shell: analyzing /app/jdk9/release...
|
||||
2022-05-29T22:37:04.636+0300 INFO Module spring4shell: analyzing /app/jdk9/release...
|
||||
...
|
||||
2022-05-29T22:37:08.917+0300 INFO Module spring4shell: Java Version: 8, Tomcat Version: 8.5.77
|
||||
2022-05-29T22:37:08.917+0300 INFO Module spring4shell: change CVE-2022-22965 severity from CRITICAL to LOW
|
||||
```
|
||||
|
||||
In the above example, the Java version is 8 which is not affected by CVE-2022-22965, so this module changes the severity from CRITICAL to LOW.
|
||||
|
||||
## Note
|
||||
This module is also used for testing in Trivy.
|
||||
|
||||
[trivy-module-spring4shell]: https://github.com/orgs/aquasecurity/packages/container/package/trivy-module-spring4shell
|
||||
283
examples/module/spring4shell/spring4shell.go
Normal file
@@ -0,0 +1,283 @@
|
||||
//go:generate tinygo build -o spring4shell.wasm -scheduler=none -target=wasi --no-debug spring4shell.go
|
||||
//go:build tinygo.wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/module/api"
|
||||
"github.com/aquasecurity/trivy/pkg/module/serialize"
|
||||
"github.com/aquasecurity/trivy/pkg/module/wasm"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ModuleVersion = 1
|
||||
ModuleName = "spring4shell"
|
||||
TypeJavaMajor = ModuleName + "/java-major-version"
|
||||
TypeTomcatVersion = ModuleName + "/tomcat-version"
|
||||
)
|
||||
|
||||
var (
|
||||
tomcatVersionRegex = regexp.MustCompile(`Apache Tomcat Version ([\d.]+)`)
|
||||
)
|
||||
|
||||
// main is required for TinyGo to compile to Wasm.
|
||||
func main() {
|
||||
wasm.RegisterModule(Spring4Shell{})
|
||||
}
|
||||
|
||||
type Spring4Shell struct {
|
||||
// Cannot define fields as modules can't keep state.
|
||||
}
|
||||
|
||||
func (Spring4Shell) Version() int {
|
||||
return ModuleVersion
|
||||
}
|
||||
|
||||
func (Spring4Shell) Name() string {
|
||||
return ModuleName
|
||||
}
|
||||
|
||||
func (Spring4Shell) RequiredFiles() []string {
|
||||
return []string{
|
||||
`\/openjdk-\d+\/release`, // For OpenJDK version
|
||||
`\/jdk\d+\/release`, // For JDK version
|
||||
`tomcat\/RELEASE-NOTES`, // For Tomcat version
|
||||
}
|
||||
}
|
||||
|
||||
func (s Spring4Shell) Analyze(filePath string) (*serialize.AnalysisResult, error) {
|
||||
wasm.Info(fmt.Sprintf("analyzing %s...", filePath))
|
||||
f, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
switch {
|
||||
case strings.HasSuffix(filePath, "/release"):
|
||||
return s.parseJavaRelease(f, filePath)
|
||||
case strings.HasSuffix(filePath, "/RELEASE-NOTES"):
|
||||
return s.parseTomcatReleaseNotes(f, filePath)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Parse a jdk release file like "/usr/local/openjdk-11/release"
|
||||
func (Spring4Shell) parseJavaRelease(f *os.File, filePath string) (*serialize.AnalysisResult, error) {
|
||||
var javaVersion string
|
||||
scanner := bufio.NewScanner(f)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !strings.HasPrefix(line, "JAVA_VERSION=") {
|
||||
continue
|
||||
}
|
||||
|
||||
ss := strings.Split(line, "=")
|
||||
if len(ss) != 2 {
|
||||
return nil, fmt.Errorf("invalid java version: %s", line)
|
||||
}
|
||||
|
||||
javaVersion = strings.Trim(ss[1], `"`)
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &serialize.AnalysisResult{
|
||||
CustomResources: []serialize.CustomResource{
|
||||
{
|
||||
Type: TypeJavaMajor,
|
||||
FilePath: filePath,
|
||||
Data: javaVersion,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (Spring4Shell) parseTomcatReleaseNotes(f *os.File, filePath string) (*serialize.AnalysisResult, error) {
|
||||
b, err := io.ReadAll(f)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m := tomcatVersionRegex.FindStringSubmatch(string(b))
|
||||
if len(m) != 2 {
|
||||
return nil, fmt.Errorf("unknown tomcat release notes format")
|
||||
}
|
||||
|
||||
return &serialize.AnalysisResult{
|
||||
CustomResources: []serialize.CustomResource{
|
||||
{
|
||||
Type: TypeTomcatVersion,
|
||||
FilePath: filePath,
|
||||
Data: m[1],
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (Spring4Shell) PostScanSpec() serialize.PostScanSpec {
|
||||
return serialize.PostScanSpec{
|
||||
Action: api.ActionUpdate, // Update severity
|
||||
IDs: []string{"CVE-2022-22965"},
|
||||
}
|
||||
}
|
||||
|
||||
// PostScan takes results including custom resources and detected CVE-2022-22965.
|
||||
//
|
||||
// Example input:
|
||||
// [
|
||||
// {
|
||||
// "Target": "",
|
||||
// "Class": "custom",
|
||||
// "CustomResources": [
|
||||
// {
|
||||
// "Type": "spring4shell/java-major-version",
|
||||
// "FilePath": "/usr/local/openjdk-8/release",
|
||||
// "Layer": {
|
||||
// "Digest": "sha256:d7b564a873af313eb2dbcb1ed0d393c57543e3666bdedcbe5d75841d72b1f791",
|
||||
// "DiffID": "sha256:ba40706eccba610401e4942e29f50bdf36807f8638942ce20805b359ae3ac1c1"
|
||||
// },
|
||||
// "Data": "1.8.0_322"
|
||||
// },
|
||||
// {
|
||||
// "Type": "spring4shell/tomcat-version",
|
||||
// "FilePath": "/usr/local/tomcat/RELEASE-NOTES",
|
||||
// "Layer": {
|
||||
// "Digest": "sha256:59c0978ccb117247fd40d936973c40df89195f60466118c5acc6a55f8ba29f06",
|
||||
// "DiffID": "sha256:85595543df2b1115a18284a8ef62d0b235c4bc29e3d33b55f89b54ee1eadf4c6"
|
||||
// },
|
||||
// "Data": "8.5.77"
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "Target": "Java",
|
||||
// "Class": "lang-pkgs",
|
||||
// "Type": "jar",
|
||||
// "Vulnerabilities": [
|
||||
// {
|
||||
// "VulnerabilityID": "CVE-2022-22965",
|
||||
// "PkgName": "org.springframework.boot:spring-boot",
|
||||
// "PkgPath": "usr/local/tomcat/webapps/helloworld.war",
|
||||
// "InstalledVersion": "2.6.3",
|
||||
// "FixedVersion": "2.5.12, 2.6.6",
|
||||
// "Layer": {
|
||||
// "Digest": "sha256:cc44af318e91e6f9f9bf73793fa4f0639487613f46aa1f819b02b6e8fb5c6c07",
|
||||
// "DiffID": "sha256:eb769943b91f10a0418f2fc3b4a4fde6c6293be60c37293fcc0fa319edaf27a5"
|
||||
// },
|
||||
// "SeveritySource": "nvd",
|
||||
// "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2022-22965",
|
||||
// "DataSource": {
|
||||
// "ID": "glad",
|
||||
// "Name": "GitLab Advisory Database Community",
|
||||
// "URL": "https://gitlab.com/gitlab-org/advisories-community"
|
||||
// },
|
||||
// "Title": "spring-framework: RCE via Data Binding on JDK 9+",
|
||||
// "Description": "A Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.",
|
||||
// "Severity": "CRITICAL",
|
||||
// "CweIDs": [
|
||||
// "CWE-94"
|
||||
// ],
|
||||
// "VendorSeverity": {
|
||||
// "ghsa": 4,
|
||||
// "nvd": 4,
|
||||
// "redhat": 3
|
||||
// },
|
||||
// "CVSS": {
|
||||
// "ghsa": {
|
||||
// "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
|
||||
// "V3Score": 9.8
|
||||
// },
|
||||
// "nvd": {
|
||||
// "V2Vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P",
|
||||
// "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
|
||||
// "V2Score": 7.5,
|
||||
// "V3Score": 9.8
|
||||
// },
|
||||
// "redhat": {
|
||||
// "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
|
||||
// "V3Score": 8.1
|
||||
// }
|
||||
// },
|
||||
// "References": [
|
||||
// "https://github.com/advisories/GHSA-36p3-wjmg-h94x"
|
||||
// ],
|
||||
// "PublishedDate": "2022-04-01T23:15:00Z",
|
||||
// "LastModifiedDate": "2022-05-19T14:21:00Z"
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//]
|
||||
func (Spring4Shell) PostScan(results serialize.Results) (serialize.Results, error) {
|
||||
var javaMajorVersion int
|
||||
var tomcatVersion string
|
||||
for _, result := range results {
|
||||
if result.Class != types.ClassCustom {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, c := range result.CustomResources {
|
||||
if c.Type == TypeJavaMajor {
|
||||
v := c.Data.(string)
|
||||
ss := strings.Split(v, ".")
|
||||
if len(ss) == 0 || len(ss) < 2 {
|
||||
wasm.Warn("Invalid Java version: " + v)
|
||||
continue
|
||||
}
|
||||
|
||||
ver := ss[0]
|
||||
if ver == "1" {
|
||||
ver = ss[1]
|
||||
}
|
||||
|
||||
var err error
|
||||
javaMajorVersion, err = strconv.Atoi(ver)
|
||||
if err != nil {
|
||||
wasm.Warn("Invalid Java version: " + v)
|
||||
continue
|
||||
}
|
||||
} else if c.Type == TypeTomcatVersion {
|
||||
tomcatVersion = c.Data.(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wasm.Info(fmt.Sprintf("Java Version: %d, Tomcat Version: %s", javaMajorVersion, tomcatVersion))
|
||||
|
||||
vulnerable := true
|
||||
// TODO: version comparison
|
||||
if tomcatVersion == "10.0.20" || tomcatVersion == "9.0.62" || tomcatVersion == "8.5.78" {
|
||||
vulnerable = false
|
||||
} else if javaMajorVersion <= 8 {
|
||||
vulnerable = false
|
||||
}
|
||||
|
||||
for i, result := range results {
|
||||
for j, vuln := range result.Vulnerabilities {
|
||||
// Look up Spring4Shell
|
||||
if vuln.VulnerabilityID != "CVE-2022-22965" {
|
||||
continue
|
||||
}
|
||||
|
||||
// If it doesn't satisfy any of requirements, the severity should be changed to LOW.
|
||||
if !strings.Contains(vuln.PkgPath, ".war") || !vulnerable {
|
||||
wasm.Info(fmt.Sprintf("change %s CVE-2022-22965 severity from CRITICAL to LOW", vuln.PkgName))
|
||||
results[i].Vulnerabilities[j].Severity = "LOW"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results, nil
|
||||
}
|
||||
24
examples/trivy-conf/trivy.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
timeout: 10m
|
||||
format: json
|
||||
dependency-tree: true
|
||||
list-all-pkgs: true
|
||||
exit-code: 1
|
||||
output: result.json
|
||||
severity:
|
||||
- HIGH
|
||||
- CRITICAL
|
||||
scan:
|
||||
skip-dirs:
|
||||
- /lib64
|
||||
- /lib
|
||||
- /usr/lib
|
||||
- /usr/include
|
||||
|
||||
security-checks:
|
||||
- vuln
|
||||
- secret
|
||||
vulnerability:
|
||||
type:
|
||||
- os
|
||||
- library
|
||||
ignore-unfixed: true
|
||||
293
go.mod
@@ -3,201 +3,320 @@ module github.com/aquasecurity/trivy
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/CycloneDX/cyclonedx-go v0.5.1
|
||||
github.com/CycloneDX/cyclonedx-go v0.6.0
|
||||
github.com/Masterminds/sprig/v3 v3.2.2
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46
|
||||
github.com/NYTimes/gziphandler v1.1.1
|
||||
github.com/alicebob/miniredis/v2 v2.22.0
|
||||
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
|
||||
github.com/aquasecurity/fanal v0.0.0-20220426115253-1d75fc0c7219
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20220422134844-880747206031
|
||||
github.com/aquasecurity/go-dep-parser v0.0.0-20220626060741-179d0b167e5f
|
||||
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
|
||||
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
|
||||
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
|
||||
github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20220327074450-74195d9604b2
|
||||
github.com/caarlos0/env/v6 v6.9.1
|
||||
github.com/aquasecurity/table v1.6.0
|
||||
github.com/aquasecurity/testdocker v0.0.0-20210911155206-e1e85f5a1516
|
||||
github.com/aquasecurity/trivy-db v0.0.0-20220627104749-930461748b63
|
||||
github.com/aquasecurity/trivy-kubernetes v0.3.1-0.20220623094029-353ad52f879b
|
||||
github.com/caarlos0/env/v6 v6.9.3
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/cheggaaa/pb/v3 v3.0.8
|
||||
github.com/docker/docker v20.10.14+incompatible
|
||||
github.com/containerd/containerd v1.6.6
|
||||
github.com/docker/docker v20.10.17+incompatible
|
||||
github.com/docker/go-connections v0.4.0
|
||||
github.com/fatih/color v1.13.0
|
||||
github.com/go-enry/go-license-detector/v4 v4.3.0
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/google/go-containerregistry v0.7.1-0.20211214010025-a65b7844a475
|
||||
github.com/google/licenseclassifier/v2 v2.0.0-pre5
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/google/wire v0.5.0
|
||||
github.com/hashicorp/go-getter v1.5.11
|
||||
github.com/hashicorp/go-getter v1.6.2
|
||||
github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f
|
||||
github.com/knqyf263/go-deb-version v0.0.0-20190517075300-09fca494f03d
|
||||
github.com/knqyf263/go-rpm-version v0.0.0-20170716094938-74609b86c936
|
||||
github.com/knqyf263/go-rpm-version v0.0.0-20220614171824-631e686d1075
|
||||
github.com/kylelemons/godebug v1.1.0
|
||||
github.com/liamg/memoryfs v1.4.2
|
||||
github.com/liamg/tml v0.6.0
|
||||
github.com/mailru/easyjson v0.7.7
|
||||
github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/open-policy-agent/opa v0.39.0
|
||||
github.com/owenrumney/go-sarif/v2 v2.1.1
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
github.com/open-policy-agent/opa v0.42.0
|
||||
github.com/owenrumney/go-sarif/v2 v2.1.2
|
||||
github.com/package-url/packageurl-go v0.1.1-0.20220203205134-d70459300c8a
|
||||
github.com/samber/lo v1.16.0
|
||||
github.com/spf13/afero v1.8.1 // indirect
|
||||
github.com/stretchr/testify v1.7.1
|
||||
github.com/testcontainers/testcontainers-go v0.12.0
|
||||
github.com/twitchtv/twirp v8.1.1+incompatible
|
||||
github.com/urfave/cli/v2 v2.4.0
|
||||
github.com/samber/lo v1.24.0
|
||||
github.com/sosedoff/gitkit v0.3.0
|
||||
github.com/spf13/cobra v1.5.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/viper v1.8.1
|
||||
github.com/stretchr/testify v1.8.0
|
||||
github.com/testcontainers/testcontainers-go v0.13.0
|
||||
github.com/tetratelabs/wazero v0.0.0-20220701105919-891761ac1ee2
|
||||
github.com/twitchtv/twirp v8.1.2+incompatible
|
||||
github.com/xlab/treeprint v1.1.0
|
||||
go.etcd.io/bbolt v1.3.6
|
||||
go.uber.org/zap v1.21.0
|
||||
golang.org/x/exp v0.0.0-20220407100705-7b9b53b0aca4
|
||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
|
||||
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df
|
||||
google.golang.org/protobuf v1.28.0
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.99.0 // indirect
|
||||
cloud.google.com/go v0.100.2 // indirect
|
||||
cloud.google.com/go/compute v1.6.1 // indirect
|
||||
cloud.google.com/go/iam v0.3.0 // indirect
|
||||
cloud.google.com/go/storage v1.14.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v63.0.0+incompatible // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.25 // indirect
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.27
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.20
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/BurntSushi/toml v1.1.0 // indirect
|
||||
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible // indirect
|
||||
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
|
||||
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.1.1 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.2 // indirect
|
||||
github.com/Masterminds/squirrel v1.5.2 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.2 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.3 // indirect
|
||||
github.com/OneOfOne/xxhash v1.2.8 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
|
||||
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
|
||||
github.com/VividCortex/ewma v1.1.1 // indirect
|
||||
github.com/acomagu/bufpipe v1.0.3 // indirect
|
||||
github.com/agext/levenshtein v1.2.3 // indirect
|
||||
github.com/agnivade/levenshtein v1.0.1 // indirect
|
||||
github.com/alecthomas/chroma v0.10.0 // indirect
|
||||
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
|
||||
github.com/apparentlymart/go-cidr v1.1.0 // indirect
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||
github.com/aquasecurity/defsec v0.28.5-0.20220416075528-0f0c8fdf63b8 // indirect
|
||||
github.com/aquasecurity/tfsec v1.8.0 // indirect
|
||||
github.com/aws/aws-sdk-go v1.43.31 // indirect
|
||||
github.com/aquasecurity/defsec v0.68.6
|
||||
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.46
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
|
||||
github.com/bmatcuk/doublestar v1.3.4 // indirect
|
||||
github.com/briandowns/spinner v1.12.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/containerd/cgroups v1.0.3 // indirect
|
||||
github.com/containerd/containerd v1.5.9 // indirect
|
||||
github.com/containerd/continuity v0.2.2 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.10.1 // indirect
|
||||
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
|
||||
github.com/containerd/cgroups v1.0.4 // indirect
|
||||
github.com/containerd/continuity v0.3.0 // indirect
|
||||
github.com/containerd/fifo v1.0.0 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.11.4 // indirect
|
||||
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3 // indirect
|
||||
github.com/containerd/typeurl v1.0.2 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dgryski/go-minhash v0.0.0-20170608043002-7fe510aff544 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dimchansky/utfbom v1.1.1 // indirect
|
||||
github.com/docker/cli v20.10.11+incompatible // indirect
|
||||
github.com/docker/distribution v2.7.1+incompatible // indirect
|
||||
github.com/dlclark/regexp2 v1.4.0 // indirect
|
||||
github.com/docker/cli v20.10.17+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.1+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.6.4 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/ekzhu/minhash-lsh v0.0.0-20171225071031-5c06ee8586a1 // indirect
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||
github.com/ghodss/yaml v1.0.0 // indirect
|
||||
github.com/go-errors/errors v1.0.1 // indirect
|
||||
github.com/go-git/gcfg v1.5.0 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.3.1 // indirect
|
||||
github.com/go-git/go-git/v5 v5.4.2 // indirect
|
||||
github.com/go-git/go-git/v5 v5.4.2
|
||||
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.5 // indirect
|
||||
github.com/go-openapi/swag v0.19.14 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
github.com/goccy/go-yaml v1.8.2 // indirect
|
||||
github.com/gofrs/uuid v4.0.0+incompatible // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/google/gnostic v0.5.7-v3refs // indirect
|
||||
github.com/google/go-cmp v0.5.8 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/gosuri/uitable v0.0.4 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
|
||||
github.com/hashicorp/go-safetemp v1.0.0 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/go-version v1.4.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.11.1 // indirect
|
||||
github.com/huandu/xstrings v1.3.1 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.12.0 // indirect
|
||||
github.com/hhatto/gorst v0.0.0-20181029133204-ca9f730cac5b // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/imdario/mergo v0.3.13 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jdkato/prose v1.1.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.3.4 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
github.com/klauspost/compress v1.14.2 // indirect
|
||||
github.com/knqyf263/go-rpmdb v0.0.0-20220209103220-0f7a6d951a6d // indirect
|
||||
github.com/knqyf263/nested v0.0.1 // indirect
|
||||
github.com/klauspost/compress v1.15.6 // indirect
|
||||
github.com/knqyf263/go-rpmdb v0.0.0-20220607073645-842f01763e21
|
||||
github.com/knqyf263/nested v0.0.1
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/liamg/iamgo v0.0.6 // indirect
|
||||
github.com/liamg/jfather v0.0.7 // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/lib/pq v1.10.4 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.12 // indirect
|
||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.0 // indirect
|
||||
github.com/moby/buildkit v0.9.3 // indirect
|
||||
github.com/moby/sys/mount v0.2.0 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.0 // indirect
|
||||
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/buildkit v0.10.3
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/spdystream v0.2.0 // indirect
|
||||
github.com/moby/sys/mount v0.3.3 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||
github.com/moby/sys/signal v0.7.0 // indirect
|
||||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||
github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb // indirect
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||
github.com/opencontainers/runc v1.1.0 // indirect
|
||||
github.com/owenrumney/squealer v0.3.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1
|
||||
github.com/opencontainers/runc v1.1.3 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220311020903-6969a0a09ab1 // indirect
|
||||
github.com/opencontainers/selinux v1.10.1 // indirect
|
||||
github.com/owenrumney/squealer v1.0.1-0.20220510063705-c0be93f0edea // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.12.2 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/rubenv/sql-migrate v1.1.1 // indirect
|
||||
github.com/russross/blackfriday v1.6.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/saracen/walker v0.0.0-20191201085201-324a081bae7e // indirect
|
||||
github.com/saracen/walker v0.0.0-20191201085201-324a081bae7e
|
||||
github.com/sergi/go-diff v1.1.0 // indirect
|
||||
github.com/shogo82148/go-shuffle v0.0.0-20170808115208-59829097ff3b // indirect
|
||||
github.com/shopspring/decimal v1.2.0 // indirect
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/stretchr/objx v0.3.0 // indirect
|
||||
github.com/tmccombs/hcl2json v0.3.4 // indirect
|
||||
github.com/spdx/tools-golang v0.3.0
|
||||
github.com/spf13/afero v1.8.2 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/stretchr/objx v0.4.0 // indirect
|
||||
github.com/subosito/gotenv v1.4.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.8 // indirect
|
||||
github.com/vbatts/tar-split v0.11.2 // indirect
|
||||
github.com/vektah/gqlparser/v2 v2.4.5 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
github.com/yashtewari/glob-intersection v0.1.0 // indirect
|
||||
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect
|
||||
github.com/zclconf/go-cty v1.10.0 // indirect
|
||||
github.com/zclconf/go-cty-yaml v1.0.2 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220208233918-bba287dce954 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/tools v0.1.8 // indirect
|
||||
google.golang.org/api v0.62.0 // indirect
|
||||
go.uber.org/multierr v1.7.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
|
||||
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
|
||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
|
||||
golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect
|
||||
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
|
||||
golang.org/x/text v0.3.7
|
||||
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
||||
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717 // indirect
|
||||
gonum.org/v1/gonum v0.7.0 // indirect
|
||||
google.golang.org/api v0.81.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220204002441-d6cc3cc0770e // indirect
|
||||
google.golang.org/grpc v1.45.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect
|
||||
google.golang.org/grpc v1.47.0 // indirect
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
|
||||
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||
gopkg.in/neurosnap/sentences.v1 v1.0.6 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gotest.tools v2.2.0+incompatible
|
||||
gotest.tools/v3 v3.2.0 // indirect
|
||||
helm.sh/helm/v3 v3.9.0 // indirect
|
||||
k8s.io/api v0.24.2 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.24.0 // indirect
|
||||
k8s.io/apimachinery v0.24.2 // indirect
|
||||
k8s.io/apiserver v0.24.1 // indirect
|
||||
k8s.io/cli-runtime v0.24.2 // indirect
|
||||
k8s.io/client-go v0.24.2 // indirect
|
||||
k8s.io/component-base v0.24.2 // indirect
|
||||
k8s.io/klog/v2 v2.60.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
|
||||
k8s.io/kubectl v0.24.2 // indirect
|
||||
lukechampine.com/uint128 v1.1.1 // indirect
|
||||
modernc.org/cc/v3 v3.35.22 // indirect
|
||||
modernc.org/ccgo/v3 v3.15.1 // indirect
|
||||
modernc.org/libc v1.14.1 // indirect
|
||||
modernc.org/cc/v3 v3.36.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.6 // indirect
|
||||
modernc.org/libc v1.16.7 // indirect
|
||||
modernc.org/mathutil v1.4.1 // indirect
|
||||
modernc.org/memory v1.0.5 // indirect
|
||||
modernc.org/memory v1.1.1 // indirect
|
||||
modernc.org/opt v0.1.1 // indirect
|
||||
modernc.org/sqlite v1.14.5 // indirect
|
||||
modernc.org/sqlite v1.17.3 // indirect
|
||||
modernc.org/strutil v1.1.1 // indirect
|
||||
modernc.org/token v1.0.0 // indirect
|
||||
oras.land/oras-go v1.2.0 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
|
||||
sigs.k8s.io/kustomize/api v0.11.4 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.13.6 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||
)
|
||||
|
||||
// To resolve CVE-2022-23648
|
||||
replace github.com/containerd/containerd v1.5.9 => github.com/containerd/containerd v1.5.10
|
||||
// See https://github.com/moby/moby/issues/42939#issuecomment-1114255529
|
||||
replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible
|
||||
|
||||
// v1.2.0 is taken from github.com/open-policy-agent/opa v0.42.0
|
||||
// v1.2.0 incompatible with github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible
|
||||
replace oras.land/oras-go => oras.land/oras-go v1.1.1
|
||||
|
||||