Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Snowflake Query History
Cyber Security

Snowflake Query History

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Cyber Security

Snowflake query history is the record of SQL statements executed in an account, along with timing, users, and execution details. Security teams use it to spot reconnaissance, bulk extraction, privilege changes, and other suspicious patterns. It is a core hunting source because attacker behavior often leaves a clear query trail.

What Snowflake Query History Reveals

Query history is more than an activity log. In Snowflake, it captures who ran a statement, when it ran, and how the warehouse responded, which turns the log into a practical record of access and data-use behaviour. That makes it useful for understanding legitimate workload patterns, but also for spotting suspicious querying that may indicate reconnaissance, staging, or extraction.

For defenders, the main value is context. A single query may be harmless, but the surrounding sequence can show intent: repeated metadata lookups, unusual table access, broad exports, or privilege-related statements that do not fit the user’s normal role. Query history becomes especially useful when it is read alongside authentication, role change, and data access telemetry.

Why Query History Matters for Detection

Security teams use query history because attackers often leave a trail in the database layer even when other controls miss them. It can expose the early stages of abuse, such as testing permissions, enumerating schemas, or running high-volume reads that precede exfiltration. It is also one of the few places where misuse of legitimate credentials can still be visible after initial access.

That visibility is strongest when analysts look for sequence and context rather than isolated statements. A user querying a familiar schema during business hours looks different from a service account suddenly issuing broad selects across many databases, or an interactive user running statements that touch many objects in a short burst. The signal is often behavioural, not just syntactic.

How Security Teams Use It in Investigations

Query history is a hunting source because it helps reconstruct what happened inside the account after access was obtained. Analysts can use it to identify the first suspicious statement, separate ordinary application activity from manual abuse, and determine whether a compromise involved reconnaissance, privilege change, or bulk data access. It also helps narrow the time window for follow-on review of login activity, role history, and data export events.

It is most valuable when paired with other Snowflake telemetry. Query history alone may show that something unusual happened, but not always whether it was malicious. When combined with access history, authentication records, and role assignments, it becomes a stronger basis for scoping impact and deciding whether the activity was administrative, automated, or adversarial.

For a broader defensive pattern on database auditing and investigation workflows, see Database Audit Log Detection Guide and Database Breach Response Playbook.

What Good Monitoring Looks Like

Effective monitoring starts with knowing what normal query behaviour looks like for each workload, role, and automation path. That means understanding baseline statement types, typical execution times, expected warehouse usage, and the common objects each actor should touch. Without that baseline, query history becomes too noisy to support investigation.

Defenders should also treat query history as part of a wider detection pipeline rather than a standalone control. Repeated failed queries, access to unusual tables, mass export-style activity, and sudden shifts in privilege-related statements are all more meaningful when correlated with session origin, authentication method, and role context. The operational question is not just “what was run?”, but “does this sequence make sense for this actor?”

Snowflake-specific hardening and monitoring patterns are covered in Snowflake Security Guide, while breach context and attacker tradecraft are discussed in Snowflake breach and UNC5537 (Snowflake customer data theft) threat actor profile.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKT1213 — Data from Information RepositoriesQuery history helps detect repository-style collection and bulk data access patterns.
Recommendation — Map suspicious query sequences to T1213 and hunt for bulk extraction from databases.
NIST SP 800-53 Rev 5AU-6 — Audit Record Review, Analysis, and ReportingQuery history is an audit source that supports review and analysis of database activity.
AU-12 — Audit Record GenerationThe term depends on generating detailed audit records for SQL execution and user activity.
Recommendation — Review Snowflake query history under AU-6 to identify anomalous statements and escalation paths. Ensure Snowflake generates sufficiently detailed query audit records for investigation and hunting.
NIST CSF 2.0DE.CM-09 — Monitoring for Anomalous ActivityQuery history is a monitoring source used to detect unusual account and data-access behaviour.
Recommendation — Use query history in DE.CM-09 monitoring to flag unusual SQL patterns and suspicious access.
OWASP Non-Human Identity Top 10NHI-05 — Overprivileged NHIQuery trails often expose excessive privilege use by service users and automated actors.
Recommendation — Inspect query history for overprivileged service and workload accounts performing access beyond job needs.

Practitioner Guidance

What to watch for: Treat query history as an investigation pivot, not a passive archive. The most useful queries are often the ones that do not fit the surrounding user context, such as unexpected bulk reads, unusual schema exploration, or privilege-related statements that appear outside normal change windows.

Governance implication: Ownership matters because query history spans identity, access, and data movement. Security, platform, and data teams should agree on which actors, warehouses, and statement patterns require review so that suspicious activity is not lost in operational noise. That shared ownership is what turns telemetry into hunting capability.

Practitioner takeaway: Query history is strongest when it is used to reconstruct intent, not just to confirm execution.

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.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org