@orionscanner/cli 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +248 -0
- package/assets/logo.png +0 -0
- package/bin/orion.js +48 -0
- package/docs/API_REFERENCE.md +211 -0
- package/docs/ARCHITECTURE.md +183 -0
- package/docs/CHANGELOG.md +112 -0
- package/docs/CONTRIBUTING.md +157 -0
- package/docs/ENGINE_CATALOG.md +87 -0
- package/docs/GETTING_STARTED.md +226 -0
- package/package.json +48 -0
- package/pyproject.toml +16 -0
- package/src/orion/__init__.py +0 -0
- package/src/orion/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/orion/engine/__init__.py +17 -0
- package/src/orion/engine/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/config.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/core.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/ir.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/languages.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/registry.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/results.cpython-313.pyc +0 -0
- package/src/orion/engine/__pycache__/runner.cpython-313.pyc +0 -0
- package/src/orion/engine/api_security/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/api_security/engine.py +125 -0
- package/src/orion/engine/architecture/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/architecture/engine.py +463 -0
- package/src/orion/engine/authorization/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/authorization/engine.py +337 -0
- package/src/orion/engine/callgraph/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/callgraph/engine.py +236 -0
- package/src/orion/engine/cfg/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/cfg/engine.py +509 -0
- package/src/orion/engine/chaos/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/chaos/engine.py +268 -0
- package/src/orion/engine/chaos_config/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/chaos_config/engine.py +322 -0
- package/src/orion/engine/complexity/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/complexity/engine.py +144 -0
- package/src/orion/engine/compliance/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/compliance/engine.py +325 -0
- package/src/orion/engine/config.py +41 -0
- package/src/orion/engine/config_engine/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/config_engine/engine.py +364 -0
- package/src/orion/engine/config_validation/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/config_validation/engine.py +313 -0
- package/src/orion/engine/container/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/container/engine.py +546 -0
- package/src/orion/engine/contract_probe/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/contract_probe/engine.py +316 -0
- package/src/orion/engine/core.py +75 -0
- package/src/orion/engine/crypto_guard/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/crypto_guard/engine.py +134 -0
- package/src/orion/engine/data_residency/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/data_residency/engine.py +238 -0
- package/src/orion/engine/dataflow/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/dataflow/engine.py +398 -0
- package/src/orion/engine/dead_import/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/dead_import/engine.py +293 -0
- package/src/orion/engine/deps/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/deps/engine.py +244 -0
- package/src/orion/engine/dispatcher.py +350 -0
- package/src/orion/engine/docs/AUDIT_PROMPT.md +1248 -0
- package/src/orion/engine/duplication/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/duplication/engine.py +120 -0
- package/src/orion/engine/error_handling/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/error_handling/engine.py +256 -0
- package/src/orion/engine/fp_learn/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/fp_learn/engine.py +248 -0
- package/src/orion/engine/hunter/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/hunter/engine.py +324 -0
- package/src/orion/engine/iac_security/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/iac_security/engine.py +218 -0
- package/src/orion/engine/ir.py +22 -0
- package/src/orion/engine/languages.py +454 -0
- package/src/orion/engine/license/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/license/engine.py +172 -0
- package/src/orion/engine/lint/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/lint/engine.py +558 -0
- package/src/orion/engine/llm_security/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/llm_security/engine.py +125 -0
- package/src/orion/engine/logging_c/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/logging_c/engine.py +164 -0
- package/src/orion/engine/noise/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/noise/engine.py +140 -0
- package/src/orion/engine/orphan/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/orphan/engine.py +244 -0
- package/src/orion/engine/perf_guard/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/perf_guard/engine.py +345 -0
- package/src/orion/engine/prompt_security/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/prompt_security/detectors/__init__.py +4 -0
- package/src/orion/engine/prompt_security/engine.py +170 -0
- package/src/orion/engine/provenance/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/provenance/engine.py +242 -0
- package/src/orion/engine/registry.py +55 -0
- package/src/orion/engine/regression/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/regression/engine.py +213 -0
- package/src/orion/engine/results.py +21 -0
- package/src/orion/engine/runner.py +1310 -0
- package/src/orion/engine/sandbox_escape/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/sandbox_escape/engine.py +284 -0
- package/src/orion/engine/sast/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/sast/engine.py +217 -0
- package/src/orion/engine/sast/patterns/__init__.py +513 -0
- package/src/orion/engine/sast/patterns/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/orion/engine/secrets/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/secrets/engine.py +77 -0
- package/src/orion/engine/secrets/patterns/__init__.py +74 -0
- package/src/orion/engine/secrets/patterns/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/orion/engine/sensitive_data/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/sensitive_data/engine.py +143 -0
- package/src/orion/engine/state/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/state/engine.py +218 -0
- package/src/orion/engine/supply_chain_sbom/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/supply_chain_sbom/engine.py +290 -0
- package/src/orion/engine/symbol/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/symbol/engine.py +463 -0
- package/src/orion/engine/taint/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/taint/engine.py +464 -0
- package/src/orion/engine/test_coverage/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/test_coverage/engine.py +445 -0
- package/src/orion/engine/threat_model/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/threat_model/engine.py +126 -0
- package/src/orion/engine/wiring_trace/__pycache__/engine.cpython-313.pyc +0 -0
- package/src/orion/engine/wiring_trace/engine.py +200 -0
- package/src/orion_engine.egg-info/PKG-INFO +7 -0
- package/src/orion_engine.egg-info/SOURCES.txt +65 -0
- package/src/orion_engine.egg-info/dependency_links.txt +1 -0
- package/src/orion_engine.egg-info/entry_points.txt +2 -0
- package/src/orion_engine.egg-info/top_level.txt +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Chandra Hotha
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Orion Security Suite (v0.1.0)
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="assets/logo.png" alt="Orion Security Suite" width="420" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Proprietary In-House Code Intelligence, Static Application Security Testing (SAST) & Architecture Auditing Platform</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version 0.1.0" />
|
|
13
|
+
<img src="https://img.shields.io/badge/license-Proprietary%20%2F%20In--House-green.svg" alt="License" />
|
|
14
|
+
<img src="https://img.shields.io/badge/python-%3E%3D3.10-blue.svg" alt="Python Version" />
|
|
15
|
+
<img src="https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg" alt="Platform" />
|
|
16
|
+
<img src="https://img.shields.io/badge/architecture-100%25%20In--House%20Local-purple.svg" alt="Architecture" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Executive Overview
|
|
22
|
+
|
|
23
|
+
**Orion Security Suite** is a unified, enterprise-grade static analysis, software security, and architecture intelligence platform. Every auditing engine is **100% custom-built and developed in-house**, executing locally with zero third-party wrappers, zero external CLI subprocess dependencies, and zero telemetry.
|
|
24
|
+
|
|
25
|
+
Orion operates on a unified **Intermediate Representation (IR)** graph, performing AST semantic analysis, Inter-Procedural Control Flow Graphs (CFG), Taint Propagation, AI/LLM agent defense, Cloud/IaC misconfiguration audits, and comprehensive PII/PCI-DSS privacy inspections.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Key Capabilities & Highlights
|
|
30
|
+
|
|
31
|
+
| Capability | Orion Engine Architecture |
|
|
32
|
+
| :--- | :--- |
|
|
33
|
+
| **100% In-House Local IP** | All AST visitors, taint trackers, heuristics, and tokenizers run natively in pure Python. |
|
|
34
|
+
| **Comprehensive Scope** | Single unified run covering Application Security, Cloud/IaC, AI Prompt/Agent Defense, Code Quality, and Architecture. |
|
|
35
|
+
| **Phased Indexing** | Clear, multi-phase AST indexing and CFG synthesis without jumpy animations or progress-bar console jitter. |
|
|
36
|
+
| **Cross-Engine Deduplication** | Correlates and collapses overlapping findings across multiple engines with confidence scoring. |
|
|
37
|
+
| **Executive Reports** | Generates self-contained HTML dashboards with one-click print/PDF layout, JSON findings catalog, and TXT summaries in `ORION SCANNER REPORTS/`. |
|
|
38
|
+
| **Isolated Execution** | Async/await execution model with per-engine resource limits, sandboxing, and timeout protection. |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Proprietary In-House Engine Suite
|
|
43
|
+
|
|
44
|
+
Orion features a full matrix of specialized auditing engines grouped by domain:
|
|
45
|
+
|
|
46
|
+
### 1. Application Security & Deep SAST
|
|
47
|
+
- **DeepSAST™ (`sast`)**: Detects SQL Injection, XSS, Command Injection, SSRF, Path Traversal, Insecure Deserialization, and Weak Ciphers.
|
|
48
|
+
- **TaintFlow™ (`taint`)**: Inter-procedural AST taint propagation tracking untrusted inputs to critical execution sinks.
|
|
49
|
+
- **KeyVault™ (`secrets`)**: High-entropy token analysis and pattern matching for leaked API keys, private keys, and passwords.
|
|
50
|
+
- **AuthGate™ (`authorization`)**: Route-level access control auditor verifying RBAC/ABAC enforcement across web frameworks.
|
|
51
|
+
- **CryptoGuard™ (`crypto_guard`)**: Cryptographic posture validator flagging outdated algorithms (MD5, SHA1, DES, ECB mode).
|
|
52
|
+
- **APIGuard™ (`api_security`)**: OWASP API Top 10 inspector auditing endpoint rate limiting, input validation, and JWT signatures.
|
|
53
|
+
- **ContainerBreak™ (`sandbox_escape`)**: Detects sandbox escape vectors, unsafe reflection, `ctypes`, and dangerous native calls.
|
|
54
|
+
|
|
55
|
+
### 2. AI, LLM & Threat Modeling
|
|
56
|
+
- **AegisAgent™ (`llm_security` / `prompt_security`)**: Audits LLM applications for prompt injection, jailbreak attempts, unconstrained tool use, and insecure output handling.
|
|
57
|
+
- **ThreatPulse™ (`threat_model`)**: Automated STRIDE threat modeling analyzing trust boundaries, unprotected persistence crossings, and cascading I/O.
|
|
58
|
+
|
|
59
|
+
### 3. Privacy, Compliance & Supply Chain
|
|
60
|
+
- **PrivacyShield™ (`sensitive_data`)**: Scans for PII, GDPR, HIPAA, and PCI-DSS violations with proprietary Luhn PAN validation and SSN detectors.
|
|
61
|
+
- **DataBound™ (`data_residency`)**: Verifies data sovereignty and storage boundaries to prevent unauthorized geographic transfers.
|
|
62
|
+
- **SBOMTracker™ (`supply_chain_sbom` / `deps`)**: In-house Software Bill of Materials (SBOM) generator and dependency vulnerability scanner.
|
|
63
|
+
- **LicenseGuard™ (`license`)**: Scans for GPL/AGPL copyleft license contamination and license compatibility conflicts.
|
|
64
|
+
- **ProvenanceTrace™ (`provenance`)**: Audits source code build integrity, commit signing indicators, and pipeline reproducibility.
|
|
65
|
+
|
|
66
|
+
### 4. Code Quality, Standards & Reliability
|
|
67
|
+
- **CognitivePulse™ (`complexity`)**: Computes cyclomatic complexity, cognitive load metrics, and deeply nested logic paths.
|
|
68
|
+
- **CloneMatrix™ (`duplication`)**: Token-based duplicate code and structural redundancy detector.
|
|
69
|
+
- **CleanSweep™ (`dead_import` / `orphan`)**: Identifies unreferenced symbols, orphan functions, and dead code stores.
|
|
70
|
+
- **ResilienceGuard™ (`error_handling`)**: Detects empty exception handlers (`except: pass`), swallowed errors, and unhandled promises.
|
|
71
|
+
- **CodeStandard™ (`lint`)**: Static code quality and best practices enforcement without stylistic noise.
|
|
72
|
+
- **CoverageGuard™ (`test_coverage`)**: Heuristic test-to-code ratio and missing unit test coverage detector.
|
|
73
|
+
|
|
74
|
+
### 5. Architecture, Dataflow & Performance
|
|
75
|
+
- **CallGraph360™ (`callgraph`)**: Constructs comprehensive whole-program call graphs and dependency coupling hierarchies.
|
|
76
|
+
- **FlowCFG™ (`cfg`)**: Builds control flow graphs to detect unreachable branches, infinite loops, and execution anomalies.
|
|
77
|
+
- **SymbolMatrix™ (`symbol`)**: Analyzes symbol resolution, shadowed builtins, and scope collisions.
|
|
78
|
+
- **DataFlowIR™ (`dataflow`)**: Intra-function data flow analyzer detecting use-before-def and uninitialized state.
|
|
79
|
+
- **SpeedGuard™ (`perf_guard`)**: Identifies algorithmic performance anti-patterns, nested O(n²) loops, and unindexed lookups.
|
|
80
|
+
- **RegressionShield™ (`regression`)**: Flags fragile patterns, runtime monkey patching, and unsafe reflection.
|
|
81
|
+
- **WiringTrace™ (`wiring_trace`)**: Dependency injection and component wiring validator.
|
|
82
|
+
- **StateGuard™ (`state`)**: Concurrency analysis detecting unprotected shared mutable state and race conditions.
|
|
83
|
+
|
|
84
|
+
### 6. Cloud, IaC & Resilience
|
|
85
|
+
- **CloudSentry™ (`container`)**: Dockerfile and container security analyzer (root execution, exposed daemon sockets, multi-stage builds).
|
|
86
|
+
- **IaCGuard™ (`iac_security`)**: Terraform, CloudFormation, and Kubernetes manifest auditor for security group and IAM misconfigurations.
|
|
87
|
+
- **ConfigPulse™ (`config_engine` / `config_validation`)**: Validates environment variables, `.env` hygiene, and application configuration drift.
|
|
88
|
+
- **ChaosProbe™ (`chaos` / `chaos_config`)**: Injects fault tolerance simulations and verifies circuit breaker recovery mechanisms.
|
|
89
|
+
- **NoiseFilter™ (`noise`)**: Machine-level false positive suppression and signal-to-noise optimization.
|
|
90
|
+
- **HunterCore™ (`hunter`)**: Heuristic zero-day vulnerability hunter for unusual code patterns.
|
|
91
|
+
- **FPLearn™ (`fp_learn`)**: Contextual learning feedback loop to minimize recurring false positives.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Quick Start & Installation
|
|
96
|
+
|
|
97
|
+
### Local Editable Installation
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Clone or navigate to the Orion Engine repository
|
|
101
|
+
cd D:/Homeworks/Orion_Engine
|
|
102
|
+
|
|
103
|
+
# Install in editable mode
|
|
104
|
+
pip install -e .
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Verification
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
orion --help
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Command Line Interface (CLI)
|
|
116
|
+
|
|
117
|
+
Orion provides a formatted CLI with steady status reporting and dedicated sections for **Security Vulnerabilities** and **Code Quality Standards**:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Run a full audit across all proprietary engines on current directory
|
|
121
|
+
orion .
|
|
122
|
+
|
|
123
|
+
# Audit a specific repository or file
|
|
124
|
+
orion /path/to/project
|
|
125
|
+
orion ./src/app.py
|
|
126
|
+
|
|
127
|
+
# Specialized Targeted Scans:
|
|
128
|
+
orion . --security # Application Security & Deep SAST
|
|
129
|
+
orion . --threat # Automated STRIDE Threat Modeling & Privacy (PII)
|
|
130
|
+
orion . --iac # Infrastructure as Code & Container Security
|
|
131
|
+
orion . --ai # AI, LLM Prompt Security & Agent Defense
|
|
132
|
+
orion . --quality # Code Quality, Complexity & Linter
|
|
133
|
+
orion . --architecture # Call Graph, CFG & Data Flow Analysis
|
|
134
|
+
orion . --supply-chain # SBOM, Dependencies & License Auditing
|
|
135
|
+
|
|
136
|
+
# Interactive Management Console:
|
|
137
|
+
orion
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Executive Reporting Outputs
|
|
143
|
+
|
|
144
|
+
Every execution automatically cleans previous artifacts and produces three reports in `ORION SCANNER REPORTS/`:
|
|
145
|
+
|
|
146
|
+
1. **`orion_executive_security_report.html`**:
|
|
147
|
+
- High-clarity executive security dashboard.
|
|
148
|
+
- Interactive severity (`Critical`, `High`, `Medium`, `Low`) and category filter tabs (`Security`, `Code Quality`, `Architecture`, `Supply Chain`).
|
|
149
|
+
- Clean, self-contained layout with zero external CSS/JS dependencies.
|
|
150
|
+
- Built-in **🖨️ Export PDF / Print Report** stylesheet optimized for executive presentations.
|
|
151
|
+
2. **`orion_executive_security_report.json`**:
|
|
152
|
+
- Machine-readable structured findings catalog with metadata, CWE identifiers, confidence scores, and contributing engine attribution.
|
|
153
|
+
3. **`orion_executive_security_report.txt`**:
|
|
154
|
+
- Clean plaintext audit summary ideal for CI/CD terminal logs and build pipelines.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Python Programmatic API
|
|
159
|
+
|
|
160
|
+
You can integrate Orion directly into custom Python pipelines:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
import asyncio
|
|
164
|
+
from pathlib import Path
|
|
165
|
+
from orion.engine import OrionEngine, EngineConfig, ResourceLimits
|
|
166
|
+
from orion.engine.ir import OrionIR
|
|
167
|
+
|
|
168
|
+
async def audit_codebase():
|
|
169
|
+
# 1. Initialize Orion Engine
|
|
170
|
+
engine = OrionEngine()
|
|
171
|
+
|
|
172
|
+
# 2. Build Intermediate Representation (IR)
|
|
173
|
+
file_path = Path("src/server.py")
|
|
174
|
+
ir = OrionIR(
|
|
175
|
+
content=file_path.read_bytes(),
|
|
176
|
+
metadata={
|
|
177
|
+
"path": str(file_path),
|
|
178
|
+
"language": "python",
|
|
179
|
+
"project_root": "."
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# 3. Configure Execution Limits
|
|
184
|
+
config = EngineConfig(
|
|
185
|
+
resource_limits=ResourceLimits(
|
|
186
|
+
max_cpu_seconds=30,
|
|
187
|
+
max_memory_mb=256
|
|
188
|
+
)
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# 4. Execute Engine Suite
|
|
192
|
+
result = await engine.run([ir], config)
|
|
193
|
+
|
|
194
|
+
# 5. Process Findings
|
|
195
|
+
print(f"Total Findings: {len(result.findings)}")
|
|
196
|
+
for finding in result.findings:
|
|
197
|
+
print(f"[{finding.severity.upper()}] {finding.title} ({finding.location})")
|
|
198
|
+
print(f" Engine: {finding.engine} | Confidence: {finding.metadata.get('confidence')}")
|
|
199
|
+
|
|
200
|
+
if __name__ == "__main__":
|
|
201
|
+
asyncio.run(audit_codebase())
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Supported Languages & File Formats
|
|
207
|
+
|
|
208
|
+
Orion automatically detects and audits:
|
|
209
|
+
- **Languages**: Python (`.py`), JavaScript (`.js`, `.jsx`, `.mjs`), TypeScript (`.ts`, `.tsx`), Go (`.go`), Java (`.java`), Rust (`.rs`), Ruby (`.rb`), PHP (`.php`), C/C++ (`.c`, `.cpp`, `.h`), C# (`.cs`), Shell (`.sh`, `.bash`), SQL (`.sql`).
|
|
210
|
+
- **Infrastructure & Configs**: Dockerfile, `docker-compose.yml`, Kubernetes manifests (`.yaml`, `.yml`), Terraform (`.tf`), GitHub Actions workflows (`.github/workflows/*.yml`), `.env` configuration files.
|
|
211
|
+
- **Manifests & Dependencies**: `requirements.txt`, `pyproject.toml`, `Pipfile`, `package.json`, `package-lock.json`, `go.mod`, `Cargo.toml`, `pom.xml`.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Project Structure
|
|
216
|
+
|
|
217
|
+
```text
|
|
218
|
+
Orion_Engine/
|
|
219
|
+
├── assets/
|
|
220
|
+
│ └── logo.png # Official Orion Emblem & Logo
|
|
221
|
+
├── src/
|
|
222
|
+
│ └── orion/
|
|
223
|
+
│ └── engine/
|
|
224
|
+
│ ├── core.py # OrionEngine Core Coordinator
|
|
225
|
+
│ ├── ir.py # Intermediate Representation (IR)
|
|
226
|
+
│ ├── runner.py # CLI Runner, Formatter & Report Generator
|
|
227
|
+
│ ├── registry.py # Dynamic In-House Engine Discovery
|
|
228
|
+
│ ├── config.py # Engine Configurations & Resource Limits
|
|
229
|
+
│ ├── results.py # Finding & EngineResult Data Models
|
|
230
|
+
│ ├── sast/ # DeepSAST™ Engine
|
|
231
|
+
│ ├── taint/ # TaintFlow™ Engine
|
|
232
|
+
│ ├── secrets/ # KeyVault™ Engine
|
|
233
|
+
│ ├── threat_model/ # ThreatPulse™ STRIDE Engine
|
|
234
|
+
│ ├── sensitive_data/ # PrivacyShield™ PII/PCI Engine
|
|
235
|
+
│ ├── llm_security/ # AegisAgent™ AI/LLM Security Engine
|
|
236
|
+
│ ├── perf_guard/ # SpeedGuard™ Performance Engine
|
|
237
|
+
│ ├── iac_security/ # IaCGuard™ Cloud/IaC Engine
|
|
238
|
+
│ └── ... # (All in-house proprietary engines)
|
|
239
|
+
├── ORION SCANNER REPORTS/ # Output Directory for Latest Generated Reports
|
|
240
|
+
├── pyproject.toml # Package Configuration (v0.1.0)
|
|
241
|
+
└── README.md # Documentation
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## License & Compliance
|
|
247
|
+
|
|
248
|
+
Orion Security Suite is a proprietary, in-house developed codebase intelligence platform. All engines, AST visitors, and parsers are original intellectual property engineered to run self-contained on local infrastructure.
|
package/assets/logo.png
ADDED
|
Binary file
|
package/bin/orion.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Orion Security Suite - Global NPM CLI Wrapper (v0.1.0)
|
|
4
|
+
* 100% In-House Code Intelligence & SAST Platform
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { spawn } = require('child_process');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
|
|
11
|
+
const projectRoot = path.resolve(__dirname, '..');
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
|
|
14
|
+
function runPython(pythonCmd) {
|
|
15
|
+
const pythonEnv = Object.assign({}, process.env, {
|
|
16
|
+
PYTHONPATH: path.join(projectRoot, 'src') + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : '')
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const scriptPath = path.join(projectRoot, 'src', 'orion', 'engine', 'runner.py');
|
|
20
|
+
const child = spawn(pythonCmd, [scriptPath, ...args], {
|
|
21
|
+
stdio: 'inherit',
|
|
22
|
+
env: pythonEnv,
|
|
23
|
+
cwd: process.cwd()
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
child.on('error', (err) => {
|
|
27
|
+
if (pythonCmd === 'python3') {
|
|
28
|
+
runPython('python');
|
|
29
|
+
} else if (pythonCmd === 'python') {
|
|
30
|
+
runPython('py');
|
|
31
|
+
} else {
|
|
32
|
+
console.error('\x1b[31m✖ Error: Python 3.10+ is required to execute Orion Engine.\x1b[0m');
|
|
33
|
+
console.error('Please ensure Python is installed and added to your PATH environment variable.');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
child.on('close', (code) => {
|
|
39
|
+
process.exit(code || 0);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Start with standard python executable or python3
|
|
44
|
+
if (process.platform === 'win32') {
|
|
45
|
+
runPython('python');
|
|
46
|
+
} else {
|
|
47
|
+
runPython('python3');
|
|
48
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
## Core Classes
|
|
4
|
+
|
|
5
|
+
### OrionEngine
|
|
6
|
+
Main orchestrator — single entry point for all 38 engines.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
from orion.engine import OrionEngine, EngineConfig, ResourceLimits
|
|
10
|
+
from orion.engine.ir import OrionIR
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
engine = OrionEngine()
|
|
14
|
+
ir = OrionIR(content=code.encode(), metadata={"path": "app.py", "language": "python"})
|
|
15
|
+
config = EngineConfig(resource_limits=ResourceLimits(max_cpu_seconds=60))
|
|
16
|
+
|
|
17
|
+
result = await engine.run([ir], config)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Methods:**
|
|
21
|
+
- `register_engine(name: str, engine_cls: type)` — Register custom engine
|
|
22
|
+
- `run(irs: List[OrionIR], config: EngineConfig) -> EngineResult` — Run all engines
|
|
23
|
+
- `registered_count: int` — Number of registered engines
|
|
24
|
+
|
|
25
|
+
### EngineConfig
|
|
26
|
+
Configuration for scan execution.
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
config = EngineConfig(
|
|
30
|
+
toggles={
|
|
31
|
+
"exclude": ["tests/", "vendor/", "*.min.js"],
|
|
32
|
+
"only_engines": ["sast", "secrets", "deps"],
|
|
33
|
+
"severity_threshold": "medium",
|
|
34
|
+
},
|
|
35
|
+
resource_limits=ResourceLimits(
|
|
36
|
+
max_cpu_seconds=120,
|
|
37
|
+
max_memory_mb=1024,
|
|
38
|
+
max_file_size_mb=10,
|
|
39
|
+
max_files=50000
|
|
40
|
+
),
|
|
41
|
+
network_policy=NetworkPolicy(
|
|
42
|
+
allow_outbound=False,
|
|
43
|
+
allowed_hosts=[]
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### ResourceLimits
|
|
49
|
+
Per-engine resource constraints.
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
ResourceLimits(
|
|
53
|
+
max_cpu_seconds=60, # Timeout per engine
|
|
54
|
+
max_memory_mb=512, # Memory limit
|
|
55
|
+
max_file_size_mb=10, # Max file size to scan
|
|
56
|
+
max_files=50000 # Max files per scan
|
|
57
|
+
)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### NetworkPolicy
|
|
61
|
+
Network access control.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
NetworkPolicy(
|
|
65
|
+
allow_outbound=False, # Block external calls
|
|
66
|
+
allowed_hosts=[] # Allowlist (if outbound enabled)
|
|
67
|
+
)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### OrionIR
|
|
71
|
+
Intermediate Representation — content-addressed, immutable.
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
ir = OrionIR(
|
|
75
|
+
content=b"source code bytes",
|
|
76
|
+
metadata={
|
|
77
|
+
"path": "relative/path.py",
|
|
78
|
+
"language": "python",
|
|
79
|
+
"project_root": "/absolute/project/root"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Properties
|
|
84
|
+
ir.address # SHA-256 hash (first 16 chars)
|
|
85
|
+
ir.content # Raw bytes
|
|
86
|
+
ir.metadata # Dict with path, language, project_root
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### EngineResult
|
|
90
|
+
Aggregated scan results.
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
result = EngineResult(
|
|
94
|
+
engine="orion", # Orchestrator name
|
|
95
|
+
findings=[Finding, ...], # List of findings
|
|
96
|
+
errors=["engine: error"], # Engine errors (silent to user)
|
|
97
|
+
metrics={ # Scan metadata
|
|
98
|
+
"elapsed_s": 1.23,
|
|
99
|
+
"engines_run": 38,
|
|
100
|
+
"files_scanned": 150
|
|
101
|
+
},
|
|
102
|
+
ok=True # False if any engine errored
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Finding
|
|
107
|
+
Individual security/quality issue.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
finding = Finding(
|
|
111
|
+
engine="sast", # Source engine
|
|
112
|
+
severity="critical", # critical|high|medium|low|info
|
|
113
|
+
title="SQL Injection", # Short title
|
|
114
|
+
description="User input in SQL", # Detailed description
|
|
115
|
+
location="app.py:42", # file:line
|
|
116
|
+
metadata={ # Evidence
|
|
117
|
+
"confidence": 0.95, # 0.0-1.0
|
|
118
|
+
"snippet": "query = f\"...\"", # Code context
|
|
119
|
+
"cwe": "CWE-89", # CWE ID
|
|
120
|
+
"cvss": 8.9, # CVSS score
|
|
121
|
+
"pattern": "sql_injection", # Pattern name
|
|
122
|
+
"file": "app.py", # File path
|
|
123
|
+
"line": 42 # Line number
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Engine Interface
|
|
129
|
+
|
|
130
|
+
All engines implement this interface:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
class Engine:
|
|
134
|
+
name = "engine_name"
|
|
135
|
+
version = "1.0.0"
|
|
136
|
+
|
|
137
|
+
async def check_availability(self) -> bool:
|
|
138
|
+
"""Return True if engine can run."""
|
|
139
|
+
return True
|
|
140
|
+
|
|
141
|
+
def resource_limits(self) -> ResourceLimits:
|
|
142
|
+
"""Return resource limits for this engine."""
|
|
143
|
+
return ResourceLimits(max_cpu_seconds=60, max_memory_mb=512)
|
|
144
|
+
|
|
145
|
+
async def run(self, ir: OrionIR, config: EngineConfig) -> EngineResult:
|
|
146
|
+
"""Analyze a single IR."""
|
|
147
|
+
# Language detection
|
|
148
|
+
language = ir.metadata.get("language")
|
|
149
|
+
if isinstance(language, str):
|
|
150
|
+
language = Language(language.lower())
|
|
151
|
+
|
|
152
|
+
# Route to language-specific analyzer
|
|
153
|
+
if language == Language.PYTHON:
|
|
154
|
+
return await self._run_python_ast(ir, config)
|
|
155
|
+
|
|
156
|
+
# Universal regex fallback
|
|
157
|
+
return self.universal.run(ir, config)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## CLI Usage
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Interactive menu
|
|
164
|
+
orion
|
|
165
|
+
|
|
166
|
+
# Direct scan
|
|
167
|
+
orion . --security # Security engines only
|
|
168
|
+
orion . --quality # Quality engines only
|
|
169
|
+
orion . --arch # Architecture engines only
|
|
170
|
+
orion . # Full audit (all 38 engines)
|
|
171
|
+
orion path/to/file.py # Single file
|
|
172
|
+
orion ./my_project # Directory scan
|
|
173
|
+
|
|
174
|
+
# Config
|
|
175
|
+
orion . --config-json '{"resource_limits":{"max_cpu_seconds":30}}'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Reports
|
|
179
|
+
|
|
180
|
+
Generated in `ORION SCANNER REPORTS/`:
|
|
181
|
+
- `ScanType_target_timestamp.html` — Dark theme, sidebar, expandable findings, score/grade
|
|
182
|
+
- `ScanType_target_timestamp.json` — Machine-readable
|
|
183
|
+
- `ScanType_target_timestamp.txt` — Human-readable summary
|
|
184
|
+
|
|
185
|
+
## Language Detection
|
|
186
|
+
|
|
187
|
+
Automatic from file extension/filename:
|
|
188
|
+
|
|
189
|
+
| Extension | Language |
|
|
190
|
+
|-----------|----------|
|
|
191
|
+
| `.py` | python |
|
|
192
|
+
| `.js`, `.jsx`, `.mjs` | javascript |
|
|
193
|
+
| `.ts`, `.tsx` | typescript |
|
|
194
|
+
| `.java` | java |
|
|
195
|
+
| `.go` | go |
|
|
196
|
+
| `.rs` | rust |
|
|
197
|
+
| `.php` | php |
|
|
198
|
+
| `.rb` | ruby |
|
|
199
|
+
| `.cs` | csharp |
|
|
200
|
+
| `.html`, `.htm` | html |
|
|
201
|
+
| `.css`, `.scss` | css |
|
|
202
|
+
| `.yml`, `.yaml` | yaml |
|
|
203
|
+
| `.json` | json |
|
|
204
|
+
| `.toml` | toml |
|
|
205
|
+
| `.xml` | xml |
|
|
206
|
+
| `Dockerfile` | dockerfile |
|
|
207
|
+
| `.sh` | shell |
|
|
208
|
+
| `.ps1` | powershell |
|
|
209
|
+
| `.md` | markdown |
|
|
210
|
+
|
|
211
|
+
Special filenames: `Dockerfile`, `Makefile`, `package.json`, `requirements.txt`, `Cargo.toml`, `pom.xml`, `go.mod`, `composer.json`, `Gemfile`, `pyproject.toml`, `poetry.lock`, `yarn.lock`, `pnpm-lock.yaml`
|