Skip to content

Commit b8a6ecb

Browse files
authored
Merge pull request #226 from authzed/audit-log-ga
Update audit logging docs
2 parents 6627c49 + a69ade2 commit b8a6ecb

File tree

1 file changed

+72
-15
lines changed

1 file changed

+72
-15
lines changed

pages/authzed/concepts/audit-logging.mdx

+72-15
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ import { Callout, Tabs } from 'nextra/components'
44

55
Audit Logging is functionality exclusive to AuthZed products that publishes logs of SpiceDB API operations to a log sink.
66

7-
<Callout type="info">
8-
**Info:**
9-
Audit Logging is currently in Early Access.
10-
11-
Early Access functionality is production-ready, but requires coordination with your success team to set-up.
12-
</Callout>
13-
147
## Log Format
158

169
Logs contain the full details related to a request including:
@@ -28,7 +21,7 @@ Logs contain the full details related to a request including:
2821
{
2922
"specversion": "1.0",
3023
"id": "35cdd6662882bd387292ef78a650d18b",
31-
"source": "spicedb",
24+
"source": "/ps/dev-ps/rc/us-east-1/p/dev-ps-abcd1234",
3225
"type": "/authzed.api.v1.SchemaService/ReadSchema",
3326
"datacontenttype": "application/json",
3427
"time": "2023-12-18T17:32:47.234247Z",
@@ -55,17 +48,81 @@ Logs contain the full details related to a request including:
5548
## Log Sinks
5649

5750
Log Sinks are the targets where logs will be shipped in order to be persisted.
58-
In order to configure a log sink, you must file a request with your AuthZed customer success team.
59-
60-
The following are the supported log sinks:
61-
62-
- [Apache Kafka](https://kafka.apache.org)
63-
- [AWS Kinesis](https://aws.amazon.com/kinesis)
64-
- [AWS Kinesis Firehose](https://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html)
6551

6652
<Callout type="info">
6753
**Info:**
6854
We're exploring additional Log Sinks.
6955

7056
Please reach out to your success team with any requests.
7157
</Callout>
58+
59+
### AWS Kinesis and Kinesis Firehose
60+
61+
As a prerequisite to use [Kinesis] or [Kinesis Firehose] as a log sink, an IAM role must exist in the AWS account
62+
with the necessary permissions to write to the Kinesis stream or Firehose delivery stream.
63+
64+
This is an example policy that grants the necessary permissions to write to a Firehose delivery stream:
65+
66+
```json
67+
{
68+
"Version": "2012-10-17",
69+
"Statement": [
70+
{
71+
"Sid": "",
72+
"Effect": "Allow",
73+
"Action": [
74+
"firehose:PutRecord"
75+
],
76+
"Resource": "EXAMPLE_FIREHOSE_ARN"
77+
}
78+
]
79+
}
80+
```
81+
82+
[Kinesis]: https://aws.amazon.com/kinesis
83+
[Kinesis Firehose]: https://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html
84+
85+
#### Dedicated
86+
87+
For Dedicated customers, this role will also need a trust policy which allows the role to be assumed by the AuthZed account
88+
in order to deliver logs to the stream.
89+
90+
To find the Dedicated AWS account ID, navigate to the Permission System's settings page, find the Audit Log settings,
91+
and choose "AWS Kinesis" or "AWS Kinesis Firehose" as the log sink.
92+
The account ID will be displayed in the configuration.
93+
94+
This is an example trust policy that allows the AuthZed account to assume the role:
95+
96+
```json
97+
{
98+
"Version": "2012-10-17",
99+
"Statement": [
100+
{
101+
"Effect": "Allow",
102+
"Principal": {
103+
"AWS": "EXAMPLE_AUTHZED_ACCOUNT_ID"
104+
},
105+
"Action": "sts:AssumeRole",
106+
"Condition": {
107+
"StringEquals": {
108+
"sts:ExternalId": "EXAMPLE_EXTERNAL_ID"
109+
}
110+
}
111+
}
112+
]
113+
}
114+
```
115+
116+
## Configuration
117+
118+
The process for setting up audit logging varies depending on the AuthZed product you're using.
119+
Find the instructions for your product below.
120+
121+
### Dedicated
122+
123+
Using the web dashboard, navigate to the Permission System's settings page to find the Audit Log settings.
124+
125+
### Self-Hosted
126+
127+
Audit logging is configured using command-line flags.
128+
See the full list of flags in the [Extenders section](extenders#flags).

0 commit comments

Comments
 (0)