Access audit logs
Cloudflare Access generates two types of audit logs:
- Authentication audit logs maintain a record of authentication events.
- Per-request audit logs record HTTP requests to protected URI paths.
Authentication audit logs
Cloudflare Access logs an authentication event whenever a user or service attempts to log in to an application, whether the attempt succeeds or not.
Identity-based authentication refers to login attempts that matched on user email, IdP group, SAML group, or OIDC claim.
Non-identity authentication refers to login attempts that matched a non-identity policy such as IP address, device posture, country, valid certificate, or service token.
Identity-based authentication
To view logs for identity-based authentication events:
- In Zero Trust ↗, go to Logs > Access.
- Expand a row to view details such as the login method, the IP address of the user, and more.
- If a login attempt was blocked, select View for information about why Access denied the user access.
The Access authentication logs API endpoint provides a custom URL to export audit log events for your account.
Explanation of the fields
Identity-based authentication logs contain the following fields:
Field | Description |
---|---|
user_email | The email address of the authenticating user. |
ip_address | The IP address of the authenticating user. |
app_uid | The unique identifier for the protected application. |
app_domain | The URL of the protected application. |
action | The event that occurred, such as a login attempt. |
allowed | The result of the authentication event. |
created_at | The event timestamp. |
connection | The IdP used to authenticate. |
country | The country associated with the user’s IP address. |
ray_id | A unique identifier for every request through Cloudflare. |
app_type | The type specifies if the app is self-hosted or SaaS. |
Non-identity authentication
To retrieve logs for non-identity authentication events, use the GraphQL Analytics API. These logs are not available in Zero Trust.
Log retention
Block policy decisions are retained for a week. Authentication logs are retained for six months.
Per-request audit Logs
Users who have authenticated through Access have access to authorized URL paths for the duration of their session. Cloudflare provides several ways to audit these requests.
Using Cloudflare Logs
Enterprise customers have access to detailed logs of HTTP requests on their Cloudflare dashboard. Enterprise customers also have access to Cloudflare’s Logpush service, which can be configured from the Cloudflare dashboard or API. For more information about Cloudflare HTTP logging, refer to Cloudflare Logs.
Once a member of your team authenticates to reach a resource behind Access, Cloudflare generates a token for that user that contains their SSO identity. The token is structured as a JSON Web Token (JWT). Cloudflare relies on an RSA Signature with SHA-256, or RS256, an asymmetric algorithm, to perform that signature. Cloudflare also makes the public key available, so that you can validate their authenticity, as well.
When a user requests a given URL, Access appends the user identity from that token as a request header, which we then log as the request passes through our network. Your team can collect these logs in your preferred third-party Security information and event management (SIEM) software or storage destination by using Cloudflare Logpush. When enabled with the Access user identity field, the logs will export to your systems as JSON similar to the logs below.
Using the cf-access-user
field
In addition to the HTTP request fields available in Cloudflare Enterprise logging, requests made to applications behind Access include the cf-access-user
field, which contains the user identity string. This offers another tool for auditing user behavior. To add the cf-access-user
field to your HTTP request logs, you must add it as a custom field. Refer to Custom fields for instructions.
Keep in mind that Access does not log all interactions. For example, per-request audit logs can indicate that a specific user visited domain.com/admin
and then domain.com/admin/panel
, but the logs can only identify user interactions that result in a new HTTP request.