python-ubel 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ala Bouali
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-ubel
3
+ Version: 0.1.0
4
+ Summary: Supply-chain dependency firewall for: Python, Node, PHP, Ubuntu, Debian, Red Hat, and Almalinux.
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: requests
9
+ Requires-Dist: python-dotenv
10
+ Requires-Dist: cvss
11
+ Requires-Dist: reportlab
12
+ Requires-Dist: distro
13
+ Dynamic: license-file
14
+
15
+ # UBEL ( Unified Bill / Enforced Law ) – Multi‑Ecosystem Security & Policy Enforcement CLI
16
+
17
+ Ubel is a fast, cross‑ecosystem security engine that resolves dependencies, generates PURLs, scans them through OSV.dev, and enforces security policies during installation. It works with:
18
+
19
+ - **PyPI** (via `ubel-pip`)
20
+ - **npm** (via `ubel-npm`)
21
+ - **Linux distributions** (Ubuntu, Debian, RHEL, AlmaLinux)
22
+
23
+ Ubel runs in **CLI**, **automation scripts**, and **CI/CD pipelines**, producing clean **JSON** and **PDF** reports.
24
+
25
+ ---
26
+
27
+ ## ✨ Features
28
+ - Full dependency resolution across ecosystems
29
+ - OSV.dev vulnerability scanning (batch API)
30
+ - Policy engine (block/allow by severity & infection)
31
+ - Checking linux-package or node/python dependency or entire project (`check` mode)
32
+ - Install‑time enforcement (`install` mode)
33
+ - Project‑level/Host-level scanning (`health` mode)
34
+ - Catches Non-CVEs
35
+ - It is a supply-chain protection tool
36
+ - Automatic report generation (JSON + PDF)
37
+ - Extremely fast (seconds per scan)
38
+
39
+ ---
40
+
41
+ ## 📦 Installation
42
+ ```bash
43
+ pip install ubel
44
+ ```
45
+
46
+ Ubel exposes three binaries:
47
+
48
+ - `ubel` (Linux package scanning and OS-level operations: Ubuntu , Debian, Red Hat, Almalinux )
49
+ - `ubel-pip` (Python ecosystem)
50
+ - `ubel-npm` (Node.js ecosystem)
51
+
52
+ ---
53
+
54
+ # 🚀 Usage Overview
55
+
56
+ ## Main CLI
57
+ ```
58
+ usage: ubel [-h] {check,install,health,init,allow,block} [extra_args ...]
59
+ ```
60
+
61
+ ## PyPI CLI
62
+ ```
63
+ usage: ubel-pip [-h] {check,install,health,init,allow,block} [extra_args ...]
64
+ ```
65
+
66
+ ## npm CLI
67
+ ```
68
+ usage: ubel-npm [-h] {check,install,health,init,allow,block} [extra_args ...]
69
+ ```
70
+
71
+ ---
72
+
73
+ # 🧠 Commands Explained
74
+
75
+ ### **check**
76
+ Resolve dependencies/linux-packages → generate report → exit.
77
+
78
+ #### Python example:
79
+ ```bash
80
+ ubel-pip check
81
+ ```
82
+ If no extra arguments are passed, Ubel will:
83
+ - Detect `requirements.txt`
84
+ - Resolve all packages
85
+ - Scan them
86
+ - Output PDF + JSON
87
+
88
+ #### npm example:
89
+ ```bash
90
+ ubel-npm check flask==3.1.0
91
+ ```
92
+ If no args are passed, it will detect `package.json` automatically.
93
+
94
+ ---
95
+
96
+ ### **install**
97
+ Same as `check`, but enforces policies and either **blocks or allows** installation.
98
+
99
+ #### Python example:
100
+ ```bash
101
+ ubel-pip install flask==3.1.0
102
+ ```
103
+ Or auto-detect project requirements:
104
+ ```bash
105
+ ubel-pip install
106
+ ```
107
+
108
+ #### npm example:
109
+ ```bash
110
+ ubel-npm install express@5.0.0
111
+ ```
112
+ Or simply:
113
+ ```bash
114
+ ubel-npm install
115
+ ```
116
+ (uses `package.json` automatically)
117
+
118
+ ---
119
+
120
+ ### **health**
121
+ Scan the **entire machine** or **running project**, including:
122
+ - Installed PyPI packages
123
+ - Installed npm global packages
124
+ - OS-level packages (Ubuntu/Debian/RHEL/AlmaLinux)
125
+
126
+ Example:
127
+ ( for linux )
128
+ ```bash
129
+ ubel health
130
+ ```
131
+ or ( for node.js app )
132
+ ```bash
133
+ ubel-npm health
134
+ ```
135
+ or ( for python app )
136
+ ```bash
137
+ ubel-pip health
138
+ ```
139
+
140
+ This mode produces large, detailed inventories and vulnerability matrices.
141
+
142
+ ---
143
+
144
+ ### **init**
145
+ Initialize a policy file for the project or system.
146
+
147
+ Example:
148
+ ```bash
149
+ ubel init
150
+ ```
151
+ Creates default policy:
152
+ ```yaml
153
+ infections: block
154
+ severity:
155
+ critical: block
156
+ high: block
157
+ medium: allow
158
+ low: allow
159
+ unknown: allow
160
+ ```
161
+
162
+ ---
163
+
164
+ ### **allow / block**
165
+ Override Ubel's decision from CI/CD or scripted pipelines.
166
+
167
+ The arguments can be: "low", "medium", "high", "critical".
168
+
169
+ Example:
170
+ ```bash
171
+ ubel block high critical
172
+ ```
173
+ ---
174
+
175
+ # 📁 Automatic Project Detection
176
+
177
+ For **npm** and **PyPI**, when running:
178
+ - `install`
179
+ - `check`
180
+
181
+ without arguments:
182
+
183
+ ### Ubel automatically loads:
184
+ - `package.json` (for npm)
185
+ - `requirements.txt` (for pip)
186
+
187
+ This makes it ideal for CI/CD workflows.
188
+
189
+ ---
190
+
191
+ # 📤 Output
192
+ Ubel generates:
193
+
194
+ ### **1. JSON report**
195
+ Machine‑readable, includes:
196
+ - dependency list
197
+ - purls
198
+ - vulnerabilities
199
+ - severity
200
+ - infection state
201
+ - policy decision
202
+ - Generate complete SBOM-like machine inventory
203
+
204
+ ### **2. PDF report**
205
+ Human‑readable, includes:
206
+ - summary statistics
207
+ - per‑dependency vulnerability details
208
+ - fix recommendations
209
+ - tables
210
+ - OSV reference links
211
+ - Generate complete SBOM-like machine inventory
212
+
213
+
214
+ ---
215
+
216
+ # 🧩 Ecosystem Tools
217
+ - `ubel` → system packages, Linux distros
218
+ - `ubel-pip` → PyPI projects, virtual environments\
219
+ - `ubel-npm` → Node.js, npm, package.json projects
220
+
221
+
222
+ ---
223
+ Ubel – Secure every dependency, before it reaches production.
224
+
@@ -0,0 +1,210 @@
1
+ # UBEL ( Unified Bill / Enforced Law ) – Multi‑Ecosystem Security & Policy Enforcement CLI
2
+
3
+ Ubel is a fast, cross‑ecosystem security engine that resolves dependencies, generates PURLs, scans them through OSV.dev, and enforces security policies during installation. It works with:
4
+
5
+ - **PyPI** (via `ubel-pip`)
6
+ - **npm** (via `ubel-npm`)
7
+ - **Linux distributions** (Ubuntu, Debian, RHEL, AlmaLinux)
8
+
9
+ Ubel runs in **CLI**, **automation scripts**, and **CI/CD pipelines**, producing clean **JSON** and **PDF** reports.
10
+
11
+ ---
12
+
13
+ ## ✨ Features
14
+ - Full dependency resolution across ecosystems
15
+ - OSV.dev vulnerability scanning (batch API)
16
+ - Policy engine (block/allow by severity & infection)
17
+ - Checking linux-package or node/python dependency or entire project (`check` mode)
18
+ - Install‑time enforcement (`install` mode)
19
+ - Project‑level/Host-level scanning (`health` mode)
20
+ - Catches Non-CVEs
21
+ - It is a supply-chain protection tool
22
+ - Automatic report generation (JSON + PDF)
23
+ - Extremely fast (seconds per scan)
24
+
25
+ ---
26
+
27
+ ## 📦 Installation
28
+ ```bash
29
+ pip install ubel
30
+ ```
31
+
32
+ Ubel exposes three binaries:
33
+
34
+ - `ubel` (Linux package scanning and OS-level operations: Ubuntu , Debian, Red Hat, Almalinux )
35
+ - `ubel-pip` (Python ecosystem)
36
+ - `ubel-npm` (Node.js ecosystem)
37
+
38
+ ---
39
+
40
+ # 🚀 Usage Overview
41
+
42
+ ## Main CLI
43
+ ```
44
+ usage: ubel [-h] {check,install,health,init,allow,block} [extra_args ...]
45
+ ```
46
+
47
+ ## PyPI CLI
48
+ ```
49
+ usage: ubel-pip [-h] {check,install,health,init,allow,block} [extra_args ...]
50
+ ```
51
+
52
+ ## npm CLI
53
+ ```
54
+ usage: ubel-npm [-h] {check,install,health,init,allow,block} [extra_args ...]
55
+ ```
56
+
57
+ ---
58
+
59
+ # 🧠 Commands Explained
60
+
61
+ ### **check**
62
+ Resolve dependencies/linux-packages → generate report → exit.
63
+
64
+ #### Python example:
65
+ ```bash
66
+ ubel-pip check
67
+ ```
68
+ If no extra arguments are passed, Ubel will:
69
+ - Detect `requirements.txt`
70
+ - Resolve all packages
71
+ - Scan them
72
+ - Output PDF + JSON
73
+
74
+ #### npm example:
75
+ ```bash
76
+ ubel-npm check flask==3.1.0
77
+ ```
78
+ If no args are passed, it will detect `package.json` automatically.
79
+
80
+ ---
81
+
82
+ ### **install**
83
+ Same as `check`, but enforces policies and either **blocks or allows** installation.
84
+
85
+ #### Python example:
86
+ ```bash
87
+ ubel-pip install flask==3.1.0
88
+ ```
89
+ Or auto-detect project requirements:
90
+ ```bash
91
+ ubel-pip install
92
+ ```
93
+
94
+ #### npm example:
95
+ ```bash
96
+ ubel-npm install express@5.0.0
97
+ ```
98
+ Or simply:
99
+ ```bash
100
+ ubel-npm install
101
+ ```
102
+ (uses `package.json` automatically)
103
+
104
+ ---
105
+
106
+ ### **health**
107
+ Scan the **entire machine** or **running project**, including:
108
+ - Installed PyPI packages
109
+ - Installed npm global packages
110
+ - OS-level packages (Ubuntu/Debian/RHEL/AlmaLinux)
111
+
112
+ Example:
113
+ ( for linux )
114
+ ```bash
115
+ ubel health
116
+ ```
117
+ or ( for node.js app )
118
+ ```bash
119
+ ubel-npm health
120
+ ```
121
+ or ( for python app )
122
+ ```bash
123
+ ubel-pip health
124
+ ```
125
+
126
+ This mode produces large, detailed inventories and vulnerability matrices.
127
+
128
+ ---
129
+
130
+ ### **init**
131
+ Initialize a policy file for the project or system.
132
+
133
+ Example:
134
+ ```bash
135
+ ubel init
136
+ ```
137
+ Creates default policy:
138
+ ```yaml
139
+ infections: block
140
+ severity:
141
+ critical: block
142
+ high: block
143
+ medium: allow
144
+ low: allow
145
+ unknown: allow
146
+ ```
147
+
148
+ ---
149
+
150
+ ### **allow / block**
151
+ Override Ubel's decision from CI/CD or scripted pipelines.
152
+
153
+ The arguments can be: "low", "medium", "high", "critical".
154
+
155
+ Example:
156
+ ```bash
157
+ ubel block high critical
158
+ ```
159
+ ---
160
+
161
+ # 📁 Automatic Project Detection
162
+
163
+ For **npm** and **PyPI**, when running:
164
+ - `install`
165
+ - `check`
166
+
167
+ without arguments:
168
+
169
+ ### Ubel automatically loads:
170
+ - `package.json` (for npm)
171
+ - `requirements.txt` (for pip)
172
+
173
+ This makes it ideal for CI/CD workflows.
174
+
175
+ ---
176
+
177
+ # 📤 Output
178
+ Ubel generates:
179
+
180
+ ### **1. JSON report**
181
+ Machine‑readable, includes:
182
+ - dependency list
183
+ - purls
184
+ - vulnerabilities
185
+ - severity
186
+ - infection state
187
+ - policy decision
188
+ - Generate complete SBOM-like machine inventory
189
+
190
+ ### **2. PDF report**
191
+ Human‑readable, includes:
192
+ - summary statistics
193
+ - per‑dependency vulnerability details
194
+ - fix recommendations
195
+ - tables
196
+ - OSV reference links
197
+ - Generate complete SBOM-like machine inventory
198
+
199
+
200
+ ---
201
+
202
+ # 🧩 Ecosystem Tools
203
+ - `ubel` → system packages, Linux distros
204
+ - `ubel-pip` → PyPI projects, virtual environments\
205
+ - `ubel-npm` → Node.js, npm, package.json projects
206
+
207
+
208
+ ---
209
+ Ubel – Secure every dependency, before it reaches production.
210
+
@@ -0,0 +1,18 @@
1
+ [project]
2
+ name = "python-ubel"
3
+ version = "0.1.0"
4
+ description = "Supply-chain dependency firewall for: Python, Node, PHP, Ubuntu, Debian, Red Hat, and Almalinux."
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ dependencies = [
8
+ "requests",
9
+ "python-dotenv",
10
+ "cvss",
11
+ "reportlab",
12
+ "distro"
13
+ ]
14
+
15
+ [project.scripts]
16
+ ubel-pip = "ubel.cli:pip_mode"
17
+ ubel-npm = "ubel.cli:npm_mode"
18
+ ubel = "ubel.cli:linux_mode"
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-ubel
3
+ Version: 0.1.0
4
+ Summary: Supply-chain dependency firewall for: Python, Node, PHP, Ubuntu, Debian, Red Hat, and Almalinux.
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: requests
9
+ Requires-Dist: python-dotenv
10
+ Requires-Dist: cvss
11
+ Requires-Dist: reportlab
12
+ Requires-Dist: distro
13
+ Dynamic: license-file
14
+
15
+ # UBEL ( Unified Bill / Enforced Law ) – Multi‑Ecosystem Security & Policy Enforcement CLI
16
+
17
+ Ubel is a fast, cross‑ecosystem security engine that resolves dependencies, generates PURLs, scans them through OSV.dev, and enforces security policies during installation. It works with:
18
+
19
+ - **PyPI** (via `ubel-pip`)
20
+ - **npm** (via `ubel-npm`)
21
+ - **Linux distributions** (Ubuntu, Debian, RHEL, AlmaLinux)
22
+
23
+ Ubel runs in **CLI**, **automation scripts**, and **CI/CD pipelines**, producing clean **JSON** and **PDF** reports.
24
+
25
+ ---
26
+
27
+ ## ✨ Features
28
+ - Full dependency resolution across ecosystems
29
+ - OSV.dev vulnerability scanning (batch API)
30
+ - Policy engine (block/allow by severity & infection)
31
+ - Checking linux-package or node/python dependency or entire project (`check` mode)
32
+ - Install‑time enforcement (`install` mode)
33
+ - Project‑level/Host-level scanning (`health` mode)
34
+ - Catches Non-CVEs
35
+ - It is a supply-chain protection tool
36
+ - Automatic report generation (JSON + PDF)
37
+ - Extremely fast (seconds per scan)
38
+
39
+ ---
40
+
41
+ ## 📦 Installation
42
+ ```bash
43
+ pip install ubel
44
+ ```
45
+
46
+ Ubel exposes three binaries:
47
+
48
+ - `ubel` (Linux package scanning and OS-level operations: Ubuntu , Debian, Red Hat, Almalinux )
49
+ - `ubel-pip` (Python ecosystem)
50
+ - `ubel-npm` (Node.js ecosystem)
51
+
52
+ ---
53
+
54
+ # 🚀 Usage Overview
55
+
56
+ ## Main CLI
57
+ ```
58
+ usage: ubel [-h] {check,install,health,init,allow,block} [extra_args ...]
59
+ ```
60
+
61
+ ## PyPI CLI
62
+ ```
63
+ usage: ubel-pip [-h] {check,install,health,init,allow,block} [extra_args ...]
64
+ ```
65
+
66
+ ## npm CLI
67
+ ```
68
+ usage: ubel-npm [-h] {check,install,health,init,allow,block} [extra_args ...]
69
+ ```
70
+
71
+ ---
72
+
73
+ # 🧠 Commands Explained
74
+
75
+ ### **check**
76
+ Resolve dependencies/linux-packages → generate report → exit.
77
+
78
+ #### Python example:
79
+ ```bash
80
+ ubel-pip check
81
+ ```
82
+ If no extra arguments are passed, Ubel will:
83
+ - Detect `requirements.txt`
84
+ - Resolve all packages
85
+ - Scan them
86
+ - Output PDF + JSON
87
+
88
+ #### npm example:
89
+ ```bash
90
+ ubel-npm check flask==3.1.0
91
+ ```
92
+ If no args are passed, it will detect `package.json` automatically.
93
+
94
+ ---
95
+
96
+ ### **install**
97
+ Same as `check`, but enforces policies and either **blocks or allows** installation.
98
+
99
+ #### Python example:
100
+ ```bash
101
+ ubel-pip install flask==3.1.0
102
+ ```
103
+ Or auto-detect project requirements:
104
+ ```bash
105
+ ubel-pip install
106
+ ```
107
+
108
+ #### npm example:
109
+ ```bash
110
+ ubel-npm install express@5.0.0
111
+ ```
112
+ Or simply:
113
+ ```bash
114
+ ubel-npm install
115
+ ```
116
+ (uses `package.json` automatically)
117
+
118
+ ---
119
+
120
+ ### **health**
121
+ Scan the **entire machine** or **running project**, including:
122
+ - Installed PyPI packages
123
+ - Installed npm global packages
124
+ - OS-level packages (Ubuntu/Debian/RHEL/AlmaLinux)
125
+
126
+ Example:
127
+ ( for linux )
128
+ ```bash
129
+ ubel health
130
+ ```
131
+ or ( for node.js app )
132
+ ```bash
133
+ ubel-npm health
134
+ ```
135
+ or ( for python app )
136
+ ```bash
137
+ ubel-pip health
138
+ ```
139
+
140
+ This mode produces large, detailed inventories and vulnerability matrices.
141
+
142
+ ---
143
+
144
+ ### **init**
145
+ Initialize a policy file for the project or system.
146
+
147
+ Example:
148
+ ```bash
149
+ ubel init
150
+ ```
151
+ Creates default policy:
152
+ ```yaml
153
+ infections: block
154
+ severity:
155
+ critical: block
156
+ high: block
157
+ medium: allow
158
+ low: allow
159
+ unknown: allow
160
+ ```
161
+
162
+ ---
163
+
164
+ ### **allow / block**
165
+ Override Ubel's decision from CI/CD or scripted pipelines.
166
+
167
+ The arguments can be: "low", "medium", "high", "critical".
168
+
169
+ Example:
170
+ ```bash
171
+ ubel block high critical
172
+ ```
173
+ ---
174
+
175
+ # 📁 Automatic Project Detection
176
+
177
+ For **npm** and **PyPI**, when running:
178
+ - `install`
179
+ - `check`
180
+
181
+ without arguments:
182
+
183
+ ### Ubel automatically loads:
184
+ - `package.json` (for npm)
185
+ - `requirements.txt` (for pip)
186
+
187
+ This makes it ideal for CI/CD workflows.
188
+
189
+ ---
190
+
191
+ # 📤 Output
192
+ Ubel generates:
193
+
194
+ ### **1. JSON report**
195
+ Machine‑readable, includes:
196
+ - dependency list
197
+ - purls
198
+ - vulnerabilities
199
+ - severity
200
+ - infection state
201
+ - policy decision
202
+ - Generate complete SBOM-like machine inventory
203
+
204
+ ### **2. PDF report**
205
+ Human‑readable, includes:
206
+ - summary statistics
207
+ - per‑dependency vulnerability details
208
+ - fix recommendations
209
+ - tables
210
+ - OSV reference links
211
+ - Generate complete SBOM-like machine inventory
212
+
213
+
214
+ ---
215
+
216
+ # 🧩 Ecosystem Tools
217
+ - `ubel` → system packages, Linux distros
218
+ - `ubel-pip` → PyPI projects, virtual environments\
219
+ - `ubel-npm` → Node.js, npm, package.json projects
220
+
221
+
222
+ ---
223
+ Ubel – Secure every dependency, before it reaches production.
224
+
@@ -0,0 +1,20 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ python_ubel.egg-info/PKG-INFO
5
+ python_ubel.egg-info/SOURCES.txt
6
+ python_ubel.egg-info/dependency_links.txt
7
+ python_ubel.egg-info/entry_points.txt
8
+ python_ubel.egg-info/requires.txt
9
+ python_ubel.egg-info/top_level.txt
10
+ ubel/__init__.py
11
+ ubel/cli.py
12
+ ubel/client.py
13
+ ubel/cvss_parser.py
14
+ ubel/info.py
15
+ ubel/linux_runner.py
16
+ ubel/node_runner.py
17
+ ubel/policy.py
18
+ ubel/python_runner.py
19
+ ubel/ubel_engine.py
20
+ ubel/utils.py
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ ubel = ubel.cli:linux_mode
3
+ ubel-npm = ubel.cli:npm_mode
4
+ ubel-pip = ubel.cli:pip_mode