📨Amazon SQS setup
Send P0 audit logs to an Amazon SQS queue in your AWS account.
P0 sends each audit log event from your P0 tenant as one message to an Amazon SQS queue in your AWS account. Any tool that reads from SQS can consume the queue, and you can batch the events into S3 for tools that read from S3.
Prerequisites
Existing P0 account at p0.app
P0's AWS integration installed for the AWS account that owns the queue
An SQS queue, standard or FIFO
Permission to create IAM roles in that AWS account
Set up the Amazon SQS integration
Copy your queue's ARN. In the AWS console, open Amazon SQS, select your queue, and copy the ARN from the Details panel. It has the form
arn:aws:sqs:<region>:<account-id>:<queue-name>.Add the queue in P0. Log in to p0.app and select Integrations. Under Security Information & Event Managers, select Amazon SQS, then the Queue ARN component, and add a queue.
Enter the queue details and click Next. See Configure Amazon SQS for the fields.
Create P0's role. P0 shows the commands that create the
P0RoleIamEventSenderrole in your account. Run the shell commands in AWS CloudShell or a terminal signed in to that account, or apply the Terraform. Then click Next. P0 checks that the role exists and that its policies match.Click Finish. P0 sends one test message to your queue to confirm it can deliver events. The test message looks like this:
{"type":"test","action":"p0.integration.test","timestamp":"2026-10-22T19:09:08.670Z","source":"p0","tenant":"your-org","id":"p0-test-1792696148670"}
P0 supports one Amazon SQS queue per P0 organization.
Configure Amazon SQS
Queue ARN
The ARN of the queue P0 sends audit events to. FIFO queues have names that end in .fifo.
KMS key ARN
Optional. Leave this blank unless your queue is encrypted with a customer managed KMS key. If it is, enter the key's ARN, in the form arn:aws:kms:<region>:<account-id>:key/<key-id>. P0 adds permission to use that key to its role.
Queues that use SQS-managed encryption or the AWS managed key (alias/aws/sqs) need no key here.
Message format
Each message body is one audit log event as single-line JSON, in the format described in Audit log format. P0 adds three fields to every event:
source
Always p0
tenant
Your P0 organization identifier
id
A unique identifier for the event. Use it to drop duplicates, because SQS can deliver a message more than once.
The timestamp field is an ISO 8601 string. P0 does not set SQS message attributes.
For FIFO queues, P0 sets the message group ID to your P0 organization identifier and the deduplication ID to the event's id.
Send events to S3 (optional)
Some log tools read from SQS directly. Others only read files from S3. To batch the queued events into S3 files, connect the queue to Amazon Data Firehose with an EventBridge pipe:
You create and own these resources. P0's responsibility ends when an event arrives in your queue.
Create a Firehose stream with an S3 destination. Turn on the newline delimiter so each event lands on its own line, and choose a compression format. These are the settings that matter:
Create a pipe from your queue to the Firehose stream, with this input template:
Each line in the S3 files is then {"event": { ... }}, with the P0 event under event. In your log tool, P0's fields appear as event.<field>, for example event.action.
The pipe's role needs sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes on the queue, and firehose:PutRecord and firehose:PutRecordBatch on the stream. For details, see the AWS documentation for EventBridge Pipes and Firehose to S3.
Troubleshooting
P0 stopped sending events
If P0 can't send to your queue because the queue was deleted, P0's role was removed or changed, or the KMS key was disabled, P0 stops sending to the queue. Events from that period are not delivered.
To resume, fix the cause, then install the Amazon SQS integration again from the Queue ARN component. P0 checks the role, sends a test message, and resumes sending new events.
An event is too large
SQS accepts messages up to 1 MiB, and a queue can set a lower limit. P0 does not send an event that exceeds the limit.
Last updated