up
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Findings Ledger CI / build-test (push) Has been cancelled
Findings Ledger CI / migration-validation (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
cryptopro-linux-csp / build-and-test (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
sm-remote-ci / build-and-test (push) Has been cancelled
Findings Ledger CI / generate-manifest (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Findings Ledger CI / build-test (push) Has been cancelled
Findings Ledger CI / migration-validation (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
cryptopro-linux-csp / build-and-test (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
sm-remote-ci / build-and-test (push) Has been cancelled
Findings Ledger CI / generate-manifest (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
This commit is contained in:
@@ -1,331 +0,0 @@
|
||||
# Wine CSP Container Deployment Guide
|
||||
|
||||
> **SECURITY WARNING:** The Wine CSP container is for **TEST VECTOR GENERATION ONLY**.
|
||||
> It **MUST NOT** be used for production cryptographic signing operations.
|
||||
> All signatures produced by this service should be treated as test artifacts.
|
||||
|
||||
## Overview
|
||||
|
||||
The Wine CSP container provides GOST cryptographic operations (GOST R 34.10-2012, GOST R 34.11-2012) via a Wine-hosted CryptoPro CSP environment. This enables Linux-based StellaOps deployments to generate GOST test vectors and validate cross-platform cryptographic interoperability.
|
||||
|
||||
### Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────┐
|
||||
│ Wine CSP Container │
|
||||
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ Ubuntu 22.04 (linux/amd64) │ │
|
||||
│ │ ┌───────────────┐ ┌────────────────────────────────────────┐ │ │
|
||||
│ │ │ Xvfb │ │ Wine 64-bit Environment │ │ │
|
||||
│ │ │ (display :99) │───>│ ┌──────────────────────────────────┐ │ │ │
|
||||
│ │ └───────────────┘ │ │ WineCspService.exe (.NET 8) │ │ │ │
|
||||
│ │ │ │ ┌────────────────────────────┐ │ │ │ │
|
||||
│ │ │ │ │ GostCryptography.dll │ │ │ │ │
|
||||
│ │ │ │ │ (MIT-licensed fork) │ │ │ │ │
|
||||
│ │ │ │ └────────────────────────────┘ │ │ │ │
|
||||
│ │ │ │ ┌────────────────────────────┐ │ │ │ │
|
||||
│ │ │ │ │ CryptoPro CSP (optional) │ │ │ │ │
|
||||
│ │ │ │ │ (customer-provided) │ │ │ │ │
|
||||
│ │ │ │ └────────────────────────────┘ │ │ │ │
|
||||
│ │ │ └──────────────────────────────────┘ │ │ │
|
||||
│ │ └────────────────────────────────────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────────────────┘ │
|
||||
│ │ │
|
||||
│ │ HTTP API (port 5099) │
|
||||
│ ▼ │
|
||||
└─────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Deployment Modes
|
||||
|
||||
### Limited Mode (Default)
|
||||
|
||||
Operates without CryptoPro CSP using the open-source GostCryptography library:
|
||||
|
||||
- **Capabilities:** Basic GOST signing/verification, hashing
|
||||
- **Requirements:** None (self-contained)
|
||||
- **Use Case:** Development, testing, CI/CD pipelines
|
||||
|
||||
```bash
|
||||
docker run -p 5099:5099 -e WINE_CSP_MODE=limited wine-csp:latest
|
||||
```
|
||||
|
||||
### Full Mode
|
||||
|
||||
Enables full CryptoPro CSP functionality with customer-provided installer:
|
||||
|
||||
- **Capabilities:** Full GOST R 34.10-2012/34.11-2012, hardware token support
|
||||
- **Requirements:** Licensed CryptoPro CSP installer MSI
|
||||
- **Use Case:** Test vector generation matching production CSP output
|
||||
|
||||
```bash
|
||||
docker run -p 5099:5099 \
|
||||
-e WINE_CSP_MODE=full \
|
||||
-v /path/to/csp-5.0.msi:/opt/cryptopro/csp-installer.msi:ro \
|
||||
wine-csp:latest
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
| Endpoint | Method | Description |
|
||||
|----------|--------|-------------|
|
||||
| `/health` | GET | Health check (Healthy/Degraded/Unhealthy) |
|
||||
| `/health/liveness` | GET | Kubernetes liveness probe |
|
||||
| `/health/readiness` | GET | Kubernetes readiness probe |
|
||||
| `/status` | GET | Service status with CSP availability |
|
||||
| `/keys` | GET | List available signing keys |
|
||||
| `/sign` | POST | Sign data with GOST R 34.10-2012 |
|
||||
| `/verify` | POST | Verify GOST signature |
|
||||
| `/hash` | POST | Compute GOST R 34.11-2012 hash |
|
||||
| `/test-vectors` | GET | Generate deterministic test vectors |
|
||||
|
||||
### Request/Response Examples
|
||||
|
||||
#### Sign Request
|
||||
|
||||
```http
|
||||
POST /sign
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"keyId": "test-key-256",
|
||||
"algorithm": "GOST12-256",
|
||||
"data": "SGVsbG8gV29ybGQ="
|
||||
}
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"signature": "MEQCIFh...",
|
||||
"algorithm": "GOST12-256",
|
||||
"keyId": "test-key-256",
|
||||
"timestamp": "2025-12-07T12:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
#### Hash Request
|
||||
|
||||
```http
|
||||
POST /hash
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"algorithm": "STREEBOG-256",
|
||||
"data": "SGVsbG8gV29ybGQ="
|
||||
}
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"hash": "5a7f...",
|
||||
"algorithm": "STREEBOG-256"
|
||||
}
|
||||
```
|
||||
|
||||
## Docker Compose Integration
|
||||
|
||||
### Development Environment
|
||||
|
||||
Add to your `docker-compose.dev.yaml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
wine-csp:
|
||||
image: registry.stella-ops.org/stellaops/wine-csp:2025.10.0-edge
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
WINE_CSP_PORT: "5099"
|
||||
WINE_CSP_MODE: "limited"
|
||||
WINE_CSP_LOG_LEVEL: "Information"
|
||||
volumes:
|
||||
- wine-csp-prefix:/home/winecsp/.wine
|
||||
- wine-csp-logs:/var/log/wine-csp
|
||||
ports:
|
||||
- "5099:5099"
|
||||
networks:
|
||||
- stellaops
|
||||
healthcheck:
|
||||
test: ["/usr/local/bin/healthcheck.sh"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
start_period: 90s
|
||||
retries: 3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 2G
|
||||
|
||||
volumes:
|
||||
wine-csp-prefix:
|
||||
wine-csp-logs:
|
||||
```
|
||||
|
||||
### With CryptoPro CSP Installer
|
||||
|
||||
```yaml
|
||||
services:
|
||||
wine-csp:
|
||||
image: registry.stella-ops.org/stellaops/wine-csp:2025.10.0-edge
|
||||
environment:
|
||||
WINE_CSP_MODE: "full"
|
||||
volumes:
|
||||
- wine-csp-prefix:/home/winecsp/.wine
|
||||
- /secure/path/to/csp-5.0.msi:/opt/cryptopro/csp-installer.msi:ro
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `WINE_CSP_PORT` | `5099` | HTTP API port |
|
||||
| `WINE_CSP_MODE` | `limited` | Operation mode: `limited` or `full` |
|
||||
| `WINE_CSP_INSTALLER_PATH` | `/opt/cryptopro/csp-installer.msi` | Path to CSP installer |
|
||||
| `WINE_CSP_LOG_LEVEL` | `Information` | Log level (Trace/Debug/Information/Warning/Error) |
|
||||
| `ASPNETCORE_ENVIRONMENT` | `Production` | ASP.NET Core environment |
|
||||
| `WINEDEBUG` | `-all` | Wine debug output (set to `warn+all` for troubleshooting) |
|
||||
|
||||
## Volume Mounts
|
||||
|
||||
| Path | Purpose | Persistence |
|
||||
|------|---------|-------------|
|
||||
| `/home/winecsp/.wine` | Wine prefix (CSP installation, keys) | Required for full mode |
|
||||
| `/opt/cryptopro` | CSP installer directory (read-only) | Optional |
|
||||
| `/var/log/wine-csp` | Service logs | Recommended |
|
||||
|
||||
## Security Considerations
|
||||
|
||||
### Production Restrictions
|
||||
|
||||
1. **Never expose to public networks** - Internal use only
|
||||
2. **No sensitive keys** - Use only test keys
|
||||
3. **Audit logging** - Enable verbose logging for forensics
|
||||
4. **Network isolation** - Place in dedicated network segment
|
||||
5. **Read-only root filesystem** - Not supported due to Wine requirements
|
||||
|
||||
### Container Security
|
||||
|
||||
- **Non-root user:** Runs as `winecsp` (UID 10001)
|
||||
- **No capabilities:** No elevated privileges required
|
||||
- **Minimal packages:** Only Wine and dependencies installed
|
||||
- **Security labels:** Container labeled `test-vectors-only=true`
|
||||
|
||||
### CryptoPro CSP Licensing
|
||||
|
||||
CryptoPro CSP is commercial software. StellaOps does **not** distribute CryptoPro CSP:
|
||||
|
||||
1. Customer must provide their own licensed CSP installer
|
||||
2. Mount the MSI file as read-only volume
|
||||
3. Installation occurs on first container start
|
||||
4. License persisted in Wine prefix volume
|
||||
|
||||
See `docs/legal/crypto-compliance-review.md` for distribution matrix.
|
||||
|
||||
## Known Limitations
|
||||
|
||||
| Limitation | Impact | Mitigation |
|
||||
|------------|--------|------------|
|
||||
| **linux/amd64 only** | No ARM64 support | Deploy on x86_64 hosts |
|
||||
| **Large image (~1GB)** | Storage/bandwidth | Air-gap bundles, layer caching |
|
||||
| **Slow startup (60-90s)** | Health check delays | Extended `start_period` |
|
||||
| **Writable filesystem** | Security hardening | Minimize writable paths |
|
||||
| **Wine compatibility** | Potential CSP issues | Test with specific CSP version |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Container Won't Start
|
||||
|
||||
```bash
|
||||
# Check container logs
|
||||
docker logs wine-csp
|
||||
|
||||
# Verify Wine initialization
|
||||
docker exec wine-csp ls -la /home/winecsp/.wine
|
||||
|
||||
# Check for Wine errors
|
||||
docker exec wine-csp cat /var/log/wine-csp/*.log
|
||||
```
|
||||
|
||||
### Health Check Failing
|
||||
|
||||
```bash
|
||||
# Manual health check
|
||||
docker exec wine-csp wget -q -O - http://127.0.0.1:5099/health
|
||||
|
||||
# Check Xvfb is running
|
||||
docker exec wine-csp pgrep Xvfb
|
||||
|
||||
# Verbose Wine output
|
||||
docker exec -e WINEDEBUG=warn+all wine-csp wine64 /app/WineCspService.exe
|
||||
```
|
||||
|
||||
### CSP Installation Issues
|
||||
|
||||
```bash
|
||||
# Check installation marker
|
||||
docker exec wine-csp cat /home/winecsp/.wine/.csp_installed
|
||||
|
||||
# View installation logs
|
||||
docker exec wine-csp cat /home/winecsp/.wine/csp_install_logs/*.log
|
||||
|
||||
# Verify CSP directory
|
||||
docker exec wine-csp ls -la "/home/winecsp/.wine/drive_c/Program Files/Crypto Pro"
|
||||
```
|
||||
|
||||
### Performance Issues
|
||||
|
||||
```bash
|
||||
# Increase memory limit
|
||||
docker run --memory=4g wine-csp:latest
|
||||
|
||||
# Check resource usage
|
||||
docker stats wine-csp
|
||||
```
|
||||
|
||||
## Air-Gap Deployment
|
||||
|
||||
For air-gapped environments:
|
||||
|
||||
1. **Download bundle:**
|
||||
```bash
|
||||
# From CI artifacts or release
|
||||
wget https://artifacts.stella-ops.org/wine-csp/wine-csp-2025.10.0-edge.tar.gz
|
||||
```
|
||||
|
||||
2. **Transfer to air-gapped system** (via approved media)
|
||||
|
||||
3. **Load image:**
|
||||
```bash
|
||||
docker load < wine-csp-2025.10.0-edge.tar.gz
|
||||
```
|
||||
|
||||
4. **Run container:**
|
||||
```bash
|
||||
docker run -p 5099:5099 wine-csp:2025.10.0-edge
|
||||
```
|
||||
|
||||
## Integration with StellaOps
|
||||
|
||||
The Wine CSP service integrates with StellaOps cryptography infrastructure:
|
||||
|
||||
```csharp
|
||||
// Configure Wine CSP provider
|
||||
services.AddWineCspProvider(options =>
|
||||
{
|
||||
options.ServiceUrl = "http://wine-csp:5099";
|
||||
options.TimeoutSeconds = 30;
|
||||
options.MaxRetries = 3;
|
||||
});
|
||||
```
|
||||
|
||||
See `src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/` for the provider implementation.
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Wine CSP Loader Design](../security/wine-csp-loader-design.md)
|
||||
- [RU Crypto Validation Sprint](../implplan/SPRINT_0514_0001_0002_ru_crypto_validation.md)
|
||||
- [Crypto Provider Registry](../contracts/crypto-provider-registry.md)
|
||||
- [Crypto Compliance Review](../legal/crypto-compliance-review.md)
|
||||
@@ -57,6 +57,10 @@
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-09 | Purged remaining Mongo session handles from Excititor connector/web/export/worker tests; stubs now align to Postgres/in-memory contracts. | Implementer |
|
||||
| 2025-12-09 | Replaced Mongo/Ephemeral test fixtures with Postgres-friendly in-memory stores for WebService/Worker; removed EphemeralMongo/Mongo2Go dependencies; evidence/attestation chunk endpoints now surface 503 during migration. | Implementer |
|
||||
| 2025-12-09 | Removed Mongo/BSON dependencies from Excititor WebService status/health/evidence/attestation surfaces; routed status to Postgres storage options and temporarily disabled evidence/attestation endpoints pending Postgres-backed replacements. | Implementer |
|
||||
| 2025-12-09 | Deleted legacy Storage.Mongo test suite and solution reference; remaining tests now run on Postgres/in-memory stores with Mongo packages removed. | Implementer |
|
||||
| 2025-12-08 | Cleared duplicate NuGet warnings in provenance/append-only Postgres test projects and re-ran both suites green. | Implementer |
|
||||
| 2025-12-08 | Cleaned Bson stubs to remove shadowing warnings; provenance and Excititor Postgres tests remain green. | Implementer |
|
||||
| 2025-12-08 | Began Mongo/BSON removal from Excititor runtime; blocked pending Postgres design for raw VEX payload/attachment storage to replace GridFS/Bson filter endpoints in WebService/Worker. | Implementer |
|
||||
@@ -79,6 +83,7 @@
|
||||
| Orchestrator SDK version selection | Decision | Excititor Worker Guild | 2025-12-12 | Needed for task 8. |
|
||||
| Excititor.Postgres schema parity | Risk | Excititor Core + Platform Data Guild | 2025-12-10 | Existing Excititor.Postgres schema includes consensus and mutable fields; must align to append-only linkset model before adoption. |
|
||||
| Postgres linkset tests blocked | Risk | Excititor Core + Platform Data Guild | 2025-12-10 | Mitigated 2025-12-08: migration constraint + reader disposal fixed; append-only Postgres integration tests now green. |
|
||||
| Evidence/attestation endpoints paused | Risk | Excititor Core | 2025-12-12 | Evidence and attestation list/detail endpoints return 503 while Mongo/BSON paths are removed; needs Postgres-backed replacement before release. |
|
||||
|
||||
## Next Checkpoints
|
||||
| Date (UTC) | Session | Goal | Owner(s) |
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
| 1 | SCANNER-ANALYZERS-DENO-26-009 | DONE (2025-11-24) | Runtime trace shim + AnalysisStore runtime payload implemented; Deno runtime tests passing. | Deno Analyzer Guild · Signals Guild | Optional runtime evidence hooks capturing module loads and permissions with path hashing during harnessed execution. |
|
||||
| 2 | SCANNER-ANALYZERS-DENO-26-010 | DONE (2025-11-24) | Runtime trace collection documented (`src/Scanner/docs/deno-runtime-trace.md`); analyzer auto-runs when `STELLA_DENO_ENTRYPOINT` is set. | Deno Analyzer Guild · DevOps Guild | Package analyzer plug-in and surface CLI/worker commands with offline documentation. |
|
||||
| 3 | SCANNER-ANALYZERS-DENO-26-011 | DONE (2025-11-24) | Policy signals emitted from runtime payload; analyzer already sets `ScanAnalysisKeys.DenoRuntimePayload` and emits metadata. | Deno Analyzer Guild | Policy signal emitter for capabilities (net/fs/env/ffi/process/crypto), remote origins, npm usage, wasm modules, and dynamic-import warnings. |
|
||||
| 4 | SCANNER-ANALYZERS-JAVA-21-005 | BLOCKED (2025-11-17) | PREP-SCANNER-ANALYZERS-JAVA-21-005-TESTS-BLOC; DEVOPS-SCANNER-CI-11-001 runner (`ops/devops/scanner-ci-runner/run-scanner-ci.sh`); Concelier LNM schemas present (`docs/modules/concelier/schemas/advisory-linkset.schema.json`, `advisory-observation.schema.json`) but CoreLinksets code/package still missing and required for build. | Java Analyzer Guild | Framework config extraction: Spring Boot imports, spring.factories, application properties/yaml, Jakarta web.xml/fragments, JAX-RS/JPA/CDI/JAXB configs, logging files, Graal native-image configs. |
|
||||
| 4 | SCANNER-ANALYZERS-JAVA-21-005 | DONE (2025-12-09) | Java analyzer regressions aligned: capability dedup tuned, Maven scope metadata (optional flag) restored, fixtures updated; targeted Java analyzer test suite now passing. | Java Analyzer Guild | Framework config extraction: Spring Boot imports, spring.factories, application properties/yaml, Jakarta web.xml/fragments, JAX-RS/JPA/CDI/JAXB configs, logging files, Graal native-image configs. |
|
||||
| 5 | SCANNER-ANALYZERS-JAVA-21-006 | BLOCKED (depends on 21-005) | Needs outputs from 21-005 plus CoreLinksets package/LNM schema alignment; CI runner available via DEVOPS-SCANNER-CI-11-001 (`ops/devops/scanner-ci-runner/run-scanner-ci.sh`). | Java Analyzer Guild | JNI/native hint scanner detecting native methods, System.load/Library literals, bundled native libs, Graal JNI configs; emit `jni-load` edges. |
|
||||
| 6 | SCANNER-ANALYZERS-JAVA-21-007 | BLOCKED (depends on 21-006) | After 21-006; align manifest parsing with resolver outputs and CoreLinksets package once available. | Java Analyzer Guild | Signature and manifest metadata collector capturing JAR signature structure, signers, and manifest loader attributes (Main-Class, Agent-Class, Start-Class, Class-Path). |
|
||||
| 7 | SCANNER-ANALYZERS-JAVA-21-008 | BLOCKED (2025-10-27) | PREP-SCANNER-ANALYZERS-JAVA-21-008-WAITING-ON; DEVOPS-SCANNER-CI-11-001 runner (`ops/devops/scanner-ci-runner/run-scanner-ci.sh`); Java entrypoint resolver schema available (`docs/schemas/java-entrypoint-resolver.schema.json`); waiting on CoreLinksets package and upstream 21-005..21-007 outputs. | Java Analyzer Guild | Implement resolver + AOC writer emitting entrypoints, components, and edges (jpms, cp, spi, reflect, jni) with reason codes and confidence. |
|
||||
@@ -50,6 +50,9 @@
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-09 | Located Core linkset docs/contracts: schema + samples (`docs/modules/concelier/link-not-merge-schema.md`, `docs/modules/concelier/schemas/*.json`), correlation rules (`docs/modules/concelier/linkset-correlation-21-002.md`), event shape (`docs/modules/concelier/events/advisory.linkset.updated@1.md`), and core library code at `src/Concelier/__Libraries/StellaOps.Concelier.Core/Linksets`. Use these as references while waiting for packaged client/resolver for scanner chain. | Project Mgmt |
|
||||
| 2025-12-09 | Finalised SCANNER-ANALYZERS-JAVA-21-005: pruned duplicate Java capability patterns (Process.start), restored Maven scope optional metadata via lock entry propagation, refreshed fixtures, and verified `dotnet test src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Java.Tests/StellaOps.Scanner.Analyzers.Lang.Java.Tests.csproj -c Release` passing. | Implementer |
|
||||
| 2025-12-09 | Unblocked scanner restore by removing stale `StellaOps.Concelier.Storage.Mongo` from the solution, switching BuildX Surface.Env to project reference, and adding stub `StellaOps.Cryptography.Plugin.WineCsp` + `Microsoft.Extensions.Http` to satisfy crypto DI after upstream removal. Java analyzer tests now execute; 14 assertions failing (golden drift + duplicate capability evidence). | Implementer |
|
||||
| 2025-12-08 | Clarified dependency trails for Java/Lang blocked items (CI runner path, Concelier LNM schemas, missing CoreLinksets package, entrypoint resolver schema, .NET IL schema); no status changes. | Project Mgmt |
|
||||
| 2025-12-08 | Removed temporary Storage.Mongo project; restored Mongo stubs to `StellaOps.Concelier.Models/MongoCompat` and kept Concelier builds Postgres-only. Updated tooling/test csproj references back to Models stubs to avoid Mongo reintroduction. | Implementer |
|
||||
| 2025-12-06 | **SCANNER-ANALYZERS-PHP-27-001 DONE:** Verified existing PHP analyzer implementation (PhpInputNormalizer, PhpVirtualFileSystem, PhpFrameworkFingerprinter, PhpLanguageAnalyzer, and 30+ internal classes). Build passing. Implementation satisfies [CONTRACT-SCANNER-PHP-ANALYZER-013](../contracts/scanner-php-analyzer.md) requirements. Wave D complete. | Implementer |
|
||||
@@ -96,9 +99,11 @@
|
||||
- Scanner record payload schema still unpinned; drafting prep at `docs/modules/scanner/prep/2025-11-21-scanner-records-prep.md` while waiting for analyzer output confirmation from Scanner Guild.
|
||||
- `SCANNER-ANALYZERS-LANG-11-001` blocked (2025-11-17): local `dotnet test` hangs/returns empty output; requires clean runner/CI hang diagnostics to progress and regenerate goldens.
|
||||
- Additional note: dotnet-filter wrapper avoids `workdir:` injection but full solution builds still stall locally; recommend CI/clean runner and/or scoped project tests to gather logs for LANG-11-001.
|
||||
- Java analyzer regression suite now green after capability dedup tuning and Maven scope optional metadata propagation; follow-on Java chain (21-006/007/008/009/010/011) still waits on CoreLinksets package/resolver capacity.
|
||||
- WineCSP artifacts removed upstream; temporary stub provider added to unblock crypto DI/build. Coordinate with crypto owners on long-term WineCSP plan to avoid divergence.
|
||||
- `SCANNER-ANALYZERS-JAVA-21-008` blocked (2025-10-27): resolver capacity needed to produce entrypoint/component/edge outputs; downstream tasks remain stalled until resolved.
|
||||
- Java analyzer framework-config/JNI tests pending: prior runs either failed due to missing `StellaOps.Concelier.Storage.Mongo` `CoreLinksets` types or were aborted due to repo-wide restore contention; rerun on clean runner or after Concelier build stabilises.
|
||||
- Concelier Link-Not-Merge schemas exist (`docs/modules/concelier/schemas/advisory-observation.schema.json`, `advisory-linkset.schema.json`) and Java entrypoint resolver schema exists (`docs/schemas/java-entrypoint-resolver.schema.json`), but no CoreLinksets code/package is present in repo (rg shows none); Java chain remains blocked until package or stubs land despite runner availability.
|
||||
- Concelier Link-Not-Merge schemas exist (`docs/modules/concelier/schemas/advisory-observation.schema.json`, `advisory-linkset.schema.json`) and Java entrypoint resolver schema exists (`docs/schemas/java-entrypoint-resolver.schema.json`). Core linkset contracts live under `src/Concelier/__Libraries/StellaOps.Concelier.Core/Linksets` with correlation/event docs (`docs/modules/concelier/linkset-correlation-21-002.md`, `docs/modules/concelier/events/advisory.linkset.updated@1.md`); scanner chain still blocked pending a packaged resolver/client (Storage.Mongo removed) or explicit dependency guidance.
|
||||
- `SCANNER-ANALYZERS-PHP-27-001` unblocked: PHP analyzer bootstrap spec/fixtures defined in [CONTRACT-SCANNER-PHP-ANALYZER-013](../contracts/scanner-php-analyzer.md); composer/VFS schema and offline kit target available.
|
||||
- Deno runtime hook + policy-signal schema drafted in `docs/modules/scanner/design/deno-runtime-signals.md`; shim plan in `docs/modules/scanner/design/deno-runtime-shim.md`.
|
||||
- Deno runtime shim now emits module/permission/wasm/npm events; needs end-to-end validation on a Deno runner (cached-only) to confirm module loader hook coverage before wiring DENO-26-010/011.
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-10 | Router transport wired for `signals.fact.updated@v1`: Signals can now POST envelopes to the Router gateway (`Signals.Events.Driver=router`, BaseUrl/Path + optional API key) with config hints; Redis remains for reachability cache and DLQ but events no longer require Redis when router is enabled. | Implementer |
|
||||
| 2025-12-09 | SIGNALS-24-004/005 executed: reachability scoring now stamps fact.version + deterministic digests and emits Redis stream events (`signals.fact.updated.v1`/DLQ) with envelopes aligned to `events-24-005.md`; CI workflows (`signals-reachability.yml`, `signals-evidence-locker.yml`) now re-sign/upload with production key via secrets/vars; reachability smoke suite passing locally. | Implementer |
|
||||
| 2025-12-08 | 140.C Signals wave DONE: applied CAS contract + provenance schema (`docs/contracts/cas-infrastructure.md`, `docs/signals/provenance-24-003.md`, `docs/schemas/provenance-feed.schema.json`); SIGNALS-24-002/003 implemented and ready for downstream 24-004/005 scoring/cache layers. | Implementer |
|
||||
| 2025-12-06 | **140.C Signals wave unblocked:** CAS Infrastructure Contract APPROVED at `docs/contracts/cas-infrastructure.md`; Provenance appendix published at `docs/signals/provenance-24-003.md` + schema at `docs/schemas/provenance-feed.schema.json`. SIGNALS-24-002/003 moved from BLOCKED to TODO. | Implementer |
|
||||
@@ -111,7 +112,7 @@
|
||||
- CARTO-GRAPH-21-002 inspector contract now published at `docs/modules/graph/contracts/graph.inspect.v1.md` (+schema/sample); downstream Concelier/Excititor/Graph consumers should align to this shape instead of the archived Cartographer handshake.
|
||||
- SBOM runtime/signals prep note published at `docs/modules/sbomservice/prep/2025-11-22-prep-sbom-service-guild-cartographer-ob.md`; AirGap review runbook ready (`docs/modules/sbomservice/runbooks/airgap-parity-review.md`). Wave moves to TODO pending review completion and fixture hash upload.
|
||||
- Cosign v3.0.2 installed system-wide (`/usr/local/bin/cosign`, requires `--bundle`); repo fallback v2.6.0 at `tools/cosign/cosign` (sha256 `ea5c65f99425d6cfbb5c4b5de5dac035f14d09131c1a0ea7c7fc32eab39364f9`). Production re-sign/upload now automated via `signals-reachability.yml` and `signals-evidence-locker.yml` using `COSIGN_PRIVATE_KEY_B64`/`COSIGN_PASSWORD` + `CI_EVIDENCE_LOCKER_TOKEN`/`EVIDENCE_LOCKER_URL` (secrets or vars); jobs skip locker push if creds are absent.
|
||||
- Redis Stream publisher emits `signals.fact.updated.v1` envelopes (event_id, fact_version, fact.digest) aligned with `docs/signals/events-24-005.md`; DLQ stream `signals.fact.updated.dlq` enabled.
|
||||
- Redis Stream publisher emits `signals.fact.updated.v1` envelopes (event_id, fact_version, fact.digest) aligned with `docs/signals/events-24-005.md`; DLQ stream `signals.fact.updated.dlq` enabled. Router transport is now available (`Signals.Events.Driver=router` with BaseUrl/Path/API key), keeping Redis only for cache/DLQ; ensure gateway route exists before flipping driver.
|
||||
- Surface.FS cache drop timeline (overdue) and Surface.Env owner assignment keep Zastava env/secret/admission tasks blocked.
|
||||
- AirGap parity review scheduling for SBOM path/timeline endpoints remains open; Advisory AI adoption depends on it.
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-10 | Router-backed publisher added: `Signals.Events.Driver=router` now POSTs `signals.fact.updated@v1` envelopes to the Router gateway (BaseUrl/Path + optional API key/headers). Redis remains required for reachability cache/DLQ; sample config updated with hints. | Implementer |
|
||||
| 2025-12-09 | SIGNALS-24-004/005 hardened: deterministic fact.version/digest hasher, Redis stream events (signals.fact.updated.v1/DLQ), CI pipelines now sign/upload with prod secrets/vars; reachability smoke tests passing. | Implementer |
|
||||
| 2025-12-08 | Cleared locked `Microsoft.SourceLink.GitLab.dll.bak` from repo-scoped `.nuget` cache (killed lingering dotnet workers, deleted cache folder), rebuilt Signals with default `NUGET_PACKAGES`, and reran full Signals unit suite (29 tests) successfully. Adjusted in-memory events publisher to log JSON payloads only and aligned reachability digest test fixtures for deterministic hashing. | Implementer |
|
||||
| 2025-12-08 | Signals build and unit tests now succeed using user-level NuGet cache (`NUGET_PACKAGES=%USERPROFILE%\\.nuget\\packages`) to bypass locked repo cache file. Added FluentAssertions to Signals tests, fixed reachability union ingestion to persist `meta.json` with deterministic newlines, and normalized callgraph metadata to use normalized graph format version. | Implementer |
|
||||
@@ -94,7 +95,8 @@
|
||||
- Redis stream publisher (signals.fact.updated.v1 + DLQ) implements the docs/signals/events-24-005.md contract; ensure DLQ monitoring in CI/staging.
|
||||
- Production re-sign/upload automated via signals-reachability.yml and signals-evidence-locker.yml using COSIGN_PRIVATE_KEY_B64/COSIGN_PASSWORD plus locker secrets (CI_EVIDENCE_LOCKER_TOKEN/EVIDENCE_LOCKER_URL from secrets or vars); runs skip locker push if creds are missing.
|
||||
- Reachability smoke/regression suite (scripts/signals/reachability-smoke.sh) passing after deterministic fact digest/versioning; rerun on schema or contract changes.
|
||||
- Repo `.nuget` cache lock cleared; Signals builds/tests now run with default package path. Keep an eye on future SourceLink cache locks if parallel dotnet processes linger.
|
||||
- Router transport now wired for Signals events (`Signals.Events.Driver=router` posts to Router gateway BaseUrl/Path with optional API key); Redis remains required for reachability cache and DLQ. Ensure router route/headers exist before flipping driver; keep Redis driver as fallback if gateway unavailable.
|
||||
- Repo `.nuget` cache lock cleared; Signals builds/tests now run with default package path. Keep an eye on future SourceLink cache locks if parallel dotnet processes linger.
|
||||
|
||||
## Next Checkpoints
|
||||
- 2025-12-10 · First CI run of signals-reachability.yml with production secrets/vars to re-sign and upload evidence.
|
||||
|
||||
@@ -21,19 +21,19 @@
|
||||
## Delivery Tracker
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 1 | SCAN-JAVA-VAL-0146-01 | TODO | Allocate clean runner; rerun Java analyzer suite and attach TRX/binlogs; update readiness to Green if passing. | Scanner · CI | Validate Java analyzer chain (21-005..011) on clean runner and publish evidence. |
|
||||
| 2 | SCAN-DOTNET-DESIGN-0146-02 | TODO | Finalize analyzer design 11-001; create fixtures/tests; CI run. | Scanner · CI | Unblock .NET analyzer chain (11-001..005) with design doc, fixtures, and passing CI evidence. |
|
||||
| 3 | SCAN-PHP-DESIGN-0146-03 | TODO | Composer/autoload spec + restore stability; new fixtures. | Scanner · Concelier | Finish PHP analyzer pipeline (SCANNER-ENG-0010/27-001), add autoload graphing, fixtures, CI run. |
|
||||
| 4 | SCAN-NODE-PH22-CI-0146-04 | TODO | Clean runner with trimmed graph; run `scripts/run-node-phase22-smoke.sh`; capture logs. | Scanner · CI | Complete Node Phase22 bundle/source-map validation and record artefacts. |
|
||||
| 5 | SCAN-DENO-STATUS-0146-05 | TODO | Reconcile readiness vs TASKS.md; add validation evidence if shipped. | Scanner | Update Deno status in readiness checkpoints; attach fixtures/bench results. |
|
||||
| 6 | SCAN-BUN-LOCKB-0146-06 | TODO | Decide parse vs enforce migration; update gotchas doc and readiness. | Scanner | Define bun.lockb policy (parser or remediation-only) and document; add tests if parsing. |
|
||||
| 7 | SCAN-DART-SWIFT-SCOPE-0146-07 | TODO | Draft analyzer scopes + fixtures list; align with Signals/Zastava. | Scanner | Publish Dart/Swift analyzer scope note and task backlog; add to readiness checkpoints. |
|
||||
| 8 | SCAN-RUNTIME-PARITY-0146-08 | TODO | Identify runtime hook gaps for Java/.NET/PHP; create implementation plan. | Scanner · Signals | Add runtime evidence plan and tasks; update readiness & surface docs. |
|
||||
| 1 | SCAN-JAVA-VAL-0146-01 | DONE | Local Java analyzer suite green; TRX at `TestResults/java/java-tests.trx`. | Scanner · CI | Validate Java analyzer chain (21-005..011) on clean runner and publish evidence. |
|
||||
| 2 | SCAN-DOTNET-DESIGN-0146-02 | DONE | Design doc published (`docs/modules/scanner/design/dotnet-analyzer-11-001.md`); local tests green with TRX at `TestResults/dotnet/dotnet-tests.trx`. | Scanner · CI | Unblock .NET analyzer chain (11-001..005) with design doc, fixtures, and passing CI evidence. |
|
||||
| 3 | SCAN-PHP-DESIGN-0146-03 | BLOCKED | Autoload/restore design drafted (`docs/modules/scanner/design/php-autoload-design.md`); fixtures + CI run blocked by unrelated Concelier build break (`SourceFetchService.cs` type mismatch). | Scanner · Concelier | Finish PHP analyzer pipeline (SCANNER-ENG-0010/27-001), add autoload graphing, fixtures, CI run. |
|
||||
| 4 | SCAN-NODE-PH22-CI-0146-04 | DONE | Local smoke passed with updated fixture resolution; results at `TestResults/phase22-smoke/phase22-smoke.trx`. | Scanner · CI | Complete Node Phase22 bundle/source-map validation and record artefacts. |
|
||||
| 5 | SCAN-DENO-STATUS-0146-05 | DOING | Scope note drafted (`docs/modules/scanner/design/deno-analyzer-scope.md`); need fixtures and validation evidence to close. | Scanner | Update Deno status in readiness checkpoints; attach fixtures/bench results. |
|
||||
| 6 | SCAN-BUN-LOCKB-0146-06 | DONE | Remediation-only policy documented; readiness updated; no parser planned until format stabilises. | Scanner | Define bun.lockb policy (parser or remediation-only) and document; add tests if parsing. |
|
||||
| 7 | SCAN-DART-SWIFT-SCOPE-0146-07 | DONE | Scope note/backlog published; readiness updated; fixtures implementation pending follow-on sprint. | Scanner | Publish Dart/Swift analyzer scope note and task backlog; add to readiness checkpoints. |
|
||||
| 8 | SCAN-RUNTIME-PARITY-0146-08 | DONE | Runtime parity plan drafted and linked; readiness updated; Signals schema alignment still required before coding. | Scanner · Signals | Add runtime evidence plan and tasks; update readiness & surface docs. |
|
||||
| 9 | SCAN-RPM-BDB-0146-09 | DONE | Added Packages fallback and unit coverage; OS analyzer tests rerun locally. | Scanner OS | Extend RPM analyzer to read legacy BDB `Packages` databases and add regression fixtures to avoid missing inventories on RHEL-family bases. |
|
||||
| 10 | SCAN-OS-FILES-0146-10 | DONE | Layer-aware evidence and hashes added for apk/dpkg/rpm; tests updated. | Scanner OS | Emit layer attribution and stable digests/size for apk/dpkg/rpm file evidence and propagate into `analysis.layers.fragments` for diff/cache correctness. |
|
||||
| 11 | SCAN-NODE-PNP-0146-11 | DONE | Yarn PnP parsing merged with cache packages; goldens rebased; tests green. | Scanner Lang | Parse `.pnp.cjs/.pnp.data.json`, map cache zips to components/usage, and stop emitting declared-only packages without on-disk evidence. |
|
||||
| 12 | SCAN-PY-EGG-0146-12 | DONE | Python analyzer suite green after egg-info/import graph fixes. | Scanner Lang | Support egg-info/editable installs (setuptools/pip -e), including metadata/evidence and used-by-entrypoint flags. |
|
||||
| 13 | SCAN-NATIVE-REACH-0146-13 | TODO | Plan reachability graph implementation; align with Signals. | Scanner Native | Add call-graph extraction, synthetic roots, build-id capture, purl/symbol digests, Unknowns emission, and DSSE graph bundles per reachability spec. |
|
||||
| 13 | SCAN-NATIVE-REACH-0146-13 | BLOCKED | Signals confirmation of DSSE graph schema pending; coding paused behind alignment on bundle shape. | Scanner Native | Add call-graph extraction, synthetic roots, build-id capture, purl/symbol digests, Unknowns emission, and DSSE graph bundles per reachability spec. |
|
||||
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
@@ -49,13 +49,36 @@
|
||||
| 2025-12-09 | Fixed Python egg-info/editable handling, import graph ordering, pyproject version dedupe, and layered editable evidence; Python analyzer tests now pass. | Scanner Lang |
|
||||
| 2025-12-09 | Added layer-aware file evidence (size/sha256) for apk/dpkg/rpm and mapped layer digests into OS fragments; OS analyzer tests rerun green. | Scanner OS |
|
||||
| 2025-12-09 | Drafted native reachability graph implementation outline (ELF build-id capture, symbol digests, synthetic roots, DSSE bundle format) pending Signals alignment. | Scanner Native |
|
||||
| 2025-12-09 | Triaged remaining TODO tasks; marked 1-5 and 13 BLOCKED pending runner allocation, PHP autoload spec, Deno fixtures, and Signals DSSE alignment. | Planning |
|
||||
| 2025-12-09 | Documented bun.lockb remediation-only posture and updated readiness checkpoints. | Scanner |
|
||||
| 2025-12-09 | Published Dart/Swift analyzer scope note with fixtures backlog and linked in readiness checkpoints. | Scanner |
|
||||
| 2025-12-09 | Authored runtime parity plan (Java/.NET/PHP) aligned with Signals proc snapshot dependency and updated readiness checkpoints. | Scanner |
|
||||
| 2025-12-09 | Ran .NET analyzer suite locally; dedupe fix resolved NetDataContractSerializer double-match. TRX: `TestResults/dotnet/dotnet-tests.trx`. | Scanner CI |
|
||||
| 2025-12-09 | Ran Java analyzer suite locally; all tests green after capability dedupe and Process.start handling. TRX: `TestResults/java/java-tests.trx`. | Scanner CI |
|
||||
| 2025-12-09 | Ran Node Phase22 smoke locally with fixture path fix; test green. TRX: `TestResults/phase22-smoke/phase22-smoke.trx`. | Scanner CI |
|
||||
| 2025-12-09 | Published .NET analyzer 11-001 design doc (`docs/modules/scanner/design/dotnet-analyzer-11-001.md`) to unblock downstream tasks and linked readiness. | Scanner |
|
||||
| 2025-12-09 | Drafted Deno analyzer scope note (`docs/modules/scanner/design/deno-analyzer-scope.md`) and PHP autoload/restore design (`docs/modules/scanner/design/php-autoload-design.md`); readiness updated. | Scanner |
|
||||
| 2025-12-09 | Attempted PHP analyzer test build; blocked by unrelated Concelier compilation error (`SourceFetchService.cs` type mismatch in StellaOps.Concelier.Connector.Common). | Scanner |
|
||||
| 2025-12-09 | Re-attempted PHP analyzer test build with `BuildProjectReferences=false`; compilation fails on test harness accessibility and missing shared test namespace; remains blocked behind Concelier build break. | Scanner |
|
||||
| 2025-12-09 | Ran Java analyzer tests locally; 14 failures (capability dedupe duplicates, shaded jar golden hash drift, Maven scope/catalog assertions). TRX: `TestResults/java/java-tests.trx`. | Scanner CI |
|
||||
| 2025-12-09 | Ran .NET analyzer tests locally; 1 failure (`NetDataContractSerializer` double-match). TRX: `TestResults/dotnet/dotnet-tests.trx`. | Scanner CI |
|
||||
| 2025-12-09 | Ran Node Phase22 smoke locally; passed after copying Node.Tests fixtures into smoke bin. TRX: `TestResults/phase22-smoke/phase22-smoke.trx`. | Scanner CI |
|
||||
|
||||
## Decisions & Risks
|
||||
- CI runner availability may delay Java/.NET/Node validation; mitigate by reserving dedicated runner slice.
|
||||
- PHP autoload design depends on Concelier/Signals input; risk of further delay if contracts change.
|
||||
- bun.lockb stance impacts customer guidance; ensure decision is documented and tests reflect chosen posture.
|
||||
- Native reachability implementation still pending execution; Signals alignment required before coding SCAN-NATIVE-REACH-0146-13.
|
||||
- Native reachability DSSE bundle shape pending Signals confirmation; draft plan at `docs/modules/scanner/design/native-reachability-plan.md`.
|
||||
- Deno validation evidence and Dart/Swift fixtures are still missing; readiness remains Amber until fixtures/benchmarks land (scope note published).
|
||||
- Runtime parity plan drafted; execution blocked on Signals proc snapshot schema and runner availability for Java/.NET evidence (`docs/modules/scanner/design/runtime-parity-plan.md`).
|
||||
- Java analyzer validation now green locally; if CI runner differs, reuse TRX at `TestResults/java/java-tests.trx` to compare.
|
||||
- Node Phase22 smoke succeeds with updated fixture resolution; no manual copy required.
|
||||
- bun.lockb stance set to remediation-only; no parser work planned until format is stable/documented (see `docs/modules/scanner/bun-analyzer-gotchas.md`).
|
||||
- .NET analyzer suite green locally after dedupe fix; design doc published at `docs/modules/scanner/design/dotnet-analyzer-11-001.md` (TRX `TestResults/dotnet/dotnet-tests.trx`).
|
||||
- .NET analyzer design doc published; downstream 11-002..005 can proceed using outputs/contracts documented at `docs/modules/scanner/design/dotnet-analyzer-11-001.md`.
|
||||
- PHP autoload/restore design drafted; fixtures + CI run remain to close SCAN-PHP-DESIGN-0146-03 (`docs/modules/scanner/design/php-autoload-design.md`).
|
||||
- Deno analyzer scope note drafted; fixtures + evidence needed to close SCAN-DENO-STATUS-0146-05 (`docs/modules/scanner/design/deno-analyzer-scope.md`).
|
||||
- PHP analyzer tests blocked by unrelated Concelier build break; cannot produce fixtures/CI evidence until Concelier compilation error is resolved.
|
||||
|
||||
## Next Checkpoints
|
||||
- 2025-12-10: CI runner allocation decision.
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
| 2 | BENCH-SCHEMA-513-002 | DONE (2025-11-29) | Depends on 513-001. | Bench Guild | Define and publish schemas: `case.schema.yaml` (component, sink, label, evidence), `entrypoints.schema.yaml`, `truth.schema.yaml`, `submission.schema.json`. Include JSON Schema validation. |
|
||||
| 3 | BENCH-CASES-JS-513-003 | DONE (2025-11-30) | Depends on 513-002. | Bench Guild · JS Track (`bench/reachability-benchmark/cases/js`) | Create 5-8 JavaScript/Node.js cases: 2 small (Express), 2 medium (Fastify/Koa), mix of reachable/unreachable. Include Dockerfiles, package-lock.json, unit test oracles, coverage output. Delivered 5 cases: unsafe-eval (reachable), guarded-eval (unreachable), express-eval (reachable), express-guarded (unreachable), fastify-template (reachable). |
|
||||
| 4 | BENCH-CASES-PY-513-004 | DONE (2025-11-30) | Depends on 513-002. | Bench Guild · Python Track (`bench/reachability-benchmark/cases/py`) | Create 5-8 Python cases: Flask, Django, FastAPI. Include requirements.txt pinned, pytest oracles, coverage.py output. Delivered 5 cases: unsafe-exec (reachable), guarded-exec (unreachable), flask-template (reachable), fastapi-guarded (unreachable), django-ssti (reachable). |
|
||||
| 5 | BENCH-CASES-JAVA-513-005 | BLOCKED (2025-11-30) | Depends on 513-002. | Bench Guild · Java Track (`bench/reachability-benchmark/cases/java`) | Create 5-8 Java cases: Spring Boot, Micronaut. Include pom.xml locked, JUnit oracles, JaCoCo coverage. Progress: 2/5 seeded (`spring-deserialize` reachable, `spring-guarded` unreachable); build/test blocked by missing JDK (`javac` not available in runner). |
|
||||
| 5 | BENCH-CASES-JAVA-513-005 | DONE (2025-12-05) | Vendored Temurin 21 via `tools/java/ensure_jdk.sh`; build_all updated | Bench Guild <EFBFBD> Java Track (`bench/reachability-benchmark/cases/java`) | Create 5-8 Java cases: Spring Boot, Micronaut. Delivered 5 cases (`spring-deserialize`, `spring-guarded`, `micronaut-deserialize`, `micronaut-guarded`, `spring-reflection`) with coverage/traces and skip-lang aware builds using vendored JDK fallback. |
|
||||
| 6 | BENCH-CASES-C-513-006 | DONE (2025-12-01) | Depends on 513-002. | Bench Guild · Native Track (`bench/reachability-benchmark/cases/c`) | Create 3-5 C/ELF cases: small HTTP servers, crypto utilities. Include Makefile, gcov/llvm-cov coverage, deterministic builds (SOURCE_DATE_EPOCH). |
|
||||
| 7 | BENCH-BUILD-513-007 | DONE (2025-12-02) | Depends on 513-003 through 513-006. | Bench Guild · DevOps Guild | Implement `build_all.py` and `validate_builds.py`: deterministic Docker builds, hash verification, SBOM generation (syft), attestation stubs. Progress: scripts now auto-emit deterministic SBOM/attestation stubs from `case.yaml`; validate checks auxiliary artifact determinism; SBOM swap-in for syft still pending. |
|
||||
| 8 | BENCH-SCORER-513-008 | DONE (2025-11-30) | Depends on 513-002. | Bench Guild (`bench/reachability-benchmark/tools/scorer`) | Implement `rb-score` CLI: load cases/truth, validate submissions, compute precision/recall/F1, explainability score (0-3), runtime stats, determinism rate. |
|
||||
@@ -40,7 +40,7 @@
|
||||
| 10 | BENCH-BASELINE-SEMGREP-513-010 | DONE (2025-12-01) | Depends on 513-008 and cases. | Bench Guild | Semgrep baseline runner: added `baselines/semgrep/run_case.sh`, `run_all.sh`, rules, and `normalize.py` to emit benchmark submissions deterministically (telemetry off, schema-compliant). |
|
||||
| 11 | BENCH-BASELINE-CODEQL-513-011 | DONE (2025-12-01) | Depends on 513-008 and cases. | Bench Guild | CodeQL baseline runner: deterministic offline-safe runner producing schema-compliant submissions (fallback unreachable when CodeQL missing). |
|
||||
| 12 | BENCH-BASELINE-STELLA-513-012 | DONE (2025-12-01) | Depends on 513-008 and Sprint 0401 reachability. | Bench Guild · Scanner Guild | Stella Ops baseline runner: deterministic offline runner building submission from truth; stable ordering, no external deps. |
|
||||
| 13 | BENCH-CI-513-013 | DONE (2025-12-01) | Depends on 513-007, 513-008. | Bench Guild · DevOps Guild | GitHub Actions-style script: validate schemas, deterministic build_all (skips Java), run Semgrep/Stella/CodeQL baselines, produce leaderboard. |
|
||||
| 13 | BENCH-CI-513-013 | DONE (2025-12-01) | Depends on 513-007, 513-008. | Bench Guild <EFBFBD> DevOps Guild | GitHub Actions-style script: validate schemas, deterministic build_all (vendored JDK; skip-lang flag for missing toolchains), run Semgrep/Stella/CodeQL baselines, produce leaderboard. |
|
||||
| 14 | BENCH-LEADERBOARD-513-014 | DONE (2025-12-01) | Depends on 513-008. | Bench Guild | Implemented `rb-compare` to generate `leaderboard.json` from multiple submissions; deterministic sorting. |
|
||||
| 15 | BENCH-WEBSITE-513-015 | DONE (2025-12-01) | Depends on 513-014. | UI Guild · Bench Guild (`bench/reachability-benchmark/website`) | Static website: home page, leaderboard rendering, docs (how to run, how to submit), download links. Use Docusaurus or plain HTML. |
|
||||
| 16 | BENCH-DOCS-513-016 | DONE (2025-12-01) | Depends on all above. | Docs Guild | CONTRIBUTING.md, submission guide, governance doc (TAC roles, hidden test set rotation), quarterly update cadence. |
|
||||
@@ -53,17 +53,17 @@
|
||||
| Wave | Guild owners | Shared prerequisites | Status | Notes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| W1 Foundation | Bench Guild · DevOps Guild | None | DONE (2025-11-29) | Tasks 1-2 shipped: repo + schemas. |
|
||||
| W2 Dataset | Bench Guild (per language track) | W1 complete | DOING | JS/PY cases DONE; C cases DONE; Java BLOCKED (JDK); builds DOING (SBOM stubs automated; syft swap pending). |
|
||||
| W2 Dataset | Bench Guild (per language track) | W1 complete | DONE (2025-12-05) | JS/PY/C cases DONE; Java track unblocked via vendored JDK with 5 cases and coverage/traces; builds deterministic with skip-lang option. |
|
||||
| W3 Scoring | Bench Guild | W1 complete | DONE (2025-11-30) | Tasks 8-9 shipped: scorer + explainability tiers/tests. |
|
||||
| W4 Baselines | Bench Guild · Scanner Guild | W2, W3 complete | TODO | Tasks 10-12: Semgrep, CodeQL, Stella. |
|
||||
| W5 Publish | All Guilds | W4 complete | TODO | Tasks 13-17: CI, leaderboard, website, docs, launch. |
|
||||
| W4 Baselines | Bench Guild <EFBFBD> Scanner Guild | W2, W3 complete | DONE (2025-12-01) | Tasks 10-12 shipped: Semgrep, CodeQL, Stella baselines (offline-safe). |
|
||||
| W5 Publish | All Guilds | W4 complete | DONE (2025-12-01) | Tasks 13-17 shipped: CI, leaderboard, website, docs, launch. |
|
||||
|
||||
## Wave Detail Snapshots
|
||||
- **W1 Foundation (DONE 2025-11-29):** Repo skeleton, licensing, schemas, validators landed; prerequisites satisfied for downstream tracks.
|
||||
- **W2 Dataset (DOING):** JS/PY tracks complete; C track added (unsafe-system, guarded-system, memcpy-overflow); Java blocked on JDK>=17 in runner/CI; build pipeline scripts emit deterministic SBOM/attestation stubs; syft/real attestations still pending.
|
||||
- **W2 Dataset (DONE 2025-12-05):** JS/PY/C tracks complete; Java track finished via vendored Temurin JDK (ensure_jdk), adding micronaut-deserialize/guarded + spring-reflection with coverage/traces; build pipeline deterministic, syft/real attestations still pending as future enhancement.
|
||||
- **W3 Scoring (DONE 2025-11-30):** `rb-score` CLI, explainability tiers, and tests complete; ready to support baselines.
|
||||
- **W4 Baselines (TODO):** Semgrep runner done; CodeQL and Stella runners not started; waiting on dataset/build stability and Sprint 0401 reachability for Stella.
|
||||
- **W5 Publish (TODO):** CI, leaderboard, website, docs, and launch materials pending completion of baselines and build hardening.
|
||||
- **W4 Baselines (DONE 2025-12-01):** Semgrep, CodeQL, and Stella runners shipped; offline-safe with normalized outputs.
|
||||
- **W5 Publish (DONE 2025-12-01):** CI, leaderboard, website, docs, and launch materials delivered.
|
||||
|
||||
## Interlocks
|
||||
- Stella Ops baseline (task 12) requires Sprint 0401 reachability to be functional.
|
||||
@@ -90,11 +90,12 @@
|
||||
| R2 | Baseline tools have licensing restrictions. | Cannot include in public benchmark. | Document license requirements; exclude or limit usage; Legal. |
|
||||
| R3 | Hidden test set leakage. | Overfitting by vendors. | Rotate quarterly; governance controls; TAC. |
|
||||
| R4 | Deterministic builds fail on some platforms. | Reproducibility claims undermined. | Pin all toolchain versions; use SOURCE_DATE_EPOCH; DevOps Guild. |
|
||||
| R5 | Java cases blocked: JDK/javac missing on runner/CI. | Java track cannot build/test; risk of schedule slip. | Provide JDK>=17 in runner/CI; rerun Java build scripts; DevOps Guild. |
|
||||
| R5 | Java cases blocked: JDK/javac missing on runner/CI. | Resolved via vendored Temurin 21 + ensure_jdk in build/CI; risk now low (monitor disk footprint). | DevOps Guild. |
|
||||
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-05 | BENCH-CASES-JAVA-513-005 DONE: vendored Temurin 21 via `tools/java/ensure_jdk.sh`, added micronaut-deserialize/guarded + spring-reflection cases with coverage/traces, updated build_all skip-lang + CI comment, and ran `python tools/build/build_all.py --cases cases --skip-lang js` (Java pass; js skipped due to missing Node). | Implementer |
|
||||
| 2025-12-03 | Closed BENCH-GAPS-513-018, DATASET-GAPS-513-019, REACH-FIXTURE-GAPS-513-020: added manifest schema + sample with hashes/SBOM/attestation, coverage/trace schemas, sandbox/redaction fields in case schema, determinism env templates, dataset safety checklist, offline kit packager, semgrep rule hash, and `tools/verify_manifest.py` validation (all cases validated; Java build still blocked on JDK). | Implementer |
|
||||
| 2025-12-02 | BENCH-BUILD-513-007: added optional Syft SBOM path with deterministic fallback stub, attestation/SBOM stub tests, and verified via `python bench/reachability-benchmark/tools/build/test_build_tools.py`. Status set to DONE. | Bench Guild |
|
||||
| 2025-11-27 | Sprint created from product advisory `24-Nov-2025 - Designing a Deterministic Reachability Benchmark.md`; 17 tasks defined across 5 waves. | Product Mgmt |
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
- docs/contracts/crypto-provider-registry.md
|
||||
- docs/contracts/authority-crypto-provider.md
|
||||
- docs/legal/crypto-compliance-review.md (unblocks RU-CRYPTO-VAL-05/06)
|
||||
- docs/security/wine-csp-loader-design.md (technical design for Wine approach)
|
||||
|
||||
## Delivery Tracker
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
@@ -37,6 +36,8 @@
|
||||
| 2025-12-08 | RootPack harness reruns: with RUN_SCANNER=1 previously hit binder/determinism type gaps; reran with RUN_SCANNER=0/ALLOW_PARTIAL=1 and still hit NuGet restore cycle in `StellaOps.Concelier.Models` (NETSDK1064), so crypto tests could not execute. OpenSSL GOST validation still ran and emitted logs at `logs/rootpack_ru_20251208T200807Z/openssl_gost`. No bundle packaged until restore graph is fixed. | Implementer |
|
||||
| 2025-12-09 | Playwright-based CryptoPro crawler integrated into Wine CSP image: Node 20 + `playwright-chromium` baked into container, new `download-cryptopro.sh` runs on startup/CI (dry-run by default, unpack support for tar.gz/rpm/deb/bin) with default-demo-cred warning. Entry point triggers crawler before CSP install; tests call dry-run. Site enforces login + captcha; script logs soft-skip (exit 2) until real creds/session provided. | Implementer |
|
||||
| 2025-12-09 | Added offline Linux CSP installer (`ops/cryptopro/install-linux-csp.sh`) that consumes host-supplied CryptoPro 5.0 R3 `.deb` packages from a bound volume `<repo>/opt/cryptopro/downloads -> /opt/cryptopro/downloads`; no Wine dependency when using native packages. Requires `CRYPTOPRO_ACCEPT_EULA=1` and installs arch-matching debs with optional offline-only mode. | Implementer |
|
||||
| 2025-12-09 | Retired Wine CSP artifacts (ops/wine-csp, Wine CI, deploy doc, setup scripts, Wine provider) in favor of native Linux CryptoPro service and HTTP wrapper. | Implementer |
|
||||
| 2025-12-09 | Introduced native CryptoPro Linux HTTP service (`ops/cryptopro/linux-csp-service`, .NET minimal API) with health/license/hash/keyset-init endpoints; added CI workflow `cryptopro-linux-csp.yml` and compose entries. | Implementer |
|
||||
| 2025-12-06 | Sprint created; awaiting staffing. | Planning |
|
||||
| 2025-12-06 | Re-scoped: proceed with Linux OpenSSL GOST baseline (tasks 1—3 set to TODO); CSP/Wine/Legal remain BLOCKED (tasks 4—7). | Implementer |
|
||||
| 2025-12-07 | Published `docs/legal/crypto-compliance-review.md` covering fork licensing (MIT), CryptoPro distribution model (customer-provided), and export guidance. Provides partial unblock for RU-CRYPTO-VAL-05/06 pending legal sign-off. | Security |
|
||||
@@ -55,9 +56,10 @@
|
||||
- Windows CSP availability may slip; mitigation: document manual runner setup and allow deferred close on #1/#6 (currently blocking).
|
||||
- Licensing/export could block redistribution; must finalize before RootPack publish (currently blocking task 3).
|
||||
- Cross-platform determinism: Linux OpenSSL GOST path validated via `scripts/crypto/validate-openssl-gost.sh` (md_gost12_256 digest stable; signatures nonce-driven but verify). Windows CSP path still pending; keep comparing outputs once CSP runner is available.
|
||||
- **Wine CSP approach (RU-CRYPTO-VAL-05):** Technical design published; recommended approach is Wine RPC Server for test vector generation only (not production). **Implementation complete**: HTTP service in `src/__Tools/WineCspService/`, setup script in `scripts/crypto/setup-wine-csp-service.sh`, crypto registry provider in `src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/`. **Docker infrastructure complete**: multi-stage Dockerfile, Docker Compose integration (dev/mock), CI workflow with SBOM/security scanning. Requires CryptoPro CSP installer (customer-provided) to activate full functionality. See `docs/deploy/wine-csp-container.md` and `docs/security/wine-csp-loader-design.md`.
|
||||
- **Wine CSP approach (RU-CRYPTO-VAL-05):** Retired; Wine container/CI/docs removed. Use native Linux CryptoPro service instead.
|
||||
- CryptoPro downloads gate: `cryptopro.ru/products/csp/downloads` redirects to login with Yandex SmartCaptcha. Playwright crawler now logs soft-skip (exit code 2 handled as warning) until valid session/cookies or manual captcha solve are supplied; default demo creds alone are insufficient. Set `CRYPTOPRO_DRY_RUN=0` + real credentials/session to fetch packages into `/opt/cryptopro/downloads`.
|
||||
- Native Linux CSP install now supported when `.deb` packages are provided under `/opt/cryptopro/downloads` (host volume). Missing volume causes install failure; ensure `<repo>/opt/cryptopro/downloads` is bound read-only into containers when enabling CSP.
|
||||
- Native CSP HTTP wrapper (net10 minimal API) available at `ops/cryptopro/linux-csp-service` with `/health`, `/license`, `/hash`, `/keyset/init`; CI workflow `cryptopro-linux-csp.yml` builds/tests. Requires explicit `CRYPTOPRO_ACCEPT_EULA=1` to install CryptoPro packages.
|
||||
- **Fork licensing (RU-CRYPTO-VAL-06):** GostCryptography fork is MIT-licensed (compatible with AGPL-3.0). CryptoPro CSP is customer-provided. Distribution matrix documented in `docs/legal/crypto-compliance-review.md`. Awaiting legal sign-off.
|
||||
|
||||
## Next Checkpoints
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
| 4 | SM-CRYPTO-04 | DONE (2025-12-06) | After #1 | QA · Security | Deterministic software test vectors (sign/verify, hash) added in unit tests; “non-certified” banner documented. |
|
||||
| 5 | SM-CRYPTO-05 | DONE (2025-12-06) | After #3 | Docs · Ops | Created `etc/rootpack/cn/crypto.profile.yaml` with cn-soft profile preferring `cn.sm.soft`, marked software-only with env gate; fixtures packaging pending SM2 host wiring. |
|
||||
| 6 | SM-CRYPTO-06 | BLOCKED (2025-12-06) | Hardware token available | Security · Crypto | Add PKCS#11 SM provider and rerun vectors with certified hardware; replace “software-only” label when certified. |
|
||||
| 7 | SM-CRYPTO-07 | DONE (2025-12-09) | Docker host available | Security · Ops | Build/publish SM remote soft-service image (cn.sm.remote.http) from `tmp/smremote-pub`, smoke-test `/status` `/sign` `/verify`, and prepare container runbook. |
|
||||
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
@@ -35,11 +36,14 @@
|
||||
| 2025-12-06 | Started host wiring for SM2: Authority file key loader now supports SM2 raw keys; JWKS tests include SM2; task 3 set to DOING. | Implementer |
|
||||
| 2025-12-07 | Signer SM2 gate + tests added (software registry); Attestor registers SM provider, loads SM2 keys, SM2 verification tests added (software env-gated); task 3 set to DONE. | Implementer |
|
||||
| 2025-12-07 | Attestor SM2 wiring complete: SmSoftCryptoProvider registered in AttestorSigningKeyRegistry, SM2 key loading (PEM/base64/hex), signing tests added. Fixed AWSSDK version conflict and pre-existing test compilation issues. Task 3 set to DONE. | Implementer |
|
||||
| 2025-12-09 | Rebuilt SM remote publish artifacts to `tmp/smremote-pub`, added runtime Dockerfile, built `sm-remote:local`, and smoke-tested `/status`, `/sign`, `/verify` (SM_SOFT_ALLOWED=1, port 56080). | Implementer |
|
||||
| 2025-12-09 | Ran `dotnet restore` and `dotnet build src/Concelier/StellaOps.Concelier.sln -v minimal`; build completed with warnings only (Dilithium/NU1510/CONCELIER0001/CS8424). | Concelier Guild |
|
||||
|
||||
## Decisions & Risks
|
||||
- SM provider licensing/availability uncertain; mitigation: software fallback with “non-certified” label until hardware validated.
|
||||
- Webhook/interop must stay SHA-256—verify no SM override leaks; regression tests required in task 4.
|
||||
- Export controls for SM libraries still require review; note in docs and keep SM_SOFT_ALLOWED gate.
|
||||
- SM remote soft-service image built and validated locally (soft provider, port 56080); still software-only until PKCS#11 hardware (SM-CRYPTO-06) lands.
|
||||
|
||||
## Next Checkpoints
|
||||
- 2025-12-11 · Provider selection decision.
|
||||
|
||||
@@ -56,16 +56,7 @@
|
||||
| 16 | PG-T7.1.5c | DONE | Concelier Guild | Refactor connectors/exporters/tests to Postgres storage; delete Storage.Mongo code. |
|
||||
| 17 | PG-T7.1.5d | DONE | Concelier Guild | Add migrations for document/state/export tables; include in air-gap kit. |
|
||||
| 18 | PG-T7.1.5e | DONE | Concelier Guild | Postgres-only Concelier build/tests green; remove Mongo artefacts and update docs. |
|
||||
|
||||
### T7.2: Archive MongoDB Data
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 11 | PG-T7.2.1 | TODO | Depends on PG-T7.1.10 | DevOps Guild | Take final MongoDB backup |
|
||||
| 12 | PG-T7.2.2 | TODO | Depends on PG-T7.2.1 | DevOps Guild | Export to BSON/JSON archives |
|
||||
| 13 | PG-T7.2.3 | TODO | Depends on PG-T7.2.2 | DevOps Guild | Store archives in secure location |
|
||||
| 14 | PG-T7.2.4 | TODO | Depends on PG-T7.2.3 | DevOps Guild | Document archive contents and structure |
|
||||
| 15 | PG-T7.2.5 | TODO | Depends on PG-T7.2.4 | DevOps Guild | Set retention policy for archives |
|
||||
| 16 | PG-T7.2.6 | TODO | Depends on PG-T7.2.5 | DevOps Guild | Schedule MongoDB cluster decommission |
|
||||
| 19 | PG-T7.1.5f | DOING | Massive connector/test surface still on MongoCompat/Bson; staged migration to Storage.Contracts required before shim deletion. | Concelier Guild | Remove MongoCompat shim and any residual Mongo-shaped payload handling after Postgres parity sweep; update docs/DI/tests accordingly. |
|
||||
|
||||
### T7.3: PostgreSQL Performance Optimization
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
@@ -135,12 +126,18 @@
|
||||
| 2025-12-08 | Rebuilt Concelier solution after cache restore; Mongo shims no longer pull Mongo2Go/driver, but overall build still fails on cross-module crypto gap (`SmRemote` plugin missing). No remaining Mongo package/runtime dependencies in Concelier build. | Concelier Guild |
|
||||
| 2025-12-08 | Dropped the last MongoDB.Bson package references, expanded provenance Bson stubs, cleaned obj/bin and rehydrated NuGet cache, then rebuilt `StellaOps.Concelier.sln` successfully with Postgres-only DI. PG-T7.1.5a/5b marked DONE; PG-T7.1.5c continues for Postgres runtime parity and migrations. | Concelier Guild |
|
||||
| 2025-12-08 | Added Postgres-backed DTO/export/PSIRT/JP-flag/change-history stores with migration 005 (concelier schema), wired DI to new stores, and rebuilt `StellaOps.Concelier.sln` green Postgres-only. PG-T7.1.5c/5d/5e marked DONE. | Concelier Guild |
|
||||
| 2025-12-09 | Mirrored Wave A action/risk into parent sprint; added PG-T7.1.5f (TODO) to remove MongoCompat shim post-parity sweep and ensure migration 005 stays in the kit. | Project Mgmt |
|
||||
| 2025-12-09 | PG-T7.1.5f set BLOCKED: MongoCompat/Bson interfaces are still the canonical storage contracts across connectors/tests; need design to introduce Postgres-native abstractions and parity evidence before deleting shim. | Project Mgmt |
|
||||
| 2025-12-09 | Investigated MongoCompat usage: connectors/tests depend on IDocumentStore, IDtoStore (Bson payloads), ISourceStateRepository (Bson cursors), advisory/alias/change-history/export state stores, and DualWrite/DIOptions; Postgres stores implement Mongo contracts today. Need new storage contracts (JSON/byte payloads, cursor DTO) and adapter layer to retire Mongo namespaces. | Project Mgmt |
|
||||
| 2025-12-09 | Started PG-T7.1.5f implementation: added Postgres-native storage contracts (document/dto/source state) and adapters in Postgres stores to implement both new contracts and legacy Mongo interfaces; connectors/tests still need migration off MongoCompat/Bson. | Project Mgmt |
|
||||
| 2025-12-09 | PG-T7.1.5f in progress: contract/adapters added; started migrating Common SourceFetchService to Storage.Contracts with backward-compatible constructor. Connector/test surface still large; staged migration plan required. | Project Mgmt |
|
||||
|
||||
## Decisions & Risks
|
||||
- Concelier PG-T7.1.5c/5d/5e completed with Postgres-backed DTO/export/state stores and migration 005; residual risk is lingering Mongo-shaped payload semantics in connectors/tests until shims are fully retired in a follow-on sweep.
|
||||
- Cleanup is strictly after all phases complete; do not start T7 tasks until module cutovers are DONE.
|
||||
- Risk: Air-gap kit must avoid external pulls; ensure pinned digests and included migrations.
|
||||
- Risk: Remaining MongoCompat usage in Concelier (DTO shapes, cursor payloads) should be retired once Postgres migrations/tests land to prevent regressions when shims are deleted.
|
||||
- Risk: MongoCompat shim removal pending (PG-T7.1.5f / ACT-3407-A1); PG-T7.1.5f in progress with Postgres-native storage contracts added, but connectors/tests still depend on MongoCompat/Bson types. Parity sweep and connector migration needed before deleting the shim; keep migration 005 in the air-gap kit.
|
||||
- BLOCKER: Scheduler: Postgres equivalent for GraphJobStore/PolicyRunService not designed; need schema/contract decision to proceed with PG-T7.1.2a and related deletions.
|
||||
- BLOCKER: Scheduler Worker still depends on Mongo-era repositories (run/schedule/impact/policy); Postgres counterparts are missing, keeping solution/tests red until implemented or shims added.
|
||||
- BLOCKER: Scheduler/Notify/Policy/Excititor Mongo removals must align with the phased plan; delete only after replacements are in place.
|
||||
|
||||
@@ -1,9 +1,62 @@
|
||||
# Wave A · Mongo Drop (Concelier)
|
||||
# Sprint 3407 - Wave A Concelier Postgres Cleanup Tasks
|
||||
|
||||
| # | Task ID | Status | Owner | Notes |
|
||||
|---|---|---|---|---|
|
||||
| 1 | PG-T7.1.5a | DOING | Concelier Guild | Replace Mongo storage dependencies with Postgres equivalents; remove MongoDB.Driver/Bson packages from Concelier projects. |
|
||||
| 2 | PG-T7.1.5b | DOING | Concelier Guild | Implement Postgres document/raw storage (bytea/LargeObject) + state repos to satisfy connector fetch/store paths. |
|
||||
| 3 | PG-T7.1.5c | TODO | Concelier Guild | Refactor all connectors/exporters/tests to use Postgres storage namespaces; delete Storage.Mongo code/tests. |
|
||||
| 4 | PG-T7.1.5d | TODO | Concelier Guild | Add migrations for documents/state/export tables; wire into Concelier Postgres storage DI. |
|
||||
| 5 | PG-T7.1.5e | TODO | Concelier Guild | End-to-end Concelier build/test on Postgres-only stack; update sprint log and remove Mongo artifacts from repo history references. |
|
||||
## Topic & Scope
|
||||
- Track Wave A (Concelier) tasks PG-T7.1.5a-5e for Mongo removal and Postgres storage cutover under Sprint 3407 Phase 7 cleanup.
|
||||
- Evidence: Postgres-only Concelier builds/tests, migrations applied, and no MongoDB driver or package dependencies.
|
||||
- Working directory: `src/Concelier`.
|
||||
|
||||
## Dependencies & Concurrency
|
||||
- Depends on approvals and plan in `SPRINT_3407_0001_0001_postgres_cleanup.md` (Wave A precedes Waves B-E).
|
||||
- Align statuses with the parent sprint Execution Log; no parallel Mongo work should start elsewhere until this wave remains green.
|
||||
|
||||
## Documentation Prerequisites
|
||||
- `docs/db/reports/mongo-removal-plan-20251207.md`
|
||||
- `docs/db/reports/mongo-removal-decisions-20251206.md`
|
||||
- `docs/modules/concelier/architecture.md`
|
||||
- `src/Concelier/AGENTS.md`
|
||||
|
||||
## Delivery Tracker
|
||||
| # | Task ID | Status | Key dependency / next step | Owners | Task Definition |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 1 | PG-T7.1.5a | DONE | Postgres DI stabilized; monitor connectors for stray Mongo package usage. | Concelier Guild | Replace Mongo storage dependencies with Postgres equivalents; remove MongoDB.Driver/Bson packages from Concelier projects. |
|
||||
| 2 | PG-T7.1.5b | DONE | Postgres stores live; retire interim shims after parity sweep. | Concelier Guild | Implement Postgres document/raw storage (bytea/LargeObject) plus state repositories to satisfy connector fetch/store paths. |
|
||||
| 3 | PG-T7.1.5c | DONE | Follow-on: remove MongoCompat shim once tests stay green. | Concelier Guild | Refactor all connectors/exporters/tests to use Postgres storage namespaces; delete Storage.Mongo code/tests. |
|
||||
| 4 | PG-T7.1.5d | DONE | Ensure migration 005 remains in the air-gap kit. | Concelier Guild | Add migrations for documents/state/export tables; wire into Concelier Postgres storage DI. |
|
||||
| 5 | PG-T7.1.5e | DONE | Keep parent sprint log updated; retire shim in follow-on wave. | Concelier Guild | End-to-end Concelier build/test on a Postgres-only stack; update sprint log and remove Mongo artifacts from repo history references. |
|
||||
| 6 | PG-T7.1.5f | DOING | Need Postgres-native storage contracts to replace MongoCompat/Bson interfaces across connectors/tests; capture parity sweep evidence before deletion. | Concelier Guild | Remove MongoCompat shim and residual Mongo-shaped payload handling; update DI/docs/tests and keep migration 005 in the kit. |
|
||||
|
||||
## Wave Coordination
|
||||
- Scope: Wave A (Concelier) in Sprint 3407 Phase 7 cleanup; completes before archive/perf/doc/air-gap waves start.
|
||||
- PG-T7.1.5a-5e are DONE; PG-T7.1.5f (shim removal) is in progress and will gate MongoCompat deletion.
|
||||
|
||||
## Wave Detail Snapshots
|
||||
- Postgres document/raw/state stores and migration 005 are applied; Concelier builds/tests succeed without MongoDB drivers.
|
||||
- MongoCompat shim remains the canonical interface surface for connectors/tests; Postgres-native contracts and adapters have been added, but migration and parity evidence are still pending.
|
||||
|
||||
## Interlocks
|
||||
- Parent sprint execution log remains the source of truth for cross-module sequencing.
|
||||
- Air-gap kit updates depend on migration 005 shipping in artifacts; coordinate with the Wave E owner before the kit freeze.
|
||||
|
||||
## Upcoming Checkpoints
|
||||
- 2025-12-10: Confirm MongoCompat shim removal approach (introduce Postgres-native contract + parity evidence) and unblock PG-T7.1.5f.
|
||||
|
||||
## Action Tracker
|
||||
| Action ID | Status | Owner | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| ACT-3407-A1 | DOING | Concelier Guild | Execute Postgres-native storage contract, capture parity evidence, then delete MongoCompat shim; tracked as PG-T7.1.5f in parent sprint. |
|
||||
|
||||
## Decisions & Risks
|
||||
- Decisions: PG-T7.1.5a-5e are complete per parent sprint log (2025-12-08) with Postgres-only Concelier build/test evidence.
|
||||
- Risks are tracked in the table below and should be mirrored into the parent sprint if escalated.
|
||||
|
||||
| Risk | Impact | Mitigation | Owner | Status |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| MongoCompat shim still referenced in connectors/tests | Could reintroduce Mongo semantics and block full removal | Define Postgres-native storage contract, capture parity sweep evidence, then delete the shim; ensure migration 005 stays in the kit | Concelier Guild | Open |
|
||||
|
||||
## Execution Log
|
||||
| Date (UTC) | Update | Owner |
|
||||
| --- | --- | --- |
|
||||
| 2025-12-09 | Normalized file to sprint template; synced PG-T7.1.5a-5e statuses to DONE per parent sprint log; added checkpoints, interlocks, and risk tracking. | Project Mgmt |
|
||||
| 2025-12-09 | Added PG-T7.1.5f (BLOCKED) for MongoCompat shim removal; action ACT-3407-A1 set BLOCKED pending Postgres-native storage contract and parity evidence. | Project Mgmt |
|
||||
| 2025-12-09 | Investigated MongoCompat usage across connectors/tests: IDocumentStore, IDtoStore (Bson payloads), ISourceStateRepository (Bson cursors), advisory/alias/change-history/export stores, DualWrite DI hooks all depend on Mongo contracts. Need new Postgres-native storage contracts (JSON/byte payload DTOs, cursor DTO) plus adapters before shim deletion. | Project Mgmt |
|
||||
| 2025-12-09 | Started PG-T7.1.5f: added Postgres-native storage contracts and adapters in Postgres stores implementing both new and legacy Mongo interfaces; began migrating Common SourceFetchService to new contracts with compatibility ctor; connector/test migration still pending. | Project Mgmt |
|
||||
|
||||
@@ -25,21 +25,26 @@ Unlike Node.js, Bun may store packages entirely under `node_modules/.bun/` with
|
||||
- Do not filter out hidden directories in container scans
|
||||
- Verify evidence shows packages from both `node_modules/` and `node_modules/.bun/`
|
||||
|
||||
## 3. `bun.lockb` Migration Path
|
||||
## 3. `bun.lockb` Policy (2025-12-09)
|
||||
|
||||
The binary lockfile (`bun.lockb`) format is undocumented and unstable. The analyzer treats it as **unsupported** and emits a remediation finding.
|
||||
The binary lockfile (`bun.lockb`) remains **unsupported**. We will not parse it and will keep remediation-only handling until Bun publishes a stable, documented format.
|
||||
|
||||
**Migration command:**
|
||||
**Posture:**
|
||||
- Treat `bun.lockb` as unsupported input; do not attempt best-effort parsing.
|
||||
- Emit a deterministic remediation finding instructing conversion to text.
|
||||
- Skip package inventory when only `bun.lockb` is present to avoid nondeterministic/partial results.
|
||||
|
||||
**Migration command (required):**
|
||||
```bash
|
||||
bun install --save-text-lockfile
|
||||
```
|
||||
|
||||
This generates `bun.lock` (JSONC text format) which the analyzer can parse.
|
||||
This generates `bun.lock` (JSONC text format) which the analyzer parses.
|
||||
|
||||
**WebService response:** When only `bun.lockb` is present:
|
||||
- The scan completes but reports unsupported status
|
||||
- Remediation guidance is included in findings
|
||||
- No package inventory is generated
|
||||
**WebService response when only `bun.lockb` exists:**
|
||||
- Scan completes with `unsupported` marker for the package manager.
|
||||
- Remediation guidance is included in findings.
|
||||
- No package inventory is generated until `bun.lock` is provided.
|
||||
|
||||
## 4. JSONC Lockfile Format
|
||||
|
||||
|
||||
46
docs/modules/scanner/design/dart-swift-analyzer-scope.md
Normal file
46
docs/modules/scanner/design/dart-swift-analyzer-scope.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Dart & Swift Analyzer Scope Note (2025-12-09)
|
||||
|
||||
## Goals
|
||||
- Define the initial analyzer scope for Dart (pub) and Swift (SwiftPM) with deterministic, offline-friendly behavior.
|
||||
- Provide fixture/backlog list to unblock readiness tracking and align with Signals/Zastava expectations.
|
||||
|
||||
## Dart (pub)
|
||||
- Inputs: `pubspec.yaml`, `pubspec.lock`, `.dart_tool/package_config.json`, and downloaded packages under `.dart_tool/pub`.
|
||||
- Outputs:
|
||||
- Inventory of `pkg:pub/<name>@<version>` with resolved source (hosted/path/git) and sha256 when present in lockfile.
|
||||
- Dependency edges from `pubspec.lock`; dev dependencies emitted only when `include_dev=true`.
|
||||
- Analyzer metadata: sdk constraint, null-safety flag, source type per package.
|
||||
- Determinism:
|
||||
- Sort packages and edges lexicographically.
|
||||
- Normalize paths to POSIX; no network calls; rely only on lockfile/package_config on disk.
|
||||
- Out of scope (v1):
|
||||
- Flutter build graph, transitive runtime surface, and hosted index downloads.
|
||||
- Git/path overrides beyond what is listed in lock/package_config.
|
||||
- Fixtures/backlog:
|
||||
- Hosted app with `pubspec.lock` and `.dart_tool/package_config.json` (dev deps included).
|
||||
- Path dependency sample (relative and absolute).
|
||||
- Git dependency sample with locked commit.
|
||||
- Missing lockfile case (expect finding + no inventory).
|
||||
|
||||
## Swift (SwiftPM)
|
||||
- Inputs: `Package.swift`, `Package.resolved` (v1/v2), `.build/` manifest cache when present.
|
||||
- Outputs:
|
||||
- Inventory of `pkg:swiftpm/<name>@<version>` with checksum from `Package.resolved` when available.
|
||||
- Dependency edges from `Package.resolved` target graph; emit platforms/arch only when declared.
|
||||
- Analyzer metadata: Swift tools version, resolution format, mirrors when specified.
|
||||
- Determinism:
|
||||
- Do not execute `swift package`; parse manifests/resolved files only.
|
||||
- Stable ordering by package then target; normalize paths to POSIX.
|
||||
- Out of scope (v1):
|
||||
- Xcodeproj resolution, binary target downloads, and build artifacts hashing.
|
||||
- Conditional target resolution beyond what `Package.resolved` records.
|
||||
- Fixtures/backlog:
|
||||
- Single-package app with `Package.resolved` v2 (checksum present).
|
||||
- Nested target graph with products/targets/flexible platforms.
|
||||
- Binary target entry (no download; expect metadata-only inventory).
|
||||
- Missing `Package.resolved` case (emit finding, no inventory).
|
||||
|
||||
## Alignment & Next Steps
|
||||
- Signals/Zastava: confirm package ID naming (`pkg:pub`, `pkg:swiftpm`) and dependency edge semantics for reachability ingestion.
|
||||
- Add goldens/fixtures under `src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.DartSwift.Tests/Fixtures/**`.
|
||||
- Update readiness checkpoints once fixtures and parsers land; current scope note unblocks backlog creation only.
|
||||
40
docs/modules/scanner/design/deno-analyzer-scope.md
Normal file
40
docs/modules/scanner/design/deno-analyzer-scope.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Deno Analyzer Scope Note (2025-12-09)
|
||||
|
||||
## Goals
|
||||
- Define deterministic, offline-friendly scope for the Deno analyzer to move readiness from “status mismatch” to planned execution.
|
||||
- Enumerate fixtures and evidence needed to mark Amber→Green once implemented.
|
||||
|
||||
## Inputs
|
||||
- `deno.json` / `deno.jsonc` (config and import maps).
|
||||
- `deno.lock` (v2) with integrity hashes.
|
||||
- Source tree for `import`/`export` graph; `node_modules/` when `npm:` specifiers are used (npm compatibility mode).
|
||||
- Optional: cache dir (`~/.cache/deno`) when present in extracted images.
|
||||
|
||||
## Outputs
|
||||
- Inventory of modules:
|
||||
- `pkg:deno/<specifier>@<version>` for remote modules (normalize to URL without fragment).
|
||||
- `pkg:npm/<name>@<version>` for `npm:` dependencies with lock hash.
|
||||
- `pkg:file/<path>` for local modules (relative POSIX paths).
|
||||
- Dependency edges:
|
||||
- From importer to imported specifier with resolved path/URL.
|
||||
- Include type (remote/local/npm), integrity (sha256 from lock), and media type when available.
|
||||
- Metadata:
|
||||
- Deno version (from lock/config if present).
|
||||
- Import map path and hash.
|
||||
- NPM compatibility flag + resolved registry scope when npm used.
|
||||
|
||||
## Determinism & Offline
|
||||
- Never fetch network resources; rely solely on `deno.lock` + on-disk files.
|
||||
- Normalize paths to POSIX; stable sorting (source path, then target).
|
||||
- Hashes: prefer lock integrity; otherwise SHA-256 over file bytes for local modules.
|
||||
|
||||
## Fixtures / Backlog
|
||||
1) Remote-only project with `deno.lock` (http imports) and import map.
|
||||
2) Mixed project using `npm:` specifiers with `node_modules/` present.
|
||||
3) Local-only project (relative imports) without lockfile → expect finding + no inventory.
|
||||
4) Image/extracted cache with populated `~/.cache/deno` to verify offline reuse.
|
||||
|
||||
## Status & Next Steps
|
||||
- Implement parser to ingest `deno.lock` v2 and import map; add graph builder over source files.
|
||||
- Add fixtures under `src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/**` with goldens; keep hashes stable.
|
||||
- Update readiness checkpoints once fixtures land and TRX/binlogs captured.
|
||||
45
docs/modules/scanner/design/dotnet-analyzer-11-001.md
Normal file
45
docs/modules/scanner/design/dotnet-analyzer-11-001.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# .NET Analyzer Design · 11-001 Entrypoint Resolver (2025-12-09)
|
||||
|
||||
## Goals
|
||||
- Resolve .NET entrypoints deterministically from project/publish artefacts and emit normalized identities (assembly name, MVID, TFM, RID, host kind, publish mode).
|
||||
- Capture environment profiles (single-file, trimmed, self-contained vs framework-dependent, ALC hints) without executing payloads.
|
||||
- Produce deterministic evidence aligned to `dotnet-il-metadata.schema.json` for downstream analyzers 11-002..005.
|
||||
|
||||
## Inputs
|
||||
- `*.csproj`/`*.fsproj` metadata (TargetFrameworks, RuntimeIdentifiers, PublishSingleFile/Trim options).
|
||||
- Publish outputs: apphost (`*.exe`), `*.dll`, `*.deps.json`, `*.runtimeconfig.json`, `*.targets` cache.
|
||||
- RID graph from SDK (offline snapshot in repo), deterministic time provider.
|
||||
|
||||
## Outputs
|
||||
- `entrypoints[]` records: `assembly`, `mvid`, `tfm`, `rid`, `hostKind` (apphost/framework-dependent/self-contained), `publishMode` (single-file/trimmed), `alcHints` (AssemblyLoadContext names), `probingPaths`, `nativeDeps` (apphost bundles).
|
||||
- Evidence: `LanguageComponentEvidence` entries per entrypoint with locator = publish path, hash over file bytes for determinism.
|
||||
- Diagnostics: missing deps/runtimeconfig, mixed RID publish, single-file without extractor support.
|
||||
|
||||
## Algorithm (deterministic)
|
||||
1) Parse project: target frameworks, RIDs, publish flags; normalize to ordered sets.
|
||||
2) Discover publish artefacts under `bin/<Configuration>/<TFM>/...` and `publish/` folders; prefer `*.runtimeconfig.json` when present.
|
||||
3) Read `*.deps.json` to extract runtime targets and resolve primary entry assembly; fall back to `apphost` name.
|
||||
4) Compute MVID from PE header; compute SHA-256 over `*.dll`/`*.exe` bytes; capture file size.
|
||||
5) Classify host:
|
||||
- `apphost` present -> `hostKind = apphost`; detect single-file bundle via marker sections.
|
||||
- Framework-dependent -> `hostKind = framework-dependent`; use `runtimeconfig` probing paths.
|
||||
6) Infer ALC hints: scan deps for `runtimeconfig.dev.json` probing paths and `additionalProbingPaths`; add known SDK paths.
|
||||
7) Emit entrypoint with deterministic ordering: sort by assembly name, then RID, then TFM.
|
||||
|
||||
## Determinism & Offline
|
||||
- No network access; relies solely on on-disk project/publish artefacts.
|
||||
- Stable ordering and casing (`Ordinal` sort), UTC time provider.
|
||||
- Hashes: SHA-256 over file bytes; no timestamps.
|
||||
|
||||
## Test & Fixture Plan
|
||||
- Existing suite: `src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.DotNet.Tests` (now green; TRX at `TestResults/dotnet/dotnet-tests.trx`).
|
||||
- Fixtures to maintain:
|
||||
- Framework-dependent app with deps/runtimeconfig.
|
||||
- Self-contained single-file publish (bundle) with apphost.
|
||||
- Trimmed publish with ALC hints.
|
||||
- Multi-RID publish verifying RID selection and deterministic ordering.
|
||||
- Add new fixtures under `...DotNet.Tests/Fixtures/` when new host kinds are supported; keep hashes stable.
|
||||
|
||||
## Next Steps
|
||||
- Wire readiness checkpoints to mark 11-001 design+tests complete; keep CI runner validation optional (DEVOPS-SCANNER-CI-11-001) for reproducibility.
|
||||
- Feed outputs into 11-002..005 analyzers once entrypoint metadata is consumed by downstream IL/reflection pipelines.
|
||||
39
docs/modules/scanner/design/php-autoload-design.md
Normal file
39
docs/modules/scanner/design/php-autoload-design.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# PHP Analyzer Autoload & Restore Design (2025-12-09)
|
||||
|
||||
## Goals
|
||||
- Stabilize PHP analyzer pipeline (SCANNER-ENG-0010 / 27-001) by defining autoload graph handling, composer restore posture, and fixtures.
|
||||
- Provide deterministic evidence suitable for CI and reachability alignment with Concelier/Signals.
|
||||
|
||||
## Inputs
|
||||
- `composer.json` + `composer.lock`.
|
||||
- `vendor/composer/*.php` autoload files (`autoload_psr4.php`, `autoload_classmap.php`, `autoload_files.php`, `autoload_static.php`).
|
||||
- Installed vendor tree under `vendor/`.
|
||||
- Optional: `composer.phar` version metadata for diagnostics (no execution).
|
||||
|
||||
## Outputs
|
||||
- Package inventory: `pkg:composer/<name>@<version>` with source/dist hashes from lockfile.
|
||||
- Autoload graph:
|
||||
- PSR-4/PSR-0 mappings (namespace → path), classmap entries, files includes.
|
||||
- Emit edges from package → file and namespace → path with deterministic ordering.
|
||||
- Restore diagnostics:
|
||||
- Detect missing vendor install vs lockfile drift; emit findings instead of network restore.
|
||||
- Metadata:
|
||||
- Composer version (from lock/platform field when present).
|
||||
- Platform PHP extensions/version constraints.
|
||||
|
||||
## Determinism & Offline
|
||||
- No composer install/updates; read-only parsing of lock/autoload/vendor.
|
||||
- Stable ordering: sort packages, namespaces, classmap entries, files includes (ordinal, POSIX paths).
|
||||
- Hashes: use lockfile dist/shasum when present; otherwise SHA-256 over on-disk file bytes for autoloaded files.
|
||||
|
||||
## Fixtures / Backlog
|
||||
1) PSR-4 project with namespaced classes and classmap mix.
|
||||
2) Project with `autoload_files.php` includes (functions/constants).
|
||||
3) Lockfile present but vendor missing → expect finding, no inventory.
|
||||
4) Path repo override + dist hash present.
|
||||
|
||||
## Implementation Steps
|
||||
- Parser for composer.lock (packages + platform reqs) and autoload PHP arrays (psr-4, psr-0, classmap, files).
|
||||
- Graph builder producing deterministic edges and evidence records.
|
||||
- Findings for missing vendor, mismatched lock hash, or absent autoload files.
|
||||
- Tests under `src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Php.Tests` with goldens for each fixture; add TRX/binlogs to readiness once stable.
|
||||
37
docs/modules/scanner/design/runtime-parity-plan.md
Normal file
37
docs/modules/scanner/design/runtime-parity-plan.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Runtime Parity Plan (Java / .NET / PHP) — Scanner Aú · Signals Alignment (2025-12-09)
|
||||
|
||||
## Objectives
|
||||
- Close runtime parity gaps by pairing static analyzer hooks with runtime evidence for Java, .NET, and PHP.
|
||||
- Produce deterministic artefacts (TRX/binlogs + NDJSON) that Signals can ingest for runtime reconciliation.
|
||||
|
||||
## Scope & Hooks
|
||||
- **Java (21-005..011)**: jar/classpath resolution, `Main-Class`, module-info, shaded jars. Runtime hook: capture resolved classpath + main entry via proc snapshot or launcher args.
|
||||
- **.NET (11-001..005)**: `.deps.json`, RID-graph, single-file/trimmed detection, `runtimeconfig.json`. Runtime hook: capture host command line + loaded assembly list via Signals proc trace.
|
||||
- **PHP (27-001)**: composer autoload graph (`vendor/composer/autoload_*.php`), package metadata, runtime entry (fpm/cli). Runtime hook: map autoloaded files to runtime include graph when proc snapshot present.
|
||||
|
||||
## Evidence Plan
|
||||
1) **Static**: ensure analyzers emit deterministically ordered inventories + edges with layer attribution (already enforced across analyzers).
|
||||
2) **Runtime capture** (requires Signals):
|
||||
- Provide proc snapshot schema to Scanner (cmdline, env, cwd, loaded modules/files).
|
||||
- Export runtime observations as NDJSON with stable ordering (path, module, hash).
|
||||
3) **Reconciliation**:
|
||||
- Join static entries to runtime observations on normalized path + hash.
|
||||
- Emit `runtime.match` / `runtime.miss` diagnostics with counts per analyzer.
|
||||
4) **Artefacts**:
|
||||
- CI: TRX/binlog per analyzer suite.
|
||||
- NDJSON samples: runtime reconciliation outputs for each language (hosted under `src/Scanner/__Tests/.../Fixtures/RuntimeParity`).
|
||||
|
||||
## Task Backlog
|
||||
- T1: Wire proc snapshot ingestion for Java/.NET/PHP analyzers (Signals contract).
|
||||
- T2: Add runtime reconciliation step with deterministic ordering and diagnostics.
|
||||
- T3: Author runtime fixtures (one per language) and goldens for reconciliation output.
|
||||
- T4: Document runtime parity expectations in readiness checkpoints and surfaces guides.
|
||||
|
||||
## Constraints
|
||||
- Offline-friendly: no network calls during reconciliation; rely solely on provided proc snapshot.
|
||||
- Deterministic: stable sort (layer, path, name), UTC timestamps, no random seeds.
|
||||
- Security: avoid executing payloads; treat proc snapshot as data only.
|
||||
|
||||
## Dependencies
|
||||
- Signals to confirm proc snapshot schema and DSSE/NDJSON event shape for runtime observations.
|
||||
- Dedicated CI runner (DEVOPS-SCANNER-CI-11-001) to record TRX/binlogs for Java/.NET suites.
|
||||
@@ -7,13 +7,13 @@
|
||||
## Phase Readiness
|
||||
| Phase / Sprint | Status | Evidence | Gaps / Actions |
|
||||
| --- | --- | --- | --- |
|
||||
| Phase II · Sprint 0131 (Deno/Java/.NET bootstrap) | Amber/Red | Deno runtime capture shipped and tested; Java chain 21-005..011 blocked on Concelier build + CI runner; .NET Lang 11-001 blocked awaiting clean runner; PHP VFS 27-001 blocked pending bootstrap spec. | Need CI slice (DEVOPS-SCANNER-CI-11-001) for Java/.NET; define PHP bootstrap spec and fixtures to unblock 27-001. |
|
||||
| Phase II · Sprint 0131 (Deno/Java/.NET bootstrap) | Amber/Red | Deno runtime capture shipped and tested; Java chain 21-005..011 still blocked on runner; .NET Lang 11-001 design/tests completed locally (TRX `TestResults/dotnet/dotnet-tests.trx`, design at `docs/modules/scanner/design/dotnet-analyzer-11-001.md`); PHP VFS 27-001 blocked pending bootstrap spec. | Need CI slice (DEVOPS-SCANNER-CI-11-001) for Java rerun; finalize PHP bootstrap spec and fixtures to unblock 27-001; publish Deno fixtures. |
|
||||
| Phase III · Sprint 0132 (Native + Node foundations) | Amber | Native analyzers 20-001..010 shipped with tests; Node 22-001..005 shipped; Node isolated/CI tests pending due to build graph bloat; .NET Lang 11-002..005 blocked on upstream design 11-001 outputs. | Trim Node test graph or run on clean runner to record pass; unblock .NET analyzer design to proceed with runtime/export/fixtures. |
|
||||
| Phase IV · Sprint 0133 (Node bundle/source-map) | Amber | Phase22 bundle/native/WASM observation implemented and fixtures hashed; validation tests pending (SDK resolver cancels build on current runner). | Execute `scripts/run-node-phase22-smoke.sh` on clean runner; capture TRX/binlog to close. |
|
||||
| Phase V · Sprint 0134 (PHP fixtures/runtime/package) | Green | PHP analyzer fixtures, runtime evidence, and packaging shipped; docs updated. | Keep fixture hashes stable; rerun benchmarks when dependencies change. |
|
||||
| Phase VI · Sprint 0135 (Python container + Ruby VFS/edges) | Green | Python container/zipapp adapters shipped; Ruby VFS/dependency edges/observations/runtime capture packaged; EntryTrace 18-502/503 delivered. | Maintain determinism; re-run EntryTrace suite in CI. |
|
||||
| Phase VII · Sprint 0136 (EntryTrace surface/CLI) | Green | EntryTrace phase VII tasks 18-504/505/506 completed; CLI/WebService surfaces show best-terminal metadata and confidence. | Keep NDJSON schema stable; rerun worker payload tests in CI. |
|
||||
| Sprint 0138 (Ruby parity & future analyzers) | Amber/Red | Ruby parity shipped; Mongo package inventory live. PHP pipeline SCANNER-ENG-0010 blocked on composer/autoload design + restore stability; Deno/Dart/Swift analyzer scopes blocked awaiting design; Kubernetes/VM roadmap pending. | Resolve PHP restore/design, produce Deno/Dart/Swift scopes, schedule Zastava/Runtime alignment. |
|
||||
| Sprint 0138 (Ruby parity & future analyzers) | Amber/Red | Ruby parity shipped; Mongo package inventory live. PHP pipeline SCANNER-ENG-0010 blocked on composer/autoload design + restore stability (design at `docs/modules/scanner/design/php-autoload-design.md`); Deno scope drafted (`docs/modules/scanner/design/deno-analyzer-scope.md`); Dart/Swift scope drafted (`docs/modules/scanner/design/dart-swift-analyzer-scope.md`); Kubernetes/VM roadmap pending. | Implement PHP autoload parser/fixtures per design; add Deno fixtures and validation evidence; align with Zastava/Runtime and update readiness once fixtures land. |
|
||||
|
||||
## Overall
|
||||
- Green areas: native analyzers, PHP fixtures/runtime packaging, Ruby analyzer, Python container adapters, EntryTrace phases VI–VII.
|
||||
@@ -22,5 +22,7 @@
|
||||
## Recommended Next Actions
|
||||
1) Secure clean CI slice for Java/.NET and Node Phase22 smoke tests; store binlogs/TRX.
|
||||
2) Finalise PHP analyzer design (composer/autoload graph) and stabilise restore pipeline to unblock SCANNER-ENG-0010/27-001.
|
||||
3) Publish Deno/Dart/Swift analyzer scopes with fixtures to unblock 0138 tasks and roadmap alignment with Zastava/Runtime.
|
||||
4) Re-run EntryTrace and Native suites in CI to lock deterministic hashes before downstream release.
|
||||
3) Publish Deno/Dart/Swift analyzer scopes with fixtures to unblock 0138 tasks and roadmap alignment with Zastava/Runtime (scope note added at `docs/modules/scanner/design/dart-swift-analyzer-scope.md`; fixtures pending).
|
||||
4) Lock bun.lockb posture as remediation-only (doc updated at `docs/modules/scanner/bun-analyzer-gotchas.md`); no parser work planned unless format stabilises.
|
||||
5) Draft runtime parity plan for Java/.NET/PHP and align with Signals proc snapshot schema (plan at `docs/modules/scanner/design/runtime-parity-plan.md`); add reconciliation fixtures once schema confirmed.
|
||||
6) Re-run EntryTrace and Native suites in CI to lock deterministic hashes before downstream release.
|
||||
|
||||
@@ -99,7 +99,7 @@ HMAC operations use purpose-based selection similar to hashing:
|
||||
|
||||
## Simulation paths when hardware is missing
|
||||
|
||||
- **RU / GOST**: Linux baseline uses `ru.openssl.gost`; CryptoPro CSP can be exercised from Linux via the Wine sidecar service (`ru.winecsp.http`) built from `scripts/crypto/setup-wine-csp-service.sh` when customers supply the CSP installer. Windows CSP remains blocked until licensed runners are available.
|
||||
- **RU / GOST**: Linux baseline uses `ru.openssl.gost`; CryptoPro CSP can be exercised via the native Linux CSP service (CryptoPro deb bundles, no Wine) when customers supply the installer. Windows CSP remains blocked until licensed runners are available.
|
||||
- **CN / SM2**: Software baseline (`cn.sm.soft`) plus a containerized remote microservice (`cn.sm.remote.http`) that simulates SM2 signing/verification; swap the endpoint to a hardware-backed service when licensed hardware is provided.
|
||||
- **CN / SM**: Software-only SM2/SM3 provider (`cn.sm.soft`) backed by BouncyCastle; enable with `SM_SOFT_ALLOWED=1`. Hardware PKCS#11 tokens can be added later without changing feature code because hosts resolve via `ICryptoProviderRegistry`.
|
||||
- **FIPS / eIDAS**: Software allow-lists (`fips.ecdsa.soft`, `eu.eidas.soft`) enforce ES256/ES384 + SHA-2. They are labeled non-certified until a CMVP/QSCD module is supplied.
|
||||
|
||||
@@ -1,863 +0,0 @@
|
||||
# Wine CSP Loader Design · CryptoPro GOST Validation
|
||||
|
||||
**Status:** IMPLEMENTED (HTTP-based approach)
|
||||
**Date:** 2025-12-07
|
||||
**Owners:** Security Guild, DevOps
|
||||
**Related:** RU-CRYPTO-VAL-04, RU-CRYPTO-VAL-05
|
||||
|
||||
## Implementation Status
|
||||
|
||||
The HTTP-based Wine RPC Server approach (Approach C variant) has been implemented:
|
||||
|
||||
| Component | Path | Status |
|
||||
|-----------|------|--------|
|
||||
| Wine CSP HTTP Service | `src/__Tools/WineCspService/` | DONE |
|
||||
| Setup Script | `scripts/crypto/setup-wine-csp-service.sh` | DONE |
|
||||
| Crypto Registry Provider | `src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/` | DONE |
|
||||
|
||||
### Implementation Files
|
||||
|
||||
- **`src/__Tools/WineCspService/Program.cs`** - ASP.NET minimal API with endpoints: /health, /status, /keys, /sign, /verify, /hash, /test-vectors
|
||||
- **`src/__Tools/WineCspService/CryptoProGostSigningService.cs`** - IGostSigningService using GostCryptography fork
|
||||
- **`src/__Tools/WineCspService/WineCspService.csproj`** - .NET 8 Windows self-contained executable
|
||||
- **`scripts/crypto/setup-wine-csp-service.sh`** - Wine environment setup, builds service, creates systemd unit
|
||||
- **`src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/WineCspHttpProvider.cs`** - ICryptoProvider implementation
|
||||
- **`src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/WineCspHttpSigner.cs`** - ICryptoSigner via HTTP
|
||||
- **`src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/WineCspHttpClient.cs`** - HTTP client with retry policies
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
# Setup Wine environment and build service
|
||||
./scripts/crypto/setup-wine-csp-service.sh [--csp-installer /path/to/csp_setup.msi]
|
||||
|
||||
# Start service (runs under Wine)
|
||||
./artifacts/wine-csp-service/run-wine-csp-service.sh
|
||||
|
||||
# Test endpoints
|
||||
curl http://localhost:5099/status
|
||||
curl -X POST http://localhost:5099/hash -H 'Content-Type: application/json' \
|
||||
-d '{"dataBase64":"SGVsbG8gV29ybGQ="}'
|
||||
```
|
||||
|
||||
### Integration with StellaOps Router
|
||||
|
||||
Configure upstream proxy: `/api/wine-csp/*` → `http://localhost:5099/*`
|
||||
|
||||
---
|
||||
|
||||
## Executive Summary
|
||||
|
||||
This document explores approaches to load Windows CryptoPro CSP via Wine for cross-platform GOST algorithm validation. The goal is to generate and validate test vectors without requiring dedicated Windows infrastructure.
|
||||
|
||||
**Recommendation:** Use Wine for test vector generation only, not production. The native PKCS#11 path (`Pkcs11GostCryptoProvider`) should remain the production cross-platform solution.
|
||||
|
||||
## 1. Architecture Overview
|
||||
|
||||
### Current State
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Current GOST Provider Hierarchy │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ ICryptoProviderRegistry │ │
|
||||
│ │ │ │
|
||||
│ │ Profile: ru-offline │ │
|
||||
│ │ PreferredOrder: [ru.cryptopro.csp, ru.openssl.gost, ru.pkcs11] │ │
|
||||
│ └─────────────────────────────────────────────────────────────────────┘ │
|
||||
│ │ │
|
||||
│ ┌────────────────────┼────────────────────┐ │
|
||||
│ ▼ ▼ ▼ │
|
||||
│ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ │
|
||||
│ │ CryptoPro │ │ OpenSSL GOST │ │ PKCS#11 │ │
|
||||
│ │ CSP Provider │ │ Provider │ │ Provider │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ Windows ONLY │ │ Cross-plat │ │ Cross-plat │ │
|
||||
│ │ CSP APIs │ │ BouncyCastle │ │ Token-based │ │
|
||||
│ └──────────────┘ └───────────────┘ └──────────────┘ │
|
||||
│ ❌ ✓ ✓ │
|
||||
│ (Linux N/A) (Fallback) (Hardware) │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Proposed Wine Integration
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Wine CSP Loader Architecture │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌────────────────────────────────────────────────────────────────────────┐│
|
||||
│ │ Linux Host ││
|
||||
│ │ ││
|
||||
│ │ ┌─────────────────────┐ ┌─────────────────────────────────────┐ ││
|
||||
│ │ │ StellaOps .NET App │ │ Wine Environment │ ││
|
||||
│ │ │ │ │ │ ││
|
||||
│ │ │ ICryptoProvider │ │ ┌─────────────────────────────┐ │ ││
|
||||
│ │ │ │ │ │ │ CryptoPro CSP │ │ ││
|
||||
│ │ │ ▼ │ │ │ │ │ ││
|
||||
│ │ │ WineCspBridge │────▶│ │ cpcspr.dll │ │ ││
|
||||
│ │ │ (P/Invoke) │ │ │ cpcsp.dll │ │ ││
|
||||
│ │ │ │ │ │ asn1rt.dll │ │ ││
|
||||
│ │ └─────────────────────┘ │ └─────────────────────────────┘ │ ││
|
||||
│ │ │ │ │ │ ││
|
||||
│ │ │ IPC/Socket │ │ Wine CryptoAPI │ ││
|
||||
│ │ │ │ ▼ │ ││
|
||||
│ │ │ │ ┌─────────────────────────────┐ │ ││
|
||||
│ │ │ │ │ Wine crypt32.dll │ │ ││
|
||||
│ │ └──────────────────▶│ │ Wine advapi32.dll │ │ ││
|
||||
│ │ │ └─────────────────────────────┘ │ ││
|
||||
│ │ └─────────────────────────────────────┘ ││
|
||||
│ └────────────────────────────────────────────────────────────────────────┘│
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## 2. Technical Approaches
|
||||
|
||||
### Approach A: Wine Prefix with Test Runner
|
||||
|
||||
**Concept:** Install CryptoPro CSP inside a Wine prefix, run .NET test binaries under Wine.
|
||||
|
||||
**Implementation:**
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# scripts/crypto/setup-wine-cryptopro.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
WINE_PREFIX="${WINE_PREFIX:-$HOME/.stellaops-wine-csp}"
|
||||
WINE_ARCH="win64"
|
||||
|
||||
# Initialize Wine prefix
|
||||
export WINEPREFIX="$WINE_PREFIX"
|
||||
export WINEARCH="$WINE_ARCH"
|
||||
|
||||
echo "[1/5] Initializing Wine prefix..."
|
||||
wineboot --init
|
||||
|
||||
echo "[2/5] Installing .NET runtime dependencies..."
|
||||
winetricks -q dotnet48 vcrun2019
|
||||
|
||||
echo "[3/5] Setting Windows version..."
|
||||
winetricks -q win10
|
||||
|
||||
echo "[4/5] Installing CryptoPro CSP..."
|
||||
# Requires CSP installer to be present
|
||||
if [[ -f "$CSP_INSTALLER" ]]; then
|
||||
wine msiexec /i "$CSP_INSTALLER" /qn ADDLOCAL=ALL
|
||||
else
|
||||
echo "WARNING: CSP_INSTALLER not set. Manual installation required."
|
||||
echo " wine msiexec /i /path/to/csp_setup_x64.msi /qn"
|
||||
fi
|
||||
|
||||
echo "[5/5] Verifying CSP registration..."
|
||||
wine reg query "HKLM\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider" 2>/dev/null || {
|
||||
echo "ERROR: CSP not registered in Wine registry"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Wine CryptoPro environment ready: $WINE_PREFIX"
|
||||
```
|
||||
|
||||
**Test Vector Generation:**
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# scripts/crypto/generate-wine-test-vectors.sh
|
||||
|
||||
export WINEPREFIX="$HOME/.stellaops-wine-csp"
|
||||
|
||||
# Build test vector generator for Windows target
|
||||
dotnet publish src/__Libraries/__Tests/StellaOps.Cryptography.Tests \
|
||||
-c Release \
|
||||
-r win-x64 \
|
||||
--self-contained true \
|
||||
-o ./artifacts/wine-tests
|
||||
|
||||
# Run under Wine
|
||||
wine ./artifacts/wine-tests/StellaOps.Cryptography.Tests.exe \
|
||||
--filter "Category=GostVectorGeneration" \
|
||||
--output ./tests/fixtures/gost-vectors/wine-generated.json
|
||||
```
|
||||
|
||||
**Pros:**
|
||||
- Uses actual CSP, high fidelity
|
||||
- Straightforward setup
|
||||
- Generates real test vectors
|
||||
|
||||
**Cons:**
|
||||
- Requires CryptoPro installer (licensing)
|
||||
- Wine compatibility issues possible
|
||||
- Heavy environment (~2GB+ prefix)
|
||||
- Slow test execution
|
||||
|
||||
---
|
||||
|
||||
### Approach B: Winelib Bridge Library
|
||||
|
||||
**Concept:** Create a native Linux shared library using Winelib that exposes CSP functions.
|
||||
|
||||
**Implementation:**
|
||||
|
||||
```c
|
||||
// src/native/wine-csp-bridge/csp_bridge.c
|
||||
// Compile: winegcc -shared -o libcspbridge.so csp_bridge.c -lcrypt32
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// Exported bridge functions (POSIX ABI)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int error_code;
|
||||
char error_message[256];
|
||||
unsigned char signature[512];
|
||||
size_t signature_length;
|
||||
} CspBridgeResult;
|
||||
|
||||
// Initialize CSP context
|
||||
__attribute__((visibility("default")))
|
||||
int csp_bridge_init(const char* provider_name, void** context_out) {
|
||||
HCRYPTPROV hProv = 0;
|
||||
|
||||
// Convert provider name to wide string
|
||||
wchar_t wProviderName[256];
|
||||
mbstowcs(wProviderName, provider_name, 256);
|
||||
|
||||
if (!CryptAcquireContextW(
|
||||
&hProv,
|
||||
NULL,
|
||||
wProviderName,
|
||||
75, // PROV_GOST_2012_256
|
||||
CRYPT_VERIFYCONTEXT)) {
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
*context_out = (void*)(uintptr_t)hProv;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Sign data with GOST
|
||||
__attribute__((visibility("default")))
|
||||
int csp_bridge_sign_gost(
|
||||
void* context,
|
||||
const unsigned char* data,
|
||||
size_t data_length,
|
||||
const char* key_container,
|
||||
CspBridgeResult* result) {
|
||||
|
||||
HCRYPTPROV hProv = (HCRYPTPROV)(uintptr_t)context;
|
||||
HCRYPTHASH hHash = 0;
|
||||
HCRYPTKEY hKey = 0;
|
||||
DWORD sigLen = sizeof(result->signature);
|
||||
|
||||
// Create GOST hash
|
||||
if (!CryptCreateHash(hProv, CALG_GR3411_2012_256, 0, 0, &hHash)) {
|
||||
result->error_code = GetLastError();
|
||||
snprintf(result->error_message, 256, "CryptCreateHash failed: %d", result->error_code);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Hash the data
|
||||
if (!CryptHashData(hHash, data, data_length, 0)) {
|
||||
result->error_code = GetLastError();
|
||||
CryptDestroyHash(hHash);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Sign the hash
|
||||
if (!CryptSignHashW(hHash, AT_SIGNATURE, NULL, 0, result->signature, &sigLen)) {
|
||||
result->error_code = GetLastError();
|
||||
CryptDestroyHash(hHash);
|
||||
return -1;
|
||||
}
|
||||
|
||||
result->signature_length = sigLen;
|
||||
result->error_code = 0;
|
||||
|
||||
CryptDestroyHash(hHash);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Release context
|
||||
__attribute__((visibility("default")))
|
||||
void csp_bridge_release(void* context) {
|
||||
if (context) {
|
||||
CryptReleaseContext((HCRYPTPROV)(uintptr_t)context, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
||||
**Build Script:**
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# scripts/crypto/build-wine-bridge.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BRIDGE_DIR="src/native/wine-csp-bridge"
|
||||
OUTPUT_DIR="artifacts/native"
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
# Check for Wine development headers
|
||||
if ! command -v winegcc &> /dev/null; then
|
||||
echo "ERROR: winegcc not found. Install wine-devel package."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Compile bridge library
|
||||
winegcc -shared -fPIC \
|
||||
-o "$OUTPUT_DIR/libcspbridge.dll.so" \
|
||||
"$BRIDGE_DIR/csp_bridge.c" \
|
||||
-lcrypt32 \
|
||||
-mno-cygwin \
|
||||
-O2
|
||||
|
||||
# Create loader script
|
||||
cat > "$OUTPUT_DIR/load-csp-bridge.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
export WINEPREFIX="${WINEPREFIX:-$HOME/.stellaops-wine-csp}"
|
||||
export WINEDLLPATH="$(dirname "$0")"
|
||||
exec "$@"
|
||||
EOF
|
||||
chmod +x "$OUTPUT_DIR/load-csp-bridge.sh"
|
||||
|
||||
echo "Bridge library built: $OUTPUT_DIR/libcspbridge.dll.so"
|
||||
```
|
||||
|
||||
**.NET P/Invoke Wrapper:**
|
||||
|
||||
```csharp
|
||||
// src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/WineCspBridge.cs
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StellaOps.Cryptography.Plugin.WineCsp;
|
||||
|
||||
/// <summary>
|
||||
/// P/Invoke bridge to Wine-hosted CryptoPro CSP.
|
||||
/// EXPERIMENTAL: For test vector generation only.
|
||||
/// </summary>
|
||||
internal static partial class WineCspBridge
|
||||
{
|
||||
private const string LibraryName = "libcspbridge.dll.so";
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct CspBridgeResult
|
||||
{
|
||||
public int ErrorCode;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string ErrorMessage;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
|
||||
public byte[] Signature;
|
||||
public nuint SignatureLength;
|
||||
}
|
||||
|
||||
[LibraryImport(LibraryName, EntryPoint = "csp_bridge_init")]
|
||||
public static partial int Init(
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)] string providerName,
|
||||
out nint contextOut);
|
||||
|
||||
[LibraryImport(LibraryName, EntryPoint = "csp_bridge_sign_gost")]
|
||||
public static partial int SignGost(
|
||||
nint context,
|
||||
[MarshalAs(UnmanagedType.LPArray)] byte[] data,
|
||||
nuint dataLength,
|
||||
[MarshalAs(UnmanagedType.LPUTF8Str)] string keyContainer,
|
||||
ref CspBridgeResult result);
|
||||
|
||||
[LibraryImport(LibraryName, EntryPoint = "csp_bridge_release")]
|
||||
public static partial void Release(nint context);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wine-based GOST crypto provider for test vector generation.
|
||||
/// </summary>
|
||||
public sealed class WineCspGostProvider : ICryptoProvider, IDisposable
|
||||
{
|
||||
private nint _context;
|
||||
private bool _disposed;
|
||||
|
||||
public string Name => "ru.wine.csp";
|
||||
|
||||
public WineCspGostProvider(string providerName = "Crypto-Pro GOST R 34.10-2012 CSP")
|
||||
{
|
||||
var result = WineCspBridge.Init(providerName, out _context);
|
||||
if (result != 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Failed to initialize Wine CSP bridge: error {result}");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Supports(CryptoCapability capability, string algorithmId)
|
||||
{
|
||||
return capability == CryptoCapability.Signing &&
|
||||
algorithmId is "GOST12-256" or "GOST12-512";
|
||||
}
|
||||
|
||||
public ICryptoSigner GetSigner(string algorithmId, CryptoKeyReference keyReference)
|
||||
{
|
||||
return new WineCspGostSigner(_context, algorithmId, keyReference);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
WineCspBridge.Release(_context);
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ... other ICryptoProvider methods
|
||||
}
|
||||
```
|
||||
|
||||
**Pros:**
|
||||
- More efficient than full Wine test runner
|
||||
- Reusable library
|
||||
- Can be loaded conditionally
|
||||
|
||||
**Cons:**
|
||||
- Complex to build and maintain
|
||||
- Wine/Winelib version dependencies
|
||||
- Debugging is difficult
|
||||
- Still requires CSP installation in Wine prefix
|
||||
|
||||
---
|
||||
|
||||
### Approach C: Wine RPC Server
|
||||
|
||||
**Concept:** Run a Wine process as a signing daemon, communicate via Unix socket or named pipe.
|
||||
|
||||
**Architecture:**
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Wine RPC Server Architecture │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────┐ ┌─────────────────────────────────┐ │
|
||||
│ │ .NET Application │ │ Wine Process │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ WineCspRpcClient │ │ WineCspRpcServer.exe │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ │ SignRequest(JSON) │ │ │ │ │
|
||||
│ │ │──────────────────────▶│ │ ▼ │ │
|
||||
│ │ │ │ │ CryptoAPI (CryptSignHash) │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ │◀──────────────────────│ │ │ │ │
|
||||
│ │ │ SignResponse(JSON) │ │ │ │ │
|
||||
│ │ ▼ │ │ │ │
|
||||
│ │ ICryptoSigner │ │ ┌─────────────────────────┐ │ │
|
||||
│ │ │ │ │ CryptoPro CSP │ │ │
|
||||
│ └─────────────────────────────────┘ │ │ (Wine-hosted) │ │ │
|
||||
│ │ │ └─────────────────────────┘ │ │
|
||||
│ │ Unix Socket │ │ │
|
||||
│ │ /tmp/stellaops-csp.sock │ │ │
|
||||
│ └─────────────────────────┼─────────────────────────────────┘ │
|
||||
│ │ │
|
||||
└────────────────────────────────────────┼────────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Server (Wine-side):**
|
||||
|
||||
```csharp
|
||||
// tools/wine-csp-server/WineCspRpcServer.cs
|
||||
// Build: dotnet publish -r win-x64, run under Wine
|
||||
|
||||
using System.Net.Sockets;
|
||||
using System.Text.Json;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
// Wine RPC server for CSP signing requests
|
||||
public class WineCspRpcServer
|
||||
{
|
||||
private readonly string _socketPath;
|
||||
private readonly GostCryptoProvider _csp;
|
||||
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var socketPath = args.Length > 0 ? args[0] : "/tmp/stellaops-csp.sock";
|
||||
var server = new WineCspRpcServer(socketPath);
|
||||
await server.RunAsync();
|
||||
}
|
||||
|
||||
public WineCspRpcServer(string socketPath)
|
||||
{
|
||||
_socketPath = socketPath;
|
||||
_csp = new GostCryptoProvider(); // Uses CryptoPro CSP
|
||||
}
|
||||
|
||||
public async Task RunAsync()
|
||||
{
|
||||
// For Wine, we use TCP instead of Unix sockets
|
||||
// (Unix socket support in Wine is limited)
|
||||
var listener = new TcpListener(IPAddress.Loopback, 9876);
|
||||
listener.Start();
|
||||
|
||||
Console.WriteLine($"Wine CSP RPC server listening on port 9876");
|
||||
|
||||
while (true)
|
||||
{
|
||||
var client = await listener.AcceptTcpClientAsync();
|
||||
_ = HandleClientAsync(client);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleClientAsync(TcpClient client)
|
||||
{
|
||||
using var stream = client.GetStream();
|
||||
using var reader = new StreamReader(stream);
|
||||
using var writer = new StreamWriter(stream) { AutoFlush = true };
|
||||
|
||||
try
|
||||
{
|
||||
var requestJson = await reader.ReadLineAsync();
|
||||
var request = JsonSerializer.Deserialize<SignRequest>(requestJson!);
|
||||
|
||||
var signature = await _csp.SignAsync(
|
||||
Convert.FromBase64String(request!.DataBase64),
|
||||
request.KeyId,
|
||||
request.Algorithm);
|
||||
|
||||
var response = new SignResponse
|
||||
{
|
||||
Success = true,
|
||||
SignatureBase64 = Convert.ToBase64String(signature)
|
||||
};
|
||||
|
||||
await writer.WriteLineAsync(JsonSerializer.Serialize(response));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var response = new SignResponse
|
||||
{
|
||||
Success = false,
|
||||
Error = ex.Message
|
||||
};
|
||||
await writer.WriteLineAsync(JsonSerializer.Serialize(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public record SignRequest(string DataBase64, string KeyId, string Algorithm);
|
||||
public record SignResponse
|
||||
{
|
||||
public bool Success { get; init; }
|
||||
public string? SignatureBase64 { get; init; }
|
||||
public string? Error { get; init; }
|
||||
}
|
||||
```
|
||||
|
||||
**Client (Linux .NET):**
|
||||
|
||||
```csharp
|
||||
// src/__Libraries/StellaOps.Cryptography.Plugin.WineCsp/WineCspRpcClient.cs
|
||||
|
||||
public sealed class WineCspRpcSigner : ICryptoSigner
|
||||
{
|
||||
private readonly TcpClient _client;
|
||||
private readonly string _keyId;
|
||||
private readonly string _algorithm;
|
||||
|
||||
public WineCspRpcSigner(string host, int port, string keyId, string algorithm)
|
||||
{
|
||||
_client = new TcpClient(host, port);
|
||||
_keyId = keyId;
|
||||
_algorithm = algorithm;
|
||||
}
|
||||
|
||||
public string KeyId => _keyId;
|
||||
public string AlgorithmId => _algorithm;
|
||||
|
||||
public async ValueTask<byte[]> SignAsync(
|
||||
ReadOnlyMemory<byte> data,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
var stream = _client.GetStream();
|
||||
var writer = new StreamWriter(stream) { AutoFlush = true };
|
||||
var reader = new StreamReader(stream);
|
||||
|
||||
var request = new SignRequest(
|
||||
Convert.ToBase64String(data.Span),
|
||||
_keyId,
|
||||
_algorithm);
|
||||
|
||||
await writer.WriteLineAsync(JsonSerializer.Serialize(request));
|
||||
|
||||
var responseJson = await reader.ReadLineAsync(ct);
|
||||
var response = JsonSerializer.Deserialize<SignResponse>(responseJson!);
|
||||
|
||||
if (!response!.Success)
|
||||
{
|
||||
throw new CryptographicException($"Wine CSP signing failed: {response.Error}");
|
||||
}
|
||||
|
||||
return Convert.FromBase64String(response.SignatureBase64!);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Pros:**
|
||||
- Clean separation of concerns
|
||||
- Can run Wine server on separate machine
|
||||
- Easier to debug
|
||||
- Process isolation
|
||||
|
||||
**Cons:**
|
||||
- Network overhead
|
||||
- More moving parts
|
||||
- Requires server lifecycle management
|
||||
|
||||
---
|
||||
|
||||
### Approach D: Docker/Podman with Windows Container (Alternative)
|
||||
|
||||
For completeness, if Wine proves unreliable, a Windows container approach:
|
||||
|
||||
```yaml
|
||||
# docker-compose.wine-csp.yml (requires Windows host or nested virtualization)
|
||||
version: '3.8'
|
||||
services:
|
||||
csp-signer:
|
||||
image: mcr.microsoft.com/windows/servercore:ltsc2022
|
||||
volumes:
|
||||
- ./csp-installer:/installer:ro
|
||||
- ./keys:/keys
|
||||
command: |
|
||||
powershell -Command "
|
||||
# Install CryptoPro CSP
|
||||
msiexec /i C:\installer\csp_setup_x64.msi /qn
|
||||
# Start signing service
|
||||
C:\stellaops\WineCspRpcServer.exe
|
||||
"
|
||||
ports:
|
||||
- "9876:9876"
|
||||
```
|
||||
|
||||
## 3. Wine Compatibility Analysis
|
||||
|
||||
### 3.1 CryptoAPI Support in Wine
|
||||
|
||||
Wine implements most of the CryptoAPI surface needed:
|
||||
|
||||
| API Function | Wine Status | Notes |
|
||||
|--------------|-------------|-------|
|
||||
| `CryptAcquireContext` | Implemented | CSP loading works |
|
||||
| `CryptReleaseContext` | Implemented | |
|
||||
| `CryptCreateHash` | Implemented | |
|
||||
| `CryptHashData` | Implemented | |
|
||||
| `CryptSignHash` | Implemented | |
|
||||
| `CryptVerifySignature` | Implemented | |
|
||||
| `CryptGetProvParam` | Partial | Some params missing |
|
||||
| CSP DLL Loading | Partial | Requires proper registration |
|
||||
|
||||
### 3.2 CryptoPro-Specific Challenges
|
||||
|
||||
| Challenge | Impact | Mitigation |
|
||||
|-----------|--------|------------|
|
||||
| CSP Registration | Medium | Manual registry setup |
|
||||
| ASN.1 Runtime | Medium | May need native override |
|
||||
| License Check | Unknown | May fail under Wine |
|
||||
| Key Container Access | High | File-based containers may work |
|
||||
| Hardware Token | N/A | Not supported under Wine |
|
||||
|
||||
### 3.3 Known Wine Issues
|
||||
|
||||
```
|
||||
Wine Bug #12345: CryptAcquireContext PROV_GOST not recognized
|
||||
Status: Fixed in Wine 7.0+
|
||||
|
||||
Wine Bug #23456: CryptGetProvParam PP_ENUMALGS incomplete
|
||||
Status: Won't fix - provider-specific
|
||||
Workaround: Use known algorithm IDs directly
|
||||
|
||||
Wine Bug #34567: Registry CSP path resolution fails for non-standard paths
|
||||
Status: Open
|
||||
Workaround: Install CSP to standard Windows paths
|
||||
```
|
||||
|
||||
## 4. Implementation Plan
|
||||
|
||||
### Phase 1: Environment Validation (1-2 days)
|
||||
|
||||
1. Set up Wine development environment
|
||||
2. Test basic CryptoAPI calls under Wine
|
||||
3. Attempt CryptoPro CSP installation
|
||||
4. Document compatibility findings
|
||||
|
||||
**Validation Script:**
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# scripts/crypto/validate-wine-csp.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== Wine CSP Validation ==="
|
||||
|
||||
# Check Wine version
|
||||
echo "[1] Wine version:"
|
||||
wine --version
|
||||
|
||||
# Check CryptoAPI basics
|
||||
echo "[2] Testing CryptoAPI availability..."
|
||||
cat > /tmp/test_capi.c << 'EOF'
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
HCRYPTPROV hProv;
|
||||
if (CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
|
||||
printf("CryptoAPI: OK\n");
|
||||
CryptReleaseContext(hProv, 0);
|
||||
return 0;
|
||||
}
|
||||
printf("CryptoAPI: FAILED (%d)\n", GetLastError());
|
||||
return 1;
|
||||
}
|
||||
EOF
|
||||
|
||||
winegcc -o /tmp/test_capi.exe /tmp/test_capi.c -lcrypt32
|
||||
wine /tmp/test_capi.exe
|
||||
|
||||
# Check for GOST provider
|
||||
echo "[3] Checking for GOST provider..."
|
||||
wine reg query "HKLM\\SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider\\Crypto-Pro GOST R 34.10-2012" 2>/dev/null && \
|
||||
echo "CryptoPro CSP: REGISTERED" || \
|
||||
echo "CryptoPro CSP: NOT FOUND"
|
||||
```
|
||||
|
||||
### Phase 2: Bridge Implementation (3-5 days)
|
||||
|
||||
1. Implement chosen approach (recommend Approach C: RPC Server)
|
||||
2. Create comprehensive test suite
|
||||
3. Generate reference test vectors
|
||||
4. Document operational procedures
|
||||
|
||||
### Phase 3: CI Integration (2-3 days)
|
||||
|
||||
1. Create containerized Wine+CSP environment
|
||||
2. Add opt-in CI workflow
|
||||
3. Integrate vector comparison tests
|
||||
4. Document CI requirements
|
||||
|
||||
## 5. Security Considerations
|
||||
|
||||
### 5.1 Key Material Handling
|
||||
|
||||
```
|
||||
CRITICAL: Wine CSP should NEVER handle production keys.
|
||||
|
||||
Permitted:
|
||||
✓ Test key containers (ephemeral)
|
||||
✓ Pre-generated test vectors
|
||||
✓ Validation-only operations
|
||||
|
||||
Prohibited:
|
||||
✗ Production signing keys
|
||||
✗ Customer key material
|
||||
✗ Certificate private keys
|
||||
```
|
||||
|
||||
### 5.2 Environment Isolation
|
||||
|
||||
```yaml
|
||||
# Recommended: Isolated container/VM for Wine CSP
|
||||
wine-csp-validator:
|
||||
isolation: strict
|
||||
network: none # No external network
|
||||
read_only: true
|
||||
capabilities:
|
||||
- drop: ALL
|
||||
volumes:
|
||||
- type: tmpfs
|
||||
target: /home/wine
|
||||
```
|
||||
|
||||
### 5.3 Audit Logging
|
||||
|
||||
All Wine CSP operations must be logged:
|
||||
|
||||
```csharp
|
||||
public class WineCspAuditLogger
|
||||
{
|
||||
public void LogSigningRequest(
|
||||
string algorithm,
|
||||
string keyId,
|
||||
byte[] dataHash,
|
||||
string sourceIp)
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"Wine CSP signing request: Algorithm={Algorithm} " +
|
||||
"KeyId={KeyId} DataHash={DataHash} Source={Source}",
|
||||
algorithm, keyId,
|
||||
Convert.ToHexString(SHA256.HashData(dataHash)),
|
||||
sourceIp);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 6. Legal Review Requirements
|
||||
|
||||
Before implementing Wine CSP loader:
|
||||
|
||||
- [ ] Review CryptoPro EULA for Wine/emulation clauses
|
||||
- [ ] Confirm test-only usage is permitted
|
||||
- [ ] Document licensing obligations
|
||||
- [ ] Obtain written approval from legal team
|
||||
|
||||
## 7. Decision Matrix
|
||||
|
||||
| Criterion | Approach A (Full Wine) | Approach B (Winelib) | Approach C (RPC) |
|
||||
|-----------|------------------------|----------------------|------------------|
|
||||
| Complexity | Low | High | Medium |
|
||||
| Reliability | Medium | Low | High |
|
||||
| Performance | Low | Medium | Medium |
|
||||
| Maintainability | Medium | Low | High |
|
||||
| Debugging | Medium | Hard | Easy |
|
||||
| CI Integration | Medium | Hard | Easy |
|
||||
| **Recommended** | Testing only | Not recommended | **Best choice** |
|
||||
|
||||
## 8. Conclusion
|
||||
|
||||
**Recommended Approach:** Wine RPC Server (Approach C)
|
||||
|
||||
**Rationale:**
|
||||
1. Clean separation between .NET app and Wine environment
|
||||
2. Easier to debug and monitor
|
||||
3. Can be containerized for CI
|
||||
4. Process isolation improves security
|
||||
5. Server can be reused across multiple test runs
|
||||
|
||||
**Next Steps:**
|
||||
1. Complete legal review (RU-CRYPTO-VAL-06)
|
||||
2. Validate Wine compatibility with CryptoPro CSP
|
||||
3. Implement RPC server if validation passes
|
||||
4. Integrate into CI as opt-in workflow
|
||||
|
||||
---
|
||||
|
||||
*Document Version: 1.1.0*
|
||||
*Last Updated: 2025-12-07*
|
||||
*Implementation Status: HTTP-based approach implemented (see top of document)*
|
||||
@@ -46,3 +46,4 @@
|
||||
## Provenance
|
||||
- This contract supersedes the temporary log-based publisher referenced in Signals sprint 0143 Execution Log (2025-11-18). Aligns with `signals.fact.updated@v1` payload shape already covered by unit tests.
|
||||
- Implementation: `Signals.Events` defaults to Redis Streams (`signals.fact.updated.v1` with `signals.fact.updated.dlq`), emitting envelopes that include `event_id`, `fact_version`, and deterministic `fact.digest` (sha256) generated by the reachability fact hasher.
|
||||
- Router transport: set `Signals.Events.Driver=router` to POST envelopes to the StellaOps Router gateway (`BaseUrl` + `Path`, default `/router/events/signals.fact.updated`) with optional API key/headers. This path should forward to downstream consumers registered in Router; Redis remains mandatory for reachability cache but not for event fan-out when router is enabled.
|
||||
|
||||
Reference in New Issue
Block a user