security(vault,recovery,config): harden Vault keyfile/seal, strip recovery passwords, guard config & symlinks
This commit is contained in:
parent
005c82e6bf
commit
e3f716d24f
12 changed files with 504 additions and 207 deletions
|
|
@ -202,20 +202,13 @@ describe('Bundle size budget & full-stack Express + WS lifecycle', () => {
|
|||
).toBe(200);
|
||||
|
||||
// 6. Vault Init + Step-Up guard + Drop Elevation + Generate Ed25519 key
|
||||
const vInit = await api('/api/vault/init', { method: 'POST', body: {} });
|
||||
expect(vInit.status).toBe(201);
|
||||
const generatedMasterKey = String(vInit.data.generatedKeyHex);
|
||||
|
||||
// v1.1 defaults elevateOnLogin=false; step up first, then verify drop-elevation clears it
|
||||
// v1.1 defaults elevateOnLogin=false; verify non-elevated session cannot init vault
|
||||
const statusInitial = await api('/api/auth/status');
|
||||
expect(statusInitial.data.elevatedUntil).toBeNull();
|
||||
|
||||
const noStepUp = await api('/api/vault/generate-ed25519', {
|
||||
method: 'POST',
|
||||
body: { id: 'prod-key', name: 'Prod Key' },
|
||||
});
|
||||
expect(noStepUp.status).toBe(403);
|
||||
expect(noStepUp.data.error).toBe('STEP_UP_REQUIRED');
|
||||
const vInitDenied = await api('/api/vault/init', { method: 'POST', body: {} });
|
||||
expect(vInitDenied.status).toBe(403);
|
||||
expect(vInitDenied.data.error).toBe('STEP_UP_REQUIRED');
|
||||
|
||||
const stepUpRes = await api('/api/auth/step-up', {
|
||||
method: 'POST',
|
||||
|
|
@ -223,6 +216,10 @@ describe('Bundle size budget & full-stack Express + WS lifecycle', () => {
|
|||
});
|
||||
expect(stepUpRes.status).toBe(200);
|
||||
|
||||
const vInit = await api('/api/vault/init', { method: 'POST', body: {} });
|
||||
expect(vInit.status).toBe(201);
|
||||
const generatedMasterKey = String(vInit.data.generatedKeyHex);
|
||||
|
||||
const statusBeforeDrop = await api('/api/auth/status');
|
||||
expect(typeof statusBeforeDrop.data.elevatedUntil).toBe('number');
|
||||
const dropped = await api('/api/auth/drop-elevation', { method: 'POST' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue