plexavo 0.2.1__tar.gz → 0.2.3__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.
Files changed (50) hide show
  1. {plexavo-0.2.1 → plexavo-0.2.3}/PKG-INFO +67 -87
  2. {plexavo-0.2.1 → plexavo-0.2.3}/README.md +66 -86
  3. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/__init__.py +1 -1
  4. plexavo-0.2.3/plexavo/__main__.py +13 -0
  5. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/PKG-INFO +67 -87
  6. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/SOURCES.txt +2 -0
  7. {plexavo-0.2.1 → plexavo-0.2.3}/pyproject.toml +1 -1
  8. plexavo-0.2.3/tests/test_cli_entrypoint.py +51 -0
  9. {plexavo-0.2.1 → plexavo-0.2.3}/LICENSE +0 -0
  10. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/auth.py +0 -0
  11. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/aws_profile_setup.py +0 -0
  12. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/__init__.py +0 -0
  13. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/encryption.py +0 -0
  14. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/iam.py +0 -0
  15. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/iam_hygiene.py +0 -0
  16. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/logging.py +0 -0
  17. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/network.py +0 -0
  18. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/storage.py +0 -0
  19. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/checks/usage.py +0 -0
  20. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/cli.py +0 -0
  21. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/findings.py +0 -0
  22. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/interactive.py +0 -0
  23. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/principals.py +0 -0
  24. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/__init__.py +0 -0
  25. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/ai_narration.py +0 -0
  26. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/fonts/DejaVuSans-Bold.ttf +0 -0
  27. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/fonts/DejaVuSans-BoldOblique.ttf +0 -0
  28. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/fonts/DejaVuSans-Oblique.ttf +0 -0
  29. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/fonts/DejaVuSans.ttf +0 -0
  30. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/fonts/GEIST-FONT-LICENSE.txt +0 -0
  31. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/html_report.py +0 -0
  32. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/pdf.py +0 -0
  33. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/report/templates/report.html.j2 +0 -0
  34. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo/scoring.py +0 -0
  35. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/dependency_links.txt +0 -0
  36. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/entry_points.txt +0 -0
  37. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/requires.txt +0 -0
  38. {plexavo-0.2.1 → plexavo-0.2.3}/plexavo.egg-info/top_level.txt +0 -0
  39. {plexavo-0.2.1 → plexavo-0.2.3}/setup.cfg +0 -0
  40. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_ai_narration_offline.py +0 -0
  41. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_auth_offline.py +0 -0
  42. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_encryption_offline.py +0 -0
  43. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_iam_hygiene_offline.py +0 -0
  44. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_iam_offline.py +0 -0
  45. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_logging_offline.py +0 -0
  46. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_network_offline.py +0 -0
  47. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_report_offline.py +0 -0
  48. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_scoring.py +0 -0
  49. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_storage_offline.py +0 -0
  50. {plexavo-0.2.1 → plexavo-0.2.3}/tests/test_usage_offline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexavo
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Open-source AWS misconfiguration scanner — runs with your own local AWS credentials, nothing sent to anyone else.
5
5
  Author: Kavee
6
6
  License: AGPL-3.0-or-later
@@ -125,128 +125,107 @@ scoped by a Condition block, or a CloudTrail lookup that hit its page cap on
125
125
  `--report-html`/`--report-pdf` render this same data as a full report; see
126
126
  [Cost](#cost) for what `--explain` needs and what it costs.
127
127
 
128
- ## Quick start
128
+ ## Install
129
129
 
130
- **Recommended: [uv](https://docs.astral.sh/uv/).** It installs Plexavo into
131
- its own isolated environment automatically — no venv to create, activate,
132
- or remember to reactivate in every new terminal.
130
+ Plexavo is a command-line tool. Pick your OS below — every path installs
131
+ it into its own isolated environment, so it never clashes with your other
132
+ Python packages.
133
133
 
134
- ### 1. Install uv (if you don't already have it)
134
+ ### macOS & Linux
135
135
 
136
- ```bash
137
- curl -LsSf https://astral.sh/uv/install.sh | sh # Mac/Linux
138
- powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
139
- ```
140
-
141
- (Full options: [uv installation docs](https://docs.astral.sh/uv/getting-started/installation/).)
142
-
143
- ### 2. Install Plexavo
136
+ [uv](https://docs.astral.sh/uv/) puts a single `plexavo` command on your
137
+ PATH, in every terminal, with nothing to activate:
144
138
 
145
139
  ```bash
140
+ curl -LsSf https://astral.sh/uv/install.sh | sh # skip if you have uv
146
141
  uv tool install plexavo
147
142
  ```
148
143
 
149
- That's it — `plexavo` is now on your PATH in every terminal, until you
150
- uninstall it. No activate step, ever.
144
+ Update or remove later with `uv tool upgrade plexavo` /
145
+ `uv tool uninstall plexavo`. Prefer [pipx](https://pipx.pypa.io/)?
146
+ `pipx install plexavo` works the same way.
151
147
 
152
- **Have an Anthropic API key and want AI-narrated explanations** (see
153
- [Cost](#cost) — it's optional and costs a few cents per scan, not
154
- free)? Install with the `[ai]` extra instead — same package, just with
155
- the `anthropic` library included:
148
+ ### Windows
156
149
 
157
- ```bash
158
- uv tool install "plexavo[ai]"
159
- ```
150
+ `uv` and `pipx` install fine, but the small `plexavo.exe` launcher they
151
+ drop on your PATH is unsigned, and Windows Smart App Control refuses to
152
+ run unsigned executables it doesn't recognise. The way around it is to
153
+ run Plexavo through Python directly. Two ways — both isolated, pick one:
160
154
 
161
- No key yet, or not sure? Skip it for now — the plain install is
162
- genuinely complete on its own. Add it later with:
155
+ #### Option 1 — uv (recommended)
163
156
 
164
- ```bash
165
- uv tool install --reinstall "plexavo[ai]"
166
- ```
157
+ ```powershell
158
+ uv tool install plexavo
167
159
 
168
- Just want to try it once without installing anything?
160
+ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
169
161
 
170
- ```bash
171
- uvx plexavo scan --profile my-aws-profile
162
+ if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }
163
+ Add-Content $PROFILE 'function plexavo { & "$env:APPDATA\uv\tools\plexavo\Scripts\python.exe" -m plexavo @args }'
172
164
  ```
173
165
 
174
- Updating or removing later:
166
+ Open a new terminal and `plexavo` works exactly like it does on
167
+ macOS/Linux.
175
168
 
176
- ```bash
177
- uv tool upgrade plexavo
178
- uv tool uninstall plexavo
179
- ```
169
+ `uv tool install` still leaves the blocked `plexavo.exe` on your PATH.
170
+ The line you add to your PowerShell profile shadows it with a command
171
+ that calls uv's bundled `python.exe` directly — that Python is signed by
172
+ the Python Software Foundation, so Smart App Control never stops it. You
173
+ add it once; the `Set-ExecutionPolicy` line (also once) is what lets
174
+ PowerShell load your profile at all. Update later with
175
+ `uv tool upgrade plexavo`.
180
176
 
181
- ### 3. Run a scan
177
+ #### Option 2 — virtual environment (no uv)
182
178
 
183
- ```bash
184
- plexavo scan --profile my-aws-profile --report-html report.html
179
+ ```powershell
180
+ py -m venv plexavo-venv
181
+ .\plexavo-venv\Scripts\Activate.ps1
182
+ pip install plexavo
185
183
  ```
186
184
 
187
- No `--profile`? It uses your default profile / environment variables,
188
- same resolution order as the AWS CLI. No AI, no API key, no cost — and
189
- findings still come with free Next Step / Full Fix Detail guidance
190
- wherever a template exists (10 common check types); this alone is a
191
- complete, genuinely useful scan.
185
+ Now run `plexavo`. When you're finished, type `deactivate`.
192
186
 
193
- Want a full AI-written explanation for *every* finding instead (needs
194
- the `[ai]` install above)?
187
+ A virtual environment is just a folder holding its own copy of Python and
188
+ its packages. Activating it is what adds its `plexavo` to your PATH — and
189
+ only for that one terminal. So every time you open a new terminal you run
190
+ `.\plexavo-venv\Scripts\Activate.ps1` again before using Plexavo. That
191
+ re-activation is the trade-off for installing nothing globally. If
192
+ PowerShell blocks the activate script, run
193
+ `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once. Update with
194
+ `pip install --upgrade plexavo` inside the activated environment.
195
195
 
196
- ```bash
197
- export ANTHROPIC_API_KEY="sk-ant-..." # your own key, your own account
198
- plexavo scan --profile my-aws-profile --explain --report-html report.html --report-pdf report.pdf
199
- ```
200
-
201
- - Drop `--explain` and findings still get free template remediation where
202
- available (no API key needed) and raw technical detail otherwise.
203
- `--explain` replaces that with a live AI narrative for every finding,
204
- including the templated ones.
205
- - Drop `--report-html`/`--report-pdf` to just see the console table.
206
- - `--explain-limit N` (default 25) caps how many findings get a live AI
207
- call when `--explain` is passed, as a safety rail against unexpectedly
208
- large real scans — it doesn't limit the free template remediation.
209
- - No `ANTHROPIC_API_KEY` set, or a call fails for any reason (invalid key,
210
- rate limit, network issue)? The scan and report are completely
211
- unaffected — that finding falls back to template/raw detail instead of
212
- an AI narrative, not an error. See [Cost](#cost).
196
+ ### AI-narrated explanations (optional, any OS)
213
197
 
214
- ### Alternative: pipx
198
+ Plexavo is complete without this. If you have an Anthropic API key and
199
+ want each finding rewritten as a full narrative (see [Cost](#cost)),
200
+ install `"plexavo[ai]"` in place of `plexavo` in any command above.
215
201
 
216
- Already use [pipx](https://pipx.pypa.io/)? It works exactly the same way —
217
- its own isolated environment, one global command, no venv:
202
+ ### From source (for contributing, or trying an unreleased change)
218
203
 
219
204
  ```bash
220
- pipx install plexavo
221
- pipx install "plexavo[ai]" # with AI-narrated explanations
205
+ git clone https://github.com/plexavo/plexavo.git
206
+ cd plexavo
207
+ uv pip install -e . # or: pip install -e . (inside a venv)
222
208
  ```
223
209
 
224
- ### Alternative: pip + venv
210
+ ## Using Plexavo
225
211
 
226
- Prefer to manage the environment yourself, or on a system without uv/pipx?
227
- Modern Python (PEP 668) blocks a plain `pip install` outside a venv on
228
- many systems, so create one first:
212
+ Just run:
229
213
 
230
214
  ```bash
231
- python -m venv plexavo-env
232
- plexavo-env\Scripts\activate # Windows
233
- source plexavo-env/bin/activate # Mac/Linux
234
-
235
- pip install plexavo
236
- pip install "plexavo[ai]" # with AI-narrated explanations
215
+ plexavo
237
216
  ```
238
217
 
239
- You'll need to reactivate this venv (`plexavo-env\Scripts\activate` /
240
- `source plexavo-env/bin/activate`) every time you open a new terminal —
241
- `deactivate` exits it without uninstalling anything.
218
+ with no arguments. It walks you through choosing an AWS profile (or
219
+ setting a new one up), picking whether you want an HTML or PDF report,
220
+ then runs the scan and shows your 0-100 score with every finding and its
221
+ plain-English fix. Nothing to memorise.
242
222
 
243
- ### From source (for contributing, or trying an unreleased change)
223
+ On Windows Option 2, run `python -m plexavo` if the bare `plexavo`
224
+ command is ever blocked.
244
225
 
245
- ```bash
246
- git clone https://github.com/plexavo/plexavo.git
247
- cd plexavo
248
- uv pip install -e . # or: pip install -e . (inside a venv)
249
- ```
226
+ Scripting a scan into CI or a scheduled job? `plexavo scan --help` covers
227
+ the flag-driven form (`--profile`, `--region`, `--report-html`,
228
+ `--report-pdf`, `--explain`).
250
229
 
251
230
  ## Project structure
252
231
 
@@ -257,6 +236,7 @@ plexavo/
257
236
  ├── findings.py # Finding data model, Severity enum
258
237
  ├── scoring.py # 0-100 score from a list of Findings
259
238
  ├── cli.py # `plexavo scan ...` entry point
239
+ ├── __main__.py # lets `python -m plexavo` run the CLI
260
240
  ├── checks/
261
241
  │ ├── iam.py # IAM-01 to IAM-06 (privilege escalation)
262
242
  │ ├── iam_hygiene.py # IAM-07 to IAM-14 (hygiene, cross-account trust)
@@ -96,128 +96,107 @@ scoped by a Condition block, or a CloudTrail lookup that hit its page cap on
96
96
  `--report-html`/`--report-pdf` render this same data as a full report; see
97
97
  [Cost](#cost) for what `--explain` needs and what it costs.
98
98
 
99
- ## Quick start
99
+ ## Install
100
100
 
101
- **Recommended: [uv](https://docs.astral.sh/uv/).** It installs Plexavo into
102
- its own isolated environment automatically — no venv to create, activate,
103
- or remember to reactivate in every new terminal.
101
+ Plexavo is a command-line tool. Pick your OS below — every path installs
102
+ it into its own isolated environment, so it never clashes with your other
103
+ Python packages.
104
104
 
105
- ### 1. Install uv (if you don't already have it)
105
+ ### macOS & Linux
106
106
 
107
- ```bash
108
- curl -LsSf https://astral.sh/uv/install.sh | sh # Mac/Linux
109
- powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
110
- ```
111
-
112
- (Full options: [uv installation docs](https://docs.astral.sh/uv/getting-started/installation/).)
113
-
114
- ### 2. Install Plexavo
107
+ [uv](https://docs.astral.sh/uv/) puts a single `plexavo` command on your
108
+ PATH, in every terminal, with nothing to activate:
115
109
 
116
110
  ```bash
111
+ curl -LsSf https://astral.sh/uv/install.sh | sh # skip if you have uv
117
112
  uv tool install plexavo
118
113
  ```
119
114
 
120
- That's it — `plexavo` is now on your PATH in every terminal, until you
121
- uninstall it. No activate step, ever.
115
+ Update or remove later with `uv tool upgrade plexavo` /
116
+ `uv tool uninstall plexavo`. Prefer [pipx](https://pipx.pypa.io/)?
117
+ `pipx install plexavo` works the same way.
122
118
 
123
- **Have an Anthropic API key and want AI-narrated explanations** (see
124
- [Cost](#cost) — it's optional and costs a few cents per scan, not
125
- free)? Install with the `[ai]` extra instead — same package, just with
126
- the `anthropic` library included:
119
+ ### Windows
127
120
 
128
- ```bash
129
- uv tool install "plexavo[ai]"
130
- ```
121
+ `uv` and `pipx` install fine, but the small `plexavo.exe` launcher they
122
+ drop on your PATH is unsigned, and Windows Smart App Control refuses to
123
+ run unsigned executables it doesn't recognise. The way around it is to
124
+ run Plexavo through Python directly. Two ways — both isolated, pick one:
131
125
 
132
- No key yet, or not sure? Skip it for now — the plain install is
133
- genuinely complete on its own. Add it later with:
126
+ #### Option 1 — uv (recommended)
134
127
 
135
- ```bash
136
- uv tool install --reinstall "plexavo[ai]"
137
- ```
128
+ ```powershell
129
+ uv tool install plexavo
138
130
 
139
- Just want to try it once without installing anything?
131
+ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
140
132
 
141
- ```bash
142
- uvx plexavo scan --profile my-aws-profile
133
+ if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }
134
+ Add-Content $PROFILE 'function plexavo { & "$env:APPDATA\uv\tools\plexavo\Scripts\python.exe" -m plexavo @args }'
143
135
  ```
144
136
 
145
- Updating or removing later:
137
+ Open a new terminal and `plexavo` works exactly like it does on
138
+ macOS/Linux.
146
139
 
147
- ```bash
148
- uv tool upgrade plexavo
149
- uv tool uninstall plexavo
150
- ```
140
+ `uv tool install` still leaves the blocked `plexavo.exe` on your PATH.
141
+ The line you add to your PowerShell profile shadows it with a command
142
+ that calls uv's bundled `python.exe` directly — that Python is signed by
143
+ the Python Software Foundation, so Smart App Control never stops it. You
144
+ add it once; the `Set-ExecutionPolicy` line (also once) is what lets
145
+ PowerShell load your profile at all. Update later with
146
+ `uv tool upgrade plexavo`.
151
147
 
152
- ### 3. Run a scan
148
+ #### Option 2 — virtual environment (no uv)
153
149
 
154
- ```bash
155
- plexavo scan --profile my-aws-profile --report-html report.html
150
+ ```powershell
151
+ py -m venv plexavo-venv
152
+ .\plexavo-venv\Scripts\Activate.ps1
153
+ pip install plexavo
156
154
  ```
157
155
 
158
- No `--profile`? It uses your default profile / environment variables,
159
- same resolution order as the AWS CLI. No AI, no API key, no cost — and
160
- findings still come with free Next Step / Full Fix Detail guidance
161
- wherever a template exists (10 common check types); this alone is a
162
- complete, genuinely useful scan.
156
+ Now run `plexavo`. When you're finished, type `deactivate`.
163
157
 
164
- Want a full AI-written explanation for *every* finding instead (needs
165
- the `[ai]` install above)?
158
+ A virtual environment is just a folder holding its own copy of Python and
159
+ its packages. Activating it is what adds its `plexavo` to your PATH — and
160
+ only for that one terminal. So every time you open a new terminal you run
161
+ `.\plexavo-venv\Scripts\Activate.ps1` again before using Plexavo. That
162
+ re-activation is the trade-off for installing nothing globally. If
163
+ PowerShell blocks the activate script, run
164
+ `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once. Update with
165
+ `pip install --upgrade plexavo` inside the activated environment.
166
166
 
167
- ```bash
168
- export ANTHROPIC_API_KEY="sk-ant-..." # your own key, your own account
169
- plexavo scan --profile my-aws-profile --explain --report-html report.html --report-pdf report.pdf
170
- ```
171
-
172
- - Drop `--explain` and findings still get free template remediation where
173
- available (no API key needed) and raw technical detail otherwise.
174
- `--explain` replaces that with a live AI narrative for every finding,
175
- including the templated ones.
176
- - Drop `--report-html`/`--report-pdf` to just see the console table.
177
- - `--explain-limit N` (default 25) caps how many findings get a live AI
178
- call when `--explain` is passed, as a safety rail against unexpectedly
179
- large real scans — it doesn't limit the free template remediation.
180
- - No `ANTHROPIC_API_KEY` set, or a call fails for any reason (invalid key,
181
- rate limit, network issue)? The scan and report are completely
182
- unaffected — that finding falls back to template/raw detail instead of
183
- an AI narrative, not an error. See [Cost](#cost).
167
+ ### AI-narrated explanations (optional, any OS)
184
168
 
185
- ### Alternative: pipx
169
+ Plexavo is complete without this. If you have an Anthropic API key and
170
+ want each finding rewritten as a full narrative (see [Cost](#cost)),
171
+ install `"plexavo[ai]"` in place of `plexavo` in any command above.
186
172
 
187
- Already use [pipx](https://pipx.pypa.io/)? It works exactly the same way —
188
- its own isolated environment, one global command, no venv:
173
+ ### From source (for contributing, or trying an unreleased change)
189
174
 
190
175
  ```bash
191
- pipx install plexavo
192
- pipx install "plexavo[ai]" # with AI-narrated explanations
176
+ git clone https://github.com/plexavo/plexavo.git
177
+ cd plexavo
178
+ uv pip install -e . # or: pip install -e . (inside a venv)
193
179
  ```
194
180
 
195
- ### Alternative: pip + venv
181
+ ## Using Plexavo
196
182
 
197
- Prefer to manage the environment yourself, or on a system without uv/pipx?
198
- Modern Python (PEP 668) blocks a plain `pip install` outside a venv on
199
- many systems, so create one first:
183
+ Just run:
200
184
 
201
185
  ```bash
202
- python -m venv plexavo-env
203
- plexavo-env\Scripts\activate # Windows
204
- source plexavo-env/bin/activate # Mac/Linux
205
-
206
- pip install plexavo
207
- pip install "plexavo[ai]" # with AI-narrated explanations
186
+ plexavo
208
187
  ```
209
188
 
210
- You'll need to reactivate this venv (`plexavo-env\Scripts\activate` /
211
- `source plexavo-env/bin/activate`) every time you open a new terminal —
212
- `deactivate` exits it without uninstalling anything.
189
+ with no arguments. It walks you through choosing an AWS profile (or
190
+ setting a new one up), picking whether you want an HTML or PDF report,
191
+ then runs the scan and shows your 0-100 score with every finding and its
192
+ plain-English fix. Nothing to memorise.
213
193
 
214
- ### From source (for contributing, or trying an unreleased change)
194
+ On Windows Option 2, run `python -m plexavo` if the bare `plexavo`
195
+ command is ever blocked.
215
196
 
216
- ```bash
217
- git clone https://github.com/plexavo/plexavo.git
218
- cd plexavo
219
- uv pip install -e . # or: pip install -e . (inside a venv)
220
- ```
197
+ Scripting a scan into CI or a scheduled job? `plexavo scan --help` covers
198
+ the flag-driven form (`--profile`, `--region`, `--report-html`,
199
+ `--report-pdf`, `--explain`).
221
200
 
222
201
  ## Project structure
223
202
 
@@ -228,6 +207,7 @@ plexavo/
228
207
  ├── findings.py # Finding data model, Severity enum
229
208
  ├── scoring.py # 0-100 score from a list of Findings
230
209
  ├── cli.py # `plexavo scan ...` entry point
210
+ ├── __main__.py # lets `python -m plexavo` run the CLI
231
211
  ├── checks/
232
212
  │ ├── iam.py # IAM-01 to IAM-06 (privilege escalation)
233
213
  │ ├── iam_hygiene.py # IAM-07 to IAM-14 (hygiene, cross-account trust)
@@ -4,4 +4,4 @@ Runs entirely with your own local AWS credentials. Nothing is sent to
4
4
  anyone else. See README.md for usage, or `plexavo scan --help`.
5
5
  """
6
6
 
7
- __version__ = "0.2.1"
7
+ __version__ = "0.2.3"
@@ -0,0 +1,13 @@
1
+ """Allow `python -m plexavo` (and `py -m plexavo` on Windows) to launch the CLI.
2
+
3
+ This is the exact same entry point as the installed `plexavo` command, so
4
+ running it with no arguments still opens the interactive menu. It exists so
5
+ Windows users can install with plain `pip` and run the tool without going
6
+ through the generated `plexavo.exe` launcher, which Windows Smart App Control
7
+ blocks on some machines (it's unsigned). See the README's Install section.
8
+ """
9
+
10
+ from plexavo.cli import main
11
+
12
+ if __name__ == "__main__":
13
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexavo
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Open-source AWS misconfiguration scanner — runs with your own local AWS credentials, nothing sent to anyone else.
5
5
  Author: Kavee
6
6
  License: AGPL-3.0-or-later
@@ -125,128 +125,107 @@ scoped by a Condition block, or a CloudTrail lookup that hit its page cap on
125
125
  `--report-html`/`--report-pdf` render this same data as a full report; see
126
126
  [Cost](#cost) for what `--explain` needs and what it costs.
127
127
 
128
- ## Quick start
128
+ ## Install
129
129
 
130
- **Recommended: [uv](https://docs.astral.sh/uv/).** It installs Plexavo into
131
- its own isolated environment automatically — no venv to create, activate,
132
- or remember to reactivate in every new terminal.
130
+ Plexavo is a command-line tool. Pick your OS below — every path installs
131
+ it into its own isolated environment, so it never clashes with your other
132
+ Python packages.
133
133
 
134
- ### 1. Install uv (if you don't already have it)
134
+ ### macOS & Linux
135
135
 
136
- ```bash
137
- curl -LsSf https://astral.sh/uv/install.sh | sh # Mac/Linux
138
- powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
139
- ```
140
-
141
- (Full options: [uv installation docs](https://docs.astral.sh/uv/getting-started/installation/).)
142
-
143
- ### 2. Install Plexavo
136
+ [uv](https://docs.astral.sh/uv/) puts a single `plexavo` command on your
137
+ PATH, in every terminal, with nothing to activate:
144
138
 
145
139
  ```bash
140
+ curl -LsSf https://astral.sh/uv/install.sh | sh # skip if you have uv
146
141
  uv tool install plexavo
147
142
  ```
148
143
 
149
- That's it — `plexavo` is now on your PATH in every terminal, until you
150
- uninstall it. No activate step, ever.
144
+ Update or remove later with `uv tool upgrade plexavo` /
145
+ `uv tool uninstall plexavo`. Prefer [pipx](https://pipx.pypa.io/)?
146
+ `pipx install plexavo` works the same way.
151
147
 
152
- **Have an Anthropic API key and want AI-narrated explanations** (see
153
- [Cost](#cost) — it's optional and costs a few cents per scan, not
154
- free)? Install with the `[ai]` extra instead — same package, just with
155
- the `anthropic` library included:
148
+ ### Windows
156
149
 
157
- ```bash
158
- uv tool install "plexavo[ai]"
159
- ```
150
+ `uv` and `pipx` install fine, but the small `plexavo.exe` launcher they
151
+ drop on your PATH is unsigned, and Windows Smart App Control refuses to
152
+ run unsigned executables it doesn't recognise. The way around it is to
153
+ run Plexavo through Python directly. Two ways — both isolated, pick one:
160
154
 
161
- No key yet, or not sure? Skip it for now — the plain install is
162
- genuinely complete on its own. Add it later with:
155
+ #### Option 1 — uv (recommended)
163
156
 
164
- ```bash
165
- uv tool install --reinstall "plexavo[ai]"
166
- ```
157
+ ```powershell
158
+ uv tool install plexavo
167
159
 
168
- Just want to try it once without installing anything?
160
+ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
169
161
 
170
- ```bash
171
- uvx plexavo scan --profile my-aws-profile
162
+ if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }
163
+ Add-Content $PROFILE 'function plexavo { & "$env:APPDATA\uv\tools\plexavo\Scripts\python.exe" -m plexavo @args }'
172
164
  ```
173
165
 
174
- Updating or removing later:
166
+ Open a new terminal and `plexavo` works exactly like it does on
167
+ macOS/Linux.
175
168
 
176
- ```bash
177
- uv tool upgrade plexavo
178
- uv tool uninstall plexavo
179
- ```
169
+ `uv tool install` still leaves the blocked `plexavo.exe` on your PATH.
170
+ The line you add to your PowerShell profile shadows it with a command
171
+ that calls uv's bundled `python.exe` directly — that Python is signed by
172
+ the Python Software Foundation, so Smart App Control never stops it. You
173
+ add it once; the `Set-ExecutionPolicy` line (also once) is what lets
174
+ PowerShell load your profile at all. Update later with
175
+ `uv tool upgrade plexavo`.
180
176
 
181
- ### 3. Run a scan
177
+ #### Option 2 — virtual environment (no uv)
182
178
 
183
- ```bash
184
- plexavo scan --profile my-aws-profile --report-html report.html
179
+ ```powershell
180
+ py -m venv plexavo-venv
181
+ .\plexavo-venv\Scripts\Activate.ps1
182
+ pip install plexavo
185
183
  ```
186
184
 
187
- No `--profile`? It uses your default profile / environment variables,
188
- same resolution order as the AWS CLI. No AI, no API key, no cost — and
189
- findings still come with free Next Step / Full Fix Detail guidance
190
- wherever a template exists (10 common check types); this alone is a
191
- complete, genuinely useful scan.
185
+ Now run `plexavo`. When you're finished, type `deactivate`.
192
186
 
193
- Want a full AI-written explanation for *every* finding instead (needs
194
- the `[ai]` install above)?
187
+ A virtual environment is just a folder holding its own copy of Python and
188
+ its packages. Activating it is what adds its `plexavo` to your PATH — and
189
+ only for that one terminal. So every time you open a new terminal you run
190
+ `.\plexavo-venv\Scripts\Activate.ps1` again before using Plexavo. That
191
+ re-activation is the trade-off for installing nothing globally. If
192
+ PowerShell blocks the activate script, run
193
+ `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once. Update with
194
+ `pip install --upgrade plexavo` inside the activated environment.
195
195
 
196
- ```bash
197
- export ANTHROPIC_API_KEY="sk-ant-..." # your own key, your own account
198
- plexavo scan --profile my-aws-profile --explain --report-html report.html --report-pdf report.pdf
199
- ```
200
-
201
- - Drop `--explain` and findings still get free template remediation where
202
- available (no API key needed) and raw technical detail otherwise.
203
- `--explain` replaces that with a live AI narrative for every finding,
204
- including the templated ones.
205
- - Drop `--report-html`/`--report-pdf` to just see the console table.
206
- - `--explain-limit N` (default 25) caps how many findings get a live AI
207
- call when `--explain` is passed, as a safety rail against unexpectedly
208
- large real scans — it doesn't limit the free template remediation.
209
- - No `ANTHROPIC_API_KEY` set, or a call fails for any reason (invalid key,
210
- rate limit, network issue)? The scan and report are completely
211
- unaffected — that finding falls back to template/raw detail instead of
212
- an AI narrative, not an error. See [Cost](#cost).
196
+ ### AI-narrated explanations (optional, any OS)
213
197
 
214
- ### Alternative: pipx
198
+ Plexavo is complete without this. If you have an Anthropic API key and
199
+ want each finding rewritten as a full narrative (see [Cost](#cost)),
200
+ install `"plexavo[ai]"` in place of `plexavo` in any command above.
215
201
 
216
- Already use [pipx](https://pipx.pypa.io/)? It works exactly the same way —
217
- its own isolated environment, one global command, no venv:
202
+ ### From source (for contributing, or trying an unreleased change)
218
203
 
219
204
  ```bash
220
- pipx install plexavo
221
- pipx install "plexavo[ai]" # with AI-narrated explanations
205
+ git clone https://github.com/plexavo/plexavo.git
206
+ cd plexavo
207
+ uv pip install -e . # or: pip install -e . (inside a venv)
222
208
  ```
223
209
 
224
- ### Alternative: pip + venv
210
+ ## Using Plexavo
225
211
 
226
- Prefer to manage the environment yourself, or on a system without uv/pipx?
227
- Modern Python (PEP 668) blocks a plain `pip install` outside a venv on
228
- many systems, so create one first:
212
+ Just run:
229
213
 
230
214
  ```bash
231
- python -m venv plexavo-env
232
- plexavo-env\Scripts\activate # Windows
233
- source plexavo-env/bin/activate # Mac/Linux
234
-
235
- pip install plexavo
236
- pip install "plexavo[ai]" # with AI-narrated explanations
215
+ plexavo
237
216
  ```
238
217
 
239
- You'll need to reactivate this venv (`plexavo-env\Scripts\activate` /
240
- `source plexavo-env/bin/activate`) every time you open a new terminal —
241
- `deactivate` exits it without uninstalling anything.
218
+ with no arguments. It walks you through choosing an AWS profile (or
219
+ setting a new one up), picking whether you want an HTML or PDF report,
220
+ then runs the scan and shows your 0-100 score with every finding and its
221
+ plain-English fix. Nothing to memorise.
242
222
 
243
- ### From source (for contributing, or trying an unreleased change)
223
+ On Windows Option 2, run `python -m plexavo` if the bare `plexavo`
224
+ command is ever blocked.
244
225
 
245
- ```bash
246
- git clone https://github.com/plexavo/plexavo.git
247
- cd plexavo
248
- uv pip install -e . # or: pip install -e . (inside a venv)
249
- ```
226
+ Scripting a scan into CI or a scheduled job? `plexavo scan --help` covers
227
+ the flag-driven form (`--profile`, `--region`, `--report-html`,
228
+ `--report-pdf`, `--explain`).
250
229
 
251
230
  ## Project structure
252
231
 
@@ -257,6 +236,7 @@ plexavo/
257
236
  ├── findings.py # Finding data model, Severity enum
258
237
  ├── scoring.py # 0-100 score from a list of Findings
259
238
  ├── cli.py # `plexavo scan ...` entry point
239
+ ├── __main__.py # lets `python -m plexavo` run the CLI
260
240
  ├── checks/
261
241
  │ ├── iam.py # IAM-01 to IAM-06 (privilege escalation)
262
242
  │ ├── iam_hygiene.py # IAM-07 to IAM-14 (hygiene, cross-account trust)
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  plexavo/__init__.py
5
+ plexavo/__main__.py
5
6
  plexavo/auth.py
6
7
  plexavo/aws_profile_setup.py
7
8
  plexavo/cli.py
@@ -35,6 +36,7 @@ plexavo/report/fonts/GEIST-FONT-LICENSE.txt
35
36
  plexavo/report/templates/report.html.j2
36
37
  tests/test_ai_narration_offline.py
37
38
  tests/test_auth_offline.py
39
+ tests/test_cli_entrypoint.py
38
40
  tests/test_encryption_offline.py
39
41
  tests/test_iam_hygiene_offline.py
40
42
  tests/test_iam_offline.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "plexavo"
7
- version = "0.2.1"
7
+ version = "0.2.3"
8
8
  description = "Open-source AWS misconfiguration scanner — runs with your own local AWS credentials, nothing sent to anyone else."
9
9
  readme = "README.md"
10
10
  license = { text = "AGPL-3.0-or-later" }
@@ -0,0 +1,51 @@
1
+ """Checks that `python -m plexavo` works and is equivalent to the installed
2
+ `plexavo` command / `python -m plexavo.cli`.
3
+
4
+ This is the Windows install path (README Install section): the venv option
5
+ runs the tool via `py -m plexavo` instead of the Smart-App-Control-blocked
6
+ `plexavo.exe` launcher. If the `plexavo/__main__.py` shim regresses, that
7
+ path breaks.
8
+
9
+ Run: python test_cli_entrypoint.py
10
+ """
11
+
12
+ import subprocess
13
+ import sys
14
+
15
+ failures = 0
16
+
17
+
18
+ def assert_true(cond, msg):
19
+ global failures
20
+ status = "PASS" if cond else "FAIL"
21
+ print(f"[{status}] {msg}")
22
+ if not cond:
23
+ failures += 1
24
+
25
+
26
+ def run(*args):
27
+ return subprocess.run(
28
+ [sys.executable, *args],
29
+ capture_output=True,
30
+ text=True,
31
+ )
32
+
33
+
34
+ print("=== python -m plexavo --version ===")
35
+ mod = run("-m", "plexavo", "--version")
36
+ assert_true(mod.returncode == 0, f"exits 0 (got {mod.returncode}, stderr: {mod.stderr!r})")
37
+ assert_true("plexavo" in (mod.stdout + mod.stderr).lower(), "prints the version string")
38
+
39
+ print("\n=== equivalent to python -m plexavo.cli ===")
40
+ cli = run("-m", "plexavo.cli", "--version")
41
+ assert_true(mod.stdout == cli.stdout, f"same --version output ({mod.stdout!r} vs {cli.stdout!r})")
42
+
43
+ print("\n=== python -m plexavo --help mentions the scan subcommand ===")
44
+ helptext = run("-m", "plexavo", "--help")
45
+ assert_true(helptext.returncode == 0, f"--help exits 0 (got {helptext.returncode})")
46
+ assert_true("scan" in helptext.stdout, "help lists the scan subcommand")
47
+ assert_true("usage: plexavo" in helptext.stdout,
48
+ "usage line shows 'plexavo', not '__main__.py'")
49
+
50
+ print(f"\n{'ALL PASSED' if failures == 0 else f'{failures} FAILURE(S)'}")
51
+ sys.exit(1 if failures else 0)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes