This week we’re looking into some new security features that Snowflake has recently released
As you might know, the default idle time for Snowflake sessions is 4 hours BUT that was recently adjusted; you can now change this value on certain levels.
Because we can finetune these numbers, Management has asked us to enforce it for some of our new colleagues :
The challenge for this week :
– Create 2 users
– User 1 should have a max idle time of 8 minutes in the old Snowflake UI
– User 2 should have a max idle time of 10 minutes in SnowSQL and in their communication with Snowflake from tools like Tableau
One of the things we’d be looking for looks like this :

Remember, if you want to participate:
My solutions for weeks 24 – 32 🙂
Here’s my solution
Two step approach:
1. Create a dbt macro that queries the Session_Policies object in the snowflake share. https://github.com/dsmdavid/frostyfridays-sf/blob/main/models/challenge_32.sql
2. Create a macro that is run in the pre_hook of (init_for_challenge) and another that run as the post-hook (clean_up)
It will take some time, but policies will be shown in the view from the share.
My quick solution
A nice feature to know of..