starshield-forensics 0.3.7__tar.gz → 0.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. starshield_forensics-0.3.8/PKG-INFO +194 -0
  2. starshield_forensics-0.3.8/README.md +174 -0
  3. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/pyproject.toml +6 -2
  4. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/__init__.py +1 -1
  5. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/cli.py +21 -3
  6. starshield_forensics-0.3.8/starshield/mcp_server.py +465 -0
  7. starshield_forensics-0.3.8/starshield_forensics.egg-info/PKG-INFO +194 -0
  8. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield_forensics.egg-info/SOURCES.txt +1 -0
  9. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/tests/test_adversarial.py +173 -0
  10. starshield_forensics-0.3.7/PKG-INFO +0 -119
  11. starshield_forensics-0.3.7/README.md +0 -99
  12. starshield_forensics-0.3.7/starshield_forensics.egg-info/PKG-INFO +0 -119
  13. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/LICENSE +0 -0
  14. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/setup.cfg +0 -0
  15. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/data/__init__.py +0 -0
  16. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/data/synthetic_case_benchmark.json +0 -0
  17. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/image_containers.py +0 -0
  18. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/ioc_validators.py +0 -0
  19. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield/leveldb_log.py +0 -0
  20. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield_forensics.egg-info/dependency_links.txt +0 -0
  21. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield_forensics.egg-info/entry_points.txt +0 -0
  22. {starshield_forensics-0.3.7 → starshield_forensics-0.3.8}/starshield_forensics.egg-info/top_level.txt +0 -0
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: starshield-forensics
3
+ Version: 0.3.8
4
+ Summary: Deterministic, offline Chromium & Electron LevelDB (.log) carver, PNG/JPEG screenshot & ICC provenance inspector, ISO-13616/Luhn financial checksum validator, and zero-dependency Model Context Protocol (MCP) server.
5
+ Author: Ziqi Xiao
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://ziqi.github.io/starshield/
8
+ Project-URL: Repository, https://github.com/Ziqi/starshield-forensics
9
+ Keywords: digital-forensics,dfir,leveldb,indexeddb,electron,png-metadata,image-forensics,iban-validator,mcp,model-context-protocol,evidence-triage
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Intended Audience :: Legal Industry
13
+ Classifier: Intended Audience :: Information Technology
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Security
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # `starshield-forensics` (`v0.3.8` — Clean-Room Deterministic DFIR & MCP Toolkit)
22
+
23
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/16602/badge)](https://www.bestpractices.dev/projects/16602)
24
+ [![OpenSSF Scorecard](https://img.shields.io/endpoint?url=https%3A%2F%2Fziqi.github.io%2Fstarshield%2Fscorecard.json)](https://github.com/Ziqi/starshield-forensics/actions/workflows/scorecard.yml)
25
+ [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://github.com/Ziqi/starshield-forensics/attestations)
26
+ [![OSPS Baseline](https://img.shields.io/badge/OpenSSF%20OSPS%20Baseline-Level%203%20%28EU%20CRA%20Aligned%29-brightgreen)](./SECURITY.md#5-openssf-osps-baseline-level-3--eu-cyber-resilience-act-cra-alignment)
27
+ [![UK FSR Statutory Code / ISO 17025 Validation](https://img.shields.io/badge/Validation-UK%20FSR%20%28FSA--DIG--100%29%20%26%20ISO%2017025%20Aligned-blue)](./VALIDATION_REPORT_FSR_ISO17025.md)
28
+ [![PyPI](https://img.shields.io/pypi/v/starshield-forensics?label=PyPI%20%28PEP%20740%29&color=blue)](https://pypi.org/project/starshield-forensics/0.3.8/)
29
+
30
+ > **English** | **[简体中文 (`README.zh-CN.md`)](./README.zh-CN.md)**
31
+
32
+ > **Deterministic Chromium & Electron IndexedDB / LevelDB `.log` Multi-Schema Record Carver, Structural PNG/JPEG Container Inspector, Financial Checksum Validator & Zero-Dependency `MCP` Server**
33
+ >
34
+ > **Author:** [Ziqi Xiao](https://ziqi.github.io/starshield/) (`@Ziqi`) · **PyPI:** [`starshield-forensics 0.3.8 (PEP 740)`](https://pypi.org/project/starshield-forensics/0.3.8/) · **Homebrew:** [`Ziqi/tap/starshield-forensics`](https://github.com/Ziqi/homebrew-tap) · **Concept DOI:** [`10.5281/zenodo.24145804`](https://doi.org/10.5281/zenodo.24145804) (`v0.3.7`: [`10.5281/zenodo.24156262`](https://doi.org/10.5281/zenodo.24156262)) · **SWHID:** [`swh:1:snp:4ed5efec...`](https://archive.softwareheritage.org/swh:1:snp:4ed5efecab5e40975e75a5c5107b63121b1df60a;origin=https://github.com/Ziqi/starshield-forensics) · **OpenSSF Best Practices:** [`#16602 (SILVER — 226%)`](https://www.bestpractices.dev/projects/16602) · **Scorecard:** [`8.0 / 10 (Fuzzing 10/10 · 11/18 Perfect Checks)`](https://github.com/Ziqi/starshield-forensics/actions/workflows/scorecard.yml) · **Provenance:** [SLSA L3 & Sigstore `/attestations`](https://github.com/Ziqi/starshield-forensics/attestations) · **Method Validation:** [UK FSR Statutory Code (`FSA – DIG 100`) / ISO 17025 Summary](./VALIDATION_REPORT_FSR_ISO17025.md) · **License:** MIT (`REUSE 3.3`) · **Runtime:** Python >= 3.10 (stdlib only, zero network calls, zero LLM dependencies)
35
+
36
+ ---
37
+
38
+ ## High-Frequency Use Cases (DFIR, FinTech Audit & Developer Diagnostics)
39
+
40
+ `starshield-forensics` is an **offline, read-only binary inspection and evidence triage toolkit** serving three primary audiences with zero third-party dependencies:
41
+
42
+ 1. **FinTech, E-Commerce & Expense-Audit Screenshot Pre-Screening (`starshield inspect-image`)**: Millisecond structural verification of reimbursement receipts, payment screenshots, and disputed attachments—verifying RFC 2083 PNG chunk CRC32 integrity (`IHDR`/`IDAT`/`IEND`/`iCCP`), multi-segment ISO 10918 JPEG `APP2 ICC_PROFILE` color headers (`acsp`), and Photoshop `APP13 (8BIM)` resource blocks alongside offline ISO-7812 Luhn / 89-country ISO-13616 IBAN Mod-97 / ISO-9362 SWIFT validation.
43
+ 2. **Developer & IT Offline Diagnostics for Corrupted Electron / Chrome Caches (`starshield precheck` & `parse-leveldb-log`)**: Read-only local health check and uncompacted `.log` write-ahead log recovery for corrupted Chromium browser (`Chrome`, `Edge`, `Brave`) and **Electron desktop app (`VS Code`, `Slack`, `Microsoft Teams`, `Discord`, `WhatsApp Desktop`)** IndexedDB / Local Storage caches using strict masked Castagnoli CRC32C (`0xA282EAD8`) verification.
44
+ 3. **Legal & DFIR Pre-Action Evidentiary Triage (`UK FSR FSA – DIG 100` / `ISO 17025` Aligned)**: Byte-offset-cited carving of soft-deleted or edited web-messaging and B2B portal records with explicit four-tier epistemic tagging (`OBSERVED` / `DERIVED` / `INFERRED` / `UNKNOWN`) and ephemeral `HMAC-SHA256` pseudonymization.
45
+
46
+ All bundled fixtures in `samples/` and `starshield/data/`—plus the seeded 24-case evaluation suite in `benchmark/benchmark_suite.py` (`StarShield-Bench-24`)—are **100% clean-room specification test vectors** modeled on a fictional 2025 UK supplier-invoice scenario (`GBP 18,400.00`, ISO-13616 example IBANs `GB82WEST12345698765432` and `NO9386011117947`, Luhn test string `6200000000000005`). Zero real incident data or PII is included.
47
+
48
+ ---
49
+
50
+ ## Epistemic Tiers & Capability Boundary Matrix (`v0.3.8`)
51
+
52
+ Every analytical output carries an explicit machine-readable epistemic tier so investigators and solicitors never conflate raw bytes with interpretive leads:
53
+
54
+ - **`OBSERVED`**: Directly present in raw input bytes, chunk headers, or JSON fields (bound to physical WAL frame offsets or chunk offsets).
55
+ - **`DERIVED`**: Deterministically computed from raw input via standardized algorithms (Castagnoli CRC32C, ISO/IEC 7812 Luhn, ISO-13616 Mod-97, UTC delta arithmetic).
56
+ - **`INFERRED`**: Contextual triage lead requiring external corroboration (e.g., server-side bank logs or subpoenaed ISP records); never asserted as standalone proof.
57
+ - **`UNKNOWN`**: Explicitly outside the evidentiary boundary of local client artifacts (e.g., records compacted prior to acquisition).
58
+
59
+ | Module | Capability in `v0.3.8` | Epistemic Boundary & Known Limitations |
60
+ | :--- | :--- | :--- |
61
+ | **Zero-PII Storage Feasibility Gate** (`precheck`) | Scans Chromium & Electron IndexedDB / Local Storage folders or `.log`/`.ldb` files offline, checks LevelDB SSTable footer magic (`0xdb4775248b80fb57`), `.blob` directories, and Blink `0xFF` headers, emitting a deterministic `GO` / `PARTIAL` / `NO_GO_COMPACTED_OR_UNSUPPORTED` manifest with zero plaintext leakage. | *Pre-screens compaction status prior to triage; does not decompress `.ldb` blocks.* |
62
+ | **Chromium & Electron LevelDB `.log` Carver** (`leveldb_log.py`) | Parses 32 KiB physical blocks, verifies masked Castagnoli CRC32C (`0xA282EAD8`), reassembles cross-block `FULL`/`FIRST`/`MIDDLE`/`LAST` WriteBatch frames, and extracts UTF-8 & Blink UTF-16LE JSON records across Chromium browsers and Electron desktop apps (`chatsvc` for Microsoft Teams/Skype, Slack, WhatsApp Web/Desktop, Discord, `VS Code`, and B2B invoice portals via `--schema auto\|chatsvc\|generic-json`). | *Does not decompress Snappy `.ldb` SSTables or decode non-JSON Blink `StructuredClone` primitives (roadmap: `v0.4`).* |
63
+ | **Exported Message & Portal JSON Triage** (`triage-json`) | Enumerates soft-deleted (`deletetime` / `deleted_ts` / `is_deleted`) and edited (`edittime` / `edited.ts`) JSON records across messaging & portal exports, extracting validated IOCs strictly per record. | *Cannot quantify records already compacted or evicted prior to acquisition.* |
64
+ | **Financial Checksum Validation** (`ioc_validators.py`) | Validates payment cards via ISO/IEC 7812 **Luhn**, IBANs via all 89 SWIFT IBAN Registry country lengths (15–34 chars) + **Mod-97**, SWIFT/BICs via all **249 ISO 3166-1 alpha-2 country codes + `XK`** (`250` total codes) + stopword filtering, and pairs UK Sort Codes within a 120-char intra-message window. | *Does not bundle proprietary Pay.UK Vocalink sort-code modulus weight tables.* |
65
+ | **RFC 2083 PNG & ISO 10918 JPEG Container Inspection** (`image_containers.py`) | Enforces PNG `IHDR` + `IDAT` + `IEND` completeness and per-chunk CRC32, bounded-decompresses `iCCP` chunks (`acsp`), and reassembles multi-chunk JPEG `APP2` `ICC_PROFILE` + `APP13` (`8BIM`) segments through `SOS`/`EOI` (`0xFFD9`). | *Emits neutral container observations + benign screenshot/OS-resave caveats; never declares standalone "proof of forgery".* |
66
+ | **Zero-Dependency `MCP` Server** (`mcp_server.py` / `starshield mcp`) | Exposes 4 read-only deterministic tools (`starshield_demo`, `starshield_precheck_leveldb`, `starshield_inspect_image_tamper`, `starshield_validate_financial_iocs`) over JSON-RPC 2.0 `stdio` (newline & `Content-Length` framed) for Claude Desktop, Cursor, Google Antigravity, and Windsurf. | *Enforces `HMAC-SHA256` masked mode by default so cloud LLMs never receive raw PII, filenames, or raw SHA-256 hashes.* |
67
+ | **Keyed Pseudonymization & Cryptographic Agility** (`cli.py`) | Default masked mode applies ephemeral per-run `HMAC-SHA256` tokens (configurable via `--hmac-digest {sha256,sha384,blake2b}` and external 32-byte salt `--hmac-key-file PATH`) and suppresses raw file `SHA-256` hashes, exact byte lengths, source filenames, PNG `tEXt/iTXt` previews, custom ICC names, exact UTC dates, and failure-path `stderr` filenames/byte counts/snippets. | *Provides keyed pseudonymization for casual screen/log hygiene—NOT formal legal anonymization under UK GDPR / GDPR. Pass `--unredacted` only inside authorized offline environments.* |
68
+
69
+ ---
70
+
71
+ ## 10-Second Zero-Install Tryout (`uvx`) & Installation (`pip` PEP 740 / `.pyz`)
72
+
73
+ ```bash
74
+ # Instant zero-install clean-room showcase (fetches PyPI wheel directly, zero repo clone needed):
75
+ uvx --from starshield-forensics starshield demo
76
+
77
+ # Option A — Official PyPI package (with PEP 740 Sigstore digital attestations, zero dependencies):
78
+ pip install starshield-forensics
79
+ starshield demo
80
+
81
+ # Option A2 — macOS / Linux Homebrew Tap (isolated virtualenv formula, zero dependencies):
82
+ brew install Ziqi/tap/starshield-forensics && starshield demo
83
+
84
+ # Option B — Zero-install single-file zipapp (for air-gapped forensic VMs & law-firm IT):
85
+ python3 starshield.pyz demo
86
+ python3 starshield.pyz precheck /path/to/readonly_chromium_idb_copy
87
+
88
+ # Option C — Clone & run all 26 unit/MCP tests, fuzzing harness & StarShield-Bench-24 (<1s, zero dependencies):
89
+ git clone https://github.com/Ziqi/starshield-forensics.git
90
+ cd starshield-forensics
91
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -m unittest discover -s tests -v
92
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -W error tests/fuzz_parsers.py --stdlib --iterations 2500
93
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 benchmark/benchmark_suite.py
94
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 scripts/verify_cross_tool_forensics.py
95
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -m starshield.cli demo
96
+ ```
97
+
98
+ ### Zero-Install AI Agent Integration (`starshield mcp` for Claude Desktop, Cursor, Antigravity & Windsurf)
99
+
100
+ Mount StarShield's 4 deterministic read-only binary inspection tools directly into any MCP client (privacy-masked by default via ephemeral `HMAC-SHA256` so cloud LLMs never see raw PII, filenames, or raw hashes):
101
+
102
+ ```json
103
+ {
104
+ "mcpServers": {
105
+ "starshield-forensics": {
106
+ "command": "uvx",
107
+ "args": ["--from", "starshield-forensics", "starshield", "mcp"]
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Sample Deterministic Output (`starshield demo`, Default Masked Mode)
114
+
115
+ ```json
116
+ {
117
+ "epistemic_tier": "OBSERVED",
118
+ "schema_detected": "chatsvc",
119
+ "leveldb_batch_byte_offset": 397,
120
+ "leveldb_sequence_number": 1002,
121
+ "is_soft_deleted_in_ui": true,
122
+ "sender_mri": "[REDACTED_HMAC:1b71a34908e1]",
123
+ "cached_content": "[REDACTED_CONTENT — pass --unredacted to view]",
124
+ "extracted_iocs": {
125
+ "luhn_validated_cards": ["[REDACTED_HMAC:3ec5f5677098]"],
126
+ "mod97_validated_ibans": ["[REDACTED_HMAC:4dad6b1cc0be]", "[REDACTED_HMAC:f21864d3e75c]"]
127
+ }
128
+ }
129
+ ```
130
+
131
+ ### CLI Subcommands (`starshield [--unredacted] [--max-mb 64] [--hmac-digest {sha256,sha384,blake2b}] [--hmac-key-file PATH] <subcommand>`)
132
+
133
+ | Subcommand | Input Artifact | Output JSON Summary |
134
+ | :--- | :--- | :--- |
135
+ | `demo` | Built-in synthetic fixtures | Runs end-to-end clean-room WAL, JSON, container, and checksum showcase |
136
+ | `precheck <path> [--schema ...]` | Chromium folder or `.log`/`.ldb` | Zero-PII `GO` / `PARTIAL` / `NO_GO` feasibility & compaction check |
137
+ | `parse-leveldb-log <file.log> [--schema ...]` | Chromium LevelDB `.log` WAL | Physical block CRC32C status, byte-offset-bound carved records, and validated IOCs |
138
+ | `triage-json <export.json> [--schema ...]` | Exported messaging/portal JSON | Soft-deleted & edited records + per-record IOC schedule |
139
+ | `inspect-image <image.png\|jpg>` | PNG or JPEG exhibit | Chunk/marker integrity, ICC profile (`acsp`) header fields, `8BIM`, and neutral caveats |
140
+ | `corroborate-timestamps <events.json>` | Timezone-aware UTC pairs | Monotonicity verification, clock-skew bounds, and edge-node frequency summary |
141
+ | `summarize-linguistics <chat.json>` | Chat transcript JSON | Descriptive utterance-length & punctuation distribution (`N >= 30` guardrailed) |
142
+ | `mcp` | JSON-RPC 2.0 `stdio` stream | Read-only MCP server exposing `starshield_demo`, `starshield_precheck_leveldb`, `starshield_inspect_image_tamper`, and `starshield_validate_financial_iocs` |
143
+
144
+ ---
145
+
146
+ ## Deterministic Core vs. Human-Reviewed Triage
147
+
148
+ `starshield-forensics` intentionally contains **zero LLM or network code**. Byte-offset extraction, CRC32C verification, and banking check-digit math must be 100% deterministic and reproducible, ensuring embedded adversary messages cannot trigger indirect prompt injection during extraction. Any downstream bilingual indexing or legal schedule preparation belongs in a human-reviewed workflow where every statement cites an immutable underlying record hash.
149
+
150
+ ---
151
+
152
+ ## Cryptographic Release Verification & Bit-for-Bit Reproducibility (`v0.3.8`)
153
+
154
+ Every official release (`starshield.pyz`, `.whl`, `.tar.gz`, and ISO/IEC 5962:2021 SPDX 2.3 SBOM `starshield-forensics-0.3.8.spdx.json`) is backed by **triple cryptographic verification**:
155
+ 1. **GitHub OIDC + Sigstore (`Fulcio` X.509 + `Rekor` transparency log)** build provenance & SPDX 2.3 SBOM attestations at [`/attestations`](https://github.com/Ziqi/starshield-forensics/attestations);
156
+ 2. **Isolated SLSA Build Level 3** provenance (`multiple.intoto.jsonl` via `slsa-framework/slsa-github-generator`);
157
+ 3. **Air-gapped OpenSSH `Ed25519`** detached maintainer signature (`SHA256SUMS.sig`) verified against [`KEYS.pub`](./KEYS.pub).
158
+
159
+ ```bash
160
+ # 1. Verify Sigstore X.509 + Rekor build & SBOM attestations via GitHub CLI:
161
+ gh attestation verify starshield.pyz -R Ziqi/starshield-forensics
162
+
163
+ # 2. Verify isolated SLSA Build Level 3 provenance (.intoto.jsonl):
164
+ slsa-verifier verify-artifact starshield.pyz \
165
+ --provenance-path multiple.intoto.jsonl \
166
+ --source-uri github.com/Ziqi/starshield-forensics
167
+
168
+ # 3. Offline air-gapped verification using standard OpenSSH (>=8.2p1) & SHA256SUMS:
169
+ ssh-keygen -Y verify -f KEYS.pub -I "2196305+Ziqi@users.noreply.github.com" -n file -s SHA256SUMS.sig < SHA256SUMS
170
+ shasum -a 256 -c SHA256SUMS
171
+
172
+ # 4. Rebuild starshield.pyz & SPDX 2.3 SBOM from source and verify bit-for-bit reproducibility:
173
+ python3 scripts/build_reproducible.py --verify
174
+ python3 scripts/generate_spdx_sbom.py --verify
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Governance, Method Validation & Security Reporting
180
+
181
+ | Verification / Archival Dimension | Live Status & Permanent Identifier |
182
+ | :--- | :--- |
183
+ | **Continuous Fuzzing (`ClusterFuzzLite / Atheris`)** | [![Fuzzing: 10/10](https://img.shields.io/badge/Scorecard%20Fuzzing-10%2F10%20%28ClusterFuzzLite%29-brightgreen)](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml) [![Continuous Fuzzing](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml) |
184
+ | **Static Security (`CodeQL SAST`) & Deterministic CI** | [![CodeQL SAST](https://github.com/Ziqi/starshield-forensics/actions/workflows/codeql.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/codeql.yml) [![StarShield Deterministic CI](https://github.com/Ziqi/starshield-forensics/actions/workflows/ci.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/ci.yml) |
185
+ | **Supply-Chain Provenance & Licensing (`REUSE 3.3`)** | [![Supply-Chain Attestations](https://github.com/Ziqi/starshield-forensics/actions/workflows/attestations.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/attestations) [![REUSE status](https://img.shields.io/badge/REUSE-3.3%20compliant-brightgreen)](./REUSE.toml) |
186
+ | **Packaging (`Homebrew Tap`) & Scholarly / UNESCO Archival** | [![Homebrew Tap](https://img.shields.io/badge/Homebrew-Ziqi%2Ftap-FBB040.svg?logo=homebrew&logoColor=white)](https://github.com/Ziqi/homebrew-tap) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24145804.svg)](https://doi.org/10.5281/zenodo.24145804) [![SWHID](https://img.shields.io/badge/SWHID-swh%3A1%3Asnp%3A4ed5efec-e20026)](https://archive.softwareheritage.org/swh:1:snp:4ed5efecab5e40975e75a5c5107b63121b1df60a;origin=https://github.com/Ziqi/starshield-forensics) |
187
+
188
+ - **Dual-Tool Forensic Method Validation (UK FSR Statutory Code `FSA – DIG 100` [superseding `FSR-C-107`] & `ISO/IEC 17025` Clause 7.2.2 Aligned):** [`VALIDATION_REPORT_FSR_ISO17025.md`](./VALIDATION_REPORT_FSR_ISO17025.md) (`482` test vectors cross-validated against Google `dfindexeddb 20260210` & `Pillow 13.0.0`; open-source validation aid for accredited laboratories, not a claim of laboratory accreditation)
189
+ - **OpenSSF Security Insights (v2.0.0), OSPS Baseline Level 3 (EU CRA Aligned) & REUSE 3.3:** [`SECURITY-INSIGHTS.yml`](./SECURITY-INSIGHTS.yml) · [`SECURITY.md §5`](./SECURITY.md#5-openssf-osps-baseline-level-3--eu-cyber-resilience-act-cra-alignment) · [`REUSE.toml`](./REUSE.toml) · **SWHID (`v0.3.7`):** [`swh:1:rel:3fa912215b0bb2510f7a2cfdfbd51293e29980c4`](https://archive.softwareheritage.org/swh:1:rel:3fa912215b0bb2510f7a2cfdfbd51293e29980c4;origin=https://github.com/Ziqi/starshield-forensics)
190
+ - **Security Assurance Case & 12-Month Roadmap:** [`SECURITY_ASSURANCE_CASE.md`](./SECURITY_ASSURANCE_CASE.md)
191
+ - **Vulnerability Response Policy (48h Ack SLA):** [`SECURITY.md`](./SECURITY.md) · [GitHub Private Vulnerability Reporting](https://github.com/Ziqi/starshield-forensics/security/advisories/new)
192
+ - **Governance, Roles & Continuity Policy:** [`GOVERNANCE.md`](./GOVERNANCE.md)
193
+ - **Contribution, DCO 1.1 & Testing Standards:** [`CONTRIBUTING.md`](./CONTRIBUTING.md) · [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md)
194
+ - **Author:** **Ziqi Xiao** (`@Ziqi`) — [Documentation & Sample Workpaper](https://ziqi.github.io/starshield/) · [GitHub Issues](https://github.com/Ziqi/starshield-forensics/issues)
@@ -0,0 +1,174 @@
1
+ # `starshield-forensics` (`v0.3.8` — Clean-Room Deterministic DFIR & MCP Toolkit)
2
+
3
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/16602/badge)](https://www.bestpractices.dev/projects/16602)
4
+ [![OpenSSF Scorecard](https://img.shields.io/endpoint?url=https%3A%2F%2Fziqi.github.io%2Fstarshield%2Fscorecard.json)](https://github.com/Ziqi/starshield-forensics/actions/workflows/scorecard.yml)
5
+ [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://github.com/Ziqi/starshield-forensics/attestations)
6
+ [![OSPS Baseline](https://img.shields.io/badge/OpenSSF%20OSPS%20Baseline-Level%203%20%28EU%20CRA%20Aligned%29-brightgreen)](./SECURITY.md#5-openssf-osps-baseline-level-3--eu-cyber-resilience-act-cra-alignment)
7
+ [![UK FSR Statutory Code / ISO 17025 Validation](https://img.shields.io/badge/Validation-UK%20FSR%20%28FSA--DIG--100%29%20%26%20ISO%2017025%20Aligned-blue)](./VALIDATION_REPORT_FSR_ISO17025.md)
8
+ [![PyPI](https://img.shields.io/pypi/v/starshield-forensics?label=PyPI%20%28PEP%20740%29&color=blue)](https://pypi.org/project/starshield-forensics/0.3.8/)
9
+
10
+ > **English** | **[简体中文 (`README.zh-CN.md`)](./README.zh-CN.md)**
11
+
12
+ > **Deterministic Chromium & Electron IndexedDB / LevelDB `.log` Multi-Schema Record Carver, Structural PNG/JPEG Container Inspector, Financial Checksum Validator & Zero-Dependency `MCP` Server**
13
+ >
14
+ > **Author:** [Ziqi Xiao](https://ziqi.github.io/starshield/) (`@Ziqi`) · **PyPI:** [`starshield-forensics 0.3.8 (PEP 740)`](https://pypi.org/project/starshield-forensics/0.3.8/) · **Homebrew:** [`Ziqi/tap/starshield-forensics`](https://github.com/Ziqi/homebrew-tap) · **Concept DOI:** [`10.5281/zenodo.24145804`](https://doi.org/10.5281/zenodo.24145804) (`v0.3.7`: [`10.5281/zenodo.24156262`](https://doi.org/10.5281/zenodo.24156262)) · **SWHID:** [`swh:1:snp:4ed5efec...`](https://archive.softwareheritage.org/swh:1:snp:4ed5efecab5e40975e75a5c5107b63121b1df60a;origin=https://github.com/Ziqi/starshield-forensics) · **OpenSSF Best Practices:** [`#16602 (SILVER — 226%)`](https://www.bestpractices.dev/projects/16602) · **Scorecard:** [`8.0 / 10 (Fuzzing 10/10 · 11/18 Perfect Checks)`](https://github.com/Ziqi/starshield-forensics/actions/workflows/scorecard.yml) · **Provenance:** [SLSA L3 & Sigstore `/attestations`](https://github.com/Ziqi/starshield-forensics/attestations) · **Method Validation:** [UK FSR Statutory Code (`FSA – DIG 100`) / ISO 17025 Summary](./VALIDATION_REPORT_FSR_ISO17025.md) · **License:** MIT (`REUSE 3.3`) · **Runtime:** Python >= 3.10 (stdlib only, zero network calls, zero LLM dependencies)
15
+
16
+ ---
17
+
18
+ ## High-Frequency Use Cases (DFIR, FinTech Audit & Developer Diagnostics)
19
+
20
+ `starshield-forensics` is an **offline, read-only binary inspection and evidence triage toolkit** serving three primary audiences with zero third-party dependencies:
21
+
22
+ 1. **FinTech, E-Commerce & Expense-Audit Screenshot Pre-Screening (`starshield inspect-image`)**: Millisecond structural verification of reimbursement receipts, payment screenshots, and disputed attachments—verifying RFC 2083 PNG chunk CRC32 integrity (`IHDR`/`IDAT`/`IEND`/`iCCP`), multi-segment ISO 10918 JPEG `APP2 ICC_PROFILE` color headers (`acsp`), and Photoshop `APP13 (8BIM)` resource blocks alongside offline ISO-7812 Luhn / 89-country ISO-13616 IBAN Mod-97 / ISO-9362 SWIFT validation.
23
+ 2. **Developer & IT Offline Diagnostics for Corrupted Electron / Chrome Caches (`starshield precheck` & `parse-leveldb-log`)**: Read-only local health check and uncompacted `.log` write-ahead log recovery for corrupted Chromium browser (`Chrome`, `Edge`, `Brave`) and **Electron desktop app (`VS Code`, `Slack`, `Microsoft Teams`, `Discord`, `WhatsApp Desktop`)** IndexedDB / Local Storage caches using strict masked Castagnoli CRC32C (`0xA282EAD8`) verification.
24
+ 3. **Legal & DFIR Pre-Action Evidentiary Triage (`UK FSR FSA – DIG 100` / `ISO 17025` Aligned)**: Byte-offset-cited carving of soft-deleted or edited web-messaging and B2B portal records with explicit four-tier epistemic tagging (`OBSERVED` / `DERIVED` / `INFERRED` / `UNKNOWN`) and ephemeral `HMAC-SHA256` pseudonymization.
25
+
26
+ All bundled fixtures in `samples/` and `starshield/data/`—plus the seeded 24-case evaluation suite in `benchmark/benchmark_suite.py` (`StarShield-Bench-24`)—are **100% clean-room specification test vectors** modeled on a fictional 2025 UK supplier-invoice scenario (`GBP 18,400.00`, ISO-13616 example IBANs `GB82WEST12345698765432` and `NO9386011117947`, Luhn test string `6200000000000005`). Zero real incident data or PII is included.
27
+
28
+ ---
29
+
30
+ ## Epistemic Tiers & Capability Boundary Matrix (`v0.3.8`)
31
+
32
+ Every analytical output carries an explicit machine-readable epistemic tier so investigators and solicitors never conflate raw bytes with interpretive leads:
33
+
34
+ - **`OBSERVED`**: Directly present in raw input bytes, chunk headers, or JSON fields (bound to physical WAL frame offsets or chunk offsets).
35
+ - **`DERIVED`**: Deterministically computed from raw input via standardized algorithms (Castagnoli CRC32C, ISO/IEC 7812 Luhn, ISO-13616 Mod-97, UTC delta arithmetic).
36
+ - **`INFERRED`**: Contextual triage lead requiring external corroboration (e.g., server-side bank logs or subpoenaed ISP records); never asserted as standalone proof.
37
+ - **`UNKNOWN`**: Explicitly outside the evidentiary boundary of local client artifacts (e.g., records compacted prior to acquisition).
38
+
39
+ | Module | Capability in `v0.3.8` | Epistemic Boundary & Known Limitations |
40
+ | :--- | :--- | :--- |
41
+ | **Zero-PII Storage Feasibility Gate** (`precheck`) | Scans Chromium & Electron IndexedDB / Local Storage folders or `.log`/`.ldb` files offline, checks LevelDB SSTable footer magic (`0xdb4775248b80fb57`), `.blob` directories, and Blink `0xFF` headers, emitting a deterministic `GO` / `PARTIAL` / `NO_GO_COMPACTED_OR_UNSUPPORTED` manifest with zero plaintext leakage. | *Pre-screens compaction status prior to triage; does not decompress `.ldb` blocks.* |
42
+ | **Chromium & Electron LevelDB `.log` Carver** (`leveldb_log.py`) | Parses 32 KiB physical blocks, verifies masked Castagnoli CRC32C (`0xA282EAD8`), reassembles cross-block `FULL`/`FIRST`/`MIDDLE`/`LAST` WriteBatch frames, and extracts UTF-8 & Blink UTF-16LE JSON records across Chromium browsers and Electron desktop apps (`chatsvc` for Microsoft Teams/Skype, Slack, WhatsApp Web/Desktop, Discord, `VS Code`, and B2B invoice portals via `--schema auto\|chatsvc\|generic-json`). | *Does not decompress Snappy `.ldb` SSTables or decode non-JSON Blink `StructuredClone` primitives (roadmap: `v0.4`).* |
43
+ | **Exported Message & Portal JSON Triage** (`triage-json`) | Enumerates soft-deleted (`deletetime` / `deleted_ts` / `is_deleted`) and edited (`edittime` / `edited.ts`) JSON records across messaging & portal exports, extracting validated IOCs strictly per record. | *Cannot quantify records already compacted or evicted prior to acquisition.* |
44
+ | **Financial Checksum Validation** (`ioc_validators.py`) | Validates payment cards via ISO/IEC 7812 **Luhn**, IBANs via all 89 SWIFT IBAN Registry country lengths (15–34 chars) + **Mod-97**, SWIFT/BICs via all **249 ISO 3166-1 alpha-2 country codes + `XK`** (`250` total codes) + stopword filtering, and pairs UK Sort Codes within a 120-char intra-message window. | *Does not bundle proprietary Pay.UK Vocalink sort-code modulus weight tables.* |
45
+ | **RFC 2083 PNG & ISO 10918 JPEG Container Inspection** (`image_containers.py`) | Enforces PNG `IHDR` + `IDAT` + `IEND` completeness and per-chunk CRC32, bounded-decompresses `iCCP` chunks (`acsp`), and reassembles multi-chunk JPEG `APP2` `ICC_PROFILE` + `APP13` (`8BIM`) segments through `SOS`/`EOI` (`0xFFD9`). | *Emits neutral container observations + benign screenshot/OS-resave caveats; never declares standalone "proof of forgery".* |
46
+ | **Zero-Dependency `MCP` Server** (`mcp_server.py` / `starshield mcp`) | Exposes 4 read-only deterministic tools (`starshield_demo`, `starshield_precheck_leveldb`, `starshield_inspect_image_tamper`, `starshield_validate_financial_iocs`) over JSON-RPC 2.0 `stdio` (newline & `Content-Length` framed) for Claude Desktop, Cursor, Google Antigravity, and Windsurf. | *Enforces `HMAC-SHA256` masked mode by default so cloud LLMs never receive raw PII, filenames, or raw SHA-256 hashes.* |
47
+ | **Keyed Pseudonymization & Cryptographic Agility** (`cli.py`) | Default masked mode applies ephemeral per-run `HMAC-SHA256` tokens (configurable via `--hmac-digest {sha256,sha384,blake2b}` and external 32-byte salt `--hmac-key-file PATH`) and suppresses raw file `SHA-256` hashes, exact byte lengths, source filenames, PNG `tEXt/iTXt` previews, custom ICC names, exact UTC dates, and failure-path `stderr` filenames/byte counts/snippets. | *Provides keyed pseudonymization for casual screen/log hygiene—NOT formal legal anonymization under UK GDPR / GDPR. Pass `--unredacted` only inside authorized offline environments.* |
48
+
49
+ ---
50
+
51
+ ## 10-Second Zero-Install Tryout (`uvx`) & Installation (`pip` PEP 740 / `.pyz`)
52
+
53
+ ```bash
54
+ # Instant zero-install clean-room showcase (fetches PyPI wheel directly, zero repo clone needed):
55
+ uvx --from starshield-forensics starshield demo
56
+
57
+ # Option A — Official PyPI package (with PEP 740 Sigstore digital attestations, zero dependencies):
58
+ pip install starshield-forensics
59
+ starshield demo
60
+
61
+ # Option A2 — macOS / Linux Homebrew Tap (isolated virtualenv formula, zero dependencies):
62
+ brew install Ziqi/tap/starshield-forensics && starshield demo
63
+
64
+ # Option B — Zero-install single-file zipapp (for air-gapped forensic VMs & law-firm IT):
65
+ python3 starshield.pyz demo
66
+ python3 starshield.pyz precheck /path/to/readonly_chromium_idb_copy
67
+
68
+ # Option C — Clone & run all 26 unit/MCP tests, fuzzing harness & StarShield-Bench-24 (<1s, zero dependencies):
69
+ git clone https://github.com/Ziqi/starshield-forensics.git
70
+ cd starshield-forensics
71
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -m unittest discover -s tests -v
72
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -W error tests/fuzz_parsers.py --stdlib --iterations 2500
73
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 benchmark/benchmark_suite.py
74
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 scripts/verify_cross_tool_forensics.py
75
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. python3 -m starshield.cli demo
76
+ ```
77
+
78
+ ### Zero-Install AI Agent Integration (`starshield mcp` for Claude Desktop, Cursor, Antigravity & Windsurf)
79
+
80
+ Mount StarShield's 4 deterministic read-only binary inspection tools directly into any MCP client (privacy-masked by default via ephemeral `HMAC-SHA256` so cloud LLMs never see raw PII, filenames, or raw hashes):
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "starshield-forensics": {
86
+ "command": "uvx",
87
+ "args": ["--from", "starshield-forensics", "starshield", "mcp"]
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ### Sample Deterministic Output (`starshield demo`, Default Masked Mode)
94
+
95
+ ```json
96
+ {
97
+ "epistemic_tier": "OBSERVED",
98
+ "schema_detected": "chatsvc",
99
+ "leveldb_batch_byte_offset": 397,
100
+ "leveldb_sequence_number": 1002,
101
+ "is_soft_deleted_in_ui": true,
102
+ "sender_mri": "[REDACTED_HMAC:1b71a34908e1]",
103
+ "cached_content": "[REDACTED_CONTENT — pass --unredacted to view]",
104
+ "extracted_iocs": {
105
+ "luhn_validated_cards": ["[REDACTED_HMAC:3ec5f5677098]"],
106
+ "mod97_validated_ibans": ["[REDACTED_HMAC:4dad6b1cc0be]", "[REDACTED_HMAC:f21864d3e75c]"]
107
+ }
108
+ }
109
+ ```
110
+
111
+ ### CLI Subcommands (`starshield [--unredacted] [--max-mb 64] [--hmac-digest {sha256,sha384,blake2b}] [--hmac-key-file PATH] <subcommand>`)
112
+
113
+ | Subcommand | Input Artifact | Output JSON Summary |
114
+ | :--- | :--- | :--- |
115
+ | `demo` | Built-in synthetic fixtures | Runs end-to-end clean-room WAL, JSON, container, and checksum showcase |
116
+ | `precheck <path> [--schema ...]` | Chromium folder or `.log`/`.ldb` | Zero-PII `GO` / `PARTIAL` / `NO_GO` feasibility & compaction check |
117
+ | `parse-leveldb-log <file.log> [--schema ...]` | Chromium LevelDB `.log` WAL | Physical block CRC32C status, byte-offset-bound carved records, and validated IOCs |
118
+ | `triage-json <export.json> [--schema ...]` | Exported messaging/portal JSON | Soft-deleted & edited records + per-record IOC schedule |
119
+ | `inspect-image <image.png\|jpg>` | PNG or JPEG exhibit | Chunk/marker integrity, ICC profile (`acsp`) header fields, `8BIM`, and neutral caveats |
120
+ | `corroborate-timestamps <events.json>` | Timezone-aware UTC pairs | Monotonicity verification, clock-skew bounds, and edge-node frequency summary |
121
+ | `summarize-linguistics <chat.json>` | Chat transcript JSON | Descriptive utterance-length & punctuation distribution (`N >= 30` guardrailed) |
122
+ | `mcp` | JSON-RPC 2.0 `stdio` stream | Read-only MCP server exposing `starshield_demo`, `starshield_precheck_leveldb`, `starshield_inspect_image_tamper`, and `starshield_validate_financial_iocs` |
123
+
124
+ ---
125
+
126
+ ## Deterministic Core vs. Human-Reviewed Triage
127
+
128
+ `starshield-forensics` intentionally contains **zero LLM or network code**. Byte-offset extraction, CRC32C verification, and banking check-digit math must be 100% deterministic and reproducible, ensuring embedded adversary messages cannot trigger indirect prompt injection during extraction. Any downstream bilingual indexing or legal schedule preparation belongs in a human-reviewed workflow where every statement cites an immutable underlying record hash.
129
+
130
+ ---
131
+
132
+ ## Cryptographic Release Verification & Bit-for-Bit Reproducibility (`v0.3.8`)
133
+
134
+ Every official release (`starshield.pyz`, `.whl`, `.tar.gz`, and ISO/IEC 5962:2021 SPDX 2.3 SBOM `starshield-forensics-0.3.8.spdx.json`) is backed by **triple cryptographic verification**:
135
+ 1. **GitHub OIDC + Sigstore (`Fulcio` X.509 + `Rekor` transparency log)** build provenance & SPDX 2.3 SBOM attestations at [`/attestations`](https://github.com/Ziqi/starshield-forensics/attestations);
136
+ 2. **Isolated SLSA Build Level 3** provenance (`multiple.intoto.jsonl` via `slsa-framework/slsa-github-generator`);
137
+ 3. **Air-gapped OpenSSH `Ed25519`** detached maintainer signature (`SHA256SUMS.sig`) verified against [`KEYS.pub`](./KEYS.pub).
138
+
139
+ ```bash
140
+ # 1. Verify Sigstore X.509 + Rekor build & SBOM attestations via GitHub CLI:
141
+ gh attestation verify starshield.pyz -R Ziqi/starshield-forensics
142
+
143
+ # 2. Verify isolated SLSA Build Level 3 provenance (.intoto.jsonl):
144
+ slsa-verifier verify-artifact starshield.pyz \
145
+ --provenance-path multiple.intoto.jsonl \
146
+ --source-uri github.com/Ziqi/starshield-forensics
147
+
148
+ # 3. Offline air-gapped verification using standard OpenSSH (>=8.2p1) & SHA256SUMS:
149
+ ssh-keygen -Y verify -f KEYS.pub -I "2196305+Ziqi@users.noreply.github.com" -n file -s SHA256SUMS.sig < SHA256SUMS
150
+ shasum -a 256 -c SHA256SUMS
151
+
152
+ # 4. Rebuild starshield.pyz & SPDX 2.3 SBOM from source and verify bit-for-bit reproducibility:
153
+ python3 scripts/build_reproducible.py --verify
154
+ python3 scripts/generate_spdx_sbom.py --verify
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Governance, Method Validation & Security Reporting
160
+
161
+ | Verification / Archival Dimension | Live Status & Permanent Identifier |
162
+ | :--- | :--- |
163
+ | **Continuous Fuzzing (`ClusterFuzzLite / Atheris`)** | [![Fuzzing: 10/10](https://img.shields.io/badge/Scorecard%20Fuzzing-10%2F10%20%28ClusterFuzzLite%29-brightgreen)](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml) [![Continuous Fuzzing](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/cflite.yml) |
164
+ | **Static Security (`CodeQL SAST`) & Deterministic CI** | [![CodeQL SAST](https://github.com/Ziqi/starshield-forensics/actions/workflows/codeql.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/codeql.yml) [![StarShield Deterministic CI](https://github.com/Ziqi/starshield-forensics/actions/workflows/ci.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/actions/workflows/ci.yml) |
165
+ | **Supply-Chain Provenance & Licensing (`REUSE 3.3`)** | [![Supply-Chain Attestations](https://github.com/Ziqi/starshield-forensics/actions/workflows/attestations.yml/badge.svg)](https://github.com/Ziqi/starshield-forensics/attestations) [![REUSE status](https://img.shields.io/badge/REUSE-3.3%20compliant-brightgreen)](./REUSE.toml) |
166
+ | **Packaging (`Homebrew Tap`) & Scholarly / UNESCO Archival** | [![Homebrew Tap](https://img.shields.io/badge/Homebrew-Ziqi%2Ftap-FBB040.svg?logo=homebrew&logoColor=white)](https://github.com/Ziqi/homebrew-tap) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24145804.svg)](https://doi.org/10.5281/zenodo.24145804) [![SWHID](https://img.shields.io/badge/SWHID-swh%3A1%3Asnp%3A4ed5efec-e20026)](https://archive.softwareheritage.org/swh:1:snp:4ed5efecab5e40975e75a5c5107b63121b1df60a;origin=https://github.com/Ziqi/starshield-forensics) |
167
+
168
+ - **Dual-Tool Forensic Method Validation (UK FSR Statutory Code `FSA – DIG 100` [superseding `FSR-C-107`] & `ISO/IEC 17025` Clause 7.2.2 Aligned):** [`VALIDATION_REPORT_FSR_ISO17025.md`](./VALIDATION_REPORT_FSR_ISO17025.md) (`482` test vectors cross-validated against Google `dfindexeddb 20260210` & `Pillow 13.0.0`; open-source validation aid for accredited laboratories, not a claim of laboratory accreditation)
169
+ - **OpenSSF Security Insights (v2.0.0), OSPS Baseline Level 3 (EU CRA Aligned) & REUSE 3.3:** [`SECURITY-INSIGHTS.yml`](./SECURITY-INSIGHTS.yml) · [`SECURITY.md §5`](./SECURITY.md#5-openssf-osps-baseline-level-3--eu-cyber-resilience-act-cra-alignment) · [`REUSE.toml`](./REUSE.toml) · **SWHID (`v0.3.7`):** [`swh:1:rel:3fa912215b0bb2510f7a2cfdfbd51293e29980c4`](https://archive.softwareheritage.org/swh:1:rel:3fa912215b0bb2510f7a2cfdfbd51293e29980c4;origin=https://github.com/Ziqi/starshield-forensics)
170
+ - **Security Assurance Case & 12-Month Roadmap:** [`SECURITY_ASSURANCE_CASE.md`](./SECURITY_ASSURANCE_CASE.md)
171
+ - **Vulnerability Response Policy (48h Ack SLA):** [`SECURITY.md`](./SECURITY.md) · [GitHub Private Vulnerability Reporting](https://github.com/Ziqi/starshield-forensics/security/advisories/new)
172
+ - **Governance, Roles & Continuity Policy:** [`GOVERNANCE.md`](./GOVERNANCE.md)
173
+ - **Contribution, DCO 1.1 & Testing Standards:** [`CONTRIBUTING.md`](./CONTRIBUTING.md) · [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md)
174
+ - **Author:** **Ziqi Xiao** (`@Ziqi`) — [Documentation & Sample Workpaper](https://ziqi.github.io/starshield/) · [GitHub Issues](https://github.com/Ziqi/starshield-forensics/issues)
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "starshield-forensics"
7
- version = "0.3.7"
8
- description = "Deterministic, offline Chromium IndexedDB/LevelDB write-ahead log (.log) multi-schema record carver, local storage precheck gate, PNG/JPEG ICC container provenance inspector, and multi-jurisdiction financial checksum validator."
7
+ version = "0.3.8"
8
+ description = "Deterministic, offline Chromium & Electron LevelDB (.log) carver, PNG/JPEG screenshot & ICC provenance inspector, ISO-13616/Luhn financial checksum validator, and zero-dependency Model Context Protocol (MCP) server."
9
9
  readme = "README.md"
10
10
  license = "MIT"
11
11
  license-files = ["LICENSE"]
@@ -18,8 +18,12 @@ keywords = [
18
18
  "dfir",
19
19
  "leveldb",
20
20
  "indexeddb",
21
+ "electron",
21
22
  "png-metadata",
23
+ "image-forensics",
22
24
  "iban-validator",
25
+ "mcp",
26
+ "model-context-protocol",
23
27
  "evidence-triage"
24
28
  ]
25
29
  classifiers = [
@@ -1,3 +1,3 @@
1
1
  """StarShield Forensics — Deterministic Chromium Cache & Container Provenance Toolkit."""
2
2
 
3
- __version__ = "0.3.7"
3
+ __version__ = "0.3.8"
@@ -509,8 +509,8 @@ def build_synthetic_leveldb_wal_bytes() -> bytes:
509
509
  return part1 + part2
510
510
 
511
511
 
512
- def run_demo(redact: bool = True) -> int:
513
- run_salt = secrets.token_bytes(32)
512
+ def build_demo_report(redact: bool = True, salt: bytes | None = None) -> Dict[str, Any]:
513
+ run_salt = salt if salt is not None else secrets.token_bytes(32)
514
514
  try:
515
515
  sample_json_bytes = (
516
516
  importlib.resources.files("starshield.data")
@@ -532,7 +532,7 @@ def run_demo(redact: bool = True) -> int:
532
532
  )
533
533
  valid_jpeg = build_valid_jpeg_with_icc_and_8bim("Display P3", "APPL", split_icc_chunks=2)
534
534
 
535
- report = {
535
+ return {
536
536
  "toolkit": f"starshield-forensics v{__version__} (Deterministic Chromium Cache & Container Provenance Toolkit)",
537
537
  "author": "Ziqi Xiao (@Ziqi)",
538
538
  "dataset_notice": "100% CLEAN-ROOM SPECIFICATION TEST VECTORS (2025 UK SUPPLIER INVOICE SCENARIO — TLP:CLEAR)",
@@ -556,6 +556,10 @@ def run_demo(redact: bool = True) -> int:
556
556
  ),
557
557
  "engine_5_descriptive_linguistics": summarize_corpus_linguistics(payload),
558
558
  }
559
+
560
+
561
+ def run_demo(redact: bool = True) -> int:
562
+ report = build_demo_report(redact=redact)
559
563
  print(json.dumps(report, indent=2, ensure_ascii=False))
560
564
  return 0
561
565
 
@@ -631,6 +635,11 @@ def main(argv: List[str] | None = None) -> int:
631
635
  p_dur = sub.add_parser("summarize-linguistics", help="Compute descriptive utterance length & punctuation statistics")
632
636
  p_dur.add_argument("json_file", type=Path, help="Path to chat transcript JSON")
633
637
 
638
+ sub.add_parser(
639
+ "mcp",
640
+ help="Run deterministic read-only Model Context Protocol (MCP) JSON-RPC 2.0 server over stdio",
641
+ )
642
+
634
643
  args = parser.parse_args(argv)
635
644
  redact = not args.unredacted
636
645
  set_active_hmac_digest(args.hmac_digest)
@@ -718,6 +727,15 @@ def main(argv: List[str] | None = None) -> int:
718
727
  }
719
728
  print(json.dumps(out, indent=2, ensure_ascii=False))
720
729
  return 0
730
+
731
+ if args.command == "mcp":
732
+ from starshield.mcp_server import run_mcp_stdio_server
733
+
734
+ return run_mcp_stdio_server(
735
+ redact=redact,
736
+ max_mb=args.max_mb,
737
+ salt=run_salt,
738
+ )
721
739
  except (OSError, ValueError, TypeError, KeyError, UnicodeDecodeError) as exc:
722
740
  if redact:
723
741
  if isinstance(exc, UnicodeDecodeError):