Skip to content

Access audit logs

Cloudflare Access generates two types of audit logs:

Authentication 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

View Access authentication logs

To view logs for identity-based authentication events:

  1. In Zero Trust, go to Logs > Access.
  2. Select a row to view details such as the login method, the IP address of the user, and more.

Explanation of the fields

Identity-based authentication logs contain the following fields:

Basic information
FieldDescription
AppName of the Access application.
User emailEmail address of the authenticating user.
User IDUUID of the authenticating user.
IP addressIP address of the authenticating user.
App UIDUUID of the Access application.
App domainURL of the Access application.
App typeThe type specifies if the Access application is self-hosted, SaaS, or infrastructure.
EventType of authentication event, such as a login attempt.
ConnectionIdP used to authenticate.
AllowResult of the authentication event.
Request timeTimestamp of the authentication event.
Ray IDA unique identifier for every request through Cloudflare.
CountryCountry associated with the user's IP address.
Infrastructure applications

Cloudflare Access logs the following information when the user authenticates to an infrastructure application:

FieldDescription
HostnameHostname of the infrastructure target.
Target IDUUID of the infrastructure target.
SSH userThe UNIX user, such as root, that the authenticating user specified when connecting to the infrastructure target.
SSH logsSSH commands that the user ran on the target. Requires configuring an SSH encryption key before the session begins.

Non-identity authentication

To retrieve logs for non-identity authentication events, use the GraphQL Analytics API. These logs are not available in Zero Trust.

Per-request 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 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 and infrastructure logging, refer to Cloudflare Logs.

Once a member of your team authenticates to reach an HTTP resource behind Access, Cloudflare generates a token for that user that contains their SSO identity. The token is structured as a . 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.

{
"ClientIP": "198.51.100.206",
"ClientRequestHost": "jira.widgetcorp.tech",
"ClientRequestMethod": "GET",
"ClientRequestURI": "/secure/Dashboard/jspa",
"ClientRequestUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36",
"EdgeEndTimestamp": "2019-11-10T09:51:07Z",
"EdgeResponseBytes": 4600,
"EdgeResponseStatus": 200,
"EdgeStartTimestamp": "2019-11-10T09:51:07Z",
"RayID": "5y1250bcjd621y99",
"RequestHeaders":{"cf-access-user":"srhea"}
},
{
"ClientIP": "198.51.100.206",
"ClientRequestHost": "jira.widgetcorp.tech",
"ClientRequestMethod": "GET",
"ClientRequestURI": "/browse/EXP-12",
"ClientRequestUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36",
"EdgeEndTimestamp": "2019-11-10T09:51:27Z",
"EdgeResponseBytes": 4570,
"EdgeResponseStatus": 200,
"EdgeStartTimestamp": "2019-11-10T09:51:27Z",
"RayID": "yzrCqUhRd6DVz72a",
"RequestHeaders":{"cf-access-user":"srhea"}
}

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.