turbot/snowflake
steampipe plugin install snowflake

Table: snowflake_session_policy - Query Snowflake Session Policies using SQL

A Snowflake Session Policy is a feature in Snowflake that allows users to define and enforce specific settings or behaviors for a user session. These policies can include setting the time zone, date and time formats, and other session parameters. Snowflake Session Policies help in maintaining consistency and control over user sessions.

Table Usage Guide

The snowflake_session_policy table provides insights into session policies within Snowflake. As a database administrator, explore specific details about each session policy, including its name, comment, and the values of the parameters it sets. Utilize it to uncover information about session policies, such as their current state, and the specific settings or behaviors they enforce.

Examples

Basic info

Identify the policies regarding session timeouts within your Snowflake environment. This can help manage idle sessions and optimize resource usage.

select
name,
database_name,
schema_name,
session_idle_timeout_mins,
session_ui_idle_timeout_mins
from
snowflake_session_policy;
select
name,
database_name,
schema_name,
session_idle_timeout_mins,
session_ui_idle_timeout_mins
from
snowflake_session_policy;

List policies with idle timeout more than an hour

Explore the policies that have an idle timeout exceeding one hour. This query can be useful in identifying potential areas for improved resource allocation and efficiency.

select
name,
database_name,
schema_name,
session_idle_timeout_mins,
session_ui_idle_timeout_mins
from
snowflake_session_policy
where
session_idle_timeout_mins > 60
or session_ui_idle_timeout_mins > 60;
select
name,
database_name,
schema_name,
session_idle_timeout_mins,
session_ui_idle_timeout_mins
from
snowflake_session_policy
where
session_idle_timeout_mins > 60
or session_ui_idle_timeout_mins > 60;

Schema for snowflake_session_policy

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
accounttextThe Snowflake account ID.
commenttextComment for this policy.
created_ontimestamp with time zoneDate and time of the creation of session policy.
database_nametextName of the database policy belongs.
kindtextType of the snowflake policy.
nametextIdentifier for the session policy.
ownertextName of the role that owns the policy.
regiontextThe Snowflake region in which the account is located.
schema_nametextName of the schema in database policy belongs.
session_idle_timeout_minsbigintTime period in minutes of inactivity with either the web interface or a programmatic client.
session_ui_idle_timeout_minsbigintTime period in minutes of inactivity with the web interface.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- snowflake

You can pass the configuration to the command with the --config argument:

steampipe_export_snowflake --config '<your_config>' snowflake_session_policy