Exporting audit logs to MaxPatrol SIEM using the management console or Yandex Cloud CLI
MaxPatrol SIEM
To set up audit log export using the management console or Yandex Cloud CLI:
- Get your cloud ready.
- Set up your environment.
- Create a trail to send logs to the stream in Data Streams.
- In MaxPatrol SIEM, set up a task to collect data from the stream in Data Streams.
If you no longer need the resources you created, delete them.
Getting started
Sign up for Yandex Cloud and create a billing account:
- Navigate to the management console
and log in to Yandex Cloud or create a new account. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVEorTRIAL_ACTIVEstatus. If you do not have a billing account, create one and link a cloud to it.
If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page
Learn more about clouds and folders here.
Required paid resources
The cost of support for the new infrastructure includes:
- Using a data stream (see Data Streams pricing).
- Using Yandex Managed Service for YDB in serverless mode (see Managed Service for YDB pricing).
Set up your environment
Create service accounts
The trail will use the maxpatrol-sa service account to collect logs for all your organization's resources and upload them to the specified data stream in Data Streams. MaxPatrol SIEM will use the maxpatrol-reader-sa service account to load audit logs from the data stream.
Create a service account in the same folder where you will be creating the trail, e.g., in example-folder:
- In the management console
, selectexample-folder. - Go to Identity and Access Management.
- Click Create service account.
- In the Name field, specify
maxpatrol-sa. - In the Roles in the folder field, click
Add role and select theyds.writerrole for the folder. - Click Create.
Repeat these steps to create the maxpatrol-reader-sa service account and assign it the yds.viewer role for the folder.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.
-
Create a service account named
maxpatrol-sa:yc iam service-account create \ --name maxpatrol-saResult:
done (2s) id: ajecq2artiv5******** folder_id: b1g5bhjofg7o******** created_at: "2026-03-18T18:29:53Z" name: maxpatrol-sa -
Repeat these steps to create the
maxpatrol-reader-saservice account.
For more information about the yc iam service-account create command, see the CLI reference.
Assign roles to the service accounts
Assign the missing roles to the service accounts:
- Log in to Yandex Identity Hub
using an administrator or organization owner account. - In the left-hand panel, select
Access bindings. - Click Assign roles in the top-right corner of the page. In the window that opens, select the
maxpatrol-saservice account. If required, use the search bar. - Click
Add role and selectaudit-trails.viewer. - Click Save.
-
Assign the
yds.writerrole forexample-folderto themaxpatrol-saservice account:yc resource-manager folder add-access-binding example-folder \ --role yds.writer \ --subject serviceAccount:<service_account_ID>Where:
--role: Role to assign.--subject:maxpatrol-saservice account ID.
-
Repeat these steps to assign the
yds.viewerrole to themaxpatrol-reader-saservice account forexample-folder.For more information about the
yc resource-manager folder add-access-bindingcommand, see the CLI reference. -
Assign the
maxpatrol-saservice account theaudit-trails.viewerrole for the organization:yc organization-manager organization add-access-binding \ --role audit-trails.viewer \ --id <organization_ID> \ --service-account-id <service_account_ID>Where:
--role: Role being assigned.--id: ID of the organization the service account belongs to.--service-account-id:maxpatrol-saservice account ID.
For more information about the
yc organization-manager organization add-access-bindingcommand, see the CLI reference.
Create a static access key for MaxPatrol SIEM
MaxPatrol SIEM uses static access keys to authorize Data Streams queries.
Create a static access key for the maxpatrol-reader-sa service account:
- In the management console
, selectexample-folder. - Go to Identity and Access Management.
- In the left-hand panel, select
Service accounts and select themaxpatrol-reader-saservice account from the list that opens. - In the top panel, click
Create new key and select Create static access key. - Enter a description for the key and click Create.
Alert
Save the ID and secret key. After you close this dialog, the key value will no longer be available.
Run this command:
yc iam access-key create \
--service-account-name maxpatrol-reader-sa
Result:
access_key:
id: aje38c5mjq11********
service_account_id: ajegtlf2q28a********
created_at: "2026-03-18T17:39:41.851532824Z"
key_id: YCAJEnmnfsV8GpAMk********
secret: YCMVxx-n0t8Y6s48zJDdKw9lWMB1iGU-********
Alert
Save the ID (key_id) and secret key (secret). You cannot get the secret key again.
For more information about the yc iam access-key create command, see the CLI reference.
Create a YDB serverless database
The database is required for the stream in Data Streams.
- In the management console
, selectexample-folder. - Click Create resource and select YDB database.
- Specify Name:
maxpatrol-db. - Under Database type, select
Serverless. - Keep the default values for all other parameters.
- Click Create a database.
Wait for the database status to change to Running.
-
Create a database:
yc ydb database create \ --name maxpatrol-db \ --serverless \ --folder-name example-folderWhere:
--name: Database name.--serverless:serverlessdatabase type.--folder-name: Folder name.
Result:
done (36s) id: etnubo9ude8e******** folder_id: b1g5bhjofg7o******** created_at: "2026-03-18T18:34:31Z" name: maxpatrol-db status: PROVISIONING ...For more information about the
yc ydb database createcommand, see the CLI reference. -
Check the status of the new database:
yc ydb database get maxpatrol-dbWait for the database status to change to
RUNNING.
Create a data stream
The trail will upload organization resource logs to this data stream.
- In the management console
, selectexample-folder. - Click Create resource and select Data stream.
- In the Database field, select
maxpatrol-db. - Specify the Name:
maxpatrol-stream. - Leave the other settings at their defaults.
- Click Create.
Wait for the data stream status to change to Running.
Create a trail
The trail will collect management event audit logs for all your organization's resources and upload them to the maxpatrol-stream data stream.
- In the management console
, selectexample-folder. - Click Create resource and select Trail.
- Specify the Name for the new trail:
maxpatrol-trail. - Under Destination, configure the destination object:
- Destination:
Data Streams. - Data stream: Select
maxpatrol-stream.
- Destination:
- Under Service account, select
maxpatrol-sa. - Under Collecting management events, configure the collection of management event audit logs:
- Collecting events: Select
Enabled. - Resource: Select
Organization. - Organization: Automatically populated field displaying the name of the organization to host the trail.
- Cloud: Keep the default value,
All.
- Collecting events: Select
- Under Collecting data events, select
Disabledin the Collecting events field. - Click Create.
Create the maxpatrol-trail trail:
yc audit-trails trail create \
--name maxpatrol-trail \
--service-account-id <service_account_ID> \
--destination-yds-stream maxpatrol-stream \
--destination-yds-database-id <YDS_database_ID> \
--filter-all-organisation-id <organization_ID>
Where:
--name: Name of the new trail.--service-account-id:maxpatrol-saservice account ID.--destination-yds-stream: Stream name.--destination-yds-database-id:maxpatrol-dbdatabase ID.--filter-all-organisation-id: ID of the organization to create the trail and store audit logs in.
Result:
done (1s)
id: cnpvbmk64136********
folder_id: b1g5bhjofg7o********
created_at: "2026-03-18T10:57:33.322Z"
updated_at: "2026-03-18T10:57:33.322Z"
name: maxpatrol-trail
destination:
data_stream:
database_id: etn5bfdglcn8********
stream_name: maxpatrol-stream
codec: RAW
service_account_id: aje1jot7q7eh********
status: ACTIVE
cloud_id: b1gj9ja2h4ct********
filtering_policy:
management_events_filter:
resource_scopes:
- id: bpfaidqca8vd********
type: organization-manager.organization
For more information about the yc audit-trails trail create command, see the CLI reference.
For more information about creating a trail, see Creating a trail to upload audit logs.
Configure MaxPatrol SIEM
Create credentials
You can use credentials to store secrets. Create credentials named static-key-id and static-key-private to host the ID and secret access key for the maxpatrol-reader-sa service account:
- Log in to the MaxPatrol SIEM web interface.
- Under Data collection, click Credentials.
- Click Add credential → Password and specify the following:
- Name:
static-key-id. - Password: Static key ID.
- Confirm password: Reenter static key ID.
- Name:
- Click Save.
Similarly, create a credential named static-key-private containing the secret key.
Create a data collection task
Create and run a data collection task with the Yandex Data Streams profile:
- Log in to the MaxPatrol SIEM web interface.
- Under Data collection, click Tasks.
- On the Data collection tasks page:
- In the toolbar, click Create task.
- Click Data collection.
- On the Create data collection task page, specify the following parameters:
- Name:
YDS-logs-task. - Profile:
Yandex Data Streams. - In the hierarchy list, select Run script.
- Under Connection, specify:
- Credentials:
static-key-id. - Credentials for privilege elevation:
static-key-private.
- Credentials:
- Script settings:
- database:
<maxpatrol-db_ID>; - folder:
<cloud_ID_for_example-folder>; - region_name:
ru-central1. - stream_name:
maxpatrol-stream.
- database:
- In the Data collection targets panel:
- Select the Include tab.
- In the Network addresses field, enter
yandex-cloud.
- Click Save and run.
- Name:
To view logs, go to the events page:
- Go the to the Data collection tasks page.
- Click
YDS-logs-task. - Click Collected events → Select.
How to delete the resources you created
Delete the resources you no longer need to avoid paying for them:
Exporting audit logs to MaxPatrol SIEM using the management console or Yandex Cloud CLI
MaxPatrol SIEM
To set up audit log export using the management console or Yandex Cloud CLI:
- Get your cloud ready.
- Set up your environment.
- Create a trail to send logs to the stream in Data Streams.
- In MaxPatrol SIEM, set up a task to collect data from the stream in Data Streams.
If you no longer need the resources you created, delete them.
Getting started
Sign up for Yandex Cloud and create a billing account:
- Navigate to the management console
and log in to Yandex Cloud or create a new account. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVEorTRIAL_ACTIVEstatus. If you do not have a billing account, create one and link a cloud to it.
If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page
Learn more about clouds and folders here.
Required paid resources
The cost of support for the new infrastructure includes:
- Using a data stream (see Data Streams pricing).
- Using Yandex Managed Service for YDB in serverless mode (see Managed Service for YDB pricing).
Set up your environment
Create service accounts
The trail will use the maxpatrol-sa service account to collect logs for all your organization's resources and upload them to the specified data stream in Data Streams. MaxPatrol SIEM will use the maxpatrol-reader-sa service account to load audit logs from the data stream.
Create a service account in the same folder where you will be creating the trail, e.g., in example-folder:
- In the management console
, selectexample-folder. - Go to Identity and Access Management.
- Click Create service account.
- In the Name field, specify
maxpatrol-sa. - In the Roles in the folder field, click
Add role and select theyds.writerrole for the folder. - Click Create.
Repeat these steps to create the maxpatrol-reader-sa service account and assign it the yds.viewer role for the folder.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.
-
Create a service account named
maxpatrol-sa:yc iam service-account create \ --name maxpatrol-saResult:
done (2s) id: ajecq2artiv5******** folder_id: b1g5bhjofg7o******** created_at: "2026-03-18T18:29:53Z" name: maxpatrol-sa -
Repeat these steps to create the
maxpatrol-reader-saservice account.
For more information about the yc iam service-account create command, see the CLI reference.
Assign roles to the service accounts
Assign the missing roles to the service accounts:
-
Log in to Yandex Identity Hub
using an administrator or organization owner account. -
In the left-hand panel, select
Access bindings. -
Click Assign roles in the top-right corner of the page. In the window that opens, select the
maxpatrol-saservice account. If required, use the search bar. -
Click
Add role and selectaudit-trails.viewer. -
Click Save.
-
Assign the
yds.writerrole forexample-folderto themaxpatrol-saservice account:yc resource-manager folder add-access-binding example-folder \ --role yds.writer \ --subject serviceAccount:<service_account_ID>Where:
--role: Role to assign.--subject:maxpatrol-saservice account ID.
-
Repeat these steps to assign the
yds.viewerrole to themaxpatrol-reader-saservice account forexample-folder.For more information about the
yc resource-manager folder add-access-bindingcommand, see the CLI reference. -
Assign the
maxpatrol-saservice account theaudit-trails.viewerrole for the organization:yc organization-manager organization add-access-binding \ --role audit-trails.viewer \ --id <organization_ID> \ --service-account-id <service_account_ID>Where:
--role: Role being assigned.--id: ID of the organization the service account belongs to.--service-account-id:maxpatrol-saservice account ID.
For more information about the
yc organization-manager organization add-access-bindingcommand, see the CLI reference.
Create a static access key for MaxPatrol SIEM
MaxPatrol SIEM uses static access keys to authorize Data Streams queries.
Create a static access key for the maxpatrol-reader-sa service account:
- In the management console
, selectexample-folder. - Go to Identity and Access Management.
- In the left-hand panel, select
Service accounts and select themaxpatrol-reader-saservice account from the list that opens. - In the top panel, click
Create new key and select Create static access key. - Enter a description for the key and click Create.
Alert
Save the ID and secret key. After you close this dialog, the key value will no longer be available.
Run this command:
yc iam access-key create \
--service-account-name maxpatrol-reader-sa
Result:
access_key:
id: aje38c5mjq11********
service_account_id: ajegtlf2q28a********
created_at: "2026-03-18T17:39:41.851532824Z"
key_id: YCAJEnmnfsV8GpAMk********
secret: YCMVxx-n0t8Y6s48zJDdKw9lWMB1iGU-********
Alert
Save the ID (key_id) and secret key (secret). You cannot get the secret key again.
For more information about the yc iam access-key create command, see the CLI reference.
Create a YDB serverless database
The database is required for the stream in Data Streams.
- In the management console
, selectexample-folder. - Click Create resource and select YDB database.
- Specify Name:
maxpatrol-db. - Under Database type, select
Serverless. - Keep the default values for all other parameters.
- Click Create a database.
Wait for the database status to change to Running.
-
Create a database:
yc ydb database create \ --name maxpatrol-db \ --serverless \ --folder-name example-folderWhere:
--name: Database name.--serverless:serverlessdatabase type.--folder-name: Folder name.
Result:
done (36s) id: etnubo9ude8e******** folder_id: b1g5bhjofg7o******** created_at: "2026-03-18T18:34:31Z" name: maxpatrol-db status: PROVISIONING ...For more information about the
yc ydb database createcommand, see the CLI reference. -
Check the status of the new database:
yc ydb database get maxpatrol-dbWait for the database status to change to
RUNNING.
Create a data stream
The trail will upload organization resource logs to this data stream.
- In the management console
, selectexample-folder. - Click Create resource and select Data stream.
- In the Database field, select
maxpatrol-db. - Specify the Name:
maxpatrol-stream. - Leave the other settings at their defaults.
- Click Create.
Wait for the data stream status to change to Running.
Create a trail
The trail will collect management event audit logs for all your organization's resources and upload them to the maxpatrol-stream data stream.
- In the management console
, selectexample-folder. - Click Create resource and select Trail.
- Specify the Name for the new trail:
maxpatrol-trail. - Under Destination, configure the destination object:
- Destination:
Data Streams. - Data stream: Select
maxpatrol-stream.
- Destination:
- Under Service account, select
maxpatrol-sa. - Under Collecting management events, configure the collection of management event audit logs:
- Collecting events: Select
Enabled. - Resource: Select
Organization. - Organization: Automatically populated field displaying the name of the organization to host the trail.
- Cloud: Keep the default value,
All.
- Collecting events: Select
- Under Collecting data events, select
Disabledin the Collecting events field. - Click Create.
Create the maxpatrol-trail trail:
yc audit-trails trail create \
--name maxpatrol-trail \
--service-account-id <service_account_ID> \
--destination-yds-stream maxpatrol-stream \
--destination-yds-database-id <YDS_database_ID> \
--filter-all-organisation-id <organization_ID>
Where:
--name: Name of the new trail.--service-account-id:maxpatrol-saservice account ID.--destination-yds-stream: Stream name.--destination-yds-database-id:maxpatrol-dbdatabase ID.--filter-all-organisation-id: ID of the organization to create the trail and store audit logs in.
Result:
done (1s)
id: cnpvbmk64136********
folder_id: b1g5bhjofg7o********
created_at: "2026-03-18T10:57:33.322Z"
updated_at: "2026-03-18T10:57:33.322Z"
name: maxpatrol-trail
destination:
data_stream:
database_id: etn5bfdglcn8********
stream_name: maxpatrol-stream
codec: RAW
service_account_id: aje1jot7q7eh********
status: ACTIVE
cloud_id: b1gj9ja2h4ct********
filtering_policy:
management_events_filter:
resource_scopes:
- id: bpfaidqca8vd********
type: organization-manager.organization
For more information about the yc audit-trails trail create command, see the CLI reference.
For more information about creating a trail, see Creating a trail to upload audit logs.
Configure MaxPatrol SIEM
Create credentials
You can use credentials to store secrets. Create credentials named static-key-id and static-key-private to host the ID and secret access key for the maxpatrol-reader-sa service account:
- Log in to the MaxPatrol SIEM web interface.
- Under Data collection, click Credentials.
- Click Add credential → Password and specify the following:
- Name:
static-key-id. - Password: Static key ID.
- Confirm password: Reenter static key ID.
- Name:
- Click Save.
Similarly, create a credential named static-key-private containing the secret key.
Create a data collection task
Create and run a data collection task with the Yandex Data Streams profile:
- Log in to the MaxPatrol SIEM web interface.
- Under Data collection, click Tasks.
- On the Data collection tasks page:
- In the toolbar, click Create task.
- Click Data collection.
- On the Create data collection task page, specify the following parameters:
- Name:
YDS-logs-task. - Profile:
Yandex Data Streams. - In the hierarchy list, select Run script.
- Under Connection, specify:
- Credentials:
static-key-id. - Credentials for privilege elevation:
static-key-private.
- Credentials:
- Script settings:
- database:
<maxpatrol-db_ID>; - folder:
<cloud_ID_for_example-folder>; - region_name:
ru-central1. - stream_name:
maxpatrol-stream.
- database:
- In the Data collection targets panel:
- Select the Include tab.
- In the Network addresses field, enter
yandex-cloud.
- Click Save and run.
- Name:
To view logs, go to the events page:
- Go the to the Data collection tasks page.
- Click
YDS-logs-task. - Click Collected events → Select.
How to delete the resources you created
Delete the resources you no longer need to avoid paying for them: