Snowflake 세션 및 세션 정책

이 항목에서는 Snowflake 세션 및 세션 정책을 설명하고 계정 또는 사용자 수준에서 세션 정책을 구성하는 지침을 제공합니다.

Snowflake 세션

세션은 사용자가 Snowflake에 연결하고 Snowflake 프로그래밍 방식 클라이언트 또는 Snowsight 를 사용하여 성공적으로 인증할 때 시작됩니다. 세션은 ID 공급자(IdP) 세션과는 무관합니다. Snowflake 세션이 만료되었지만 IdP 세션은 활성 상태로 남아 있는 경우, 사용자는 로그인 자격 증명을 다시 입력하지 않고도 Snowflake에 로그인할 수 있습니다(즉, 자동 인증).

By default, a session is maintained indefinitely with continued user activity. After a period of inactivity in the session, known as the idle session timeout, the user must authenticate to Snowflake again. The default idle session timeout is four hours for non-UI (programmatic) sessions and 18 hours for UI sessions (if opted in to BCR-2139). The session policy can modify the idle session timeout period from a minimum of 5 minutes to a maximum of 24 hours.

A session policy can also enforce a maximum session lifespan, which ends the session after a set duration regardless of activity. The configurable range is 0 minutes to 30 days, where a value of 0 means no maximum lifespan is enforced. By default, no maximum lifespan is enforced. These session timeouts apply to the following:

Snowflake에서는 가능하면 기존 세션을 재사용하고 더 이상 세션이 필요하지 않을 때 Snowflake에 대한 연결을 종료할 것을 권장합니다.

Snowsight 세션 만료 및 로그아웃 동작

  • A Snowsight session remains active as long as the user is interacting with the application, has not exceeded the configured idle session timeout, and has not reached the maximum session lifespan (if configured).

  • The session idle timeout is controlled by your organization’s session policy. The default idle timeout is four hours (or 18 hours if opted in to BCR-2139). If there is no activity for longer than this period, the session will expire and you will be logged out automatically.

  • A session policy can also enforce a maximum session lifespan. If configured, the session expires after the specified duration regardless of activity. By default, no maximum lifespan is enforced.

  • In addition to idle timeout and maximum lifespan, session persistence is also affected by authentication cookies:

    • 대부분의 경우 브라우저를 닫았다가 다시 열면 유휴 시간과 관계없이 Snowsight 세션이 종료됩니다.

    • 인증 쿠키가 만료되면(일반적으로 24시간 후), 세션 시간 제한보다 오래 유휴 상태가 아니더라도 다시 로그인해야 합니다.

  • 네트워크 연결이 해제되거나 허용되지 않은 네트워크에서 Snowsight 에 액세스하려고 시도하는 경우 세션이 닫히고 로그아웃될 수 있습니다.

  • 어떤 이유로든 세션이 닫히면 해당 세션과 연결된 실행 중인 모든 쿼리 또는 작업은 짧은 지연 후(보통 몇 분 이내에) 종료됩니다.

참고

Session expiration can occur due to idle timeout, maximum session lifespan, cookie expiration, browser restarts, or network policy violations. Closing your browser or being inactive for an extended period may require you to log in again, even if you have not reached the configured idle timeout.

세션 사용 모니터링

Snowsight 또는 SQL 뷰를 사용하여 활성 세션 및 세션 사용량을 모니터링할 수 있습니다. 자신의 세션을 보거나 SESSIONS 뷰 액세스 권한이 있는 역할을 사용하여 계정의 세션을 볼 수 있습니다. ACCOUNT_USAGE 스키마 SNOWFLAKE 데이터베이스 역할 섹션을 참조하십시오.

SQL:

공유 SNOWFLAKE 데이터베이스의 ACCOUNT USAGE 스키마에서 SESSIONS 뷰를 쿼리하여 세션 사용량을 모니터링합니다.

Snowsight:

탐색 메뉴에서 Governance & security » Network policies`를 선택한 후 :ui:`Sessions 탭을 선택합니다. 세션 ID, 사용자 이름, 시작 시간, 세션에 사용 중인 클라이언트 드라이버, 클라이언트 네트워크 주소, 인증 방법을 검토할 수 있습니다. 시작 시간 위로 마우스를 가져가면 세션이 시작된 정확한 날짜와 시간을 해당 현지 타임존으로 확인할 수 있습니다.

세션 정책

세션 정책은 유휴 세션 시간 제한 기간을 분 단위로 정의하고 기본 유휴 시간 제한 값을 재정의할 수 있는 옵션을 제공합니다. Snowflake에 대한 인증에 성공할 때 시간 초과 기간이 시작됩니다. 세션 정책에 대해 구성 가능한 최소 유휴 시간 제한 값은 5 분입니다.

If a session policy is not set, Snowflake uses a default value of 240 minutes (four hours) for non-UI (programmatic) sessions. For Snowsight sessions, the default is 1080 minutes (18 hours) if opted in to BCR-2139, or 240 minutes (four hours) otherwise.

세션이 만료될 때 사용자는 Snowflake에 다시 인증해야 합니다. 하지만 Snowflake는 사용자 지정 로그아웃 엔드포인트 에 의해 정의된 설정을 적용하지 않습니다.

The session policy can be set for an account or user with configurable idle timeout and maximum session lifespan values to address compliance requirements. If a user is associated with both an account and user-level session policy, the user-level session policy takes precedence. After the session policy is set on the account or user, Snowflake enforces the session policy.

There are two properties that govern the idle timeout behavior:

  • 프로그램 방식 및 Snowflake 클라이언트에 대한 SESSION_IDLE_TIMEOUT_MINS.

  • SESSION_UI_IDLE_TIMEOUT_MINS (Snowsight).

A session policy can also define the maximum session lifespan, regardless of activity. When the maximum lifespan is reached, the user must authenticate again even if the session is still active. The configurable range is 0 to 43200 minutes (30 days).

If a session policy is set but a session lifespan is not defined, Snowflake uses a default value of 0, which means no maximum lifespan is enforced.

There are two properties that govern the maximum lifespan behavior:

  • SESSION_MAX_LIFESPAN_MINS for programmatic and Snowflake clients.

  • SESSION_UI_MAX_LIFESPAN_MINS for Snowsight.

자세한 내용은 세션 정책 관리하기 섹션을 참조하십시오.

세션 정책의 보조 역할

사용자가 Snowflake에 연결하고 세션이 시작되면 사용자는 USE SECONDARY ROLES 명령으로 보조 역할 을 활성화할 수 있습니다. 그러나 보안 관리자는 개별 사용자, 사용자 그룹 또는 전체 계정에 사용할 수 있는 보조 역할을 관리하고 싶을 수 있습니다. 보조 역할을 관리하면 세션이 진행되는 동안 사용자가 사용할 수 있는 권한의 범위를 정하는 데 도움이 됩니다.

이러한 관리 요구 사항을 충족하기 위해 세션 정책에서 ALLOWED_SECONDARY_ROLES 속성을 설정하고 계정 또는 계정의 사용자에 대한 세션 정책을 설정할 수 있습니다. 이 속성은 세션에서 활성화할 수 있는 보조 역할을 제어합니다. 이 속성을 빈 목록 ALLOWED_SECONDARY_ROLES=() 로 설정하면 세션에서 보조 역할이 비활성화됩니다.

예는 세션 정책에서 보조 역할 지정 을 참조하십시오.

참고

세션 정책에서 ALLOWED_SECONDARY_ROLES 속성을 설정하면 기존 세션을 포함하여 보조 역할의 적용이 즉시 시작됩니다.

보조 역할을 제한하기 위해 세션 정책을 업데이트하기 전에 워크로드 일정과 각 워크로드에 대한 액세스 제어를 고려하여 불필요한 워크로드 중단을 방지하십시오.

고려 사항

  • If a client supports the CLIENT_SESSION_KEEP_ALIVE option and the option is set to TRUE, the client preserves the Snowflake session as long as the connection to Snowflake is active. However, if a session policy with a maximum session lifespan is configured, the session still ends when that lifespan is reached, regardless of activity. If the option is set to FALSE, the session ends after the idle session timeout (four hours by default for programmatic sessions). When possible, avoid using this option since it can result in many open sessions and place a greater demand on resources, which can lead to a performance degradation.

  • CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY 매개 변수를 사용해 클라이언트가 세션에 대한 토큰 업데이트를 시도하는 간격(초)을 지정할 수 있습니다. Snowflake 오브젝트가 계속 사용됨에 따라(예: DDL 및 DML 문의 실행), 웹 인터페이스 세션의 새로 고침이 이루어질 수 있습니다. Snowflake는 30초마다 이 동작을 확인합니다.

  • 새 워크시트를 만들거나 기존 워크시트를 열면 설정된 사용자 세션이 계속 사용되지만, 유휴 세션 시간 제한이 0으로 재설정됩니다.

제한 사항

향후 권한 부여:

세션 정책에 대한 향후 권한 부여 는 지원되지 않습니다.

해결 방법으로 APPLY SESSION POLICY 권한을 사용자 지정 역할에 부여하여 해당 역할이 사용자 또는 Snowflake 계정에 세션 정책을 적용하도록 허용하십시오.