feat(auth): Phase 5 — PEM cleanup and security-check commands
muse auth cleanup-keys - Overwrites each ~/.muse/keys/*.pem with os.urandom bytes of equal length, fsyncs, then unlinks — no key material survives on disk - JSON: {destroyed: [...paths], count: N}
muse auth security-check - Four invariant checks: mnemonic in keychain, no PEM files, no key_path in identity.toml, fingerprint matches mnemonic derivation - Exits 1 if any check fails; JSON output for agent consumption - Ran on real identity: 6 stale PEM files destroyed; localhost:10003 and staging.musehub.ai entries flagged (pre-migration, will fix on re-register)
Doc: mark Phases 1-4 complete, Phase 5 in progress → now implemented Tests: 10 new tests (C1-C5, S1-S5) all green
sha256:a1157e1c48b653cabd6ebc9d43abbc7464ea0fc74413e1921c896ad45eb7e9df
sha
+65
~1
symbols
sha256:91938e39dee1e92dd0dc845984da194b0d371018a196aa56d3dd5ad7abdde909
snapshot
+65
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes
66 symbols
+
Key Material Security Audit — Muse + MuseHub
section Key Material Security Audit — Muse + MuseHub L1–256
+
Phase 1 — Fix the Mnemonic Keychain Key (C3) ✅ COMPLETE
section Phase 1 — Fix the Mnemonic Keychain Key (C3) ✅ COMPLETE L132–143
+
Phase 2 — Derive and Sign in Memory (C1, C2, H1) ✅ COMPLETE
section Phase 2 — Derive and Sign in Memory (C1, C2, H1) ✅ COMPLETE L143–166
+
toml Schema (C4) ✅ COMPLETE
section Phase 3 — Remove key_path from identity.toml Schema (C4) ✅ COMPLETE L166–176
+
py CLI Commands (H2, H4) ✅ COMPLETE
section Phase 4 — Update auth.py CLI Commands (H2, H4) ✅ COMPLETE L176–187
+
Phase 5 — Orphan PEM Cleanup 🔴 IN PROGRESS
section Phase 5 — Orphan PEM Cleanup 🔴 IN PROGRESS L187–203
+
Phase 6 — DerivedKey Zeroing Hardening (M1, M2)
section Phase 6 — DerivedKey Zeroing Hardening (M1, M2) L203–212
+
Phase 7 — MuseHub Server Audit (already clean, verify)
section Phase 7 — MuseHub Server Audit (already clean, verify) L212–223
+
test_C2_json_output_lists_destroyed_paths
method
method test_C2_json_output_lists_destroyed_paths L100–114
+
test_C4_pem_content_is_overwritten_before_deletion
method
method test_C4_pem_content_is_overwritten_before_deletion L127–152
+
test_S1_all_checks_pass_after_clean_keygen_register
method
method test_S1_all_checks_pass_after_clean_keygen_register L176–193
+
test_S3_fails_when_key_path_in_identity
method
method test_S3_fails_when_key_path_in_identity L214–234
+
test_S4_fails_when_fingerprint_mismatches
method
method test_S4_fails_when_fingerprint_mismatches L236–255
+
test_S5_fails_when_no_mnemonic_in_keychain
method
method test_S5_fails_when_no_mnemonic_in_keychain L257–272
~
register
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:a1157e1c48b653cabd6ebc9d43abbc7464ea0fc74413e1921c896ad45eb7e9df --body "your comment"
No comments yet. Be the first to start the discussion.