ID 및 액세스 관리(IAM) 정책은 Google Cloud 리소스에 대한 액세스 제어를 지정합니다.
Policy는 bindings의 모음입니다. binding은 하나 이상의 members 또는 주 구성원을 단일 role에 바인딩합니다. 주 구성원은 사용자 계정, 서비스 계정, Google 그룹, 도메인(예: G Suite)일 수 있습니다. role은 이름이 지정된 권한 목록입니다. 각 role은 IAM 사전 정의된 역할 또는 사용자가 만든 커스텀 역할일 수 있습니다.
일부 유형의 Google Cloud 리소스의 경우 binding은 표현식이 true로 평가될 때만 리소스 액세스를 허용하는 논리 표현식인 condition을 지정할 수 있습니다. 조건은 요청, 리소스 또는 둘 모두를 기준으로 제약조건을 추가할 수 있습니다. IAM 정책의 지원을 지원하는 리소스에 대해 알아보려면 IAM 문서를 참조하세요.
members 또는 주 구성원 목록을 role에 연결합니다. 선택사항으로, bindings의 적용 방법과 시기를 결정하는 condition을 지정할 수 있습니다. 각 bindings에는 하나 이상의 주 구성원을 포함해야 합니다.
하나의 Policy 안의 bindings은 최대 1,500개의 주 구성원을 참조할 수 있습니다. 이러한 주 구성원 중에서 Google 그룹은 최대 250개까지 가능합니다. 주 구성원이 나타날 때마다 이러한 한도에 반영됩니다. 예를 들어 bindings이 user:alice@example.com에 50가지 역할을 부여하고, 다른 어떤 주 구성원에도 역할을 부여하지 않은 경우, Policy의 bindings에 1,450개의 주 구성원을 추가할 수 있습니다.
etag는 동시에 발생한 여러 정책 업데이트가 서로를 덮어쓰지 않도록 방지하는 낙관적 동시 실행 제어에 사용됩니다. 정책 업데이트를 수행할 때 읽기-수정-쓰기 주기에서 시스템이 etag를 활용하여 경합 상태를 방지하는 것이 좋습니다. etag는 getIamPolicy에 대한 응답으로 반환되며, setIamPolicy 요청에 해당 etag를 넣어 변경사항이 정책의 동일한 버전에 적용되도록 해야 합니다.
중요: IAM 조건을 사용하는 경우 setIamPolicy를 호출할 때마다 etag 필드를 포함해야 합니다. 이 필드를 제외하면 IAM을 통해 버전 3 정책으로 1 정책을 덮어쓸 수 있으며, 버전 3 정책의 모든 조건이 손실됩니다.
members 또는 주 구성원 목록에 할당된 역할입니다. 예를 들면 roles/viewer, roles/editor, roles/owner입니다.
IAM 역할 및 권한에 대한 개요는 IAM 문서를 참조하세요. 사전 정의된 사용 가능한 역할의 목록은 여기를 참조하세요.
members[]
string
Google Cloud 리소스에 대한 액세스를 요청하는 주 구성원을 지정합니다. members는 다음 값을 가질 수 있습니다.
allUsers: Google 계정 유무에 관계없이 임의의 인터넷 사용자를 나타내는 특수한 식별자입니다.
allAuthenticatedUsers: Google 계정 또는 서비스 계정으로 인증한 사용자를 나타내는 특수한 식별자입니다. ID 제휴를 통해 외부 ID 공급업체(IdP)에서 가져온 ID는 포함되지 않습니다.
user:{emailid}: 특정 Google 계정을 나타내는 이메일 주소입니다. 예를 들면 alice@example.com입니다.
serviceAccount:{emailid}: Google 서비스 계정을 나타내는 이메일 주소입니다. 예를 들면 my-other-app@appspot.gserviceaccount.com입니다.
serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]: Kubernetes 서비스 계정의 식별자입니다. 예를 들면 my-project.svc.id.goog[my-namespace/my-kubernetes-sa]입니다.
group:{emailid}: Google 그룹을 나타내는 이메일 주소입니다. 예를 들면 admins@example.com입니다.
domain:{domain}: 해당 도메인의 모든 사용자를 나타내는 G Suite 도메인(기본)입니다. 예를 들면 google.com 또는 example.com입니다.
principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}: 직원 ID 풀의 단일 ID
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{groupId}: 그룹의 모든 직원 ID
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}: 특정 속성값의 모든 직원 ID
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*: 직원 ID 풀의 모든 ID
principal://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}: 워크로드 아이덴티티 풀의 단일 ID
principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/group/{groupId}: 워크로드 아이덴티티 풀 그룹
principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}: 특정 속성이 있는 워크로드 아이덴티티 풀의 모든 ID
principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/*: 워크로드 아이덴티티 풀의 모든 ID
deleted:user:{emailid}?uid={uniqueid}: 최근에 삭제된 사용자를 나타내는 이메일 주소 및 고유 식별자입니다. 예를 들면 alice@example.com?uid=123456789012345678901입니다. 사용자가 복구되면 이 값은 user:{emailid}로 되돌아가고 복구된 사용자는 binding에서 역할을 유지합니다.
deleted:serviceAccount:{emailid}?uid={uniqueid}: 최근에 삭제된 서비스 계정을 나타내는 이메일 주소 및 고유 식별자입니다. 예를 들면 my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901입니다. 서비스 계정이 삭제 취소되면 이 값은 serviceAccount:{emailid}로 되돌아가고 삭제되지 않은 서비스 계정은 binding에서 역할을 유지합니다.
deleted:group:{emailid}?uid={uniqueid}: 최근에 삭제된 Google 그룹을 나타내는 이메일 주소 및 고유 식별자입니다. 예를 들면 admins@example.com?uid=123456789012345678901입니다. 그룹이 복구되면 이 값은 group:{emailid}로 되돌아가고 복구된 그룹은 binding에서 역할을 유지합니다.
deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}: 직원 ID 풀의 단일 ID입니다. 예를 들면 deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value입니다.
Common Expression Language(CEL) 구문으로 된 텍스트 표현식을 나타냅니다. CEL은 C와 같은 표현식 언어입니다. CEL의 구문과 시맨틱스는 https://github.com/google/cel-spec에 설명되어 있습니다.
예시(비교):
title: "Summary size limit"
description: "Determines if a summary is less than 100 chars"
expression: "document.summary.size() < 100"
예시(균등):
title: "Requestor is owner"
description: "Determines if requestor is the document owner"
expression: "document.owner == request.auth.claims.email"
예시(로직):
title: "Public documents"
description: "Determine whether the document should be publicly visible"
expression: "document.type != 'private' && document.type != 'internal'"
예시(데이터 조작):
title: "Notification string"
description: "Create a notification string with a timestamp."
expression: "'New message received at ' + string(document.create_time)"
표현식 내에서 참조할 수 있는 정확한 변수와 함수는 이를 계산하는 서비스에 의해 결정됩니다. 자세한 내용은 서비스 문서를 참조하세요.
선택사항. 표현식의 제목으로, 목적을 설명하는 짧은 문자열입니다. 표현식을 입력할 수 있는 UI 등에 사용할 수 있습니다.
description
string
선택사항. 표현식에 대한 설명입니다. 표현식을 설명하는 더 긴 텍스트입니다. 예를 들어 UI에서 마우스를 가져갈 때 표시할 수 있습니다.
location
string
선택사항. 오류 보고를 위해 표현식의 위치를 나타내는 문자열입니다. 예를 들어 파일 이름 및 파일 내 위치일 수 있습니다.
AuditConfig
서비스의 감사 구성을 지정합니다. 이 구성은 로깅되는 권한 유형 및 로깅에서 제외할 ID(있는 경우)를 결정합니다. AuditConfig에는 하나 이상의 AuditLogConfig가 있어야 합니다.
allServices와 특정 서비스 모두에 AuditConfig가 있으면 해당 서비스에 두 AuditConfig의 합집합이 사용됩니다. 즉, 각 AuditConfig에 지정된 log_types가 사용 설정되며 각 AuditLogConfig의 exemptedMembers가 제외됩니다.
이 정책은 sampleservice에서 DATA_READ, DATA_WRITE, ADMIN_READ 로깅을 사용 설정합니다. 또한 DATA_READ 로깅에서 jose@example.com을 제외하고 DATA_WRITE 로깅에서 aliya@example.com을 제외합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-29(UTC)"],[[["\u003cp\u003eIAM policies manage access control for Google Cloud resources through a collection of bindings.\u003c/p\u003e\n"],["\u003cp\u003eA binding in an IAM policy links one or more principals (members) to a single role, with principals including user accounts, service accounts, Google groups, and domains.\u003c/p\u003e\n"],["\u003cp\u003eIAM policies can also contain a condition, which is a logical expression that must evaluate to true for the binding to apply, enabling constraint-based access.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eetag\u003c/code\u003e field in the policy JSON is crucial for optimistic concurrency control, especially when using IAM Conditions, to prevent simultaneous updates from overwriting each other.\u003c/p\u003e\n"],["\u003cp\u003eAudit configurations (\u003ccode\u003eauditConfigs\u003c/code\u003e) within an IAM policy allow for specifying which types of permissions are logged, and can also list exempted members for specific types of logging.\u003c/p\u003e\n"]]],[],null,["# Policy\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Binding](#Binding)\n - [JSON representation](#Binding.SCHEMA_REPRESENTATION)\n- [Expr](#Expr)\n - [JSON representation](#Expr.SCHEMA_REPRESENTATION)\n- [AuditConfig](#AuditConfig)\n - [JSON representation](#AuditConfig.SCHEMA_REPRESENTATION)\n- [AuditLogConfig](#AuditLogConfig)\n - [JSON representation](#AuditLogConfig.SCHEMA_REPRESENTATION)\n- [LogType](#LogType)\n\nAn Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.\n\nA `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.\n\nFor some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).\n\n**JSON example:** \n\n {\n \"bindings\": [\n {\n \"role\": \"roles/resourcemanager.organizationAdmin\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-project-id@appspot.gserviceaccount.com\"\n ]\n },\n {\n \"role\": \"roles/resourcemanager.organizationViewer\",\n \"members\": [\n \"user:eve@example.com\"\n ],\n \"condition\": {\n \"title\": \"expirable access\",\n \"description\": \"Does not grant access after Sep 2020\",\n \"expression\": \"request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\",\n }\n }\n ],\n \"etag\": \"BwWWja0YfJA=\",\n \"version\": 3\n }\n\n**YAML example:** \n\n bindings:\n - members:\n - user:mike@example.com\n - group:admins@example.com\n - domain:google.com\n - serviceAccount:my-project-id@appspot.gserviceaccount.com\n role: roles/resourcemanager.organizationAdmin\n - members:\n - user:eve@example.com\n role: roles/resourcemanager.organizationViewer\n condition:\n title: expirable access\n description: Does not grant access after Sep 2020\n expression: request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\n etag: BwWWja0YfJA=\n version: 3\n\nFor a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).\n\nBinding\n-------\n\nAssociates `members`, or principals, with a `role`.\n\nExpr\n----\n\nRepresents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at \u003chttps://github.com/google/cel-spec\u003e.\n\nExample (Comparison): \n\n title: \"Summary size limit\"\n description: \"Determines if a summary is less than 100 chars\"\n expression: \"document.summary.size() \u003c 100\"\n\nExample (Equality): \n\n title: \"Requestor is owner\"\n description: \"Determines if requestor is the document owner\"\n expression: \"document.owner == request.auth.claims.email\"\n\nExample (Logic): \n\n title: \"Public documents\"\n description: \"Determine whether the document should be publicly visible\"\n expression: \"document.type != 'private' && document.type != 'internal'\"\n\nExample (Data Manipulation): \n\n title: \"Notification string\"\n description: \"Create a notification string with a timestamp.\"\n expression: \"'New message received at ' + string(document.create_time)\"\n\nThe exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.\n\nAuditConfig\n-----------\n\nSpecifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exemptedMembers in each AuditLogConfig are exempted.\n\nExample Policy with multiple AuditConfigs: \n\n {\n \"auditConfigs\": [\n {\n \"service\": \"allServices\",\n \"auditLogConfigs\": [\n {\n \"logType\": \"DATA_READ\",\n \"exemptedMembers\": [\n \"user:jose@example.com\"\n ]\n },\n {\n \"logType\": \"DATA_WRITE\"\n },\n {\n \"logType\": \"ADMIN_READ\"\n }\n ]\n },\n {\n \"service\": \"sampleservice.googleapis.com\",\n \"auditLogConfigs\": [\n {\n \"logType\": \"DATA_READ\"\n },\n {\n \"logType\": \"DATA_WRITE\",\n \"exemptedMembers\": [\n \"user:aliya@example.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.\n\nAuditLogConfig\n--------------\n\nProvides the configuration for logging a type of permissions. Example: \n\n {\n \"auditLogConfigs\": [\n {\n \"logType\": \"DATA_READ\",\n \"exemptedMembers\": [\n \"user:jose@example.com\"\n ]\n },\n {\n \"logType\": \"DATA_WRITE\"\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting [jose@example.com](mailto:jose@example.com) from DATA_READ logging.\n\nLogType\n-------\n\nThe list of valid permission types for which logging can be configured. Admin writes are always logged, and are not configurable."]]