Join our Newsletter — 33% off our NHI Course
Home› Guides› Snowflake Login and Access History Detection Guide: Bulk…
Guide SOC & Detection Engineering

Snowflake Login and Access History Detection Guide: Bulk Export and Credential Abuse Queries

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 19 November 2026 18 min read
On this page

Snowflake records every login, session, query and object access in its ACCOUNT_USAGE views, and a small set of joined queries over those views will catch most credential abuse and bulk data theft before the attacker has finished downloading. This guide walks through the four views a SOC needs, the columns that matter in each, and the detections worth building first, from password logins without a second factor to temporary stages filled with compressed exports.

It is the detection and query companion to our Snowflake Security Guide, which covers hardening. If you are already responding to a suspected compromise, go straight to the Snowflake Account Compromise Playbook. The structure follows the rest of our log source series, such as the Okta System Log Detection Guide.

This is an independent guide from NHI Mgmt Group, based on Snowflake's public documentation as of November 2026. It is not sponsored or reviewed by Snowflake. Product features change, so confirm settings against Snowflake's current documentation.

Key takeaways

  • Four ACCOUNT_USAGE views carry almost every signal you need: LOGIN_HISTORY, SESSIONS, QUERY_HISTORY and ACCESS_HISTORY. Each covers the last 365 days.
  • The views are not real time. Snowflake documents latency of up to 2 hours for LOGIN_HISTORY, 45 minutes for QUERY_HISTORY and 3 hours for SESSIONS and ACCESS_HISTORY, so plan schedules and alert expectations around those numbers.
  • The highest value detection is still the simplest: successful logins where SECOND_AUTHENTICATION_FACTOR is NULL and FIRST_AUTHENTICATION_FACTOR is a password, especially for human users who should never log in that way.
  • Bulk theft in Snowflake tends to follow a recognisable sequence: discovery (SHOW TABLES), staging (CREATE TEMPORARY STAGE), unload (COPY INTO a stage) and download (GET). Each step leaves a row in QUERY_HISTORY.
  • Client software names in LOGIN_HISTORY are self reported and not authenticated. Use them as context and as known bad indicators, never as proof that a login is legitimate.
  • ACCESS_HISTORY needs Enterprise Edition or higher. It tells you which tables and columns a query actually read, which turns "a large query ran" into "someone read the customer PII columns".

The four views and what each one proves

All four views live in the SNOWFLAKE.ACCOUNT_USAGE schema. Reading them needs a role with access to the SNOWFLAKE database, so give your detection pipeline a dedicated service user and role rather than borrowing an administrator's session. That service user is itself a non-human identity that can read a year of your account's activity, so protect it accordingly (see the Service Accounts in Snowflake Guide).

ViewWhat it recordsDocumented latencyKey join columns
LOGIN_HISTORYEvery login attempt, successful or not, with factors, client IP and reported client typeUp to 120 minutesEVENT_ID, USER_NAME
SESSIONSOne row per session, with authentication method and the Snowflake client application that opened itUp to 180 minutesSESSION_ID, LOGIN_EVENT_ID
QUERY_HISTORYEvery statement: text, type, role, warehouse, rows and bytes produced or unloadedUp to 45 minutesQUERY_ID, SESSION_ID
ACCESS_HISTORYWhich objects and columns each query read, wrote or changed by DDLUp to 180 minutesQUERY_ID

The joins are what make Snowflake detection powerful. LOGIN_HISTORY.EVENT_ID matches SESSIONS.LOGIN_EVENT_ID, SESSIONS.SESSION_ID matches QUERY_HISTORY.SESSION_ID, and QUERY_HISTORY.QUERY_ID matches ACCESS_HISTORY.QUERY_ID. With those three joins you can go from "a password login from an unfamiliar IP" to "and in that session the user read these columns and unloaded this many rows" in one query.

Two retention points matter for investigations. The ACCOUNT_USAGE views each cover the last 365 days, while the Information Schema QUERY_HISTORY table function covers only the past 7 days. If you need more than a year, export the views to your SIEM or to a separate, locked down database on a schedule.

LOGIN_HISTORY columns that matter

LOGIN_HISTORY is your authentication log. The columns worth indexing in a SIEM are:

  • EVENT_TIMESTAMP and EVENT_TYPE: when the attempt happened and what kind of event it was (LOGIN for authentication events).
  • USER_NAME: the user. Snowflake notes this is NULL when a failed attempt cannot be tied to a user, for example invalid OAuth client credentials or a key pair attempt naming an unknown user. A spike of NULL user failures is itself a signal.
  • CLIENT_IP: IPv4 or IPv6 source. Internal Snowflake operations, such as Snowsight worksheet access and Snowpark Container Services logins, show INTERNAL_SNOWFLAKE_IP/0.0.0.0, so exclude that value from geolocation and new IP logic.
  • REPORTED_CLIENT_TYPE and REPORTED_CLIENT_VERSION: values such as JDBC_DRIVER or ODBC_DRIVER. Snowflake states these are reported, not authenticated.
  • FIRST_AUTHENTICATION_FACTOR and SECOND_AUTHENTICATION_FACTOR: the method used and, if MFA was used, the second factor. The second factor column is NULL when MFA was not used.
  • FIRST_AUTHENTICATION_FACTOR_ID and SECOND_AUTHENTICATION_FACTOR_ID: the ID of the credential used. These let you tell which of a user's keys or tokens was presented, which is vital when rotating.
  • IS_SUCCESS, ERROR_CODE and ERROR_MESSAGE: outcome and reason.
  • LOGIN_DETAILS: a JSON object that includes the malicious IP protection category, risk category and blocking status.
  • AUTHORIZING_INTEGRATION_NAME: the security integration that authorised the login, for example the OAuth integration. NULL if no integration was involved.
  • CONNECTION and CLIENT_PRIVATE_LINK_ID: the Client Redirect connection name and private connectivity endpoint, useful for confirming that a service user only ever arrives over its expected path.

Snowflake also notes that activity by its internal system users, such as those maintaining Snowsight worksheets, does not appear in this view. That is helpful: what you see is customer side activity.

SESSIONS, QUERY_HISTORY and ACCESS_HISTORY columns that matter

SESSIONS

SESSIONS bridges logins and queries. AUTHENTICATION_METHOD records how the user authenticated, LOGIN_EVENT_ID links back to LOGIN_HISTORY, and CLIENT_APPLICATION_ID records the Snowflake provided client and version (for example "JDBC 3.8.7"). CLIENT_ENVIRONMENT carries details such as operating system. CREATED_ON, ACCESS_TIME, IS_OPEN and CLOSED_REASON describe the session lifecycle. Snowflake notes that SQL API transient sessions are not tracked here, so SQL API use needs to be watched through QUERY_HISTORY and LOGIN_HISTORY instead.

QUERY_HISTORY

The detection relevant columns are QUERY_TEXT (truncated beyond 100K characters), QUERY_TYPE, USER_NAME, ROLE_NAME, WAREHOUSE_NAME, SESSION_ID, START_TIME and EXECUTION_STATUS (success, fail or incident). For volume, use ROWS_UNLOADED (rows unloaded during data export), BYTES_WRITTEN_TO_RESULT, and OUTBOUND_DATA_TRANSFER_BYTES with OUTBOUND_DATA_TRANSFER_CLOUD for unloads that leave the region or cloud. Snowflake marks ROWS_PRODUCED for deprecation and recommends the more specific row counters, so avoid building new detections on it. Note that START_TIME is in the local time zone while LOGIN_HISTORY.EVENT_TIMESTAMP is documented in UTC, so normalise before correlating.

ACCESS_HISTORY

ACCESS_HISTORY (Enterprise Edition or higher) adds the "what" to every query. DIRECT_OBJECTS_ACCESSED lists the objects named in the query, BASE_OBJECTS_ACCESSED lists every underlying object needed to run it (so a read through a view still shows the base table), and OBJECTS_MODIFIED lists what was written. Each entry carries objectDomain, objectName, objectId and, for tables and views, a columns array of columnId and columnName. OBJECT_MODIFIED_BY_DDL records DDL with an operationType such as CREATE, DROP, ALTER, GRANT or REVOKE, and POLICIES_REFERENCED shows which masking and row access policies were enforced. Newer columns, PARENT_QUERY_ID, ROOT_QUERY_ID and AGENTS_INFO, tie queries to stored procedure chains and to Cortex or external agents, which is increasingly useful as agents start reading data on users' behalf (see the Snowflake Cortex AI Security Guide).

Snowflake's usage notes add three practical cautions: always filter on QUERY_START_TIME with narrow ranges for performance; not every QUERY_HISTORY record appears in ACCESS_HISTORY; and truncated values show as -1 or TRUNCATED.

Credential abuse detections

The 2024 campaign Mandiant tracks as UNC5537 is the reference case for why these detections matter. Mandiant reported that the actor used customer credentials stolen by infostealer malware, that MFA was not enabled on the affected accounts and that network allow lists were not in place. Mandiant found no evidence of a breach of Snowflake's own enterprise environment. Every one of those conditions is visible in LOGIN_HISTORY.

1. Successful password login without a second factor

Alert on IS_SUCCESS = 'YES' where FIRST_AUTHENTICATION_FACTOR indicates a password and SECOND_AUTHENTICATION_FACTOR IS NULL. Tune by user type: for human users this should be zero once MFA is enforced; for legacy service users it should be a shrinking, named list tracked against your migration to key pair or workload identity federation (see How to find Snowflake service users without key-pair auth).

Illustrative query:

1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

Sample 1
-- Illustrative: adapt factor values to those seen in your account
SELECT event_timestamp, user_name, client_ip, reported_client_type,
       first_authentication_factor
FROM snowflake.account_usage.login_history
WHERE event_timestamp > DATEADD(hour, -6, CURRENT_TIMESTAMP())
  AND is_success = 'YES'
  AND second_authentication_factor IS NULL
  AND first_authentication_factor = 'PASSWORD';

2. Password spraying and stuffing

Group failed attempts (IS_SUCCESS = 'NO') by CLIENT_IP and count distinct USER_NAME values in a window. Many users from one IP suggests spraying; many failures for one user from many IPs suggests stuffing. Include NULL user failures, which Snowflake records when the user cannot be identified. Escalate when a failure burst is followed by a success from the same IP.

3. New IP or network path for a service user

Service users should log in from a small, stable set of addresses, private link endpoints or connections. Baseline CLIENT_IP, CLIENT_PRIVATE_LINK_ID and CONNECTION per service user over 30 days and alert on anything new. Exclude INTERNAL_SNOWFLAKE_IP/0.0.0.0. For human users, compare against your VPN and corporate egress ranges; Mandiant reported that UNC5537 access came largely through commercial VPN exit nodes.

4. Malicious IP protection hits

Parse LOGIN_DETAILS for the malicious IP protection category and blocking status. A blocked attempt is not an incident by itself, but an allowed login carrying a risk category is worth an analyst's look, and repeated blocked attempts against one user suggest that credential is circulating.

5. Unexpected client application

Join LOGIN_HISTORY to SESSIONS on EVENT_ID = LOGIN_EVENT_ID and alert when a user opens a session with a CLIENT_APPLICATION_ID outside their baseline. Mandiant published client application IDs seen in the campaign, including Rapeflake (its FROSTBITE utility) and DBeaver_DBeaverUltimate, and these are worth a direct match. The others it listed, such as specific JDBC, Python connector and SnowSQL versions, are common legitimate clients, so treat them as context only. Because client names are self reported, an attacker can change them; the value of this detection is catching the careless, and catching drift from a service user's single expected driver.

6. Credential ID changes

For service users with key pair or programmatic access tokens, track FIRST_AUTHENTICATION_FACTOR_ID. A login with a credential ID that is not in your inventory, or with an ID you believe was rotated out, is a strong signal that a key or token was added outside your process or that rotation did not complete. Pair this with ACCESS_HISTORY DDL entries for ALTER USER operations.

Bulk export and staging detections

Mandiant described the UNC5537 exfiltration sequence in detail: list stages, create a temporary stage, select the target tables, COPY INTO the stage as gzip compressed CSV, then GET the files to a local machine. A temporary stage disappears when the session ends, so the evidence lives in QUERY_HISTORY, not in your object inventory.

7. Discovery burst

Count SHOW statements (for example SHOW TABLES, SHOW DATABASES, SHOW USERS) per session. A session that issues many discovery statements in its first minutes, from a user whose role normally runs a fixed set of reports, is unusual. Mandiant reported FROSTBITE enumerating users, roles, IPs and session IDs, so include queries against CURRENT_ROLE and similar context functions in the count.

8. Temporary stage created by a human or unexpected user

Search QUERY_TEXT for CREATE TEMPORARY STAGE (and CREATE STAGE in general) by users who are not data engineering service users. Most organisations can list the handful of pipelines that legitimately create stages.

9. Large unload

Alert when ROWS_UNLOADED or OUTBOUND_DATA_TRANSFER_BYTES for a user or session exceeds that identity's 30 day maximum, or when OUTBOUND_DATA_TRANSFER_CLOUD is populated for a user who has never unloaded across clouds. Combine with the next detection for high fidelity.

10. COPY INTO followed by GET in one session

This is the sequence detection. Within one SESSION_ID, look for a COPY INTO a stage location followed by a GET. Legitimate pipelines usually unload to external stages and never call GET from a client; analysts rarely unload at all.

Sample 1
-- Illustrative: sessions that both unload to a stage and download from one
WITH s AS (
  SELECT session_id, user_name,
         MAX(IFF(query_text ILIKE 'copy into @%', 1, 0)) AS did_unload,
         MAX(IFF(query_text ILIKE 'get @%', 1, 0))       AS did_get,
         SUM(rows_unloaded)                              AS rows_out
  FROM snowflake.account_usage.query_history
  WHERE start_time > DATEADD(day, -1, CURRENT_TIMESTAMP())
  GROUP BY session_id, user_name)
SELECT * FROM s WHERE did_unload = 1 AND did_get = 1;

11. Sensitive column reads

Flatten BASE_OBJECTS_ACCESSED and its columns array, then join to your list of sensitive tables or tagged columns. Alert when a user reads a sensitive column for the first time, or reads many sensitive tables in one session. Using base rather than direct objects means a read through a view still counts.

Sample 1
-- Illustrative: who read which columns of a sensitive table yesterday
SELECT ah.user_name, obj.value:objectName::string AS object_name,
       col.value:columnName::string AS column_name, COUNT(*) AS reads
FROM snowflake.account_usage.access_history ah,
     LATERAL FLATTEN(ah.base_objects_accessed) obj,
     LATERAL FLATTEN(obj.value:columns) col
WHERE ah.query_start_time > DATEADD(day, -1, CURRENT_TIMESTAMP())
  AND obj.value:objectName::string = 'PROD.CRM.CUSTOMERS'
GROUP BY 1, 2, 3;

12. Control tampering

Use OBJECT_MODIFIED_BY_DDL to catch GRANT operations to unexpected roles, ALTER operations that remove masking or row access policies, and DROP operations on policy objects. Attackers who gain an administrative role often widen access before exporting. Pair these with QUERY_HISTORY for ALTER USER, ALTER NETWORK POLICY and CREATE USER statements.

Correlating the views into one story

Single detections produce leads. The investigation view is a chain: a login with no second factor from a new IP, a session opened with an unusual client application, a discovery burst, a temporary stage, a large unload, a GET, and ACCESS_HISTORY showing sensitive columns. Build one scheduled query or SIEM correlation that scores sessions on how many of those links they contain, and route sessions with three or more to an analyst immediately.

Two practical tips. First, correlate on SESSION_ID rather than user and time window wherever you can, because service users often run many parallel sessions. Second, because the views lag, run the correlation over a window comfortably longer than the slowest view's latency (for example, the last six hours every hour) and deduplicate alerts on SESSION_ID.

Collecting the views without gaps

  • Pull incrementally on time, with overlap. Query each view for rows newer than your last high water mark minus the documented latency, then deduplicate on EVENT_ID, SESSION_ID or QUERY_ID. A naive "last hour" pull misses rows that arrive late.
  • Use a dedicated reader identity. A service user with key pair or workload identity authentication, a role limited to the SNOWFLAKE database views it needs, and a network policy tied to your collector's egress. Alert on any login by that user from anywhere else.
  • Size the warehouse. ACCESS_HISTORY and QUERY_HISTORY are large in busy accounts. Narrow time filters are both a performance and cost control.
  • Keep a copy outside Snowflake. An attacker with administrative access cannot delete ACCOUNT_USAGE history, but your investigation should not depend on access to the account under investigation. Ship the views to your SIEM (see the SIEM Log Source Onboarding Checklist).
  • Record your edition. If you are on Standard Edition, ACCESS_HISTORY is not available; lean harder on QUERY_TEXT parsing and plan for the gap.

Mapping detections to ATT&CK and frameworks

DetectionMITRE ATT&CKNIST
Password login without second factor, new IP, unexpected clientT1078.004 Valid Accounts: Cloud AccountsCSF 2.0 DE.CM-03; SP 800-53 AC-2, SI-4
Spraying and stuffingT1110.004 Credential StuffingSP 800-53 SI-4
Discovery burstT1087.004 Account Discovery: Cloud AccountCSF 2.0 DE.AE-02
Sensitive column reads, large unloadT1530 Data from Cloud StorageSP 800-53 AU-6
Unload to another cloud or accountT1537 Transfer Data to Cloud AccountCSF 2.0 DE.CM-03

Snowflake is a data warehouse rather than object storage, so T1530 is the closest fit rather than an exact one. Treat the mapping as a coverage aid, not a scoring exercise.

Rolling out and testing detections

  1. Start with detection 1. Run it over the last 90 days to find every user still logging in with a password and no second factor. That list is both your first alert baseline and a hardening backlog.
  2. Baseline service users. For each service user, record expected IPs, client application IDs, credential IDs and typical ROWS_UNLOADED. Store the baseline as a table so detections can join to it.
  3. Add the sequence detection. COPY INTO plus GET in one session is low volume in most accounts and high value.
  4. Test safely. In a non-production account, have a test user run a discovery burst, create a temporary stage, unload a dummy table and GET it. Confirm every step appears and every alert fires within the expected latency.
  5. Document each rule. Use the Detection Rule Documentation Template to record the view, columns, threshold, owner and response for each.
  6. Review quarterly. Snowflake adds columns (AGENTS_INFO is a recent example) and deprecates others (ROWS_PRODUCED). Check the view pages for changes each quarter.

Common failure patterns

  • Treating ACCOUNT_USAGE as real time. Alert logic that expects rows within minutes silently misses events that arrive two or three hours later.
  • Trusting REPORTED_CLIENT_TYPE. Allowlisting a client name as "safe" gives an attacker a free pass, because the value is self reported.
  • Ignoring NULL user failures. Failures where USER_NAME is NULL are dropped by many joins, hiding probes against unknown users and invalid OAuth clients.
  • No time zone normalisation. Mixing UTC EVENT_TIMESTAMP with local START_TIME breaks correlation windows.
  • Alerting on every SHOW statement. BI tools issue discovery queries constantly. Baseline per user and alert on change, not presence.
  • A powerful, unmonitored collector. The identity that reads your audit views becomes a high value target if it uses a password or has broad roles.
  • No retention beyond a year. Infostealer credentials can sit unused for a long time, and Mandiant reported credentials that had gone unrotated for years. Investigations may need history older than 365 days.

Practitioner checklist

  • Create a dedicated, key pair or workload identity authenticated service user and least privilege role for audit view collection.
  • Ingest LOGIN_HISTORY, SESSIONS, QUERY_HISTORY and (on Enterprise Edition or higher) ACCESS_HISTORY incrementally with latency aware overlap.
  • Alert on successful password logins with a NULL SECOND_AUTHENTICATION_FACTOR, and track the remaining service user exceptions to zero.
  • Baseline IPs, client application IDs and credential IDs per service user and alert on drift.
  • Build the COPY INTO plus GET session detection and a temporary stage creation detection.
  • Flatten ACCESS_HISTORY base objects and alert on first time or bulk reads of sensitive columns.
  • Watch OBJECT_MODIFIED_BY_DDL for grants, policy removal and user changes.
  • Normalise time zones and correlate on SESSION_ID.
  • Test every detection end to end in a non-production account and document it.
  • Retain view exports outside Snowflake for longer than 365 days.

Standards and references

Related NHI Mgmt Group resources: Snowflake Security Guide · Snowflake Account Compromise Playbook · Service Accounts in Snowflake Guide · Okta System Log Detection Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.