Expand my Community achievements bar.

How to create a new Named Right so users can interact with data via Snowflake External Account?

Avatar

Level 2

Hi,

 

Is it possible to create a new Named Right so users can interact with data via Snowflake External Account in workflows?

 

Testing shows that only possible via Admin access, and we need to separate out for standard users to run BAU queries via the external account for Snowflake.

 

Thanks,

Wayne

 

 

4 Replies

Avatar

Community Advisor

Hello @waynea40432451 

 

Create a new right by specifying your chosen label.

The Name field must take the following format user:base@server, where :

  • user corresponds with the name of the user in the external database.

  • base corresponds with the name of the external database.

  • server corresponds with the name of the external database server.

Please find more info here.

 

Br,

Avatar

Level 2

Thanks for the response and link through to guide.

I have tried to follow the guide but the 'name' field is limited to 64 characters and I need more than that for full string. Any tips on how to extend this please? I've tried to create an extension to the xktgroup schema but that's not worked.

 

Thanks,

Wayne

Avatar

Community Advisor

Hello @waynea40432451,

 

Extending the schema worked for me. Did you update the database structure after extending the schema ? Clear cache, disconnect and reconnect ?

 

Br,

Avatar

Level 1

 

It is indeed possible to create a new Named Right that allows users to interact with data via a Snowflake External Account without requiring full Admin access. This approach ensures a secure and role-based method for standard users to run their BAU queries. Here's how you can approach it:

1. Define Role-Based Access

Named Rights can be created to define specific permissions tied to a Snowflake External Account. To achieve this:

  • Identify the exact operations or queries users need to perform via the external account.
  • Limit access to only the necessary actions to maintain a principle of least privilege.

2. Use Snowflake’s Role Hierarchy

Snowflake allows for granular permission control using roles. Create a new role for standard users and assign permissions that align with BAU activities:

  • Grant access to the external account.
  • Assign specific privileges such as USAGE, SELECT, or EXECUTE on the required objects (databases, schemas, or tables).

3. Example Configuration

Below is an example of how to configure a Named Right for this purpose:

 

Copy code
-- Create a custom role for BAU queries CREATE ROLE BAU_QUERY_ROLE; -- Grant privileges to the role for external account access GRANT USAGE ON EXTERNAL ACCOUNT <External_Account_Name> TO ROLE BAU_QUERY_ROLE; GRANT SELECT ON DATABASE <Database_Name> TO ROLE BAU_QUERY_ROLE; -- Assign the role to the necessary users GRANT ROLE BAU_QUERY_ROLE TO USER <User_Name>;
 

4. Testing and Validation

Once the Named Right and roles are created:

  • Test access with a standard user account assigned to the new role.
  • Confirm users can execute their BAU queries via the external account.
  • Verify that they are restricted from performing admin-level tasks.

5. Document and Monitor

Clearly document this new Named Right for governance purposes and regularly monitor its use to ensure compliance with your organization's data access policies.