Analyze allow policies Stay organized with collections Save and categorize content based on your preferences.
This page shows how to use Policy Analyzer for allow policiesto find out which principals (users, service accounts, groups, and domains),have what access to whichGoogle Cloud resources.
The examples on this page show how to run a Policy Analysis query andimmediately view the results. If you want to export the results for furtheranalysis, you can useAnalyzeIamPolicyLongrunning to writequery results toBigQuery orCloud Storage.
Before you begin
Enable the Cloud Asset API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.You must enable the API in the project you will use to send the query. Thisdoesn't have to be the same resource that you scope your query to.
Optional: Understandhow Policy Analyzerworks.
Optional: If you want to execute more than20 policy analysis queries per organizationper day, ensure that you have anorganization-level activation of the Premiumor Enterprise tier ofSecurity Command Center.For more information, seeBillingquestions.
Required roles and permissions
The following roles and permissions are required to analyze allow policies.
Required IAM roles
To get the permissions that you need to analyze an allow policy, ask your administrator to grant you the following IAM roles on the project, folder, or organization that you will scopeyour query to:
- Cloud Asset Viewer (
roles/cloudasset.viewer) - To analyze policies withcustom IAM roles:Role Viewer (
roles/iam.roleViewer) - To use the Google Cloud CLI to analyze policies:Service Usage Consumer (
roles/serviceusage.serviceUsageConsumer)
For more information about granting roles, seeManage access to projects, folders, and organizations.
These predefined roles contain the permissions required to analyze an allow policy. To see the exact permissions that are required, expand theRequired permissions section:
Required permissions
The following permissions are required to analyze an allow policy:
cloudasset.assets.analyzeIamPolicycloudasset.assets.searchAllResourcescloudasset.assets.searchAllIamPolicies- To analyze policies with custom IAM roles:
iam.roles.get - To use the Google Cloud CLI to analyze policies:
serviceusage.services.use
You might also be able to get these permissions withcustom roles or otherpredefined roles.
Required Google Workspace permissions
If you want toexpand groups in query results to see if a principalhas certain roles or permissions as a result of their membership in aGoogle Workspace group, you need thegroups.read Google Workspace permission.This permission is contained in the Groups Reader Admin role, and in morepowerful roles such as the Groups Admin or Super Admin roles. To learn how togrant these roles, seeAssign specific admin roles.
Determine which principals can access a resource
You can use Policy Analyzer to check which principals have certainroles or permissions on a specific resource in your project, folder, ororganization. To get this information, create a query that includes the resourcethat you want to analyze access for and one or more roles or permissions tocheck for.
Note: Policy Analyzer only supportsIAM allow policies. Results do not account for other access control mechanisms, like IAM deny policies. For more information, seeSupported policy types. In the Google Cloud console, go to thePolicy analyzer page. In theAnalyze policies section, find the pane labeledCustom queryand clickCreate custom query in that pane. In theSelect query scope field, select the project, folder, ororganization that you want to scope the query to. Policy Analyzerwill analyze access for that project, folder, or organization, as well as anyresources within that project, folder, or organization. Choose the resource to check and the role or permission to check for: Optional: ClickContinue, then select anyadvanced optionsthat you want to enable for this query. In theCustom query pane, clickAnalyze > Run query.The report page shows the query parameters you entered, and a results tableof all principals with the specified roles or permissions on the specifiedresource. Policy analysis queries in the Google Cloud console run for up to one minute. After one minute, the Google Cloud console stops the query and displays all available results. If the query didn't finish in that time, the Google Cloud console displays a banner indicating that the results are incomplete. To get more results for these queries,export the results to BigQuery. Before using any of the command data below, make the following replacements: Execute thegcloud asset analyze-iam-policy command: You receive a YAML response with analysis results. Each analysis result lists a set of accesses, identities, and resources that are relevant to your query, followed by the related IAM role binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is The principals that have any of the specified permissions on the specified resource are listed in the If the request times out before the query finishes, you get a To determine which principals have certain permissions on aresource, use the Cloud Asset Inventory API's Before using any of the request data, make the following replacements: HTTP method and URL: Request JSON body: To send your request, expand one of these options: Save the request body in a file named Save the request body in a file named Copy the request body and open themethod reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and clickExecute. You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as The principals that have any of the specified permissions on the specified resource are listed in the If the request times out before the query finishes, you get a You can use Policy Analyzer to check which principals have specificroles or permissions on any Google Cloud resource in your organization. Toget this information, create a query that includes one or more roles orpermissions to check for, but does not specify a resource. Note: Policy Analyzer only supportsIAM allow policies. Results do not account for other access control mechanisms, like IAM deny policies. For more information, seeSupported policy types. In the Google Cloud console, go to thePolicy analyzer page. In theAnalyze policies section, find the pane labeledCustom queryand clickCreate custom query in that pane. In theSelect query scope field, select the project, folder, ororganization that you want to scope the query to. Policy Analyzerwill analyze access for that project, folder, or organization, as well as anyresources within that project, folder, or organization. In theParameter 1 field, select eitherRole orPermission. In theSelect a role orSelect a permission field, select the roleor permission that you want to check for. Optional: To check for additional roles and permissions, do the following: Optional: ClickContinue, then select anyadvanced optionsthat you want to enable for this query. In theCustom query pane, clickAnalyze > Run query.The report page shows the query parameters you entered, and a results tableof all principals with the specified roles or permissions on any in-scoperesource. Policy analysis queries in the Google Cloud console run for up to one minute. After one minute, the Google Cloud console stops the query and displays all available results. If the query didn't finish in that time, the Google Cloud console displays a banner indicating that the results are incomplete. To get more results for these queries,export the results to BigQuery. Before using any of the command data below, make the following replacements: Execute thegcloud asset analyze-iam-policy command: You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as The principals that have any of the specified roles or permissions are listed in the If the request times out before the query finishes, you get a To determine which principals have certain roles or permissions, use the Cloud Asset Inventory API's Before using any of the request data, make the following replacements: HTTP method and URL: Request JSON body: To send your request, expand one of these options: Save the request body in a file named Save the request body in a file named Copy the request body and open themethod reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and clickExecute. You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as The principals that have any of the specified roles or permissions are listed in the If the request times out before the query finishes, you get a You can use Policy Analyzer to check what roles or permissions a principalhas on a resource in your organization. To get this information, create a querythat includes the principal whose access you want to analyze and the resourcethat you want to analyze access for. Note: Policy Analyzer only supportsIAM allow policies. Results do not account for other access control mechanisms, like IAM deny policies. For more information, seeSupported policy types. In the Google Cloud console, go to thePolicy analyzer page. In theAnalyze policies section, find the pane labeledCustom queryand clickCreate custom query in that pane. In theSelect query scope field, select the project, folder, ororganization that you want to scope the query to. Policy Analyzerwill analyze access for that project, folder, or organization, as well as anyresources within that project, folder, or organization. Choose the resource and principal to check: Optional: ClickContinue, then select anyadvanced optionsthat you want to enable for this query. In theCustom query pane, clickAnalyze > Run query.The report page shows the query parameters you entered, and a results tableof all roles that the specified principal has on the specified resource. Policy analysis queries in the Google Cloud console run for up to one minute. After one minute, the Google Cloud console stops the query and displays all available results. If the query didn't finish in that time, the Google Cloud console displays a banner indicating that the results are incomplete. To get more results for these queries,export the results to BigQuery. Before using any of the command data below, make the following replacements: Execute thegcloud asset analyze-iam-policy command: You receive a YAML response with analysis results. Each analysis result lists a set of accesses, identities, and resources that are relevant to your query, followed by the related IAM role binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is The roles that the principal has on the specified resource are listed in the If the request times out before the query finishes, you get a To determine what access a principal has on a resource, use the Cloud Asset Inventory API's Before using any of the request data, make the following replacements: HTTP method and URL: Request JSON body: To send your request, expand one of these options: Save the request body in a file named Save the request body in a file named Copy the request body and open themethod reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and clickExecute. You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as The roles that the principal has on the specified resource are listed in the If the request times out before the query finishes, you get a You can use Policy Analyzer to check which resources within yourorganization a principal has a certain roles or permissions on. To get thisinformation, create a query that includes the principal whose access you want toanalyze and one or more permissions or roles that you want to check for. Note: Policy Analyzer only supportsIAM allow policies. Results do not account for other access control mechanisms, like IAM deny policies. For more information, seeSupported policy types. In the Google Cloud console, go to thePolicy analyzer page. In theAnalyze policies section, find the pane labeledCustom queryand clickCreate custom query in that pane. In theSelect query scope field, select the project, folder, ororganization that you want to scope the query to. Policy Analyzerwill analyze access for that project, folder, or organization, as well as anyresources within that project, folder, or organization. Choose the principal to check and the role or permission to check for: Optional: ClickContinue, then select anyadvanced optionsthat you want to enable for this query. In theCustom query pane, clickAnalyze > Run query.The report page shows the query parameters you entered, and a results tableof all the resources on which the specified principal has the specified rolesor permissions. Policy analysis queries in the Google Cloud console run for up to one minute. After one minute, the Google Cloud console stops the query and displays all available results. If the query didn't finish in that time, the Google Cloud console displays a banner indicating that the results are incomplete. To get more results for these queries,export the results to BigQuery. Before using any of the command data below, make the following replacements: Execute thegcloud asset analyze-iam-policy command: You receive a YAML response with analysis results. Each analysis result lists a set of accesses, identities, and resources that are relevant to your query, followed by the related IAM role binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is The resources on which the specified principal has any of the specified permissions are listed in the If the request times out before the query finishes, you get a To determine which resources a principal can access, use the Cloud Asset Inventory API's Before using any of the request data, make the following replacements: HTTP method and URL: Request JSON body: To send your request, expand one of these options: Save the request body in a file named Save the request body in a file named Copy the request body and open themethod reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and clickExecute. You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as The resources on which the specified principal has any of the specified permissions are listed in the If the request times out before the query finishes, you get a If given enough context, Policy Analyzer can analyzeIAMconditional role bindings that only grant access at specifictimes. These conditions are calleddate/time conditions.For Policy Analyzer to accurately analyze role bindings with date/timeconditions, you need to define the access time in the request. Policy Analyzer can also analyzeresourceconditions with no additional user input. Formore information about how Policy Analyzer works with conditions, seeConditional access. Note: Policy Analyzer only supportsIAM allow policies. Results do not account for other access control mechanisms, like IAM deny policies. For more information, seeSupported policy types. Before using any of the command data below, make the following replacements: Execute thegcloud asset analyze-iam-policy command: You receive a YAML response with analysis results. Each analysis result lists a set of accesses, identities, and resources that are relevant to your query, followed by the related IAM role binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is When you include the access time in the request, Policy Analyzer can evaluate date/time conditions. If the condition evaluates to false, that role is not included in the response. If the condition evaluates to true, the result of the condition evaluation is listed as If the request times out before the query finishes, you get a To determine which principals will have certain permissions on a resource ata specific time, use the Cloud Asset Inventory API's Before using any of the request data, make the following replacements: HTTP method and URL: Request JSON body: To send your request, expand one of these options: Save the request body in a file named Save the request body in a file named Copy the request body and open themethod reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Paste the request body in this tool, complete any other required fields, and clickExecute. You receive a JSON response with analysis results. Each analysis result describes a relevant IAM role binding, then lists the resource, accesses, and principals in that binding. If the role binding is conditional, the analysis result also includes the result of the condition evaluation. If the condition couldn't be evaluated, the result is listed as When you include the access time in the request, Policy Analyzer can evaluate date/time conditions. If the condition evaluates to false, that role is not included in the response. If the condition evaluates to true, the condition evaluation value in the analysis response is If the request times out before the query finishes, you get a You can enable the following options to receive more detailed query results. If you enable this option, any groups in the query results are expanded intoindividual members. If you have sufficient group permissions, nested groups willalso be expanded. This expansion is capped at1,000 members per group. This option is only available if you don't specify a principal in your query. If you enable this option, the query results list all permissions inside eachrole in addition to the role itself. This option is only available if you don't specify any permissions or roles in your query. This section describes several common flags that you can add when you use thegcloud CLI to analyze allow policies. For a full list of options, seeOptional flags. If this option is enabled, Policy Analyzer runs additional analysisqueries to determine who can impersonate the service accounts thathave the specified access to the specified resources. Policy Analyzerruns one query for each service account in query results. Thesequeries analyze who has any of the following permissions on theservice account: This is a very expensive operation, because it automatically executes many queries. We highly recommend that youexport to BigQuery orexport to Cloud Storage using If you enable this option, any groups in the query results are expanded intoindividual members. If you have sufficient group permissions, nested groups willalso be expanded. This expansion is capped at1,000 members per group. This option is only effective if you don't specify a principal in your query. If you enable this option, the query results list all permissions inside eachrole in addition to the role itself. This option is only available if you don't specify any permissions or roles in your query. To enable any options, first add an Replace If this option is enabled, Policy Analyzer runs additional analysisqueries to determine who can impersonate the service accounts thathave the specified access to the specified resources. Policy Analyzerruns one query for each service account in query results. Thesequeries analyze who has any of the following permissions on theservice account: This is a very expensive operation, because it automatically executes many queries. We highly recommend that youexport to BigQuery orexport to Cloud Storage using If you enable this option, any groups in the query results are expanded intoindividual members. If you have sufficient group permissions, nested groups willalso be expanded. This expansion is capped at1,000 members per group. This option is only effective if you don't specify a principal in your query. If you enable this option, the query results list all permissions inside eachrole in addition to the role itself. This option is only available if you don't specify any permissions or roles in your query.Console
gcloud
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueproject,folder, ororganization.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.FULL_RESOURCE_NAME:The full resource name of the resource that you want to analyze access for. For a list of fullresource name formats, seeResource nameformat.PERMISSIONS: Acomma-separated list of the permissions that you want to check for—for example,compute.instances.get,compute.instances.start. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.Linux, macOS, or Cloud Shell
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID\--full-resource-name=FULL_RESOURCE_NAME\--permissions='PERMISSIONS'
Windows (PowerShell)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID`--full-resource-name=FULL_RESOURCE_NAME`--permissions='PERMISSIONS'
Windows (cmd.exe)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.Note: If this command uses' for quoting content, replace these single quotes with double quotes. If quoting is nested, use\" to escape the inner quotes.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID^--full-resource-name=FULL_RESOURCE_NAME^--permissions='PERMISSIONS'
CONDITIONAL.identities fields in the response. The following example shows a single analysis result with theidentities field highlighted....---ACLs:- accesses: - permission: compute.instances.get - permission: compute.instances.startidentities: - name: user:my-user@example.com resources: - fullResourceName: //cloudresourcemanager.googleapis.com/projects/my-projectpolicy: attachedResource: //cloudresourcemanager.googleapis.com/projects/my-project binding: members: - user: my-user@example.com role: roles/compute.admin---...
DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyze-iam-policy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.REST
analyzeIamPolicy method.
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueprojects,folders, ororganizations.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.FULL_RESOURCE_NAME:The full resource name of the resource that you want to analyze access for. For a list of fullresource name formats, seeResource nameformat.PERMISSION_1,PERMISSION_2...PERMISSION_N: The permissions thatyou want to check for—for example,compute.instances.get. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.POST https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy
{ "analysisQuery": { "resourceSelector": { "fullResourceName": "FULL_RESOURCE_NAME" }, "accessSelector": { "permissions": [ "PERMISSION_1", "PERMISSION_2", "PERMISSION_N" ] } }}curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "X-HTTP-Method-Override: GET" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy"PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "X-HTTP-Method-Override" = "GET" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy" | Select-Object -Expand ContentAPIs Explorer (browser)
CONDITIONAL.identities fields in the response. The following example shows a single analysis result with theidentities field highlighted....{ "attachedResourceFullName": "//cloudresourcemanager.googleapis.com/projects/my-project", "iamBinding": { "role": "roles/compute.admin", "members": [ "user:my-user@example.com" ] }, "accessControlLists": [ { "resources": [ { "fullResourceName": "//cloudresourcemanager.googleapis.com/projects/my-project" } ], "accesses": [ { "permission": "compute.instances.get" }, { "permission": "compute.instances.start" } ] } ], "identityList": {"identities": [ { "name": "user:my-user@example.com" } ] }, "fullyExplored": true},...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyzeIamPolicy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.Determine which principals have certain roles or permissions
Console
gcloud
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueproject,folder, ororganization.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.ROLES: A comma-separated listof the roles that you want to check for—for example,roles/compute.admin,roles/compute.imageUser. If you list multiple roles, PolicyAnalyzer will check for any of the roles listed.PERMISSIONS: Acomma-separated list of the permissions that you want to check for—for example,compute.instances.get,compute.instances.start. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.Linux, macOS, or Cloud Shell
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID\--roles='ROLES'\--permissions='PERMISSIONS'
Windows (PowerShell)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID`--roles='ROLES'`--permissions='PERMISSIONS'
Windows (cmd.exe)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.Note: If this command uses' for quoting content, replace these single quotes with double quotes. If quoting is nested, use\" to escape the inner quotes.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID^--roles='ROLES'^--permissions='PERMISSIONS'
CONDITIONAL.identities fields in the response. The following example shows a single analysis result with theidentities field highlighted....---ACLs:- accesses: - permission: compute.instances.get - permission: compute.instances.start - role: roles/compute.adminidentities: - name: user:my-user@example.com resources: - fullResourceName: //cloudresourcemanager.googleapis.com/projects/my-projectpolicy: attachedResource: //cloudresourcemanager.googleapis.com/projects/my-project binding: members: - user: my-user@example.com role: roles/compute.admin---...
DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyze-iam-policy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.REST
analyzeIamPolicy method.
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueprojects,folders, ororganizations.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.ROLE_1,ROLE_2...ROLE_N: The roles thatyou want to check for—for example,roles/compute.admin. If you list multipleroles, Policy Analyzer will check for any of the roles listed.PERMISSION_1,PERMISSION_2...PERMISSION_N: The permissions thatyou want to check for—for example,compute.instances.get. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.POST https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy
{ "analysisQuery": { "accessSelector": { "roles": [ "ROLE_1", "ROLE_2", "ROLE_N" ], "permissions": [ "PERMISSION_1", "PERMISSION_2", "PERMISSION_N" ] } }}curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "X-HTTP-Method-Override: GET" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy"PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "X-HTTP-Method-Override" = "GET" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy" | Select-Object -Expand ContentAPIs Explorer (browser)
CONDITIONAL.identities fields in the response. The following example shows a single analysis result with theidentities field highlighted....{ "attachedResourceFullName": "//cloudresourcemanager.googleapis.com/projects/my-project", "iamBinding": { "role": "roles/compute.admin", "members": [ "user:my-user@example.com" ] }, "accessControlLists": [ { "resources": [ { "fullResourceName": "//cloudresourcemanager.googleapis.com/projects/my-project" } ], "accesses": [ { "permission": "compute.instances.get" }, { "role": "roles/compute.admin" } ] } ], "identityList": {"identities": [ { "name": "user:my-user@example.com" } ] }, "fullyExplored": true},...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyzeIamPolicy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.Determine what access a principal has on a resource
Console
gcloud
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueproject,folder, ororganization.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.FULL_RESOURCE_NAME:The full resource name of the resource that you want to analyze access for. For a list of fullresource name formats, seeResource nameformat.PRINCIPAL: The principal whoseaccess you want to analyze, in the formPRINCIPAL_TYPE:ID—for example,user:my-user@example.com. For a full list of the principal types, seePrincipal identifiers.Linux, macOS, or Cloud Shell
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID\--full-resource-name=FULL_RESOURCE_NAME\--identity=PRINCIPAL
Windows (PowerShell)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID`--full-resource-name=FULL_RESOURCE_NAME`--identity=PRINCIPAL
Windows (cmd.exe)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID^--full-resource-name=FULL_RESOURCE_NAME^--identity=PRINCIPAL
CONDITIONAL.accesses fields in the response. The following example shows a single analysis result with theaccesses field highlighted....---ACLs:- accesses: - roles/iam.serviceAccountUser identities: - name: user:my-user@example.com resources: - fullResourceName: //cloudresourcemanager.googleapis.com/projects/my-projectpolicy: attachedResource: //cloudresourcemanager.googleapis.com/projects/my-project binding: members: - user: my-user@example.com role: roles/iam.serviceAccountUser---...
DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyze-iam-policy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.REST
analyzeIamPolicy method.
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueprojects,folders, ororganizations.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.FULL_RESOURCE_NAME:The full resource name of the resource that you want to analyze access for. For a list of fullresource name formats, seeResource nameformat.PRINCIPAL: The principal whoseaccess you want to analyze, in the formPRINCIPAL_TYPE:ID—for example,user:my-user@example.com. For a full list of the principal types, seePrincipal identifiers.POST https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy
{ "analysisQuery": { "resourceSelector": { "fullResourceName": "FULL_RESOURCE_NAME" }, "identitySelector": { "identity": "PRINCIPAL" } }}curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "X-HTTP-Method-Override: GET" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy"PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "X-HTTP-Method-Override" = "GET" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy" | Select-Object -Expand ContentAPIs Explorer (browser)
CONDITIONAL.accesses fields in the response. The following example shows a single analysis result with theaccesses field highlighted....{ "attachedResourceFullName": "//cloudresourcemanager.googleapis.com/projects/my-project", "iamBinding": { "role": "roles/iam.serviceAccountUser", "members": [ "user:my-user@example.com" ] }, "accessControlLists": [ { "resources": [ { "fullResourceName": "//cloudresourcemanager.googleapis.com/projects/my-project" } ],"accesses": [ { "roles": "iam.serviceAccountUser" } ] } ], "identityList": { "identities": [ { "name": "user:my-user@example.com" } ] }, "fullyExplored": true},...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyzeIamPolicy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.Determine which resources a principal can access
Console
gcloud
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueproject,folder, ororganization.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.PRINCIPAL: The principal whoseaccess you want to analyze, in the formPRINCIPAL_TYPE:ID—for example,user:my-user@example.com. For a full list of the principal types, seePrincipal identifiers.PERMISSIONS: Acomma-separated list of the permissions that you want to check for—for example,compute.instances.get,compute.instances.start. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.Linux, macOS, or Cloud Shell
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID\--identity=PRINCIPAL\--permissions='PERMISSIONS'
Windows (PowerShell)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID`--identity=PRINCIPAL`--permissions='PERMISSIONS'
Windows (cmd.exe)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.Note: If this command uses' for quoting content, replace these single quotes with double quotes. If quoting is nested, use\" to escape the inner quotes.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID^--identity=PRINCIPAL^--permissions='PERMISSIONS'
CONDITIONAL.resources fields in the response. The following example shows a single analysis result with theresources field highlighted....---ACLs:- accesses: - permission: compute.instances.get - permission: compute.instances.start identities: - name: user:my-user@example.comresources: - fullResourceName: //compute.googleapis.com/projects/my-project/global/images/my-imagepolicy: attachedResource: //compute.googleapis.com/projects/my-project/global/images/my-image binding: members: - user: my-user@example.com role: roles/compute.admin---...
DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyze-iam-policy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.REST
analyzeIamPolicy method.
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueprojects,folders, ororganizations.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.PRINCIPAL: The principal whoseaccess you want to analyze, in the formPRINCIPAL_TYPE:ID—for example,user:my-user@example.com. For a full list of the principal types, seePrincipal identifiers.PERMISSION_1,PERMISSION_2...PERMISSION_N: The permissions thatyou want to check for—for example,compute.instances.get. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.POST https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy
{ "analysisQuery": { "identitySelector": { "identity": "PRINCIPAL" }, "accessSelector": { "permissions": [ "PERMISSION_1", "PERMISSION_2", "PERMISSION_N" ] } }}curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "X-HTTP-Method-Override: GET" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy"PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "X-HTTP-Method-Override" = "GET" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy" | Select-Object -Expand ContentAPIs Explorer (browser)
CONDITIONAL.resources fields in the response. The following example shows a single analysis result with theresources field highlighted....{ "attachedResourceFullName": "//compute.googleapis.com/projects/my-project/global/images/my-image", "iamBinding": { "role": "roles/compute.admin", "members": [ "user:my-user@example.com" ] }, "accessControlLists": [ {"resources": [ { "fullResourceName": "//compute.googleapis.com/projects/my-project/global/images/my-image" } ], "accesses": [ { "permission": "compute.instances.get" }, { "permission": "compute.instances.start" } ] } ], "identityList": { "identities": [ { "name": "user:my-user@example.com" } ] }, "fullyExplored": true},...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyzeIamPolicy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.Determine access at a specific time
gcloud
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueproject,folder, ororganization.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.PERMISSIONS:Optional. A comma-separated list of the permissions that you want to check for—for example,compute.instances.get,compute.instances.start. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.FULL_RESOURCE_NAME: Optional. The full resource name of the resource thatyou want to analyze access for. For a list of full resource name formats, seeResource name format.PERMISSIONS:Optional. A comma-separated list of the permissions that you want to check for—for example,compute.instances.get,compute.instances.start. If you list multiplepermissions, Policy Analyzer will check for any of the permissions listed.ACCESS_TIME: The time that you wantto check. This time must be in the future. Use a timestamp inRFC 3339format—forexample,2099-02-01T00:00:00Z.Linux, macOS, or Cloud Shell
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID\--identity=PRINCIPAL\--full-resource-name=FULL_RESOURCE_NAME\--permissions='PERMISSIONS'\--access-time=ACCESS_TIME
Windows (PowerShell)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID`--identity=PRINCIPAL`--full-resource-name=FULL_RESOURCE_NAME`--permissions='PERMISSIONS'`--access-time=ACCESS_TIME
Windows (cmd.exe)
Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running eithergcloud init; orgcloud auth login andgcloud config set project.Note: If this command uses' for quoting content, replace these single quotes with double quotes. If quoting is nested, use\" to escape the inner quotes.gcloudassetanalyze-iam-policy--RESOURCE_TYPE=RESOURCE_ID^--identity=PRINCIPAL^--full-resource-name=FULL_RESOURCE_NAME^--permissions='PERMISSIONS'^--access-time=ACCESS_TIME
CONDITIONAL.TRUE....---ACLs:- accesses: - permission: compute.instances.get - permission: compute.instances.start conditionEvaluationValue: 'TRUE' identities: - name: user:my-user@example.com resources: - fullResourceName: //cloudresourcemanager.googleapis.com/projects/my-projectpolicy: attachedResource: //cloudresourcemanager.googleapis.com/projects/my-project binding: condition: expression: request.time.getHours("America/Los_Angeles") >= 5 title: No access before 5am PST members: - user: my-user@example.com role: roles/compute.admin---...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyze-iam-policy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.REST
analyzeIamPolicy method.
Note: If you want more detailed query results, you canenable advanced options.RESOURCE_TYPE: The typeof the resource that you want to scope your search to. Only IAM allow policiesattached to this resource and to its descendants will be analyzed. Use the valueprojects,folders, ororganizations.RESOURCE_ID: The ID of theGoogle Cloud project, folder, or organization that you want to scope your search to. OnlyIAM allow policies attached to this resource and to its descendants will be analyzed.ProjectIDs are alphanumeric strings, likemy-project. Folder and organization IDs are numeric,like123456789012.PERMISSION_1,PERMISSION_2...PERMISSION_N: Optional. Thepermissions that you want to check for—for example,compute.instances.get. If youlist multiple permissions, Policy Analyzer will check for any of the permissions listed.FULL_RESOURCE_NAME: Optional. The full resource name of the resource thatyou want to analyze access for. For a list of full resource name formats, seeResource name format.PERMISSION_1,PERMISSION_2...PERMISSION_N: Optional. Thepermissions that you want to check for—for example,compute.instances.get. If youlist multiple permissions, Policy Analyzer will check for any of the permissions listed.ACCESS_TIME: The time that you wantto check. This time must be in the future. Use a timestamp inRFC 3339format—forexample,2099-02-01T00:00:00Z.POST https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy
{ "analysisQuery": { "identitySelector": { "identity": "PRINCIPAL" }, "resourceSelector": { "fullResourceName": "FULL_RESOURCE_NAME" }, "accessSelector": { "permissions": [ "PERMISSION_1", "PERMISSION_2", "PERMISSION_N" ] }, "conditionContext": { "accessTime": "ACCESS_TIME" } }}curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "X-HTTP-Method-Override: GET" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy"PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.request.json, and execute the following command:$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "X-HTTP-Method-Override" = "GET" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://cloudasset.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID:analyzeIamPolicy" | Select-Object -Expand ContentAPIs Explorer (browser)
CONDITIONAL.TRUE....{ "attachedResourceFullName": "//cloudresourcemanager.googleapis.com/projects/my-project", "iamBinding": { "role": "roles/compute.admin", "members": [ "user:my-user@example.com" ], "condition": { "expression": "request.time.getHours(\"America/Los_Angeles\") \u003e= 5", "title": "No access before 5am PST" } }, "accessControlLists": [ { "resources": [ { "fullResourceName": "//cloudresourcemanager.googleapis.com/projects/my-project" } ], "accesses": [ { "permission": "compute.instances.get" }, { "permission": "compute.instances.start" } ], "conditionEvaluation": { "evaluationValue": "TRUE" } } ], "identityList": { "identities": [ { "name": "user:my-user@example.com" } ] }, "fullyExplored": true},...DEADLINE_EXCEEDED error. To get more results for these queries, write the results to either BigQuery or Cloud Storage using the long-running version ofanalyzeIamPolicy. For instructions, seeWrite policy analysis to BigQuery orWrite policy analysis to Cloud Storage.Enable options
Console
Option Description List resources within resource(s) matching your query If you enable this option, the query results list up to1,000 relevantdescendantresources for any parent resources (projects, folders, andorganizations) in the query results. List individual users inside groups List permissions inside roles gcloud
Flag Description --analyze-service-account-impersonationiam.serviceAccounts.actAsiam.serviceAccounts.getAccessTokeniam.serviceAccounts.getOpenIdTokeniam.serviceAccounts.implicitDelegationiam.serviceAccounts.signBlobiam.serviceAccounts.signJwtanalyze-iam-policy-longrunning instead of usinganalyze-iam-policy.--expand-groups--expand-resourcesIf you enable this option, the query results list up to1,000 relevantdescendantresources for any parent resources (projects, folders, andorganizations) in the query results. --expand-roles--output-group-edgesIf you enable this option, the query results output the relevant membershiprelationships between groups. --output-resource-edgesIf you enable this option, the query results output the relevant parent/childrelationships between resources. REST
options field to your analysisquery. For example:{"analysisQuery":{"resourceSelector":{"fullResourceName":"//cloudresourcemanager.googleapis.com/projects/my-project"},"accessSelector":{"permissions":["iam.roles.get","iam.roles.list"]},"options":{OPTIONS}}}
OPTIONS with the options that you want toenable, in the form"OPTION": true. The following tabledescribes the available options:Option Description analyzeServiceAccountImpersonationiam.serviceAccounts.actAsiam.serviceAccounts.getAccessTokeniam.serviceAccounts.getOpenIdTokeniam.serviceAccounts.implicitDelegationiam.serviceAccounts.signBlobiam.serviceAccounts.signJwtAnalyzeIamPolicyLongrunning instead of usingAnalyzeIamPolicy.expandGroupsexpandResourcesIf you enable this option, the query results list up to1,000 relevantdescendantresources for any parent resources (projects, folders, andorganizations) in the query results. expandRolesoutputGroupEdgesIf you enable this option, the query results output the relevant membershiprelationships between groups. outputResourceEdgesIf you enable this option, the query results output the relevant parent/childrelationships between resources. What's next
AnalyzeIamPolicyLongrunning towriteto BigQuery orwrite toCloud Storage.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.