세션 제어를 사용하면 액세스 권한이 부여된 후 사용자가 다시 인증해야 하는 빈도와 전체 로그인, 비밀번호만 또는 하드웨어 보안 키가 필요한지 여부를 구성할 수 있습니다.
세션 제어를 적용하여 다음 작업을 할 수 있습니다.
- 권한이 있는 사용자의 재인증 빈도 강제: 프로젝트 소유자, 결제 관리자와 같이 승격된 권한이 있는 사용자에게 더 자주 재인증을 요구합니다.
- 특정 애플리케이션의 세션 시간 길게 구성: Google Cloud 콘솔, Google Cloud SDK, 특정 OAuth 앱과 같은 지원되는 애플리케이션이 최적의 성능에 필요한 큰 컨텍스트 윈도우를 유지할 수 있도록 세션 시간을 길게 설정할 수 있습니다.
세션 길이 및 재인증 방법 정의
Access Context Manager 바인딩을 만들 때 세션 제어를 정의할 수 있습니다. 세션 제어에 대한 자세한 내용은 액세스 바인딩을 사용하여 사용자 그룹에 정책 적용하기를 참고하세요.
gcloud
-
--session-length플래그를 사용하여 세션 시간을 설정합니다. 값은0s이거나 1시간에서 24시간 사이여야 합니다. 시간 단위로 기간을 지정합니다. 예를 들어 '12h'를 사용하여 12시간 길이의 세션을 설정합니다.--session-reauth-method플래그를 사용하여 재인증 방법을 지정합니다. 예를 들어 세션 시간 기간을 3시간 (3h)으로 설정하고LOGIN,PASSWORD또는SECURITY_KEY재인증 방법을 설정할 수 있습니다.애플리케이션별 설정으로 재정의되지 않는 한 모든 애플리케이션에 적용됩니다.
-
clientId을 사용하여 특정 애플리케이션의 세션 제어를 지정하려면 YAML 파일에서scopedAccessSettings를 정의합니다. 이렇게 하면 이러한 애플리케이션의 기본 세션 컨트롤을 재정의할 수 있습니다. 그런 다음--binding-file flag를 사용하여 YAML 파일을 전달할 수 있습니다.
REST API
GcpUserAccessBinding 바인딩을 생성하거나 업데이트하기 위해 POST 요청의 JSON 본문에서 sessionSettings 객체 내에 sessionLength 및 sessionReauthMethod 필드를 정의합니다.
sessionLength은 세션 시간(초)으로, 초 단위 숫자 뒤에s이 붙은 형식입니다(예:3600s). 값은0s또는3600s(1시간)에서86400s(24시간) 사이여야 합니다.0s로 설정된 경우sessionLengthEnabled을false로 설정하거나 설정되지 않은 상태로 두어야 합니다.sessionLength을0s로,sessionLengthEnabled을true로 설정할 수 없습니다.sessionReauthMethod는LOGIN,PASSWORD또는SECURITY_KEY일 수 있습니다.scopedAccessSettings을 사용하여 애플리케이션별 세션 제어를 정의합니다. 자세한 내용은 특정 애플리케이션의 구성 정의를 참고하세요.
Terraform
Terraform Google Cloud 사용자 액세스 바인딩 리소스 내에서 session_settings 인수를 설정하여 모든 사용자 트래픽에 적용되는 일반 세션 길이 제어를 구성합니다.
session_length: 세션 시간(초)입니다. 예를 들어3600s은 세션 길이를 1시간으로 설정합니다. 마지막에s가 필요합니다.session_length_enabled: 지정된 세션 설정을 사용 중지하려면 false로 설정합니다.session_reauth_method: 사용자 인증 정보를 새로고침하는 데 사용되는 인증 챌린지 유형입니다. 옵션은LOGIN,PASSWORD또는SECURITY_KEY입니다.use_oidc_max_age: 인증 사용자 인증 정보가 OAuth 토큰인 경우 지정되는 선택적 OIDC 최대 기간 매개변수를 세션에서 따를지 구성하는 데 사용되는 고급 필드입니다.
세션 제어를 정의할 때는 요청과 일치하는 가장 최근에 생성된 액세스 바인딩만 세션 제어 설정을 해결할 때 사용됩니다.
정책 구성 예시
다음 예에서는 LOGIN를 사용하여 18시간마다 재인증이 필요하고 SECURITY_KEY을 사용하여 특정 애플리케이션 (SENSITIVE_APP_ID)의 경우 2시간마다 재인증이 필요한 세션 제어를 만드는 방법을 보여줍니다.
기본 설정
Google Cloud CLI 명령어의 --level, --session-length, --session-reauth-method 플래그 (또는 API 호출의 JSON 본문에 있는 해당 필드)는 scopedAccessSettings에 명시적으로 정의되지 않은 모든 애플리케이션의 기본 동작을 설정합니다.
애플리케이션별 설정
YAML 파일 (또는 JSON 본문)의 scopedAccessSettings 섹션을 사용하면 특정 애플리케이션의 기본 설정을 재정의할 수 있습니다. 이 예에서는 클라이언트 ID가 SENSITIVE_APP_ID인 애플리케이션에 SECURITY_KEY를 사용하여 2시간 재인증 요구사항을 설정합니다.
scopedAccessSettings의 애플리케이션별 설정은 기본 (전역) 세션 제어를 완전히 재정의합니다. 애플리케이션에 범위가 지정된 설정이 정의된 경우 기본 세션 컨트롤은 해당 애플리케이션에 적용되지 않습니다.
전역 제어가 활성화된 경우 특정 애플리케이션을 세션 제어에서 제외하려면 scopedAccessSettings에 명시적으로 추가하고 sessionLength 필드를 0s로, sessionLengthEnabled을 false로 설정해야 합니다.
gcloud
다음 예에서는 세션 설정 구성을 보여줍니다.
scopedAccessSettings:
- scope:
clientScope:
restrictedClientApplication:
clientId: SENSITIVE_APP_ID
activeSettings:
sessionSettings:
sessionLength: 7200s
sessionReauthMethod: SECURITY_KEY
sessionLengthEnabled: true
액세스 바인딩을 만듭니다.
gcloud access-context-manager cloud-bindings create \
--organization=ORG_ID \
--group-key=GROUP_ID \
--binding-file=BINDING_FILE_PATH \
--session-length=SESSION_LENGTH \
--session-reauth-method LOGIN
다음을 바꿉니다.
ORG_ID: Google Cloud 조직의 IDGROUP_ID: 그룹 키BINDING_FILE_PATH: 바인딩 파일의 경로SESSION_LENGTH: 세션 길이(예:18h)
REST API
API 요청의 JSON 본문 예시:
{
"groupKey": "GROUP_ID",
"sessionSettings": {
"sessionLength": "64800s",
"sessionReauthMethod": "LOGIN",
"sessionLengthEnabled": true
},
"scopedAccessSettings": [
{
"scope": {
"clientScope": {
"restrictedClientApplication": {
"clientId": "SENSITIVE_APP_ID"
}
}
},
"activeSettings": {
"sessionSettings": {
"sessionLength": "7200s",
"sessionReauthMethod": "SECURITY_KEY",
"sessionLengthEnabled": true
}
}
}
]
}
다음 형식으로 POST 요청을 생성합니다.
POST https://accesscontextmanager.googleapis.com/v1/organizations/ORG_ID/gcpUserAccessBindings
ORG_ID를 Google Cloud 조직의 ID로 바꿉니다.
Terraform
전역 및 특정 애플리케이션에 적용되는 세션 컨트롤을 지정하려면 session_settings 및 scoped_access_settings 인수를 설정합니다.
resource "google_access_context_manager_gcp_user_access_binding" "gcp_user_access_binding" {
organization_id = "{Organization ID}"
group_key = "{Group Key}"
session_settings {
session_length = "64800s"
session_length_enabled = true
session_reauth_method = "LOGIN"
use_oidc_max_age = false
}
scoped_access_settings {
scope {
client_scope {
restricted_client_application {
client_id = "SENSITIVE_APP_ID"
}
}
}
active_settings {
session_settings {
session_length = "7200s"
session_length_enabled = true
session_reauth_method = "SECURITY_KEY"
use_oidc_max_age = false
}
}
}
}
Google Cloud 애플리케이션의 정책 구성 예시
Google Cloud 애플리케이션에 애플리케이션별 재인증 제어를 구성할 수 있습니다. 예를 들어 Google Cloud SDK에는 SECURITY_KEY이 필요하고 Google Cloud 콘솔에는 LOGIN이 필요합니다. 다음 예에서는 SECURITY_KEY를 사용하여 Google Cloud SDK의 경우 매시간, LOGIN를 사용하여 Google Cloud 콘솔의 경우 4시간마다 재인증이 필요한 세션 제어를 만드는 방법을 보여줍니다.
YAML 파일 (또는 JSON 본문)의 scopedAccessSettings 섹션을 사용하면 특정 애플리케이션의 기본 설정을 재정의할 수 있습니다. 이 예에서는 SECURITY_KEY를 사용하여 Google Cloud SDK에 1시간 재인증 요구사항을 설정하고 LOGIN를 사용하여 Google Cloud 콘솔에 4시간 재인증 요구사항을 설정합니다. name 필드를 사용하여 이러한 애플리케이션을 식별합니다.
특정 애플리케이션을 세션 제어에서 제외하려면 sessionLength 필드를 0s 또는 sessionLengthEnabled~false로 설정합니다. 그러면 sessionReauthMethod 메서드가 무시됩니다.
gcloud
다음 예에서는 세션 설정 구성을 보여줍니다.
scopedAccessSettings:
- scope:
clientScope:
restrictedClientApplication:
name: Google Cloud SDK
activeSettings:
sessionSettings:
sessionLength: 3600s
sessionReauthMethod: SECURITY_KEY
sessionLengthEnabled: true
- scope:
clientScope:
restrictedClientApplication:
name: Cloud Console
activeSettings:
sessionSettings:
sessionLength: 14400s
sessionReauthMethod: LOGIN
sessionLengthEnabled: true
액세스 바인딩을 만듭니다.
gcloud access-context-manager cloud-bindings create \
--organization=ORG_ID \
--group-key=GROUP_ID \
--binding-file=BINDING_FILE_PATH
다음을 바꿉니다.
ORG_ID: Google Cloud 조직의 IDGROUP_ID: 그룹 키BINDING_FILE_PATH: 바인딩 파일의 경로
REST API
API 요청의 JSON 본문 예시:
{
"groupKey": "GROUP_ID",
"scopedAccessSettings": [
{
"scope": {
"clientScope": {
"restrictedClientApplication": {
"name": "Google Cloud SDK"
}
}
},
"activeSettings": {
"sessionSettings": {
"sessionLength": "3600s",
"sessionReauthMethod": "SECURITY_KEY",
"sessionLengthEnabled": true
}
}
},
{
"scope": {
"clientScope": {
"restrictedClientApplication": {
"name": "Cloud Console"
}
}
},
"activeSettings": {
"sessionSettings": {
"sessionLength": "14400s",
"sessionReauthMethod": "LOGIN",
"sessionLengthEnabled": true
}
}
}
]
}
다음 형식으로 POST 요청을 생성합니다.
POST https://accesscontextmanager.googleapis.com/v1/organizations/ORG_ID/gcpUserAccessBindings
ORG_ID를 Google Cloud 조직의 ID로 바꿉니다.
Terraform
Google Cloud SDK 및 Google Cloud 콘솔의 세션 길이 설정을 지정하려면 적절한 scoped_access_settings 인수를 설정하세요.
resource "google_access_context_manager_gcp_user_access_binding" "gcp_user_access_binding" {
organization_id = "{Organization ID}"
group_key = "{Group Key}"
scoped_access_settings {
scope {
client_scope {
restricted_client_application {
name = "Google Cloud SDK"
}
}
}
active_settings {
session_settings {
session_length = "3600s"
session_length_enabled = true
session_reauth_method = "SECURITY_KEY"
use_oidc_max_age = false
}
}
}
scoped_access_settings {
scope {
client_scope {
restricted_client_application {
name = "Cloud Console"
}
}
}
active_settings {
session_settings {
session_length = "14400s"
session_length_enabled = true
session_reauth_method = "LOGIN"
use_oidc_max_age = false
}
}
}
}
Google Cloud 애플리케이션의 기본 16시간 세션 길이 재정의
2026년 6월부터 일부 Google Cloud 조직에 기본 세션 길이 16시간이 도입되었습니다. 이 기본 정책은 Google 관리 콘솔에 표시되지 않으며 Google Cloud 영향을 받는 조직은 Access Context Manager API를 사용하여 사용자에 대해 재정의해야 합니다.
이 기본 정책을 재정의하고 이러한 애플리케이션을 세션 제어에서 제외하여 세션 길이를 사실상 무한대로 만들려면 Google Cloud SDK 및 Google Cloud 콘솔('Cloud 콘솔') 애플리케이션 모두에 대해 sessionLengthEnabled이 false로 설정된 scopedAccessSettings를 사용하여 클라우드 바인딩을 만들면 됩니다.
gcloud
다음 예시는 이러한 애플리케이션의 세션 제어를 사용 중지하는 YAML 구성을 보여줍니다.
scopedAccessSettings:
- scope:
clientScope:
restrictedClientApplication:
name: Google Cloud SDK
activeSettings:
sessionSettings:
sessionLength: 0s
sessionReauthMethod: LOGIN
sessionLengthEnabled: false
- scope:
clientScope:
restrictedClientApplication:
name: Cloud Console
activeSettings:
sessionSettings:
sessionLength: 0s
sessionReauthMethod: LOGIN
sessionLengthEnabled: false
이 파일을 사용하여 액세스 바인딩을 만들거나 업데이트합니다.
gcloud access-context-manager cloud-bindings create \
--organization=ORG_ID \
--group-key=GROUP_ID \
--binding-file=BINDING_FILE_PATH
다음을 바꿉니다.
ORG_ID: Google Cloud 조직의 IDGROUP_ID: 그룹 키 (예: 이 재정의를 적용할 모든 사용자가 포함된 그룹)BINDING_FILE_PATH: 바인딩 파일의 경로
REST API
API 요청의 JSON 본문 예시:
{
"groupKey": "GROUP_ID",
"scopedAccessSettings": [
{
"scope": {
"clientScope": {
"restrictedClientApplication": {
"name": "Google Cloud SDK"
}
}
},
"activeSettings": {
"sessionSettings": {
"sessionLength": "0s",
"sessionReauthMethod": "LOGIN",
"sessionLengthEnabled": false
}
}
},
{
"scope": {
"clientScope": {
"restrictedClientApplication": {
"name": "Cloud Console"
}
}
},
"activeSettings": {
"sessionSettings": {
"sessionLength": "0s",
"sessionReauthMethod": "LOGIN",
"sessionLengthEnabled": false
}
}
}
]
}
다음 형식으로 POST 요청을 생성합니다.
POST https://accesscontextmanager.googleapis.com/v1/organizations/ORG_ID/gcpUserAccessBindings
ORG_ID를 Google Cloud 조직의 ID로 바꿉니다.
Terraform
Google Cloud SDK 및 Google Cloud 콘솔에서 세션 제어를 사용 중지하도록 지정하려면 session_length_enabled = false를 사용하여 적절한 scoped_access_settings 인수를 설정하세요.
resource "google_access_context_manager_gcp_user_access_binding" "gcp_user_access_binding" {
organization_id = "{Organization ID}"
group_key = "{Group Key}"
scoped_access_settings {
scope {
client_scope {
restricted_client_application {
name = "Google Cloud SDK"
}
}
}
active_settings {
session_settings {
session_length = "0s"
session_length_enabled = false
session_reauth_method = "LOGIN"
use_oidc_max_age = false
}
}
}
scoped_access_settings {
scope {
client_scope {
restricted_client_application {
name = "Cloud Console"
}
}
}
active_settings {
session_settings {
session_length = "0s"
session_length_enabled = false
session_reauth_method = "LOGIN"
use_oidc_max_age = false
}
}
}
}