security(alerts,ai): fix secret exfiltration, ReDoS/redactor bypasses, probe double-counting & add Security Event Alerting

This commit is contained in:
tyuXX 2026-11-28 05:09:46 +00:00
parent 2b878c1d99
commit 67137056f8
11 changed files with 613 additions and 173 deletions

View file

@ -287,6 +287,19 @@ describe('Phase 5: Optional BYO-API AI Assistant, Secret Redactor, Surface Guide
// Write-lock Vault -> AI runtime secret still works via VaultService.getRuntimeSecret
expect((await api('/api/vault/lock', { method: 'POST' })).data.state).toBe('locked');
// Default Zero-Trust egress policy blocks outbound calls to loopback until allowlisted
const blockedEp = await api('/api/ai/test', { method: 'POST', body: {} });
expect(blockedEp.data.ok).toBe(false);
expect(
(
await api('/api/auth/security-policy', {
method: 'PUT',
body: { egressAllowedCidrs: ['127.0.0.1/32'] },
})
).status,
).toBe(200);
const testEp = await api('/api/ai/test', { method: 'POST', body: {} });
expect(testEp.status).toBe(200);
expect(testEp.data.ok).toBe(true);