Примеры запросов для поиска событий в аудитных логах
В этом разделе собраны наиболее частые запросы для поиска событий в аудитных логах для различных ресурсов Yandex Cloud. Чтобы получить нужные события, выполните запрос из приведенных примеров.
Инфраструктура и сеть
Мониторинг и управление ресурсами
Контейнеры
- Yandex Managed Service for Kubernetes
- Создание кластера с публичным IP-адресом мастера
- Создание кластера без группы безопасности для мастера
- Создание кластера без автоматического обновления мастеров
- Создание кластера без шифрования etcd
- Создание кластера без сетевых политик
- Создание группы узлов c публичными IP-адресами
- Создание кластера без автоматического обновления группы узлов
- Yandex Container Registry
Платформа данных
Безопасность
Инфраструктура и сеть
Yandex Compute Cloud
Любые действия с виртуальной машиной
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.details.instance_id") = '<идентификатор_виртуальной_машины>' and (
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.CreateInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.UpdateInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.DeleteInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.StartInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.StopInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.RestartInstance')
Идентификатор можно запросить со списком виртуальных машин в каталоге.
Используйте фильтр:
json_payload.details.instance_id="<идентификатор_виртуальной_машины>" and (
json_payload.event_type="yandex.cloud.audit.compute.CreateInstance" or
json_payload.event_type="yandex.cloud.audit.compute.UpdateInstance" or
json_payload.event_type="yandex.cloud.audit.compute.DeleteInstance" or
json_payload.event_type="yandex.cloud.audit.compute.StartInstance" or
json_payload.event_type="yandex.cloud.audit.compute.StopInstance" or
json_payload.event_type="yandex.cloud.audit.compute.RestartInstance")
Идентификатор можно запросить со списком виртуальных машин в каталоге.
Добавление дополнительного интерфейса к виртуальной машине
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.AttachInstanceNetworkInterface'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.compute.AttachInstanceNetworkInterface"
Добавление доступа к серийной консоли виртуальной машины
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.CreateInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.UpdateInstance') and
JSON_VALUE(data,"$.details.metadata_serial_port_enable") = '1'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.compute.UpdateInstance" or
json_payload.event_type="yandex.cloud.audit.compute.CreateInstance" and
json_payload.details.metadata_serial_port_enable="1"
Создание или изменение виртуальной машины с включенным получением токена через AWS IMDSv1
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.CreateInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.UpdateInstance') and
JSON_VALUE(data,"$.details.metadata_options.aws_v1_http_token") = 'ENABLED'
Используйте фильтр:
(json_payload.event_type="yandex.cloud.audit.compute.UpdateInstance" or
json_payload.event_type="yandex.cloud.audit.compute.CreateInstance") and
json_payload.details.metadata_options.aws_v1_http_token="ENABLED"
Yandex Virtual Private Cloud
Любые действия с определенного IP-адреса
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.request_metadata.remote_address") = '<IP-адрес>'
Используйте фильтр:
json_payload.request_metadata.remote_address = "<IP-адрес>"
Добавление публичного IP-адреса к виртуальной машине
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.network.AddressAttached'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.network.AddressAttached"
Создание или изменение группы безопасности
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.CreateInstance' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.compute.UpdateInstance'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.network.CreateSecurityGroup" or
json_payload.event_type="yandex.cloud.audit.network.UpdateSecurityGroup"
Мониторинг и управление ресурсами
Yandex Cloud Organization
Удаление каталога
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.resourcemanager.DeleteFolder' and
JSON_VALUE(data,"$.details.folder_name") = '<имя_каталога>'
Имя каталога можно запросить со списком каталогов в облаке.
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.resourcemanager.DeleteFolder" and json_payload.details.folder_name="<имя_каталога>"
Имя каталога можно запросить со списком каталогов в облаке.
Создание федерации
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.organizationmanager.saml.CreateFederation'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.organizationmanager.saml.CreateFederation"
Изменение федерации
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.organizationmanager.saml.UpdateFederation'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.organizationmanager.saml.UpdateFederation"
Добавление сертификата в федерацию
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.organizationmanager.saml.CreateCertificate'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.organizationmanager.saml.CreateCertificate"
Обнаружение облачного секрета в открытом доступе
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.organizationmanager.DetectLeakedCredential'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.organizationmanager.DetectLeakedCredential"
Контейнеры
Yandex Managed Service for Kubernetes
Создание кластера с публичным IP-адресом мастера
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateCluster' and
JSON_EXISTS(data,"$.request_parameters.master_spec.zonal_master_spec.external_v4_address_spec.address")
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.k8s.CreateCluster" and
json_payload.request_parameters.master_spec.zonal_master_spec.external_v4_address_spec.address exists
Создание кластера без группы безопасности для мастера
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateCluster' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.UpdateCluster') and not
JSON_EXISTS(data,"$.request_parameters.master_spec.security_group_ids")
Используйте фильтр:
(json_payload.event_type = "yandex.cloud.audit.k8s.CreateCluster" or
json_payload.event_type = "yandex.cloud.audit.k8s.UpdateCluster") and not
json_payload.request_parameters.master_spec.security_group_ids exists
Создание кластера без автоматического обновления мастеров
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateCluster' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.UpdateCluster') and not
JSON_EXISTS(data,"$.request_parameters.master_spec.maintenance_policy.auto_upgrade")
Используйте фильтр:
(json_payload.event_type = "yandex.cloud.audit.k8s.CreateCluster" or
json_payload.event_type = "yandex.cloud.audit.k8s.UpdateCluster") and not
json_payload.request_parameters.master_spec.maintenance_policy.auto_upgrade exists
Создание кластера без шифрования etcd
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateCluster' and not
JSON_EXISTS(data,"$.request_parameters.kms_provider.key_id")
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.k8s.CreateCluster" and not
json_payload.request_parameters.kms_provider.key_id exists
Создание кластера без сетевых политик
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateCluster' and not
JSON_EXISTS(data,"$.request_parameters.network_policy.provider")
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.k8s.CreateCluster" and not
json_payload.request_parameters.network_policy.provider exists
Создание группы узлов c публичными IP-адресами
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateNodeGroup' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.UpdateNodeGroup') and
JSON_EXISTS(data,"$.request_parameters.node_template.v4_address_spec.one_to_one_nat_spec")
Используйте фильтр:
(json_payload.event_type = "yandex.cloud.audit.k8s.CreateNodeGroup" or
json_payload.event_type = "yandex.cloud.audit.k8s.CreateNodeGroup") and
json_payload.request_parameters.node_template.v4_address_spec.one_to_one_nat_spec exists
Создание кластера без автоматического обновления группы узлов
Выполните запрос:
select * from
bindings.`binding`
where
(JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.CreateNodeGroup' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.k8s.UpdateNodeGroup') and not
JSON_EXISTS(data,"$.request_parameters.maintenance_policy.auto_upgrade")
Используйте фильтр:
(json_payload.event_type = "yandex.cloud.audit.k8s.CreateNodeGroup" or
json_payload.event_type = "yandex.cloud.audit.k8s.UpdateNodeGroup") and not
json_payload.request_parameters.maintenance_policy.auto_upgrade exists
Yandex Container Registry
Обнаружение критических уязвимостей при сканировании образа
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.containerregistry.ScanImage' and
JSON_VALUE(data,"$.details.vulnerability_stats.critical") > 0
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.containerregistry.ScanImage" and
json_payload.details.vulnerability_stats.critical > 0
Платформа данных
Yandex Object Storage
Изменение политики доступа к бакету
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.storage.BucketPolicyUpdate'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.storage.BucketPolicyUpdate"
Открытие публичного доступа при создании или изменении бакета
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.storage.BucketUpdate' and
(JSON_VALUE(data,"$.details.objects_access") = 'true' or
JSON_VALUE(data,"$.details.settings_read_access") = 'true' or
JSON_VALUE(data,"$.details.list_access") = 'true')
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.storage.BucketUpdate" and
(json_payload.details.objects_access: "true" or
json_payload.details.settings_read_access: "true" or
json_payload.details.list_access: "true")
Управляемые базы данных (MDB)
Создание или изменение пользователя для MDB
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.mdb.postgresql.CreateUser' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.mdb.postgresql.UpdateUser' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.mdb.mysql.UpdateUser' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.mdb.mysql.CreateUser'
Используйте фильтр:
json_payload.event_type = "yandex.cloud.audit.mdb.postgresql.CreateUser" or
json_payload.event_type = "yandex.cloud.audit.mdb.postgresql.UpdateUser" or
json_payload.event_type = "yandex.cloud.audit.mdb.mysql.UpdateUser" or
json_payload.event_type = "yandex.cloud.audit.mdb.mysql.CreateUser"
Безопасность
Yandex Key Management Service
Изменение ролей для KMS-ключей
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.kms.UpdateSymmetricKeyAccessBindings' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.kms.SetSymmetricKeyAccessBindings' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.kms.UpdateAsymmetricEncryptionKeyAccessBindings' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.kms.SetAsymmetricEncryptionKeyAccessBindings'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.kms.UpdateSymmetricKeyAccessBindings" or
json_payload.event_type="yandex.cloud.audit.kms.SetSymmetricKeyAccessBindings" or
json_payload.event_type="yandex.cloud.audit.kms.UpdateAsymmetricEncryptionKeyAccessBindings" or
json_payload.event_type="yandex.cloud.audit.kms.SetAsymmetricEncryptionKeyAccessBindings"
Yandex Identity and Access Management
Действия конкретного пользователя за период времени
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.authentication.subject_name") = '<имя_пользователя>' and
cast(JSON_VALUE(data, "$.event_time") as Timestamp) > Date("<дата_начала_периода>")
limit 10
Дата задается в формате ГГГГ-ММ-ДД
.
Используйте фильтр:
json_payload.authentication.subject_name="<имя_пользователя>" and
json_payload.event_time>"<дата_начала_периода>" and
json_payload.event_time<"<дата_окончания_периода>"
Дата задается в формате ГГГГ-ММ-ДД
.
Создание любых ключей для сервисных аккаунтов
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.iam.CreateAccessKey' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.iam.CreateKey' or
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.iam.CreateApiKey'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.iam.CreateAccessKey" or
json_payload.event_type="yandex.cloud.audit.iam.CreateKey" or
json_payload.event_type="yandex.cloud.audit.iam.CreateApiKey"
Назначение примитивных привилегированных ролей на ресурсы
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.details.access_binding_deltas.access_binding.role_id") = '<примитивная_роль>'
Используйте фильтр:
json_payload.details.access_binding_deltas.access_binding.role_id="<примитивная_роль>"
Yandex Lockbox
Изменение ролей для секретов
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.lockbox.UpdateSecretAccessBindings'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.lockbox.UpdateSecretAccessBindings"
Чтение секрета
Выполните запрос:
select * from
bindings.`binding`
where
JSON_VALUE(data,"$.event_type") = 'yandex.cloud.audit.lockbox.GetPayload'
Используйте фильтр:
json_payload.event_type="yandex.cloud.audit.lockbox.GetPayload"