spl-tls-analyze 0.3.0b0__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.
- spl_tls_analyze-0.3.0b0/PKG-INFO +203 -0
- spl_tls_analyze-0.3.0b0/README.md +184 -0
- spl_tls_analyze-0.3.0b0/decision_orchestrator/__init__.py +41 -0
- spl_tls_analyze-0.3.0b0/decision_orchestrator/policy.py +320 -0
- spl_tls_analyze-0.3.0b0/decision_orchestrator/reporter.py +461 -0
- spl_tls_analyze-0.3.0b0/decision_orchestrator/schema.py +71 -0
- spl_tls_analyze-0.3.0b0/experiments/__init__.py +9 -0
- spl_tls_analyze-0.3.0b0/experiments/dsl_helpers.py +69 -0
- spl_tls_analyze-0.3.0b0/experiments/experiment_runner.py +338 -0
- spl_tls_analyze-0.3.0b0/experiments/metrics.py +206 -0
- spl_tls_analyze-0.3.0b0/experiments/promotion_readiness.py +199 -0
- spl_tls_analyze-0.3.0b0/experiments/real_data_loader.py +221 -0
- spl_tls_analyze-0.3.0b0/experiments/real_validation_runner.py +884 -0
- spl_tls_analyze-0.3.0b0/experiments/replication.py +224 -0
- spl_tls_analyze-0.3.0b0/experiments/replication_report.py +290 -0
- spl_tls_analyze-0.3.0b0/experiments/report.py +214 -0
- spl_tls_analyze-0.3.0b0/experiments/stability.py +119 -0
- spl_tls_analyze-0.3.0b0/experiments/status.py +30 -0
- spl_tls_analyze-0.3.0b0/frontier/__init__.py +10 -0
- spl_tls_analyze-0.3.0b0/frontier/metrics.py +78 -0
- spl_tls_analyze-0.3.0b0/frontier/reports.py +50 -0
- spl_tls_analyze-0.3.0b0/frontier/session.py +70 -0
- spl_tls_analyze-0.3.0b0/pyproject.toml +40 -0
- spl_tls_analyze-0.3.0b0/scripts/__init__.py +1 -0
- spl_tls_analyze-0.3.0b0/scripts/build_real_data_dataset.py +805 -0
- spl_tls_analyze-0.3.0b0/scripts/collect_real_tls_data.py +359 -0
- spl_tls_analyze-0.3.0b0/scripts/decision_path_audit.py +615 -0
- spl_tls_analyze-0.3.0b0/scripts/evaluate_spl_vs_baseline.py +292 -0
- spl_tls_analyze-0.3.0b0/scripts/ocsp_checker.py +472 -0
- spl_tls_analyze-0.3.0b0/scripts/run_adversarial_validation.py +167 -0
- spl_tls_analyze-0.3.0b0/scripts/run_decision_orchestration_benchmark.py +459 -0
- spl_tls_analyze-0.3.0b0/scripts/run_dogfood_cli.py +172 -0
- spl_tls_analyze-0.3.0b0/scripts/run_frontier_validation.py +226 -0
- spl_tls_analyze-0.3.0b0/scripts/run_local_tls_validation.py +853 -0
- spl_tls_analyze-0.3.0b0/scripts/run_ofe_experiment.py +40 -0
- spl_tls_analyze-0.3.0b0/scripts/run_real_tls_spl_decision_validation.py +912 -0
- spl_tls_analyze-0.3.0b0/scripts/run_reliability_campaign.py +376 -0
- spl_tls_analyze-0.3.0b0/scripts/run_replication.py +103 -0
- spl_tls_analyze-0.3.0b0/scripts/run_stratified_benchmark.py +875 -0
- spl_tls_analyze-0.3.0b0/scripts/run_tls_policy_adapter_benchmark.py +665 -0
- spl_tls_analyze-0.3.0b0/scripts/run_validation_evaluation.py +564 -0
- spl_tls_analyze-0.3.0b0/scripts/run_weakness_mapper.py +74 -0
- spl_tls_analyze-0.3.0b0/scripts/spl_tls_analyze.py +791 -0
- spl_tls_analyze-0.3.0b0/scripts/validate_real_tls_data.py +228 -0
- spl_tls_analyze-0.3.0b0/scripts/verify_release.py +463 -0
- spl_tls_analyze-0.3.0b0/setup.cfg +4 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/PKG-INFO +203 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/SOURCES.txt +91 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/dependency_links.txt +1 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/entry_points.txt +2 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/requires.txt +16 -0
- spl_tls_analyze-0.3.0b0/spl_tls_analyze.egg-info/top_level.txt +7 -0
- spl_tls_analyze-0.3.0b0/spl_v7/__init__.py +38 -0
- spl_tls_analyze-0.3.0b0/spl_v7/causal.py +1076 -0
- spl_tls_analyze-0.3.0b0/spl_v7/dashboard.py +248 -0
- spl_tls_analyze-0.3.0b0/spl_v7/dsl.py +379 -0
- spl_tls_analyze-0.3.0b0/spl_v7/frontier.py +304 -0
- spl_tls_analyze-0.3.0b0/spl_v7/kafka_pipeline.py +284 -0
- spl_tls_analyze-0.3.0b0/spl_v7/schema.py +126 -0
- spl_tls_analyze-0.3.0b0/spl_v7/utils.py +99 -0
- spl_tls_analyze-0.3.0b0/spl_v7/verification.py +163 -0
- spl_tls_analyze-0.3.0b0/tests/test_causal.py +21 -0
- spl_tls_analyze-0.3.0b0/tests/test_cli_golden_acceptance.py +359 -0
- spl_tls_analyze-0.3.0b0/tests/test_cross_source_intervention.py +75 -0
- spl_tls_analyze-0.3.0b0/tests/test_decision_orchestrator.py +1407 -0
- spl_tls_analyze-0.3.0b0/tests/test_docker_docs.py +90 -0
- spl_tls_analyze-0.3.0b0/tests/test_dsl.py +31 -0
- spl_tls_analyze-0.3.0b0/tests/test_experiments.py +338 -0
- spl_tls_analyze-0.3.0b0/tests/test_frontier.py +91 -0
- spl_tls_analyze-0.3.0b0/tests/test_frontier_contract.py +140 -0
- spl_tls_analyze-0.3.0b0/tests/test_frontier_hardening.py +198 -0
- spl_tls_analyze-0.3.0b0/tests/test_independence_stability.py +66 -0
- spl_tls_analyze-0.3.0b0/tests/test_package_entry.py +166 -0
- spl_tls_analyze-0.3.0b0/tests/test_pipeline.py +40 -0
- spl_tls_analyze-0.3.0b0/tests/test_real_data_contract.py +209 -0
- spl_tls_analyze-0.3.0b0/tests/test_real_validation_runner.py +440 -0
- spl_tls_analyze-0.3.0b0/tests/test_replication.py +269 -0
- spl_tls_analyze-0.3.0b0/tests/test_spl_decision_validation.py +763 -0
- spl_tls_analyze-0.3.0b0/tests/test_spl_tls_analyze.py +894 -0
- spl_tls_analyze-0.3.0b0/tests/test_tls_policy_adapter.py +720 -0
- spl_tls_analyze-0.3.0b0/tests/test_tls_probe.py +248 -0
- spl_tls_analyze-0.3.0b0/tests/test_v71_hardening.py +100 -0
- spl_tls_analyze-0.3.0b0/tests/test_weakness_mapper.py +290 -0
- spl_tls_analyze-0.3.0b0/tls_policy_adapter/__init__.py +58 -0
- spl_tls_analyze-0.3.0b0/tls_policy_adapter/evidence_adapter.py +94 -0
- spl_tls_analyze-0.3.0b0/tls_policy_adapter/risk_policy.py +74 -0
- spl_tls_analyze-0.3.0b0/tls_policy_adapter/schema.py +297 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/__init__.py +13 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/boundaries.py +55 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/cluster.py +57 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/extractor.py +174 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/registry.py +115 -0
- spl_tls_analyze-0.3.0b0/weakness_mapper/reporter.py +87 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spl-tls-analyze
|
|
3
|
+
Version: 0.3.0b0
|
|
4
|
+
Summary: Fast, zero-dependency TLS risk analysis with OCSP revocation detection and structured decisions
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Provides-Extra: kafka
|
|
8
|
+
Requires-Dist: confluent-kafka>=2.5; extra == "kafka"
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
11
|
+
Provides-Extra: ca-store
|
|
12
|
+
Requires-Dist: certifi>=2024.0.0; extra == "ca-store"
|
|
13
|
+
Provides-Extra: spl-core
|
|
14
|
+
Requires-Dist: numpy>=1.26; extra == "spl-core"
|
|
15
|
+
Requires-Dist: plotly>=5.20; extra == "spl-core"
|
|
16
|
+
Requires-Dist: networkx>=3.2; extra == "spl-core"
|
|
17
|
+
Requires-Dist: fastapi>=0.111; extra == "spl-core"
|
|
18
|
+
Requires-Dist: uvicorn>=0.30; extra == "spl-core"
|
|
19
|
+
|
|
20
|
+
# SPL TLS Risk Analyzer
|
|
21
|
+
|
|
22
|
+
Fast, zero-dependency TLS risk analysis with OCSP revocation detection and structured decisions.
|
|
23
|
+
|
|
24
|
+
Probes domains for TLS certificate validity, checks OCSP revocation, detects deprecated protocols (TLS 1.0/1.1), and produces ALLOW/REVIEW/DENY decisions across 15 risk categories with 5 severity levels. 3 operating profiles. JSON + Markdown structured output. No pip install required.
|
|
25
|
+
|
|
26
|
+
**Not production ready.** See `docs/KNOWN_LIMITATIONS.md`.
|
|
27
|
+
|
|
28
|
+
**Local Beta Freeze — v0.2.0b0.** See `docs/RELEASE_NOTES_0.2.0b0.md`
|
|
29
|
+
and `docs/LOCAL_BETA_FREEZE_MANIFEST.md`.
|
|
30
|
+
|
|
31
|
+
## What It Does
|
|
32
|
+
|
|
33
|
+
- **TLS probing** — certificate validity, expiry, chain trust, protocol version via Python `ssl`
|
|
34
|
+
- **OCSP revocation checking** — AIA responder URL extraction + OCSP staple verification
|
|
35
|
+
- **Deprecated TLS detection** — secondary probe forces TLS 1.0 negotiation to detect legacy support
|
|
36
|
+
- **15 risk categories** — VALID_TLS, EXPIRED_CERT, REVOKED_CERT, SELF_SIGNED_CERT, WRONG_HOST_CERT, UNTRUSTED_CHAIN, INCOMPLETE_CHAIN, WEAK_SIGNATURE_ALGORITHM, DNS_FAILURE, CONNECTION_ERROR, TIMEOUT, TLS_HANDSHAKE_FAILURE, OCSP_UNREACHABLE, UNKNOWN_SSL_ERROR, DEPRECATED_TLS_VERSION
|
|
37
|
+
- **5 severity levels** — NONE -> LOW -> MEDIUM -> HIGH -> CRITICAL
|
|
38
|
+
- **3 operating profiles** — conservative, balanced (default), strict
|
|
39
|
+
- **3 output formats** — structured console text, JSON (with schema), Markdown
|
|
40
|
+
- **Zero external dependencies** — stdlib only (Python 3.10+)
|
|
41
|
+
- **Batch analysis** — domain list files with progress reporting
|
|
42
|
+
|
|
43
|
+
## Limitations
|
|
44
|
+
|
|
45
|
+
- No multi-IP or IPv6 probing
|
|
46
|
+
- Not production-ready — see `docs/KNOWN_LIMITATIONS.md`
|
|
47
|
+
- SPL evidence pipeline (`--spl` flag) requires optional `[spl-core]` extras
|
|
48
|
+
|
|
49
|
+
## Quickstart
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# From the project root:
|
|
53
|
+
cd spl_v7_project_with_frontier/spl_v7_project
|
|
54
|
+
|
|
55
|
+
# Analyze a single domain
|
|
56
|
+
python scripts/spl_tls_analyze.py example.com
|
|
57
|
+
|
|
58
|
+
# Batch analysis with strict profile, JSON output
|
|
59
|
+
python scripts/spl_tls_analyze.py domains.txt --profile strict --json-out report.json
|
|
60
|
+
|
|
61
|
+
# Markdown report with conservative profile
|
|
62
|
+
python scripts/spl_tls_analyze.py domains.txt --profile conservative --markdown-out report.md
|
|
63
|
+
|
|
64
|
+
# Quiet mode — batch summary only
|
|
65
|
+
python scripts/spl_tls_analyze.py domains.txt --quiet
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
No pip install required. Python 3.10+.
|
|
69
|
+
|
|
70
|
+
Docker image available: see `docs/DOCKER_USAGE.md`.
|
|
71
|
+
|
|
72
|
+
## Profiles
|
|
73
|
+
|
|
74
|
+
| Profile | ALLOW Threshold | HIGH Security | Deprecated TLS | Fallback ALLOW | Use Case |
|
|
75
|
+
|---------|:-:|:-:|:-:|:-:|----------|
|
|
76
|
+
| **balanced** (default) | 0.5 | REVIEW | REVIEW | Clean VALID_TLS only | General-purpose |
|
|
77
|
+
| **conservative** | 0.7 | REVIEW | REVIEW | Never | High-sensitivity |
|
|
78
|
+
| **strict** | 0.7 | DENY | DENY | Never | Security-critical |
|
|
79
|
+
|
|
80
|
+
See `docs/OPERATING_PROFILES.md` for full details.
|
|
81
|
+
|
|
82
|
+
## Run Tests
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Official release verification (13 checks)
|
|
86
|
+
python scripts/verify_release.py
|
|
87
|
+
|
|
88
|
+
# Or run individual components:
|
|
89
|
+
|
|
90
|
+
# All tests (530 tests)
|
|
91
|
+
python -m unittest discover -s tests -v
|
|
92
|
+
|
|
93
|
+
# With pytest
|
|
94
|
+
python -m pytest tests/ -q
|
|
95
|
+
|
|
96
|
+
# Compile check
|
|
97
|
+
python -m compileall -q spl_v7 experiments scripts tests tls_policy_adapter decision_orchestrator
|
|
98
|
+
|
|
99
|
+
# Golden acceptance tests
|
|
100
|
+
python -m pytest tests/test_cli_golden_acceptance.py -v
|
|
101
|
+
|
|
102
|
+
# Docker build (optional)
|
|
103
|
+
docker build -t spl-tls-analyze:0.2.0b0 .
|
|
104
|
+
|
|
105
|
+
# Docker smoke tests
|
|
106
|
+
python -m pytest tests/test_docker_docs.py -v
|
|
107
|
+
|
|
108
|
+
# VPS dry-run script (Linux/macOS)
|
|
109
|
+
./scripts/run_vps_dry_run.sh
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Project Structure
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
spl_v7/ SPL Core (untouched since Phase 1)
|
|
116
|
+
tls_policy_adapter/ Risk category mapping (Phase 6)
|
|
117
|
+
decision_orchestrator/ Decision rules + profiles (Phase 7/8)
|
|
118
|
+
scripts/
|
|
119
|
+
spl_tls_analyze.py CLI entry point (Phase 9)
|
|
120
|
+
verify_release.py Release verification (13 checks)
|
|
121
|
+
run_docker_dogfood.ps1 Docker dogfood helper
|
|
122
|
+
run_vps_dry_run.sh VPS dry-run script (Linux)
|
|
123
|
+
run_vps_dry_run.ps1 VPS dry-run script (PowerShell)
|
|
124
|
+
run_dogfood_cli.py Dogfood runner
|
|
125
|
+
generate_golden_fixtures.ps1 Golden snapshot generator
|
|
126
|
+
...
|
|
127
|
+
tests/
|
|
128
|
+
test_cli_golden_acceptance.py Golden acceptance tests (Phase 10)
|
|
129
|
+
test_spl_tls_analyze.py CLI unit tests (Phase 9)
|
|
130
|
+
test_decision_orchestrator.py Orchestrator tests (Phase 7/7.5/8)
|
|
131
|
+
test_tls_policy_adapter.py Adapter tests (Phase 6/6.5)
|
|
132
|
+
test_docker_docs.py Docker smoke tests (Phase 15)
|
|
133
|
+
...
|
|
134
|
+
datasets/
|
|
135
|
+
cli_golden_samples.json Golden sample definitions (Phase 10)
|
|
136
|
+
vps_dry_run_domains.txt VPS dry-run dataset (15 domains)
|
|
137
|
+
docs/
|
|
138
|
+
CLI_USAGE.md Full CLI reference
|
|
139
|
+
CLI_OUTPUT_SCHEMA.md JSON schema
|
|
140
|
+
CLI_GOLDEN_TESTING.md Golden testing methodology
|
|
141
|
+
CLI_EXAMPLES.md Example runs
|
|
142
|
+
KNOWN_LIMITATIONS.md Known limitations
|
|
143
|
+
OPERATING_PROFILES.md Profile definitions
|
|
144
|
+
RELEASE_NOTES_0.2.0b0.md Release notes
|
|
145
|
+
LOCAL_BETA_FREEZE_MANIFEST.md Freeze manifest
|
|
146
|
+
RELEASE_CHECKLIST.md Pre-release checklist
|
|
147
|
+
TEST_SUITE_STATUS.md Test suite breakdown
|
|
148
|
+
DOGFOOD_FINDINGS.md Dogfood analysis
|
|
149
|
+
CLI_CONFIDENCE_FALLBACK_POLICY.md Fallback policy
|
|
150
|
+
DOCKER_USAGE.md Docker build and usage
|
|
151
|
+
VPS_DRY_RUN.md VPS dry-run guide
|
|
152
|
+
VPS_DRY_RUN_REPORT_TEMPLATE.md VPS dry-run report template
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Exit Codes
|
|
156
|
+
|
|
157
|
+
| Code | Meaning |
|
|
158
|
+
|------|---------|
|
|
159
|
+
| 0 | All domains ALLOW |
|
|
160
|
+
| 1 | One or more REVIEW (no DENY) |
|
|
161
|
+
| 2 | One or more DENY |
|
|
162
|
+
| 3 | All domains errored |
|
|
163
|
+
| 4 | Invalid arguments |
|
|
164
|
+
|
|
165
|
+
## Dogfood Results
|
|
166
|
+
|
|
167
|
+
See `docs/DOGFOOD_FINDINGS.md` for results of running the CLI against
|
|
168
|
+
31 real public domains. Key findings:
|
|
169
|
+
|
|
170
|
+
- **31/31 domains probed**, 0 errors, 0 timeouts
|
|
171
|
+
- **After Phase 13 fallback: 19 ALLOW, 11 REVIEW, 1 DENY**
|
|
172
|
+
- **Before Phase 13: 0 ALLOW, 30 REVIEW, 1 DENY** (fallback was missing)
|
|
173
|
+
- **wrong.host.badssl.com correctly DENY'd**
|
|
174
|
+
- **revoked.badssl.com correctly detected as REVOKED_CERT** — OCSP checking now implemented
|
|
175
|
+
- **deprecated TLS detected (e.g. TLSv1.1)** — secondary probe forces lower version negotiation
|
|
176
|
+
- **Exit code 2 (DENY) clearly signals action needed**
|
|
177
|
+
- **Fallback ALLOW is adapter-policy based, not SPL confidence** — see `docs/CLI_CONFIDENCE_FALLBACK_POLICY.md`
|
|
178
|
+
|
|
179
|
+
The CLI is now practical for routine scanning (exit code 0 fires for clean domains).
|
|
180
|
+
|
|
181
|
+
## Key Documents
|
|
182
|
+
|
|
183
|
+
- `docs/CLI_USAGE.md` — Full CLI reference
|
|
184
|
+
- `docs/CLI_OUTPUT_SCHEMA.md` — JSON output schema
|
|
185
|
+
- `docs/CLI_EXAMPLES.md` — Example runs with output
|
|
186
|
+
- `docs/CLI_CONFIDENCE_FALLBACK_POLICY.md` — Fallback policy design
|
|
187
|
+
- `docs/CLI_GOLDEN_TESTING.md` — Golden acceptance testing
|
|
188
|
+
- `docs/KNOWN_LIMITATIONS.md` — All known limitations
|
|
189
|
+
- `docs/OPERATING_PROFILES.md` — Profile definitions
|
|
190
|
+
- `docs/RELEASE_CHECKLIST.md` — Pre-release checklist
|
|
191
|
+
- `docs/TEST_SUITE_STATUS.md` — Test suite breakdown
|
|
192
|
+
- `docs/RELEASE_NOTES_0.2.0b0.md` — Release notes
|
|
193
|
+
- `docs/LOCAL_BETA_FREEZE_MANIFEST.md` — Freeze manifest with stable contracts
|
|
194
|
+
- `docs/DOCKER_USAGE.md` — Docker build and usage
|
|
195
|
+
- `docs/VPS_DRY_RUN.md` — VPS dry run guide
|
|
196
|
+
- `docs/VPS_DRY_RUN_REPORT_TEMPLATE.md` — VPS dry run report template
|
|
197
|
+
- `docs/DECISION_ORCHESTRATION_POLICY.md` — Orchestrator design
|
|
198
|
+
- `docs/DECISION_SEMANTICS_AUDIT.md` — Decision semantics
|
|
199
|
+
- `docs/TLS_RISK_POLICY_ADAPTER.md` — Adapter design
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
See `LICENSE` or project documentation.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# SPL TLS Risk Analyzer
|
|
2
|
+
|
|
3
|
+
Fast, zero-dependency TLS risk analysis with OCSP revocation detection and structured decisions.
|
|
4
|
+
|
|
5
|
+
Probes domains for TLS certificate validity, checks OCSP revocation, detects deprecated protocols (TLS 1.0/1.1), and produces ALLOW/REVIEW/DENY decisions across 15 risk categories with 5 severity levels. 3 operating profiles. JSON + Markdown structured output. No pip install required.
|
|
6
|
+
|
|
7
|
+
**Not production ready.** See `docs/KNOWN_LIMITATIONS.md`.
|
|
8
|
+
|
|
9
|
+
**Local Beta Freeze — v0.2.0b0.** See `docs/RELEASE_NOTES_0.2.0b0.md`
|
|
10
|
+
and `docs/LOCAL_BETA_FREEZE_MANIFEST.md`.
|
|
11
|
+
|
|
12
|
+
## What It Does
|
|
13
|
+
|
|
14
|
+
- **TLS probing** — certificate validity, expiry, chain trust, protocol version via Python `ssl`
|
|
15
|
+
- **OCSP revocation checking** — AIA responder URL extraction + OCSP staple verification
|
|
16
|
+
- **Deprecated TLS detection** — secondary probe forces TLS 1.0 negotiation to detect legacy support
|
|
17
|
+
- **15 risk categories** — VALID_TLS, EXPIRED_CERT, REVOKED_CERT, SELF_SIGNED_CERT, WRONG_HOST_CERT, UNTRUSTED_CHAIN, INCOMPLETE_CHAIN, WEAK_SIGNATURE_ALGORITHM, DNS_FAILURE, CONNECTION_ERROR, TIMEOUT, TLS_HANDSHAKE_FAILURE, OCSP_UNREACHABLE, UNKNOWN_SSL_ERROR, DEPRECATED_TLS_VERSION
|
|
18
|
+
- **5 severity levels** — NONE -> LOW -> MEDIUM -> HIGH -> CRITICAL
|
|
19
|
+
- **3 operating profiles** — conservative, balanced (default), strict
|
|
20
|
+
- **3 output formats** — structured console text, JSON (with schema), Markdown
|
|
21
|
+
- **Zero external dependencies** — stdlib only (Python 3.10+)
|
|
22
|
+
- **Batch analysis** — domain list files with progress reporting
|
|
23
|
+
|
|
24
|
+
## Limitations
|
|
25
|
+
|
|
26
|
+
- No multi-IP or IPv6 probing
|
|
27
|
+
- Not production-ready — see `docs/KNOWN_LIMITATIONS.md`
|
|
28
|
+
- SPL evidence pipeline (`--spl` flag) requires optional `[spl-core]` extras
|
|
29
|
+
|
|
30
|
+
## Quickstart
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# From the project root:
|
|
34
|
+
cd spl_v7_project_with_frontier/spl_v7_project
|
|
35
|
+
|
|
36
|
+
# Analyze a single domain
|
|
37
|
+
python scripts/spl_tls_analyze.py example.com
|
|
38
|
+
|
|
39
|
+
# Batch analysis with strict profile, JSON output
|
|
40
|
+
python scripts/spl_tls_analyze.py domains.txt --profile strict --json-out report.json
|
|
41
|
+
|
|
42
|
+
# Markdown report with conservative profile
|
|
43
|
+
python scripts/spl_tls_analyze.py domains.txt --profile conservative --markdown-out report.md
|
|
44
|
+
|
|
45
|
+
# Quiet mode — batch summary only
|
|
46
|
+
python scripts/spl_tls_analyze.py domains.txt --quiet
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
No pip install required. Python 3.10+.
|
|
50
|
+
|
|
51
|
+
Docker image available: see `docs/DOCKER_USAGE.md`.
|
|
52
|
+
|
|
53
|
+
## Profiles
|
|
54
|
+
|
|
55
|
+
| Profile | ALLOW Threshold | HIGH Security | Deprecated TLS | Fallback ALLOW | Use Case |
|
|
56
|
+
|---------|:-:|:-:|:-:|:-:|----------|
|
|
57
|
+
| **balanced** (default) | 0.5 | REVIEW | REVIEW | Clean VALID_TLS only | General-purpose |
|
|
58
|
+
| **conservative** | 0.7 | REVIEW | REVIEW | Never | High-sensitivity |
|
|
59
|
+
| **strict** | 0.7 | DENY | DENY | Never | Security-critical |
|
|
60
|
+
|
|
61
|
+
See `docs/OPERATING_PROFILES.md` for full details.
|
|
62
|
+
|
|
63
|
+
## Run Tests
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Official release verification (13 checks)
|
|
67
|
+
python scripts/verify_release.py
|
|
68
|
+
|
|
69
|
+
# Or run individual components:
|
|
70
|
+
|
|
71
|
+
# All tests (530 tests)
|
|
72
|
+
python -m unittest discover -s tests -v
|
|
73
|
+
|
|
74
|
+
# With pytest
|
|
75
|
+
python -m pytest tests/ -q
|
|
76
|
+
|
|
77
|
+
# Compile check
|
|
78
|
+
python -m compileall -q spl_v7 experiments scripts tests tls_policy_adapter decision_orchestrator
|
|
79
|
+
|
|
80
|
+
# Golden acceptance tests
|
|
81
|
+
python -m pytest tests/test_cli_golden_acceptance.py -v
|
|
82
|
+
|
|
83
|
+
# Docker build (optional)
|
|
84
|
+
docker build -t spl-tls-analyze:0.2.0b0 .
|
|
85
|
+
|
|
86
|
+
# Docker smoke tests
|
|
87
|
+
python -m pytest tests/test_docker_docs.py -v
|
|
88
|
+
|
|
89
|
+
# VPS dry-run script (Linux/macOS)
|
|
90
|
+
./scripts/run_vps_dry_run.sh
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Project Structure
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
spl_v7/ SPL Core (untouched since Phase 1)
|
|
97
|
+
tls_policy_adapter/ Risk category mapping (Phase 6)
|
|
98
|
+
decision_orchestrator/ Decision rules + profiles (Phase 7/8)
|
|
99
|
+
scripts/
|
|
100
|
+
spl_tls_analyze.py CLI entry point (Phase 9)
|
|
101
|
+
verify_release.py Release verification (13 checks)
|
|
102
|
+
run_docker_dogfood.ps1 Docker dogfood helper
|
|
103
|
+
run_vps_dry_run.sh VPS dry-run script (Linux)
|
|
104
|
+
run_vps_dry_run.ps1 VPS dry-run script (PowerShell)
|
|
105
|
+
run_dogfood_cli.py Dogfood runner
|
|
106
|
+
generate_golden_fixtures.ps1 Golden snapshot generator
|
|
107
|
+
...
|
|
108
|
+
tests/
|
|
109
|
+
test_cli_golden_acceptance.py Golden acceptance tests (Phase 10)
|
|
110
|
+
test_spl_tls_analyze.py CLI unit tests (Phase 9)
|
|
111
|
+
test_decision_orchestrator.py Orchestrator tests (Phase 7/7.5/8)
|
|
112
|
+
test_tls_policy_adapter.py Adapter tests (Phase 6/6.5)
|
|
113
|
+
test_docker_docs.py Docker smoke tests (Phase 15)
|
|
114
|
+
...
|
|
115
|
+
datasets/
|
|
116
|
+
cli_golden_samples.json Golden sample definitions (Phase 10)
|
|
117
|
+
vps_dry_run_domains.txt VPS dry-run dataset (15 domains)
|
|
118
|
+
docs/
|
|
119
|
+
CLI_USAGE.md Full CLI reference
|
|
120
|
+
CLI_OUTPUT_SCHEMA.md JSON schema
|
|
121
|
+
CLI_GOLDEN_TESTING.md Golden testing methodology
|
|
122
|
+
CLI_EXAMPLES.md Example runs
|
|
123
|
+
KNOWN_LIMITATIONS.md Known limitations
|
|
124
|
+
OPERATING_PROFILES.md Profile definitions
|
|
125
|
+
RELEASE_NOTES_0.2.0b0.md Release notes
|
|
126
|
+
LOCAL_BETA_FREEZE_MANIFEST.md Freeze manifest
|
|
127
|
+
RELEASE_CHECKLIST.md Pre-release checklist
|
|
128
|
+
TEST_SUITE_STATUS.md Test suite breakdown
|
|
129
|
+
DOGFOOD_FINDINGS.md Dogfood analysis
|
|
130
|
+
CLI_CONFIDENCE_FALLBACK_POLICY.md Fallback policy
|
|
131
|
+
DOCKER_USAGE.md Docker build and usage
|
|
132
|
+
VPS_DRY_RUN.md VPS dry-run guide
|
|
133
|
+
VPS_DRY_RUN_REPORT_TEMPLATE.md VPS dry-run report template
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Exit Codes
|
|
137
|
+
|
|
138
|
+
| Code | Meaning |
|
|
139
|
+
|------|---------|
|
|
140
|
+
| 0 | All domains ALLOW |
|
|
141
|
+
| 1 | One or more REVIEW (no DENY) |
|
|
142
|
+
| 2 | One or more DENY |
|
|
143
|
+
| 3 | All domains errored |
|
|
144
|
+
| 4 | Invalid arguments |
|
|
145
|
+
|
|
146
|
+
## Dogfood Results
|
|
147
|
+
|
|
148
|
+
See `docs/DOGFOOD_FINDINGS.md` for results of running the CLI against
|
|
149
|
+
31 real public domains. Key findings:
|
|
150
|
+
|
|
151
|
+
- **31/31 domains probed**, 0 errors, 0 timeouts
|
|
152
|
+
- **After Phase 13 fallback: 19 ALLOW, 11 REVIEW, 1 DENY**
|
|
153
|
+
- **Before Phase 13: 0 ALLOW, 30 REVIEW, 1 DENY** (fallback was missing)
|
|
154
|
+
- **wrong.host.badssl.com correctly DENY'd**
|
|
155
|
+
- **revoked.badssl.com correctly detected as REVOKED_CERT** — OCSP checking now implemented
|
|
156
|
+
- **deprecated TLS detected (e.g. TLSv1.1)** — secondary probe forces lower version negotiation
|
|
157
|
+
- **Exit code 2 (DENY) clearly signals action needed**
|
|
158
|
+
- **Fallback ALLOW is adapter-policy based, not SPL confidence** — see `docs/CLI_CONFIDENCE_FALLBACK_POLICY.md`
|
|
159
|
+
|
|
160
|
+
The CLI is now practical for routine scanning (exit code 0 fires for clean domains).
|
|
161
|
+
|
|
162
|
+
## Key Documents
|
|
163
|
+
|
|
164
|
+
- `docs/CLI_USAGE.md` — Full CLI reference
|
|
165
|
+
- `docs/CLI_OUTPUT_SCHEMA.md` — JSON output schema
|
|
166
|
+
- `docs/CLI_EXAMPLES.md` — Example runs with output
|
|
167
|
+
- `docs/CLI_CONFIDENCE_FALLBACK_POLICY.md` — Fallback policy design
|
|
168
|
+
- `docs/CLI_GOLDEN_TESTING.md` — Golden acceptance testing
|
|
169
|
+
- `docs/KNOWN_LIMITATIONS.md` — All known limitations
|
|
170
|
+
- `docs/OPERATING_PROFILES.md` — Profile definitions
|
|
171
|
+
- `docs/RELEASE_CHECKLIST.md` — Pre-release checklist
|
|
172
|
+
- `docs/TEST_SUITE_STATUS.md` — Test suite breakdown
|
|
173
|
+
- `docs/RELEASE_NOTES_0.2.0b0.md` — Release notes
|
|
174
|
+
- `docs/LOCAL_BETA_FREEZE_MANIFEST.md` — Freeze manifest with stable contracts
|
|
175
|
+
- `docs/DOCKER_USAGE.md` — Docker build and usage
|
|
176
|
+
- `docs/VPS_DRY_RUN.md` — VPS dry run guide
|
|
177
|
+
- `docs/VPS_DRY_RUN_REPORT_TEMPLATE.md` — VPS dry run report template
|
|
178
|
+
- `docs/DECISION_ORCHESTRATION_POLICY.md` — Orchestrator design
|
|
179
|
+
- `docs/DECISION_SEMANTICS_AUDIT.md` — Decision semantics
|
|
180
|
+
- `docs/TLS_RISK_POLICY_ADAPTER.md` — Adapter design
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
See `LICENSE` or project documentation.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Decision Orchestration Policy — sidecar that combines adapter + SPL outputs.
|
|
2
|
+
|
|
3
|
+
Consumes TLS Risk Policy Adapter output and SPL decision output to produce
|
|
4
|
+
a transparent final decision (ALLOW / REVIEW / DENY) without modifying SPL Core.
|
|
5
|
+
|
|
6
|
+
Exports:
|
|
7
|
+
FinalDecision, FinalRisk, DecisionSource: Literal types.
|
|
8
|
+
OrchestratorInput: TypedDict for all input fields.
|
|
9
|
+
OrchestratorOutput: TypedDict for the final output.
|
|
10
|
+
decide: The core orchestration function.
|
|
11
|
+
generate_report: Produce a structured benchmark report.
|
|
12
|
+
SEVERITY_RANK: Dict for comparing severity levels.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from decision_orchestrator.schema import (
|
|
16
|
+
FinalDecision,
|
|
17
|
+
FinalRisk,
|
|
18
|
+
DecisionSource,
|
|
19
|
+
OrchestratorInput,
|
|
20
|
+
OrchestratorOutput,
|
|
21
|
+
SEVERITY_ORDER,
|
|
22
|
+
SEVERITY_RANK,
|
|
23
|
+
OperatingProfile,
|
|
24
|
+
)
|
|
25
|
+
from decision_orchestrator.policy import decide, orchestrate
|
|
26
|
+
from decision_orchestrator.reporter import generate_report, save_results, BenchmarkRunResult
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"FinalDecision",
|
|
30
|
+
"FinalRisk",
|
|
31
|
+
"DecisionSource",
|
|
32
|
+
"OrchestratorInput",
|
|
33
|
+
"OrchestratorOutput",
|
|
34
|
+
"SEVERITY_ORDER",
|
|
35
|
+
"SEVERITY_RANK",
|
|
36
|
+
"OperatingProfile",
|
|
37
|
+
"decide",
|
|
38
|
+
"orchestrate",
|
|
39
|
+
"generate_report",
|
|
40
|
+
"BenchmarkRunResult",
|
|
41
|
+
]
|