API gateway audit access for compliance and security teams
Set up dedicated audit access for compliance teams in Zerq: audit role RBAC, what auditors can see, log formats, SIEM export, and real-world audit queries.
- compliance
- audit
- rbac
- security
- observability
Compliance and security teams need API gateway audit access — direct visibility into what happened on your API platform: which credentials were used, who changed which configuration, and what traffic passed through during the incident window. They need that visibility on their own schedule, without filing a ticket or waiting for an operations engineer to pull a report. What they do not need is the ability to create proxies, toggle collection status, or rotate credentials. Giving them admin access to satisfy a visibility requirement creates blast radius, and creates an audit finding in itself.
The answer is a dedicated auditor access path that gives compliance teams API gateway audit access without any write permissions. This post walks through exactly what that looks like in Zerq: the auditor role, what it covers, the audit and request log formats, and how compliance teams can query and export evidence without involving platform engineers.
Why most API gateways make compliance audit access difficult
Apigee gives you IAM roles, but mapping them to a "read audit logs only" permission requires configuring custom bindings across multiple GCP services. Kong requires custom RBAC configuration through the Admin API or a Kong Manager enterprise feature. AWS API Gateway has no native audit log; you assemble evidence from CloudTrail, CloudWatch Logs, and Access Logs in three separate services, with three separate access models to configure.
The practical result is usually one of two outcomes. Either the compliance team gets admin access because it is faster to configure, and that over-provisioning becomes an audit finding the next time someone looks. Or they get a CSV export from IT once a quarter, which satisfies no one, especially not a regulator who wants to trace a specific transaction.
Neither approach gives the compliance team independent, real-time access to the evidence they need. And neither produces an audit trail for the auditors' own access: who queried audit data and when.
In banking, healthcare, and government, regulators increasingly ask for evidence of continuous monitoring, not a quarterly export. PSD2, DORA, HIPAA, and equivalent frameworks all expect the compliance function to have independent access to audit data, not mediated access through the platform team. That requires a structured, always-on access path.
The Zerq auditor role
Zerq's RBAC model has four platform roles: viewer, modifier, auditor, and admin. The auditor role is purpose-built for compliance and security teams. The tiers are not hierarchical: each management route checks one role list, and the audit log routes (/api/v1/audit/logs) are the only ones guarded by the auditor list. A compliance identity therefore normally holds two mappings:
- Auditor (
OIDC_AUDITOR_ROLES): full audit log access, every configuration change made by any user or automation, in structured JSON - Viewer (
OIDC_VIEWER_ROLES): read access to platform configuration (collections, proxies, clients, profiles, policies, credentials), request logs for every API call routed through the gateway, and metrics such as status distributions, top endpoints and error rates
Neither mapping can create, update, delete, or toggle any resource. It cannot rotate credentials. It cannot modify any policy or workflow. It is structurally read-only, enforced at the API layer, not just through UI controls.
This separation of duties matters for compliance frameworks that require independent audit oversight. The same person who can change the platform configuration should not be the only person who can read the audit log of those changes.
Credential secrets and read access
Viewer access does not include secret values. Credential and profile reads return metadata only: GET /api/v1/credentials/:id leaves the password, API key, client secret, private key or connection string blank and lists which secret fields are set, and GET /api/v1/clients/:clientId/profiles/:id/credentials returns a token profile's auth type, expiry and last rotation but not the token. Stored values can only be revealed through a separate endpoint that requires a modifier or admin role, and every reveal, including a denied attempt, is written to the audit log without the revealed value. A compliance identity that holds viewer and auditor can therefore read request logs and audit evidence without being able to read the secrets Zerq stores. Secrets are encrypted at rest in MongoDB, or referenced from environment variables so they never enter the database. Secret management covers the options.
What the audit log contains
Every configuration change in Zerq generates a structured JSON audit entry stored in the customer's own MongoDB instance. This covers creating a proxy, updating a policy, deleting a client, rotating credentials, and revealing a stored credential secret. Here is what a typical entry looks like:
{
"timestamp": "2026-06-01T09:23:14Z",
"actor_id": "[email protected]",
"actor_type": "platform-operator",
"action": "update",
"resource_type": "policy",
"ip_address": "10.0.1.42",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"request_id": "0b9e4c71-2d58-4f3a-9e6b-7c1a8d2f5e40",
"metadata": {
"url": "/api/v1/policies/6649f2a1b3c4d5e6f7890123",
"request_body": "{\"rate_limit_requests\":500,\"rate_limit_interval\":\"1m\"}",
"status_code": 200
},
"seq": 20417,
"prev_hash": "c52d…",
"hash": "e8b1…"
}
Each field serves a specific compliance function:
| Field | Compliance use |
|---|---|
timestamp | Timestamps for change control and incident timelines |
actor_id | Individual accountability: the email claim of the identity that made the change |
actor_type | The roles on that identity's token, which separate operators from dedicated automation identities |
action | create, update, delete, or a specific operation such as toggle_status, rotate_credentials or update_workflow; supports segregation of duties reporting |
resource_type | Scope of change: collection, proxy, client, policy, credential, profile |
metadata.url | The management call, which carries the resource's ID, so one resource's full change history is a URL filter |
metadata.request_body | The submitted payload with secret values masked, not just a summary like "policy updated" |
ip_address | Geolocation and anomaly detection for unexpected access locations |
request_id | Correlation ID for tracing a change through system logs |
seq, prev_hash, hash | The hash chain: each entry's hash covers its fields and the previous entry's hash, so Verify integrity reports any altered entry or gap in the sequence |
The audit log covers every resource type: collections, proxies, clients, profiles, policies, credentials, and workflow configurations. It also records changes made through Management MCP: a Copilot action that creates a proxy produces the same kind of entry as a UI action, under the same actor identity, with the Management MCP hop in user_agent and ip_address. Read-only tool calls are not audit events.
What the request log contains
The request log is separate from the audit log. Where the audit log records configuration changes, the request log records every API call routed through the gateway. Each entry captures:
- Request ID (unique trace ID, also sent back as
X-Request-IDto the caller) - Timestamp
- HTTP method and path
- Target backend URL
- Response status code
- End-to-end latency in milliseconds
X-Client-IDandX-Profile-IDheaders (which partner or application made the call)- Client IP address
- Request headers and body (credential values masked)
- Response headers and body (credential values masked)
For financial services, this is the per-transaction audit trail. For healthcare, it is the record of which client accessed which FHIR resources and when. For any incident response, it is the data that lets you reconstruct what passed through the gateway during a window of concern.
Request logs are filterable by path (with wildcard support), HTTP method, status code, latency threshold, client ID, and time range. An auditor can filter to a specific partner's traffic on a specific day, export it, and hand it to a regulator without involving the operations team.
Querying audit data through the Management MCP
Compliance teams who prefer scripted, automated evidence collection can use the Management MCP directly. The Management MCP endpoint itself is guarded by the viewer list, so the connecting identity needs a viewer mapping as well as the auditor mapping that the audit tools require. Two tools cover audit data:
list_audit_logs: returns a filtered list of audit entries with paginationget_audit_log: returns the full detail of a single audit entry by ID
An automated weekly evidence export might look like:
# Query all policy changes in the last 7 days via Management MCP
POST /api/v1/mcp
Content-Type: application/json
Authorization: Bearer <auditor-oidc-token>
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "list_audit_logs",
"arguments": {
"resource_type": "policy",
"action": "update",
"start_date": "2026-05-25T00:00:00Z",
"end_date": "2026-06-01T00:00:00Z"
}
}
}
The Management MCP runs under the auditor's own OIDC session: it forwards the caller's bearer token to the Management API, so the same role checks apply as in the UI. Note that the audit log records configuration changes (creates, updates, deletes, toggles) and a small set of sensitive reads, namely secret reveals and audit exports, but not ordinary queries, so list_audit_logs calls do not themselves produce audit entries. Each audit export is recorded as action export on resource type audit_log, with its filters in metadata.url. If you need a record of every query against audit data, capture it from your IdP's token issuance logs or from an access log at your ingress.
Step-by-step: running a configuration change audit
- Sign in to the management UI with auditor credentials (or use an OIDC token directly with the Management MCP).
- Navigate to Audit logs in the sidebar. This section is visible only to identities mapped to an auditor role.
- Set the time range for the review period (for example, the previous calendar month).
- Filter by
action: deleteandaction: updateto see substantive changes. - For each change of interest, open the full entry to see the
request_body: the payload submitted at the time of change, with secret values masked. - Filter by
resource_type: credentialto isolate backend credential changes, and byaction: rotate_credentialsfor gateway credential rotations. - Cross-reference with request logs (a viewer-level read) filtered to the same time window to correlate configuration changes with traffic anomalies.
- Run Verify integrity, then export the filtered view as CSV or NDJSON, with each entry's chain hashes, for SIEM ingestion or regulator submission. The export uses the search, filters and date range on screen, with the end date covering the whole chosen day, so click Search first and the list matches what the file will hold (up to 100,000 entries per export).
All of these steps are available to the auditor without contacting the platform team.
SIEM integration and data residency
Zerq stores all audit and request data in the customer's own MongoDB instance. No audit data reaches Zerq's infrastructure at any point; the data residency boundary is entirely within the customer's environment. For teams under frameworks that require data to remain in a specific region or perimeter (GDPR, HIPAA, government boundary policies), this is the expected model. The deployment architecture places the full audit data store and every request log inside the customer's infrastructure boundary.
For SIEM integration, Zerq streams audit and request entries as they are written, straight to Splunk HEC or through an OpenTelemetry Collector or a webhook to Sentinel, Elastic SIEM or any other platform; bodies are left out of the stream unless you turn them on. For a batch archive, the audit export produces CSV or NDJSON with the chain hashes. The log format is consistent and documented, so field mappings to Splunk, Sentinel, Elastic SIEM, or any other platform are straightforward. Because audit and request logs use the same field schema across all resource types, a single SIEM parser handles the full log stream.
What this looks like for a compliance review
A European bank running Zerq for their open banking infrastructure needs to demonstrate DORA compliance to their regulator. The compliance team (separate from platform operations) has been assigned the auditor role in Zerq. When a DORA audit is initiated, the compliance team runs the following independently:
They filter the audit log to the previous 12 months by action: rotate_credentials to show all credential rotation events and confirm they fall within the mandated rotation schedule. They pull request logs filtered by status 500, 502, 503 and 504 in turn to produce an uptime and error rate report for the audit period. They export all action: delete events to confirm that any deprovisioned partner access was formally removed rather than deactivated, and that the removal is traceable to a named actor with a timestamp.
All of this takes the compliance team less than an hour, without a single ticket to the platform team. The evidence is in structured JSON, traceable to individual identities, and stored in the bank's own infrastructure, never in a vendor's system.
The compliance function's audit exports appear in the audit log as action export on resource type audit_log; its on-screen queries do not. If oversight requires a record of every query, take it from IdP sign-in and token logs or an ingress access log for the audit routes.
Compliance evidence checklist
For regulated API platforms, compliance teams typically need evidence across several categories. Here is where to find each in Zerq:
- Change control records: audit log filtered by
action: create,update,delete(andupdate_workflowfor workflow saves); includes the submitted payload of every change, with secret values masked - Audit integrity: Verify integrity on Audit Logs reports the chain intact for the review period
- Credential rotation evidence: audit log filtered by action
rotate_credentials(gateway credentials) orresource_type: credential, actionupdate(backend credentials); confirms rotation dates and actor - Access deprovisioning: audit log filtered by
resource_type: client,resource_type: profile, actiondeleteorupdatewithactive: false - Per-transaction trail: request log filtered by
client_idand time range; includes method, path, status, latency, and headers - Configuration snapshots: read access to all current configuration via collections, proxies, policies; no separate export needed
- Anomalous access: request log filtered by client and by each error status in turn (
401,403,404,405,429,5xxcodes), with IP and timestamp - Non-human traffic: request log filtered by each agent's dedicated Client ID; entries for Gateway MCP tool calls also carry an
X-Gateway-Source: mcprequest header
Summary
Zerq's auditor role gives compliance and security teams direct, independent access to the full API platform audit trail covering configuration changes and credential lifecycle events, with request-level traffic records available through a viewer mapping, and without any ability to modify the platform they are auditing. Every piece of evidence is in structured JSON stored in the customer's own MongoDB instance, with no data leaving the perimeter. SIEM integration is built in: log streaming to Splunk HEC, an OpenTelemetry Collector or a webhook, and hash-chained audit exports that can be verified later. Compliance reviews that previously required IT operations involvement can run end-to-end on the compliance team's own schedule.
Zerq is an enterprise API gateway built for regulated industries — one platform for API management, AI agent access, compliance audit, and developer portal, running entirely in your own infrastructure. See how it works or request a demo to walk through your specific requirements.