Getting started with Audit Trails
Audit Trails collects audit logs of Yandex Cloud resources to monitor actions with resources and access events. You can upload logs to a Yandex Object Storage bucket, Yandex Cloud Logging log group, or Yandex Data Streams data stream.
Audit logs are collected and delivered to Audit Trails using trails. You need a separate trail for each storage type.
Follow this guide to create a trail to upload the audit logs of your organization’s resources. Select the destination object, depending on your goal:
- Object Storage bucket for long-term storage of audit logs and their future analysis.
- Cloud Logging log group to quickly view and search logs in real time. A good option for your first introduction to the service.
Getting started
This guide assumes that you already have Yandex Cloud resources, so first make sure that:
- You have a cloud.
- Your cloud has a linked billing account with the
ACTIVEorTRIAL_ACTIVEstatus.
To create a trail, you will need the following roles:
-
iam.serviceAccounts.userfor the service account to collect audit logs. You can create this service account when creating the trail. -
audit-trails.editorfor the folder to host the trail. -
audit-trails.viewerfor the organization whose audit logs will be collected. -
If using a bucket:
kms.editorfor the folder the bucket encryption key will be created in.storage.viewerfor the bucket or folder.
-
If using a log group:
logging.viewerfor the log group or folder.
Note
If you cannot manage roles, contact your cloud or organization administrator.
Creating a trail
-
In the management console
, select the folder to host the trail. -
Navigate
to Audit Trails. -
Click Create trail.
-
Under Destination, configure the destination object:
- Destination:
Object Storage. - Bucket: Select the bucket to upload audit logs to. If you do not have a bucket yet, click Create and create a new bucket with restricted access.
- Object prefix: Optional parameter used in the full name of the audit log file.
Note
Use a prefix to store audit logs and third-party data in the same bucket. Do not use the same prefix for logs and other bucket objects because that may cause logs and third-party objects to overwrite each other.
- Encryption key: If the bucket you selected is encrypted, specify the encryption key.
- Destination:
-
Under Control plane log collection:
-
Enable log collection.
-
Select a resource:
Organization,Cloud, orFolder. -
Depending on the resource you selected, select specific clouds or folders to collect events from:
-
For the
Organizationcollection scope, select one or more clouds to collect events from in the Cloud drop-down list.Keep the default value (
All) to collect events from all clouds in the organization. -
For the
Cloudcollection scope, select one or more folders to collect events from in the Folder drop-down list.Keep the default value (
All) to collect events from all folders in the cloud.
-
-
-
Under Data plane log collection:
Warning
In the management console, collection of some data events is on by default. Their delivery is billed as per the pricing policy. If you do not need data events, disable their collection.
-
Enable log collection.
-
Select the services to collect audit logs for.
-
Configure the event collection scope and filter for each service:
-
Click
to the right of the service name. -
Select a resource:
Organization,Cloud, orFolder. -
Depending on the resource you selected, select specific clouds or folders to collect events from:
-
For the
Organizationcollection scope, select one or more clouds to collect events from in the Cloud drop-down list.Keep the default value (
All) to collect events from all clouds in the organization. -
For the
Cloudcollection scope, select one or more folders to collect events from in the Folder drop-down list.Keep the default value (
All) to collect events from all folders in the cloud.
-
-
Select the event filter:
Get all: To collect all events within the service.Selected: To collect only selected events. Then proceed to select the events.Exclude: To collect all events except for the selected ones. Then proceed to select the events.
-
-
-
Under Service account, select an existing service account or create a new one. The trail will use this account to upload audit log files to the bucket.
If you are creating a new account, click Create, name the account, and and assign the following roles to it:storage.uploaderfor the bucket.audit-trails.viewerfor the folder if planning to collect events from the folder.kms.keys.encrypterfor the encryption key if the bucket is encrypted.
-
In the Name field, enter a name for the trail.
-
Click Create.
-
In the management console
, select the folder to host the trail. -
Navigate
to Audit Trails. -
Click Create trail.
-
In the Name field, enter a name for the trail.
-
Under Destination, configure the destination object:
- Destination:
Cloud Logging. - Log group: Select a log group to upload audit logs to. If you do not have a log group yet, click Create and create a new log group.
- Destination:
-
Under Control plane log collection:
-
Enable log collection.
-
Select a resource:
Organization,Cloud, orFolder. -
Depending on the resource you selected, select specific clouds or folders to collect events from:
-
For the
Organizationcollection scope, select one or more clouds to collect events from in the Cloud drop-down list.Keep the default value (
All) to collect events from all clouds in the organization. -
For the
Cloudcollection scope, select one or more folders to collect events from in the Folder drop-down list.Keep the default value (
All) to collect events from all folders in the cloud.
-
-
-
Under Data plane log collection:
Warning
In the management console, collection of some data events is on by default. Their delivery is billed as per the pricing policy. If you do not need data events, disable their collection.
-
Enable log collection.
-
Select the services to collect audit logs for.
-
Configure the event collection scope and filter for each service:
-
Click
to the right of the service name. -
Select a resource:
Organization,Cloud, orFolder. -
Depending on the resource you selected, select specific clouds or folders to collect events from:
-
For the
Organizationcollection scope, select one or more clouds to collect events from in the Cloud drop-down list.Keep the default value (
All) to collect events from all clouds in the organization. -
For the
Cloudcollection scope, select one or more folders to collect events from in the Folder drop-down list.Keep the default value (
All) to collect events from all folders in the cloud.
-
-
Select the event filter:
Get all: To collect all events within the service.Selected: To collect only selected events. Then proceed to select the events.Exclude: To collect all events except for the selected ones. Then proceed to select the events.
-
-
-
Under Service account, select an existing service account or create a new one. The trail will use this account to upload audit log files to the log group.
If you are creating a new account, click Create, name the account, and and assign the following roles to it:logging.writerfor the log group.audit-trails.viewerfor the folder if planning to collect events from the folder.
-
Click Create.
You can also create a trail using the CLI, Terraform, or API.
Note
Changing the destination object of an existing trail may result in the loss of some events. To prevent data loss, create a dedicated trail for each destination object.
Viewing audit logs
Audit Trails generates audit log files approximately once every 5 minutes. Audit Trails creates log files in JSON format.
Access to the contents of the audit log file using one of the following methods:
- Download the object.
- Get a public link to the object.
- Mount the bucket using FUSE
: s3fs or goofys.
In the Cloud Logging UI, you can view audit logs in real time.
- In the management console
, select the folder containing the log group. - Navigate
to Cloud Logging. - Click the row with the log group.
- Navigate to the Logs tab.
- Configure event search filters.
Exporting audit logs to SIEM
You can export audit log files to your SIEM solution.
What's next
- Learn more about the service.
- Learn more about the types of audit logs.
- Read about audit log requirements in the security standard.