google_user ресурс
Используйте ресурс аудита InSpec, чтобы проверить свойства одного пользователя GCP.
Синтаксис
Блок ресурса google_user объявляет тесты для одного пользователя GCP по почтовому адресу принципала или неизменяемому идентификатору.
describe google_user(user_key: 'principal_email_address@domain.com') do
it { should exist }
end
Примеры
Следующие примеры показывают, как использовать этот ресурс аудита InSpec.
Проверка существования пользователя GCP с указанным ID
describe google_user(user_key: '110491234567894702010') do
it { should exist }
end
Проверка соответствия имени пользователя GCP
describe google_user(user_key: '110491234567894702010') do
its('name.full_name') { should eq "Bill S. Preston Esq." }
end
Проверка включения MFA для пользователя GCP
describe google_user(user_key: 'theodore_ted_logan@excellentadventure.com') do
it { should have_mfa_enabled }
end
Проверка состояния приостановки пользователя GCP
describe google_user(user_key: 'theodore_ted_logan@excellentadventure.com') do
it { should_not be_suspended }
end
Свойства
-
agreed_to_terms,archived,change_password_at_next_login,creation_time,customer_id,emails,etag,id,include_in_global_address_list,ip_whitelisted,is_admin,is_delegated_admin,is_enforced_in2_sv,is_enrolled_in2_sv,is_mailbox_setup,kind,last_login_time,name,non_editable_aliases,org_unit_path,primary_email,suspended
Разрешения GCP
Убедитесь, что в Google Suite Admin SDK включен API каталога и у вас есть достаточные привилегии для перечисления пользователей.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_user/