Repository navigation
[New] Respond to GenAI Credential Exposure - #162
Mikaayenson wants to merge 11 commits into
Conversation
- Unified concurrency key uses resolved key_id for both alert and manual - Removed __install__ connector consts; use connector-id: __install__.<name> directly per CONTRIBUTING.md - Multi-alert reject guard (event.alerts.size > 1) - Resolve provider + project_id from alert fields (gen_ai.provider, gen_ai.project.id) so OpenAI alerts work - key_id charset allowlist rejects raw secrets before logging - Removed on-failure: continue on revoke/delete HTTP steps (fail-closed) - OpenAI verify: 404-as-error means verify_error present = confirmed deletion - Removed error field echoing from audit log messages
semd
left a comment
There was a problem hiding this comment.
Nice addition, and the provider calls match the Anthropic and OpenAI Admin APIs. A few things before merging: alert runs always pick Anthropic (L100), the key ID allowlist lets raw sk- secrets through (L129), a successful OpenAI delete is never reported as verified (L216), and rejected or unverified runs end as completed (L116, L200). I'd also add an analyst approval before enforcing (L172).
One question: which rule or integration produces gen_ai.provider, gen_ai.auth.key_id and gen_ai.project.id? I couldn't find them in Kibana's ECS package or in the other library templates, and if nothing sets them yet, alert runs always end as skipped.
Alert-field provider wins over manual-input defaults, raw sk- values fail closed, unverified provider calls fail the run, and enforce waits for analyst approval.
Cover waitForApproval (1h) plus provider HTTP verify, and surface project_id in the revoke approval message when present.
semd
left a comment
There was a problem hiding this comment.
Thanks, all six addressed. Non-blocking: an alert without gen_ai.provider still falls back to the manual default anthropic (input defaults apply on alert runs), and cloud.provider is the hosting cloud (aws, gcp…), not the AI provider. The approval prompt shows the provider, so an analyst can catch it, but reading the provider only from gen_ai.provider on alert runs would be safer.
Only show project= for OpenAI revoke/audit prompts, and reject non-proj_ project_id values without echoing them.
Only run the proj_ format allowlist when project_id is non-empty so blank OpenAI runs hit the clearer missing-field skip path.
Use this when an AI provider API key has been exposed and must be revoked at the provider, not only recorded in the SIEM. Start from a credential-exposure alert or run it manually with non-secret metadata (provider, key id, and OpenAI project id when required). Prompt text and raw token values are never accepted as inputs. Audit by default logs the revoke plan. Enforce uses a customer-configured Anthropic or OpenAI Admin HTTP connector to deactivate or delete the key, then verifies status through the provider API. Enforce fails closed if the connector id is not configured. Note, this one requires admin to an enterprise Anthropic or OpenAI account to fully test.