Implement role-aware HTTPS and SSH authentication
This commit is contained in:
@@ -269,6 +269,42 @@ Because NVS is not yet encrypted, this test validates logical verifier storage r
|
||||
|
||||
With the maximum supported mix of USB CDC, WebSocket, and SSH serial clients active, repeat user list/show and several UART0 mutations. Confirm password prompts remain physical-UART-only, no user operation acquires a broker client or writer lease, existing Phase 8A network authentication and revocation behavior remains functional, and serial/broker counters show no unexplained loss. Record `memory`, `web counters`, and `ssh counters` before and after the run.
|
||||
|
||||
## Phase 8B role-aware HTTPS and SSH authentication
|
||||
|
||||
Complete the Phase 8A bootstrap first and retain two disposable accounts, one `user` and one `admin`. Phase 8B gives both roles the existing serial/status interface; the administrative SSH shell is not expected until Phase 8C.
|
||||
|
||||
### 1. HTTPS passwords and fail-closed behavior
|
||||
|
||||
For both roles, authenticate to `/`, `/api/status`, and the browser terminal with the account password. Confirm the full 16-character username and a 64-character password work, while absent, malformed, oversized, wrong-user, and wrong-password Basic headers fail without exposing which component was wrong. After bootstrap, confirm the value from `web credentials show` no longer authenticates unless it independently equals a current user password.
|
||||
|
||||
On a disposable malformed-database image, confirm HTTPS returns authentication-service unavailable and never falls back to the legacy credential. Recover through physical UART0 only. Verify `web status` reports user-database authentication and active WebSocket sessions show account, user role, and password method without secrets.
|
||||
|
||||
### 2. SSH password and public-key login
|
||||
|
||||
For both `user` and `admin`, verify password SSH login reaches the same broker-backed serial stream as before. Confirm `ssh sessions` shows the account, user role, password method, and writer/observer role. An administrator must not receive UART0 commands yet.
|
||||
|
||||
Import one Ed25519 key and one ECDSA P-256 key through `user key add`, then verify each matching private key authenticates without a password and `ssh sessions` reports `public-key`. Confirm an unregistered key, wrong username, unsupported RSA key, certificate key, and three failed completed attempts are rejected. Normal client probe-then-sign behavior must consume one completed attempt, not two; unsigned probes alone must never create an authenticated session or broker client.
|
||||
|
||||
### 3. WebSocket ticket binding
|
||||
|
||||
Authenticate separately as two users and request tickets. Confirm each ticket is accepted exactly once, expires after 30 seconds, and cannot be reused or altered. Change one account after ticket issuance but before WebSocket connection; its ticket must fail closed without creating a broker client, while the other account's ticket still works. Repeat with delete followed by recreation of the same username and confirm the old ticket remains invalid.
|
||||
|
||||
### 4. Targeted session revocation
|
||||
|
||||
Connect simultaneous WebSocket and SSH sessions for two different users and place one affected session in writer state. One mutation at a time, exercise password change, role change, SSH-key add/delete/clear, and account deletion. Required results:
|
||||
|
||||
1. Outstanding tickets and active sessions for the changed username are revoked promptly and any writer lease is released.
|
||||
2. The stale session cannot inject additional serial bytes or reacquire writer ownership.
|
||||
3. The unrelated user's WebSocket/SSH sessions remain connected and retain their expected broker roles.
|
||||
4. New authentication succeeds only with the updated password/key/role state.
|
||||
5. Deleting and recreating the same username does not revive old tickets or sessions.
|
||||
|
||||
Run `web status`, `ssh sessions`, `web counters`, `ssh counters`, and `broker clients` around each mutation. Also rotate `web credentials rotate --force` after administrator bootstrap and confirm it changes only recovery material: role-based HTTPS/SSH sessions remain connected and user passwords are unchanged. `web reset --force` restarts HTTPS because the TLS identity changes, but must not revoke unrelated SSH sessions.
|
||||
|
||||
### 5. Concurrency regression
|
||||
|
||||
With USB CDC, two role-based network users, one WebSocket terminal, one SSH terminal, and UART1 traffic active, alternate writer ownership and mutate one account. Confirm binary transparency, observer isolation, bounded authentication/handshake behavior, UART0 responsiveness, and no unexpected disconnect of the unaffected user. Record memory, broker, web, SSH, and serial counters before and after. Repeat after reboot to verify passwords, roles, keys, and authentication methods persist.
|
||||
|
||||
## Configuration A: data and handshake pairs
|
||||
|
||||
Connect the following pairs:
|
||||
|
||||
Reference in New Issue
Block a user