Security operations
Snowflake security alerts in your SIEM, with just SQL
Native webhook notifications for Splunk and Microsoft Sentinel.
Kevin Keller · kevinkeller.org
Why it matters
The telemetry is in Snowflake. The analysts are in the SIEM.
- Failed logins, privilege escalations and unusual queries all sit in
ACCOUNT_USAGE. - Getting them out used to need a Python UDF, an External Access Integration and a secret.
- That is a lot of moving parts for what amounts to an HTTP POST.
What changed
A native webhook replaces the UDF
- Create a
NOTIFICATION INTEGRATIONof typeWEBHOOKpointing at the SIEM. - Attach the auth header through a secret.
- Call
SYSTEM$SEND_NOTIFICATION()from an Alert or Task.
No Python UDF. No External Access Integration.
Choosing an approach
How your SIEM authenticates decides the pattern
| Approach | Best for |
|---|---|
| Native webhook | Static tokens: Splunk HEC, Logic App URLs |
| External Access UDF | Expiring OAuth with complex payloads |
| Hybrid | Expiring OAuth with simple alert payloads |
Native webhook
Secrets never appear in the integration or logs
- Header values use the
SNOWFLAKE_WEBHOOK_SECRETplaceholder. - Snowflake swaps in the real secret at execution time.
- Splunk needs
Authorization: Splunk <token>.Bearerreturns403 Forbidden. - An alert checking every minute can post failed logins straight to Splunk.
The token problem
Static secrets go stale when OAuth tokens expire
Sentinel's Logs Ingestion API with Entra ID uses tokens that typically expire every 60 minutes. A UDF with _snowflake.get_oauth_access_token() fetches a fresh token on every call, at the cost of a Python runtime.
The hybrid
Detect in SQL, deliver natively, refresh the token in the background.
A Task refreshes the secret every 30 minutes with ALTER SECRET. Alerts keep using the native webhook.
Comparison
Native and hybrid keep latency low
| Native | UDF | Hybrid | |
|---|---|---|---|
| Setup | Low | High | Medium |
| Token refresh | Manual or Task | At call time | Background Task |
| Latency | Low | Higher | Low |
Ready-made detections
Five alert conditions to start with
- Five or more failed logins by one user.
- A login from an IP unseen in the last 90 days.
- New grants of
ACCOUNTADMIN,SECURITYADMINorSYSADMIN. - Queries returning over 1 million rows or scanning over 1 GB.
- Queries outside business hours.
Safeguards
Run it with least privilege and an audit trail
- Rotate SIEM tokens, and the Entra ID client secret for the hybrid.
- Check
SYSTEM$ALLOWLIST()so the SIEM accepts Snowflake's egress IPs. - Monitor
NOTIFICATION_HISTORYfor delivery failures. - Use a dedicated monitoring role, never
ACCOUNTADMIN.
The takeaway
Start with the native webhook. Go hybrid when tokens expire.
Kevin Keller · kevinkeller.org