This PR creates an IAM Policy Custom Role Permissions constraint that checks whether the user defined permissions are either allowed or denied in a user defined custom role.
A sample playground for this constraint is provided here.
This constraint provides the following features:
mode
Enforcement mode, [denylist, allowlist] , defaults to allowlist.
title
The custom role title to scan for, found on the IAM Roles page.
E.g. 'My Custom Role for BigQuery'
permissions
Permissions to either allow or deny for the given custom role, depending on mode; Wildcards (*) supported.
E.g. 'bigquery.datasets.*' will search for any permissions that start with bigquery.datasets, such as bigquery.datasets.get
E.g. 'bigquery.**' will search for any permissions that start with bigquery, such as bigquery.savedqueries.get, bigquery.config.get
E.g. '*' will search for any permissions
Also included in this PR:
Sample constraint
Tests
Added a function to test_utils to test for a field other than resource.
IAM Custom Role Permissions Constraint V1
This PR creates an IAM Policy Custom Role Permissions constraint that checks whether the user defined permissions are either allowed or denied in a user defined custom role.
A sample playground for this constraint is provided here.
This constraint provides the following features:
Also included in this PR:
test_utils
to test for a field other thanresource
.