Audit Trails API, gRPC: TrailService.Create
- gRPC request
- CreateTrailRequest
- Destination
- ObjectStorage
- CloudLogging
- DataStream
- EventRouter
- Filter
- PathFilter
- PathFilterElement
- PathFilterElementAny
- Resource
- PathFilterElementSome
- EventFilter
- EventFilterElement
- EventFilterElementCategory
- FilteringPolicy
- ManagementEventsFiltering
- DataEventsFiltering
- EventTypes
- DnsDataEventsFilter
- operation.Operation
- CreateTrailMetadata
- Trail
- Destination
- ObjectStorage
- CloudLogging
- DataStream
- EventRouter
- Filter
- PathFilter
- PathFilterElement
- PathFilterElementAny
- Resource
- PathFilterElementSome
- EventFilter
- EventFilterElement
- EventFilterElementCategory
- FilteringPolicy
- ManagementEventsFiltering
- DataEventsFiltering
- EventTypes
- DnsDataEventsFilter
Creates a trail in the specified folder.
gRPC request
rpc Create (CreateTrailRequest) returns (operation.Operation)
CreateTrailRequest
{
"folder_id": "string",
"name": "string",
"description": "string",
"labels": "map<string, string>",
"destination": {
// Includes only one of the fields `object_storage`, `cloud_logging`, `data_stream`, `eventrouter`
"object_storage": {
"bucket_id": "string",
"object_prefix": "string"
},
"cloud_logging": {
// Includes only one of the fields `log_group_id`
"log_group_id": "string"
// end of the list of possible fields
},
"data_stream": {
"database_id": "string",
"stream_name": "string",
"codec": "Codec"
},
"eventrouter": {
"eventrouter_connector_id": "string"
}
// end of the list of possible fields
},
"service_account_id": "string",
"filter": {
"path_filter": {
"root": {
// Includes only one of the fields `any_filter`, `some_filter`
"any_filter": {
"resource": {
"id": "string",
"type": "string"
}
},
"some_filter": {
"resource": {
"id": "string",
"type": "string"
},
"filters": [
"PathFilterElement"
]
}
// end of the list of possible fields
}
},
"event_filter": {
"filters": [
{
"service": "string",
"categories": [
{
"plane": "EventCategoryFilter",
"type": "EventAccessTypeFilter"
}
],
"path_filter": {
"root": {
// Includes only one of the fields `any_filter`, `some_filter`
"any_filter": {
"resource": {
"id": "string",
"type": "string"
}
},
"some_filter": {
"resource": {
"id": "string",
"type": "string"
},
"filters": [
"PathFilterElement"
]
}
// end of the list of possible fields
}
}
}
]
}
},
"filtering_policy": {
"management_events_filter": {
"resource_scopes": [
{
"id": "string",
"type": "string"
}
]
},
"data_events_filters": [
{
"service": "string",
// Includes only one of the fields `included_events`, `excluded_events`
"included_events": {
"event_types": [
"string"
]
},
"excluded_events": {
"event_types": [
"string"
]
},
// end of the list of possible fields
// Includes only one of the fields `dns_filter`
"dns_filter": {
"include_nonrecursive_queries": "bool"
},
// end of the list of possible fields
"resource_scopes": [
{
"id": "string",
"type": "string"
}
]
}
]
}
}
|
Field |
Description |
|
folder_id |
string Required field. ID of the folder to create a trail in. |
|
name |
string Name of the trail. |
|
description |
string Description of the trail. |
|
labels |
object (map<string, string>) Custom labels for the secret as |
|
destination |
Required field. Destination configuration for the trail |
|
service_account_id |
string Required field. Service account ID of the trail |
|
filter |
Event filtering configuration of the trail |
|
filtering_policy |
Event filtering policy of the trail |
Destination
|
Field |
Description |
|
object_storage |
Configuration for event delivery to Object Storage Uploaded objects will have prefix <trail_id>/ by default Includes only one of the fields |
|
cloud_logging |
Configuration for event delivery to Cloud Logging Includes only one of the fields |
|
data_stream |
Configuration for event delivery to YDS Includes only one of the fields |
|
eventrouter |
Configuration for event delivery to EventRouter Includes only one of the fields |
ObjectStorage
|
Field |
Description |
|
bucket_id |
string Name of the destination bucket |
|
object_prefix |
string Prefix for exported objects. Optional |
CloudLogging
|
Field |
Description |
|
log_group_id |
string ID of the Cloud Logging destination group Includes only one of the fields |
DataStream
|
Field |
Description |
|
database_id |
string ID of the database hosting the destination YDS |
|
stream_name |
string Name of the destination YDS |
|
codec |
enum Codec Codec for compressing events
|
EventRouter
|
Field |
Description |
|
eventrouter_connector_id |
string ID of the EventRouter Connector |
Filter
|
Field |
Description |
|
path_filter |
Configuration of default events gathering for the trail |
|
event_filter |
Required field. Configuration of additional events gathering from specific services |
PathFilter
|
Field |
Description |
|
root |
Required field. Root element of the resource path filter for the trail |
PathFilterElement
|
Field |
Description |
|
any_filter |
Filter element with ANY type. If used, configures the trail to gather any events from the resource Includes only one of the fields |
|
some_filter |
Filter element with SOME type. If used, configures the trail to gather some of the events from the resource Includes only one of the fields |
PathFilterElementAny
|
Field |
Description |
|
resource |
Required field. Resource definition |
Resource
|
Field |
Description |
|
id |
string Required field. ID of the resource |
|
type |
string Required field. Type of the resource |
PathFilterElementSome
|
Field |
Description |
|
resource |
Required field. Definition of the resource that contains nested resources |
|
filters[] |
Filters for the resources contained in the parent resource |
EventFilter
|
Field |
Description |
|
filters[] |
List of filters for services |
EventFilterElement
|
Field |
Description |
|
service |
string Required field. Service ID of the gathered events |
|
categories[] |
List of the event categories gathered for a specified service |
|
path_filter |
Required field. Resource path filter for a specified service |
EventFilterElementCategory
|
Field |
Description |
|
plane |
enum EventCategoryFilter Required field. Plane of the gathered category
|
|
type |
enum EventAccessTypeFilter Required field. Type of the gathered category
|
FilteringPolicy
Combination of policies describing event filtering process of the trail
At least one filed must be filled
|
Field |
Description |
|
management_events_filter |
Singular filter describing gathering management events |
|
data_events_filters[] |
List of filters describing gathering data events |
ManagementEventsFiltering
Policy for gathering management events
|
Field |
Description |
|
resource_scopes[] |
A list of resources which will be monitored by the trail |
DataEventsFiltering
Policy for gathering data events
|
Field |
Description |
|
service |
string Required field. Name of the service whose events will be delivered |
|
included_events |
Explicitly included events of specified service Includes only one of the fields |
|
excluded_events |
Explicitly excluded events of specified service Includes only one of the fields |
|
dns_filter |
Filter is allowed only if service = dns Includes only one of the fields |
|
resource_scopes[] |
A list of resources which will be monitored by the trail |
EventTypes
Policy with explicitly specified event group
|
Field |
Description |
|
event_types[] |
string |
DnsDataEventsFilter
|
Field |
Description |
|
include_nonrecursive_queries |
bool Not only recursive queries will be delivered |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"trail_id": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"folder_id": "string",
"created_at": "google.protobuf.Timestamp",
"updated_at": "google.protobuf.Timestamp",
"name": "string",
"description": "string",
"labels": "map<string, string>",
"destination": {
// Includes only one of the fields `object_storage`, `cloud_logging`, `data_stream`, `eventrouter`
"object_storage": {
"bucket_id": "string",
"object_prefix": "string"
},
"cloud_logging": {
// Includes only one of the fields `log_group_id`
"log_group_id": "string"
// end of the list of possible fields
},
"data_stream": {
"database_id": "string",
"stream_name": "string",
"codec": "Codec"
},
"eventrouter": {
"eventrouter_connector_id": "string"
}
// end of the list of possible fields
},
"service_account_id": "string",
"status": "Status",
"filter": {
"path_filter": {
"root": {
// Includes only one of the fields `any_filter`, `some_filter`
"any_filter": {
"resource": {
"id": "string",
"type": "string"
}
},
"some_filter": {
"resource": {
"id": "string",
"type": "string"
},
"filters": [
"PathFilterElement"
]
}
// end of the list of possible fields
}
},
"event_filter": {
"filters": [
{
"service": "string",
"categories": [
{
"plane": "EventCategoryFilter",
"type": "EventAccessTypeFilter"
}
],
"path_filter": {
"root": {
// Includes only one of the fields `any_filter`, `some_filter`
"any_filter": {
"resource": {
"id": "string",
"type": "string"
}
},
"some_filter": {
"resource": {
"id": "string",
"type": "string"
},
"filters": [
"PathFilterElement"
]
}
// end of the list of possible fields
}
}
}
]
}
},
"status_error_message": "string",
"cloud_id": "string",
"filtering_policy": {
"management_events_filter": {
"resource_scopes": [
{
"id": "string",
"type": "string"
}
]
},
"data_events_filters": [
{
"service": "string",
// Includes only one of the fields `included_events`, `excluded_events`
"included_events": {
"event_types": [
"string"
]
},
"excluded_events": {
"event_types": [
"string"
]
},
// end of the list of possible fields
// Includes only one of the fields `dns_filter`
"dns_filter": {
"include_nonrecursive_queries": "bool"
},
// end of the list of possible fields
"resource_scopes": [
{
"id": "string",
"type": "string"
}
]
}
]
}
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
|
Field |
Description |
|
id |
string ID of the operation. |
|
description |
string Description of the operation. 0-256 characters long. |
|
created_at |
Creation timestamp. |
|
created_by |
string ID of the user or service account who initiated the operation. |
|
modified_at |
The time when the Operation resource was last modified. |
|
done |
bool If the value is |
|
metadata |
Service-specific metadata associated with the operation. |
|
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
|
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
CreateTrailMetadata
|
Field |
Description |
|
trail_id |
string ID of the trail that is being created |
Trail
Trail describes the filtering and destination configuration of the process of sending Audit events
|
Field |
Description |
|
id |
string ID of the trail |
|
folder_id |
string Required field. ID of the folder that the trail belongs to |
|
created_at |
Required field. The timestamp for the creation operation |
|
updated_at |
Required field. The timestamp of the last update operation |
|
name |
string Name of the trail |
|
description |
string Description of the trail |
|
labels |
object (map<string, string>) Custom labels of the trail as |
|
destination |
Required field. Destination configuration of the trail |
|
service_account_id |
string Service account ID of the trail |
|
status |
enum Status Required field. Status of the trail
|
|
filter |
Filtering configuration of the trail |
|
status_error_message |
string Current error message of the trail. Empty in case if the trail is active |
|
cloud_id |
string Required field. ID of the cloud that the trail belongs to |
|
filtering_policy |
Event filtering policy |
Destination
|
Field |
Description |
|
object_storage |
Configuration for event delivery to Object Storage Uploaded objects will have prefix <trail_id>/ by default Includes only one of the fields |
|
cloud_logging |
Configuration for event delivery to Cloud Logging Includes only one of the fields |
|
data_stream |
Configuration for event delivery to YDS Includes only one of the fields |
|
eventrouter |
Configuration for event delivery to EventRouter Includes only one of the fields |
ObjectStorage
|
Field |
Description |
|
bucket_id |
string Name of the destination bucket |
|
object_prefix |
string Prefix for exported objects. Optional |
CloudLogging
|
Field |
Description |
|
log_group_id |
string ID of the Cloud Logging destination group Includes only one of the fields |
DataStream
|
Field |
Description |
|
database_id |
string ID of the database hosting the destination YDS |
|
stream_name |
string Name of the destination YDS |
|
codec |
enum Codec Codec for compressing events
|
EventRouter
|
Field |
Description |
|
eventrouter_connector_id |
string ID of the EventRouter Connector |
Filter
|
Field |
Description |
|
path_filter |
Configuration of default events gathering for the trail |
|
event_filter |
Required field. Configuration of additional events gathering from specific services |
PathFilter
|
Field |
Description |
|
root |
Required field. Root element of the resource path filter for the trail |
PathFilterElement
|
Field |
Description |
|
any_filter |
Filter element with ANY type. If used, configures the trail to gather any events from the resource Includes only one of the fields |
|
some_filter |
Filter element with SOME type. If used, configures the trail to gather some of the events from the resource Includes only one of the fields |
PathFilterElementAny
|
Field |
Description |
|
resource |
Required field. Resource definition |
Resource
|
Field |
Description |
|
id |
string Required field. ID of the resource |
|
type |
string Required field. Type of the resource |
PathFilterElementSome
|
Field |
Description |
|
resource |
Required field. Definition of the resource that contains nested resources |
|
filters[] |
Filters for the resources contained in the parent resource |
EventFilter
|
Field |
Description |
|
filters[] |
List of filters for services |
EventFilterElement
|
Field |
Description |
|
service |
string Required field. Service ID of the gathered events |
|
categories[] |
List of the event categories gathered for a specified service |
|
path_filter |
Required field. Resource path filter for a specified service |
EventFilterElementCategory
|
Field |
Description |
|
plane |
enum EventCategoryFilter Required field. Plane of the gathered category
|
|
type |
enum EventAccessTypeFilter Required field. Type of the gathered category
|
FilteringPolicy
Combination of policies describing event filtering process of the trail
At least one filed must be filled
|
Field |
Description |
|
management_events_filter |
Singular filter describing gathering management events |
|
data_events_filters[] |
List of filters describing gathering data events |
ManagementEventsFiltering
Policy for gathering management events
|
Field |
Description |
|
resource_scopes[] |
A list of resources which will be monitored by the trail |
DataEventsFiltering
Policy for gathering data events
|
Field |
Description |
|
service |
string Required field. Name of the service whose events will be delivered |
|
included_events |
Explicitly included events of specified service Includes only one of the fields |
|
excluded_events |
Explicitly excluded events of specified service Includes only one of the fields |
|
dns_filter |
Filter is allowed only if service = dns Includes only one of the fields |
|
resource_scopes[] |
A list of resources which will be monitored by the trail |
EventTypes
Policy with explicitly specified event group
|
Field |
Description |
|
event_types[] |
string |
DnsDataEventsFilter
|
Field |
Description |
|
include_nonrecursive_queries |
bool Not only recursive queries will be delivered |