3.3 KiB
P00-02: Windows Credential Manager
- Status: Passed on the audited Windows host
- Date recorded: 2026-07-18
- MVP gate: Required before storing any AstrBot or NAS credential
Objective
Verify create, read, update, and delete operations for a test-only generic credential while keeping the secret value inside Rust and outside React, ordinary SQLite fields, logs, snapshots, and repository files.
Environment
- Host: Windows 11 x64
- Secure store target: Windows Credential Manager
- Rust toolchain: rustc/cargo 1.97.1
- MSVC C++ build tools: verified by Rust and Tauri native builds
- Administrative elevation: not permitted or required
Minimal validation implementation
The Spike is expected to expose typed Rust operations that accept a logical credential reference and return metadata or an opaque reference. Secret bytes must use bounded lifetimes and must not implement debug output that reveals their value.
React may request save, replace, existence, and delete operations, but a read operation must not return the credential value across Tauri IPC.
Required execution
- Create a uniquely named test-only credential containing a fake generated value.
- Read it in Rust and compare without printing the value.
- Replace it and confirm the old value is no longer returned.
- Delete it and confirm a structured not-found result.
- Verify missing, denied, oversized, and malformed-reference error paths.
- Scan application logs, frontend state, SQLite data, snapshots, and terminal output for the fake value.
- Confirm the test credential is removed at the end.
Actual execution result
Passed. The Windows-only Rust test created a uniquely named generic credential containing a generated fake value, read it inside Rust, replaced it, confirmed the replacement, deleted it, and confirmed the deleted value was unavailable. The cleanup path ran even when an assertion would fail, and a post-run check found no remaining test credential.
Reference and size validation tests cover empty, malformed, and oversized inputs before native access. The public secure-store surface returns metadata or an opaque reference; it does not expose the secret through Tauri IPC or React.
The workspace secret scan reported only the security-rule example in AGENTS.md and deliberate fake redaction fixtures. No real credential, Authorization header, private key, or NAS secret was found.
Log summary
Command: cargo test --workspace on Windows, including the Credential Manager CRUD test. Result: passed. Terminal output contained only test names and result categories; the generated fake secret was never printed.
Known limitations
- Windows Credential Manager behavior cannot be certified by Linux CI.
- Locked sessions, policy restrictions, roaming behavior, and credential-size limits still require Windows tests.
- NAS authentication integration is outside this isolated CRUD Spike.
Security impact
Failure would block all authenticated AstrBot and NAS connections. Falling back to plaintext configuration, SQLite, environment files, or logs is prohibited.
Recommendation
Use the Windows-native credential APIs behind a narrow Rust trait. Persist only a credential reference. Treat inability to access secure storage as an explicit user-visible error rather than a reason to weaken storage.