pysentry-rs 0.1.4__cp38-cp38-macosx_11_0_arm64.whl → 0.1.5__cp38-cp38-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 +8 -2
- pysentry/_internal.cpython-38-darwin.so +0 -0
- {pysentry_rs-0.1.4.dist-info → pysentry_rs-0.1.5.dist-info}/METADATA +193 -23
- pysentry_rs-0.1.5.dist-info/RECORD +8 -0
- pysentry_rs-0.1.4.dist-info/RECORD +0 -8
- {pysentry_rs-0.1.4.dist-info → pysentry_rs-0.1.5.dist-info}/WHEEL +0 -0
- {pysentry_rs-0.1.4.dist-info → pysentry_rs-0.1.5.dist-info}/entry_points.txt +0 -0
- {pysentry_rs-0.1.4.dist-info → pysentry_rs-0.1.5.dist-info}/licenses/LICENSE +0 -0
pysentry/__init__.py
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from ._internal import audit_python, audit_with_options, check_resolvers, check_version
|
|
4
4
|
|
|
5
|
-
__version__ = "0.1.
|
|
6
|
-
__all__ = [
|
|
5
|
+
__version__ = "0.1.5"
|
|
6
|
+
__all__ = [
|
|
7
|
+
"audit_python",
|
|
8
|
+
"audit_with_options",
|
|
9
|
+
"check_resolvers",
|
|
10
|
+
"check_version",
|
|
11
|
+
"main",
|
|
12
|
+
]
|
|
7
13
|
|
|
8
14
|
|
|
9
15
|
def main():
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pysentry-rs
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
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)
|
|
@@ -26,15 +26,18 @@ Project-URL: Issues, https://github.com/nyudenkov/pysentry/issues
|
|
|
26
26
|
|
|
27
27
|
# 🐍 PySentry
|
|
28
28
|
|
|
29
|
+
[Help to test and improve](https://github.com/nyudenkov/pysentry/issues/12)
|
|
30
|
+
|
|
29
31
|
A fast, reliable security vulnerability scanner for Python projects, written in Rust.
|
|
30
32
|
|
|
31
33
|
## Overview
|
|
32
34
|
|
|
33
|
-
PySentry audits Python projects for known security vulnerabilities by analyzing dependency files (`uv.lock`, `pyproject.toml`) 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`, `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.
|
|
34
36
|
|
|
35
37
|
## Key Features
|
|
36
38
|
|
|
37
|
-
- **Multiple Project Formats**: Supports
|
|
39
|
+
- **Multiple Project Formats**: Supports `uv.lock`, `pyproject.toml`, and `requirements.txt` files
|
|
40
|
+
- **External Resolver Integration**: Leverages `uv` and `pip-tools` for accurate requirements.txt constraint solving
|
|
38
41
|
- **Multiple Data Sources**:
|
|
39
42
|
- PyPA Advisory Database (default)
|
|
40
43
|
- PyPI JSON API
|
|
@@ -139,6 +142,40 @@ The binary will be available at `target/release/pysentry`.
|
|
|
139
142
|
|
|
140
143
|
**Note**: Windows Python wheels are not available due to compilation complexity. Windows users should use the pre-built binary from GitHub releases, install via cargo and build from source.
|
|
141
144
|
|
|
145
|
+
### CLI Command Names
|
|
146
|
+
|
|
147
|
+
- **Rust binary**: `pysentry` (when installed via cargo or binary releases)
|
|
148
|
+
- **Python package**: `pysentry-rs` (when installed via pip or uvx)
|
|
149
|
+
|
|
150
|
+
Both variants support identical functionality. The resolver tools (`uv`, `pip-tools`) must be available in your current environment regardless of which PySentry variant you use.
|
|
151
|
+
|
|
152
|
+
### Requirements.txt Support Prerequisites
|
|
153
|
+
|
|
154
|
+
To scan `requirements.txt` files, PySentry requires an external dependency resolver to convert version constraints (e.g., `flask>=2.0,<3.0`) into exact versions for vulnerability scanning.
|
|
155
|
+
|
|
156
|
+
**Install a supported resolver:**
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# uv (recommended - fastest, Rust-based)
|
|
160
|
+
pip install uv
|
|
161
|
+
|
|
162
|
+
# pip-tools (widely compatible, Python-based)
|
|
163
|
+
pip install pip-tools
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Environment Requirements:**
|
|
167
|
+
|
|
168
|
+
- Resolvers must be available in your current environment
|
|
169
|
+
- If using virtual environments, activate your venv before running PySentry:
|
|
170
|
+
```bash
|
|
171
|
+
source venv/bin/activate # Linux/macOS
|
|
172
|
+
venv\Scripts\activate # Windows
|
|
173
|
+
pysentry /path/to/project
|
|
174
|
+
```
|
|
175
|
+
- Alternatively, install resolvers globally for system-wide availability
|
|
176
|
+
|
|
177
|
+
**Auto-detection:** PySentry automatically detects and prefers: `uv` > `pip-tools`. Without a resolver, only `uv.lock` and `pyproject.toml` files can be scanned.
|
|
178
|
+
|
|
142
179
|
## Quick Start
|
|
143
180
|
|
|
144
181
|
### Basic Usage
|
|
@@ -152,6 +189,13 @@ uvx pysentry-rs /path/to/python/project
|
|
|
152
189
|
pysentry
|
|
153
190
|
pysentry /path/to/python/project
|
|
154
191
|
|
|
192
|
+
# Scan requirements.txt (auto-detects resolver)
|
|
193
|
+
pysentry /path/to/project
|
|
194
|
+
|
|
195
|
+
# Force specific resolver
|
|
196
|
+
pysentry --resolver uv /path/to/project
|
|
197
|
+
pysentry --resolver pip-tools /path/to/project
|
|
198
|
+
|
|
155
199
|
# Include development dependencies
|
|
156
200
|
pysentry --dev
|
|
157
201
|
|
|
@@ -185,24 +229,43 @@ pysentry --no-cache
|
|
|
185
229
|
pysentry --verbose
|
|
186
230
|
```
|
|
187
231
|
|
|
232
|
+
### Advanced Requirements.txt Usage
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Scan multiple requirements files
|
|
236
|
+
pysentry --requirements requirements.txt --requirements requirements-dev.txt
|
|
237
|
+
|
|
238
|
+
# Check only direct dependencies from requirements.txt
|
|
239
|
+
pysentry --direct-only --resolver uv
|
|
240
|
+
|
|
241
|
+
# Ensure resolver is available in your environment
|
|
242
|
+
source venv/bin/activate # Activate your virtual environment first
|
|
243
|
+
pysentry /path/to/project
|
|
244
|
+
|
|
245
|
+
# Debug requirements.txt resolution
|
|
246
|
+
pysentry --verbose --resolver uv /path/to/project
|
|
247
|
+
```
|
|
248
|
+
|
|
188
249
|
## Configuration
|
|
189
250
|
|
|
190
251
|
### Command Line Options
|
|
191
252
|
|
|
192
|
-
| Option
|
|
193
|
-
|
|
|
194
|
-
| `--format`
|
|
195
|
-
| `--severity`
|
|
196
|
-
| `--source`
|
|
197
|
-
| `--dev`
|
|
198
|
-
| `--optional`
|
|
199
|
-
| `--direct-only`
|
|
200
|
-
| `--ignore`
|
|
201
|
-
| `--output`
|
|
202
|
-
| `--no-cache`
|
|
203
|
-
| `--cache-dir`
|
|
204
|
-
| `--verbose`
|
|
205
|
-
| `--quiet`
|
|
253
|
+
| Option | Description | Default |
|
|
254
|
+
| ---------------- | ----------------------------------------------------- | ------------------- |
|
|
255
|
+
| `--format` | Output format: `human`, `json`, `sarif` | `human` |
|
|
256
|
+
| `--severity` | Minimum severity: `low`, `medium`, `high`, `critical` | `low` |
|
|
257
|
+
| `--source` | Vulnerability source: `pypa`, `pypi`, `osv` | `pypa` |
|
|
258
|
+
| `--dev` | Include development dependencies | `false` |
|
|
259
|
+
| `--optional` | Include optional dependencies | `false` |
|
|
260
|
+
| `--direct-only` | Check only direct dependencies | `false` |
|
|
261
|
+
| `--ignore` | Vulnerability IDs to ignore (repeatable) | `[]` |
|
|
262
|
+
| `--output` | Output file path | `stdout` |
|
|
263
|
+
| `--no-cache` | Disable caching | `false` |
|
|
264
|
+
| `--cache-dir` | Custom cache directory | `~/.cache/pysentry` |
|
|
265
|
+
| `--verbose` | Enable verbose output | `false` |
|
|
266
|
+
| `--quiet` | Suppress non-error output | `false` |
|
|
267
|
+
| `--resolver` | Dependency resolver: `auto`, `uv`, `pip-tools` | `auto` |
|
|
268
|
+
| `--requirements` | Additional requirements files (repeatable) | `[]` |
|
|
206
269
|
|
|
207
270
|
### Cache Management
|
|
208
271
|
|
|
@@ -223,19 +286,54 @@ rm -rf ~/.cache/pysentry/
|
|
|
223
286
|
|
|
224
287
|
### uv.lock Files (Recommended)
|
|
225
288
|
|
|
226
|
-
PySentry has support for `uv.lock` files
|
|
289
|
+
PySentry has support for `uv.lock` files:
|
|
227
290
|
|
|
228
291
|
- Exact version resolution
|
|
229
292
|
- Complete dependency graph analysis
|
|
230
293
|
- Source tracking
|
|
231
|
-
- Dependency classification (main, dev, optional) including
|
|
294
|
+
- Dependency classification (main, dev, optional) including transitive dependencies
|
|
295
|
+
|
|
296
|
+
### requirements.txt Files (External Resolution)
|
|
232
297
|
|
|
233
|
-
|
|
298
|
+
Advanced support for `requirements.txt` files using external dependency resolvers:
|
|
234
299
|
|
|
235
|
-
|
|
300
|
+
**Key Features:**
|
|
301
|
+
|
|
302
|
+
- **Dependencies Resolution**: Converts version constraints (e.g., `flask>=2.0,<3.0`) to exact versions using mature external tools
|
|
303
|
+
- **Multiple Resolver Support**:
|
|
304
|
+
- **uv**: Rust-based resolver, extremely fast and reliable (recommended)
|
|
305
|
+
- **pip-tools**: Python-based resolver using `pip-compile`, widely compatible
|
|
306
|
+
- **Auto-detection**: Automatically detects and uses the best available resolver in your environment
|
|
307
|
+
- **Multiple File Support**: Combines `requirements.txt`, `requirements-dev.txt`, `requirements-test.txt`, etc.
|
|
308
|
+
- **Dependency Classification**: Distinguishes between direct and transitive dependencies
|
|
309
|
+
- **Isolated Execution**: Resolvers run in temporary directories to prevent project pollution
|
|
310
|
+
- **Complex Constraint Handling**: Supports version ranges, extras, environment markers, and conflict resolution
|
|
311
|
+
|
|
312
|
+
**Resolution Workflow:**
|
|
313
|
+
|
|
314
|
+
1. Detects `requirements.txt` files in your project
|
|
315
|
+
2. Auto-detects available resolver (`uv` or `pip-tools`) in current environment
|
|
316
|
+
3. Resolves version constraints to exact dependency versions
|
|
317
|
+
4. Scans resolved dependencies for vulnerabilities
|
|
318
|
+
5. Reports findings with direct vs. transitive classification
|
|
319
|
+
|
|
320
|
+
**Environment Setup:**
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# Ensure resolver is available in your environment
|
|
324
|
+
source venv/bin/activate # Activate virtual environment
|
|
325
|
+
pip install uv # Install preferred resolver
|
|
326
|
+
pysentry /path/to/project # Run security scan
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### pyproject.toml Files (External Resolution)
|
|
330
|
+
|
|
331
|
+
Support for projects without lock files:
|
|
236
332
|
|
|
237
333
|
- Parses version constraints from `pyproject.toml`
|
|
238
|
-
-
|
|
334
|
+
- **Resolver Required**: Like requirements.txt, needs external resolvers (`uv` or `pip-tools`) to convert version constraints to exact versions for accurate vulnerability scanning
|
|
335
|
+
- Limited dependency graph information compared to lock files
|
|
336
|
+
- Works with both Poetry and PEP 621 formats
|
|
239
337
|
|
|
240
338
|
## Vulnerability Data Sources
|
|
241
339
|
|
|
@@ -294,6 +392,14 @@ PySentry is designed for speed and efficiency:
|
|
|
294
392
|
- **Efficient Matching**: In-memory indexing for fast vulnerability lookups
|
|
295
393
|
- **Streaming**: Large databases processed without excessive memory usage
|
|
296
394
|
|
|
395
|
+
### Requirements.txt Resolution Performance
|
|
396
|
+
|
|
397
|
+
PySentry leverages external resolvers for optimal performance:
|
|
398
|
+
|
|
399
|
+
- **uv resolver**: 2-10x faster than pip-tools, handles large dependency trees efficiently
|
|
400
|
+
- **pip-tools resolver**: Reliable fallback, slower but widely compatible
|
|
401
|
+
- **Isolated execution**: Prevents project pollution while maintaining security
|
|
402
|
+
|
|
297
403
|
### Benchmarks
|
|
298
404
|
|
|
299
405
|
Typical performance on a project with 100+ dependencies:
|
|
@@ -341,12 +447,47 @@ src/
|
|
|
341
447
|
|
|
342
448
|
```bash
|
|
343
449
|
# Ensure you're in a Python project directory
|
|
344
|
-
ls pyproject.toml uv.lock
|
|
450
|
+
ls pyproject.toml uv.lock requirements.txt
|
|
345
451
|
|
|
346
452
|
# Or specify the path explicitly
|
|
347
453
|
pysentry /path/to/python/project
|
|
348
454
|
```
|
|
349
455
|
|
|
456
|
+
**Error: "No dependency resolver found" or "uv resolver not available"**
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
# Install a supported resolver in your environment
|
|
460
|
+
pip install uv # Recommended - fastest
|
|
461
|
+
pip install pip-tools # Alternative
|
|
462
|
+
|
|
463
|
+
# Verify resolver is available
|
|
464
|
+
uv --version
|
|
465
|
+
pip-compile --version
|
|
466
|
+
|
|
467
|
+
# If using virtual environments, ensure resolver is installed there
|
|
468
|
+
source venv/bin/activate
|
|
469
|
+
pip install uv
|
|
470
|
+
pysentry /path/to/project
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Error: "Failed to resolve requirements"**
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
# Check your requirements.txt syntax
|
|
477
|
+
cat requirements.txt
|
|
478
|
+
|
|
479
|
+
# Try different resolver
|
|
480
|
+
pysentry --resolver pip-tools # if uv fails
|
|
481
|
+
pysentry --resolver uv # if pip-tools fails
|
|
482
|
+
|
|
483
|
+
# Ensure you're in correct environment
|
|
484
|
+
which python
|
|
485
|
+
which uv # or which pip-compile
|
|
486
|
+
|
|
487
|
+
# Debug with verbose output
|
|
488
|
+
pysentry --verbose /path/to/project
|
|
489
|
+
```
|
|
490
|
+
|
|
350
491
|
**Error: "Failed to fetch vulnerability data"**
|
|
351
492
|
|
|
352
493
|
```bash
|
|
@@ -357,6 +498,35 @@ curl -I https://osv-vulnerabilities.storage.googleapis.com/
|
|
|
357
498
|
pysentry --source pypi
|
|
358
499
|
```
|
|
359
500
|
|
|
501
|
+
**Slow requirements.txt resolution**
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
# Use faster uv resolver instead of pip-tools
|
|
505
|
+
pysentry --resolver uv
|
|
506
|
+
|
|
507
|
+
# Install uv for better performance (2-10x faster)
|
|
508
|
+
pip install uv
|
|
509
|
+
|
|
510
|
+
# Or use uvx for isolated execution
|
|
511
|
+
uvx pysentry-rs --resolver uv /path/to/project
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**Requirements.txt files not being detected**
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
# Ensure requirements.txt exists
|
|
518
|
+
ls requirements.txt
|
|
519
|
+
|
|
520
|
+
# Specify path explicitly
|
|
521
|
+
pysentry /path/to/python/project
|
|
522
|
+
|
|
523
|
+
# Include additional requirements files
|
|
524
|
+
pysentry --requirements requirements-dev.txt --requirements requirements-test.txt
|
|
525
|
+
|
|
526
|
+
# Check if higher-priority files exist (they take precedence)
|
|
527
|
+
ls uv.lock pyproject.toml
|
|
528
|
+
```
|
|
529
|
+
|
|
360
530
|
**Performance Issues**
|
|
361
531
|
|
|
362
532
|
```bash
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pysentry/__init__.py,sha256=t1lvpozrRrRipRHMSTK28BcMgkCXJNhpGVwi0GkjY8c,5089
|
|
2
|
+
pysentry/__main__.py,sha256=FJdFFQuSE8TYsZtY_vb00oCE2nvq9hB6MhMLBxnn7Ns,117
|
|
3
|
+
pysentry/_internal.cpython-38-darwin.so,sha256=yjYtLjIHdiB4bMFnoN7D5TAe7pmJMa_A5LuDFxJsFuc,6155840
|
|
4
|
+
pysentry_rs-0.1.5.dist-info/METADATA,sha256=VVt36MRhL3evoIIFKxL0Cw-TVNwyLQO_QMx0URpGGJc,17030
|
|
5
|
+
pysentry_rs-0.1.5.dist-info/WHEEL,sha256=uCxAYGR8mh7ybiMWkA6Fu-BNUURLCTLWDXY7SKDjVCA,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,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pysentry/__init__.py,sha256=TcB6vZ9qN_6fa0HZnuiNiv7VQKwf6jA-kUdWP4ZSwho,5066
|
|
2
|
-
pysentry/__main__.py,sha256=FJdFFQuSE8TYsZtY_vb00oCE2nvq9hB6MhMLBxnn7Ns,117
|
|
3
|
-
pysentry/_internal.cpython-38-darwin.so,sha256=LrT7IVNyvJDTOPBv1vSD0fKSSZW8gu5Sy1fMQP22SuQ,6137904
|
|
4
|
-
pysentry_rs-0.1.4.dist-info/METADATA,sha256=vl4tTeCjqbM0zh8h-6Z1lfdwVmVfme57xTyeIqrhP20,10992
|
|
5
|
-
pysentry_rs-0.1.4.dist-info/WHEEL,sha256=uCxAYGR8mh7ybiMWkA6Fu-BNUURLCTLWDXY7SKDjVCA,102
|
|
6
|
-
pysentry_rs-0.1.4.dist-info/entry_points.txt,sha256=3bJguekVEbXTn-ceDCWJaSIZScquPPP1Ux9TPVHHanE,44
|
|
7
|
-
pysentry_rs-0.1.4.dist-info/licenses/LICENSE,sha256=TAMtDCoJuavXz7pCEklrzjH55sdvsy5gKsXY9NsImwY,34878
|
|
8
|
-
pysentry_rs-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|