|
| 1 | += Stream {astra_db} audit logs |
| 2 | + |
| 3 | +Stream your xref:astra-db-serverless:administration:view-account-audit-log.adoc[{astra_db} audit logs] through {product_name} to an external system. |
| 4 | + |
| 5 | +To enable audit log streaming, you must do one of the following: |
| 6 | + |
| 7 | + * Provide the **Full Name** of your {product_name} topic and the streaming tenant's `client.conf` file to {support_url}[{company} Support] or your account representative. |
| 8 | + * POST your configuration to the xref:astra-api-docs:ROOT:attachment$devops-api/index.html#tag/Organization-Operations/operation/configureTelemetry[Astra DevOps API telemetry endpoint]. |
| 9 | + |
| 10 | +== Create an {product_name} topic for audit logs |
| 11 | + |
| 12 | +Audit log streaming requires a streaming tenant in the AWS `us-east-2` region. |
| 13 | +You can create a new tenant with the xref:astra-streaming:getting-started:index.adoc[{product_name} quickstart] or use an existing {product_name} tenant. |
| 14 | + |
| 15 | +. In the {link-astra-portal}, go to **Streaming**. |
| 16 | +. Select an existing tenant or xref:astra-streaming:getting-started:index.adoc#your-first-streaming-tenant[Create a Streaming Tenant] in AWS `us-east-2`. |
| 17 | +. Add a xref:astra-streaming:getting-started:index.adoc#add-a-namespace-to-hold-topics[namespace] and xref:astra-streaming:getting-started:index.adoc#a-topic-to-organize-messages[topic] to the tenant. |
| 18 | +. 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*`. |
| 19 | +. If necessary, create additional audit log topics, and then record the **Full Name** for each topic. |
| 20 | +You can use topics to organize audit logs by event type or other criteria. |
| 21 | +. In the {link-astra-portal}, go to **Streaming**, and then click your audit log streaming tenant. |
| 22 | +. On the *Connect* tab, click **Download client.conf**. |
| 23 | +. To finalize the configuration, do one of the following: |
| 24 | ++ |
| 25 | +* Send your topic's full name and the `client.conf` file to {support_url}[{company} Support] or your account representative, and then {company} will complete the setup. |
| 26 | +* <<use-the-devops-api,Use the Astra DevOps API to complete the setup.>> |
| 27 | + |
| 28 | +[#use-the-devops-api] |
| 29 | +== Configure audit log streaming with the DevOps API |
| 30 | + |
| 31 | +You can use the xref:astra-api-docs:ROOT:attachment$devops-api/index.html#tag/Organization-Operations/operation/configureTelemetry[Astra DevOps API telemetry endpoint] to configure audit log streaming instead of providing the configuration details to {company} Support. |
| 32 | + |
| 33 | +. In the {link-astra-portal}, create an application token with the **Organization Administrator** role, if you don't already have one. |
| 34 | + |
| 35 | +. To create the audit log streaming configuration, send a POST request with your topic’s full name and the required values from the tenant's `client.conf` file. |
| 36 | ++ |
| 37 | +The `auth_strategy` and other authentication details depend on your Pulsar configuration. |
| 38 | ++ |
| 39 | +[source,curl,subs="verbatim,quotes"] |
| 40 | +---- |
| 41 | +curl --request POST \ |
| 42 | + --url 'https://api.astra.datastax.com/v2/organizations/**ORG_ID**/telemetry/auditLogs' \ |
| 43 | + --header 'Accept: application/json' \ |
| 44 | + --header 'Authorization: Bearer **APPLICATION_TOKEN**' \ |
| 45 | + --data '{ |
| 46 | + "pulsar": { |
| 47 | + "endpoint": "pulsar+**BROKER_SERVICE_URL**", |
| 48 | + "auth_strategy": "token", |
| 49 | + "topic": "**TOPIC_FULL_NAME**", |
| 50 | + "auth_name": "token", |
| 51 | + "token": "**PULSAR_AUTHENTICATION_TOKEN**" |
| 52 | + } |
| 53 | +}' |
| 54 | +---- |
| 55 | ++ |
| 56 | +.Response |
| 57 | +[%collapsible] |
| 58 | +==== |
| 59 | +[source,plain] |
| 60 | +---- |
| 61 | +HTTP/1.1 202 Accepted |
| 62 | +---- |
| 63 | +==== |
| 64 | +. To retrieve and verify the audit log streaming configuration, send a GET request: |
| 65 | ++ |
| 66 | +[source,curl,subs="verbatim,quotes"] |
| 67 | +---- |
| 68 | +curl --request GET \ |
| 69 | + --url 'https://api.astra.datastax.com/v2/organizations/**ORG_ID**/telemetry/auditLogs' \ |
| 70 | + --header 'Authorization: Bearer **APPLICATION_TOKEN**' |
| 71 | +---- |
| 72 | ++ |
| 73 | +.Response |
| 74 | +[%collapsible] |
| 75 | +==== |
| 76 | +[source,json] |
| 77 | +---- |
| 78 | +{ |
| 79 | + "pulsar": { |
| 80 | + "endpoint": "pulsar+ssl://pulsar-aws-useast2.streaming.datastax.com:6651", |
| 81 | + "topic": "persistent://aws-us-east-2-mk-2/default/audit-log", |
| 82 | + "auth_strategy": "token", |
| 83 | + "token": "********", |
| 84 | + "auth_name": "token" |
| 85 | + } |
| 86 | +} |
| 87 | +---- |
| 88 | +==== |
| 89 | + |
| 90 | +. To delete an audit log streaming configuration, xref:astra-api-docs:ROOT:attachment$devops-api/index.html#tag/Organization-Operations/operation/deleteTelemetryConfig[send a DELETE request]. |
| 91 | + |
0 commit comments