Configuring Cloudflare Access for the OX CLI
The OX CLI supports Cloudflare Access authentication through environment variables. If your organization routes CLI requests through Cloudflare Access, set the service token credentials before running scans so the requests include the required authentication headers.
Prerequisites
Before configuring Cloudflare Access, make sure you have:
The OX CLI installed.
A Cloudflare Access service token with a client ID and client secret, provided by your organization's administrator.
Access to the OX environment through your organization's Cloudflare Access configuration.
Configuring Cloudflare Access for the OX CLI
Set the following environment variables before running the CLI:
CF_ACCESS_CLIENT_ID
Cloudflare Access service token client ID.
CF_ACCESS_CLIENT_SECRET
Cloudflare Access service token client secret.
Linux and macOS
To configure the credentials for the current terminal session:
Set the environment variables:
export CF_ACCESS_CLIENT_ID="<client-id>" export CF_ACCESS_CLIENT_SECRET="<client-secret>"Run your OX CLI scan from the same environment.
Windows PowerShell
To configure the credentials for the current PowerShell session:
Set the environment variables:
Run your OX CLI scan from the same PowerShell session.
Removing CLI credentials
To remove the credentials from the current Linux or macOS shell session, run:
To remove the credentials from the current Windows PowerShell session, run:
How Cloudflare Access authentication works
When the environment variables are configured, OX includes the following headers in requests to the OX backend:
CF-Access-Client-Id
The value of CF_ACCESS_CLIENT_ID.
CF-Access-Client-Secret
The value of CF_ACCESS_CLIENT_SECRET.
Cloudflare Access validates these headers before allowing the request to reach OX.
Troubleshooting
CLI scans fail behind Cloudflare Access.
The environment variables are not available to the CLI process.
Set both variables in the environment where the CLI runs and retry the scan.
Requests are rejected by Cloudflare Access.
The client ID or client secret is missing or incorrect.
Verify the credentials with your administrator and set the variables again.
Requests fail after credentials are updated.
The environment contains outdated credentials.
Replace the values with the current service token credentials and retry the scan.
Last updated