For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudCortex Cloud Runtime

How to onboard Snowflake

Onboard Snowflake as a data source in Cortex Cloud.

This connector includes the following capabilities and sub-capabilities (if applicable):

  • SaaS Posture Configuration Monitoring: Detect, monitor and alert on settings of your SaaS application. This capability is available with any active Cortex XSIAM, Cortex Cloud Runtime Security, or Cortex Cloud Posture Security license.

    • saas-posture-config-remediation: Help remediate the misconfigured security settings of your SaaS application.

  • Identity Posture: Maintain visibility and control over [app name] identities, including users, groups, roles, and privileges. This capability is available with any active Cortex XSIAM, Cortex Cloud Runtime Security, Cortex Cloud Posture Security, or Cortex Data Security license.

  • Data Security: Discover and classify sensitive data across your Snowflake environment. This capability is available with any active Cortex XSIAM, Cortex Cloud Runtime Security, Cortex Cloud Posture Security, or Cortex Data Security license.

Security Posture and Identity Posture

How to configure the Snowflake connector

Cortex XSIAM connects to a Snowflake SDK to scan your Snowflake instance for misconfigured settings and to a Snowflake API to run identity scans for account risks. Access is granted through Programmatic Access Token (PAT) authorization. You run an SQL script in Snowflake that creates a custom role, configures network guardrails, provisions a dedicated service user, and generates a PAT token.

To access Snowflake, Cortex XSIAM requires the following information, which you will specify during the connection process.

  • Account Locator As An Identifier: The unique, system-generated alphanumeric identifier assigned by Snowflake to your specific account instance. The SQL script generates and returns this value.

  • Service User PAT: A secure, long-lived Programmatic Access Token for a dedicated service user account. The SQL script generates and returns this value. Cortex XSIAM uses this token to securely connect to your Snowflake instance.

Perform the following procedures in the order that they appear below.

Task 1: Verify Administrator Permissions

Required Permissions: The account you use to run the SQL script must be assigned to the ACCOUNTADMIN role.

  1. From the left navigation pane in Snowflake, select Admin → Users & Roles.

  2. Select the name of the user whose roles you want to verify.

  3. On the user information page, locate the Granted Roles section and verify that the user is assigned to the ACCOUNTADMIN role. If not, grant the role before proceeding.

Task 2: Run the SQL Script to Generate Credentials

  1. Open a web browser, navigate to the Snowflake login page, and log in with the administrator account you verified in Task 1.

  2. From the left navigation pane, select Projects → Workspaces.

  3. From the Workspaces navigation pane, select + Add new → SQL file.

  4. Use the dropdown menus in the top-right corner of the query editor to select the ACCOUNTADMIN role, an active virtual warehouse, and the database (and associated schema) where the network rules will be created.

  5. Paste the following SQL statements into the query editor. Replace the placeholder variables with values specific to your Snowflake environment:

    • Replace all occurrences of <warehouse_name> and <custom_role_name> with names for the new warehouse and custom role.

    • Replace <network_rule_name> and <network_policy_name> with names for your network guardrails.

    • Replace <ip_address_1>, <ip_address_2>, and so on with the SSPM IP addresses required for your region.

    • Replace all occurrences of <username> with the name for the new service user, and replace <pat_name> with a name for your Programmatic Access Token.

    // ============================================================================
    // 1. COMPUTE & SECURITY ROLE SETUP
    // ============================================================================
    
    CREATE OR REPLACE WAREHOUSE <warehouse_name> WITH
      WAREHOUSE_TYPE = STANDARD
      GENERATION = '1'
      WAREHOUSE_SIZE = XSMALL
      AUTO_SUSPEND = 30
      AUTO_RESUME = TRUE
      INITIALLY_SUSPENDED = TRUE;
    
    CREATE OR REPLACE ROLE <custom_role_name>;
    
    GRANT USAGE ON WAREHOUSE <warehouse_name> TO ROLE <custom_role_name>;
    GRANT MONITOR ON ACCOUNT TO ROLE <custom_role_name>;
    GRANT APPLY PASSWORD POLICY ON ACCOUNT TO ROLE <custom_role_name>;
    GRANT APPLY AUTHENTICATION POLICY ON ACCOUNT TO ROLE <custom_role_name>;
    GRANT APPLY SESSION POLICY ON ACCOUNT TO ROLE <custom_role_name>;
    GRANT DATABASE ROLE SNOWFLAKE.SECURITY_VIEWER TO ROLE <custom_role_name>;
    
    // ============================================================================
    // 2. NETWORK GUARDRAILS CONFIGURATION
    // ============================================================================
    
    CREATE OR REPLACE NETWORK RULE <network_rule_name>
      MODE = INGRESS
      TYPE = IPV4
      VALUE_LIST = ('<ip_address_1>', '<ip_address_2>');
    
    CREATE OR REPLACE NETWORK POLICY <network_policy_name>
      ALLOWED_NETWORK_RULE_LIST = ( '<network_rule_name>' );
    
    // ============================================================================
    // 3. SERVICE USER PROVISIONING
    // ============================================================================
    
    CREATE OR REPLACE USER <username>
      TYPE = SERVICE
      DEFAULT_WAREHOUSE = <warehouse_name>
      DEFAULT_ROLE = <custom_role_name>
      NETWORK_POLICY = <network_policy_name>;
    
    GRANT ROLE <custom_role_name> TO USER <username>;
    
    // ============================================================================
    // 4. METADATA EXTRACTION & AUTHENTICATION TOKEN GENERATION
    // ============================================================================
    
    EXECUTE IMMEDIATE $$
    DECLARE
         account_locator STRING;
         pat_secret STRING;
         rs RESULTSET;
    BEGIN
    
    SELECT UPPER(
       REPLACE(
         t.value:host::string,
         '.snowflakecomputing.com',
         ''
        )
      )
    INTO :account_locator
    FROM TABLE(FLATTEN(INPUT => PARSE_JSON(SYSTEM$ALLOWLIST()))) t
    WHERE t.value:type = 'SNOWFLAKE_DEPLOYMENT';
    
    EXECUTE IMMEDIATE '
      ALTER USER IF EXISTS <username>
      ADD PAT <pat_name>
      ROLE_RESTRICTION = ''<custom_role_name>''
      DAYS_TO_EXPIRY = 365
    ';
    
    SELECT $2::STRING
    INTO :pat_secret
    FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
    
    rs := (
       SELECT 'Account Locator As An Identifier' AS ATTRIBUTE, :account_locator AS VALUE
       UNION ALL
       SELECT 'Service User PAT', :pat_secret
    );
    
    RETURN TABLE(rs);
    
    END;
    $$;
  6. Click the Run button in the upper-left corner of the query editor to execute the SQL statements.

  7. In the Results area, copy the Account Locator As An Identifier and Service User PAT values and store them securely in a text file.

    Do not continue to the next step unless you have copied both values. You must provide them to Cortex XSIAM during the onboarding process.

Task 3: Connect Snowflake to Cortex XSIAM

  1. In Cortex XSIAM, navigate to Settings → Data Sources & Integrations.

  2. Click + Add new.

  3. In the Add Data Source page, search for Snowflake.

  4. Under Recommended, hover over the new Snowflake integration and click Add Instance to launch the configuration wizard.

  5. Under the Capabilities tab, enter a name for your application.

  6. Under Select Capabilities, select Security Posture, Identity Posture, or both. Click Next.

  7. Under the Connection tab, enter the Account Locator As An Identifier and Service User PAT details.

  8. Under the Configuration tab, select a Sync Interval. Choose a meaningful Tag to distinguish between various applications in different environments.

  9. A confirmation message shows that Snowflake is successfully connected. Confirm the Summary details and click Save instance.

Data Security

How to configure the Snowflake connector

Task 1: Verify Administrator Permissions

The account you use to run the SQL script must be assigned to the ACCOUNTADMIN role.

  1. From the left navigation pane in Snowflake, select Admin → Users & Roles.

  2. Select the name of the user whose roles you want to verify.

  3. On the user information page, locate the Granted Roles section and verify that the user is assigned to the ACCOUNTADMIN role. If not, grant the role before proceeding.

Task 2: Configure egress in Cortex Gateway

You must set up an egress configuration in Cortex Gateway to allow Cortex to send requests to your Snowflake account.

  1. Copy the Account/Server URL from your Account Details in Snowflake.

  2. Navigate to the Cortex gateway and go to Permission Management → Egress Configuration.

  3. Click +Path to add a new path.

  4. Set the Flow to Snowflake and the Path to your Snowflake Account/Server URL, then click Add.

Task 3: Connect Snowflake to Cortex XSIAM

  1. In Cortex XSIAM, navigate to Settings → Data Sources & Integrations.

  2. Click + Add new.

  3. In the Add Data Source page, search for Snowflake.

  4. Under Recommended, hover over the new Snowflake integration and click Add to launch the configuration wizard.

  5. Under the Capabilities tab, enter an instance name.

  6. If necessary, check the My Snowflake is protected by network policies toggle and enter the Provider and Region.

  7. Under Select Capabilities, select Data Security and click Next.

  8. Under the Connection tab, enter your Account Identifier. (You can find this in your Account Details in Snowflake.)

  9. If you checked My Snowflake is protected by network policies, you will be provided with an IPs List. You must allow access from the listed IPs in Snowflake. (Create a new policy or update an existing policy to allow the IPs on the Governance & Security → Network Policies page.)

  10. Enter your User Name and Login Name. On the account details page, these are the values with the same names. If you use the DESC USER <username> query, the User Name is the NAME and the Login Name is the LOGIN_NAME.

You can now generate a script to run in Snowflake. To complete the setup now, proceed to task 4.

If you want to run the script later, you can leave the setup in a pending state and return to it when you're ready. To do so:

  1. Click Save.

  2. Click Next.

  3. On the Summary page, verify that the table lists the Data Security capability with a Verification Pending status.

  4. Click Create instance.

The incomplete instance configuration is saved and you can reopen it to finish the setup once the script has run.

Task 4: Generate and run the script

  1. Click Generate Script.

  2. Copy or download the script.

  3. Open a web browser, navigate to the Snowflake login page, and log in with the administrator account you verified in Task 1.

  4. From the left navigation pane, select Projects → Workspaces.

  5. From the Workspaces navigation pane, select + Add new → SQL file.

  6. Use the dropdown menus in the top-right corner of the query editor to select the ACCOUNTADMIN role, an active virtual warehouse, and the database (and associated schema) where the network rules will be created.

  7. Copy the script into the query editor.

  8. Click Run in the upper-left corner of the query editor to execute the SQL statements. (It can take some time for the script to run depending on the number of databases and amount of data in your Snowflake account.)

  9. Click Save.

  10. Click Next.

  11. A confirmation message shows that the instance configuration is successfully completed. Confirm the Summary details and click Create instance.

Snowflake credit consumption estimates

Cortex XSIAM scans your Snowflake instance by running SQL queries through the dedicated virtual warehouse created during setup. Snowflake charges for compute resources based on virtual warehouse execution time, so scans will incur additional credit consumption.

The SQL script provisions an XSMALL warehouse, which consumes 1 credit per hour. The warehouse auto-suspends after 30 seconds of inactivity. Snowflake enforces a 60-second minimum credit charge each time a suspended warehouse resumes.

Use the following formula to estimate daily credit consumption for each scan type:

Daily Scan Uptime (Hours) = ((Maximum of [Scan Time + 30s Suspend Time] or 60s) ÷ 3600s) × (24h ÷ Scan Interval)

Add the daily configuration scan uptime and daily identity scan uptime to calculate total daily warehouse uptime.

Scenario
Daily Configuration Scan Uptime
Daily Identity Scan Uptime
Daily Warehouse Uptime
Daily Credits
Monthly Credits (30 Days)

Worst-case

0.25 h interval, 20 s run = 1.6 h

6 h interval, 100 s run (10k users) = 0.144 h

1.744 h

1.744

52.32

Best-case

24 h interval, 10 s run = 0.017 h

6 h interval, 10 s run (1k users) = 0.067 h

0.084 h

0.084

2.52

To determine the monetary cost, multiply the estimated monthly credits by your organization's Snowflake contract credit rate.

Last updated

Was this helpful?