Stream Astra DB audit logs
Stream your Astra DB audit logs through Astra Streaming to an external system.
To enable audit log streaming, you must do one of the following:
-
Provide the Full Name of your Astra Streaming topic and the streaming tenant’s
client.conf
file to DataStax Support or your account representative. -
POST your configuration to the Astra DB DevOps API telemetry endpoint.
Create an Astra Streaming topic for audit logs
Audit log streaming requires a streaming tenant in the AWS us-east-2
region.
You can create a new tenant with the Astra Streaming quickstart or use an existing Astra Streaming tenant.
-
In the Astra Portal, go to Streaming.
-
Select an existing tenant or create a streaming tenant in AWS
us-east-2
, and then create a namespace and topic in the tenant.For more information about creating tenants, namespaces, and topics, see Astra Streaming quickstart.
-
On the Namespace and Topics page, click the new topic, and then copy the topic’s Full Name, such as
persistent://aws-us-east-2-mk/NAMESPACE_NAME/TOPIC_NAME
. -
If necessary, create additional audit log topics, and then record the Full Name for each topic. You can use topics to organize audit logs by event type or other criteria.
-
In the Astra Portal, go to Streaming, and then click your audit log streaming tenant.
-
On the Connect tab, click Download client.conf.
-
To finalize the configuration, do one of the following:
-
Send your topic’s full name and the
client.conf
file to DataStax Support or your account representative, and then DataStax will complete the setup.
-
Configure audit log streaming with the DevOps API
You can use the Astra DB DevOps API telemetry endpoint to configure audit log streaming instead of providing the configuration details to DataStax Support.
-
In the Astra Portal, create an application token with the Organization Administrator role.
-
Create the audit log streaming configuration using the values from the tenant’s
client.conf
file and your Pulsar configuration:curl -sS --location -X POST "https://api.astra.datastax.com/v2/organizations/ORG_ID/telemetry/auditLogs" \ --header "Authorization: Bearer APPLICATION_TOKEN" \ --header "Accept: application/json" --data '{ "pulsar": { "endpoint": "pulsar+BROKER_SERVICE_URL", "auth_strategy": "token", "topic": "TOPIC_FULL_NAME", "auth_name": "token", "token": "PULSAR_AUTHENTICATION_TOKEN" } }'
Replace the following:
-
ORG_ID
: Your Astra DB organization ID. -
APPLICATION_TOKEN
: Your Astra DB application token. -
BROKER_SERVICE_URL
: The Astra Streaming broker service URL, such asssl://pulsar-aws-useast2.streaming.datastax.com:6651
. -
TOPIC_FULL_NAME
: The full name of the Astra Streaming topic where you want to stream audit logs. -
The
auth_strategy
and other authentication details depend on your Pulsar configuration.Response
HTTP/1.1 202 Accepted
-
-
Retrieve and verify the audit log streaming configuration:
curl -sS --location -X GET "https://api.astra.datastax.com/v2/organizations/ORG_ID/telemetry/auditLogs" \ --header "Authorization: Bearer APPLICATION_TOKEN" \ --header "Accept: application/json"
Response
{ "pulsar": { "endpoint": "pulsar+ssl://pulsar-aws-useast2.streaming.datastax.com:6651", "topic": "persistent://aws-us-east-2-mk-2/default/audit-log", "auth_strategy": "token", "token": "********", "auth_name": "token" } }
Delete an audit log streaming configuration
To delete an audit log streaming configuration, send a DELETE request.