pysentry-rs 0.1.3__cp310-cp310-macosx_11_0_arm64.whl → 0.1.4__cp310-cp310-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 +124 -23
- pysentry/__main__.py +1 -1
- pysentry/_internal.cpython-310-darwin.so +0 -0
- {pysentry_rs-0.1.3.dist-info → pysentry_rs-0.1.4.dist-info}/METADATA +89 -10
- pysentry_rs-0.1.4.dist-info/RECORD +8 -0
- pysentry_rs-0.1.3.dist-info/RECORD +0 -8
- {pysentry_rs-0.1.3.dist-info → pysentry_rs-0.1.4.dist-info}/WHEEL +0 -0
- {pysentry_rs-0.1.3.dist-info → pysentry_rs-0.1.4.dist-info}/entry_points.txt +0 -0
- {pysentry_rs-0.1.3.dist-info → pysentry_rs-0.1.4.dist-info}/licenses/LICENSE +0 -0
pysentry/__init__.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""pysentry: Security vulnerability auditing tool for Python packages."""
|
|
2
2
|
|
|
3
|
-
from ._internal import audit_python, audit_with_options
|
|
3
|
+
from ._internal import audit_python, audit_with_options, check_resolvers, check_version
|
|
4
4
|
|
|
5
|
-
__version__ = "0.1.
|
|
6
|
-
__all__ = ["audit_python", "audit_with_options", "main"]
|
|
5
|
+
__version__ = "0.1.4"
|
|
6
|
+
__all__ = ["audit_python", "audit_with_options", "check_resolvers", "check_version", "main"]
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def main():
|
|
@@ -11,46 +11,147 @@ def main():
|
|
|
11
11
|
import sys
|
|
12
12
|
import argparse
|
|
13
13
|
|
|
14
|
+
# Handle the case where first argument is 'resolvers'
|
|
15
|
+
if len(sys.argv) > 1 and sys.argv[1] == "resolvers":
|
|
16
|
+
# Parse resolvers subcommand
|
|
17
|
+
parser = argparse.ArgumentParser(
|
|
18
|
+
prog="pysentry-rs resolvers",
|
|
19
|
+
description="Check available dependency resolvers",
|
|
20
|
+
)
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"--verbose", "-v", action="store_true", help="Enable verbose output"
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# Remove 'resolvers' from args and parse the rest
|
|
26
|
+
args = parser.parse_args(sys.argv[2:])
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
result = check_resolvers(args.verbose)
|
|
30
|
+
print(result)
|
|
31
|
+
except Exception as e:
|
|
32
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
33
|
+
sys.exit(1)
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
# Handle the case where first argument is 'check-version'
|
|
37
|
+
if len(sys.argv) > 1 and sys.argv[1] == "check-version":
|
|
38
|
+
# Parse check-version subcommand
|
|
39
|
+
parser = argparse.ArgumentParser(
|
|
40
|
+
prog="pysentry-rs check-version",
|
|
41
|
+
description="Check if a newer version is available",
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"--verbose", "-v", action="store_true", help="Enable verbose output"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Remove 'check-version' from args and parse the rest
|
|
48
|
+
args = parser.parse_args(sys.argv[2:])
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
result = check_version(args.verbose)
|
|
52
|
+
print(result)
|
|
53
|
+
except Exception as e:
|
|
54
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
55
|
+
sys.exit(1)
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
# Default audit command parser
|
|
14
59
|
parser = argparse.ArgumentParser(
|
|
15
|
-
prog="pysentry-rs",
|
|
60
|
+
prog="pysentry-rs",
|
|
61
|
+
description="Security vulnerability auditing for Python packages",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
parser.add_argument(
|
|
65
|
+
"path",
|
|
66
|
+
nargs="?",
|
|
67
|
+
default=".",
|
|
68
|
+
help="Path to the project directory to audit (default: current directory)",
|
|
16
69
|
)
|
|
17
|
-
parser.add_argument("path", help="Path to Python project")
|
|
18
70
|
parser.add_argument(
|
|
19
71
|
"--format",
|
|
20
72
|
choices=["human", "json", "sarif"],
|
|
21
73
|
default="human",
|
|
22
|
-
help="Output format",
|
|
74
|
+
help="Output format (default: human)",
|
|
23
75
|
)
|
|
24
76
|
parser.add_argument(
|
|
25
|
-
"--
|
|
26
|
-
choices=["pypa", "pypi", "osv"],
|
|
27
|
-
default="pypa",
|
|
28
|
-
help="Vulnerability data source",
|
|
29
|
-
)
|
|
30
|
-
parser.add_argument(
|
|
31
|
-
"--min-severity",
|
|
77
|
+
"--severity",
|
|
32
78
|
choices=["low", "medium", "high", "critical"],
|
|
33
79
|
default="low",
|
|
34
|
-
help="Minimum severity level",
|
|
80
|
+
help="Minimum severity level to report (default: low)",
|
|
35
81
|
)
|
|
36
82
|
parser.add_argument(
|
|
37
83
|
"--ignore",
|
|
38
84
|
action="append",
|
|
39
85
|
dest="ignore_ids",
|
|
40
|
-
|
|
86
|
+
metavar="ID",
|
|
87
|
+
help="Vulnerability IDs to ignore (can be specified multiple times)",
|
|
88
|
+
)
|
|
89
|
+
parser.add_argument(
|
|
90
|
+
"--output", "-o", metavar="FILE", help="Output file path (defaults to stdout)"
|
|
91
|
+
)
|
|
92
|
+
parser.add_argument(
|
|
93
|
+
"--dev", action="store_true", help="Include development dependencies"
|
|
94
|
+
)
|
|
95
|
+
parser.add_argument(
|
|
96
|
+
"--optional", action="store_true", help="Include optional dependencies"
|
|
97
|
+
)
|
|
98
|
+
parser.add_argument(
|
|
99
|
+
"--direct-only",
|
|
100
|
+
action="store_true",
|
|
101
|
+
help="Only check direct dependencies (exclude transitive)",
|
|
102
|
+
)
|
|
103
|
+
parser.add_argument("--no-cache", action="store_true", help="Disable caching")
|
|
104
|
+
parser.add_argument("--cache-dir", metavar="DIR", help="Custom cache directory")
|
|
105
|
+
parser.add_argument(
|
|
106
|
+
"--source",
|
|
107
|
+
choices=["pypa", "pypi", "osv"],
|
|
108
|
+
default="pypa",
|
|
109
|
+
help="Vulnerability data source (default: pypa)",
|
|
110
|
+
)
|
|
111
|
+
parser.add_argument(
|
|
112
|
+
"--resolver",
|
|
113
|
+
choices=["uv", "pip-tools"],
|
|
114
|
+
default="uv",
|
|
115
|
+
help="Dependency resolver for requirements.txt files (default: uv)",
|
|
116
|
+
)
|
|
117
|
+
parser.add_argument(
|
|
118
|
+
"--requirements-files",
|
|
119
|
+
nargs="+",
|
|
120
|
+
metavar="FILE",
|
|
121
|
+
help="Specific requirements files to audit (disables auto-discovery)",
|
|
122
|
+
)
|
|
123
|
+
parser.add_argument(
|
|
124
|
+
"--verbose", "-v", action="store_true", help="Enable verbose output"
|
|
125
|
+
)
|
|
126
|
+
parser.add_argument(
|
|
127
|
+
"--quiet", "-q", action="store_true", help="Suppress non-error output"
|
|
41
128
|
)
|
|
42
129
|
|
|
43
130
|
args = parser.parse_args()
|
|
44
131
|
|
|
45
132
|
try:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
133
|
+
# Main audit functionality
|
|
134
|
+
result = audit_with_options(
|
|
135
|
+
path=args.path,
|
|
136
|
+
format=args.format,
|
|
137
|
+
source=args.source,
|
|
138
|
+
min_severity=args.severity,
|
|
139
|
+
ignore_ids=args.ignore_ids,
|
|
140
|
+
output=args.output,
|
|
141
|
+
dev=args.dev,
|
|
142
|
+
optional=args.optional,
|
|
143
|
+
direct_only=args.direct_only,
|
|
144
|
+
no_cache=args.no_cache,
|
|
145
|
+
cache_dir=args.cache_dir,
|
|
146
|
+
resolver=args.resolver,
|
|
147
|
+
requirements_files=args.requirements_files,
|
|
148
|
+
verbose=args.verbose,
|
|
149
|
+
quiet=args.quiet,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
if not args.output:
|
|
153
|
+
print(result)
|
|
154
|
+
|
|
54
155
|
except Exception as e:
|
|
55
156
|
print(f"Error: {e}", file=sys.stderr)
|
|
56
157
|
sys.exit(1)
|
pysentry/__main__.py
CHANGED
|
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.4
|
|
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)
|
|
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
15
|
Classifier: Topic :: Security
|
|
15
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
17
|
License-File: LICENSE
|
|
@@ -51,7 +52,65 @@ PySentry audits Python projects for known security vulnerabilities by analyzing
|
|
|
51
52
|
|
|
52
53
|
## Installation
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
Choose the installation method that works best for you:
|
|
56
|
+
|
|
57
|
+
### ⚡ Via uvx (Recommended for occasional use)
|
|
58
|
+
|
|
59
|
+
Run directly without installing (requires [uv](https://docs.astral.sh/uv/)):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uvx pysentry-rs /path/to/project
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This method:
|
|
66
|
+
|
|
67
|
+
- Runs the latest version without installation
|
|
68
|
+
- Automatically manages Python environment
|
|
69
|
+
- Perfect for CI/CD or occasional security audits
|
|
70
|
+
- No need to manage package versions or updates
|
|
71
|
+
|
|
72
|
+
### 📦 From PyPI (Python Package)
|
|
73
|
+
|
|
74
|
+
For Python 3.8+ on Linux and macOS:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install pysentry-rs
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then use it with Python:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
python -m pysentry /path/to/project
|
|
84
|
+
# or directly if scripts are in PATH
|
|
85
|
+
pysentry-rs /path/to/project
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### ⚡ From Crates.io (Rust Package)
|
|
89
|
+
|
|
90
|
+
If you have Rust installed:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cargo install pysentry
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 💾 From GitHub Releases (Pre-built Binaries)
|
|
97
|
+
|
|
98
|
+
Download the latest release for your platform:
|
|
99
|
+
|
|
100
|
+
- **Linux x64**: `pysentry-linux-x64.tar.gz`
|
|
101
|
+
- **Linux x64 (musl)**: `pysentry-linux-x64-musl.tar.gz`
|
|
102
|
+
- **Linux ARM64**: `pysentry-linux-arm64.tar.gz`
|
|
103
|
+
- **macOS x64**: `pysentry-macos-x64.tar.gz`
|
|
104
|
+
- **macOS ARM64**: `pysentry-macos-arm64.tar.gz`
|
|
105
|
+
- **Windows x64**: `pysentry-windows-x64.zip`
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Example for Linux x64
|
|
109
|
+
curl -L https://github.com/nyudenkov/pysentry/releases/latest/download/pysentry-linux-x64.tar.gz | tar -xz
|
|
110
|
+
./pysentry-linux-x64/pysentry --help
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 🔧 From Source
|
|
55
114
|
|
|
56
115
|
```bash
|
|
57
116
|
git clone https://github.com/nyudenkov/pysentry
|
|
@@ -61,20 +120,36 @@ cargo build --release
|
|
|
61
120
|
|
|
62
121
|
The binary will be available at `target/release/pysentry`.
|
|
63
122
|
|
|
64
|
-
###
|
|
123
|
+
### Requirements
|
|
124
|
+
|
|
125
|
+
- **For uvx**: Python 3.8+ and [uv](https://docs.astral.sh/uv/) installed (Linux/macOS only)
|
|
126
|
+
- **For binaries**: No additional dependencies
|
|
127
|
+
- **For Python package**: Python 3.8+ (Linux/macOS only)
|
|
128
|
+
- **For Rust package and source**: Rust 1.79+
|
|
129
|
+
|
|
130
|
+
### Platform Support
|
|
65
131
|
|
|
66
|
-
|
|
67
|
-
|
|
132
|
+
| Installation Method | Linux | macOS | Windows |
|
|
133
|
+
| ------------------- | ----- | ----- | ------- |
|
|
134
|
+
| uvx | ✅ | ✅ | ❌ |
|
|
135
|
+
| PyPI (pip) | ✅ | ✅ | ❌ |
|
|
136
|
+
| Crates.io (cargo) | ✅ | ✅ | ✅ |
|
|
137
|
+
| GitHub Releases | ✅ | ✅ | ✅ |
|
|
138
|
+
| From Source | ✅ | ✅ | ✅ |
|
|
139
|
+
|
|
140
|
+
**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.
|
|
68
141
|
|
|
69
142
|
## Quick Start
|
|
70
143
|
|
|
71
144
|
### Basic Usage
|
|
72
145
|
|
|
73
146
|
```bash
|
|
74
|
-
#
|
|
75
|
-
pysentry
|
|
147
|
+
# Using uvx (recommended for occasional use)
|
|
148
|
+
uvx pysentry-rs
|
|
149
|
+
uvx pysentry-rs /path/to/python/project
|
|
76
150
|
|
|
77
|
-
#
|
|
151
|
+
# Using installed binary
|
|
152
|
+
pysentry
|
|
78
153
|
pysentry /path/to/python/project
|
|
79
154
|
|
|
80
155
|
# Include development dependencies
|
|
@@ -90,10 +165,14 @@ pysentry --format json --output audit-results.json
|
|
|
90
165
|
### Advanced Usage
|
|
91
166
|
|
|
92
167
|
```bash
|
|
93
|
-
#
|
|
94
|
-
pysentry --dev --optional --format sarif --output security-report.sarif
|
|
168
|
+
# Using uvx for comprehensive audit
|
|
169
|
+
uvx pysentry-rs --dev --optional --format sarif --output security-report.sarif
|
|
95
170
|
|
|
96
171
|
# Check only direct dependencies using OSV database
|
|
172
|
+
uvx pysentry-rs --direct-only --source osv
|
|
173
|
+
|
|
174
|
+
# Or with installed binary
|
|
175
|
+
pysentry --dev --optional --format sarif --output security-report.sarif
|
|
97
176
|
pysentry --direct-only --source osv
|
|
98
177
|
|
|
99
178
|
# Ignore specific vulnerabilities
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pysentry/__init__.py,sha256=TcB6vZ9qN_6fa0HZnuiNiv7VQKwf6jA-kUdWP4ZSwho,5066
|
|
2
|
+
pysentry/__main__.py,sha256=FJdFFQuSE8TYsZtY_vb00oCE2nvq9hB6MhMLBxnn7Ns,117
|
|
3
|
+
pysentry/_internal.cpython-310-darwin.so,sha256=0ybE6f2mHFS7DVeljUu3EFx62mSRi6xe-tv8Tj2aJ6g,6137840
|
|
4
|
+
pysentry_rs-0.1.4.dist-info/METADATA,sha256=vl4tTeCjqbM0zh8h-6Z1lfdwVmVfme57xTyeIqrhP20,10992
|
|
5
|
+
pysentry_rs-0.1.4.dist-info/WHEEL,sha256=XiGjjeJC2k7oCSYs1QNLi9iFDhofhstbUV6w7vMmp_k,104
|
|
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,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pysentry/__init__.py,sha256=XweE7o45pHx2rmO523WkjFJFEjGDwwESMQtXQFZ2d6k,1633
|
|
2
|
-
pysentry/__main__.py,sha256=yzx36hW8FIWKDCOkP409c8wIXnK-A5tIRMw86eueJ_Q,116
|
|
3
|
-
pysentry/_internal.cpython-310-darwin.so,sha256=rRXuTQizg_0CTMKtZQovhOIUEMyW_J3oC1Re7-xdxhk,5695376
|
|
4
|
-
pysentry_rs-0.1.3.dist-info/METADATA,sha256=Wpgd9n5P8ZJa8jO_0Ry9O1eiUF1-pJDplZndnc5SHg4,8644
|
|
5
|
-
pysentry_rs-0.1.3.dist-info/WHEEL,sha256=XiGjjeJC2k7oCSYs1QNLi9iFDhofhstbUV6w7vMmp_k,104
|
|
6
|
-
pysentry_rs-0.1.3.dist-info/entry_points.txt,sha256=3bJguekVEbXTn-ceDCWJaSIZScquPPP1Ux9TPVHHanE,44
|
|
7
|
-
pysentry_rs-0.1.3.dist-info/licenses/LICENSE,sha256=TAMtDCoJuavXz7pCEklrzjH55sdvsy5gKsXY9NsImwY,34878
|
|
8
|
-
pysentry_rs-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|