astranyx-engine 4.0.0a1__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 (106) hide show
  1. astranyx_engine-4.0.0a1/LICENSE +0 -0
  2. astranyx_engine-4.0.0a1/PKG-INFO +389 -0
  3. astranyx_engine-4.0.0a1/README.md +363 -0
  4. astranyx_engine-4.0.0a1/astranyx/__init__.py +8 -0
  5. astranyx_engine-4.0.0a1/astranyx/analysis/__init__.py +0 -0
  6. astranyx_engine-4.0.0a1/astranyx/analysis/evidence_gate.py +187 -0
  7. astranyx_engine-4.0.0a1/astranyx/analysis/pipeline.py +50 -0
  8. astranyx_engine-4.0.0a1/astranyx/analysis/taint.py +46 -0
  9. astranyx_engine-4.0.0a1/astranyx/analysis/validation.py +56 -0
  10. astranyx_engine-4.0.0a1/astranyx/cli.py +267 -0
  11. astranyx_engine-4.0.0a1/astranyx/commands/__init__.py +0 -0
  12. astranyx_engine-4.0.0a1/astranyx/commands/report.py +25 -0
  13. astranyx_engine-4.0.0a1/astranyx/core/__init__.py +0 -0
  14. astranyx_engine-4.0.0a1/astranyx/core/html.py +207 -0
  15. astranyx_engine-4.0.0a1/astranyx/core/preview.py +27 -0
  16. astranyx_engine-4.0.0a1/astranyx/core/report.py +39 -0
  17. astranyx_engine-4.0.0a1/astranyx/core/sarif.py +54 -0
  18. astranyx_engine-4.0.0a1/astranyx/core/templates/app.js +45 -0
  19. astranyx_engine-4.0.0a1/astranyx/core/templates/dashboard.html +96 -0
  20. astranyx_engine-4.0.0a1/astranyx/core/templates/style.css +220 -0
  21. astranyx_engine-4.0.0a1/astranyx/graph/callgraph.py +66 -0
  22. astranyx_engine-4.0.0a1/astranyx/graph/dfg.py +41 -0
  23. astranyx_engine-4.0.0a1/astranyx/graph/trust.py +43 -0
  24. astranyx_engine-4.0.0a1/astranyx/intelligence/__init__.py +0 -0
  25. astranyx_engine-4.0.0a1/astranyx/intelligence/classify.py +47 -0
  26. astranyx_engine-4.0.0a1/astranyx/intelligence/cwe.py +73 -0
  27. astranyx_engine-4.0.0a1/astranyx/intelligence/engine.py +37 -0
  28. astranyx_engine-4.0.0a1/astranyx/intelligence/models.py +29 -0
  29. astranyx_engine-4.0.0a1/astranyx/intelligence/recommendations.py +78 -0
  30. astranyx_engine-4.0.0a1/astranyx/intelligence/risk.py +32 -0
  31. astranyx_engine-4.0.0a1/astranyx/intelligence/safe_patterns.py +61 -0
  32. astranyx_engine-4.0.0a1/astranyx/intelligence/scoring.py +53 -0
  33. astranyx_engine-4.0.0a1/astranyx/intelligence/surface.py +26 -0
  34. astranyx_engine-4.0.0a1/astranyx/investigation/__init__.py +1 -0
  35. astranyx_engine-4.0.0a1/astranyx/investigation/manager.py +89 -0
  36. astranyx_engine-4.0.0a1/astranyx/investigation/orchestrator.py +256 -0
  37. astranyx_engine-4.0.0a1/astranyx/investigation/run.py +128 -0
  38. astranyx_engine-4.0.0a1/astranyx/models/ir.py +62 -0
  39. astranyx_engine-4.0.0a1/astranyx/modules/__init__.py +0 -0
  40. astranyx_engine-4.0.0a1/astranyx/modules/js.py +465 -0
  41. astranyx_engine-4.0.0a1/astranyx/output/__init__.py +0 -0
  42. astranyx_engine-4.0.0a1/astranyx/output/html_writer.py +309 -0
  43. astranyx_engine-4.0.0a1/astranyx/output/markdown_writer.py +18 -0
  44. astranyx_engine-4.0.0a1/astranyx/parsers/base.py +35 -0
  45. astranyx_engine-4.0.0a1/astranyx/plugins/__init__.py +0 -0
  46. astranyx_engine-4.0.0a1/astranyx/plugins/analyze.py +136 -0
  47. astranyx_engine-4.0.0a1/astranyx/plugins/dashboard.py +54 -0
  48. astranyx_engine-4.0.0a1/astranyx/plugins/evidence.py +79 -0
  49. astranyx_engine-4.0.0a1/astranyx/plugins/extract.py +41 -0
  50. astranyx_engine-4.0.0a1/astranyx/plugins/focus.py +101 -0
  51. astranyx_engine-4.0.0a1/astranyx/plugins/investigate.py +81 -0
  52. astranyx_engine-4.0.0a1/astranyx/plugins/ipa.py +134 -0
  53. astranyx_engine-4.0.0a1/astranyx/plugins/playbook.py +49 -0
  54. astranyx_engine-4.0.0a1/astranyx/plugins/report.py +116 -0
  55. astranyx_engine-4.0.0a1/astranyx/plugins/review.py +124 -0
  56. astranyx_engine-4.0.0a1/astranyx/plugins/threat.py +147 -0
  57. astranyx_engine-4.0.0a1/astranyx/services/__init__.py +0 -0
  58. astranyx_engine-4.0.0a1/astranyx/services/checklist.py +35 -0
  59. astranyx_engine-4.0.0a1/astranyx/services/data.py +20 -0
  60. astranyx_engine-4.0.0a1/astranyx/services/playbook.py +22 -0
  61. astranyx_engine-4.0.0a1/astranyx/services/status.py +32 -0
  62. astranyx_engine-4.0.0a1/astranyx/telemetry.py +55 -0
  63. astranyx_engine-4.0.0a1/astranyx/tracing.py +28 -0
  64. astranyx_engine-4.0.0a1/astranyx/wordpress/__init__.py +0 -0
  65. astranyx_engine-4.0.0a1/astranyx/wordpress/analyzer.py +90 -0
  66. astranyx_engine-4.0.0a1/astranyx/wordpress/report.py +76 -0
  67. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/__init__.py +0 -0
  68. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/ajax.py +14 -0
  69. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/dangerous.py +11 -0
  70. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/deserialization.py +9 -0
  71. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/include.py +9 -0
  72. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/react.py +21 -0
  73. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/registry.py +32 -0
  74. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/rest.py +14 -0
  75. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/sql.py +16 -0
  76. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/ssrf.py +11 -0
  77. astranyx_engine-4.0.0a1/astranyx/wordpress/rules/upload.py +11 -0
  78. astranyx_engine-4.0.0a1/astranyx/wordpress/scanner.py +200 -0
  79. astranyx_engine-4.0.0a1/astranyx/wordpress/sql.py +23 -0
  80. astranyx_engine-4.0.0a1/astranyx/wordpress/taint.py +73 -0
  81. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/PKG-INFO +389 -0
  82. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/SOURCES.txt +104 -0
  83. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/dependency_links.txt +1 -0
  84. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/entry_points.txt +2 -0
  85. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/requires.txt +2 -0
  86. astranyx_engine-4.0.0a1/astranyx_engine.egg-info/top_level.txt +1 -0
  87. astranyx_engine-4.0.0a1/pyproject.toml +89 -0
  88. astranyx_engine-4.0.0a1/setup.cfg +4 -0
  89. astranyx_engine-4.0.0a1/tests/test_analyze.py +130 -0
  90. astranyx_engine-4.0.0a1/tests/test_checklist.py +12 -0
  91. astranyx_engine-4.0.0a1/tests/test_cli_help.py +71 -0
  92. astranyx_engine-4.0.0a1/tests/test_cli_js_recursive.py +56 -0
  93. astranyx_engine-4.0.0a1/tests/test_cli_version.py +31 -0
  94. astranyx_engine-4.0.0a1/tests/test_evidence.py +32 -0
  95. astranyx_engine-4.0.0a1/tests/test_focus.py +0 -0
  96. astranyx_engine-4.0.0a1/tests/test_investigation.py +141 -0
  97. astranyx_engine-4.0.0a1/tests/test_investigation_options.py +46 -0
  98. astranyx_engine-4.0.0a1/tests/test_investigation_pipeline.py +153 -0
  99. astranyx_engine-4.0.0a1/tests/test_js_investigation.py +57 -0
  100. astranyx_engine-4.0.0a1/tests/test_js_recursive.py +31 -0
  101. astranyx_engine-4.0.0a1/tests/test_playbook.py +9 -0
  102. astranyx_engine-4.0.0a1/tests/test_report.py +10 -0
  103. astranyx_engine-4.0.0a1/tests/test_review.py +12 -0
  104. astranyx_engine-4.0.0a1/tests/test_status.py +8 -0
  105. astranyx_engine-4.0.0a1/tests/test_threat.py +0 -0
  106. astranyx_engine-4.0.0a1/tests/test_tracing.py +35 -0
File without changes
@@ -0,0 +1,389 @@
1
+ Metadata-Version: 2.4
2
+ Name: astranyx-engine
3
+ Version: 4.0.0a1
4
+ Summary: Astranyx Investigation Engine
5
+ Author: Jonathan Mendiola
6
+ Project-URL: Homepage, https://github.com/jonathanrey87/Astranyx
7
+ Project-URL: Repository, https://github.com/jonathanrey87/Astranyx
8
+ Project-URL: Issues, https://github.com/jonathanrey87/Astranyx/issues
9
+ Keywords: security,static-analysis,sast,threat-intelligence,wordpress,sarif
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Information Technology
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: arize-otel<0.14,>=0.13.0
24
+ Requires-Dist: opentelemetry-api<2,>=1.44.0
25
+ Dynamic: license-file
26
+
27
+ <div align="center">
28
+
29
+ # ASTRANYX
30
+
31
+ **Investigation Engine**
32
+
33
+ Where signals emerge from the dark.
34
+
35
+ `Version 4.0.0a1` · `Alpha` · `Python 3.11+`
36
+
37
+ </div>
38
+
39
+ Astranyx is a security-analysis framework for reviewing source code, JavaScript bundles, and WordPress plugins.
40
+
41
+ It combines pattern discovery, data-flow analysis, validation evidence, confidence scoring, attack-surface classification, and reporting—helping analysts separate suspicious behavior from findings with demonstrated security impact.
42
+
43
+ ## Core principles
44
+
45
+ Astranyx follows four operating principles:
46
+
47
+ - **Observe** — identify routes, sinks, trust boundaries, and security-relevant patterns.
48
+ - **Correlate** — connect findings with validation routines, data flow, and context.
49
+ - **Prioritize** — rank findings using evidence, confidence, and demonstrated impact.
50
+ - **Defend** — produce actionable reports and remediation guidance.
51
+
52
+ Astranyx records evidence without assuming that every suspicious response or code pattern is exploitable.
53
+
54
+ ## Implemented capabilities
55
+
56
+ ### JavaScript analysis
57
+
58
+ Astranyx can analyze directories containing JavaScript bundles and identify patterns associated with:
59
+
60
+ - Network requests
61
+ - Authentication and OAuth
62
+ - GraphQL
63
+ - Uploads
64
+ - Administrative functionality
65
+ - Collaboration features
66
+ - Application routes
67
+
68
+ Results can be written to JSON and associated with an Astranyx investigation workspace.
69
+
70
+ ### WordPress plugin analysis
71
+
72
+ The WordPress scanner includes checks for:
73
+
74
+ - Public REST routes
75
+ - Missing authorization checks
76
+ - Dynamic includes
77
+ - Deserialization
78
+ - SSRF sinks
79
+ - SQL queries
80
+ - React dangerous sinks
81
+ - Upload functionality
82
+ - Taint-flow relationships
83
+
84
+ The analyzer applies nearby validation and safe-pattern evidence to reduce noise.
85
+
86
+ ### Analysis framework
87
+
88
+ The analysis package currently includes:
89
+
90
+ - Data-flow graphs
91
+ - Call graphs
92
+ - Trust classification
93
+ - Taint analysis
94
+ - Validation-routine detection
95
+ - Evidence-based finding decisions
96
+ - Pluggable analysis stages
97
+ - A default evidence-analysis pipeline
98
+
99
+ ### Evidence gate
100
+
101
+ The evidence gate rejects findings that lack observable security impact.
102
+
103
+ Current decision categories include:
104
+
105
+ | Category | Required evidence |
106
+ |---|---|
107
+ | PII disclosure | A non-empty sensitive value |
108
+ | CRLF/header injection | A separate injected response header |
109
+ | Open redirect | A final destination outside trusted domains |
110
+ | CORS | Cross-origin access to authenticated sensitive data |
111
+ | HTTP 500 | Data exposure, authorization impact, stack disclosure, or measurable availability impact |
112
+ | GraphQL | Unauthorized protected data |
113
+ | Health endpoint | Sensitive operational data rather than status alone |
114
+
115
+ A successful query, wildcard CORS header, generic server error, or public health response is not automatically considered reportable.
116
+
117
+ ### Reporting
118
+
119
+ Astranyx contains support for:
120
+
121
+ - HTML
122
+ - Markdown
123
+ - JSON
124
+ - CSV
125
+ - SARIF
126
+ - Source previews
127
+ - Confidence summaries
128
+ - Risk summaries
129
+ - Attack-surface classification
130
+
131
+ ## Requirements
132
+
133
+ - Python 3.11 or newer
134
+ - Linux, macOS, or another Python-compatible environment
135
+ - A virtual environment is recommended
136
+
137
+ Runtime dependencies, including OpenTelemetry and Arize tracing support, are declared in `pyproject.toml` and installed automatically with Astranyx:
138
+
139
+ ```bash
140
+ python -m venv venv
141
+ source venv/bin/activate
142
+
143
+ python -m pip install --upgrade pip
144
+ python -m pip install -e .
145
+ ```
146
+
147
+ For development and testing:
148
+
149
+ ```bash
150
+ python -m pip install pytest
151
+ ```
152
+
153
+ ## Command-line interface
154
+
155
+ Show available commands:
156
+
157
+ ```bash
158
+ python -m astranyx.cli --help
159
+ ```
160
+
161
+ ### Analyze JavaScript
162
+
163
+ ```bash
164
+ python -m astranyx.cli js analyze ./path/to/javascript
165
+ ```
166
+
167
+ Write the report to a specific file:
168
+
169
+ ```bash
170
+ python -m astranyx.cli js analyze ./path/to/javascript \
171
+ --output report.json
172
+ ```
173
+
174
+ Recursively discover JavaScript files in nested directories:
175
+
176
+ ```bash
177
+ python -m astranyx.cli js analyze ./path/to/javascript \
178
+ --recursive \
179
+ --output report.json
180
+ ```
181
+
182
+ Recursive reports preserve paths relative to the analysis root, such as `assets/js/app.js`.
183
+
184
+ Associate results with an investigation:
185
+
186
+ ```bash
187
+ python -m astranyx.cli js analyze ./path/to/javascript \
188
+ --investigation investigations/INV-YYYYMMDD-HHMMSS
189
+ ```
190
+
191
+ ### Audit a WordPress plugin
192
+
193
+ ```bash
194
+ python -m astranyx.cli wordpress ./path/to/plugin
195
+ ```
196
+
197
+ Only analyze plugins and code that you own or are authorized to assess.
198
+
199
+ ### Run an investigation
200
+
201
+ Create an empty workspace with default metadata:
202
+
203
+ ```bash
204
+ astranyx investigate
205
+ ```
206
+
207
+ Run automatic local-target detection and the compatible analyzers:
208
+
209
+ ```bash
210
+ astranyx investigate ./path/to/authorized-target
211
+ ```
212
+
213
+ Choose the complete local web profile and identify the analyst:
214
+
215
+ ```bash
216
+ astranyx investigate /path/to/authorized-target \
217
+ --profile web \
218
+ --analyst "Jonathan Mendiola"
219
+ ```
220
+
221
+ Available profiles are `auto`, `web`, `javascript`, and `wordpress`. Recursive
222
+ discovery is enabled by default and can be disabled with `--no-recursive`.
223
+ `--target` remains available as a compatibility alias for the positional path.
224
+
225
+ The command creates a timestamped workspace containing directories for analysis,
226
+ API evidence, HTML, JavaScript, logs, notes, reports, and screenshots. With a
227
+ target, Astranyx runs each selected analyzer, isolates module failures, updates
228
+ `metadata.json`, and writes `manifest.json` with SHA-256 hashes for every generated
229
+ analysis and report artifact.
230
+
231
+ Choose a different workspace parent directory when needed:
232
+
233
+ ```bash
234
+ astranyx investigate ./authorized-target \
235
+ --workspace-root ./casework
236
+ ```
237
+
238
+ Example completed workspace:
239
+
240
+ ```text
241
+ investigations/INV-YYYYMMDD-HHMMSS/
242
+ ├── analysis/javascript.json
243
+ ├── reports/wordpress/
244
+ │ ├── index.html
245
+ │ ├── findings.csv
246
+ │ ├── findings.json
247
+ │ └── findings.sarif
248
+ ├── manifest.json
249
+ └── metadata.json
250
+ ```
251
+
252
+ ### Generate reports
253
+
254
+ ```bash
255
+ python -m astranyx.cli report ./path/to/report.json
256
+ ```
257
+
258
+ ## Evidence-pipeline example
259
+
260
+ ```python
261
+ from astranyx.analysis.pipeline import build_default_pipeline
262
+
263
+ pipeline = build_default_pipeline()
264
+
265
+ result = pipeline.execute(
266
+ {
267
+ "finding_evidence": [
268
+ {
269
+ "category": "graphql",
270
+ "protected_data": False,
271
+ },
272
+ {
273
+ "category": "http_500",
274
+ "data_exposure": True,
275
+ },
276
+ ]
277
+ }
278
+ )
279
+
280
+ for decision in result["evidence_decisions"]:
281
+ print(decision.reportable, decision.reason)
282
+
283
+ print("Reportable findings:", result["reportable_findings"])
284
+ ```
285
+
286
+ In this example, anonymous GraphQL execution without protected data is rejected, while a server error with demonstrated data exposure is retained.
287
+
288
+ ## Project structure
289
+
290
+ ```text
291
+ astranyx/
292
+ ├── analysis/ Evidence gates, pipeline, taint, and validation
293
+ ├── commands/ CLI command implementations
294
+ ├── core/ Reports, HTML, SARIF, and source previews
295
+ ├── graph/ Call, data-flow, and trust graphs
296
+ ├── intelligence/ Classification, scoring, risk, and recommendations
297
+ ├── investigation/ Investigation workspace management
298
+ ├── modules/ Language and artifact analyzers
299
+ ├── output/ HTML and Markdown writers
300
+ ├── parsers/ Parser interfaces
301
+ ├── plugins/ Analysis and workflow plugins
302
+ ├── services/ Checklists, playbooks, data, and status
303
+ └── wordpress/ WordPress scanning and analysis
304
+ ```
305
+
306
+ ## Testing
307
+
308
+ Run the complete test suite:
309
+
310
+ ```bash
311
+ python -m pytest -q
312
+ ```
313
+
314
+ The current suite covers:
315
+
316
+ - Evidence decisions
317
+ - Analysis-pipeline execution
318
+ - Validation detection
319
+ - Taint analysis
320
+ - Intermediate representation
321
+ - Call graphs
322
+ - Data-flow graphs
323
+ - Trust analysis
324
+ - Parsers
325
+ - Reports
326
+ - Review workflows
327
+ - Checklists
328
+ - Playbooks
329
+ - Status and threat functionality
330
+
331
+ ## Tracing
332
+
333
+ Astranyx supports optional Arize/OpenTelemetry tracing.
334
+
335
+ Set both variables before running the CLI:
336
+
337
+ ```bash
338
+ export ARIZE_SPACE_ID='your-space-id'
339
+ export ARIZE_API_KEY='your-api-key'
340
+ ```
341
+
342
+ If tracing credentials are absent, Astranyx is intended to run without exporting traces.
343
+
344
+ Never commit tracing credentials, session tokens, cookies, or API keys.
345
+
346
+ ## Development status
347
+
348
+ Astranyx is under active development. Current limitations include:
349
+
350
+ - Alpha APIs and data formats
351
+ - The evidence pipeline is available through `build_default_pipeline()` but is not yet connected to every scanner and report path
352
+ - Some modules use different finding models
353
+ - CLI and investigation behavior are still evolving
354
+ - Documentation and packaging require further validation
355
+
356
+ ## Roadmap
357
+
358
+ Planned work includes:
359
+
360
+ - Unified finding and evidence models
361
+ - Evidence-gate integration across scanners
362
+ - Cross-file taint propagation
363
+ - Historical comparison and baselines
364
+ - Framework-specific analyzers
365
+ - Expanded report schemas
366
+ - Plugin interfaces
367
+ - Dependency and packaging cleanup
368
+ - Additional integration tests
369
+
370
+ Roadmap items are plans, not completed capabilities.
371
+
372
+ ## Responsible use
373
+
374
+ Use Astranyx only on:
375
+
376
+ - Systems and code you own
377
+ - Local test environments
378
+ - Explicitly authorized security assessments
379
+ - Bug-bounty assets that are clearly in scope
380
+
381
+ Avoid collecting unrelated users’ private data, bypassing rate limits, causing availability impact, or treating scanner output as proof without independent validation.
382
+
383
+ ## Author
384
+
385
+ Created by Jonathan Mendiola.
386
+
387
+ ## License
388
+
389
+ A `LICENSE` file exists in the repository but currently contains no license text. Add the intended license before distributing the project.