이 페이지에서는 Identity and Access Management(IAM) 허용, 거부, 주 구성원 액세스 경계 정책의 문제 해결 방법을 설명합니다.
정책 문제 해결 도구 사용
특정 주 구성원의 액세스 문제를 해결해야 하는 경우 IAM 정책 문제 해결 도구를 사용하세요.
정책 문제 해결 도구를 사용하면 주 구성원이 리소스에 액세스할 수 있는지 파악할 수 있습니다. 주 구성원, 리소스, 권한을 입력하면 정책 문제 해결 도구가 주 구성원의 액세스에 영향을 미치는 허용 정책, 거부 정책, 주 구성원 액세스 경계(PAB) 정책을 조사합니다.
그런 다음 이러한 정책에 따라 주 구성원이 지정된 권한을 사용하여 리소스에 액세스할 수 있는지 여부를 알려줍니다. 또한 관련 정책을 나열하고 주 구성원의 액세스 권한에 미치는 영향을 설명합니다.
정책 문제 해결 도구를 사용하여 허용 정책, 거부 정책, 주 구성원 액세스 경계 정책 문제를 해결하는 방법을 알아보려면 IAM 권한 문제 해결을 참조하세요.
리소스에 적용되는 모든 허용 및 거부 정책 보기
Google Cloud에서 다음 허용 정책과 거부 정책은 리소스에 대한 액세스 권한에 영향을 미칩니다.
리소스의 허용 정책
리소스의 거부 정책(있는 경우)
리소스의 상위 프로젝트, 폴더, 조직의 허용 정책(있는 경우)
리소스의 상위 프로젝트, 폴더, 조직의 거부 정책(있는 경우)
상위 프로젝트, 폴더, 조직의 허용 및 거부 정책은 정책 상속으로 인해 리소스 액세스에 영향을 미칩니다.
허용 또는 거부 정책을 프로젝트, 폴더 또는 조직에 연결하면 해당 프로젝트, 폴더 또는 조직 내의 모든 리소스에도 정책이 적용됩니다.
예를 들어 조직에 대한 거부 정책에서 주 구성원이 특정 권한을 사용할 수 없다면 주 구성원은 조직 내의 모든 리소스에 해당 권한을 사용할 수 없습니다. 이 규칙은 해당 조직 내 폴더 및 프로젝트에 더 많은 허용 거부 정책이 있거나 주 구성원에게 권한을 부여하는 허용 정책이 있는 경우에도 적용됩니다.
마찬가지로 프로젝트의 허용 정책이 주 구성원에게 특정 권한을 부여하는 경우 주 구성원은 해당 권한이 거부되지 않는 한 프로젝트 내의 모든 리소스에 대한 해당 권한을 가질 수 있습니다.
이러한 모든 정책을 리소스에 대한 적용 가능한 정책 또는 유효 정책이라고 부릅니다.
Google Cloud에서 --include-deny 플래그와 함께 gcloud beta projects
get-ancestors-iam-policy 명령어를 사용하여 프로젝트에 대한 액세스 권한에 영향을 미치는 모든 허용 정책과 거부 정책의 목록을 가져올 수 있습니다. 이러한 정책은 프로젝트에 적용 가능한 정책을 구성합니다. 각 정책을 조사하여 주 구성원의 액세스에 미치는 영향을 확인할 수 있습니다.
gcloud
아래의 명령어 데이터를 사용하기 전에 다음을 바꿉니다.
PROJECT_ID: Google Cloud 프로젝트 ID입니다. 프로젝트 ID는 my-project와 같은 영숫자 문자열입니다.
이 예시에서 Raha는 조직에서 서비스 계정 관리자 역할(roles/iam.serviceAccountAdmin)을 부여받았지만 프로젝트에는 Raha가 iam.googleapis.com/serviceAccounts.create 권한을 사용하지 못하도록 하는 거부 정책이 있습니다. 따라서 Raha가 my-project 프로젝트에 서비스 계정을 만들려고 시도하면 요청이 거부됩니다.
예를 들어 조직에서 거부 정책을 사용하지 않는 경우 리소스의 유효한 허용 정책만 보면 됩니다. 이러한 경우 다음 방법을 사용하여 유효한 허용 정책을 볼 수 있습니다.
Google Cloud 콘솔에서 리소스의 IAM 허용 정책을 확인합니다. Google Cloud 콘솔에 각 리소스의 유효한 정책이 자동으로 표시됩니다.
Google Cloud 콘솔에서 리소스의 IAM 허용 정책을 보는 방법은 현재 액세스 권한 보기를 참조하세요.
Cloud Asset API를 사용하여 리소스의 유효한 허용 정책을 가져옵니다. 자세히 알아보려면 유효한 IAM 정책 보기를 참조하세요.
허용 정책 검색
허용 정책에서 특정 역할 바인딩을 찾아야 하는 경우 허용 정책을 검색할 수 있습니다.
Cloud 애셋 인벤토리를 사용하면 지정된 매개변수와 일치하는 역할 바인딩의 허용 정책을 검색할 수 있습니다. 다음과 같은 다양한 검색 매개변수를 사용할 수 있습니다.
[[["이해하기 쉬움","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-09-04(UTC)"],[[["\u003cp\u003ePolicy Troubleshooter for IAM helps determine if a principal can access a resource by examining allow policies, deny policies, and principal access boundary (PAB) policies, and it provides details on the relevant policies.\u003c/p\u003e\n"],["\u003cp\u003eAllow and deny policies at the resource, project, folder, and organization levels can affect access to a resource due to policy inheritance, where policies applied to parent entities are inherited by resources within them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud beta projects get-ancestors-iam-policy\u003c/code\u003e command with the \u003ccode\u003e--include-deny\u003c/code\u003e flag can be used to list all allow and deny policies that affect access to a project, collectively forming the effective policy.\u003c/p\u003e\n"],["\u003cp\u003eEven if a principal is granted a permission via an allow policy, a deny policy can override it, preventing the principal from using that permission on specific resources, as illustrated with the example of Raha and service account creation.\u003c/p\u003e\n"],["\u003cp\u003eCloud asset inventory can be used to locate specific roles bindings through a search feature that uses parameters such as the resource type, principal type, role, project, folder, and organization.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot policies\n\nThis page describes how to troubleshoot\nIdentity and Access Management (IAM) allow, deny, and principal access boundary policies.\n\nUse Policy Troubleshooter\n-------------------------\n\nIf you need to troubleshoot access for a specific principal, use\nPolicy Troubleshooter for IAM.\nPolicy Troubleshooter helps you understand whether a principal can access a resource. Given a principal, a resource, and a permission, Policy Troubleshooter examines the allow policies, deny policies, and principal access boundary (PAB) policies that impact the principal's access. Then, it tells you whether, based on those policies, the principal can use the specified permission to access the resource. It also lists the relevant policies and explains how they affect the principal's access.\n\nTo learn how to use Policy Troubleshooter to troubleshoot allow\npolicies, deny policies, and principal access boundary policies, see [Troubleshoot\nIAM permissions](/policy-intelligence/docs/troubleshoot-access).\n\nView all allow and deny policies that apply to a resource\n---------------------------------------------------------\n\n\nIn Google Cloud, the following allow and deny policies affect access\nto a resource:\n\n- The resource's allow policy\n- The resource's deny policies, if any\n- The allow policies of the resource's parent project, folder, and organization, if any\n- The deny policies of the resource's parent project, folder, and organization, if any\n\n\nThe allow and deny policies of parent projects, folders, and organizations\naffect access to a resource\nbecause of [policy inheritance](/iam/docs/policies#inheritance).\nWhen you attach an allow or deny policy to a project, folder, or organization,\nthat policy also applies for all resources inside that project, folder, or\norganization.\n\n\nFor example, if a deny policy for an organization says that a principal can't\nuse a specific permission, then the principal can't use that permission for any\nresource within the organization. This rule applies even if the folders and\nprojects within that organization have more permissive deny policies, or allow\npolicies that give the principal the permission.\n\n\nSimilarly, if an allow policy for a project gives a principal a specific\npermission, then the principal has that permission for any resource within the\nproject, provided that they aren't denied that permission.\n\nThe union of all of these policies is called the *applicable policy* or\n*effective policy* for the resource.\n\nIn Google Cloud, you can get a list of all of the allow and deny policies\nthat affect access to a project by using the `gcloud beta projects\nget-ancestors-iam-policy` command with the `--include-deny` flag. Together,\nthese policies make up the applicable policy for the project. You can\ninvestigate each policy to see how it affects the principal's access. \n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project ID. Project IDs are alphanumeric strings, like `my-project`.\n\n\nExecute the\n\n[`gcloud beta projects get-ancestors-iam-policy`](/sdk/gcloud/reference/beta/projects/get-ancestors-iam-policy)\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n```bash\ngcloud beta projects get-ancestors-iam-policy PROJECT_ID --include-deny --format=json\n```\n\n#### Windows (PowerShell)\n\n```bash\ngcloud beta projects get-ancestors-iam-policy PROJECT_ID --include-deny --format=json\n```\n\n#### Windows (cmd.exe)\n\n```bash\ngcloud beta projects get-ancestors-iam-policy PROJECT_ID --include-deny --format=json\n```\n\n\nThe response contains the allow and deny policies for the project; any folders that are ancestors\nof the project; and the organization. The following example shows allow policies for the\norganization `1234567890123` and the project `my-project`, as well as a deny\npolicy for the project `my-project`:\n\n```\n[\n {\n \"id\": \"1234567890123\",\n \"policy\": {\n \"bindings\": [\n {\n \"members\": [\n \"group:cloud-admins@example.com\"\n ],\n \"role\": \"roles/iam.denyAdmin\"\n },\n {\n \"members\": [\n \"user:raha@example.com\"\n ],\n \"role\": \"roles/iam.serviceAccountAdmin\"\n }\n ],\n \"etag\": \"BwXW6Eab7TI=\",\n \"version\": 1\n },\n \"type\": \"organization\"\n },\n {\n \"id\": \"my-project\",\n \"policy\": {\n \"bindings\": [\n {\n \"members\": [\n \"group:cloud-admins@example.com\"\n ],\n \"role\": \"roles/owner\"\n }\n ],\n \"etag\": \"BwXXjOM7L6M=\",\n \"type\": \"project\"\n }\n },\n {\n \"id\": \"my-project\",\n \"policy\": {\n \"createTime\": \"2022-02-14T21:46:35.865279Z\",\n \"displayName\": \"My deny policy\",\n \"etag\": \"MTgyMzg2ODcwNTEyMjMxMTM3Mjg=\",\n \"kind\": \"DenyPolicy\",\n \"name\": \"policies/cloudresourcemanager.googleapis.com%2Fprojects%2F123456789012/denypolicies/my-deny-policy\",\n \"rules\": [\n {\n \"denyRule\": {\n \"deniedPermissions\": [\n \"iam.googleapis.com/serviceAccounts.create\"\n ],\n \"deniedPrincipals\": [\n \"user:raha@example.com\"\n ]\n },\n \"description\": \"Prevent service account creation\"\n }\n ],\n \"uid\": \"c83e3dc3-d8a6-6f51-4018-814e9f200b05\",\n \"updateTime\": \"2022-02-14T21:46:35.865279Z\"\n },\n \"type\": \"project\"\n }\n]\n```\n\nIn this example, Raha is granted the Service Account\nAdmin role (`roles/iam.serviceAccountAdmin`) on the organization, but the\nproject has a deny policy that prevents Raha from using the\npermission `iam.googleapis.com/serviceAccounts.create`. As a result, if\nRaha tries to create a service account in the project\n`my-project`, the request will be denied.\n\nIn some cases, you might only need to view the effective allow policy for a\nresource---for example, if your organization doesn't use deny policies. In\nthese cases, you can use the following methods to view the effective allow\npolicy:\n\n- View the resource's IAM allow policy in the\n Google Cloud console. The Google Cloud console automatically shows each\n resource's effective policy.\n\n To learn how to view a resource's IAM allow policy in the\n Google Cloud console, see [View current access](/iam/docs/granting-changing-revoking-access#view-access).\n- Use the Cloud Asset API to get the resource's effective allow policy. To learn\n more, see [Viewing effective IAM policies](/asset-inventory/docs/view-effective-iam-policies).\n\nSearch allow policies\n---------------------\n\nIf you need to locate a specific role binding in an allow policy, you can\nsearch the allow policy.\n\nCloud Asset Inventory lets you search allow policies for role bindings\nthat match the specified parameters. You can use a variety of search parameters,\nincluding the following:\n\n- Resource type\n- Principal type\n- Role\n- Project\n- Folder\n- Organization\n\nFor more information, see [Searching IAM allow policies](/asset-inventory/docs/searching-iam-policies)."]]