Ресурс google_kms_crypto_keys
Синтаксис
Используется google_kms_crypto_keys, чтобы проверить ресурс Google CryptoKey.
Примеры
describe google_kms_crypto_keys(project: 'chef-gcp-inspec', location: 'europe-west2', key_ring_name: 'kms-key-ring') do
its('count') { should be >= 1 }
its('crypto_key_names') { should include 'kms-key' }
end
Проверка, что в хранилище ключей нет более указанного количества ключей
describe google_kms_crypto_keys(project: 'chef-inspec-gcp', location: 'us-east1', key_ring_name: 'key-ring') do
its('count') { should be <= 100}
end
Проверка наличия ожидаемого имени ключа в хранилище ключей
describe google_kms_crypto_keys(project: 'chef-inspec-gcp', location: 'us-east1', key_ring_name: 'key-ring') do
its('crypto_key_names') { should include "my-crypto-key-name" }
end
Свойства
Свойства, к которым можно получить доступ из ресурса Google_kms_crypto_keys:
Для получения дополнительной информации см. ресурс google_kms_crypto_key.
- crypto_key_name
- массив
google_kms_crypto_keycrypto_key_name - create_time
- массив
google_kms_crypto_keycreate_time - labels
- массив
google_kms_crypto_keylabels - purpose
- массив
google_kms_crypto_keypurpose - rotation_period
- массив
google_kms_crypto_keyrotation_period - version_template
- массив
google_kms_crypto_keyversion_template - next_rotation_time
- массив
google_kms_crypto_keynext_rotation_time - key_ring
- массив
google_kms_crypto_keykey_ring
Критерии фильтрации
Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые могут быть использованы с where как блоком или методом.
Разрешения GCP
Убедитесь, что для текущего проекта включен API Cloud Key Management Service (KMS) по адресу https://console.cloud.google.com/apis/library/cloudkms.googleapis.com/.
© 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_kms_crypto_keys/