Overview
Barndoor can stream every audit event from your tenant — authentication, authorization decisions, AI agent requests, tool calls, policy changes, and more — to storage you own: an S3-compatible bucket or an Azure Blob Storage container. Events are batched, gzipped, and uploaded as JSON Lines files partitioned by date and hour. Once configured, logs land in your storage within a minute of being generated and remain under your retention and access policies. This guide walks through configuring a destination, choosing an authentication method, and verifying that events are flowing. The delivery format is identical for both destination types — only the connection fields and the credential differ.Estimated time: 10–20 minutes (longer if you need to provision a new bucket, container, or IAM role)
Before You Begin
You’ll need a Barndoor account with admin privileges on the organization whose events you want to export, plus one of the two destinations below. For an S3-compatible destination:- A bucket you own. AWS S3, Google Cloud Storage (via the S3 interop endpoint), MinIO, and SeaweedFS are all supported.
- Either:
- An IAM role (AWS S3 only) whose trust policy permits Barndoor to assume it, or
- An access key pair with
s3:PutObjectpermission on your bucket
- An Azure storage account and a container that already exists. Barndoor writes into the container but doesn’t create it.
- Either:
- The storage account’s access key, or
- The ability to mint a container-scoped SAS (shared access signature) with Read, List, Write, and Create permissions
Authentication Methods
Pick a credential when you configure the destination — you can switch later without recreating the export. The options depend on which destination type you choose.S3-compatible destinations
Azure Blob Storage destinations
A container-scoped SAS is the recommended choice: it’s the least-privilege option, and rotating it is a single field edit. Use the account key when a SAS doesn’t fit your workflow and you’d rather not track an expiry date.
Configure with IAM Role Authentication
This is the recommended path for AWS S3 destinations.Step 1: Start the configuration in Barndoor
- Sign in to your Barndoor portal and navigate to Audit Log Export in the side nav.
- For the destination provider, choose Amazon S3 / S3-compatible.
- Fill in the connection details:
- Endpoint URL —
https://s3.<region>.amazonaws.com(e.g.https://s3.us-east-1.amazonaws.com) - Bucket Name — the bucket events will land in
- Region — matching AWS region (e.g.
us-east-1) - Path Prefix (optional) — key prefix for every object. Defaults to
audit-events/.
- Endpoint URL —
- Under Authentication, choose IAM role (AWS only).
- Barndoor principal — the IAM role ARN that Barndoor will use to assume your role
- External ID — a random 64-character string unique to your destination. This is a shared secret used as the
sts:ExternalIdto defend against the confused-deputy problem.
Step 2: Create the IAM role in your AWS account
In the AWS console, go to IAM → Roles → Create role:-
Trusted entity type: Custom trust policy. Paste the snippet below, substituting
<barndoor-principal>and<external-id>with the values from the Barndoor UI: - Permissions: skip the AWS managed-policies screen — we’ll add an inline policy after the role is created.
-
Name: any name you like, e.g.
barndoor-audit-export. Copy the role ARN once it’s created. -
On the role’s detail page, Add permissions → Create inline policy. Paste the snippet below, replacing
<your-bucket-name>:ListBucketandGetBucketLocationare used by Barndoor’s “Check connection” health check.PutObjectis what audit-consumer uses at runtime to upload event files.
Step 3: Paste the role ARN back into Barndoor
Back in the Audit Log Export page:- Paste the role’s ARN into IAM Role ARN.
- Pick the event types to include (see Selecting event types below) or leave the default (all types).
- Click Save Configuration. The destination saves in a paused state so you can verify the connection before any events flow.
- Click Check Connection. Barndoor assumes your role, performs a
HeadBucketagainst your destination, and reports the result.
Step 4: Start the stream
Once the connection is healthy, click Start in the Current Status card. The badge flips to Streaming Active and new audit events begin flowing to your bucket within ~30 seconds.Configure with Access Keys
Use this path for non-AWS S3-compatible destinations or when an IAM user fits your team’s workflow better.Step 1: Create the IAM user / equivalent
In AWS:- IAM → Users → Create user, name it (e.g.
barndoor-audit-export). - Skip the AWS Management Console access option — this user only needs programmatic access.
- Once the user is created, Security credentials → Create access key → Application running outside AWS (or equivalent). Save the access key and secret.
- Add inline policy with the same S3 permissions snippet from Step 2 of the IAM-role flow.
Step 2: Paste the keys into Barndoor
- Navigate to Audit Log Export, choose Amazon S3 / S3-compatible as the destination provider, and fill in Endpoint URL, Bucket Name, Region, Path Prefix.
- Under Authentication, choose Access keys.
- Paste the Access Key ID and Secret Access Key.
- Click Save Configuration, then Check Connection, then Start — same flow as the IAM-role path.
Configure with Azure Blob Storage
Use this path when your events should land in an Azure storage account instead of an S3-compatible bucket. Region, path-style addressing, and the IAM-role flow are S3-only concepts — they don’t apply here and the form doesn’t ask for them.Step 1: Get a credential from Azure
Pick whichever method you settled on in Authentication Methods. Account key- In the Azure portal, open the storage account that holds your container.
- Go to Security + networking → Access keys.
- Click Show next to key1 (or key2) and copy the Key value. Barndoor wants that key on its own — not the full connection string.
- In the Azure portal, open the storage account and go to Data storage → Containers.
- Click the container you’re exporting to, then Shared access tokens in its menu.
- Under Permissions, select at least Read, List, Write, and Create.
- Set an expiry you’re comfortable rotating on, then click Generate SAS token and URL.
- Copy the Blob SAS token — the query string, not the full blob URL.
Step 2: Fill in the destination in Barndoor
- Sign in to your Barndoor portal and navigate to Audit Log Export in the side nav.
- For the destination provider, choose Azure Blob Storage.
- Fill in the connection details:
- Blob Service URL — the blob service root for your account,
https://<storage-account>.blob.core.windows.net. It must behttps, and it must not include the container — that’s a separate field. - Container — the name of the existing container events will land in.
- Path Prefix (optional) — blob-name prefix for every upload. Defaults to
audit-events/.
- Blob Service URL — the blob service root for your account,
- Under Authentication, choose Account key or SAS token and paste the value you copied into the credential field.
- Pick the event types to include (see Selecting event types below) or leave the default (all types).
- Click Save Configuration. The destination saves in a paused state so you can verify the connection before any events flow.
Sovereign clouds work the same way — only the endpoint domain changes, for example
https://<storage-account>.blob.core.chinacloudapi.cn or https://<storage-account>.blob.core.usgovcloudapi.net.Step 3: Verify and start the stream
- Click Check Connection. Barndoor reads the container’s properties with the credential you supplied and reports the result. The credential needs at least Read, List, and Write on the container — the health check reads, and delivery writes.
- If you see Connection Healthy, click Start in the Current Status card. The badge flips to Streaming Active and new audit events begin flowing to your container within ~30 seconds.
Rotating a SAS token
A SAS token carries its own expiry, so plan a rotation before it lapses. Rotating is just re-saving the destination:- Mint a fresh token with the same permissions.
- Open the destination, paste the new token into the SAS token field, and save.
Selecting Event Types
The right-hand panel of the configuration form lets you pick which event categories to export. By default all 16 event types are included. Available categories:- Policy —
AUTHORIZATION,POLICY_DECISION - Identity —
AUTHENTICATION,SESSION_CREATED,SESSION_TERMINATED,SESSION_UPDATED,TOKEN_EXCHANGE - AI Agent & Data —
AI_REQUEST,DATA_ACCESS,TOOL_CALL - Platform & Activity —
AUDIT,REQUEST_COMPLETED,REQUEST_FORWARDED,REQUEST_RECEIVED,SYSTEM,USER_ACTION
Object Format and Partitioning
Exported objects use this layout:audit-events/:
Pausing and Resuming
The Pause / Start button on the destination page is independent of the destination configuration. Pausing buffers new audit events on the Barndoor side; resuming drains the buffer to your destination. You can also delete the destination entirely with Remove — this clears any stored credential (access keys, an Azure account key, or a SAS token) and stops exports until a new destination is configured.Troubleshooting
”Connection Unhealthy” after Check Connection (S3)
Look at the message under the badge. Common causes:AccessDeniedonHeadBucket— the IAM role or user is missings3:ListBucketands3:GetBucketLocationon the bucket. Re-check the inline permissions policy.not authorized to perform: sts:AssumeRole— the trust policy’sPrincipaldoesn’t match Barndoor’s principal ARN exactly. Re-copy from the Barndoor UI.Invalid ExternalId— thests:ExternalIdin your trust policy doesn’t match what Barndoor expects. Open the destination in the UI and re-copy the External ID; the value is stable per destination.NoSuchBucket— bucket name typo, or the bucket is in a different region than what you entered.
”Last delivery issue: … AccessDenied” but Check Connection passes
Health check usesHeadBucket (ListBucket / GetBucketLocation permissions). Actual uploads use PutObject. If health check is green but uploads fail with AccessDenied, your role / user is missing s3:PutObject. Add it to the inline permissions policy.
”Connection Unhealthy” or delivery errors on an Azure destination
AuthorizationPermissionMismatchorAuthenticationFailed— the credential needs at least Read, List, and Write on the container (a container SAS also needs Create). Re-mint the signature with the missing permissions, or check that you pasted the account key rather than the connection string.AuthenticationFailedwith a signature-expiry message — the SAS token has passed its expiry. Mint a new one and save it on the destination; see Rotating a SAS token.ContainerNotFound— container name typo, or the container doesn’t exist. Barndoor writes into an existing container and never creates one.ResourceNotFoundor connection errors on the endpoint — the Blob Service URL must be the account root (https://<storage-account>.blob.core.windows.net) overhttps, with no container path appended. Move the container name into the Container field.
No objects appearing in the bucket or container even though the stream is “Active”
Audit events are only emitted when traffic flows through Barndoor. If you’ve just configured an empty test organization and there’s no activity, the buffer may genuinely have nothing to upload. Generate some events by logging in/out, navigating around the portal, or making an API call against your tenant — anything that crosses Barndoor’s authorization or proxy paths.Switching between IAM-role and access-keys mode
Editing an existing destination to switch modes is supported. When you switch from access keys to IAM role, Barndoor automatically deletes the stored access keys from its vault. When you switch the other way, you’ll be prompted to enter new access keys.Switching between S3 and Azure Blob Storage
Editing an existing destination to switch providers is also supported. Changing the provider — or the authentication method — always requires entering the new destination’s credentials; the previously stored credential is replaced when you save. The export itself (delivery settings, event-type selection) carries over unchanged, and streaming resumes against the new destination once its connection check passes.Frequently Asked Questions
What happens if my IAM role's trust policy or bucket permissions change?
What happens if my IAM role's trust policy or bucket permissions change?
The next upload attempt will fail. The destination’s status banner in the Barndoor UI will show the AWS error message. Re-check the trust and permissions policies — Barndoor doesn’t cache anything that survives an updated AWS-side configuration.
Can the same IAM role serve multiple Barndoor organizations?
Can the same IAM role serve multiple Barndoor organizations?
Each Barndoor destination has its own External ID, so even within a single AWS account a single role can support multiple Barndoor tenants by allowing multiple
sts:ExternalId values in the trust policy. In practice we recommend one role per Barndoor organization for clean auditing.Is there a backfill option for historical events?
Is there a backfill option for historical events?
Not currently — exports start from the moment you click Start. Historical events remain queryable in the Barndoor portal but aren’t replayed to your bucket.
What's the data retention on Barndoor's side while paused?
What's the data retention on Barndoor's side while paused?
Buffered events are retained for 30 days while the stream is paused. If you resume within that window, all buffered events stream out in order. If you exceed it, older buffered events are dropped.