What you will be able to do
- Build a CREATE ALERT that checks a security condition on a schedule and make sure it actually runs
- Send security events to email, webhooks and cloud queues through notification integrations
- Collect logs, traces and metrics in an event table and hand them to external observability tools
- Treat Trust Center Threat Intelligence findings as a source of authentication-anomaly alerts
1.Scheduled security checks with CREATE ALERT
A detection query that someone has to remember to run is not monitoring. A Snowflake alert turns it into one: it runs a condition on a schedule and performs an action when the condition returns rows. The condition is the detection query, such as failed logins or unloads above a threshold. The action is the response, usually a notification.
CREATE [ OR REPLACE ] ALERT [ IF NOT EXISTS ] <name>
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
[ SCHEDULE = '{ <num> MINUTE | USING CRON <expr> <time_zone> }' ]
[ WAREHOUSE = <warehouse_name> ]
[ COMMENT = '<string_literal>' ]
[ CONFIG = '<configuration_string>' ]
[ RUNBOOK = '<string_literal>' ]
[ SUSPEND_ALERT_AFTER_NUM_FAILURES = <number> ]
IF( EXISTS(
<condition>
))
THEN
<action>Three settings decide whether the alert is any use in practice. The schedule sets the minimum time to detection. The condition's source sets the maximum: the ACCOUNT_USAGE views lag by up to hours, so a minute-level login rule should query the 7-day Information Schema table functions instead. SUSPEND_ALERT_AFTER_NUM_FAILURES stops a broken condition from failing forever. It also means that an alert whose condition keeps failing can switch itself off, so check the alert's state as well as its output.
Checkpoint 1 of 4· Check yourself
A resumed alert runs with SCHEDULE = '1 MINUTE'. Its condition looks for 20 or more failed logins from one CLIENT_IP in the last 5 minutes of SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY. During a password-spraying attack, the alert stays silent. Which change makes it fire within minutes?
The schedule sets the minimum time to detection, and the condition's source sets the maximum. Rows can reach ACCOUNT_USAGE.LOGIN_HISTORY up to 2 hours late, so a 5-minute window never sees the attack. The 7-day Information Schema table function returns recent events. Checking more often only re-reads the same stale rows. ACCESS_HISTORY lags even more, and SUSPEND_ALERT_AFTER_NUM_FAILURES only turns off an alert whose condition keeps failing.
“Latency for the view may be up to 120 minutes (2 hours).”Source: docs.snowflake.com
2.Routing security events through notification integrations
An alert's action usually sends a message, and messages need a notification integration. The integration is the object that defines where messages can go. You must create it before you call SYSTEM$SEND_SNOWFLAKE_NOTIFICATION. One call to that procedure can reach several kinds of destination at once:
- Email addresses, as plain text or HTML.
- Webhooks, for chat and incident tools.
- Cloud queues: Amazon SNS, Google Cloud PubSub or Azure Event Grid, receiving JSON.
Queues and webhooks suit machine consumers. A SIEM or SOAR pipeline subscribed to an SNS topic or Event Grid receives JSON that it can parse without screen-scraping an email. You can also create several email integrations with different recipient lists and subject lines. For example, one could page the on-call team and another could send a digest to auditors.
Email has a data-handling cost that matters for security content. Email notifications go through AWS Simple Email Service, and Snowflake may keep the message content for up to thirty days to manage delivery. Put the event ID and a pointer to the evidence in the message. Leave out the sensitive rows that triggered it.
Checkpoint 2 of 4· Check yourself
Your password-spraying alert emails the on-call team through a notification integration. You want the message to carry nothing sensitive, yet a responder must still be able to find which columns the attacker's session read. What should the email contain?
Email goes through AWS Simple Email Service, and Snowflake may keep the message content for up to thirty days, so the message should carry an event ID and a pointer to the evidence, not the data. The login EVENT_ID matches QUERY_HISTORY.authn_event_id, and query_id then leads into ACCESS_HISTORY for the columns the session read. The CLIENT_IP is not a key into ACCESS_HISTORY. query_text shows only what was typed, not the base tables behind a view.
“This ID corresponds to the value in the event_id column in the LOGIN_HISTORY view.”Source: docs.snowflake.com
Sources3
3.Event tables and exporting telemetry to external tools
Audit views cover queries and logins. Event tables cover what happens inside your code. Snowflake event tables collect logs, spans (traces) and metrics in the OpenTelemetry data model, emitted by UDFs, procedures and other handler code. Every account has an active default event table, SNOWFLAKE.TELEMETRY.EVENTS, unless you create your own and set it as active.
An active table on its own collects nothing until you set levels. You choose how much of each kind of data to capture. Tracing, for example, records nothing while its level is OFF. A sensible starting point is log levels of at least WARN for production jobs. Metrics are emitted automatically, but they can take up to five minutes to arrive. Very short jobs may emit no metrics at all.
Telemetry can contain sensitive values, so control who can read it. The EVENTS_VIEWER and EVENTS_ADMIN roles can select from EVENTS_VIEW. The ADD_ROW_ACCESS_POLICY_ON_EVENTS_VIEW procedure binds a row access policy to that view, so each team sees only its own rows. For external observability, the OpenTelemetry format is what makes export practical. Because event tables use OpenTelemetry standards, other ecosystem tools can consume their data without a custom schema mapping.
Checkpoint 3 of 4· Check yourself
During an investigation, you suspect a UDF's handler code of querying a sensitive table. The account uses only the active default event table, SNOWFLAKE.TELEMETRY.EVENTS, and the tracing level was never changed from OFF. Where will you find which tables the UDF read?
An active event table collects no traces while the tracing level is OFF. Tables read inside a UDF are logged in ACCESS_HISTORY's base_objects_accessed anyway. direct_objects_accessed holds only what the statement named, which is the UDF. A row access policy on EVENTS_VIEW limits who sees telemetry rows that already exist. It does not create any.
“UDFs and Tabular SQL UDFs (UDTFs) if tables are included in queries inside the functions. This is logged in the base_objects_accessed field.”Source: docs.snowflake.com
4.Trust Center threat-detection findings as alert sources
Trust Center scanner packages, findings and CIS Benchmarks include a Threat Intelligence package. It does part of the login analysis described above for you. Its scanners look for abnormal failure rates, meaning users with unusually many authentication failures or job errors. Each finding comes with a risk severity and a recommended mitigation.
Its scanners split by how they run, which affects how quickly they react:
- Schedule-based: users with a high volume of authentication failures, human and legacy service users still signing in with a password only, and long-running queries.
- Event-driven: changes to authentication policies at account or user level, and dormant-user sign-ins, meaning sign-ins by users who had not signed in during the previous 90 days.
A dormant account suddenly signing in, or an authentication policy loosened outside a change window, is the kind of anomaly that hand-written LOGIN_HISTORY queries tend to miss.
Checkpoint 4 of 4· Check yourself
Trust Center's Threat Intelligence package flags a human user who still signs in with a password only. You want to confirm the finding yourself in LOGIN_HISTORY before you enforce MFA. Which rows confirm it?
A NULL SECOND_AUTHENTICATION_FACTOR means the login used no multi-factor authentication. That is the gap the scanner reports. Users with MFA also have a password first factor, so the first factor alone proves nothing. REPORTED_CLIENT_TYPE is not authenticated, and LOGIN_DETAILS covers malicious IP protection, not MFA use.
“The second factor in multi-factor authentication. If the user did not use multi-factor authentication, this value is NULL.”Source: docs.snowflake.com
Sources6
Sources
(10)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Newly created or cloned alerts are suspended upon creation.”
↩︎ Scheduled security checks with CREATE ALERT“Newly created or cloned alerts are suspended upon creation.”
↩︎ Exam trap 1 - 2.
“Alerts allow for customizable triggering conditions, actions, and a schedule, in combination with notification integrations for proactive monitoring.”
↩︎ Scheduled security checks with CREATE ALERT“Snowflake event tables collect log, span, and metrics data in the OpenTelemetry data model.”
↩︎ Event tables and exporting telemetry to external tools“The Snowflake event table adopts OpenTelemetry standards, so your Snowflake telemetry can easily be consumed by other ecosystem tools.”
↩︎ Event tables and exporting telemetry to external tools“set log levels to at least WARN for any production or business critical jobs.”
↩︎ Event tables and exporting telemetry to external tools - 3.
“a queue provided by a cloud service (Amazon SNS, Google Cloud PubSub, or Azure Event Grid)”
↩︎ Routing security events through notification integrations“Send a message in a specified format, according to the type of notification integration (plain text or HTML for email, JSON for queues).”
↩︎ Routing security events through notification integrations“Before you send a notification, you must have a notification integration”
↩︎ Routing security events through notification integrations“may be retained by Snowflake for up to thirty days to manage the delivery of the message.”
↩︎ Routing security events through notification integrations - 4.
“The SNOWFLAKE.TELEMETRY.EVENTS table is the default event table for telemetry data collection.”
↩︎ Event tables and exporting telemetry to external tools“The EVENTS_VIEWER or EVENTS_ADMIN roles can execute SELECT operations on the EVENTS_VIEW view.”
↩︎ Event tables and exporting telemetry to external tools - 5.https://docs.snowflake.com/en/developer-guide/logging-tracing/logging-tracing-troubleshootingOfficial docs
“It can take up to 5 minutes for the metrics data to be available in the event table and in Snowsight.”
↩︎ Event tables and exporting telemetry to external tools - 6.
“Identifies users with a high number of authentication failures or job errors, which might indicate attempted takeovers of an account”
↩︎ Trust Center threat-detection findings as alert sources“Provides a risk-severity finding and a risk-mitigation recommendation.”
↩︎ Trust Center threat-detection findings as alert sources“Finds changes to authentication policies at both the account level and the user level.”
↩︎ Trust Center threat-detection findings as alert sources
Also cited
“you must set the tracing level to a level other than OFF for tracing data to be collected.”
↩︎ Exam trap 2“Latency for the view may be up to 120 minutes (2 hours).”
↩︎ Checkpoint“The second factor in multi-factor authentication. If the user did not use multi-factor authentication, this value is NULL.”
↩︎ Checkpoint“This ID corresponds to the value in the event_id column in the LOGIN_HISTORY view.”
↩︎ Checkpoint“UDFs and Tabular SQL UDFs (UDTFs) if tables are included in queries inside the functions. This is logged in the base_objects_accessed field.”
↩︎ Checkpoint