The BloodHound extension for Snowflake provides a powerful way to visualize access control and potential attack paths within a Snowflake environment. By mapping key entities such as Users, Roles, Databases, Warehouses, and Integrations, along with the permissions that connect them, this extension enables security teams to gain a comprehensive understanding of their Snowflake landscape. The extension leverages Snowflake’s Role-Based Access Control (RBAC) model, allowing organizations to identify and address attack paths in their Snowflake tenants. With this tool, users can explore how access is granted, track potential attack paths, and implement effective security strategies to mitigate risk in their Snowflake accounts.
I recommend reading my Mapping Snowflake's Access Landscape blogpost from June of 2024 to understand why Snowflake was interesting to me and to understand some of the types of questions that we can begin to ask with this model.
NOTE: I expect that over time we will develop a more robust/specific collector for SNOWHound, but in the short term it seemed simpler to leverage Snowflake's fantastic query interface.
The first step is to collect the graph-relevant data from Snowflake. The cool thing is that this is actually a relatively simple process. I’ve found that Snowflake’s default web client, Snowsight, does a fine job gathering this information. You can navigate to Snowsight once you’ve logged in by clicking on the Query data button at the top of the Home page.
Once there, you will have the opportunity to execute commands. This section will describe the commands that collect the data necessary to build the graph. My parsing script is built for CSV files that follow a specific naming convention. Once your command has returned results, click the download button (downward pointing arrow) and select the “Download as .csv” option.
The model supports Accounts, Applications, Databases, Roles, Users, and Warehouses. This means we will have to query those entities, which will serve as the nodes in our graph. This will download the file with a name related to your account. My parsing script expects the output of certain commands to be named in a specific way. The expected name will be shared in the corresponding sections below.
I’ve found that I can query Applications, Databases, Roles, and Users as an unprivileged user. However, this is different for Accounts, which require ORGADMIN, and Warehouses, which require instance-specific access (e.g., ACCOUNTADMIN).
- Command: SELECT * FROM snowflake.organization_usage.accounts WHERE account_locator = CURRENT_ACCOUNT();
- File Name: accounts.csv
- Command: SHOW APPLICATIONS;
- File Name: applications.csv
- Command: SELECT * FROM snowflake.account_usage.databases;
- File Name: databases.csv
- Command: SHOW SCHEMAS;
- File Name: schemas.csv
- Command: SELECT * FROM snowflake.account_usage.roles;
- File Name: roles.csv
- Command: SELECT * FROM snowflake.account_usage.users;
- File Name: users.csv
- Command: SHOW WAREHOUSES;
- File Name: warehouses.csv
Note: As mentioned above, users can only enumerate warehouses for which they have been granted privileges. One way to grant a non-ACCOUNTADMIN user visibility of all warehouses is to grant the MANAGE WAREHOUSES privilege.
- Command: SHOW INTEGRATIONS;
- File Name: integrations.csv
Finally, we must gather information on privilege grants. These are maintained in the ACCOUNT_USAGE schema of the default SNOWFLAKE database. By default, these views are only available to the ACCOUNTADMIN role. Still, users not granted USAGE of the ACCOUNTADMIN role can be granted the necessary read access via the SECURITY_VIEWER database role. The following command does this (if run as ACCOUNTADMIN):
GRANT DATABASE ROLE snowflake.SECURITY_VIEWER TO <Role>
Once you have the necessary privilege, you can query the relevant views and export them to a CSV file. The first view is grants_to_users, which maintains a list of which roles have been granted to which users. You can enumerate this list using the following command. Then save it to a CSV file and rename it grants_to_users.csv.
SELECT * FROM snowflake.account_usage.grants_to_users;
The final view is grants_to_roles, which maintains a list of all the privileges granted to roles. This glue ultimately allows users to interact with the different Snowflake entities. This view can be enumerated using the following command. The results should be saved as a CSV file named grants_to_roles.csv.
SELECT * FROM snowflake.account_usage.grants_to_roles WHERE GRANTED_ON IN ('ACCOUNT', 'APPLICATION', 'DATABASE', 'INTEGRATION', 'ROLE', 'SCHEMA', 'USER', 'WAREHOUSE');
After you've collected the relevant data from your Snowflake tenant, you must convert it from csv to a BloodHound OpenGraph payload. This is done via the snowhound.ps1 script found in this repository.
-
In a PowerShell terminal, navigate to the folder where the Snowflake csv files are located.
-
Load snowhound.ps1 into your PowerShell session:
. ./snowhound.ps1
- Execute the Invoke-SnowHound function:
Invoke-SnowHound
SnowHound will output a payload to your current working directory called snowhound_output.json
- Upload the payload via BloodHound's File Ingest page
If you do not have a Snowflake environment or if you want to test out Snowhound before collecting from your own production environment, we've included a sample data set at ./samples/example.json.
The schema defines the structure and relationships between various entities in the Snowflake environment, which are critical for mapping access and attack paths. In this extension, the schema consists of several key node types, including SNOWAccount, SNOWUser, SNOWRole, SNOWWarehouse, SNOWDatabase, and SNOWIntegration. These nodes are interconnected through edges that represent permissions, access grants, and roles, showing how users and services interact with Snowflake resources.
The schema allows you to visualize the relationships between users, roles, databases, and other entities in your Snowflake account, providing a comprehensive view of your environment’s security posture. By defining these entities and their permissions, the schema enables you to identify potential attack paths, privilege escalation opportunities, and access risks. Each node type is linked through explicit access permissions, ensuring a clear mapping of how users and roles can exploit vulnerabilities or gain access to sensitive data.
Below is the complete set of nodes and edges as defined in the model.
Nodes correspond to each object type.
Edges capture every relationship; who contains what, membership, view vs. manage permissions, etc.
NOTE: I need to go back and add SNOWContains edges from the SNOWAccount to all of the components of the account. NOTE: I need to go back and document all of the edges to and from SNOWApplication and SNOWSchema nodes.
Edge Type | Source | Target | Travesable |
---|---|---|---|
SNOWUsage |
SNOWApplication |
SNOWDatabase |
y |
SNOWUsage |
SNOWRole |
SNOWDatabase |
y |
SNOWUsage |
SNOWRole |
SNOWIntegration |
y |
SNOWUsage |
SNOWRole |
SNOWRole |
y |
SNOWUsage |
SNOWRole |
SNOWUser |
y |
SNOWUsage |
SNOWRole |
SNOWWarehouse |
y |
SNOWOwnership |
SNOWRole |
SNOWDatabase |
y |
SNOWOwnership |
SNOWRole |
SNOWIntegration |
y |
SNOWOwnership |
SNOWRole |
SNOWRole |
y |
SNOWOwnership |
SNOWRole |
SNOWUser |
y |
SNOWOwnership |
SNOWRole |
SNOWWarehouse |
y |
SNOWApplyBudget |
SNOWRole |
SNOWDatabase |
n |
SNOWApplyBudget |
SNOWRole |
SNOWWarehouse |
n |
SNOWAudit |
SNOWRole |
SNOWAccount |
n |
SNOWModify |
SNOWRole |
SNOWDatabase |
n |
SNOWModify |
SNOWRole |
SNOWWarehouse |
n |
SNOWMonitor |
SNOWRole |
SNOWAccount |
n |
SNOWMonitor |
SNOWRole |
SNOWDatabase |
n |
SNOWMonitor |
SNOWRole |
SNOWWarehouse |
n |
SNOWOperate |
SNOWRole |
SNOWWarehouse |
n |
SNOWApplyAggregationPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyAuthenticationPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyMaskingPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyPackagesPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyPasswordPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyProtectionPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplyRowAccessPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWApplySessionPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWAttachPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWBindServiceEndpoint |
SNOWRole |
SNOWAccount |
n |
SNOWCancelQuery |
SNOWRole |
SNOWAccount |
n |
SNOWCreateAccount |
SNOWRole |
SNOWAccount |
n |
SNOWCreateApiIntegration |
SNOWRole |
SNOWAccount |
n |
SNOWCreateApplication |
SNOWRole |
SNOWAccount |
n |
SNOWCreateApplicationPackage |
SNOWRole |
SNOWAccount |
n |
SNOWCreateComputerPool |
SNOWRole |
SNOWAccount |
n |
SNOWCreateCredential |
SNOWRole |
SNOWAccount |
n |
SNOWCreateDataExchangeListing |
SNOWRole |
SNOWAccount |
n |
SNOWCreateDatabase |
SNOWRole |
SNOWAccount |
n |
SNOWCreateDatabaseRole |
SNOWRole |
SNOWDatabase |
n |
SNOWCreateExternalVolume |
SNOWRole |
SNOWAccount |
n |
SNOWCreateIntegration |
SNOWRole |
SNOWAccount |
n |
SNOWCreateNetworkPolicy |
SNOWRole |
SNOWAccount |
n |
SNOWCreateReplicationGroup |
SNOWRole |
SNOWAccount |
n |
SNOWCreateRole |
SNOWRole |
SNOWAccount |
n |
SNOWCreateSchema |
SNOWRole |
SNOWDatabase |
n |
SNOWCreateShare |
SNOWRole |
SNOWAccount |
n |
SNOWCreateUser |
SNOWRole |
SNOWAccount |
n |
SNOWCreateWarehouse |
SNOWRole |
SNOWAccount |
n |
SNOWExecuteDataMetricFunction |
SNOWRole |
SNOWAccount |
n |
SNOWExecuteManagedAlert |
SNOWRole |
SNOWAccount |
n |
SNOWExecuteManagedTask |
SNOWApplication |
SNOWAccount |
n |
SNOWExecuteManagedTask |
SNOWRole |
SNOWAccount |
n |
SNOWExecuteTask |
SNOWApplication |
SNOWAccount |
n |
SNOWExecuteTask |
SNOWRole |
SNOWAccount |
n |
SNOWImportShare |
SNOWRole |
SNOWAccount |
n |
SNOWManageGrants |
SNOWRole |
SNOWAccount |
n |
SNOWManageWarehouses |
SNOWRole |
SNOWAccount |
n |
SNOWManagementSharing |
SNOWRole |
SNOWAccount |
n |
SNOWMonitorExecution |
SNOWRole |
SNOWAccount |
n |
SNOWOverrideShareRestrictions |
SNOWRole |
SNOWAccount |
n |
SNOWPurchaseDataExchangeListing |
SNOWRole |
SNOWAccount |
n |
SNOWReferenceUsage |
SNOWRole |
SNOWDatabase |
n |
SNOWUseAnyRole |
SNOWRole |
SNOWIntegration |
n |
- Add support for detailed information on integrations, specifically security integrations associated with SCIM or SSO (type =
SCIM - *
orSAML2
) - Add support for more detailed objects such as Application Roles (these currently show up as unknown objects)
We welcome and appreciate your contributions! To make the process smooth and efficient, please follow these steps:
-
Discuss Your Idea
- If you’ve found a bug or want to propose a new feature, please start by opening an issue in this repo. Describe the problem or enhancement clearly so we can discuss the best approach.
-
Fork & Create a Branch
- Fork this repository to your own account.
- Create a topic branch for your work:
git checkout -b feat/my-new-feature
-
Implement & Test
- Follow the existing style and patterns in the repo.
- Add or update any tests/examples to cover your changes.
- Verify your code runs as expected:
# e.g. dot-source the collector and run it, or load the model.json in BloodHound
-
Submit a Pull Request
- Push your branch to your fork:
git push origin feat/my-new-feature
- Open a Pull Request against the
main
branch of this repository. - In your PR description, please include:
- What you’ve changed and why.
- How to reproduce/test your changes.
- Push your branch to your fork:
-
Review & Merge
- I’ll review your PR, give feedback if needed, and merge once everything checks out.
- For larger or more complex changes, review may take a little longer—thanks in advance for your patience!
Thank you for helping improve this extension! 🎉
Copyright 2025 Jared Atkinson
Licensed under the Apache License, Version 2.0
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless otherwise annotated by a lower-level LICENSE file or license header, all files in this repository are released
under the Apache-2.0
license. A full copy of the license may be found in the top-level LICENSE file.