Exporting audit logs to MaxPatrol SIEM
MaxPatrol SIEM
To set up audit log export:
- 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 navigate to the cloud page
Learn more about clouds and folders here.
Required paid resources
The infrastructure support cost 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 a service account and assign the required roles
The trail will use this service account to collect logs for all your organization's resources and upload them to the specified data stream in Data Streams.
Create a service account in the same folder where you are going to create the trail, e.g., in example-folder:
- In the management console
, selectexample-folder. - In the list of services, select Identity and Access Management.
- Click Create service account.
- Specify the service account name:
maxpatrol-sa. - Click Create.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the 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 parameter.
-
Create a service account:
yc iam service-account create --name maxpatrol-saResult:
id: aje*****ckg folder_id: b1g*****rnj created_at: "2022-09-18..." name: maxpatrol-saFor more information about the
yc iam service-account createcommand, see the CLI reference.
Assign the audit-trails.viewer and yds.editor roles to the maxpatrol-sa service account:
-
The
audit-trails.viewerrole for your 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.
Result:
done (1s)For more information about the
yc organization-manager organization add-access-bindingcommand, see the CLI reference. -
The
yds.editorrole forexample-folder:yc resource-manager folder add-access-binding example-folder \ --role yds.editor \ --subject serviceAccount:<service_account_ID>Where:
--role: Role being assigned.--subject:maxpatrol-saservice account ID.
Result:
done (1s)For more information about the
yc resource-manager folder add-access-bindingcommand, see the CLI reference.
Create static access keys
MaxPatrol SIEM uses static access keys to authorize Data Streams queries.
- In the management console
, selectexample-folder. - In the list of services, select Identity and Access Management.
- In the left-hand panel, select
Service accounts. - In the list that opens, select the
maxpatrol-saservice account. - Click Create new key in the top panel.
- 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.
Create a static access key for the maxpatrol-sa service account:
yc iam access-key create --service-account-name maxpatrol-sa
Result:
access_key:
id: YCd*****W7t
service_account_id: aje*****ckg
created_at: "2022-09-18..."
key_id: YCA*****5Ws4
secret: YCM76*******I3fk
Alert
Save the ID (key_id) and secret key (secret). You will not be able to get the key value 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.
- Set Name to
maxpatrol-db. - Under Database type, select
Serverless. - Leave other parameters at their defaults.
- 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: Serverless type.--folder-name: Folder name.
Result:
done (7s) id: etn*****r5t folder_id: b1g*****rnj created_at: "2022-09-18..." name: maxpatrol-db status: PROVISIONING ...For more information about the
yc ydb database createcommand, see the CLI reference. -
Check the status of the created database:
yc ydb database get maxpatrol-dbWait for the database status to change to
RUNNING.
Create a data stream
This is the data stream to which the trail will upload organization resource logs.
- In the management console
, selectexample-folder. - Click Create resource and select Data stream.
- In the Database field, select
maxpatrol-db. - Set Name to
maxpatrol-stream. - Leave other parameters at their defaults.
- Click Create.
Wait for the data stream status to change to Running.
Create a trail
The trail will collect management 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.
- Name 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 (shows the name of the organization that will host the trail).
- Cloud: Keep the default value,
All.
- Collecting events: Select
- Under Collecting data events, select
Disabledin the Collecting events field. - Click Create.
For more information about creating a trail, see this guide.
Configure MaxPatrol SIEM
Create accounts
You can use accounts to store secrets. Create accounts named static-key-id and static-key-private for your ID and secret access key:
- Log in to the MaxPatrol SIEM web interface.
- Under Data collection, click Accounts.
- Click Add account → Password and specify the following parameters:
- Name:
static-key-id. - Password: Static key ID.
- Confirm password: Reenter static key ID.
- Name:
- Click Save.
Similarly, create an account 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 scenario.
- Under Connection, specify:
- Account:
static-key-id. - Access upgrade account:
static-key-private.
- Account:
- Scenario execution parameters:
- database:
<maxpatrol-db_ID> - folder:
<cloud_ID_for_example-folder> - region_name:
ru-central1. - stream_name:
<maxpatrol-stream_name>.
- database:
- In the Data collection objectives panel:
- Select the Enable tab.
- In the Network addresses field, enter
yandex-cloud.
- Click Save and run.
- Name:
To view the logs, go to the event review page:
- Go the to the Data collection tasks page.
- Click
YDS-logs-task. - Click Events collected → Select.
How to delete the resources you created
Delete the resources you no longer need to avoid paying for them: