Snowflake

Overview

Configuring a cloud source in Scope is a two-step process.

  • Generating Snowflake credentials and account details in the Snowflake portal. Please refer to Section 1 – Snowflake Setup

  • Setting up the Snowflake cloud source in the Scope application. Please refer to Section 2 – Scope Setup

Snowflake Setup

To get started, you’ll need to obtain or generate the following credentials –

  1. Account Identifier
  2. Username
  3. Thumbprint ID (Public Key Fingerprint)
  4. Passphrase
  5. Private Key
  6. Key Expiry Date
  7. Warehouse
  8. Database
  9. Role

Step 1: Obtain the Account Identifier

The account identifier uniquely identifies a Snowflake account. Obtain it using one of the following methods:

Using Snowsight (Web Interface):

  • Sign in to Snowsight.

  • Open the account selector in the lower-left corner and select View account details.

  • The Account Details dialog displays the account identifier in the format: <organization_name>-<account_name>.

    For example: if the organization name is myorg and the account name is prod_account, the account identifier will be myorg-prod_account.

Using SnowSQL:

  • Connect to Snowflake and execute the following SQL command:

    SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();
    

    The result will be the full account identifier in the format required for connection

Step 2: Generate the Private Key

  • Open a terminal window and execute the following command to generate an encrypted private key:

    openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8
    

Note: This command will prompt for a passphrase. Create a strong passphrase that complies with your organization’s security standards. Please refer here for more information about creating a strong passphrase.

Step 3: Obtain the Thumbprint (Public Key Fingerprint) and Username

  • Once the private key is generated, a corresponding public key must be generated and assigned to a Snowflake user.

    Please refer to the Snowflake Key Pair Auth documentation for details on assigning the public key to a user and the required privileges.

  • Once the public key is assigned, execute the following command in SnowSQL to retrieve the thumbprint (user’s public key fingerprint):

    DESC USER example_user
    ->> SELECT SUBSTR(
         (SELECT "value" FROM $1
              WHERE "property" = 'RSA_PUBLIC_KEY_FP'),
         LEN('SHA256:') + 1) AS key;
    
  • (Optional) If a network policy is applied to the Snowflake account or to this user, add the following Pondurance IP addresses to the policy’s allowed IP list (or to a network rule referenced by the policy):

    1. 3.130.184.81
    2. 13.59.73.171
    3. 18.218.168.118

    A user-level network policy overrides the account-level policy, so if both exist, update the user-level policy.

    Please refer to the Snowflake Network Policies documentation for details on managing network policies.

Step 4: Identify Warehouse, Database & User Role Details

  • Warehouse: Identify the Snowflake warehouse in which all operations (queries, DML) are performed.
  • Database: Identify the database where ingestion queries will be executed. Scope fetches events from the ACCOUNT_USAGE schema, which is typically available in the SNOWFLAKE database.
  • User Role: Identify the role (predefined or custom) assigned to the user to access the ACCOUNT_USAGE schema.

The Account Identifier, Passphrase, Private Key, Key Expiry Date (based on your key rotation policy), Passphrase, Thumbprint ID, Username, Warehouse, Database, and Role are to be configured in Scope Setup: Step 1 for initiating the Snowflake log ingestion.


Scope Setup

Step 1: Snowflake Cloud Source Registration in the Scope Application

In the Scope application, to register a Snowflake cloud source, navigate to the cloud source registration page.

  • Log into the Scope application.

  • Select the required organization from the Organization dropdown.

  • Select Administration from the side menu.

  • Click on the Cloud sources tab.

  • Click on the +Add Source button.

  • In Step 1 of the Add Source wizard, search for Snowflake, select the cloud source and click Next.

  • In Step 2 of the Add Source wizard, provide the connection parameters

    • Site: The user-defined name for the Snowflake cloud source.

    • Account Identifier: The account identifier obtained in Snowflake Setup: Step 1.

    • Passphrase: The passphrase used to generate the private key in Snowflake Setup: Step 2.

    • Private Key: The private key generated in Snowflake Setup: Step 2.

    • Key Expiry Date: The expiry date of the key defined in Snowflake Setup: Step 2.

    • Thumbprint ID: The thumbprint ID (public key fingerprint) obtained in Snowflake Setup: Step 3.

    • Username: The Snowflake username to which the public key is assigned (from Snowflake Setup: Step 3).

    • Warehouse: The warehouse name identified in Snowflake Setup: Step 4.

    • Database: The database name (SNOWFLAKE) identified in Snowflake Setup: Step 4.

    • Role: The role assigned to the user, identified in Snowflake Setup: Step 4.

    • Polling Interval: The polling interval for making periodic API calls to the Snowflake cloud source. The user can select the time interval from the dropdown.

    • Contact Email: The email address of the person who registers the Snowflake cloud source in Scope.

Once the required connection parameters are entered, the Snowflake cloud source registration is complete in Scope and is ready for ingestion of Snowflake logs.