google_iam_service_account_keys resource
Use the google_iam_service_account_keys
InSpec audit resource to to test a Google Cloud ServiceAccountKey resource.
Examples
describe google_iam_service_account_keys(project: 'chef-gcp-inspec', service_account: "display-name@project-id.iam.gserviceaccount.com") do
its('count') { should be <= 1000 }
end
Properties
Properties that can be accessed from the google_iam_service_account_keys
resource:
See google_iam_service_account_key for more detailed information.
key_names
: an array ofgoogle_iam_service_account_key
nameprivate_key_types
: an array ofgoogle_iam_service_account_key
private_key_typekey_algorithms
: an array ofgoogle_iam_service_account_key
key_algorithmprivate_key_data
: an array ofgoogle_iam_service_account_key
private_key_datapublic_key_data
: an array ofgoogle_iam_service_account_key
public_key_datavalid_after_times
: an array ofgoogle_iam_service_account_key
valid_after_timevalid_before_times
: an array ofgoogle_iam_service_account_key
valid_before_timekey_types
: an array ofgoogle_iam_service_account_key
key_typeservice_accounts
: an array ofgoogle_iam_service_account_key
service_accountpaths
: an array ofgoogle_iam_service_account_key
path
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where
as a block or a method.
GCP permissions
Ensure the Identity and Access Management (IAM) API is enabled for the current project.