Method: iamPolicies.lintPolicy

Lints a Cloud IAM policy object or its sub fields. Currently supports google.iam.v1.Binding.condition.

Each lint operation consists of multiple lint validation units. Each unit inspects the input object in regard to a particular linting aspect and issues a google.iam.admin.v1.LintResult disclosing the result.

The set of applicable validation units is determined by the Cloud IAM server and is not configurable.

Regardless of any lint issues or their severities, successful calls to lintPolicy return an HTTP 200 OK status code.

HTTP request

POST https://iam.googleapis.com/v1/iamPolicies:lintPolicy

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "fullResourceName": string,
  "condition": {
    object (Expr)
  }
}
Fields
fullResourceName

string

The full resource name of the policy this lint request is about.

The name follows the Google Cloud Platform (GCP) resource format. For example, a GCP project with ID my-project will be named //cloudresourcemanager.googleapis.com/projects/my-project.

The resource name is not used to read the policy instance from the Cloud IAM database. The candidate policy for lint has to be provided in the same request object.

condition

object (Expr)

google.iam.v1.Binding.condition object to be linted.

Response body

If successful, the response body contains data with the following structure:

The response of a lint operation. An empty response indicates the operation was able to fully execute and no lint issue was found.

JSON representation
{
  "lintResults": [
    {
      object (LintResult)
    }
  ]
}
Fields
lintResults[]

object (LintResult)

List of lint results sorted by severity in descending order.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/iam
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

LintResult

Structured response of a single validation unit.

JSON representation
{
  "level": enum (Level),
  "validationUnitName": string,
  "severity": enum (Severity),
  "fieldName": string,
  "locationOffset": integer,
  "debugMessage": string
}
Fields
level

enum (Level)

The validation unit level.

validationUnitName

string

The validation unit name, for instance "lintValidationUnits/ConditionComplexityCheck".

severity

enum (Severity)

The validation unit severity.

fieldName

string

The name of the field for which this lint result is about.

For nested messages fieldName consists of names of the embedded fields separated by period character. The top-level qualifier is the input object to lint in the request. For example, the fieldName value condition.expression identifies a lint result for the expression field of the provided condition.

locationOffset

integer

0-based character position of problematic construct within the object identified by fieldName. Currently, this is populated only for condition expression.

debugMessage

string

Human readable debug message associated with the issue.

Level

Possible Level values of a validation unit corresponding to its domain of discourse.

Enums
LEVEL_UNSPECIFIED Level is unspecified.
CONDITION A validation unit which operates on an individual condition within a binding.

Severity

Possible Severity values of an issued result.

Enums
SEVERITY_UNSPECIFIED Severity is unspecified.
ERROR A validation unit returns an error only for critical issues. If an attempt is made to set the problematic policy without rectifying the critical issue, it causes the setPolicy operation to fail.
WARNING

Any issue which is severe enough but does not cause an error. For example, suspicious constructs in the input object will not necessarily fail setPolicy, but there is a high likelihood that they won't behave as expected during policy evaluation in checkPolicy. This includes the following common scenarios:

  • Unsatisfiable condition: Expired timestamp in date/time condition.
  • Ineffective condition: Condition on a <member, role> pair which is granted unconditionally in another binding of the same policy.
NOTICE Reserved for the issues that are not severe as ERROR/WARNING, but need special handling. For instance, messages about skipped validation units are issued as NOTICE.
INFO Any informative statement which is not severe enough to raise ERROR/WARNING/NOTICE, like auto-correction recommendations on the input content. Note that current version of the linter does not utilize INFO.
DEPRECATED Deprecated severity level.
Var denne side nyttig? Giv os en anmeldelse af den:

Send feedback om...

Cloud IAM Documentation