openVault replaces the old static vault key with a time-limited session key. The operator authenticates once via TOTP (an authenticator app on phone). Agents read VAULT_KEY from environment; the shell profile fetches it from openVault at startup. After 10 hours the session expires and the operator re-authenticates.
When opening a new shell, you'll always be in one of three states.
Less than 10 hours since the last TOTP unlock. VAULT_KEY auto-loads in any new shell. Nothing to do.
Confirm:
python C:\Users\ctgau\library\0-system\security\dev\openVault.py status
Expected output: Session: ACTIVE -- Xh remaining
Past the 10-hour mark. Service is fine, just re-authenticate. Open the authenticator app, grab the 6-digit code, then run:
curl -X POST http://127.0.0.1:8200/unlock ^
-H "Content-Type: application/json" ^
-d "{\"totp\":\"<6-digits>\"}"
New shells will then pull VAULT_KEY cleanly on startup.
The service is not under autostart yet. After a reboot, relaunch it in a terminal you can leave running:
python C:\Users\ctgau\library\0-system\security\dev\openVault.py serve
Then run the STATE 2 unlock command to authenticate.
Open a fresh shell. Behavior tells you the state:
| What you see | State |
|---|---|
| silent (no openVault output) | STATE 1 -- $env:VAULT_KEY populated |
[openVault] locked or unreachable | STATE 2 or 3 -- run unlock or serve |
+----------------------+
| authenticator app | (operator's phone)
+----------+-----------+
| TOTP 6-digit code
v
+----------------------+
| openVault service | 127.0.0.1:8200 on Rocky
| python script | 10-hour session
+----------+-----------+
| GET /master-key
v
+----------------------+
| shell profile | PowerShell + bash
| fetches VAULT_KEY | on every new shell
+----------+-----------+
| sets $env:VAULT_KEY
v
+----------------------+
| agent session |
| uses VAULT_KEY to |
| call vault API | questboard-ec2:8120
+----------------------+
library\0-system\security\openVault-onepager.mdlibrary\0-system\security\architecture\openVault-spec.mdlibrary\0-system\security\dev\openVault.py~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1~\.bashrc