secdiagram 0.5.0__py3-none-any.whl

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 (101) hide show
  1. secdiagram-0.5.0.dist-info/METADATA +316 -0
  2. secdiagram-0.5.0.dist-info/RECORD +101 -0
  3. secdiagram-0.5.0.dist-info/WHEEL +5 -0
  4. secdiagram-0.5.0.dist-info/entry_points.txt +4 -0
  5. secdiagram-0.5.0.dist-info/licenses/LICENSE +21 -0
  6. secdiagram-0.5.0.dist-info/top_level.txt +1 -0
  7. secdiagram_core/__init__.py +186 -0
  8. secdiagram_core/advisories.py +311 -0
  9. secdiagram_core/agentic.py +599 -0
  10. secdiagram_core/analyzer.py +652 -0
  11. secdiagram_core/application_context.py +186 -0
  12. secdiagram_core/architecture_scorecard.py +1014 -0
  13. secdiagram_core/artifacts.py +180 -0
  14. secdiagram_core/assessment.py +264 -0
  15. secdiagram_core/ast_index.py +658 -0
  16. secdiagram_core/backlog.py +296 -0
  17. secdiagram_core/baseline.py +232 -0
  18. secdiagram_core/cache.py +173 -0
  19. secdiagram_core/cargo_manifest.py +80 -0
  20. secdiagram_core/cli.py +797 -0
  21. secdiagram_core/cli_commands.py +442 -0
  22. secdiagram_core/cli_doctor.py +36 -0
  23. secdiagram_core/cli_parser.py +558 -0
  24. secdiagram_core/cli_schema.py +72 -0
  25. secdiagram_core/cli_setup.py +103 -0
  26. secdiagram_core/cli_workspace.py +199 -0
  27. secdiagram_core/confidence.py +97 -0
  28. secdiagram_core/config.py +214 -0
  29. secdiagram_core/credentials.py +49 -0
  30. secdiagram_core/dart_declarations.py +354 -0
  31. secdiagram_core/dast_reports.py +951 -0
  32. secdiagram_core/dependency_bundle.py +105 -0
  33. secdiagram_core/dependency_correlation.py +166 -0
  34. secdiagram_core/dependency_gate.py +61 -0
  35. secdiagram_core/dependency_graph.py +25 -0
  36. secdiagram_core/dependency_inventory.py +117 -0
  37. secdiagram_core/dependency_remediation.py +27 -0
  38. secdiagram_core/dependency_reports.py +269 -0
  39. secdiagram_core/dependency_versions.py +146 -0
  40. secdiagram_core/diagram_edit.py +238 -0
  41. secdiagram_core/diagram_model.py +340 -0
  42. secdiagram_core/diagram_quality.py +297 -0
  43. secdiagram_core/discover.py +346 -0
  44. secdiagram_core/doctor.py +212 -0
  45. secdiagram_core/evidence_model.py +898 -0
  46. secdiagram_core/exploitability.py +653 -0
  47. secdiagram_core/exposure.py +136 -0
  48. secdiagram_core/external_reports.py +474 -0
  49. secdiagram_core/external_setup.py +285 -0
  50. secdiagram_core/features.py +98 -0
  51. secdiagram_core/frameworks.py +284 -0
  52. secdiagram_core/graph_builder.py +350 -0
  53. secdiagram_core/health.py +34 -0
  54. secdiagram_core/high_level.py +1595 -0
  55. secdiagram_core/iac.py +1168 -0
  56. secdiagram_core/investigation.py +285 -0
  57. secdiagram_core/java_index.py +1459 -0
  58. secdiagram_core/limits.py +158 -0
  59. secdiagram_core/llm.py +776 -0
  60. secdiagram_core/misconfig.py +316 -0
  61. secdiagram_core/model.py +629 -0
  62. secdiagram_core/path_safety.py +73 -0
  63. secdiagram_core/policy.py +439 -0
  64. secdiagram_core/polyglot_index.py +544 -0
  65. secdiagram_core/polyglot_lexer.py +560 -0
  66. secdiagram_core/polyglot_parsers_native.py +690 -0
  67. secdiagram_core/polyglot_parsers_web.py +932 -0
  68. secdiagram_core/polyglot_rules.py +343 -0
  69. secdiagram_core/polyglot_security.py +929 -0
  70. secdiagram_core/protocols.py +131 -0
  71. secdiagram_core/reachability.py +152 -0
  72. secdiagram_core/redaction.py +220 -0
  73. secdiagram_core/render_html.py +1460 -0
  74. secdiagram_core/render_image.py +387 -0
  75. secdiagram_core/render_json.py +32 -0
  76. secdiagram_core/render_markdown.py +535 -0
  77. secdiagram_core/render_mermaid.py +411 -0
  78. secdiagram_core/render_sarif.py +467 -0
  79. secdiagram_core/render_security.py +1426 -0
  80. secdiagram_core/render_vex.py +187 -0
  81. secdiagram_core/resolver.py +580 -0
  82. secdiagram_core/risk.py +257 -0
  83. secdiagram_core/sca.py +140 -0
  84. secdiagram_core/schemas.py +522 -0
  85. secdiagram_core/security.py +1358 -0
  86. secdiagram_core/security_report.py +636 -0
  87. secdiagram_core/server.py +441 -0
  88. secdiagram_core/server_routes.py +907 -0
  89. secdiagram_core/server_state.py +547 -0
  90. secdiagram_core/studio.py +621 -0
  91. secdiagram_core/studio_diagram.py +156 -0
  92. secdiagram_core/studio_ui/app.css +306 -0
  93. secdiagram_core/studio_ui/app.js +1218 -0
  94. secdiagram_core/studio_ui/index.html +269 -0
  95. secdiagram_core/studio_ui.py +46 -0
  96. secdiagram_core/swift_ios.py +245 -0
  97. secdiagram_core/taint_flows.py +398 -0
  98. secdiagram_core/threat_model.py +672 -0
  99. secdiagram_core/threat_review.py +664 -0
  100. secdiagram_core/workspace.py +1053 -0
  101. secdiagram_core/yaml_lite.py +163 -0
@@ -0,0 +1,316 @@
1
+ Metadata-Version: 2.4
2
+ Name: secdiagram
3
+ Version: 0.5.0
4
+ Summary: Deterministic architecture, relationship, and security analysis for polyglot repositories.
5
+ Author: secdiagram maintainers
6
+ License: MIT
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Classifier: Topic :: Software Development :: Documentation
18
+ Classifier: Topic :: Security
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: dev
23
+ Requires-Dist: bandit[toml]==1.9.4; extra == "dev"
24
+ Requires-Dist: build==1.6.1; extra == "dev"
25
+ Requires-Dist: coverage[toml]==7.16.0; python_version < "3.11" and extra == "dev"
26
+ Requires-Dist: coverage[toml]==7.17.1; python_version >= "3.11" and extra == "dev"
27
+ Requires-Dist: mypy==2.4.1; extra == "dev"
28
+ Requires-Dist: pip-audit==2.10.1; extra == "dev"
29
+ Requires-Dist: ruff==0.17.5; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ <div align="center">
33
+
34
+ # ⚡ secdiagram
35
+
36
+ ### *Small but Gold* — Deterministic Architecture Diagrams, Polyglot System Mapping, and Security Intelligence.
37
+
38
+ [![Python](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-blue.svg?style=flat-square&logo=python&logoColor=white)](https://python.org)
39
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-Standard%20Library%20Only-success.svg?style=flat-square)](pyproject.toml)
40
+ [![Tests](https://github.com/vichhaiyserey/secdiagram/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/vichhaiyserey/secdiagram/actions/workflows/ci.yml?query=branch%3Adevelop)
41
+ [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED.svg?style=flat-square&logo=docker&logoColor=white)](Dockerfile)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
43
+ [![Cross Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Ubuntu%20%7C%20RHEL%20%7C%20Windows-blueviolet.svg?style=flat-square)](docs/CONTAINER_AND_COMPOSE.md)
44
+
45
+ <p align="center">
46
+ <b>Transform codebases into clear, human-friendly system architecture diagrams, publication-quality images, security threat models, and AI reviews.</b><br>
47
+ <i>100% offline-first. Zero external Python runtime dependencies. Polyglot architecture and security analysis across <b>.NET (C#)</b>, <b>Java / Spring Boot</b>, <b>Node.js / TypeScript</b>, <b>PHP</b>, <b>Go</b>, <b>Rust</b>, <b>Dart / Flutter</b>, <b>Python</b>, and <b>Docker / Kubernetes / Terraform</b>.</i>
48
+ </p>
49
+
50
+ ---
51
+
52
+ </div>
53
+
54
+ ## 🌟 Key Highlights
55
+
56
+ - **Pure Python Standard Library (`zero dependencies`)**: Core analysis requires no third-party Python packages. Optional renderers and developer tools have separate pinned dependencies.
57
+ - **High-Level C4 System Diagrams**: Automatically compiles clean C4 tier diagrams (`diagram-highlevel.mmd` & `diagram-highlevel.png`) showing Ingress, Gateways, Core Services, Databases, Caches, Brokers, and External APIs.
58
+ - **Multi-Format Image Rendering**: Export diagrams directly to **PNG**, **SVG**, or **PDF** offline via bundled Mermaid CLI (`mmdc`) or zero-dependency HTTP fallbacks (Kroki, mermaid.ink).
59
+ - **Security & IaC SAST Overlay**: Discovers entrypoints, traces taint dataflows **across functions and files** (controller → service → repository) to dangerous sinks (CWE-78, CWE-89, CWE-502), draws them as an attack-path diagram, catches hardcoded secrets, and audits Dockerfile, Kubernetes, Terraform, and GitHub Actions configurations.
60
+ - **Runtime DAST Evidence Correlation**: Import OWASP ZAP Traditional JSON and Nuclei JSONL/JSON reports and deterministically match observed requests (HTTP method + templated path) to static endpoint nodes. Matched endpoints gain `runtime_observed` metadata, runtime-only endpoints are reported instead of invented, and runtime-confirmed critical/high findings can satisfy the strict policy reachability gate -- all without launching a scanner or making network calls.
61
+ - **Local Dependency Risk Correlation**: Builds a bounded offline Pub/Flutter inventory from `pubspec.yaml`, `pubspec.lock`, and `.dart_tool/package_config.json`, then correlates local Trivy and CycloneDX reports by scoped package and exact resolved version. Static imports and qualified package call paths supply reachability evidence, while a policy-owned reviewed symbol gate is required before a dependency finding can fail CI. Optional SHA-256 evidence bundles add reproducibility and freshness checks, and remediation details flow into Markdown, HTML, JSON, SARIF, and VEX. See [Dependency risk correlation](docs/DEPENDENCY_RISK_CORRELATION.md).
62
+ - **Web/API Misconfiguration Checks**: Flags broken JWT validation (`alg=none`, signature/expiry checks off), CORS that trusts any origin **with credentials**, disabled CSRF protection, cookies without `HttpOnly`/`Secure`, XXE-prone XML parsers, non-cryptographic RNGs used for tokens, and JS prototype pollution across C#, JS/TS, PHP, Go, and Java.
63
+ - **Risk-Ranked "Fix First" List**: Scores every finding 0–10 by impact × exposure (anonymous, authenticated, or internal entry point, detected from framework auth markers) × evidence × confidence × CISA KEV, and groups them P0–P3 in reports, SARIF, and diagrams.
64
+ - **STRIDE Threat Model**: Generates `THREAT_MODEL.md` and `threat-model.json` with affected components, assets, source evidence, static flows, severity/confidence, and verification steps. Facts and assessments are separated; `secdiagram threat-diff` compares saved versions offline. See [Threat modeling](docs/THREAT_MODELING.md).
65
+ - **Architecture Security Scorecard**: The standalone security review opens with a defensible verdict (`pass`, `conditional pass`, `fail`, or `insufficient evidence`), architecture and control posture, evidence-backed critical attack paths, design risks, and explicit coverage confidence. Facts and judgments are separate, and missing evidence is never reported as a pass.
66
+ - **MITRE ATT&CK Audit Gate**: `secdiagram audit <dir>` maps the parsed architecture to ATT&CK techniques (T1190 Exploit Public-Facing Application, T1040 Network Sniffing, T1552 Unsecured Credentials, …) with evidence and missing mitigations, and **fails CI/CD with exit code 1** when findings violate `policy.yaml` thresholds.
67
+ - **CycloneDX 1.6 VEX & SARIF Export**: Generates industry-standard `security.sarif` and CycloneDX 1.6 VEX documents (`vex.json`) with automated reachability justifications (`code_not_reachable`) for dead/internal code.
68
+ - **AI Architectural & Threat Modeling Reviews**: Integrates with local/containerized **Ollama (Qwen, LLaMA, DeepSeek)** or OpenAI endpoints to generate evidence-grounded architectural reviews citing exact `path:line` with zero hallucinations.
69
+ - **Agentic Studio & Portable AI Skill**: User-level installer with a private venv, portable launchers, and an agent skill manifest. The hardened Studio SPA adds interactive diagram overrides, a five-phase discover/model/secure/review/handoff state machine with evidence gates, executable handoff artifacts, and local-Ollama or OpenAI reviews -- all without adding a runtime dependency. See [Agentic Studio](docs/STUDIO.md).
70
+ - **100% Deterministic & Air-Gapped**: Byte-for-byte reproducible outputs across runs. Fully functional in offline, isolated, or air-gapped environments.
71
+
72
+ ---
73
+
74
+ ## 🚀 Quick Start
75
+
76
+ New to secdiagram? Start with the [beginner guide](docs/BEGINNER_GUIDE.md) or
77
+ download the [printable PDF](docs/BEGINNER_GUIDE.pdf).
78
+
79
+ ### 1. Install and run (Python 3.10+)
80
+
81
+ Install the CLI in a virtual environment or run it directly from a source checkout.
82
+
83
+ ```bash
84
+ python -m pip install secdiagram
85
+ secdiagram --dir . --offline
86
+ ```
87
+
88
+ From a source checkout, the CLI requires only the Python standard library.
89
+
90
+ See [runtime prerequisites and evidence coverage](docs/RUNTIME_PREREQUISITES.md)
91
+ for operating permissions, optional renderers and AI providers, and current
92
+ vulnerability evidence.
93
+
94
+ ```bash
95
+ # Analyze current repository and generate detailed architecture diagrams:
96
+ python secdiagram.py --dir="."
97
+
98
+ # Generate both detailed and high-level C4 system diagrams with PNG images:
99
+ python secdiagram.py --dir="." --image
100
+
101
+ # Generate high-level system overview as primary diagram:
102
+ python secdiagram.py --dir="." --high-level --image
103
+
104
+ # Correlate local Trivy/CycloneDX evidence with the Pub inventory (offline):
105
+ python secdiagram.py --dir="." --offline --trivy-report trivy.json --sbom inventory.cdx.json --format json,sarif,vex
106
+
107
+ # ATT&CK audit gate for CI/CD - exits 1 on policy violations:
108
+ python secdiagram.py audit . --policy policy.yaml --json audit-result.json
109
+
110
+ # Strict audit against a SHA-256 verified evidence bundle:
111
+ python secdiagram.py audit . --offline --evidence-bundle evidence.json --require-evidence --json audit-result.json
112
+ ```
113
+
114
+ ### 2. Standalone Container Execution (Docker / Podman)
115
+
116
+ Run using the pre-built, hardened non-root container with bundled Chromium and Mermaid CLI:
117
+
118
+ ```bash
119
+ # Linux / macOS:
120
+ docker run --rm -v "$(pwd):/repo" secdiagram:local --image
121
+
122
+ # Windows PowerShell:
123
+ docker run --rm -v "${PWD}:/repo" secdiagram:local --image
124
+
125
+ # RHEL / Fedora (SELinux mode):
126
+ docker run --rm -v "$(pwd):/repo:z" secdiagram:local --image
127
+ ```
128
+
129
+ ### 3. Agentic Studio & Portable AI Skill
130
+
131
+ ```bash
132
+ # Install the user-level Studio home, launchers, and agent skill:
133
+ python secdiagram.py studio install
134
+
135
+ # Serve the Studio on loopback with authentication:
136
+ python secdiagram.py studio serve --dir . --user analyst --password 'change-me'
137
+ ```
138
+
139
+ Open `http://127.0.0.1:8080/studio` to edit diagrams, drive the SDLC phases, request local AI
140
+ reviews, investigate findings, and generate handoff artifacts. The installer is CLI-only; the Studio reuses the
141
+ hardened platform server. See the [Agentic Studio guide](docs/STUDIO.md).
142
+
143
+ ### 4. Python Public Facade
144
+
145
+ Integrate directly into custom automation scripts or DevSecOps pipelines:
146
+
147
+ ```python
148
+ from secdiagram_core import analyze, render_mermaid, AnalysisConfig
149
+
150
+ result = analyze(AnalysisConfig(root=".", security=True))
151
+ print(f"Discovered {len(result.graph.nodes)} nodes and {len(result.graph.findings)} findings.")
152
+
153
+ # Native taint and package reachability query:
154
+ if result.has_taint_at("app/api.py", line=42):
155
+ print("Tainted dataflow detected at line 42!")
156
+
157
+ # Correlate runtime DAST evidence with the static endpoint graph:
158
+ runtime = analyze(
159
+ AnalysisConfig(root=".", zap_report="zap.json", nuclei_report="nuclei.jsonl")
160
+ )
161
+ print(runtime.graph.meta["runtime_analysis"]["matched_requests"], "runtime requests matched")
162
+
163
+ # Correlate local Pub inventory with Trivy and CycloneDX evidence:
164
+ deps = analyze(
165
+ AnalysisConfig(root=".", trivy_report="trivy.json", sbom="inventory.cdx.json")
166
+ )
167
+ print(deps.graph.meta["dependency_reports"])
168
+ ```
169
+
170
+ ---
171
+
172
+ ## 🔀 Supported Ecosystems
173
+
174
+ | Ecosystem | Manifests Inspected | Architectural & Security Elements Detected |
175
+ | :--- | :--- | :--- |
176
+ | **.NET (C#)** | `*.sln`, `*.csproj`, `*.fsproj`, `*.cs` | Project metadata and C# source indexing for ASP.NET Core, EF Core, and MediatR. Selected taint and configuration checks. |
177
+ | **Node.js / TypeScript** | `package.json`, workspaces, `schema.prisma`, `*.js`/`*.ts` | Express, Fastify, Koa, Hono, NestJS, Next.js routes & auth middleware; Prisma, TypeORM, Mongoose; interprocedural taint to SQL/NoSQL, `child_process`, `eval`, XSS, path, SSRF sinks; prototype pollution; JWT/CORS/cookie checks |
178
+ | **PHP** | `composer.json`, `*.php` | Laravel routes & middleware, Symfony `#[Route]`/`#[IsGranted]`, Slim, legacy page scripts; constructor DI; taint to SQL, `system`/`exec`, `include`, `unserialize`, XSS, path, SSRF; CSRF/CORS/cookie/XXE checks |
179
+ | **Go** | `go.mod`, `*.go` | `net/http` (incl. Go 1.22 `"GET /path"`), Gin, Echo, Chi routes & auth middleware; structs, receiver methods, `NewX` injection; taint to SQL, `exec.Command`, path, SSRF, XSS; JWT/CORS/cookie/TLS checks |
180
+ | **Dart / Flutter** | `pubspec.yaml`, `pubspec.lock`, `.dart_tool/package_config.json`, `*.dart` | Flutter widgets, services, repositories, GoRouter/Shelf routes; Pub direct/dev/transitive inventory with resolved versions and scopes; interprocedural taint to SQLite, `Process.run`, WebView JS/HTML, filesystem and HTTP sinks; TLS and weak-crypto checks; Trivy/CycloneDX advisory correlation. |
181
+ | **Rust** | `Cargo.toml`, `*.rs` | Structs/enums/traits, `impl` methods, Axum router and Actix attribute routes; request-to-SQLx, shell-command, filesystem and HTTP sink evidence; TLS/CORS and selected non-cryptographic RNG checks. Lexical coverage and limits: [Rust support](docs/RUST_SUPPORT.md). |
182
+ | **Swift / iOS** | `*.swift`, Xcode projects, SwiftPM manifests and pins, CocoaPods manifests and locks, plists and localization resources | SwiftUI app and view structure, MVVM relationships, SwiftData models, framework imports, dependencies, and selected iOS release-configuration findings. [Swift support](docs/SWIFT_SUPPORT.md). |
183
+ | **Java / Spring Boot** | `pom.xml`, `build.gradle(.kts)` | Stereotypes (`@RestController`, `@Service`, `@Repository`), DI (`@Autowired`), injection/call edges, `@PreAuthorize`/`@PermitAll`; SQLi, command injection, deserialization, SSRF, XSS, XXE; JWT/CORS/CSRF/cookie checks |
184
+ | **Python** | `pyproject.toml`, `requirements.txt`, `*.py` AST | FastAPI, Flask, Django, Celery; SQLAlchemy, Tortoise-ORM, asyncpg, pymongo; AST taint tracking from sources to dangerous execution sinks |
185
+ | **Infrastructure & IaC** | `docker-compose.yml`, `Dockerfile`, K8s, Terraform | Compose service ports & links; Dockerfile unpinned tags & root user; Kubernetes capabilities & security contexts; Terraform public ACLs |
186
+
187
+ ---
188
+
189
+ ## 📦 Generated Artifacts
190
+
191
+ Preview a scan without writing files, or capture a structured CI summary:
192
+
193
+ ```bash
194
+ secdiagram --dir . --offline --dry-run --verbose
195
+ secdiagram --dir . --offline --output json --format json,sarif > scan-summary.json
196
+ ```
197
+
198
+ Progress stages appear on stderr. The summary reports parsed files, detected languages,
199
+ components, unresolved references and skipped paths. Use `--verbose` for diagnostic
200
+ details, and check `health.complete` in CI to detect partial coverage.
201
+ Image rendering defaults to local `mmdc`; HTTP rendering requires an explicit provider.
202
+ For large repositories, combine repeatable `--include`/`--exclude` filters with the
203
+ incremental cache and configurable input limits. See the [CLI reference](docs/CLI_REFERENCE.md).
204
+
205
+ The default formats are `json,md,mermaid`. Artifacts go to `<repo>/.secdiagram/` unless
206
+ `--out` is supplied. Select additional outputs using `--format` or the corresponding flags.
207
+
208
+ - `diagram-highlevel.mmd` / `.png` — High-level C4 system tier diagram (`secdiagram.com` style).
209
+ - `diagram.mmd` / `.png` — Detailed architecture flowchart and component relationships (taint paths highlighted in red).
210
+ - `diagram-taint.mmd` / `.png` — Attack-path diagram: untrusted input → entry points → every function on the path → vulnerable sink.
211
+ - `ARCHITECTURE.md` — Complete markdown architecture report with embedded diagrams and a risk-ranked "Fix first" table.
212
+ - `THREAT_MODEL.md` — STRIDE threat model per trust boundary, backed by findings and their risk priority.
213
+ - `threat-model.json` — Versioned source-backed observations and coverage context; compare versions with `secdiagram threat-diff before/threat-model.json after/threat-model.json`.
214
+ - `audit-result.json` — Machine-readable ATT&CK audit result (`secdiagram audit --json`): policy, per-technique status/evidence, violations, evidence freshness, dependency report summaries/findings, and reviewed dependency violations.
215
+ - `graph.json` — Machine-readable graph schema (nodes, edges, confidence, features, findings with hop-by-hop `metadata.flow` and `metadata.risk`); Pub inventory nodes and structured `dependency` details for Trivy/CycloneDX findings.
216
+ - `security.sarif` — OASIS SARIF v2.1.0 code-scanning report with taint `codeFlows`; `rank` and `riskScore`/`riskPriority` follow the risk model, and dependency provenance is exposed in `properties.dependency`.
217
+ - `vex.json` — CycloneDX 1.6 VEX document with automated reachability justifications, dependency components, in-triage/resolved states, and remediation properties.
218
+ - `report.html` — Zero-dependency interactive HTML report with dark mode, filtering, and an "Attack paths" view.
219
+ - `SECURITY_REVIEW.md` / `security-report.html` — Standalone security review (`--security-report md|html|both`) with an architecture security scorecard and facts-versus-judgments breakdown.
220
+ - `NARRATIVE.md` — Optional evidence-grounded AI review (`--llm` / `--ollama`).
221
+ - `security.baseline.json` — Accepted-findings baseline (`--create-baseline`, then `--baseline`).
222
+ - `backlog.json` / `BACKLOG.md` — Correlated remediation backlog with owner, deterministic due date, risk decision, ticket, fix commit, and verification result (`--backlog`; requires `--backlog-as-of`).
223
+ - `jira-issues.json` / `gitlab-issues.json` / `github-issues.json` — Offline import-ready tracker payloads.
224
+ - `evidence-snapshots/<snapshot_id>.json` — Immutable, content-addressed evidence snapshot with report SHA-256 hashes (`--evidence-snapshot`).
225
+
226
+ ### Analysis coverage and evidence
227
+
228
+ `graph.json` records per-language source coverage in `meta.analysis.coverage`.
229
+ The denominator is recognized source files admitted by discovery. `indexed` counts
230
+ files with a built-in index, including partial indexes listed in `partial`.
231
+ `unindexed` lists admitted source files with no index. Discovery skips and parse
232
+ errors are tracked separately. `security_supported` indicates built-in heuristic
233
+ rule availability for a language. The scan-wide `security_enabled` flag records
234
+ whether those rules were enabled.
235
+
236
+ Graph schema version 1 remains readable by existing consumers. Check
237
+ `schema_features` for additive fields. `Graph.validation_errors()` checks graph
238
+ integrity, and the JSON CLI summary exposes diagnostics under `health`.
239
+
240
+ Finding provenance in graph JSON and SARIF records the detector, origin,
241
+ evidence locations, trace, and report name and external ID when available.
242
+ Validation starts at `unverified`. `advisory_corroborated` means a supplied
243
+ advisory matched the finding. `runtime_observed` means a supplied runtime
244
+ scanner reported the finding. These statuses describe the evidence
245
+ available to the scan.
246
+
247
+ Run `python -m tests.test_analysis_trust` for corpus precision and recall.
248
+ The metrics cover labeled fixture files and count unique category, path, and
249
+ primary line matches. See [corpus scope](tests/fixtures/security_corpus/README.md).
250
+
251
+ ### Application context and risk
252
+
253
+ `graph.json` and `threat-model.json` include an application inventory. API
254
+ records identify each method, route, handler, authentication marker, and source
255
+ location. A matched runtime report can mark a route as observed. Unknown auth
256
+ means the analyzer found no explicit marker.
257
+
258
+ The inventory records entry boundaries, evidenced graph relationships to data
259
+ or messaging assets, external code calls, and Compose dependencies on data
260
+ or messaging services. Compose relationships describe declared deployment
261
+ dependencies. Finding context links to inventory records, cites affected files,
262
+ and keeps recorded data-flow hops alongside any matching static call evidence.
263
+ The risk score lists its numeric factors and any advisory floor. A partial flow
264
+ receives less weight than a trace with both source and sink.
265
+
266
+ ---
267
+
268
+ ## 📚 Documentation Index
269
+
270
+ For comprehensive guides, references, and deployment patterns, see:
271
+
272
+ | Guide | Description |
273
+ | :--- | :--- |
274
+ | [**Architecture Diagrams & Image Rendering**](docs/ARCHITECTURE_DIAGRAMS.md) | C4 high-level diagrams, visual tiering, detail modes, PNG/SVG/PDF rendering, and providers. |
275
+ | [**Container & Docker Compose Guide**](docs/CONTAINER_AND_COMPOSE.md) | Standalone Docker & Podman, Windows Git Bash tips, SELinux mode, and local Ollama Compose. |
276
+ | [**Security, IaC & Runtime Evidence**](docs/SECURITY_AND_IAC.md) | SAST and interprocedural taint rules per language, web/API misconfiguration checks, risk model, STRIDE threat model, MITRE ATT&CK audit gate, attack-path diagram, IaC checks, SonarQube/Xray import, ZAP/Nuclei runtime DAST correlation, CycloneDX VEX. |
277
+ | [**Dependency Risk Correlation**](docs/DEPENDENCY_RISK_CORRELATION.md) | Offline Pub/Flutter inventory, Trivy/CycloneDX ingestion, SHA-256 evidence bundles, reviewed symbol gate, Pub advisory ranges, and remediation exports. |
278
+ | [**Rust / Axum / Actix Support**](docs/RUST_SUPPORT.md) | Supported syntax, Cargo inventory, evidence-backed rules, offline examples and coverage limits. |
279
+ | [**Threat Modeling & Diffs**](docs/THREAT_MODELING.md) | Facts versus assessments, source-linked STRIDE observations and version comparison. |
280
+ | [**Hardened Platform Server & REST API**](docs/SERVER_API.md) | Daemon mode (`secdiagram serve`), authentication, rate limits, request caps, and config schema. |
281
+ | [**Agentic Studio & AI-Skill Installer**](docs/STUDIO.md) | User-level install, portable agent skill, Studio UI, diagram overrides, SDLC evidence gates, handoffs, and local AI reviews. |
282
+ | [**CLI Reference Manual**](docs/CLI_REFERENCE.md) | Complete command-line syntax, options breakdown table, and exit codes. |
283
+ | [**Python Public Facade & Developer API**](docs/PYTHON_API.md) | Stable facade (`secdiagram_core`), taint/reachability queries, SCA bridge, and cache serialization. |
284
+ | [**Task Tracking Guide**](docs/TASK_TRACKING.md) | GitHub Issues & Projects v2 task lifecycle tracking with `taskctl.py`. |
285
+ | [**Test Contracts & Validation**](docs/TEST_VALIDATION.md) | Meaningful test conditions, isolated fault checks, cross-platform verification and known gaps. |
286
+ | [**SAST Accuracy Benchmarks**](docs/SAST_BENCHMARK.md) | Score secdiagram against OWASP Benchmark (Python/Java), Juliet/SARD and SecBench.js with a stdlib harness, then publish reproducible per-CWE scorecards. |
287
+
288
+ ---
289
+
290
+ ## 🧪 Verification & Testing
291
+
292
+ `secdiagram` maintains behavior-focused tests covering the supported application languages, including Rust and Dart/Flutter, plus infrastructure-as-code, interprocedural taint, misconfiguration rules, risk scoring, the STRIDE threat model and MITRE ATT&CK audit gate, Pub dependency inventory and correlation, offline evidence verification, graph builders, image rendering, and deterministic CLI behaviors. Related conditions use named subtests; full-content checks and positive/negative controls take precedence over assertion counts. CI runs the suite on Ubuntu **and** Windows for every supported Python version. See [test contracts and validation](docs/TEST_VALIDATION.md) for the inventory, fault checks and coverage limits.
293
+
294
+ ```bash
295
+ # Run unit test suite:
296
+ python -m unittest discover -s tests -v
297
+ ```
298
+
299
+ Detection accuracy is measured, not assumed. `scripts/benchmark_sast.py` scores a
300
+ SARIF report against an OWASP-style answer key and reports TPR, FPR and Youden J
301
+ overall and per CWE. See [SAST accuracy benchmarks](docs/SAST_BENCHMARK.md) for
302
+ the protocol, datasets and publication checklist.
303
+
304
+ ```bash
305
+ python scripts/benchmark_sast.py --sarif out/security.sarif \
306
+ --expected expectedresults-0.1.csv \
307
+ --benchmark-name "OWASP Benchmark for Python" --benchmark-version v0.1 \
308
+ --out-dir benchmarks/scorecards/owasp-python-0.1
309
+ ```
310
+
311
+ ---
312
+
313
+ ## 🤝 Contributing & License
314
+
315
+ - **Contributing**: Please review [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`AGENTS.md`](AGENTS.md) for architectural guardrails and commit conventions.
316
+ - **License**: Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,101 @@
1
+ secdiagram-0.5.0.dist-info/licenses/LICENSE,sha256=Lv6MyT2ZGDp3_l1XQ0U53qdI4CXia6U8XUE36ft3iMQ,1070
2
+ secdiagram_core/__init__.py,sha256=8Na3s3PqHaPSwo4oHhmfRDmz778QF2KGLNk9RSaWX-Q,4908
3
+ secdiagram_core/advisories.py,sha256=QVJNC6u2Ac_tXjrm_0BbfhvFExPHgKvsyCnsbEHhT1Q,12222
4
+ secdiagram_core/agentic.py,sha256=4ZwuJzHcUWIjqsVb4GPvr_wCyEYImGIbMCp1vaJrIrM,20590
5
+ secdiagram_core/analyzer.py,sha256=wAHNMFcM282TQ13oSAV_pXeiY8R7UZPTot6xBewPLb8,27233
6
+ secdiagram_core/application_context.py,sha256=Nr-zesSdpc3LorKNafG4xD0qn8BOZQSpeGyGo0vDFfE,8563
7
+ secdiagram_core/architecture_scorecard.py,sha256=6Qr21Mj1zp-RsRdJPqxOxCIB2rdQacv6TsppUdcGvhA,37511
8
+ secdiagram_core/artifacts.py,sha256=gXy29ibaUw77az3xkYST0ZS22O5XQfJo4CwOJPkbsKQ,6597
9
+ secdiagram_core/assessment.py,sha256=ReRxp6cCKvRncCIRF41KALZIaywBnx1hOYaZgMGmkYI,10220
10
+ secdiagram_core/ast_index.py,sha256=Yp-Q9DiUFztSNvHkv7k6PFxiPbcf7JG9LrlqcLXOwhE,24661
11
+ secdiagram_core/backlog.py,sha256=Y7GElcS8Sax2R9zbW-sZsKNUmPCwT2fxXubz4fsSazk,11227
12
+ secdiagram_core/baseline.py,sha256=klF6jVYZvtVu-kQcWDIc1ve2YNY7pHS7ssF_hbHJ3ME,8817
13
+ secdiagram_core/cache.py,sha256=dzj7B57wKb3BRXMRTJU3Pw-1wbkQeWuT9vbJVNwb62o,5717
14
+ secdiagram_core/cargo_manifest.py,sha256=7fE-mbWg6bg22F8hEWnEmT4nadRQekfiVzb5aefbeBU,3461
15
+ secdiagram_core/cli.py,sha256=AAtqhq61BjFBVDCteyBY1Amai0xyg8kL0iIWnNsrc2U,34493
16
+ secdiagram_core/cli_commands.py,sha256=cjLnCsKHmmTJSuPv89hPwBuOfDhW3hojLOjp7W1wrYc,19783
17
+ secdiagram_core/cli_doctor.py,sha256=iz0PZivDJLsK2XkftcxuEvB1tBey3sicBRr_S6pF1RE,1515
18
+ secdiagram_core/cli_parser.py,sha256=affojbInO8HsYMQd_JaLe50xOx7Ih0x31YoXUXm4X8k,20509
19
+ secdiagram_core/cli_schema.py,sha256=rCzvbwgroG3KgSu4kt2rldOR3U_sxzoDCrhS3EkbxLo,2535
20
+ secdiagram_core/cli_setup.py,sha256=Vb7KxIN-iyowxosJLqrTgH-4mE91LgGycZsPctlm8o8,3679
21
+ secdiagram_core/cli_workspace.py,sha256=jLLwzmknNqXIwmc_YEZOIqjEJgmgr7gUBoeqqPOaxcY,7477
22
+ secdiagram_core/confidence.py,sha256=f-on9rbmZGt7Tw4BvBOn_lgHltWqMDSXxxcrU4ps0-0,3045
23
+ secdiagram_core/config.py,sha256=BSubPQnEb_Xrh3EPXgerBy1JUQRpk28jF2SE-iummAA,8593
24
+ secdiagram_core/credentials.py,sha256=wIkOaRYyKtrLpLTJxX_Y-UBZlfGZfOeXt4QLrAjHDew,2120
25
+ secdiagram_core/dart_declarations.py,sha256=U_zXvwlB1yhzfAQ7pbtBBEcfISZUL0lGjMDKB_mW_rY,12592
26
+ secdiagram_core/dast_reports.py,sha256=r5-AyKRWMQXKmGRqTe2l3Y1tlfLuV96IWb_DFpl4_N4,33555
27
+ secdiagram_core/dependency_bundle.py,sha256=b0OLauRD84Hd0BSqWGYunbvN_F_1aC6LLeNc5RgwijY,5125
28
+ secdiagram_core/dependency_correlation.py,sha256=Pwtj6JHoU2VIzIcvfBCrlFB0ih06iiHbv9nzuDVzgYs,7313
29
+ secdiagram_core/dependency_gate.py,sha256=5PmQt5ftxyUvyt6erEZFUX15UhVPfWa50ofPf8Y7HTw,2869
30
+ secdiagram_core/dependency_graph.py,sha256=giNJsVU--r2b6zatipx8NMSwzS6Rgb0q3AyZoJGu6_0,1300
31
+ secdiagram_core/dependency_inventory.py,sha256=7gZVzeHBlzjluMPYdFWY3oML72kaToW-NbZXQtNXJrI,5091
32
+ secdiagram_core/dependency_remediation.py,sha256=rlkrc3tDPYMT7rT-rpC7v1p2oHpJyVmJMUPdO65TuHY,1121
33
+ secdiagram_core/dependency_reports.py,sha256=iis6hj-aygWXc30rMpLpwbH2_OdnIugrphRqLIJ0eNo,13757
34
+ secdiagram_core/dependency_versions.py,sha256=38ThdPXyRVZR_lUlp7ta3C5wre0_GBf_5wtm8r3YClc,6590
35
+ secdiagram_core/diagram_edit.py,sha256=_wxntdMBKMWzUUs4irmwerDB6b5l_uPdwIA6SHvlVNI,9002
36
+ secdiagram_core/diagram_model.py,sha256=5WbOzPVh5QjCE3Piw10D-k3vE2OPIAAvUOCiEESVXBc,12508
37
+ secdiagram_core/diagram_quality.py,sha256=tOJvKUtU8cLwQDJd5SZyb8rKvHS7BI-1fSDi2ekn8z4,10796
38
+ secdiagram_core/discover.py,sha256=rFdE0jvv3jGERWeGtO0itMhvS-80XCg6Ndj9Tf3X53k,10425
39
+ secdiagram_core/doctor.py,sha256=P9DqvoZ8GrHpGiRxUx3NTX68ZvK2ByHHMrGmFuUDjVQ,7223
40
+ secdiagram_core/evidence_model.py,sha256=vDOD6x1syB42FJEXR-WbYkoEmJcAhR3Nt-0C5VSd44A,32863
41
+ secdiagram_core/exploitability.py,sha256=5OMP_ZtlqzZG3H70zGv3wTvV9Uof9T4J2oAphNGOtwU,20415
42
+ secdiagram_core/exposure.py,sha256=Y10qBgjkFy6hT-91x8CIu9Hxd1sPvM3LedGusIsYWTM,5429
43
+ secdiagram_core/external_reports.py,sha256=r9j8_RFmaO8OsbrP8hpvsTpqoBVe38DBB4Zb7wBAj4s,17702
44
+ secdiagram_core/external_setup.py,sha256=9aibOFDaJqEO6t-EvdYaxHdXqn1dOeDAQeVCGDVLY3Y,10327
45
+ secdiagram_core/features.py,sha256=BsO0penyGTAXpD9SxjB0BSAKHZ0IEVzyVQpeqe2VQoY,3228
46
+ secdiagram_core/frameworks.py,sha256=ktYqXfMCmBYrUJBsRnaVQUY4BEab5TbfVQDJmoOdNtY,9914
47
+ secdiagram_core/graph_builder.py,sha256=3JrE3xCXqpRqRX7M_UPq0F31r_i9LVPqTbOgiNPfFxg,13872
48
+ secdiagram_core/health.py,sha256=IM4hiVlq5fngs7_LtaP7BJTSC9g_CpkQ1XlExpyVtrg,1351
49
+ secdiagram_core/high_level.py,sha256=k2E_iI-sqNH775frlNgCRDBAesLTls-8vy3P__j14Cc,63753
50
+ secdiagram_core/iac.py,sha256=D9wzbdAze3djMBa8b5yflY0UDX7khZ2mZCi7e5j9QL4,47405
51
+ secdiagram_core/investigation.py,sha256=ZY-kpPDhEeI7gxEFyeUMy9FjCffpbSIr_5o8941lUk0,13948
52
+ secdiagram_core/java_index.py,sha256=IR6TY0nfLxYdBHfV8UNGs4TcG8tPCnFe2dMa_Xgtv2U,57332
53
+ secdiagram_core/limits.py,sha256=mhX8KrLzCCZO_V58Kn_1SFsUZM-CDlRK83Z75LrVC38,4960
54
+ secdiagram_core/llm.py,sha256=V6_XzR0tHbP7VwM7zg8FJAdNPBIXLQQ7TTGecfkStjE,28518
55
+ secdiagram_core/misconfig.py,sha256=MsEVpLuV0sD3JdAOxE7lw-zpY1aT0w2KmlAhkHft93k,18305
56
+ secdiagram_core/model.py,sha256=kNaR9jfDqT2Q2ptqTId5CHFLSIvdNd01e1L7aOIm1Vo,23663
57
+ secdiagram_core/path_safety.py,sha256=ND0fgfxYJ9JexLJU2ZiBRxQ1vYr5SgBn9fCBsIwUQJI,2639
58
+ secdiagram_core/policy.py,sha256=KnMqZbklDHc2aQO61lyjkNdaqCdp5eGZJf8X7O6pP0w,17732
59
+ secdiagram_core/polyglot_index.py,sha256=H3IM-BgwgU3G3qoimkDSUoMq4unFQFOiyEjThe8IWX0,24902
60
+ secdiagram_core/polyglot_lexer.py,sha256=7G1Yc0IFgvZhhw0QIZuT7itXc1-uj2Z-gZ7zTkRp1vM,20016
61
+ secdiagram_core/polyglot_parsers_native.py,sha256=Dfumfa3VhUF3g8K_OjHYTAxAHMfJtujOoQJAt5xmq-Y,30196
62
+ secdiagram_core/polyglot_parsers_web.py,sha256=EDyyCl_BorxtE7gV3OjDaS5ERe2cBzsg06uIX0k0qiM,40446
63
+ secdiagram_core/polyglot_rules.py,sha256=D4GUtbD6yqNrvteUSV5tmOOyCk6b-Z4QyeyJqgxPki4,22870
64
+ secdiagram_core/polyglot_security.py,sha256=fhVEt_Lr5A43HGMYazFAFWZ7CJHcXwTwjp73rWvis14,40593
65
+ secdiagram_core/protocols.py,sha256=__PNgL5tqvYCo8Lu3WdQGB8Yr9IjkTsPYjot32pRTdU,4158
66
+ secdiagram_core/reachability.py,sha256=fcc3aj-yXF07MP3nHXbXSGu4i2H4by6GU-u-zFEaitA,5618
67
+ secdiagram_core/redaction.py,sha256=1jOXeRm7tAwzgZGSR1tYY57CO8tb7OKloDDwZANcNks,9675
68
+ secdiagram_core/render_html.py,sha256=8HCsftQL-wF7wughpxHmyGs19q93XW_sBP0p8vFOYRs,66424
69
+ secdiagram_core/render_image.py,sha256=O6jCIBNNkK957pIyKYzOq0PB2eoyrwUkA-2xTbbLMr0,14326
70
+ secdiagram_core/render_json.py,sha256=FgZn2s2qTg4qb8znrmQDoTs7qMCUC7l66mm3AY1_2nw,1026
71
+ secdiagram_core/render_markdown.py,sha256=ppZckBzI1cZyaXX0MN8sxCqLv6vE28fRXbtTXndneVU,24638
72
+ secdiagram_core/render_mermaid.py,sha256=MgjZsS8C4SSFyat7mXL9oqJjKkzigJzEQ35lfiZeTe4,17306
73
+ secdiagram_core/render_sarif.py,sha256=vHiYyeR88UOcN0Mca36gRvAP2hdtnh00T-RjjdVi9-g,18911
74
+ secdiagram_core/render_security.py,sha256=4GI0VSy_zV1Fz9b2VRMhG_rRK8KW2lhWgsJ0dCT9Ueo,61284
75
+ secdiagram_core/render_vex.py,sha256=rJ-3J8bjVHQ4Ir7g9F6qWL78nnUuhnN9IMmviU8MNKU,7063
76
+ secdiagram_core/resolver.py,sha256=Ldpg05N2nwiB1b-Jl6Z2UwCWtgIc5tixZyTSNinfIHY,25462
77
+ secdiagram_core/risk.py,sha256=RT0UHkA0mVAtMkaPkNJeug575dg9jXYjp368VbjuxJo,10595
78
+ secdiagram_core/sca.py,sha256=TMBT1dt3ML_O8yY1IL1zUM_ucFuA8-ZIBOCdmuy4Q3w,5647
79
+ secdiagram_core/schemas.py,sha256=SKU5G4t98BJ7QmpKWnTmm6q8GTEDFsqqifD0x54SOdw,19177
80
+ secdiagram_core/security.py,sha256=WPdYHwpNcYfAuZ41j7_3mHLtGC4ArpXULKWKLeLKplo,53019
81
+ secdiagram_core/security_report.py,sha256=4oCGAT0LeDTEDADXqWF-HgH4fXJq6SKA7SgmV2VbIQQ,23384
82
+ secdiagram_core/server.py,sha256=MdUnWYRapOwHQzplqYhkp9WTqIhtn9cuMf2C37adzcw,16340
83
+ secdiagram_core/server_routes.py,sha256=v5EhIw_k_bts42jcADt3kJXAjFJfWK-Qf3sHGAqFyFE,36304
84
+ secdiagram_core/server_state.py,sha256=nyFrTr-6LTSVswMAMoNAzA-RBMQRD_J1XXFVVst1rkw,20325
85
+ secdiagram_core/studio.py,sha256=IvIK9FtF3ceya5rVORUpd3u26E6ivSfW0nHVS7wuxGM,22886
86
+ secdiagram_core/studio_diagram.py,sha256=MbzSK0_qCcTyKh_1o5dFy9QP7mp09DP8FiGELzeZclU,7576
87
+ secdiagram_core/studio_ui.py,sha256=LhR1goQ2qssRX18HvYUrUOkQaPfB8hMBL-Nixjj1vmI,1480
88
+ secdiagram_core/swift_ios.py,sha256=NXag6bdqNqVtN1ZNBs9V5KJ0HpDG6RUQ8Vpug6Q5lEw,13135
89
+ secdiagram_core/taint_flows.py,sha256=TCikbhxOm6ChH9gTA1S5rzFnkJ2UcFzmOaetH8OZUDc,16244
90
+ secdiagram_core/threat_model.py,sha256=PsCwd7jeP4KqnKnyASY0FcXXuIYFDRXq7XuDFLMHSZI,31941
91
+ secdiagram_core/threat_review.py,sha256=Zl4Ay-vjN5zB7VnqwPhqg3csYcPeIct2esAmcl08o4s,28051
92
+ secdiagram_core/workspace.py,sha256=7Tf0iUnm0L5m51daz69I-KGHJIcEfKvZzMn9K09-g9E,39464
93
+ secdiagram_core/yaml_lite.py,sha256=dzhe8Ft3YHoAPfw9jPnS6SgcJQWdLC7lD3B2FSnzAeQ,5571
94
+ secdiagram_core/studio_ui/app.css,sha256=ZsVhU_iwEf-RQqSYBgQO9-RnQBOmMh96iKUG6KWZ7j0,14623
95
+ secdiagram_core/studio_ui/app.js,sha256=KyAMVvtlzH-K7hFGoIpWNXmy17JNJ4Ylzre9__RA6mE,48246
96
+ secdiagram_core/studio_ui/index.html,sha256=qHy5pxkFCA2mehGDaV8ainw_ZJC0txzHl-njWUN1NCc,15357
97
+ secdiagram-0.5.0.dist-info/METADATA,sha256=6D-5B7wyPVjFOD_lMJer65vhkt60LXaqSn_wWj1-KRc,23887
98
+ secdiagram-0.5.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
99
+ secdiagram-0.5.0.dist-info/entry_points.txt,sha256=pMAatxjliA2q5w3BuP5hF5Yhglh1o-FSuxZvWW9lQYs,161
100
+ secdiagram-0.5.0.dist-info/top_level.txt,sha256=Z0Yjlvl9jE-bYtHt7w2I6qDHCzqwfi6Cg6PgQEgmwzU,16
101
+ secdiagram-0.5.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ secdiagram = secdiagram_core.cli:main
3
+ secdiagram-image = secdiagram_core.render_image:main
4
+ secdiagram-server = secdiagram_core.cli:server_main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vichhaiyserey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ secdiagram_core
@@ -0,0 +1,186 @@
1
+ """secdiagram: deterministic architecture and security graphs for Python, .NET, Node.js, and polyglot repositories."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ __version__ = "0.5.0"
8
+ SCHEMA_VERSION = 1
9
+ SCHEMA_FEATURES = (
10
+ "finding.assessment/v1",
11
+ "finding.rule/v1",
12
+ "finding.provenance/v1",
13
+ "finding.remediation/v1",
14
+ "finding.provenance/v2",
15
+ "analysis.coverage/v1",
16
+ "analysis.swift/v1",
17
+ "analysis.application/v1",
18
+ "finding.application_context/v1",
19
+ "finding.lifecycle/v1",
20
+ "evidence.snapshot/v1",
21
+ "remediation.backlog/v1",
22
+ )
23
+
24
+ from .analyzer import AnalysisConfig, AnalysisResult, analyze, run_analysis
25
+ from .backlog import (
26
+ build_backlog,
27
+ render_backlog_json,
28
+ render_backlog_markdown,
29
+ render_github_issues,
30
+ render_gitlab_issues,
31
+ render_jira_issues,
32
+ )
33
+ from .config import SecdiagramConfig, load_config
34
+ from .evidence_model import (
35
+ EvidenceSnapshotError,
36
+ build_evidence_snapshot,
37
+ canonical_finding,
38
+ correlation_key,
39
+ dedupe_key,
40
+ group_findings,
41
+ load_evidence_snapshot,
42
+ load_lifecycle,
43
+ verify_evidence_snapshot,
44
+ write_evidence_snapshot,
45
+ )
46
+ from .frameworks import register_framework, register_sanitizer, register_sink
47
+ from .high_level import (
48
+ HighLevelArchitecture,
49
+ Subsystem,
50
+ SubsystemConnection,
51
+ build_high_level_architecture,
52
+ render_mermaid_highlevel,
53
+ )
54
+ from .model import (
55
+ DependencyReachabilitySummary,
56
+ Edge,
57
+ Finding,
58
+ Graph,
59
+ Loc,
60
+ Node,
61
+ TaintTrace,
62
+ )
63
+ from .protocols import (
64
+ LanguageIndexer,
65
+ ReportExporter,
66
+ SecurityRuleProvider,
67
+ get_registered_exporters,
68
+ get_registered_indexers,
69
+ get_registered_security_providers,
70
+ register_exporter,
71
+ register_indexer,
72
+ register_security_provider,
73
+ reset_registries,
74
+ unregister_exporter,
75
+ unregister_indexer,
76
+ unregister_security_provider,
77
+ )
78
+ from .render_image import ImageRenderError, render_image
79
+ from .render_mermaid import render_mermaid as _render_mermaid_graph
80
+ from .render_vex import render_vex
81
+ from .server import BasicAuthenticator, NoOpAuthenticator, create_server, serve
82
+
83
+
84
+ def render_mermaid(
85
+ target: Any,
86
+ *,
87
+ direction: str = "TD",
88
+ theme: str = "modern",
89
+ detail: str = "architecture",
90
+ link_base: str | None = None,
91
+ max_diagram_nodes: int = 200,
92
+ **kwargs: Any,
93
+ ) -> str:
94
+ """Polymorphic Mermaid renderer supporting AnalysisResult, HighLevelArchitecture, or Graph."""
95
+ if isinstance(target, HighLevelArchitecture):
96
+ return render_mermaid_highlevel(
97
+ target,
98
+ direction="TB" if direction in {"TB", "TD"} else "LR",
99
+ theme=theme,
100
+ )
101
+ if hasattr(target, "graph") and isinstance(target.graph, Graph):
102
+ return _render_mermaid_graph(
103
+ target.graph,
104
+ direction=direction,
105
+ theme=theme,
106
+ detail=detail,
107
+ link_base=link_base,
108
+ max_diagram_nodes=max_diagram_nodes,
109
+ )
110
+ if isinstance(target, Graph):
111
+ return _render_mermaid_graph(
112
+ target,
113
+ direction=direction,
114
+ theme=theme,
115
+ detail=detail,
116
+ link_base=link_base,
117
+ max_diagram_nodes=max_diagram_nodes,
118
+ )
119
+ raise TypeError(
120
+ f"render_mermaid expected Graph, AnalysisResult, or HighLevelArchitecture, got {type(target).__name__}"
121
+ )
122
+
123
+
124
+ __all__ = [
125
+ "__version__",
126
+ "SCHEMA_VERSION",
127
+ "SCHEMA_FEATURES",
128
+ "analyze",
129
+ "run_analysis",
130
+ "AnalysisConfig",
131
+ "AnalysisResult",
132
+ "render_mermaid",
133
+ "render_mermaid_highlevel",
134
+ "render_vex",
135
+ "render_image",
136
+ "ImageRenderError",
137
+ "build_evidence_snapshot",
138
+ "write_evidence_snapshot",
139
+ "load_evidence_snapshot",
140
+ "verify_evidence_snapshot",
141
+ "canonical_finding",
142
+ "group_findings",
143
+ "dedupe_key",
144
+ "correlation_key",
145
+ "load_lifecycle",
146
+ "EvidenceSnapshotError",
147
+ "build_backlog",
148
+ "render_backlog_json",
149
+ "render_backlog_markdown",
150
+ "render_jira_issues",
151
+ "render_gitlab_issues",
152
+ "render_github_issues",
153
+ "HighLevelArchitecture",
154
+ "Subsystem",
155
+ "SubsystemConnection",
156
+ "build_high_level_architecture",
157
+ "Graph",
158
+ "Node",
159
+ "Edge",
160
+ "Finding",
161
+ "Loc",
162
+ "TaintTrace",
163
+ "DependencyReachabilitySummary",
164
+ "register_framework",
165
+ "register_sanitizer",
166
+ "register_sink",
167
+ "create_server",
168
+ "serve",
169
+ "load_config",
170
+ "SecdiagramConfig",
171
+ "BasicAuthenticator",
172
+ "NoOpAuthenticator",
173
+ "LanguageIndexer",
174
+ "SecurityRuleProvider",
175
+ "ReportExporter",
176
+ "register_indexer",
177
+ "unregister_indexer",
178
+ "get_registered_indexers",
179
+ "register_security_provider",
180
+ "unregister_security_provider",
181
+ "get_registered_security_providers",
182
+ "register_exporter",
183
+ "unregister_exporter",
184
+ "get_registered_exporters",
185
+ "reset_registries",
186
+ ]