Skip to content

Commit dbc7a83

Browse files
ankk13knqyf263
andauthored
feat(python): add packaging detector and respective hook (#1223)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
1 parent 19c0b70 commit dbc7a83

File tree

25 files changed

+191
-99
lines changed

25 files changed

+191
-99
lines changed

docs/vulnerability/detection/language.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,32 @@
22

33
`Trivy` automatically detects the following files in the container and scans vulnerabilities in the application dependencies.
44

5-
| Language | File | Dev dependencies |
6-
| ---------| ------------------------------------------------| -----------------|
7-
| Ruby | Gemfile.lock | included |
8-
| Python | Pipfile.lock | excluded |
9-
| | poetry.lock | included |
10-
| PHP | composer.lock | excluded |
11-
| Node.js | package-lock.json | excluded |
12-
| | yarn.lock | included |
13-
| .NET | packages.lock.json | included |
14-
| Java | JAR/WAR/EAR (`*.jar`, `*.war`, and `*.ear`)[^1] | included |
15-
| Go | Binaries built by Go[^2] | excluded |
16-
| | go.sum | included |
5+
| Language | File | Image[^6] | Filesystem[^7] | Repository[^8] |Dev dependencies |
6+
|---------|-------------------------|:---------:|:--------------:|:---------------:|-----------------|
7+
| Ruby | Gemfile.lock |||| included |
8+
| Python | Pipfile.lock | - |||excluded |
9+
| | poetry.lock | - ||| included |
10+
| | requirements.txt | - ||| included |
11+
| | egg package[^1] ||| - | excluded |
12+
| | wheel package[^2] ||| - | excluded |
13+
| PHP | composer.lock |||| excluded |
14+
| Node.js | package-lock.json |||| excluded |
15+
| | yarn.lock |||| ncluded |
16+
| .NET | packages.lock.json |||| included |
17+
| Java | JAR/WAR/EAR[^3][^4] |||| included |
18+
| Go | Binaries built by Go[^5] ||| - | excluded |
19+
| | go.sum | - ||| included |
1720

1821

1922
The path of these files does not matter.
2023

2124
Example: [Dockerfile](https://github.com/aquasecurity/trivy-ci-test/blob/main/Dockerfile)
2225

23-
[^1]: It requires the Internet access
24-
[^2]: UPX-compressed binaries don't work
26+
[^1]: `*.egg-info`, `*.egg-info/PKG-INFO`, `*.egg` and `EGG-INFO/PKG-INFO`
27+
[^2]: `.dist-info/META-DATA`
28+
[^3]: `*.jar`, `*.war`, and `*.ear`
29+
[^4]: It requires the Internet access
30+
[^5]: UPX-compressed binaries don't work
31+
[^6]: ✅ means "enabled" and `-` means "disabled" in the image scanning
32+
[^7]: ✅ means "enabled" and `-` means "disabled" in the filesystem scanning
33+
[^8]: ✅ means "enabled" and `-` means "disabled" in the git repository scanning

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ require (
77
github.com/Masterminds/sprig v2.22.0+incompatible
88
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46
99
github.com/aquasecurity/bolt-fixtures v0.0.0-20200903104109-d34e7f983986
10-
github.com/aquasecurity/fanal v0.0.0-20210815095355-42429a80d0e3
11-
github.com/aquasecurity/go-dep-parser v0.0.0-20210815080135-5be65146849a
10+
github.com/aquasecurity/fanal v0.0.0-20210913141820-41bee177765e
11+
github.com/aquasecurity/go-dep-parser v0.0.0-20210905090655-b95c2c079bbb
1212
github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce
1313
github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798
1414
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
@@ -37,18 +37,18 @@ require (
3737
github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08
3838
github.com/mitchellh/copystructure v1.1.1 // indirect
3939
github.com/olekukonko/tablewriter v0.0.5
40-
github.com/open-policy-agent/opa v0.31.0
40+
github.com/open-policy-agent/opa v0.32.0
4141
github.com/smartystreets/assertions v1.2.0 // indirect
4242
github.com/spf13/afero v1.6.0
4343
github.com/stretchr/objx v0.3.0 // indirect
4444
github.com/stretchr/testify v1.7.0
4545
github.com/testcontainers/testcontainers-go v0.11.1
4646
github.com/twitchtv/twirp v8.1.0+incompatible
4747
github.com/urfave/cli/v2 v2.3.0
48-
go.uber.org/zap v1.17.0
48+
go.uber.org/zap v1.19.0
4949
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
5050
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
51-
google.golang.org/protobuf v1.26.0
51+
google.golang.org/protobuf v1.27.1
5252
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
5353
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
5454
k8s.io/utils v0.0.0-20201110183641-67b214c5f920

0 commit comments

Comments
 (0)