pysentry-rs 0.1.5__cp39-cp39-macosx_11_0_arm64.whl → 0.2.0__cp39-cp39-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pysentry-rs might be problematic. Click here for more details.
- pysentry/__init__.py +81 -61
- pysentry/_internal.cpython-39-darwin.so +0 -0
- {pysentry_rs-0.1.5.dist-info → pysentry_rs-0.2.0.dist-info}/METADATA +30 -14
- pysentry_rs-0.2.0.dist-info/RECORD +8 -0
- pysentry_rs-0.1.5.dist-info/RECORD +0 -8
- {pysentry_rs-0.1.5.dist-info → pysentry_rs-0.2.0.dist-info}/WHEEL +0 -0
- {pysentry_rs-0.1.5.dist-info → pysentry_rs-0.2.0.dist-info}/entry_points.txt +0 -0
- {pysentry_rs-0.1.5.dist-info → pysentry_rs-0.2.0.dist-info}/licenses/LICENSE +0 -0
pysentry/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from ._internal import audit_python, audit_with_options, check_resolvers, check_version
|
|
4
4
|
|
|
5
|
-
__version__ = "0.
|
|
5
|
+
__version__ = "0.2.0"
|
|
6
6
|
__all__ = [
|
|
7
7
|
"audit_python",
|
|
8
8
|
"audit_with_options",
|
|
@@ -17,73 +17,83 @@ def main():
|
|
|
17
17
|
import sys
|
|
18
18
|
import argparse
|
|
19
19
|
|
|
20
|
-
# Handle
|
|
21
|
-
if len(sys.argv) > 1
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
20
|
+
# Handle subcommands manually to match Rust CLI structure exactly
|
|
21
|
+
if len(sys.argv) > 1:
|
|
22
|
+
if sys.argv[1] == "resolvers":
|
|
23
|
+
# Resolvers subcommand
|
|
24
|
+
parser = argparse.ArgumentParser(
|
|
25
|
+
prog="pysentry resolvers",
|
|
26
|
+
description="Check available dependency resolvers",
|
|
27
|
+
)
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
"-v", "--verbose", action="store_true", help="Enable verbose output"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
args = parser.parse_args(sys.argv[2:])
|
|
33
|
+
try:
|
|
34
|
+
result = check_resolvers(args.verbose)
|
|
35
|
+
print(result)
|
|
36
|
+
except Exception as e:
|
|
37
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
38
|
+
sys.exit(1)
|
|
39
|
+
return
|
|
40
|
+
|
|
41
|
+
elif sys.argv[1] == "check-version":
|
|
42
|
+
# Check-version subcommand
|
|
43
|
+
parser = argparse.ArgumentParser(
|
|
44
|
+
prog="pysentry-rs check-version",
|
|
45
|
+
description="Check if a newer version is available",
|
|
46
|
+
)
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
"-v", "--verbose", action="store_true", help="Enable verbose output"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
args = parser.parse_args(sys.argv[2:])
|
|
52
|
+
try:
|
|
53
|
+
result = check_version(args.verbose)
|
|
54
|
+
print(result)
|
|
55
|
+
except Exception as e:
|
|
56
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
57
|
+
sys.exit(1)
|
|
58
|
+
return
|
|
59
|
+
elif sys.argv[1] in ["-h", "--help"]:
|
|
60
|
+
# Show main help
|
|
61
|
+
pass
|
|
62
|
+
elif sys.argv[1] in ["-V", "--version"]:
|
|
63
|
+
print(f"pysentry-rs {__version__}")
|
|
64
|
+
return
|
|
65
|
+
|
|
66
|
+
# Main parser for audit command (default) and help
|
|
65
67
|
parser = argparse.ArgumentParser(
|
|
66
68
|
prog="pysentry-rs",
|
|
67
69
|
description="Security vulnerability auditing for Python packages",
|
|
70
|
+
usage="pysentry-rs [OPTIONS] [PATH] [COMMAND]",
|
|
68
71
|
)
|
|
69
72
|
|
|
73
|
+
# Add version argument
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
"-V", "--version", action="version", version=f"pysentry-rs {__version__}"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Main audit arguments
|
|
70
79
|
parser.add_argument(
|
|
71
80
|
"path",
|
|
72
81
|
nargs="?",
|
|
73
82
|
default=".",
|
|
74
|
-
|
|
83
|
+
metavar="PATH",
|
|
84
|
+
help="Path to the project directory to audit [default: .]",
|
|
75
85
|
)
|
|
76
86
|
parser.add_argument(
|
|
77
87
|
"--format",
|
|
78
88
|
choices=["human", "json", "sarif"],
|
|
79
89
|
default="human",
|
|
80
|
-
help="Output format
|
|
90
|
+
help="Output format [default: human] [possible values: human, json, sarif]",
|
|
81
91
|
)
|
|
82
92
|
parser.add_argument(
|
|
83
93
|
"--severity",
|
|
84
94
|
choices=["low", "medium", "high", "critical"],
|
|
85
95
|
default="low",
|
|
86
|
-
help="Minimum severity level to report
|
|
96
|
+
help="Minimum severity level to report [default: low] [possible values: low, medium, high, critical]",
|
|
87
97
|
)
|
|
88
98
|
parser.add_argument(
|
|
89
99
|
"--ignore",
|
|
@@ -93,13 +103,12 @@ def main():
|
|
|
93
103
|
help="Vulnerability IDs to ignore (can be specified multiple times)",
|
|
94
104
|
)
|
|
95
105
|
parser.add_argument(
|
|
96
|
-
"
|
|
106
|
+
"-o", "--output", metavar="FILE", help="Output file path (defaults to stdout)"
|
|
97
107
|
)
|
|
98
108
|
parser.add_argument(
|
|
99
|
-
"--
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"--optional", action="store_true", help="Include optional dependencies"
|
|
109
|
+
"--all",
|
|
110
|
+
action="store_true",
|
|
111
|
+
help="Include ALL dependencies (main + dev, optional, etc)",
|
|
103
112
|
)
|
|
104
113
|
parser.add_argument(
|
|
105
114
|
"--direct-only",
|
|
@@ -112,13 +121,13 @@ def main():
|
|
|
112
121
|
"--source",
|
|
113
122
|
choices=["pypa", "pypi", "osv"],
|
|
114
123
|
default="pypa",
|
|
115
|
-
help="Vulnerability data source
|
|
124
|
+
help="Vulnerability data source [default: pypa] [possible values: pypa, pypi, osv]",
|
|
116
125
|
)
|
|
117
126
|
parser.add_argument(
|
|
118
127
|
"--resolver",
|
|
119
128
|
choices=["uv", "pip-tools"],
|
|
120
129
|
default="uv",
|
|
121
|
-
help="Dependency resolver for requirements.txt files
|
|
130
|
+
help="Dependency resolver for requirements.txt files [default: uv] [possible values: uv, pip-tools]",
|
|
122
131
|
)
|
|
123
132
|
parser.add_argument(
|
|
124
133
|
"--requirements-files",
|
|
@@ -127,16 +136,27 @@ def main():
|
|
|
127
136
|
help="Specific requirements files to audit (disables auto-discovery)",
|
|
128
137
|
)
|
|
129
138
|
parser.add_argument(
|
|
130
|
-
"
|
|
139
|
+
"-v", "--verbose", action="store_true", help="Enable verbose output"
|
|
131
140
|
)
|
|
132
141
|
parser.add_argument(
|
|
133
|
-
"
|
|
142
|
+
"-q", "--quiet", action="store_true", help="Suppress non-error output"
|
|
134
143
|
)
|
|
135
144
|
|
|
145
|
+
# Add custom help text for commands
|
|
146
|
+
parser.epilog = """
|
|
147
|
+
Commands:
|
|
148
|
+
resolvers Check available dependency resolvers
|
|
149
|
+
check-version Check if a newer version is available
|
|
150
|
+
help Print this message or the help of the given subcommand(s)
|
|
151
|
+
"""
|
|
152
|
+
|
|
136
153
|
args = parser.parse_args()
|
|
137
154
|
|
|
138
155
|
try:
|
|
139
|
-
# Main audit functionality
|
|
156
|
+
# Main audit functionality - convert --all to dev/optional
|
|
157
|
+
dev = args.all
|
|
158
|
+
optional = args.all
|
|
159
|
+
|
|
140
160
|
result = audit_with_options(
|
|
141
161
|
path=args.path,
|
|
142
162
|
format=args.format,
|
|
@@ -144,8 +164,8 @@ def main():
|
|
|
144
164
|
min_severity=args.severity,
|
|
145
165
|
ignore_ids=args.ignore_ids,
|
|
146
166
|
output=args.output,
|
|
147
|
-
dev=
|
|
148
|
-
optional=
|
|
167
|
+
dev=dev,
|
|
168
|
+
optional=optional,
|
|
149
169
|
direct_only=args.direct_only,
|
|
150
170
|
no_cache=args.no_cache,
|
|
151
171
|
cache_dir=args.cache_dir,
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pysentry-rs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -32,11 +32,11 @@ A fast, reliable security vulnerability scanner for Python projects, written in
|
|
|
32
32
|
|
|
33
33
|
## Overview
|
|
34
34
|
|
|
35
|
-
PySentry audits Python projects for known security vulnerabilities by analyzing dependency files (`uv.lock`, `pyproject.toml`, `requirements.txt`) and cross-referencing them against multiple vulnerability databases. It provides comprehensive reporting with support for various output formats and filtering options.
|
|
35
|
+
PySentry audits Python projects for known security vulnerabilities by analyzing dependency files (`uv.lock`, `poetry.lock`, `pyproject.toml`, `requirements.txt`) and cross-referencing them against multiple vulnerability databases. It provides comprehensive reporting with support for various output formats and filtering options.
|
|
36
36
|
|
|
37
37
|
## Key Features
|
|
38
38
|
|
|
39
|
-
- **Multiple Project Formats**: Supports `uv.lock`, `pyproject.toml`, and `requirements.txt` files
|
|
39
|
+
- **Multiple Project Formats**: Supports `uv.lock`, `poetry.lock`, `pyproject.toml`, and `requirements.txt` files
|
|
40
40
|
- **External Resolver Integration**: Leverages `uv` and `pip-tools` for accurate requirements.txt constraint solving
|
|
41
41
|
- **Multiple Data Sources**:
|
|
42
42
|
- PyPA Advisory Database (default)
|
|
@@ -49,7 +49,7 @@ PySentry audits Python projects for known security vulnerabilities by analyzing
|
|
|
49
49
|
- Intelligent caching system
|
|
50
50
|
- **Comprehensive Filtering**:
|
|
51
51
|
- Severity levels (low, medium, high, critical)
|
|
52
|
-
- Dependency
|
|
52
|
+
- Dependency scopes (main only vs all [optional, dev, prod, etc] dependencies)
|
|
53
53
|
- Direct vs. transitive dependencies
|
|
54
54
|
- **Enterprise Ready**: SARIF output for IDE/CI integration
|
|
55
55
|
|
|
@@ -174,7 +174,7 @@ pip install pip-tools
|
|
|
174
174
|
```
|
|
175
175
|
- Alternatively, install resolvers globally for system-wide availability
|
|
176
176
|
|
|
177
|
-
**Auto-detection:** PySentry automatically detects and prefers: `uv` > `pip-tools`. Without a resolver, only `uv.lock` and `
|
|
177
|
+
**Auto-detection:** PySentry automatically detects and prefers: `uv` > `pip-tools`. Without a resolver, only `uv.lock` and `poetry.lock` files can be scanned.
|
|
178
178
|
|
|
179
179
|
## Quick Start
|
|
180
180
|
|
|
@@ -189,15 +189,15 @@ uvx pysentry-rs /path/to/python/project
|
|
|
189
189
|
pysentry
|
|
190
190
|
pysentry /path/to/python/project
|
|
191
191
|
|
|
192
|
-
#
|
|
192
|
+
# Automatically detects project type (uv.lock, poetry.lock, pyproject.toml, requirements.txt)
|
|
193
193
|
pysentry /path/to/project
|
|
194
194
|
|
|
195
195
|
# Force specific resolver
|
|
196
196
|
pysentry --resolver uv /path/to/project
|
|
197
197
|
pysentry --resolver pip-tools /path/to/project
|
|
198
198
|
|
|
199
|
-
# Include
|
|
200
|
-
pysentry --
|
|
199
|
+
# Include all dependencies (main + dev + optional)
|
|
200
|
+
pysentry --all
|
|
201
201
|
|
|
202
202
|
# Filter by severity (only show high and critical)
|
|
203
203
|
pysentry --severity high
|
|
@@ -210,13 +210,13 @@ pysentry --format json --output audit-results.json
|
|
|
210
210
|
|
|
211
211
|
```bash
|
|
212
212
|
# Using uvx for comprehensive audit
|
|
213
|
-
uvx pysentry-rs --
|
|
213
|
+
uvx pysentry-rs --all --format sarif --output security-report.sarif
|
|
214
214
|
|
|
215
215
|
# Check only direct dependencies using OSV database
|
|
216
216
|
uvx pysentry-rs --direct-only --source osv
|
|
217
217
|
|
|
218
218
|
# Or with installed binary
|
|
219
|
-
pysentry --
|
|
219
|
+
pysentry --all --format sarif --output security-report.sarif
|
|
220
220
|
pysentry --direct-only --source osv
|
|
221
221
|
|
|
222
222
|
# Ignore specific vulnerabilities
|
|
@@ -255,8 +255,7 @@ pysentry --verbose --resolver uv /path/to/project
|
|
|
255
255
|
| `--format` | Output format: `human`, `json`, `sarif` | `human` |
|
|
256
256
|
| `--severity` | Minimum severity: `low`, `medium`, `high`, `critical` | `low` |
|
|
257
257
|
| `--source` | Vulnerability source: `pypa`, `pypi`, `osv` | `pypa` |
|
|
258
|
-
| `--
|
|
259
|
-
| `--optional` | Include optional dependencies | `false` |
|
|
258
|
+
| `--all` | Include all dependencies (main + dev + optional) | `false` |
|
|
260
259
|
| `--direct-only` | Check only direct dependencies | `false` |
|
|
261
260
|
| `--ignore` | Vulnerability IDs to ignore (repeatable) | `[]` |
|
|
262
261
|
| `--output` | Output file path | `stdout` |
|
|
@@ -293,6 +292,23 @@ PySentry has support for `uv.lock` files:
|
|
|
293
292
|
- Source tracking
|
|
294
293
|
- Dependency classification (main, dev, optional) including transitive dependencies
|
|
295
294
|
|
|
295
|
+
### poetry.lock Files
|
|
296
|
+
|
|
297
|
+
Full support for Poetry lock files:
|
|
298
|
+
|
|
299
|
+
- **Exact Version Resolution**: Scans exact dependency versions locked by Poetry
|
|
300
|
+
- **Lock-File Only Analysis**: Relies purely on the lock file structure, no pyproject.toml parsing needed
|
|
301
|
+
- **Complete Dependency Tree**: Analyzes all resolved dependencies including transitive ones
|
|
302
|
+
- **Dependency Classification**: Distinguishes between main dependencies and optional groups (dev, test, etc.)
|
|
303
|
+
- **Source Tracking**: Supports PyPI registry, Git repositories, local paths, and direct URLs
|
|
304
|
+
|
|
305
|
+
**Key Features:**
|
|
306
|
+
|
|
307
|
+
- No external tools required
|
|
308
|
+
- Fast parsing with exact version information
|
|
309
|
+
- Handles Poetry's dependency groups and optional dependencies
|
|
310
|
+
- Perfect for Poetry-managed projects with established lock files
|
|
311
|
+
|
|
296
312
|
### requirements.txt Files (External Resolution)
|
|
297
313
|
|
|
298
314
|
Advanced support for `requirements.txt` files using external dependency resolvers:
|
|
@@ -447,7 +463,7 @@ src/
|
|
|
447
463
|
|
|
448
464
|
```bash
|
|
449
465
|
# Ensure you're in a Python project directory
|
|
450
|
-
ls pyproject.toml uv.lock requirements.txt
|
|
466
|
+
ls pyproject.toml uv.lock poetry.lock requirements.txt
|
|
451
467
|
|
|
452
468
|
# Or specify the path explicitly
|
|
453
469
|
pysentry /path/to/python/project
|
|
@@ -524,7 +540,7 @@ pysentry /path/to/python/project
|
|
|
524
540
|
pysentry --requirements requirements-dev.txt --requirements requirements-test.txt
|
|
525
541
|
|
|
526
542
|
# Check if higher-priority files exist (they take precedence)
|
|
527
|
-
ls uv.lock pyproject.toml
|
|
543
|
+
ls uv.lock poetry.lock pyproject.toml
|
|
528
544
|
```
|
|
529
545
|
|
|
530
546
|
**Performance Issues**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pysentry/__init__.py,sha256=kDa2q8nWFR120mhgRaTBxmI8Yxf26tsE5Pdk8tg35VI,5898
|
|
2
|
+
pysentry/__main__.py,sha256=FJdFFQuSE8TYsZtY_vb00oCE2nvq9hB6MhMLBxnn7Ns,117
|
|
3
|
+
pysentry/_internal.cpython-39-darwin.so,sha256=sCj8gF1QnV1kI7r01L6Nqc2cI8NFijx5nd4NaiFYIfk,6240928
|
|
4
|
+
pysentry_rs-0.2.0.dist-info/METADATA,sha256=JAISzKEXYsg9sS29nTxu1NwyVZVZp1_vCKpxdQ2jLhE,17816
|
|
5
|
+
pysentry_rs-0.2.0.dist-info/WHEEL,sha256=XNDUDUieSorG-Y7wZ8qiKEUDK0umKv3PscUlyjQeFKE,102
|
|
6
|
+
pysentry_rs-0.2.0.dist-info/entry_points.txt,sha256=3bJguekVEbXTn-ceDCWJaSIZScquPPP1Ux9TPVHHanE,44
|
|
7
|
+
pysentry_rs-0.2.0.dist-info/licenses/LICENSE,sha256=TAMtDCoJuavXz7pCEklrzjH55sdvsy5gKsXY9NsImwY,34878
|
|
8
|
+
pysentry_rs-0.2.0.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pysentry/__init__.py,sha256=t1lvpozrRrRipRHMSTK28BcMgkCXJNhpGVwi0GkjY8c,5089
|
|
2
|
-
pysentry/__main__.py,sha256=FJdFFQuSE8TYsZtY_vb00oCE2nvq9hB6MhMLBxnn7Ns,117
|
|
3
|
-
pysentry/_internal.cpython-39-darwin.so,sha256=XQwsz9kuj1ggKF3RQdDkTyEQqpfbhSC2Xzt_CQ2CSSA,6156016
|
|
4
|
-
pysentry_rs-0.1.5.dist-info/METADATA,sha256=VVt36MRhL3evoIIFKxL0Cw-TVNwyLQO_QMx0URpGGJc,17030
|
|
5
|
-
pysentry_rs-0.1.5.dist-info/WHEEL,sha256=XNDUDUieSorG-Y7wZ8qiKEUDK0umKv3PscUlyjQeFKE,102
|
|
6
|
-
pysentry_rs-0.1.5.dist-info/entry_points.txt,sha256=3bJguekVEbXTn-ceDCWJaSIZScquPPP1Ux9TPVHHanE,44
|
|
7
|
-
pysentry_rs-0.1.5.dist-info/licenses/LICENSE,sha256=TAMtDCoJuavXz7pCEklrzjH55sdvsy5gKsXY9NsImwY,34878
|
|
8
|
-
pysentry_rs-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|