You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition, Trivy supports three formats of Python packages: `egg`, `wheel` and `conda`.
13
13
The following scanners are supported for Python packages.
14
14
15
-
| Packaging | SBOM | Vulnerability | License |
16
-
|---------|:---: |:-----------: |:-----: |
17
-
| Egg |✓ | ✓ | ✓ |
18
-
| Wheel |✓ | ✓ | ✓ |
19
-
| Conda |✓ | - | - |
15
+
| Packaging | SBOM | Vulnerability | License |
16
+
|-----------|:----:|:-------------:|:-------:|
17
+
| Egg | ✓ | ✓ | ✓ |
18
+
| Wheel | ✓ | ✓ | ✓ |
19
+
| Conda | ✓ | - | - |
20
20
21
21
22
22
The following table provides an outline of the features Trivy offers.
@@ -40,6 +40,8 @@ See [here](./index.md) for the detail.
40
40
Trivy parses your files generated by package managers in filesystem/repository scanning.
41
41
42
42
### pip
43
+
44
+
#### Dependency detection
43
45
Trivy only parses [version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#id4) with `==` comparison operator and without `.*`.
44
46
To convert unsupported version specifiers - use the `pip freeze` command.
45
47
@@ -91,7 +93,16 @@ urllib3==1.26.15
91
93
`requirements.txt` files don't contain information about dependencies used for development.
92
94
Trivy could detect vulnerabilities on the development packages, which not affect your production environment.
93
95
94
-
License detection is not supported for `pip`.
96
+
#### License detection
97
+
98
+
`requirements.txt` files don't contain information about licenses.
99
+
Therefore, Trivy checks `METADATA` files from `lib/site-packages` directory.
100
+
101
+
Trivy uses 3 ways to detect `site-packages` directory:
102
+
103
+
- Checks `VIRTUAL_ENV` environment variable.
104
+
- Detects path to `python`[^1] binary and checks `../lib/pythonX.Y/site-packages` directory.
105
+
- Detects path to `python`[^1] binary and checks `../../lib/site-packages` directory.
95
106
96
107
### Pipenv
97
108
Trivy parses `Pipfile.lock`.
@@ -116,4 +127,6 @@ Trivy looks for `*.egg-info`, `*.egg-info/PKG-INFO`, `*.egg` and `EGG-INFO/PKG-I
116
127
### Wheel
117
128
Trivy looks for `.dist-info/META-DATA` to identify Python packages.
118
129
130
+
[^1]: Trivy checks `python`, `python3`, `python2` and `python.exe` file names.
0 commit comments