Send Audits to Amazon SQS in a Self-Managed AWS Deployment¶
In a self-managed deployment, Audit Server can send PolicySync audits to Amazon SQS using the AWS SDK. Enable the SQS destination and provide the queue details in Privacera Manager; Audit Server uses your AWS credentials (for example an IAM role on the cluster) to publish messages.
For audits written to object storage through Audit Fluentd, see Send Audits to S3. To send the same connector audit stream to Solr, Audit Fluentd, and Amazon SQS together, see Connector audit output destinations.
This is applicable only for self-managed deployments. For PrivaceraCloud, please reach out to your contact at Privacera.
Note
- SQS is configured on Audit Server, not Audit Fluentd.
- On EKS, see IAM for Audit Server on Amazon EKS (IRSA).
Note
Use this page when you want Privacera connector activity—for example grant and revoke operations the connector runs—to show up as messages in your Amazon SQS queue. After you follow the setup below, Audit Server publishes those connector events to SQS. Audit traffic that does not go through a connector (for example some Ranger-only flows) is not covered here.
Collections supported for SQS¶
| Audit stream | Audit collection | SQS on Audit Server |
|---|---|---|
| PolicySync audits | policysync_audit | Supported. Complete the Setup section in this guide. |
Prerequisites¶
| Requirement | Notes |
|---|---|
| Traffic | policysync_audit events from connectors (including grant and revoke actions executed by a connector). |
| Queue | Standard or FIFO queue URL and matching region. |
| IAM | sqs:SendMessage on the Audit Server identity (plus GetQueueUrl / GetQueueAttributes if you use them). |
| Handler V2 | Connector audit handler V2 must be on. Set AUDITSERVER_POLICYSYNC_AUDIT_HANDLER_V2_ENABLED to true as described in Connector audit output destinations. |
Setup¶
To send PolicySync audits to Amazon SQS, follow these steps.
- Sign in to the host where Privacera Manager is installed.
- Open the Manager configuration directory:
Bash - Copy the Audit Server sample variables into
custom-varsif you have not already. The-nflag avoids overwriting an existing file.Bash - Edit the Audit Server custom variables file:
Bash - Turn on connector audit handler V2 and set the destination list as described in Connector audit output destinations. When Amazon SQS is enabled for this stream, the destination list must include
sqs(Privacera Manager does not add it automatically). -
In the same file, set the Amazon SQS properties:
Property Purpose AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_SQS_ENABLEDSet to trueto send PolicySync audits to your queue.AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_SQS_QUEUE_URLFull HTTPS URL of the queue. AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_SQS_REGIONAWS Region of the queue (for example us-east-1).AUDITSERVER_POLICYSYNC_AUDIT_DESTINATIONS_NAMESComma-separated destinations; include sqswhen SQS is on (for examplesolr,sqs). See Connector audit output destinations forsolr,fluentd, andsqs.If Amazon SQS delivery fails temporarily, Audit Server can spool messages and retry. In the same file, optional SQS spool settings are:
Property Purpose AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_SQS_SPOOL_ENABLEDSet to trueto write failed SQS sends to the SQS spool under the shared PolicySync spool base directory.AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_SQS_SPOOL_DRAIN_INTERVAL_SECONDSHow often the SQS spool is drained and retried, in seconds. The base directory and drain interval shared by Solr, SQS, and Fluentd for connector audits are described in Connector audit output destinations. For Fluentd URL and path settings when
fluentdappears in the destination list, use the Audit Server sample variables and the same connector destinations guide. -
Apply the configuration with Privacera Manager, then restart Audit Server.
Example¶
Solr plus one SQS queue (replace URL and region):
To also send the same stream to Audit Fluentd, add fluentd to the names list and set AUDITSERVER_POLICYSYNC_AUDIT_DESTINATION_FLUENTD_ENABLED to true (see sample vars for URL and path keys).
Validation¶
- Generate
policysync_audittraffic, then confirm Solr (ifsolris in the destination list) and new messages in the queue (AWS console,aws sqs receive-message, or a short-lived consumer). - On your Audit Server dashboard (for example Grafana), confirm SQS-related metrics move with traffic instead of staying flat.
- On failures, check
AUDITSERVER_POLICYSYNC_AUDIT_DESTINATIONS_SPOOL_BASE_DIRand Audit Server logs.
One SQS message is not always one audit JSON line (batching/spool before SendMessage).