diff --git a/package.json b/package.json index 33c2735e772..fc894ca80e1 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@types/unist": "3.0.3", "@typescript-eslint/parser": "8.72.1", "astro": "7.4.7", - "cf": "1.0.0-rc.4", + "cf": "1.0.0-rc.7", "cidr-tools": "13.0.4", "clsx": "2.1.1", "codeowners-utils": "1.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2571d3d143d..d4d72cf917f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -147,8 +147,8 @@ importers: specifier: 7.4.7 version: 7.4.7(@astrojs/markdown-remark@7.3.2(supports-color@10.2.2))(@types/node@26.6.6)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1) cf: - specifier: 1.0.0-rc.4 - version: 1.0.0-rc.4(@types/node@26.6.6) + specifier: 1.0.0-rc.7 + version: 1.0.0-rc.7(@types/node@26.6.6) cidr-tools: specifier: 13.0.4 version: 13.0.4 @@ -745,15 +745,15 @@ packages: resolution: {integrity: sha512-NWT/0wULeX1YLQRDFm6rs8NAJz4YDYWbED628F0GpXF1w5PT09glR4CilIdGiovL9jflGneCD7/uLTrxWMkerQ==} engines: {node: '>=16.0.0'} - '@cloudflare/build-output-utils@1.0.0-rc.3': - resolution: {integrity: sha512-eOBdKjGzwMZXvrBGhL3VAS6fEE41pSlg8gYCydL4ao/6kHy7dUKpoxFfJ5PS9pcgP1Y7T/uu0hO+n+MtbA/X+Q==} - - '@cloudflare/config@1.0.0-rc.3': - resolution: {integrity: sha512-O4BxQxaC3MuX3fKGRNUJ4ZIazg8VXoShkA2K7neaZXUvpi61srzTC/wU3vEN8jEpFlbCo1z63NLC4xi3ZNr2eQ==} + '@cloudflare/build-output-utils@1.0.0-rc.6': + resolution: {integrity: sha512-76HLkywpc/bIuWhY8nmNzy1pcLHCeK3p8SC6wdAtB1MYcbJK9fp+E2O+vwh4TcqWUJZJ9mNnMOxulF1zbHL5LA==} '@cloudflare/config@1.0.0-rc.4': resolution: {integrity: sha512-/XMjR78UkEGL3ffbevmH6GTVrL5YtuX23ZHBm5t61CU1eAYUBj8MV4a/jSOPwQJTTSRm2WSNNSBOAxgE+H5R7A==} + '@cloudflare/config@1.0.0-rc.5': + resolution: {integrity: sha512-EJGL1OqAj4NZpAscupy8i+tOcYpjJI0WPCg3rAytBHKoV+DtrrOVgZZIq52fDj7k99AAdrw+J5KjPJYVfluKMg==} + '@cloudflare/kv-asset-handler@0.5.0': resolution: {integrity: sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==} engines: {node: '>=22.0.0'} @@ -787,8 +787,8 @@ packages: satori: optional: true - '@cloudflare/runtime-types@0.1.32': - resolution: {integrity: sha512-TU2vBeZ35tZlOAcFl+eJ6ylj+Ce6Zt4GNsBcyhduHEQ4I70XCsEYFU+X1CcpWbVKWC8ppCwMHrBsMkkJpKJWyg==} + '@cloudflare/runtime-types@0.1.36': + resolution: {integrity: sha512-I3HSTmvL5T1ZLKTdCH6+T4qnOCMWHeS4C6DZbUd2daNEBgrn+R9ivvHHIuBCMdfebv4ymIfsDoeg0EzNWZeZvQ==} '@cloudflare/unenv-preset@2.16.2': resolution: {integrity: sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==} @@ -823,8 +823,8 @@ packages: cpu: [x64] os: [darwin] - '@cloudflare/workerd-darwin-64@1.20261119.1': - resolution: {integrity: sha512-yotoiTGXCl1gTRX+y5ZWSAmzAg6CcBJXhJL6C1DGWUhsjjezNe8FdzraNsefVTOeKsOid2EC+hqOzewczKLvmQ==} + '@cloudflare/workerd-darwin-64@1.20261127.1': + resolution: {integrity: sha512-7kDdqYmmWX8S/P9pE6ae9BFU807UjivLqtF2dzUGXIQVYEenY+S8zQcKtaRm9wzhkmq8ZYyIjm0XYW5SEc8kMg==} engines: {node: '>=16'} cpu: [x64] os: [darwin] @@ -841,8 +841,8 @@ packages: cpu: [arm64] os: [darwin] - '@cloudflare/workerd-darwin-arm64@1.20261119.1': - resolution: {integrity: sha512-VPOmfEmMubvw4SPcg/yDgamQXsiVAENgxeCJO8pDggRJFaF93SP0g/hktD8sbfmWBS19BO1kX1EsdgHSgRL9jA==} + '@cloudflare/workerd-darwin-arm64@1.20261127.1': + resolution: {integrity: sha512-mSgMwlIlMsfLfzWTUi3ngrahDb8P+TKTbtic4nvEJOnnYM1KtZNf8EfYQHtB2GVoXau79uK0UEdS+kAN0WItAg==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] @@ -859,8 +859,8 @@ packages: cpu: [x64] os: [linux] - '@cloudflare/workerd-linux-64@1.20261119.1': - resolution: {integrity: sha512-aaDf78smiN12Uuwtg6TG6iLVS61sLpy/7DC5PYORf2+TCYw/bygcaqqb8zQJ+XwZ3xYhm/Ws80c/yMMhCMTFYA==} + '@cloudflare/workerd-linux-64@1.20261127.1': + resolution: {integrity: sha512-/7c3pJfyn9tg38nXEzLqdZPTwWolhlVOVyBv85FoWSmMPC23eQsFunRQAgsWi1Os/h1a6n3505MAChgqYrpq7w==} engines: {node: '>=16'} cpu: [x64] os: [linux] @@ -877,8 +877,8 @@ packages: cpu: [arm64] os: [linux] - '@cloudflare/workerd-linux-arm64@1.20261119.1': - resolution: {integrity: sha512-LkyAvTMcKqRUP73HRScWWwTSz3pw09um1hxR+rcGdvsGzao8IR59XXTp/tul6kFdVBL2mD8U3X6j2O8t7I4viw==} + '@cloudflare/workerd-linux-arm64@1.20261127.1': + resolution: {integrity: sha512-x/MJ8Vd+Q9VamNtj3pFRJZdZc9r3HcSqOpU6XfhcOTFuQEpA9t/0/DWdP27NrzxKNdHV5139XYxUw+x/oGY/Kw==} engines: {node: '>=16'} cpu: [arm64] os: [linux] @@ -895,8 +895,8 @@ packages: cpu: [x64] os: [win32] - '@cloudflare/workerd-windows-64@1.20261119.1': - resolution: {integrity: sha512-y4RO3QFNWt4j4uq2kmP5tklTvdA3qOA0PXuA66vsCmEtZYYb71ldefJcq5Dt0jrexKf/i4BBaLXZMVYLnohb0g==} + '@cloudflare/workerd-windows-64@1.20261127.1': + resolution: {integrity: sha512-ebko9XaZy6iqDHLr4WH2dC01Hf8L8xQe2GxBwqdsUfAmhMPGbnk33GtvR5FFaae+CPCPiU/H2TY1WeJ8cNSKdQ==} engines: {node: '>=16'} cpu: [x64] os: [win32] @@ -2486,8 +2486,8 @@ packages: ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - cf@1.0.0-rc.4: - resolution: {integrity: sha512-QNJOSb4DT4HOO/ZwIL0zG5GhnX64cN6a8Dmfln/IwXim/G0eTkQdo/0rEexbY3FJI6rzG19GotWN8I+udulgxA==} + cf@1.0.0-rc.7: + resolution: {integrity: sha512-UE+XKdKo6ka2G/Du+B/ei6RyCBB3Tiy8170My9f8+0/ql52p4G1TOKHDLRYYTDmb4i1fNbYFkPkC6rUikLfxZg==} engines: {node: ^22.23.0 || ^24.22.0 || ^26.12.0} hasBin: true @@ -4255,8 +4255,8 @@ packages: resolution: {integrity: sha512-FGqoi2BF7Vq6v8aSraq9Tmhg8ORpUBC5RkNGhfa11J597cWlLJ5QP9vJwDMOzwJx+W4U+IuHWSidVceBK6VRZQ==} engines: {node: '>=22.0.0'} - miniflare@5.20261119.0-beta: - resolution: {integrity: sha512-HdNQIUPgde5Yg0qFaI6iiYd0aOxAgKQTXDstkBN2G1tPBdslNrUKdySwaGdBix0IFd+yh8M0gkqzw68dIZ2Ugw==} + miniflare@5.20261127.1-beta: + resolution: {integrity: sha512-QEmP4WEmcKYtfL0ymm1zW443zwDLFGi32wAex7H9HHpFJ5sNhzQO/IoXJaum8vwQnduogmMf+2+6s8bK49Hzmw==} engines: {node: '>=22.12.0'} peerDependencies: kerberos: ^2.0.0 @@ -5633,8 +5633,8 @@ packages: engines: {node: '>=16'} hasBin: true - workerd@1.20261119.1: - resolution: {integrity: sha512-lalSvY+ad5asqMgzA/DfrZo7wvuvOHJc/aS1UctUrwu76fJE/LkSKJlprfBu0LeU79Qai5d+xFooQA9CIfj+dQ==} + workerd@1.20261127.1: + resolution: {integrity: sha512-0iiH4PRpbGnXCh9MWYczOWciw6d0ddFZ1W/I/W8qCRS2oZSNv6swptZ/n1U5pJRyrYaO9Eh6oo3Kc7+iPix4hg==} engines: {node: '>=16'} hasBin: true @@ -6240,15 +6240,15 @@ snapshots: '@cloudflare/ai-search-snippet@0.0.43': {} - '@cloudflare/build-output-utils@1.0.0-rc.3': + '@cloudflare/build-output-utils@1.0.0-rc.6': dependencies: - '@cloudflare/config': 1.0.0-rc.3 + '@cloudflare/config': 1.0.0-rc.5 - '@cloudflare/config@1.0.0-rc.3': + '@cloudflare/config@1.0.0-rc.4': dependencies: zod: 4.6.6 - '@cloudflare/config@1.0.0-rc.4': + '@cloudflare/config@1.0.0-rc.5': dependencies: zod: 4.6.6 @@ -6312,10 +6312,10 @@ snapshots: - terser - tsx - '@cloudflare/runtime-types@0.1.32(@types/node@26.6.6)': + '@cloudflare/runtime-types@0.1.36(@types/node@26.6.6)': dependencies: - miniflare: 5.20261119.0-beta(@types/node@26.6.6) - workerd: 1.20261119.1 + miniflare: 5.20261127.1-beta(@types/node@26.6.6) + workerd: 1.20261127.1 transitivePeerDependencies: - '@types/node' - bufferutil @@ -6368,7 +6368,7 @@ snapshots: '@cloudflare/workerd-darwin-64@1.20261102.1': optional: true - '@cloudflare/workerd-darwin-64@1.20261119.1': + '@cloudflare/workerd-darwin-64@1.20261127.1': optional: true '@cloudflare/workerd-darwin-arm64@1.20261012.1': @@ -6377,7 +6377,7 @@ snapshots: '@cloudflare/workerd-darwin-arm64@1.20261102.1': optional: true - '@cloudflare/workerd-darwin-arm64@1.20261119.1': + '@cloudflare/workerd-darwin-arm64@1.20261127.1': optional: true '@cloudflare/workerd-linux-64@1.20261012.1': @@ -6386,7 +6386,7 @@ snapshots: '@cloudflare/workerd-linux-64@1.20261102.1': optional: true - '@cloudflare/workerd-linux-64@1.20261119.1': + '@cloudflare/workerd-linux-64@1.20261127.1': optional: true '@cloudflare/workerd-linux-arm64@1.20261012.1': @@ -6395,7 +6395,7 @@ snapshots: '@cloudflare/workerd-linux-arm64@1.20261102.1': optional: true - '@cloudflare/workerd-linux-arm64@1.20261119.1': + '@cloudflare/workerd-linux-arm64@1.20261127.1': optional: true '@cloudflare/workerd-windows-64@1.20261012.1': @@ -6404,7 +6404,7 @@ snapshots: '@cloudflare/workerd-windows-64@1.20261102.1': optional: true - '@cloudflare/workerd-windows-64@1.20261119.1': + '@cloudflare/workerd-windows-64@1.20261127.1': optional: true '@cloudflare/workers-types@5.20261102.1': {} @@ -8080,13 +8080,13 @@ snapshots: ccount@2.0.1: {} - cf@1.0.0-rc.4(@types/node@26.6.6): + cf@1.0.0-rc.7(@types/node@26.6.6): dependencies: - '@cloudflare/build-output-utils': 1.0.0-rc.3 - '@cloudflare/config': 1.0.0-rc.3 - '@cloudflare/runtime-types': 0.1.32(@types/node@26.6.6) + '@cloudflare/build-output-utils': 1.0.0-rc.6 + '@cloudflare/config': 1.0.0-rc.5 + '@cloudflare/runtime-types': 0.1.36(@types/node@26.6.6) blake3-wasm: 2.1.5 - miniflare: 5.20261119.0-beta(@types/node@26.6.6) + miniflare: 5.20261127.1-beta(@types/node@26.6.6) transitivePeerDependencies: - '@types/node' - bufferutil @@ -10373,12 +10373,12 @@ snapshots: - bufferutil - utf-8-validate - miniflare@5.20261119.0-beta(@types/node@26.6.6): + miniflare@5.20261127.1-beta(@types/node@26.6.6): dependencies: '@cspotcode/source-map-support': 0.8.1 sharp: 0.35.5(@types/node@26.6.6) undici: 7.30.2 - workerd: 1.20261119.1 + workerd: 1.20261127.1 ws: 8.21.0 youch: 4.1.0-beta.10 transitivePeerDependencies: @@ -11857,13 +11857,13 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20261102.1 '@cloudflare/workerd-windows-64': 1.20261102.1 - workerd@1.20261119.1: + workerd@1.20261127.1: optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20261119.1 - '@cloudflare/workerd-darwin-arm64': 1.20261119.1 - '@cloudflare/workerd-linux-64': 1.20261119.1 - '@cloudflare/workerd-linux-arm64': 1.20261119.1 - '@cloudflare/workerd-windows-64': 1.20261119.1 + '@cloudflare/workerd-darwin-64': 1.20261127.1 + '@cloudflare/workerd-darwin-arm64': 1.20261127.1 + '@cloudflare/workerd-linux-64': 1.20261127.1 + '@cloudflare/workerd-linux-arm64': 1.20261127.1 + '@cloudflare/workerd-windows-64': 1.20261127.1 workers-og@0.0.27: dependencies: diff --git a/src/content/docs/cloudflare-one/access-controls/access-settings/independent-mfa.mdx b/src/content/docs/cloudflare-one/access-controls/access-settings/independent-mfa.mdx index 6ebc8547a77..f511ea999e3 100644 --- a/src/content/docs/cloudflare-one/access-controls/access-settings/independent-mfa.mdx +++ b/src/content/docs/cloudflare-one/access-controls/access-settings/independent-mfa.mdx @@ -10,7 +10,14 @@ tags: - Authentication --- -import { Tabs, TabItem, APIRequest, Details, Render } from "~/components"; +import { + APIRequest, + Details, + Render, + Steps, + TabItem, + Tabs, +} from "~/components"; Independent multi-factor authentication (MFA) allows you to enforce MFA requirements directly in Access without relying on your identity provider (IdP). Users authenticate with their IdP as usual, and Access prompts for an additional authentication method before granting access to the application. @@ -33,6 +40,7 @@ Before you can [enforce independent MFA on applications and policies](/cloudflar + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Allow multi-factor authentication (MFA)**, select the [MFA methods](#supported-mfa-methods) you want to allow in your organization. 3. Set an **Authentication duration**. This determines how long a user can log in to Access without being prompted for MFA again. If the user does not have an active MFA session for the required authenticator method, they must complete MFA in addition to IdP authentication. @@ -42,6 +50,38 @@ Before you can [enforce independent MFA on applications and policies](/cloudflar The [App Launcher](/cloudflare-one/access-controls/access-settings/app-launcher/) is exempt from the global MFA requirement. Users must be able to access the App Launcher without MFA to enroll their authenticators. ::: 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Review the current `mfa_config` of your Zero Trust organization: + + ```sh + cf zero-trust organization get + ``` + +2. Turn on independent MFA with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit): + + ```sh + cf zero-trust organization edit \ + --mfa-config-allowed-authenticators totp \ + --mfa-config-allowed-authenticators biometrics \ + --mfa-config-allowed-authenticators security_key \ + --mfa-config-session-duration 24h \ + --mfa-required-for-all-apps false + ``` + + - `--mfa-config-allowed-authenticators`: Pass once for each [MFA method](#supported-mfa-methods) to allow: `totp`, `biometrics`, `security_key`, `piv_key`, or `ssh_fido2_key`. + - `--mfa-config-session-duration`: The **Authentication duration**, for example `30m` or `24h`. To require MFA on every access, use `0m`. + - `--mfa-required-for-all-apps`: Corresponds to **Apply global MFA settings by default**. + - `--mfa-config-amr-matching-session-duration`: (Optional) Turns on [**Use identity provider MFA**](#use-identity-provider-mfa) with the given duration. + + The `--mfa-config-*` options update the organization's `mfa_config` together. Pass the current values of any `mfa_config` settings that you want to keep, such as `--mfa-config-required-aaguids`. + @@ -89,6 +129,10 @@ After you turn on independent MFA, users can [enroll authenticators](#enroll-aut If you plan to use PIV keys for [MFA for infrastructure applications](/cloudflare-one/access-controls/policies/mfa-requirements/#infrastructure-applications), configure the PIV key requirements in your organization's Access settings. These requirements determine which PIV keys users can enroll. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Allow multi-factor authentication (MFA)**, turn on the "Personal Identity Verification (PIV) key" authenticator. 3. Configure the following settings: @@ -102,6 +146,27 @@ If you plan to use PIV keys for [MFA for infrastructure applications](/cloudflar | **Require FIPS** | Require the PIV key to be on a FIPS-validated device | `true`, `false` | 4. Select **Save**. + + + + + +To configure the requirements with `cf`, run `cf zero-trust organization edit` with `piv_key` in the allowed authenticators and the `--mfa-piv-key-requirements-*` options. Include the other MFA methods that you want to keep: + +```sh +cf zero-trust organization edit \ + --mfa-config-allowed-authenticators security_key \ + --mfa-config-allowed-authenticators piv_key \ + --mfa-piv-key-requirements-ssh-key-type ecdsa \ + --mfa-piv-key-requirements-pin-policy once \ + --mfa-piv-key-requirements-touch-policy always \ + --mfa-piv-key-requirements-require-fips-device false +``` + +`cf` sends `--mfa-piv-key-requirements-ssh-key-size` values as strings instead of numbers. To set the **Key size**, use the dashboard or API. + + + :::note @@ -180,13 +245,27 @@ You can look up AAGUIDs for common authenticators in the [FIDO Alliance Metadata + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Allow multi-factor authentication (MFA)**, go to **Limit MFA to specific authentication methods**. 3. Select an existing [AAGUID list](#1-create-an-aaguid-list). 4. Select **Save**. + After you save, only authenticators whose AAGUIDs appear in the list can be enrolled. Users with previously enrolled security keys or biometrics outside the list can continue to use them until they are [deleted by an administrator](#delete-a-user-authenticator). A previously enrolled FIDO2 key outside the list stops working on the next connection. To remove the restriction, unset the AAGUID list. + + + +Assign the list with `cf zero-trust organization edit`. Include the current allowed authenticators and session duration, because the `--mfa-config-*` options update `mfa_config` together: + +```sh +cf zero-trust organization edit \ + --mfa-config-allowed-authenticators security_key \ + --mfa-config-session-duration 24h \ + --mfa-config-required-aaguids +``` + @@ -247,10 +326,24 @@ Access ignores AMR values that do not map to a supported authenticator type (for + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Allow multi-factor authentication (MFA)**, turn on **Use identity provider MFA**. 3. Under **Authentication Method Reference (AMR) matching duration**, set how long a successful IdP MFA remains valid. During this period, users can log in to Access without an additional MFA prompt. You can set a custom duration (default 24 hours) or check for a [valid AMR value](#supported-amr-values) on every login. 4. Select **Save**. + + + + + +Turn on AMR matching with `cf zero-trust organization edit` and `--mfa-config-amr-matching-session-duration`. Include the current allowed authenticators and session duration, because the `--mfa-config-*` options update `mfa_config` together: + +```sh +cf zero-trust organization edit \ + --mfa-config-allowed-authenticators security_key \ + --mfa-config-session-duration 24h \ + --mfa-config-amr-matching-session-duration 24h +``` @@ -562,12 +655,37 @@ If a user is locked out or you need to revoke an authenticator for security reas + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Users**. 2. Select the user whose authenticator you want to delete. 3. Under **MFA devices**, find the authenticator and select **Delete**. + The user can no longer use the deleted authenticator for MFA challenges. If no usable authenticators remain, they must enroll another one before completing an independent MFA challenge. + + + + +1. Find the user ID: + + ```sh + cf zero-trust access users list --email user@example.com + ``` + +2. Find the authenticator ID in the `mfa_authenticators` array of the user's last seen identity: + + ```sh + cf zero-trust access users last-seen-identity get + ``` + +3. Delete the authenticator with [`cf zero-trust users mfa authenticators delete`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-users-mfa-authenticators-delete): + + ```sh + cf zero-trust users mfa authenticators delete --user-id --force + ``` + + diff --git a/src/content/docs/cloudflare-one/access-controls/access-settings/require-access-protection.mdx b/src/content/docs/cloudflare-one/access-controls/access-settings/require-access-protection.mdx index db274e1c338..42afc8c9991 100644 --- a/src/content/docs/cloudflare-one/access-controls/access-settings/require-access-protection.mdx +++ b/src/content/docs/cloudflare-one/access-controls/access-settings/require-access-protection.mdx @@ -10,6 +10,8 @@ tags: - Security --- +import { Steps, TabItem, Tabs } from "~/components"; + Cloudflare Access allows you to require Access protection for all hostnames in your account. When this setting is turned on, traffic to any hostname without a matching [Access application](/cloudflare-one/access-controls/applications/) is automatically blocked. This deny-by-default approach prevents accidental exposure of internal resources to the public Internet. Without this setting, a developer could deploy a new application or create a DNS record and inadvertently expose the resource before configuring an Access application. @@ -20,6 +22,10 @@ This deny-by-default approach prevents accidental exposure of internal resources Turning on Access protection blocks traffic to any hostname that does not have an Access application. Before turning on this setting, verify that all publicly accessible hostnames have an [Access application with an Allow or Bypass policy](#allow-traffic-to-a-hostname). ::: + + + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and go to **Zero Trust** > **Access controls** > **Access settings**. 2. Turn on **Block traffic to all domains in this account**. You will see a dialog confirming you understand the scope of this change. Select **Confirm**. @@ -30,6 +36,28 @@ Turning on Access protection blocks traffic to any hostname that does not have a :::note Cloudflare recommends limiting exemptions to hostnames that host only public-facing content. Internal applications should have an Access application configured. ::: + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Turn on the setting with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit): + +```sh +cf zero-trust organization edit \ + --deny-unmatched-requests true \ + --deny-unmatched-requests-exempted-zone-names example.com +``` + +- `--deny-unmatched-requests`: Corresponds to **Block traffic to all domains in this account**. Traffic to all hostnames in the account is blocked unless an Access application exists for the hostname. +- `--deny-unmatched-requests-exempted-zone-names`: (Optional) The domains to exempt, which corresponds to **Hostnames to Exempt**. Repeat the option to exempt more than one domain, and include every domain that you want to keep exempt. + +To turn off the setting, pass `--deny-unmatched-requests false`. + + + ## Allow traffic to a hostname diff --git a/src/content/docs/cloudflare-one/access-controls/access-settings/session-management.mdx b/src/content/docs/cloudflare-one/access-controls/access-settings/session-management.mdx index 331ac17b02e..dab64afab3f 100644 --- a/src/content/docs/cloudflare-one/access-controls/access-settings/session-management.mdx +++ b/src/content/docs/cloudflare-one/access-controls/access-settings/session-management.mdx @@ -11,7 +11,7 @@ tags: - Authentication --- -import { GlossaryTooltip, Render } from "~/components"; +import { GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; A user session determines how long a user can access an Access application without re-authenticating. @@ -45,10 +45,31 @@ The global session duration determines how often Cloudflare Access prompts the u To set the global session duration: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Set your global session duration**, select **Edit**, 3. Select the desired timeout duration from the dropdown menu. 4. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Set the global session duration with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit): + +```sh +cf zero-trust organization edit --session-duration 24h +``` + +Use a value between 15 minutes and one month, for example `30m`, `12h`, or `168h`. + + + The user will be required to re-authenticate with the IdP after this period of time. @@ -60,10 +81,33 @@ By default, the policy session duration is equal to the [application session dur To set the policy session duration: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Choose a policy and select **Edit**. 3. Select a **Session Duration** from the dropdown menu. 4. Save the policy. + + + + + +Update the policy with [`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update) and a new `--session-duration`, for example `30m` or `24h`. The update replaces the whole policy, so first run `cf zero-trust access policies get ` and pass the policy's current name, decision, and rules: + +```sh +cf zero-trust access policies update \ + --name "Contractors" \ + --decision allow \ + --include '[{"email_domain":{"domain":"contractor.example.com"}}]' \ + --session-duration 24h +``` + +To use the application session duration, omit `--session-duration`. + + + Users who match this policy will be issued an application token with this expiration time. @@ -73,10 +117,37 @@ The application session duration is the default [policy session duration](#polic To set the application session duration: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Choose an application and select **Edit**. 3. Select a **Session Duration** from the dropdown menu. 4. Save the application. + + + + + + +1. Save the application's current configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, set `session_duration` to the new value, for example `"session_duration": "168h"`. Use `0s` for an immediate timeout. + +3. Update the application: + + ```sh + cf zero-trust access applications update --body @app.json + ``` + + + + Users who match a policy configured with a _Same as application session timeout_ duration will be issued an application token with this expiration time. @@ -107,9 +178,28 @@ By default, failed Cloudflare One Client authentication requests return a `302` To enable this behavior: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under **Cloudflare One Client authentication**, ensure that **Enable authentication using the Cloudflare One Client session** is turned on. 3. Turn on **Return 401 response for non-browser traffic**. + + + + + +Turn on the setting with `cf zero-trust organization edit`. Cloudflare One Client authentication must also be turned on: + +```sh +cf zero-trust organization edit \ + --allow-authenticate-via-warp true \ + --warp-auth-non-browser-401 true +``` + + + You can also set `warp_auth_non_browser_401` to `true` using the [Update your Zero Trust organization](/api/resources/zero_trust/subresources/organizations/methods/update/) API. @@ -164,9 +254,28 @@ Access provides two options for revoking user sessions: per-application and per- To immediately terminate all active sessions for a specific application: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Locate the application for which you would like to revoke active sessions and select **Edit**. 3. Select **Revoke existing tokens**. + + + + + +Revoke all application tokens with [`cf zero-trust access applications revoke-tokens`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-revoke-tokens): + +```sh +cf zero-trust access applications revoke-tokens --force +``` + +To find the application ID, run `cf zero-trust access applications list --name ""`. + + + Unless there are changes to rules in the policy, users can start a new session if their profile in your identity provider is still active. @@ -176,10 +285,32 @@ Access can immediately revoke a single user session across all applications in y If you want to permanently revoke a user's access: + + + + 1. Disable their account in your identity provider so that they cannot authenticate. 2. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Users**. 3. Select the checkbox next to the user you want to revoke. 4. Select **Action** > **Revoke**. + + + + + + +1. Disable their account in your identity provider so that they cannot authenticate. +2. Revoke the user's sessions with [`cf zero-trust access users revoke`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-users-revoke): + + ```sh + cf zero-trust access users revoke --email user@example.com --force + ``` + + To also revoke the user's registered devices, add `--devices true`. + + + + The user will no longer be able to log in to any application protected by Access. The user will still count towards your seat subscription until you [remove the user](/cloudflare-one/team-and-resources/users/seat-management) from your account. diff --git a/src/content/docs/cloudflare-one/access-controls/ai-controls/secure-mcp-servers.mdx b/src/content/docs/cloudflare-one/access-controls/ai-controls/secure-mcp-servers.mdx index 2f5058d541b..b52cb9dcd6d 100644 --- a/src/content/docs/cloudflare-one/access-controls/ai-controls/secure-mcp-servers.mdx +++ b/src/content/docs/cloudflare-one/access-controls/ai-controls/secure-mcp-servers.mdx @@ -13,12 +13,13 @@ description: Secure MCP servers with Cloudflare Access. --- import { - Render, - GlossaryTooltip, - Tabs, - TabItem, APIRequest, DashButton, + GlossaryTooltip, + Render, + Steps, + TabItem, + Tabs, } from "~/components"; You can secure [Model Context Protocol (MCP) servers](https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/) with Cloudflare Access. Choose an approach based on who manages the MCP server code and hostname: @@ -160,6 +161,7 @@ The Worker will be deployed to your `*.workers.dev` subdomain at `mcp-server-cf- + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application**. 3. Select **SaaS application**. @@ -182,6 +184,45 @@ The Worker will be deployed to your `*.workers.dev` subdomain at `mcp-server-cf- product="cloudflare-one" /> 12. Select **Create**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create a JSON file that describes the application. The callback URL for our [example MCP server](#1-deploy-an-example-mcp-server) is `https://mcp-server-cf-access..workers.dev/callback`: + + ```json title="mcp-saas-app.json" + { + "name": "MCP server", + "type": "saas", + "saas_app": { + "auth_type": "oidc", + "redirect_uris": [ + "https://mcp-server-cf-access..workers.dev/callback" + ], + "grant_types": ["authorization_code", "refresh_tokens"], + "refresh_token_options": { "lifetime": "90d" } + }, + "policies": [{ "id": "", "precedence": 1 }], + "allowed_idps": [] + } + ``` + + To find policy IDs, run `cf zero-trust access policies list`. Remove `refresh_tokens` and `refresh_token_options` if you do not want to issue refresh tokens. + +2. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @mcp-saas-app.json + ``` + +3. Copy the `client_id` and `client_secret` from the `saas_app` object in the output. The client secret is only shown when you create the application. + +4. Build the OAuth endpoint URLs using your team name and the `client_id`. The token endpoint is `https://.cloudflareaccess.com/cdn-cgi/access/sso/oidc//token`. For the authorization and key endpoints, replace `/token` with `/authorization` and `/jwks`. + diff --git a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-oidc-saas.mdx b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-oidc-saas.mdx index 483cfe81efd..68d398bbc7f 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-oidc-saas.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-oidc-saas.mdx @@ -10,7 +10,7 @@ sidebar: order: 1 --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; This page provides generic instructions for setting up a SaaS application in Cloudflare Access using the OpenID Connect (OIDC) authentication protocol. @@ -27,6 +27,10 @@ Some SaaS applications provide the Redirect URL after you [configure the SSO pro ## 2. Add your application to Access + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application**. 3. Select **SaaS application**. @@ -55,6 +59,49 @@ Some SaaS applications provide the Redirect URL after you [configure the SSO pro - 14. Select **Create**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create a JSON file that describes the application: + + ```json title="oidc-app.json" + { + "name": "Example OIDC app", + "type": "saas", + "saas_app": { + "auth_type": "oidc", + "redirect_uris": ["https://app.example.com/oauth/callback"], + "grant_types": ["authorization_code"], + "scopes": ["openid", "email", "profile", "groups"] + }, + "policies": [{ "id": "", "precedence": 1 }], + "allowed_idps": [""], + "app_launcher_visible": true + } + ``` + + - `redirect_uris`: The **Redirect URLs** obtained from the SaaS application. + - `scopes`: The user attributes that Access sends in the ID token. For more information, refer to [OIDC claims](#oidc-claims). + - `grant_types`: To enable [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/), use `["authorization_code_with_pkce"]`. To issue [refresh tokens](#advanced-settings), add `refresh_tokens`. + - `policies`: The [reusable Access policies](/cloudflare-one/access-controls/policies/policy-management/) to apply. To find policy IDs, run `cf zero-trust access policies list`. + - `allowed_idps`: (Optional) The identity providers that users can log in with. To find their IDs, run `cf zero-trust identity-providers list`. + +2. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @oidc-app.json + ``` + +3. Copy the `client_id` and `client_secret` from the `saas_app` object in the output. The client secret is only shown when you create the application. Build the other values that your SaaS application needs from your team name and the client ID, as listed in the **Dashboard** tab. For example, the issuer is `https://.cloudflareaccess.com/cdn-cgi/access/sso/oidc/`. + + + + ## 3. Configure SSO in your SaaS application diff --git a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-saml-saas.mdx b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-saml-saas.mdx index 5dc4826418b..2a5a888e10e 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-saml-saas.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-saml-saas.mdx @@ -10,7 +10,7 @@ sidebar: order: 1 --- -import { Render, Details } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components"; This page provides generic instructions for setting up a SaaS application in Cloudflare Access using the SAML authentication protocol. @@ -28,6 +28,10 @@ Obtain the following URLs from your SaaS application account: ## 2. Add your application to Access + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application**. @@ -48,10 +52,10 @@ Obtain the following URLs from your SaaS application account: 10. Copy the **SSO endpoint**, **Access Entity ID or Issuer**, and **Public key**. -:::note[IdP groups] + :::note[IdP groups] -If you are using Okta, Microsoft Entra ID (formerly Azure AD), Google Workspace, or GitHub as your IdP, Access will automatically send a SAML attribute titled `groups` with all of the user's associated groups as attribute values. -::: + If you are using Okta, Microsoft Entra ID (formerly Azure AD), Google Workspace, or GitHub as your IdP, Access will automatically send a SAML attribute titled `groups` with all of the user's associated groups as attribute values. + ::: 11. @@ -63,6 +67,56 @@ If you are using Okta, Microsoft Entra ID (formerly Azure AD), Google Workspace, - 14. Select **Create**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create a JSON file that describes the application: + + ```json title="saml-app.json" + { + "name": "Example SAML app", + "type": "saas", + "saas_app": { + "auth_type": "saml", + "sp_entity_id": "https://app.example.com", + "consumer_service_url": "https://app.example.com/sso/saml/acs", + "name_id_format": "email", + "custom_attributes": [ + { + "name": "department", + "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "source": { "name": "department" } + } + ] + }, + "policies": [{ "id": "", "precedence": 1 }], + "allowed_idps": [""], + "app_launcher_visible": true + } + ``` + + - `sp_entity_id` and `consumer_service_url`: The **Entity ID** and **Assertion Consumer Service URL** obtained from your SaaS application account. + - `name_id_format`: The **Name ID Format** expected by your SaaS application, either `email` or `id`. + - `custom_attributes`: (Optional) Additional [SAML attribute statements](#saml-attributes). `source.name` is the name of the attribute in your identity provider. + - `policies`: The [reusable Access policies](/cloudflare-one/access-controls/policies/policy-management/) to apply. To find policy IDs, run `cf zero-trust access policies list`. + - `allowed_idps`: (Optional) The identity providers that users can log in with. To find their IDs, run `cf zero-trust identity-providers list`. + +2. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @saml-app.json + ``` + +3. Copy the `sso_endpoint`, `idp_entity_id` (**Access Entity ID or Issuer**), and `public_key` values from the `saas_app` object in the output. To get them again later, run `cf zero-trust access applications get `. + + + + ## 3. Configure SSO in your SaaS application diff --git a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app.mdx b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app.mdx index a942bcfe2ae..83dbcaaf04d 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app.mdx @@ -9,7 +9,7 @@ sidebar: label: Self-hosted public application --- -import { Render, Stream } from "~/components"; +import { Render, Steps, Stream, TabItem, Tabs } from "~/components"; You can securely publish internal tools and applications by adding Cloudflare Access as an authentication layer between the end user and your origin server. @@ -32,11 +32,68 @@ If your domain uses a [partial (`CNAME`) setup](/dns/zone-setups/partial-setup/) thumbnail="https://pub-d9bf66e086fb4b639107aa52105b49dd.r2.dev/tunnel%203_%20set%20up%20access.png" /> + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Find the ID of the [reusable Access policy](/cloudflare-one/access-controls/policies/policy-management/#create-a-policy) that you want to apply to the application: + + ```sh + cf zero-trust access policies list + ``` + +2. (Optional) To limit the [identity providers](/cloudflare-one/integrations/identity-providers/) that users can log in with, find their IDs: + + ```sh + cf zero-trust identity-providers list + ``` + +3. Create a JSON file that describes the application: + + ```json title="app.json" + { + "name": "Internal wiki", + "type": "self_hosted", + "destinations": [{ "type": "public", "uri": "wiki.example.com" }], + "policies": [{ "id": "", "precedence": 1 }], + "allowed_idps": [""], + "auto_redirect_to_identity": true, + "session_duration": "24h", + "app_launcher_visible": true + } + ``` + + - `destinations`: The public hostnames and paths that the application protects, for example `wiki.example.com/admin`. The hostname must belong to a domain in your Cloudflare account. To add more hostnames, add more `public` entries. + - `policies`: The reusable policies to apply, in order of precedence. + - `allowed_idps`: The identity providers that users can log in with. If you omit this field, all of your identity providers are allowed. + - `auto_redirect_to_identity`: Corresponds to **Apply instant authentication**. Requires exactly one identity provider in `allowed_idps`. + - `session_duration`: How long the [application token](/cloudflare-one/access-controls/access-settings/session-management/#application-session-duration) is valid. + - `app_launcher_visible`: Whether the application appears in the [App Launcher](/cloudflare-one/access-controls/access-settings/app-launcher/). + +4. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @app.json + ``` + +5. Note the `id` and `aud` in the output. You need the `aud` tag to [validate the Access token](#3-validate-the-access-token). + + +To change the application later, run `cf zero-trust access applications update --body @app.json`. The update replaces the whole application, so the file must include every setting that you want to keep. + + + + ## 2. Connect your origin to Cloudflare [Set up a Cloudflare Tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/) to publish your internal application. Only users who match your Access policies will be granted access. diff --git a/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/arbitrary-tcp.mdx b/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/arbitrary-tcp.mdx index e0badb2c31f..35295bcbe24 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/arbitrary-tcp.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/arbitrary-tcp.mdx @@ -77,6 +77,12 @@ Run the following command to create a connection from the device to Cloudflare. cloudflared access tcp --hostname tcp.site.com --url localhost:9210 ``` +If the [Cloudflare CLI (`cf`)](/cf/) is installed on the device, you can run the equivalent [`cf access tcp`](/cloudflare-one/access-controls/cli-commands/#cf-access-tcp) command instead. It runs `cloudflared`, so `cloudflared` must still be installed: + +```sh +cf access tcp --hostname tcp.site.com --url localhost:9210 +``` + This command can be wrapped as a desktop shortcut so that end users do not need to use the command line. Point the client application to the selected port. diff --git a/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/index.mdx b/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/index.mdx index 2eb56052b24..1cb62941d34 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/index.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/index.mdx @@ -13,6 +13,8 @@ With Cloudflare Zero Trust, users can connect to non-HTTP applications via a pub Users log in to the application by running a `cloudflared access` command in their terminal. `cloudflared` will launch a browser window and prompt the user to authenticate with your identity provider. +Users who have the [Cloudflare CLI (`cf`)](/cf/) installed can also run the equivalent [`cf access`](/cloudflare-one/access-controls/cli-commands/#access) commands, such as `cf access login` and `cf access tcp`. These commands run `cloudflared`, so `cloudflared` must still be installed on the device. + :::note Automated services should only authenticate with `cloudflared` if they cannot use a [service token](/cloudflare-one/access-controls/service-credentials/service-tokens/). Cloudflared authentication relies on WebSockets to establish a connection. WebSockets have a known limitation where persistent connections may close unexpectedly. We recommend either a [Service Auth policy](/cloudflare-one/access-controls/policies/#service-auth) or using [Warp to Tunnel routing](/cloudflare-one/access-controls/applications/non-http/) in these instances. diff --git a/src/content/docs/cloudflare-one/access-controls/applications/non-http/infrastructure-apps.mdx b/src/content/docs/cloudflare-one/access-controls/applications/non-http/infrastructure-apps.mdx index 35103187aa0..39f02087708 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/non-http/infrastructure-apps.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/non-http/infrastructure-apps.mdx @@ -15,9 +15,9 @@ import { APIRequest, Badge, Details, - Tabs, - TabItem, Render, + TabItem, + Tabs, } from "~/components";
@@ -76,6 +76,19 @@ You can filter and sort targets by tag values. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Targets**. Use the filter and sort controls to narrow the list by tag key or value. + + + +To filter targets by tag, add one or more `--tag` options to [`cf zero-trust access targets list`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-targets-list): + +```sh +cf zero-trust access targets list --tag environment:production --tag team:platform +``` + +Use `:` between the tag key and value in each filter. If you add multiple `--tag` options, Cloudflare applies AND logic. + +`cf` does not yet support sorting targets by tag. To sort by hostname or creation date, add `--order hostname` or `--order created_at` and `--direction asc` or `--direction desc`. + @@ -177,6 +190,24 @@ Attach key-value [resource tags](/resource-tagging/) to targets to organize and To tag a target, you need an API token with the `Zero Trust Write` [permission](/fundamentals/api/reference/permissions/). No additional tag-specific permissions are required. + + + +Update the target with [`cf zero-trust access targets update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-targets-update). The update replaces the target, so pass its current hostname and IP addresses along with the tags. `--tags` replaces all existing tags on the target. + +```sh +cf zero-trust access targets update \ + --hostname infra-target-example \ + --ip-ipv4-ip-addr 198.51.100.10 \ + --ip-ipv4-virtual-network-id \ + --tags '{"environment":"production","team":"platform"}' +``` + +To get the current values, run `cf zero-trust access targets get `. To replace the tags on many targets at once, use `cf zero-trust access targets bulk-replace-tags`. + + + + To add tags to a target, make a `PUT` request to the [Infrastructure Access Targets](/api/resources/zero_trust/subresources/access/subresources/infrastructure/subresources/targets/methods/update/) endpoint. Include a `tags` object: + + + Each target supports one value per tag key. For more information on managing tags, refer to [Resource Tagging](/resource-tagging/how-to/manage-tags/). ## Granular target permissions diff --git a/src/content/docs/cloudflare-one/access-controls/applications/non-http/self-hosted-private-app.mdx b/src/content/docs/cloudflare-one/access-controls/applications/non-http/self-hosted-private-app.mdx index e30f2db2412..fdbd851c1bc 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/non-http/self-hosted-private-app.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/non-http/self-hosted-private-app.mdx @@ -11,7 +11,7 @@ sidebar: label: Add a self-hosted private application --- -import { Render, GlossaryTooltip, } from "~/components"; +import { GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; You can configure a self-hosted Access application to manage access to specific IPs or hostnames on your private network. @@ -28,6 +28,10 @@ This feature replaces the legacy [private network app type](/cloudflare-one/acce ## Add your application to Access + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application**. @@ -89,6 +93,65 @@ This feature replaces the legacy [private network app type](/cloudflare-one/acce 11. Select **Create**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Find the ID of the [reusable Access policy](/cloudflare-one/access-controls/policies/policy-management/#create-a-policy) that you want to apply to the application: + + ```sh + cf zero-trust access policies list + ``` + +2. Create a JSON file that describes the application. The following example protects a private hostname on port `443` and a private IP on port `22`: + + ```json title="private-app.json" + { + "name": "Internal wiki", + "type": "self_hosted", + "destinations": [ + { + "type": "private", + "hostname": "wiki.internal.local", + "port_range": "443" + }, + { + "type": "private", + "cidr": "10.0.0.1/32", + "port_range": "22", + "l4_protocol": "tcp" + } + ], + "policies": [{ "id": "", "precedence": 1 }], + "allow_authenticate_via_warp": true, + "session_duration": "24h" + } + ``` + + Each entry in `destinations` corresponds to a **Add private IP** or **Add private hostname** entry in the dashboard: + + - `hostname`: The private hostname of the application. You can use [wildcards](/cloudflare-one/access-controls/policies/app-paths/). + - `cidr`: The private IP or CIDR range of the application. Use `/32` for a single IPv4 address. + - `port_range`: A single port or a port range, for example `22` or `8000-8099`. If you omit this field, the destination matches all ports. + - `l4_protocol`: (Optional) `tcp` or `udp`. If you omit this field, the destination matches both. + - `vnet_id`: (Optional) The [virtual network](/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/tunnel-virtual-networks/) of the destination. + + The `allow_authenticate_via_warp` field corresponds to **Authenticate with Cloudflare One Client**. To limit identity providers, add `allowed_idps` and `auto_redirect_to_identity` as described in [Publish a self-hosted application](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/#1-add-your-application-to-access). + +3. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @private-app.json + ``` + + + + + Users can now connect to your private application after authenticating with Cloudflare Access. ## Authentication flow diff --git a/src/content/docs/cloudflare-one/access-controls/applications/non-http/short-lived-certificates-legacy.mdx b/src/content/docs/cloudflare-one/access-controls/applications/non-http/short-lived-certificates-legacy.mdx index 8ad2eb26f2b..093e35731ac 100644 --- a/src/content/docs/cloudflare-one/access-controls/applications/non-http/short-lived-certificates-legacy.mdx +++ b/src/content/docs/cloudflare-one/access-controls/applications/non-http/short-lived-certificates-legacy.mdx @@ -11,7 +11,7 @@ sidebar: label: Short-lived certificates (legacy) --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; :::note Not recommended for new deployments. We recommend using [Access for Infrastructure](/cloudflare-one/networks/connectors/cloudflare-tunnel/use-cases/ssh/ssh-infrastructure-access/) to configure short-lived certificates for SSH. @@ -40,6 +40,10 @@ Cloudflare Access will take the identity from a token and, using short-lived cer ## 3. Generate a short-lived certificate public key + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **SSH**. 2. Select **Add a certificate**. @@ -51,6 +55,31 @@ Cloudflare Access will take the identity from a token and, using short-lived cer 5. Select the short-lived certificate for your application. 6. Copy its **CA public key**. You can return to copy this public key at any time. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Find the ID of the Access application that represents your SSH server: + + ```sh + cf zero-trust access applications list --name "" + ``` + +2. Generate the certificate with [`cf zero-trust access applications short-lived-certificates create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-short-lived-certificates-create): + + ```sh + cf zero-trust access applications short-lived-certificates create + ``` + +3. Copy the `public_key` value in the output. To get it again later, run `cf zero-trust access applications short-lived-certificates get `. + + + + ## 4. Save your public key @@ -78,6 +107,12 @@ To save time, you can use the following cloudflared command to print the require cloudflared access ssh-config --hostname vm.example.com --short-lived-cert ``` +If you use the [Cloudflare CLI (`cf`)](/cf/), [`cf access ssh-config`](/cloudflare-one/access-controls/cli-commands/#cf-access-ssh-config) runs the same `cloudflared` command and prints the same configuration: + +```sh +cf access ssh-config --hostname vm.example.com --short-lived-cert +``` + If you prefer to configure manually, this is an example of the generated SSH config: ```txt diff --git a/src/content/docs/cloudflare-one/access-controls/authenticate-agents.mdx b/src/content/docs/cloudflare-one/access-controls/authenticate-agents.mdx index b7cf6ec9024..b5bde2fdb74 100644 --- a/src/content/docs/cloudflare-one/access-controls/authenticate-agents.mdx +++ b/src/content/docs/cloudflare-one/access-controls/authenticate-agents.mdx @@ -53,6 +53,8 @@ The token is valid for the session duration configured for the application. For more information, refer to [Connect through Access using a CLI](/cloudflare-one/tutorials/cli/) and [Client-side cloudflared](/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/). +If the [Cloudflare CLI (`cf`)](/cf/) is installed, your agent can also run [`cf access curl`](/cloudflare-one/access-controls/cli-commands/#cf-access-curl) and [`cf access token`](/cloudflare-one/access-controls/cli-commands/#cf-access-token), which run the equivalent `cloudflared access` commands. `cloudflared` must still be installed. + ## Use service tokens Service tokens are static credential pairs that authenticate requests without a browser login. Use them for automated workflows where no user is present. @@ -65,6 +67,15 @@ Service tokens are static credential pairs that authenticate requests without a | ------------ | --------- | ------------- | ---------------- | | Service Auth | Include | Service Token | Your agent token | + To create this policy with the [Cloudflare CLI (`cf`)](/cf/), pass the service token `id` (not the Client ID) to [`cf zero-trust access policies create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-create), then add the policy to the application: + + ```sh + cf zero-trust access policies create \ + --name "Agent token" \ + --decision non_identity \ + --include '[{"service_token":{"token_id":""}}]' + ``` + 3. Store the Client ID and Client Secret in a secure location on your machine that your agent can read. 4. Include both values as headers in requests to the protected resource: diff --git a/src/content/docs/cloudflare-one/access-controls/cli-commands.mdx b/src/content/docs/cloudflare-one/access-controls/cli-commands.mdx new file mode 100644 index 00000000000..6ed1a11afa5 --- /dev/null +++ b/src/content/docs/cloudflare-one/access-controls/cli-commands.mdx @@ -0,0 +1,129 @@ +--- +pcx_content_type: reference +title: Access CLI commands +description: Manage Access applications, policies, rule groups, service tokens, targets, and other Access resources from the command line using the Cloudflare CLI (cf). +sidebar: + order: 12 +products: + - cloudflare-one +--- + +import { CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust access` commands to manage Access applications, policies, rule groups, service tokens, infrastructure targets, custom pages, and other Access resources from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Read** permission (or **Access: Apps and Policies Write** to make changes). Service tokens require **Access: Service Tokens Write**, and infrastructure targets require **Zero Trust Write**. + +You can also use `cf access` commands on a user device to reach Access-protected applications from a terminal. For details, refer to [`access`](#access). + +:::note +`cf zero-trust access` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- `applications create` and `applications update` only accept `--body`. Pass the application as JSON, either inline or from a file with `--body @app.json`. Options that take JSON, such as `--include` on `policies create`, also accept `@path/to/file.json`. +- `update` commands replace the whole resource. Pass the current values of any fields that you want to keep. For example, `applications update` requires `type` and `destinations`, and `policies update` clears a policy's `session_duration` if you omit `--session-duration`. Use the matching `get` command to read the current values first. +- Hostnames in a public `destinations` entry of a self-hosted application must belong to a zone in your account. +- Infrastructure applications do not support reusable policies. Define their policies inline in the `policies` array of the application. +- Pass `-f` (`--force`) to `delete`, `revoke`, and `revoke-tokens` commands to skip the confirmation prompt in scripts, CI, or coding agents. +- Pass PEM certificates from a file, for example `--certificate @ca.pem`. A value that starts with `-----BEGIN` is parsed as an option name. + +::: + +## `zero-trust access applications` + +Create and manage [Access applications](/cloudflare-one/access-controls/applications/), including self-hosted, SaaS, infrastructure, and bookmark applications. Use `policy-tests` to [test policies](/cloudflare-one/access-controls/policies/policy-management/#test-your-policies) against your users, `revoke-tokens` to [revoke application sessions](/cloudflare-one/access-controls/access-settings/session-management/#per-application), and `short-lived-certificates` to manage [short-lived certificates](/cloudflare-one/access-controls/applications/non-http/short-lived-certificates-legacy/). + + + +## `zero-trust access policies` + +Create and manage reusable [Access policies](/cloudflare-one/access-controls/policies/). Pass rules as JSON arrays to `--include`, `--exclude`, and `--require`. To attach a policy to an application, add its ID to the application's `policies` array. + + + +## `zero-trust access rule-groups` + +Create and manage [rule groups](/cloudflare-one/access-controls/policies/groups/) (formerly Access groups) that you can reference from Access policies with `{"group": {"id": ""}}`. + + + +## `zero-trust access service-tokens` + +Create, refresh, and rotate [service tokens](/cloudflare-one/access-controls/service-credentials/service-tokens/). The client secret is only shown in the output of `create` and `rotate`. `service-tokens update` clears the token name if you omit `--name`. + + + +## `zero-trust access tags` + +Create and manage [Access tags](/cloudflare-one/reusable-components/tags/). To tag an application, add tag names to the application's `tags` array. + + + +## `zero-trust access custom-pages` + +Create and manage [Access custom pages](/cloudflare-one/reusable-components/custom-pages/access-custom-pages/). To assign a page to an application, add its `uid` to the application's `custom_pages` array. + + + +## `zero-trust access mtls-certificates` + +Manage root certificates for [mutual TLS authentication](/cloudflare-one/access-controls/service-credentials/mutual-tls-authentication/) and per-hostname mTLS settings. + + + +## `zero-trust access targets` + +Create and manage [infrastructure targets](/cloudflare-one/access-controls/applications/non-http/infrastructure-apps/) for Access for Infrastructure. + + + +## `zero-trust access infrastructure` + +Manage the [SSH certificate authority](/cloudflare-one/networks/connectors/cloudflare-tunnel/use-cases/ssh/ssh-infrastructure-access/) used by Access for Infrastructure, and the encryption settings for [SSH command logs](/cloudflare-one/insights/logs/dashboard-logs/ssh-command-logs/). + + + +## `zero-trust access users` + +List the users in your Zero Trust organization, review their active sessions and failed logins, and [revoke their sessions](/cloudflare-one/access-controls/access-settings/session-management/#per-user). + + + +## `zero-trust access user-populations` + +Create and manage user populations. + + + +## `zero-trust access logs` + +Query [Access authentication logs](/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs/), just-in-time access request logs, and SCIM provisioning logs. + + + +## `zero-trust access signing-keys` + +Get and rotate the keys that Access uses to sign [application tokens](/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/application-token/). Rotating keys affects every application in your account. + + + +## `zero-trust access saml-encryption-certificates` + +Get and rotate the certificates used to encrypt SAML assertions for [SaaS applications](/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-saml-saas/). + + + +## `zero-trust access mfa` + +List the authenticator models that you can allow for [independent MFA](/cloudflare-one/access-controls/access-settings/independent-mfa/). + + + +## `zero-trust organization` + +Get and update account-wide Access settings for your Zero Trust organization, such as the [global session duration](/cloudflare-one/access-controls/access-settings/session-management/#global-session-duration), [login page design](/cloudflare-one/reusable-components/custom-pages/access-login-page/), and default [block pages](/cloudflare-one/reusable-components/custom-pages/access-block-page/). `organization edit` sends only the settings you pass (`PATCH`), while `organization update` sends a full replacement (`PUT`). To change individual settings, use `organization edit`. These settings apply to your whole account. + + + +## `access` + +Reach Access-protected applications from a user device. These commands run [`cloudflared`](/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/), which must be installed on the device, and behave the same as the matching `cloudflared access` commands. For example, `cf access login` is equivalent to `cloudflared access login`. For usage, refer to [Client-side cloudflared](/cloudflare-one/access-controls/applications/non-http/cloudflared-authentication/) and [Connect through Access using a CLI](/cloudflare-one/tutorials/cli/). + + diff --git a/src/content/docs/cloudflare-one/access-controls/index.mdx b/src/content/docs/cloudflare-one/access-controls/index.mdx index 933b9866e36..59e68104a7e 100644 --- a/src/content/docs/cloudflare-one/access-controls/index.mdx +++ b/src/content/docs/cloudflare-one/access-controls/index.mdx @@ -14,6 +14,8 @@ Learn how to secure your self-hosted and SaaS applications with Zero Trust polic +You can also create and manage Access applications, policies, rule groups, service tokens, and targets with the [Cloudflare CLI (`cf`)](/cf/). To manage Access from a terminal, a script, or a coding agent, refer to [Access CLI commands](/cloudflare-one/access-controls/cli-commands/). + ## Troubleshooting For help resolving common issues with Cloudflare Access, refer to [Troubleshoot Access](/cloudflare-one/access-controls/troubleshooting/). diff --git a/src/content/docs/cloudflare-one/access-controls/policies/isolate-application.mdx b/src/content/docs/cloudflare-one/access-controls/policies/isolate-application.mdx index 959f9cf402d..9216b61ae38 100644 --- a/src/content/docs/cloudflare-one/access-controls/policies/isolate-application.mdx +++ b/src/content/docs/cloudflare-one/access-controls/policies/isolate-application.mdx @@ -8,7 +8,7 @@ sidebar: order: 4 --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; :::note @@ -23,8 +23,43 @@ With Access policies, you can require users to open self-hosted applications in ## Enable Browser Isolation + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + +:::note +`cf` does not yet support turning on **Allow users to open a remote browser without the device client** on its own. Turn on this setting in the dashboard, as described in steps 1 and 2 of the **Dashboard** tab. +::: + + +1. Get the current settings of the Allow policy that you want to isolate: + + ```sh + cf zero-trust access policies get + ``` + +2. Update the policy with [`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update). Pass `--isolation-required true` along with the policy's current name, decision, rules, and other settings, because the update replaces the whole policy: + + ```sh + cf zero-trust access policies update \ + --name "Isolated contractors" \ + --decision allow \ + --include '[{"email_domain":{"domain":"contractor.example.com"}}]' \ + --isolation-required true + ``` + + Isolation is not supported on policies that are attached to bookmark applications. + + + + + ## Policies for isolated applications Traffic to the isolated Access application is filtered by your Gateway [HTTP policies](/cloudflare-one/traffic-controls/http-policies/). Useful policies include: diff --git a/src/content/docs/cloudflare-one/access-controls/policies/mfa-requirements.mdx b/src/content/docs/cloudflare-one/access-controls/policies/mfa-requirements.mdx index a748e103837..609fe6abc9a 100644 --- a/src/content/docs/cloudflare-one/access-controls/policies/mfa-requirements.mdx +++ b/src/content/docs/cloudflare-one/access-controls/policies/mfa-requirements.mdx @@ -12,7 +12,14 @@ tags: - Authentication --- -import { GlossaryTooltip, Details, Render } from "~/components"; +import { + Details, + GlossaryTooltip, + Render, + Steps, + TabItem, + Tabs, +} from "~/components"; Cloudflare Access supports two methods of enforcing multi-factor authentication (MFA): @@ -34,6 +41,10 @@ IdP-based MFA enforcement is only available with the following identity provider To enforce an IdP MFA requirement on an application: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Find the application for which you want to enforce MFA and select **Edit**. Alternatively, [create a new application](/cloudflare-one/access-controls/applications/http-apps/). 3. Go to **Policies**. @@ -50,6 +61,33 @@ To enforce an IdP MFA requirement on an application: | Require | Authentication method | `mfa - multiple-factor authentication` | 6. Save the policy. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Get the current settings of the policy that contains the identity requirement: + + ```sh + cf zero-trust access policies get + ``` + +2. Update the policy with [`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update) and add an `auth_method` Require rule. Pass the policy's current name, decision, rules, and other settings, because the update replaces the whole policy: + + ```sh + cf zero-trust access policies update \ + --name "Allow employees with MFA" \ + --decision allow \ + --include '[{"email_domain":{"domain":"example.com"}}]' \ + --require '[{"auth_method":{"auth_method":"mfa"}}]' + ``` + + + + :::caution[Important] If the user fails to present the required MFA method, Cloudflare Access rejects the user, even if they successfully log in to the identity provider with an alternative method. @@ -97,6 +135,10 @@ Each application has three MFA options: To configure MFA for an application: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Find the application you want to configure and select **Edit**. 3. Scroll down to **Authentication** and select the **MFA** tab. @@ -105,6 +147,41 @@ To configure MFA for an application: - To set custom requirements, select **Custom MFA settings**, then configure the [allowed MFA methods](/cloudflare-one/access-controls/access-settings/independent-mfa/#supported-mfa-methods) and [authentication duration](#mfa-session-duration). - To exempt the application from MFA, select **Disable MFA**. 5. Select **Save**. + + + + + + +1. Save the application's current configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, set `mfa_config`: + + ```json title="app.json" + "mfa_config": { + "mfa_disabled": false, + "allowed_authenticators": ["security_key", "biometrics"], + "session_duration": "24h" + }, + ``` + + - To set custom requirements, set `mfa_disabled` to `false` and configure `allowed_authenticators` and `session_duration`. The authenticators must also be allowed in your [organization settings](/cloudflare-one/access-controls/access-settings/independent-mfa/). + - To exempt the application from MFA, set `mfa_disabled` to `true`. + - To inherit the organization setting, remove `mfa_config`. + +3. Update the application: + + ```sh + cf zero-trust access applications update --body @app.json + ``` + + + + To configure MFA for an infrastructure application, refer to [Infrastructure applications](#infrastructure-applications). @@ -112,6 +189,10 @@ To configure MFA for an infrastructure application, refer to [Infrastructure app Each policy has the same three MFA options described in [Configure independent MFA for an application](#configure-independent-mfa-for-an-application). Policy-level allowed authenticators and session durations override inherited values, but do not re-enable MFA when the application has **Disable MFA** selected. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Choose an **Allow** policy and select **Edit**. 3. Under **Multi-factor authentication (MFA)**, select an option: @@ -119,6 +200,29 @@ Each policy has the same three MFA options described in [Configure independent M - To set custom requirements for users who match this policy, select **Custom MFA settings**, then configure the [allowed MFA methods](/cloudflare-one/access-controls/access-settings/independent-mfa/#supported-mfa-methods) and [authentication duration](#mfa-session-duration). - To exempt users who match this policy from MFA, select **Disable MFA**. 4. Select **Save**. + + + + + +Update the policy with `cf zero-trust access policies update` and the `--mfa-config-*` options. Pass the policy's current name, decision, rules, and other settings, because the update replaces the whole policy: + +```sh +cf zero-trust access policies update \ + --name "Allow employees" \ + --decision allow \ + --include '[{"email_domain":{"domain":"example.com"}}]' \ + --mfa-config-allowed-authenticators security_key \ + --mfa-config-allowed-authenticators biometrics \ + --mfa-config-session-duration 12h +``` + +- To set custom requirements, pass `--mfa-config-allowed-authenticators` once for each allowed method, and `--mfa-config-session-duration`. The authenticators must also be allowed in your [organization settings](/cloudflare-one/access-controls/access-settings/independent-mfa/). +- To exempt users who match this policy from MFA, pass `--mfa-config-mfa-disabled true` instead. +- To inherit the application or organization setting, omit the `--mfa-config-*` options. + + + To configure MFA for an infrastructure application policy, refer to [Infrastructure applications](#infrastructure-applications). diff --git a/src/content/docs/cloudflare-one/access-controls/policies/policy-management.mdx b/src/content/docs/cloudflare-one/access-controls/policies/policy-management.mdx index 20826422275..d5e55ff20b8 100644 --- a/src/content/docs/cloudflare-one/access-controls/policies/policy-management.mdx +++ b/src/content/docs/cloudflare-one/access-controls/policies/policy-management.mdx @@ -10,7 +10,7 @@ tags: - REST API --- -import { Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; Access policies define the users who can log in to your Access applications. You can create, edit, or delete policies at any time and reuse policies across multiple applications. @@ -18,6 +18,10 @@ Access policies define the users who can log in to your Access applications. You To create a reusable Access policy: + + + + 1. In [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Select **Add a policy**. 3. Enter a **Policy name**. @@ -30,6 +34,35 @@ To create a reusable Access policy: - [Temporary authentication](/cloudflare-one/access-controls/policies/temporary-auth/) - [Independent MFA](/cloudflare-one/access-controls/policies/mfa-requirements/#independent-mfa) 8. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create the policy with [`cf zero-trust access policies create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-create): + + ```sh + cf zero-trust access policies create \ + --name "Allow employees" \ + --decision allow \ + --session-duration 24h \ + --include '[{"email_domain":{"domain":"example.com"}}]' \ + --require '[{"geo":{"country_code":"US"}}]' + ``` + + - `--decision`: The [action](/cloudflare-one/access-controls/policies/#actions) for the policy: `allow`, `deny` (**Block**), `bypass`, or `non_identity` (**Service Auth**). + - `--include`, `--exclude`, `--require`: The policy [rules](/cloudflare-one/access-controls/policies/#rule-types), each as a JSON array of [selectors](/cloudflare-one/access-controls/policies/#selectors). To read rules from a file, pass `@path/to/rules.json`. To find the JSON for a selector, build a rule in the dashboard and run `cf zero-trust access policies get `. + - `--session-duration`: The [policy session duration](/cloudflare-one/access-controls/access-settings/session-management/#policy-session-duration), for example `30m` or `24h`. + - (Optional) Additional settings: `--isolation-required` ([Isolate application](/cloudflare-one/access-controls/policies/isolate-application/)), `--purpose-justification-required` and `--purpose-justification-prompt` ([Purpose justification](/cloudflare-one/access-controls/policies/require-purpose-justification/)), `--approval-required` and `--approval-groups` ([Temporary authentication](/cloudflare-one/access-controls/policies/temporary-auth/)), and the `--mfa-config-*` options ([Independent MFA](/cloudflare-one/access-controls/policies/mfa-requirements/#independent-mfa)). + +2. Note the `id` in the output. To add the policy to an application, include the ID in the application's `policies` array, for example `"policies": [{ "id": "", "precedence": 1 }]`, and run `cf zero-trust access applications update`. + + + + You can now add this policy to an [Access application](/cloudflare-one/access-controls/applications/http-apps/). @@ -37,9 +70,40 @@ You can now add this policy to an [Access application](/cloudflare-one/access-co To make changes to an existing Access policy: + + + + 1. In [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Locate the policy you want to update and select **Edit**. 3. Once you have made the necessary changes, select **Save**. + + + + + +[`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update) replaces the whole policy. Options that you omit, such as `--session-duration`, are cleared. + + +1. Get the current settings of the policy: + + ```sh + cf zero-trust access policies get + ``` + +2. Update the policy with its current `name`, `decision`, rules, and other settings, along with your changes: + + ```sh + cf zero-trust access policies update \ + --name "Allow employees" \ + --decision allow \ + --session-duration 24h \ + --include '[{"email_domain":{"domain":"example.com"}}]' + ``` + + + + The updated policy is now in effect for all associated Access applications. @@ -47,10 +111,35 @@ The updated policy is now in effect for all associated Access applications. To delete a reusable Access policy: + + + + 1. In [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies** and locate the policy you want to delete. 2. If the policy is used by an application, remove the policy from all associated applications. 3. Select **Delete**. 4. A pop-up message will ask you to confirm your decision to delete the policy. Select **Delete**. + + + + + + +1. Check the `app_count` of the policy. If the value is greater than `0`, remove the policy from the `policies` array of each application that uses it: + + ```sh + cf zero-trust access policies get + ``` + +2. Delete the policy with [`cf zero-trust access policies delete`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-delete): + + ```sh + cf zero-trust access policies delete --force + ``` + + + + ## Test your policies @@ -64,9 +153,46 @@ The Access policy builder allows you to test your rules before saving any change To test an individual Access policy: + + + + 1. In [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Locate the policy you want to test and select **Edit**. 3. Go to **Policy tester** and select **Test policies**. + + + + + + +1. Start a policy test with [`cf zero-trust access applications policy-tests create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-policy-tests-create): + + ```sh + cf zero-trust access applications policy-tests create --body '{"policies":[""]}' + ``` + + To test changes before you save them, replace the policy ID with a full policy object, for example `{"policies":[{"decision":"allow","include":[{"email_domain":{"domain":"example.com"}}]}]}`. + +2. Note the `id` in the output and get the results: + + ```sh + cf zero-trust access applications policy-tests get + ``` + + The output includes the number and percentage of users who are approved or blocked. When `status` is `complete`, all users have been processed. + +3. (Optional) List the users who were approved or blocked: + + ```sh + cf zero-trust access applications policy-tests users list --policy-test-id --status fail + ``` + + Use `--status success` for approved users and `--status fail` for blocked users. + + + + The policy tester reports the percentage of active users who are allowed or denied access to an application based on this policy. You can expand the test results to view a list of allowed or blocked users. @@ -76,6 +202,10 @@ You can test your Access application policies against your user population befor To test if users have access to an application: + + + + 1. In [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Locate the application you want to test and select **Edit**. 3. Go to **Policies** > **Policy tester**. @@ -95,6 +225,31 @@ To test if users have access to an application: - Whether the user is allowed or denied access to this application based on all configured policies. - The user's identity from their most recent Access login attempt. - Whether the user matches individual Allow, Block, or Bypass policies. + + + + + + +1. Get the IDs of the policies on the application: + + ```sh + cf zero-trust access applications get + ``` + +2. Start a policy test with all of the policy IDs from the `policies` array: + + ```sh + cf zero-trust access applications policy-tests create --body '{"policies":["",""]}' + ``` + +3. Get the results with `cf zero-trust access applications policy-tests get `, as described in [Test a single policy](#test-a-single-policy). + + +`cf` does not yet support testing a single user against an application. Use the dashboard. + + + ## Legacy policies @@ -111,11 +266,30 @@ To migrate legacy policies to reusable policies: ### Convert a legacy policy -You can use the API to convert a legacy policy into a reusable policy. To convert a legacy policy, make a `PUT` request with an empty request body: +You can use `cf` or the API to convert a legacy policy into a reusable policy. + + + + +Run [`cf zero-trust access applications policies make-reusable`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-policies-make-reusable) with the ID of the legacy policy and its application: + +```sh +cf zero-trust access applications policies make-reusable --app-id +``` + +Infrastructure applications do not support reusable policies, so you cannot convert their policies. + + + + +To convert a legacy policy, make a `PUT` request with an empty request body: + + + The policy is now removed from the applications endpoint (`/access/apps/$APP_ID/policies`) and managed using the [reusable policies endpoints](/api/resources/zero_trust/subresources/access/subresources/policies/)(`/access/policies/$POLICY_ID`). diff --git a/src/content/docs/cloudflare-one/access-controls/policies/require-purpose-justification.mdx b/src/content/docs/cloudflare-one/access-controls/policies/require-purpose-justification.mdx index 9ac3272c7f7..8f97a0aa31e 100644 --- a/src/content/docs/cloudflare-one/access-controls/policies/require-purpose-justification.mdx +++ b/src/content/docs/cloudflare-one/access-controls/policies/require-purpose-justification.mdx @@ -12,12 +12,18 @@ head: --- +import { Steps, TabItem, Tabs } from "~/components"; + Cloudflare Access allows security and IT teams to present users with a purpose justification screen directly after they log in to an Access application. This allows organizations to audit not only for who is accessing their resources, but also for why they are requesting access. The purpose justification screen will show for any new sessions of an application. For example, if an Access application has a session time of eight hours, a user will see the purpose justification screen once every eight hours. Configuring a purpose justification screen is done as part of configuring an Access policy. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Choose an application and select **Edit**. 3. Go to **Policies**. @@ -25,6 +31,36 @@ Configuring a purpose justification screen is done as part of configuring an Acc 5. Under **Additional settings**, turn on **Purpose justification**. 6. (Optional) Set a custom purpose justification message. This will appear on the purpose justification screen and will be visible to the user. 7. Save the policy. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Get the current settings of the Allow policy: + + ```sh + cf zero-trust access policies get + ``` + +2. Update the policy with [`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update). Pass the policy's current name, decision, rules, and other settings, because the update replaces the whole policy: + + ```sh + cf zero-trust access policies update \ + --name "Allow employees" \ + --decision allow \ + --include '[{"email_domain":{"domain":"example.com"}}]' \ + --purpose-justification-required true \ + --purpose-justification-prompt "Describe why you need access to this application." + ``` + + `--purpose-justification-prompt` is optional and sets the custom message on the purpose justification screen. + + + + Users who match this policy will see the following screen: diff --git a/src/content/docs/cloudflare-one/access-controls/policies/temporary-auth.mdx b/src/content/docs/cloudflare-one/access-controls/policies/temporary-auth.mdx index 15de6840eb3..6db9cc70a0f 100644 --- a/src/content/docs/cloudflare-one/access-controls/policies/temporary-auth.mdx +++ b/src/content/docs/cloudflare-one/access-controls/policies/temporary-auth.mdx @@ -10,12 +10,16 @@ tags: - Authentication --- -import { CURL } from "~/components"; +import { CURL, Steps, TabItem, Tabs } from "~/components"; With Cloudflare Access, you can require that users obtain approval before they can access a specific self-hosted application or SaaS application. The administrator will receive an email notification to approve or deny the request. Unlike a typical Allow policy, the user will have to request access at the end of each session. This allows you to define the users who should have persistent access and those who must request temporary access. ## Set up temporary authentication + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Choose a **Self-hosted** or **SaaS** application and select **Edit**. 3. Choose an **Allow** policy and select **Edit**. @@ -26,6 +30,40 @@ With Cloudflare Access, you can require that users obtain approval before they c Your approvers must be authenticated by Access. If they do not have an active session, Access will verify their identity against your [App Launcher Access policy](/cloudflare-one/access-controls/access-settings/app-launcher/). ::: 7. Save the policy. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Get the current settings of the Allow policy: + + ```sh + cf zero-trust access policies get + ``` + +2. Update the policy with [`cf zero-trust access policies update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-update). Pass the policy's current name, decision, rules, and other settings, because the update replaces the whole policy: + + ```sh + cf zero-trust access policies update \ + --name "Temporary access" \ + --decision allow \ + --include '[{"email_domain":{"domain":"example.com"}}]' \ + --purpose-justification-required true \ + --approval-required true \ + --approval-groups '[{"approvals_needed":1,"email_addresses":["approver@example.com"]}]' + ``` + + - `--approval-required`: Corresponds to **Temporary authentication**. Requires `--purpose-justification-required true`. + - `--approval-groups`: The **Email addresses of the approvers**, and how many approvals are needed. + + The policy cannot be attached to a bookmark application. + + + + Temporary authentication is now enabled for users who match this policy. You can optionally add a second **Allow** policy for users who should have persistent access. Be sure the policy order is set to allow persistent users through. @@ -42,7 +80,9 @@ Approvers will receive a request similar to the example below. The approver can Temporary authentication requests have separate logs from Access authentication events. The just-in-time (JIT) request logs include the requester, application, purpose justification, request status, expiration time, approval count, and approver email addresses. -To list requests across your account, send a `GET` request to the JIT request logs endpoint. You can filter the results by `status`, `search`, `since`, and `until`, and use `page` and `per_page` for pagination. Valid status values are `PENDING`, `APPROVED`, `DENIED`, and `CANCELED`. +To list requests across your account with `cf`, run [`cf zero-trust access logs jit-requests list`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-logs-jit-requests-list), for example `cf zero-trust access logs jit-requests list --status APPROVED --page 1 --per-page 25`. To review one request, run `cf zero-trust access logs jit-requests get `. + +To list requests across your account with the API, send a `GET` request to the JIT request logs endpoint. You can filter the results by `status`, `search`, `since`, and `until`, and use `page` and `per_page` for pagination. Valid status values are `PENDING`, `APPROVED`, `DENIED`, and `CANCELED`. + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **Mutual TLS**. 2. Select **Add mTLS Certificate**. 3. Enter any name for the root CA. @@ -84,6 +95,54 @@ The mTLS certificate is used only to verify the client certificate. It does not 11. Select the application you would like to enforce mTLS on and select **Edit**. The application must be included in the **Associated hostnames** list from Step 5. 12. In the **Policies** tab, add your mTLS policy. 13. Save the application. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Mutual TLS Certificates Edit** and **Access: Apps and Policies Write** permissions. + + +1. Save your root CA, or the entire CA chain if client certificates are signed by an intermediate certificate, to a file such as `ca-chain.pem`. Do not include any SSL/TLS server certificates. + +2. Upload the certificate with [`cf zero-trust access mtls-certificates create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-mtls-certificates-create): + + ```sh + cf zero-trust access mtls-certificates create \ + --name "Example root CA" \ + --certificate @ca-chain.pem \ + --associated-hostnames app.example.com + ``` + + - `--certificate`: The certificate content. Pass the file with `@`. A value that starts with `-----BEGIN` is parsed as an option name. + - `--associated-hostnames`: The fully-qualified domain names (FQDN) of the applications that will use this certificate. Each hostname must belong to a domain in your Cloudflare account. To add more than one hostname, repeat the option. + +3. Create an Access policy that uses the **Valid Certificate** (`certificate`) or **Common Name** (`common_name`) selector. If this is for a client who does not need to log in through an IdP, set `--decision` to `non_identity` (**Service Auth**): + + ```sh + cf zero-trust access policies create \ + --name "mTLS clients" \ + --decision non_identity \ + --include '[{"common_name":{"common_name":"John Doe"}}]' + ``` + + To allow any client certificate that can authenticate with the root CA, use `--include '[{"certificate":{}}]'`. + +4. Save the configuration of the application that you want to enforce mTLS on. The application hostname must be in the certificate's associated hostnames: + + ```sh + cf zero-trust access applications get > app.json + ``` + +5. In `app.json`, add `{"id": ""}` to the `policies` array, then update the application: + + ```sh + cf zero-trust access applications update --body @app.json + ``` + + + + You can now authenticate to the application using a client certificate. For instructions on how to present a client certificate, refer to [Test mTLS](#test-mtls). diff --git a/src/content/docs/cloudflare-one/access-controls/service-credentials/service-tokens.mdx b/src/content/docs/cloudflare-one/access-controls/service-credentials/service-tokens.mdx index 8f00c5affd4..3cbe7fdfd3f 100644 --- a/src/content/docs/cloudflare-one/access-controls/service-credentials/service-tokens.mdx +++ b/src/content/docs/cloudflare-one/access-controls/service-credentials/service-tokens.mdx @@ -63,6 +63,18 @@ Each service token supports up to five tags, with one value per key. Keys and va You can also add tags when you [create a service token](#create-a-service-token). Editing only the tags does not rotate the Client Secret or change the expiration date. + + +Update the token's tags with [`cf zero-trust access service-tokens update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-service-tokens-update). Include the token's existing name, otherwise the name is cleared: + +```sh +cf zero-trust access service-tokens update \ + --name "CI/CD token" \ + --tags '{"environment":"production","team":"payments"}' +``` + +`--tags` replaces the token's entire tag set. Include every tag you want to keep, or pass `--tags '{}'` to remove all tags. To find the token ID, run `cf zero-trust access service-tokens list`. + Include a `tags` object when you [create a service token](/api/resources/zero_trust/subresources/access/subresources/service_tokens/methods/create/) or [update a service token](/api/resources/zero_trust/subresources/access/subresources/service_tokens/methods/update/). When updating, include the token's existing `name` to preserve it. For example: @@ -117,6 +129,15 @@ The equivalent API policy configuration is: } ``` +To create this policy with `cf`, run: + +```sh +cf zero-trust access policies create \ + --name "Production service tokens" \ + --decision non_identity \ + --include '[{"service_token_tag":{"key":"environment","value":"production"}}]' +``` + Each rule matches one exact, case-sensitive key-value pair. Key-only matches and wildcards are not supported. The client must still present a valid Client ID and Client Secret; a tag does not make an expired or disabled token valid. You can use this selector in **Include**, **Require**, or **Exclude** rules. Policies that use the selector must use the **Service Auth** action. To require multiple tags, use the [Require rule type](/cloudflare-one/access-controls/policies/#require); multiple Include rules are combined with OR. @@ -147,6 +168,36 @@ You can configure a self-hosted Access application to accept a service token in To authenticate using a single header: + + + +1. Save your existing Access application configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, add the name of the header you want to use for service token authentication: + + ```json title="app.json" + "read_service_tokens_from_header": "Authorization", + ``` + +3. Update the application with the edited file: + + ```sh + cf zero-trust access applications update --body @app.json + ``` + +4. Add the header to any HTTP request. For example, + + ```sh + curl -H "Authorization: {\"cf-access-client-id\": \"\", \"cf-access-client-secret\": \"\"}" https://app.example.com + ``` + + + + 1. Get your existing Access application configuration: \", \"cf-access-client-secret\": \"\"}" https://app.example.com ``` + + ## Strict service token authentication Strict service token authentication is a Zero Trust organization setting that applies consistent behavior to requests made with service tokens. When the setting is on, Access handles requests with service token headers as follows: @@ -200,6 +253,18 @@ Organizations created before `2026-10-05` can turn this setting on or off. To turn off strict service token authentication, turn off the setting and select **Disable**. + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Turn on the setting with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit): + +```sh +cf zero-trust organization edit --strict-service-token-auth true +``` + +To turn off strict service token authentication, pass `--strict-service-token-auth false`. + Send a `PATCH` request to the [Update your Zero Trust organization](/api/resources/zero_trust/subresources/organizations/methods/update/) endpoint: @@ -238,6 +303,17 @@ For a token [reported as leaked](#recover-a-leaked-service-token), the previous 5. Copy the new Client Secret and update your services before the grace period ends. + + +Rotate the secret with [`cf zero-trust access service-tokens rotate`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-service-tokens-rotate). Set `--previous-client-secret-expires-at` to an RFC 3339 timestamp when the previous secret should expire: + +```sh +cf zero-trust access service-tokens rotate \ + --previous-client-secret-expires-at 2030-01-01T00:00:00Z +``` + +To revoke the previous secret immediately, omit `--previous-client-secret-expires-at`. Copy the new `client_secret` in the output and update your services before the grace period ends. To change the grace period after you rotate, run `cf zero-trust access service-tokens update` with `--name` and a new `--previous-client-secret-expires-at`. + Make a `POST` request to the [Rotate a service token](/api/resources/zero_trust/subresources/access/subresources/service_tokens/methods/rotate/) endpoint. Set `previous_client_secret_expires_at` to an RFC 3339 timestamp when the previous secret should expire: @@ -286,6 +362,7 @@ Refreshing a service token resets its expiration to the current time plus its co + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **Service Tokens**. 2. Locate the token you want to renew. 3. To renew using the current duration, select the token's refresh action. @@ -293,6 +370,23 @@ Refreshing a service token resets its expiration to the current time plus its co 1. Select **Edit**. 2. Choose a new **Service Token Duration**. 3. Select **Save**. Access resets the expiration relative to the time of the update. + + + + +To renew using the token's configured duration, run [`cf zero-trust access service-tokens refresh`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-service-tokens-refresh): + +```sh +cf zero-trust access service-tokens refresh +``` + +To change the duration and reset the expiration, update the token with the new `--duration`. Include the token's existing name, otherwise the name is cleared: + +```sh +cf zero-trust access service-tokens update \ + --name "CI/CD token" \ + --duration 17520h +``` @@ -356,6 +450,19 @@ You can set the inactivity period to a whole number from 30 to 365 days. Disable 5. Select **Save**. + + +Turn on automatic cleanup with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit). Set `--service-token-inactivity-action` to `disable` or `delete`: + +```sh +cf zero-trust organization edit \ + --service-token-inactivity-enabled true \ + --service-token-inactivity-inactivity-threshold-days 90 \ + --service-token-inactivity-action disable +``` + +To stop automatic cleanup, pass `--service-token-inactivity-enabled false`. + Send a `PATCH` request to update your Zero Trust organization. Set `action` to `disable` or `delete`: @@ -397,6 +504,18 @@ Turning off a token also stops its previous secret from working during an active 4. To restore authentication, select **Enable token** > **Enable**. + + +Update the token with `--enabled false` to turn it off. Include the token's existing name, otherwise the name is cleared: + +```sh +cf zero-trust access service-tokens update \ + --name "CI/CD token" \ + --enabled false +``` + +To turn the token on again, pass `--enabled true`. + Make a `PUT` request to the [Update a service token](/api/resources/zero_trust/subresources/access/subresources/service_tokens/methods/update/) endpoint. Set `enabled` to `false` to turn off the token: @@ -420,8 +539,18 @@ If you need to revoke access before the token expires, delete the token. Service + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **Service Tokens**. 2. **Delete** the token you need to revoke. + + + + +Delete the token with [`cf zero-trust access service-tokens delete`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-service-tokens-delete): + +```sh +cf zero-trust access service-tokens delete --force +``` diff --git a/src/content/docs/cloudflare-one/api-terraform.mdx b/src/content/docs/cloudflare-one/api-terraform.mdx index 941275a8ff6..cf3998c1dd0 100644 --- a/src/content/docs/cloudflare-one/api-terraform.mdx +++ b/src/content/docs/cloudflare-one/api-terraform.mdx @@ -11,6 +11,8 @@ tags: - REST API --- +import { Steps, TabItem, Tabs } from "~/components"; + You can manage your Cloudflare Zero Trust configuration using the API or Terraform. For more information, refer to the following links: - [API reference](/api/) @@ -19,14 +21,39 @@ You can manage your Cloudflare Zero Trust configuration using the API or Terrafo Detailed API and Terraform examples for Cloudflare Zero Trust are available in our [implementation guides](/cloudflare-one/implementation-guides/) and throughout the Cloudflare Zero Trust documentation. +You can also manage many Cloudflare Zero Trust resources from a terminal, a script, or a coding agent with the [Cloudflare CLI (`cf`)](/cf/). `cf` commands call the Cloudflare API, so they use the same API tokens and permissions. + ## Set dashboard to read-only Super Administrators can lock all settings as read-only in the Cloudflare One dashboard. Read-only mode ensures that all updates for the account are made through the API or Terraform. To enable read-only mode: + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Settings** > **Admin controls**. 2. Enable **Set dashboard to read-only**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Turn on read-only mode with `cf zero-trust organization edit`: + +```sh +cf zero-trust organization edit \ + --is-ui-read-only true \ + --ui-read-only-toggle-reason "Configuration is managed with Terraform" +``` + +`--ui-read-only-toggle-reason` describes why you changed the setting. To turn off read-only mode, run the same command with `--is-ui-read-only false`. + + + All users, regardless of [user permissions](/cloudflare-one/roles-permissions/), will be prevented from making configuration changes through the UI. diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/casb-dlp.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/casb-dlp.mdx index 9a2fac5bd88..61b5f2afd84 100644 --- a/src/content/docs/cloudflare-one/cloud-and-saas-findings/casb-dlp.mdx +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/casb-dlp.mdx @@ -10,7 +10,7 @@ tags: - Compliance --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; :::note Requires Cloudflare CASB and Cloudflare DLP. @@ -56,10 +56,40 @@ CASB will scan every publicly accessible file in the integration for text that m ### Modify an existing integration + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Cloud & SaaS**. 2. Choose a [supported integration](#supported-integrations) and select **Configure**. 3. Under **DLP profiles**, select the profiles that you want the integration to scan for. 4. Select **Save integration**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Write** permission. + + +1. Find the ID of the integration: + + ```sh + cf zero-trust casb integrations list + ``` + +2. Set the DLP profiles to scan for with [`cf zero-trust casb integrations update`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-integrations-update): + + ```sh + cf zero-trust casb integrations update \ + --dlp-profiles + ``` + + Pass the ID of every DLP profile that you want the integration to scan for. To find profile IDs, run `cf zero-trust dlp profiles list`. + + + + If you enable a DLP profile from the **Manage integrations** page, CASB will only scan publicly accessible files that have had a modification event since enabling the DLP profile. Modification events include changes to the following attributes: diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/cli-commands.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/cli-commands.mdx new file mode 100644 index 00000000000..49b8711f8de --- /dev/null +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/cli-commands.mdx @@ -0,0 +1,84 @@ +--- +pcx_content_type: reference +title: CASB CLI commands +description: Manage CASB integrations, findings, custom finding types, policies, webhooks, and remediations from the command line using the Cloudflare CLI (cf). +sidebar: + order: 6 +products: + - cloudflare-one +--- + +import { CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust casb` commands to manage Cloud and SaaS integrations, review and act on findings, create custom finding types, and configure CASB policies, webhooks, and remediations from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Read** permission (or **CASB Write** to make changes). + +:::note +`cf zero-trust casb` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- Options that take a list of objects, such as `--actions-webhook-configs` and `--headers`, accept inline JSON or `@path/to/file.json`. String options such as `--expression` also accept `@path/to/file`. +- `finding-types update`, `policies update`, and `webhooks update` replace the whole object. Pass every value you want to keep. Omitted optional values, such as a policy `--description`, are cleared. +- Some commands take an ID as an option instead of a positional argument, for example `findings instances list --finding-id `, `finding-types remediation-types list --finding-type-id `, and `applications auth-methods list --application-id `. +- List commands write pagination metadata to standard error as a `result_info:` line. For details, refer to [Paginate results](/cf/get-started/resources/#paginate-results). +- Pass `-f` (`--force`) to `delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. + +::: + +## `zero-trust casb applications` + +List the SaaS applications and cloud environments that CASB can integrate with. `applications auth-methods list` returns each authentication method and the JSON schema of the credentials that `integrations create` expects. + + + +## `zero-trust casb integrations` + +Create and manage [Cloud and SaaS integrations](/cloudflare-one/integrations/cloud-and-saas/). Integrations that use OAuth require you to authorize access in the dashboard. `integrations pause` stops all scans for an integration, and `integrations resume` restarts them. + + + +## `zero-trust casb findings` + +List [posture findings](/cloudflare-one/cloud-and-saas-findings/manage-findings/#posture-findings) and their instances, ignore findings, hide (archive) instances, change severity, and export findings. + + + +## `zero-trust casb content` + +List and export [content findings](/cloudflare-one/cloud-and-saas-findings/manage-findings/#content-findings) detected by DLP. + + + +## `zero-trust casb finding-types` + +List standard and custom finding types, and create, validate, update, and delete [custom finding types](/cloudflare-one/cloud-and-saas-findings/custom-finding-types/). `finding-types validate` takes the same options as `finding-types create` and returns `valid` and a list of `errors` without creating the finding type. + + + +## `zero-trust casb asset-schemas` + +List the asset vendors and asset classes available to your account, and get the fields of an asset class for use in custom finding type expressions. + + + +## `zero-trust casb policies` + +Create and manage [remediation policies](/cloudflare-one/cloud-and-saas-findings/policies/) that act on new finding instances automatically. + + + +## `zero-trust casb webhooks` + +Create and manage [CASB webhooks](/cloudflare-one/integrations/cloud-and-saas/webhooks/), test delivery, and send finding instances to webhooks. + + + +## `zero-trust casb remediations` + +Run [remediations](/cloudflare-one/cloud-and-saas-findings/manage-findings/#remediate-findings) on finding instances and review remediation jobs. + + + +## `zero-trust casb exports` + +Check the status of findings and content exports. + + diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/custom-finding-types.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/custom-finding-types.mdx index 73d8ebc712d..952f980b9a7 100644 --- a/src/content/docs/cloudflare-one/cloud-and-saas-findings/custom-finding-types.mdx +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/custom-finding-types.mdx @@ -203,6 +203,62 @@ When you create a custom finding type with the API or Terraform, you provide the 8. Select **Create finding type**. + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Write** permission. + + +1. Find the asset vendor and asset class to evaluate: + + ```sh + cf zero-trust casb asset-schemas list + ``` + + To list the fields of an asset class, run `cf zero-trust casb asset-schemas get `. + +2. Save the Rego expression to a file. Do not include a package declaration or import statements: + + ```txt title="disabled-user.rego" + default result := "pass" + + result := "fail" if { + input.asset.isEnabled == false + } + ``` + +3. Validate the finding type with [`cf zero-trust casb finding-types validate`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-finding-types-validate): + + ```sh + cf zero-trust casb finding-types validate \ + --name "Disabled Microsoft user" \ + --description "Detects Microsoft users whose account is disabled" \ + --severity Medium \ + --asset-vendor MICROSOFT \ + --asset-class MicrosoftUser \ + --expression @disabled-user.rego \ + --applies-to-all-integrations true + ``` + + The output shows `"valid": true` if the expression compiles. Otherwise, `errors` lists each problem with its line and column. Like **Validate** in the dashboard, this does not run the expression against asset data. + +4. Create the finding type with [`cf zero-trust casb finding-types create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-finding-types-create), using the same options: + + ```sh + cf zero-trust casb finding-types create \ + --name "Disabled Microsoft user" \ + --description "Detects Microsoft users whose account is disabled" \ + --severity Medium \ + --asset-vendor MICROSOFT \ + --asset-class MicrosoftUser \ + --expression @disabled-user.rego \ + --applies-to-all-integrations true + ``` + + To limit the finding type to specific integrations, set `--applies-to-all-integrations false` and add `--integration-ids `. + +5. Note the `id` in the output. You need it to edit or delete the finding type, or to use it in a [CASB policy](/cloudflare-one/cloud-and-saas-findings/policies/). + + 1. (Optional) Check the finding type before you create it. Make a `POST` request to the [Validate a custom finding type](/api/resources/zero_trust/subresources/casb/subresources/posture/subresources/finding_types/methods/validate/) endpoint with the same body you will use to create it. The response lists any errors in the Rego expression or the request. Like **Validate** in the dashboard, it does not run the expression against asset data. @@ -280,6 +336,9 @@ CASB applies the custom finding type when it receives future asset updates withi To confirm that a custom finding type is detecting matches, check its finding instances. + + + 1. In **Cloud & SaaS findings**, go to **Posture Findings**. 2. Find the custom finding type. @@ -287,6 +346,20 @@ To confirm that a custom finding type is detecting matches, check its finding in 4. Select **Manage** to view the matching assets. + + + +List the findings for the custom finding type, and review the instance count of each: + +```sh +cf zero-trust casb findings list --finding-type-ids +``` + +To view the matching assets, run `cf zero-trust casb findings instances list --finding-id `. + + + + :::note CASB evaluates assets only when it receives asset creations or updates. Assets that have not changed since the finding type was created are not evaluated, so they do not appear in **Instances**. ::: @@ -351,6 +424,9 @@ The original "Sensitive group open to outsiders" keeps running unchanged. For th #### Steps + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Finding types library**. 2. In the finding type menu, select **Duplicate**. @@ -362,6 +438,24 @@ The original "Sensitive group open to outsiders" keeps running unchanged. For th The duplicate finding type is a separate custom finding type. Changes to the duplicate do not affect the original finding type. + + + + +1. Get the finding type that you want to copy, and note its `severity`, `asset_vendor`, `asset_class`, `expression`, and integration scope: + + ```sh + cf zero-trust casb finding-types get + ``` + +2. Save the `expression` to a file, for example `copy.rego`, and change it as needed. + +3. Validate and create the copy with `cf zero-trust casb finding-types validate` and `cf zero-trust casb finding-types create`, as in [Create a custom finding type](#create-a-custom-finding-type). Use a new `--name`. + + + + + ### Edit a custom finding type Only the following fields can be edited after a custom finding type is created: @@ -384,6 +478,19 @@ To change the provider, asset class, or Rego expression, [duplicate the finding 4. Select **Save**. + + +Run [`cf zero-trust casb finding-types update`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-finding-types-update). `--applies-to-all-integrations` is required. You can also update `--name`, `--description`, `--severity`, and `--integration-ids`: + +```sh +cf zero-trust casb finding-types update \ + --name "Disabled Microsoft user" \ + --description "Detects disabled Microsoft users in the finance tenant" \ + --severity High \ + --applies-to-all-integrations false \ + --integration-ids +``` + Make a `PUT` request to the [Update a finding type](/api/resources/zero_trust/subresources/casb/subresources/posture/subresources/finding_types/methods/update/) endpoint. `applies_to_all_integrations` is required. You can also update `name`, `description`, `severity`, and `integration_ids`: @@ -419,6 +526,16 @@ Changing `asset_vendor`, `asset_class`, or `expression` replaces the custom find 3. Confirm the deletion. + + +Run [`cf zero-trust casb finding-types delete`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-finding-types-delete): + +```sh +cf zero-trust casb finding-types delete +``` + +If a CASB policy uses the finding type, the command fails with a `409 Conflict` error. [Delete the policy](/cloudflare-one/cloud-and-saas-findings/policies/#edit-turn-off-or-delete-a-policy) first. + Make a `DELETE` request to the [Delete a finding type](/api/resources/zero_trust/subresources/casb/subresources/posture/subresources/finding_types/methods/delete/) endpoint: diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/index.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/index.mdx index d221d8cd09b..32e02e52d74 100644 --- a/src/content/docs/cloudflare-one/cloud-and-saas-findings/index.mdx +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/index.mdx @@ -44,3 +44,12 @@ To review detected findings and their affected assets, refer to [Manage findings ## Manage CASB integrations + +### Manage integrations with the CLI + +You can also manage integrations, findings, custom finding types, policies, and webhooks with the [Cloudflare CLI (`cf`)](/cf/). For all commands, refer to [CASB CLI commands](/cloudflare-one/cloud-and-saas-findings/cli-commands/). + +To find the ID of an integration, run [`cf zero-trust casb integrations list`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-integrations-list). Then: + +- To pause an integration, run `cf zero-trust casb integrations pause `. To resume scanning, run `cf zero-trust casb integrations resume `. +- To delete an integration, run `cf zero-trust casb integrations delete `. Deleting an integration removes all keys and OAuth data, and you cannot restore it. diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/manage-findings.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/manage-findings.mdx index e8448311b01..4e18e30d91f 100644 --- a/src/content/docs/cloudflare-one/cloud-and-saas-findings/manage-findings.mdx +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/manage-findings.mdx @@ -26,11 +26,48 @@ Cloudflare CASB detects security issues involving users, stored files, and appli Posture findings include misconfigurations, unauthorized user activity, and other data security issues. Each finding summarizes one finding type within one integration. Its finding instances identify the affected assets. The same finding type can appear in separate rows for different integrations. + + + To view details about the posture findings that CASB found: + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Choose **SaaS** or **Cloud**. 3. To view details about a finding, select the finding name. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Read** permission. + + +1. List your posture findings with [`cf zero-trust casb findings list`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-findings-list): + + ```sh + cf zero-trust casb findings list --type Posture --product Saas + ``` + + Use `--product Cloud` for cloud findings. To filter the list, add options such as `--severity High`, `--vendor GOOGLE_WORKSPACE`, `--integration-id `, or `--ignored true`. Note the `id` of the finding. + +2. Get the details of the finding: + + ```sh + cf zero-trust casb findings get + ``` + +3. List the instances of the finding, one for each affected asset: + + ```sh + cf zero-trust casb findings instances list --finding-id + ``` + + To list hidden instances, add `--archived true`. + + + + Cloud & SaaS findings will display details about your posture finding, including the finding type, [severity level](#severity-levels), number of instances, associated integration, current status, and date detected. For more information on each instance of the finding, select **Manage**. @@ -63,11 +100,32 @@ The new severity level will only apply to the posture finding within this specif Content findings identify potential data exposure detected by [Data Loss Prevention (DLP)](/cloudflare-one/data-loss-prevention/). Each content finding represents one asset within an integration and groups all matching DLP profiles for that asset. + + + To view details about the content findings that CASB found: + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Content Findings**. 2. Choose **SaaS** or **Cloud**. 3. To view details about a finding, select the finding name. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Read** permission. + +List your content findings with [`cf zero-trust casb content list`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-content-list): + +```sh +cf zero-trust casb content list +``` + +To filter the list, add options such as `--vendor MICROSOFT`, `--integration-id `, `--dlp-profile-id `, or `--search ""`. + + + Cloud & SaaS findings will display details about your content finding, including the file name, a link to the file, matching DLP profiles, associated integration, and date detected. @@ -105,27 +163,83 @@ After reviewing your findings, you may decide that certain posture findings are ### Ignore a finding + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Locate the active finding you want to hide. 3. In the three-dot menu, select **Move to ignore**. + The finding's status will change from **Active** to **Ignored**. CASB will continue to scan for these findings and report detections. You can change ignored findings back to **Active** with the same process at any time. + + + + +1. Find the `id` of the finding with `cf zero-trust casb findings list --ignored false`. + +2. Ignore the finding with [`cf zero-trust casb findings ignore`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-findings-ignore): + + ```sh + cf zero-trust casb findings ignore --checks + ``` + + To ignore several findings, list each ID after `--checks`. + + +To move ignored findings back to **Active**, run `cf zero-trust casb findings unignore --checks `. + + + + ### Hide an instance of a finding + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Choose the active finding you want to hide, then select **Manage**. 3. In **Active**, find the instance you want to hide. 4. In the three-dot menu, select **Move to hidden**. + The instance will be moved from **Active** to **Hidden** within the finding. If CASB detects the same issue for that asset again, it appears in the **Hidden** tab. You can move hidden instances back to the **Active** tab at any time. + + + + +1. Find the `id` of the instance: + + ```sh + cf zero-trust casb findings instances list --finding-id + ``` + +2. Hide the instance with [`cf zero-trust casb findings instances archive`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-findings-instances-archive): + + ```sh + cf zero-trust casb findings instances archive --check-instances + ``` + + +To move hidden instances back to **Active**, run `cf zero-trust casb findings instances unarchive --check-instances `. + + + + ## Send webhook After you configure one or more [CASB webhooks](/cloudflare-one/integrations/cloud-and-saas/webhooks/), you can send posture finding instances to external systems such as chat platforms, ticketing systems, SIEMs, SOAR tools, and custom automation services. CASB webhooks currently support posture finding instances only. + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Choose **SaaS** or **Cloud**. 3. Choose the finding you want to review, then select **Manage**. @@ -133,6 +247,27 @@ CASB webhooks currently support posture finding instances only. 5. In the instance details panel, select **Send webhook**. 6. Choose the webhook destination or destinations you want to use. 7. Select **Send webhooks**. + + + + + + +1. Find the `id` of the instance with `cf zero-trust casb findings instances list --finding-id `, and the `id` of each webhook with `cf zero-trust casb webhooks list`. + +2. Send the instance with [`cf zero-trust casb webhooks jobs create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-jobs-create): + + ```sh + cf zero-trust casb webhooks jobs create \ + --webhook-ids \ + --finding-instance-ids + ``` + + CASB creates one job for each combination of webhook and instance, up to 100 jobs per request. + + + + Cloudflare queues webhook sends in the background. A success message means that Cloudflare accepted the request for delivery. @@ -156,12 +291,45 @@ CASB can now remediate instances of supported finding types directly. ### Remediate a finding + + + To remediate a finding instance: + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Choose a finding whose type supports remediation, then select **Manage**. 3. In **Active Instances**, select an instance. 4. In **Remediation details**, choose a remediation action to take. + + + + + + +1. Find the `id` of the instance with `cf zero-trust casb findings instances list --finding-id `. + +2. List the remediation actions available for the finding type, and note the `id` of the action to take: + + ```sh + cf zero-trust casb finding-types remediation-types list --finding-type-id + ``` + + An empty list means that the finding type does not support remediation. + +3. Remediate the instance with [`cf zero-trust casb remediations jobs create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-remediations-jobs-create): + + ```sh + cf zero-trust casb remediations jobs create \ + --remediation-type-id \ + --finding-instance-ids + ``` + + +To check the status of remediation jobs, run `cf zero-trust casb remediations jobs list`. + + + CASB will begin remediating the instance. diff --git a/src/content/docs/cloudflare-one/cloud-and-saas-findings/policies.mdx b/src/content/docs/cloudflare-one/cloud-and-saas-findings/policies.mdx index 176402a6360..f78007e8999 100644 --- a/src/content/docs/cloudflare-one/cloud-and-saas-findings/policies.mdx +++ b/src/content/docs/cloudflare-one/cloud-and-saas-findings/policies.mdx @@ -45,6 +45,7 @@ When you create a policy with the API or Terraform, you reference other objects + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Policies**. 2. Select **Create a policy**. 3. Under **Basic information**, enter a **Policy name**. Optionally, enter a **Description**. @@ -56,6 +57,40 @@ When you create a policy with the API or Terraform, you reference other objects - **Send webhooks** to send a notification to one or more webhook destinations. 8. Under **Status**, turn on **Enable policy**. 9. Select **Create policy**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Write** permission. + + +1. Find the [IDs for the policy](#find-the-ids-for-a-policy): + + ```sh + cf zero-trust casb finding-types list --search "" + cf zero-trust casb finding-types remediation-types list --finding-type-id + cf zero-trust casb webhooks list + ``` + +2. Create the policy with [`cf zero-trust casb policies create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-policies-create): + + ```sh + cf zero-trust casb policies create \ + --display-name "Auto-remediate public files" \ + --description "Remove public access and notify the SIEM" \ + --enabled true \ + --applies-to-all-integrations true \ + --finding-type-id \ + --actions-remediation-types '[{"remediation_type_id":""}]' \ + --actions-webhook-configs '[{"webhook_config_id":""}]' + ``` + + - `--applies-to-all-integrations`: Set to `false` and add `--integration-ids ` to limit the policy to specific integrations. Required. + - `--actions-remediation-types`: **Run Remediation**. A policy can include at most one remediation. + - `--actions-webhook-configs`: **Send webhooks**. + + A policy must include at least one action. To create the policy turned off, set `--enabled false`. + @@ -175,15 +210,48 @@ When a policy sends a webhook, the payload uses the same format as a webhook sen + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Policies**. 2. Select the policy to update. 3. Modify the policy's basic information, trigger, or actions. 4. Select **Save changes**. + To turn a policy on or off, use the **Enable policy** toggle under **Status**. Each policy displays its status as **Enabled** or **Disabled** in the policy list. A disabled policy stops matching new finding instances until you turn it on again. To delete a policy, open the policy and select **Delete**. + + +[`cf zero-trust casb policies update`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-policies-update) replaces the whole policy, so you must pass the policy's current settings along with your changes. + + +1. Get the current settings of the policy: + + ```sh + cf zero-trust casb policies get + ``` + +2. Update the policy with the same `display_name`, `description`, `applies_to_all_integrations`, and actions. For example, to turn the policy off: + + ```sh + cf zero-trust casb policies update \ + --display-name "Auto-remediate public files" \ + --description "Remove public access and notify the SIEM" \ + --enabled false \ + --applies-to-all-integrations true \ + --actions-webhook-configs '[{"webhook_config_id":""}]' + ``` + + If you omit `--description`, the description is cleared. You cannot change a policy's finding type. + + +To delete a policy, run [`cf zero-trust casb policies delete`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-policies-delete): + +```sh +cf zero-trust casb policies delete +``` + To update a policy, make a `PUT` request to the [Update a policy](/api/resources/zero_trust/subresources/casb/subresources/posture/subresources/policies/methods/update/) endpoint. Include `display_name`, `enabled`, `applies_to_all_integrations`, and `actions`. The request replaces the existing policy, so include every action you want to keep. To turn the policy off, set `enabled` to `false`: diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/cli-commands.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/cli-commands.mdx new file mode 100644 index 00000000000..428db3818b9 --- /dev/null +++ b/src/content/docs/cloudflare-one/cloud-workload-security/cli-commands.mdx @@ -0,0 +1,80 @@ +--- +pcx_content_type: reference +title: Cloud workload security CLI commands +description: Manage Cloud Workload Security workloads, policies, deployments, and policy reference resources from the command line using the Cloudflare CLI (cf). +sidebar: + order: 7.5 +products: + - cloud-workload-security +--- + +import { CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust cws` commands to manage Cloud Workload Security (CWS) workloads, policies, policy sets, deployments, domain ACLs, Basic Auth credentials, and policy reference resources from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Read** permission (or **Cloud Workload Security Write** to make changes). + +:::note +`cf zero-trust cws` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- `update` commands replace the whole resource. Pass every required value, such as a policy's `--name`, `--filter`, `--entrypoint`, and `--rego-source`, along with your changes. +- String options such as `--rego-source` accept `@path/to/file`, so you can keep Rego source in a file. Options that take a list of objects, such as `--policies` and `--entries`, accept inline JSON or `@path/to/file.json`. +- `deployments create` and `deployments update` require `--basic-auth-credential-ids`. To attach no credentials, pass the option without a value. +- `rego-metadata create` and `rego-metadata update` do not have an option for the JSON data. Pass the data with `--body`. +- `basic-auth-credentials secrets create` takes the credential ID as a positional argument, but `secrets list`, `secrets get`, and `secrets delete` take it as `--credential-id`. +- `tenant-structures nodes create` takes the structure ID as a positional argument, but the other `tenant-structures nodes` commands take it as `--structure-id`. `nodes bulk-apply` requires `--creates`, `--updates`, and `--deletes`. Pass `'[]'` for operations you do not need. +- Pass `-f` (`--force`) to `delete` and `bulk-apply` commands to skip the confirmation prompt in scripts, CI, or coding agents. + +::: + +## `zero-trust cws workloads` + +Create and manage [workloads](/cloudflare-one/cloud-workload-security/guides/configure-policies/#create-a-workload), reusable filters that select groups of requests. + + + +## `zero-trust cws policies` + +Create and manage [policies](/cloudflare-one/cloud-workload-security/guides/configure-policies/#create-a-policy) that combine a request filter with a Rego check. + + + +## `zero-trust cws policy-sets` + +Create and manage [policy sets](/cloudflare-one/cloud-workload-security/guides/configure-policies/#create-a-policy-set) that group policies and define their workload scope. + + + +## `zero-trust cws deployments` + +Create and manage [deployments](/cloudflare-one/cloud-workload-security/get-started/#create-a-deployment), the configuration that a CWS proxy loads. + + + +## `zero-trust cws domain-acls` + +Create and manage [domain ACLs](/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope/#create-a-domain-acl) that control which destinations a deployment can reach. + + + +## `zero-trust cws basic-auth-credentials` + +Create [Basic Auth credentials](/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope/#create-a-basic-auth-credential) for clients that use the proxy, and add, list, and delete their password secrets. + + + +## `zero-trust cws rego-modules` + +Create and manage [Rego modules](/cloudflare-one/cloud-workload-security/guides/policy-reference/#create-a-rego-module) that hold reusable library code. + + + +## `zero-trust cws rego-metadata` + +Create and manage [Rego metadata](/cloudflare-one/cloud-workload-security/guides/policy-reference/#create-rego-metadata), shared JSON values that policies can read. + + + +## `zero-trust cws tenant-structures` + +Create and manage [tenant structures](/cloudflare-one/cloud-workload-security/guides/policy-reference/#create-a-tenant-structure) and their nodes. + + diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/get-started/index.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/get-started/index.mdx index 50ba734812f..9ef1c010e00 100644 --- a/src/content/docs/cloudflare-one/cloud-workload-security/get-started/index.mdx +++ b/src/content/docs/cloudflare-one/cloud-workload-security/get-started/index.mdx @@ -69,6 +69,9 @@ Your account must have a [Zero Trust subscription](/cloudflare-one/setup/#2-crea 2. ### Create the guardrail policy + + + In the Cloudflare dashboard, select your account and go to **Cloud Workload Security** > **Policies**. @@ -93,8 +96,41 @@ Your account must have a [Zero Trust subscription](/cloudflare-one/setup/#2-crea Select **Add policy** to save it. + + + + Save the Rego source to a file named `cf-r2-no-public-access.rego`: + + ```txt title="cf-r2-no-public-access.rego" + package policy.cf_r2_no_public_access + + default valid := false + + valid if { + input.http.request.body.enabled == false + } + ``` + + The policy permits the selected operation only when the request turns off public access. Create the policy with [`cf zero-trust cws policies create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-policies-create): + + ```sh + cf zero-trust cws policies create \ + --name restrict-r2-public-access \ + --filter 'application.name == "Cloudflare" and application.service == "r2" and application.operation == "r2-put-bucket-public-policy"' \ + --rego-source @cf-r2-no-public-access.rego \ + --entrypoint valid + ``` + + Note the `id` in the output. + + + + 3. ### Create a policy set + + + Go to **Cloud Workload Security** > **Policy sets**. @@ -103,8 +139,27 @@ Your account must have a [Zero Trust subscription](/cloudflare-one/setup/#2-crea Turn on **Enforce** for the policy. Leave **Workloads** empty for this walkthrough, then select **Add policy set**. + + + + Create the policy set with [`cf zero-trust cws policy-sets create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-policy-sets-create). Replace `` with the `id` of the policy, and set `enforce` to `true` to turn on **Enforce**: + + ```sh + cf zero-trust cws policy-sets create \ + --name r2-private-buckets \ + --policies '[{"policy_id":"","enforce":true}]' + ``` + + Note the `id` in the output. + + + + 4. ### Create a deployment + + + Go to **Cloud Workload Security** > **Deployments**. @@ -113,6 +168,26 @@ Your account must have a [Zero Trust subscription](/cloudflare-one/setup/#2-crea In **Deployment settings**, choose *Default allow* for **Default mode**. This permits requests outside the guardrail's filter. Select **Add deployment** to save it. + + + + Create the deployment with [`cf zero-trust cws deployments create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-deployments-create). Replace `` with the `id` of the policy set: + + ```sh + cf zero-trust cws deployments create \ + --name cws-r2-test \ + --policy-set-ids \ + --default-mode ALLOW \ + --basic-auth-credential-ids + ``` + + `--default-mode ALLOW` corresponds to *Default allow*. `--basic-auth-credential-ids` is required. Pass it without a value to attach no credentials. + + The `id` in the output is the deployment ID. + + + + Open the deployment and copy its **ID**. Also copy your [Cloudflare Account ID](/fundamentals/account/find-account-and-zone-ids/). 5. ### Create the proxy API token diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/guides/configure-policies.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/guides/configure-policies.mdx index 3f8f3880e82..fbfc6262cab 100644 --- a/src/content/docs/cloudflare-one/cloud-workload-security/guides/configure-policies.mdx +++ b/src/content/docs/cloudflare-one/cloud-workload-security/guides/configure-policies.mdx @@ -8,7 +8,7 @@ sidebar: order: 1 --- -import { DashButton, Steps } from "~/components"; +import { DashButton, Steps, TabItem, Tabs } from "~/components"; Use workloads to select requests and policies to check them. Group policies in a policy set, then attach that set to a deployment. @@ -20,6 +20,9 @@ A workload is a reusable request filter. For example, you can group requests to Use separate workloads to [target security profiles for production and non-production environments](/cloudflare-one/cloud-workload-security/#target-security-profiles-with-workloads). Include each workload in the policy set for that environment. + + + 1. In the Cloudflare dashboard, select your account and go to **Cloud Workload Security** > **Workloads**. @@ -38,12 +41,38 @@ Use separate workloads to [target security profiles for production and non-produ 4. Select **Add workload** to save the workload. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Write** permission. + + +1. Create the workload with [`cf zero-trust cws workloads create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-workloads-create): + + ```sh + cf zero-trust cws workloads create \ + --name "cloudflare-api" \ + --filter 'application.name == "Cloudflare"' + ``` + + - `--filter`: The Wirefilter expression that selects requests. + - `--description`: (Optional) A description of the workload. + +2. Note the `id` in the output. You need it to include or exclude the workload in a policy set. + + + + + ## Create a policy Both **Filters** and **Rego source** are required. A policy filter selects the requests that run its Rego check. The Rego source must declare a package under `policy.` and a Boolean rule named `valid`. + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Policies**. @@ -74,10 +103,49 @@ A policy filter selects the requests that run its Rego check. The Rego source mu 5. Select **Add policy** to save the policy. Correct any filter or Rego errors before continuing. + + + + +1. Save the Rego source to a file: + + ```txt title="r2-read-only.rego" + package policy.r2_read_only + + default valid := false + + valid if { + input.http.request.method == "GET" + } + ``` + +2. Create the policy with [`cf zero-trust cws policies create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-policies-create): + + ```sh + cf zero-trust cws policies create \ + --name "r2-read-only" \ + --filter 'application.name == "Cloudflare" and application.service == "r2"' \ + --rego-source @r2-read-only.rego \ + --entrypoint valid + ``` + + - `--filter`: The Wirefilter expression that selects the requests that run the Rego check. + - `--rego-source`: The Rego source, or `@` followed by the path to a file. + - `--entrypoint`: The rule that determines whether a request passes. Use `valid`. Required. + +3. Note the `id` in the output. You need it to add the policy to a policy set. + + + + + ## Create a policy set A policy set groups policies and their workload scope. A request must match an included workload and must not match an excluded workload. Without included workloads, the set has no inclusion restriction. + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Policy sets**. @@ -96,8 +164,44 @@ A policy set groups policies and their workload scope. A request must match an i The policy filter still applies within the policy set's workload scope. A workload match does not bypass a policy filter. + + + + +1. Create a JSON file that lists the policies and whether each one is enforced: + + ```json title="policies.json" + [ + { "policy_id": "", "enforce": true }, + { "policy_id": "", "enforce": false } + ] + ``` + + `enforce` corresponds to **Enforce**. Set it to `false` to evaluate the policy without blocking on its result. + +2. Create the policy set with [`cf zero-trust cws policy-sets create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-policy-sets-create): + + ```sh + cf zero-trust cws policy-sets create \ + --name "r2-guardrails" \ + --policies @policies.json \ + --include-workload-ids + ``` + + - `--include-workload-ids`: (Optional) The workloads to include. If you omit this option, the set has no inclusion restriction. + - `--exclude-workload-ids`: (Optional) The workloads to exclude. + +3. Note the `id` in the output. You need it to attach the policy set to a deployment. + + + + + ## Attach the set to a deployment + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Deployments** and open the deployment. @@ -110,6 +214,38 @@ The policy filter still applies within the policy set's workload scope. A worklo 4. Select **Save**. Allow a configuration refresh interval before testing through the proxy. + + + +[`cf zero-trust cws deployments update`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-deployments-update) replaces the whole deployment, so you must pass its current settings along with your changes. + + +1. Get the current settings of the deployment: + + ```sh + cf zero-trust cws deployments get + ``` + +2. Update the deployment with the same `name`, `basic_auth_credential_ids`, `domain_acl_id`, `on_error_action`, and `rego_raise_error` values, and list every policy set to attach in `--policy-set-ids`: + + ```sh + cf zero-trust cws deployments update \ + --name "cws-r2-test" \ + --policy-set-ids \ + --default-mode ALLOW \ + --basic-auth-credential-ids + ``` + + - `--default-mode`: **Default mode**. `ALLOW` permits requests outside every policy's request scope. `BLOCK` blocks them. + - `--basic-auth-credential-ids`: Required. List the IDs of the Basic Auth credentials to keep, or pass the option without a value for none. + - `--domain-acl-id`: (Optional) The domain ACL to keep attached. + +3. Allow a configuration refresh interval before testing through the proxy. + + + + + ### Default mode and enforcement A policy matches when its policy set's workload scope and its filter both match. The deployment default mode applies when no policy matches. A `false` Rego result is a failed check, not an unmatched request. diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope.mdx index bf4605b825d..07fd155ef4b 100644 --- a/src/content/docs/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope.mdx +++ b/src/content/docs/cloudflare-one/cloud-workload-security/guides/manage-traffic-scope.mdx @@ -8,7 +8,7 @@ sidebar: order: 2 --- -import { DashButton, Steps } from "~/components"; +import { DashButton, Steps, TabItem, Tabs } from "~/components"; Domain access control lists (ACLs) control which destinations a deployment can reach. Use the Basic Auth page to manage credentials and their secrets. To understand how these controls relate to request policies, refer to [Request Validation](/cloudflare-one/cloud-workload-security/concepts/request-validation/). @@ -18,6 +18,9 @@ You need access to manage Cloud Workload Security in your account. A domain ACL contains domain-specific actions and a default action. The default action applies when no domain entry matches. + + + 1. In the Cloudflare dashboard, select your account and go to **Cloud Workload Security** > **Traffic scope** > **Domain ACLs**. @@ -32,10 +35,37 @@ A domain ACL contains domain-specific actions and a default action. The default 5. Select **Add a domain ACL** to save the list. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Write** permission. + + +1. Create the domain ACL with [`cf zero-trust cws domain-acls create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-domain-acls-create): + + ```sh + cf zero-trust cws domain-acls create \ + --name "block-example-api" \ + --default-action ALLOW \ + --entries '[{"domain":"api.example.com","action":"BLOCK"}]' + ``` + + - `--default-action`: **Default action**. `ALLOW` or `BLOCK`. + - `--entries`: **Domains**. Each entry has a `domain` and an `action` of `ALLOW` or `BLOCK`. Each domain can appear only once. Required. + +2. Note the `id` in the output. You need it to attach the domain ACL to a deployment. + + + + + Use `example.com` for an exact domain match. Use `.example.com` to match the parent domain and its subdomains. ## Attach a domain ACL + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Deployments** and open the deployment. @@ -46,6 +76,37 @@ Use `example.com` for an exact domain match. Use `.example.com` to match the par 3. After the proxy refreshes its configuration, test an allowed destination and a blocked destination through it. + + + +[`cf zero-trust cws deployments update`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-deployments-update) replaces the whole deployment, so you must pass its current settings along with your changes. + + +1. Get the current settings of the deployment: + + ```sh + cf zero-trust cws deployments get + ``` + +2. Update the deployment with the same `name`, `policy_set_ids`, `default_mode`, `basic_auth_credential_ids`, `on_error_action`, and `rego_raise_error` values, and set `--domain-acl-id`: + + ```sh + cf zero-trust cws deployments update \ + --name "cws-r2-test" \ + --policy-set-ids \ + --default-mode ALLOW \ + --basic-auth-credential-ids \ + --domain-acl-id + ``` + + To detach the domain ACL, omit `--domain-acl-id`. + +3. After the proxy refreshes its configuration, test an allowed destination and a blocked destination through it. + + + + + An ACL allow decision permits the connection. CWS policies can still block API requests on that connection. To detach the list, select **None** in **Domain ACL** and select **Save**. Detach an ACL from its deployments before deleting it. @@ -54,6 +115,9 @@ To detach the list, select **None** in **Domain ACL** and select **Save**. Detac Basic Auth credentials are separate from the Cloudflare API token used in your proxy configuration. + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Traffic scope** > **Credentials** > **Basic Auth**. @@ -66,12 +130,44 @@ Basic Auth credentials are separate from the Cloudflare API token used in your p 4. In the dialog, select **Add a secret**, then select **Create credential** to save the credential and its initial secret. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Write** permission. + + +1. Create the credential with [`cf zero-trust cws basic-auth-credentials create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-basic-auth-credentials-create): + + ```sh + cf zero-trust cws basic-auth-credentials create --username ci-runner + ``` + + Use printable characters without spaces or colons. Note the `id` in the output. + +2. Add the initial secret with [`cf zero-trust cws basic-auth-credentials secrets create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-basic-auth-credentials-secrets-create): + + ```sh + cf zero-trust cws basic-auth-credentials secrets create \ + --password "" \ + --expires-at 2027-01-01T00:00:00Z + ``` + + - `--password`: The password, up to 72 bytes. The password is stored as a one-way hash and is never returned. + - `--expires-at`: (Optional) **Expiration**, as an RFC 3339 timestamp. + + + + + The username is read-only after creation. Open the credential to manage its secrets. ## Rotate a secret Use this procedure for a credential your clients already use. + + + 1. In **Basic Auth**, open the credential. @@ -82,4 +178,33 @@ Use this procedure for a credential your clients already use. 4. For the old secret, select **Delete** and confirm the deletion. + + + + +1. Add a new secret to the credential: + + ```sh + cf zero-trust cws basic-auth-credentials secrets create \ + --password "" + ``` + +2. Allow the deployment configuration to refresh before updating clients to use the new password. Verify requests from those clients before deleting the old secret. + +3. Find the `id` of the old secret: + + ```sh + cf zero-trust cws basic-auth-credentials secrets list --credential-id + ``` + +4. Delete the old secret with [`cf zero-trust cws basic-auth-credentials secrets delete`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-basic-auth-credentials-secrets-delete): + + ```sh + cf zero-trust cws basic-auth-credentials secrets delete --credential-id + ``` + + + + + The secret list displays creation and expiration information. It does not display stored passwords. diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/guides/policy-reference.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/guides/policy-reference.mdx index f7510406172..b0ca4b64a4b 100644 --- a/src/content/docs/cloudflare-one/cloud-workload-security/guides/policy-reference.mdx +++ b/src/content/docs/cloudflare-one/cloud-workload-security/guides/policy-reference.mdx @@ -9,7 +9,7 @@ sidebar: order: 3 --- -import { DashButton, Steps } from "~/components"; +import { DashButton, Steps, TabItem, Tabs } from "~/components"; Use **Policy reference** resources to share code and data between policies. You need access to manage Cloud Workload Security in your account. @@ -17,6 +17,9 @@ Use **Policy reference** resources to share code and data between policies. You Rego modules hold reusable library code under `lib.`. Write each policy's `policy.` package and `valid` rule in the policy editor. + + + 1. In the Cloudflare dashboard, select your account and go to **Cloud Workload Security** > **Policy reference** > **Rego modules**. @@ -39,6 +42,36 @@ Rego modules hold reusable library code under `lib.`. Write each policy's `polic 4. Select **Add Rego module** to save the module. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Write** permission. + + +1. Save the library code to a file: + + ```txt title="bucket-rules.rego" + package lib.bucket_rules + + private if { + input.http.request.body.enabled == false + } + ``` + +2. Create the module with [`cf zero-trust cws rego-modules create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-rego-modules-create): + + ```sh + cf zero-trust cws rego-modules create \ + --name "bucket-rules" \ + --rego-source @bucket-rules.rego + ``` + + CWS derives the package path from the source. + + + + + To call the library from a policy, import it and reference its rule: ```txt title="Policy source" @@ -59,6 +92,9 @@ The policy also requires a filter to select the intended operation. Refer to [Co Metadata stores reusable JSON values. An import path such as `metadata.bucket_rules` exposes the value as `data.metadata.bucket_rules` in Rego. + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Policy reference** > **Rego metadata**. @@ -77,12 +113,43 @@ Metadata stores reusable JSON values. An import path such as `metadata.bucket_ru 4. Select **Add Rego metadata** to save the value. + + + +`cf zero-trust cws rego-metadata create` does not have an option for the JSON data, so pass the whole request in `--body`: + + +1. Create a JSON file with the name, import path, and data: + + ```json title="bucket-rules-metadata.json" + { + "name": "bucket-rules", + "import_path": "metadata.bucket_rules", + "data": { + "require_private_buckets": true + } + } + ``` + +2. Create the metadata with [`cf zero-trust cws rego-metadata create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-rego-metadata-create): + + ```sh + cf zero-trust cws rego-metadata create --body @bucket-rules-metadata.json + ``` + + + + + For this example, a policy can read `data.metadata.bucket_rules.require_private_buckets`. Update the metadata to change the shared value without editing each policy. ## Create a tenant structure Tenant structures describe an AWS or Cloudflare resource hierarchy. An optional **Package path** exposes the hierarchy to Rego, such as `data.tenant.aws.production`. + + + 1. In the Cloudflare dashboard, go to **Cloud Workload Security** > **Policy reference** > **Tenant structures**. @@ -97,6 +164,54 @@ Tenant structures describe an AWS or Cloudflare resource hierarchy. An optional 5. Select **Add tenant structure** to save the structure and nodes. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Workload Security Write** permission. + + +1. Create the tenant structure with [`cf zero-trust cws tenant-structures create`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-tenant-structures-create): + + ```sh + cf zero-trust cws tenant-structures create \ + --name "production" \ + --application aws \ + --import-path tenant.aws.production + ``` + + - `--application`: **Application**. `aws` or `cloudflare`. You cannot change it after creation. + - `--import-path`: (Optional) **Package path**, in the format `tenant..`. + + Note the `id` in the output. + +2. Create a JSON file with the nodes. Unlike the dashboard import format, `cf` takes an array, and each node includes its `native_id`: + + ```json title="nodes.json" + [ + { "native_id": "r-example", "node_kind": "root", "name": "Example organization" }, + { + "native_id": "123456789012", + "node_kind": "account", + "name": "Production account", + "parent": "r-example" + } + ] + ``` + +3. Add the nodes with [`cf zero-trust cws tenant-structures nodes bulk-apply`](/cloudflare-one/cloud-workload-security/cli-commands/#cf-zero-trust-cws-tenant-structures-nodes-bulk-apply). Pass empty arrays for `--updates` and `--deletes`: + + ```sh + cf zero-trust cws tenant-structures nodes bulk-apply \ + --structure-id \ + --creates @nodes.json \ + --updates '[]' \ + --deletes '[]' + ``` + + + + + ### Node import format Use a JSON object keyed by each node's native resource ID. Each value contains `node_kind`, an optional `name`, and `parent` for a child node. Do not add a `native_id` field inside the value. diff --git a/src/content/docs/cloudflare-one/cloud-workload-security/index.mdx b/src/content/docs/cloudflare-one/cloud-workload-security/index.mdx index d1473bc2bb8..07ea7b19c70 100644 --- a/src/content/docs/cloudflare-one/cloud-workload-security/index.mdx +++ b/src/content/docs/cloudflare-one/cloud-workload-security/index.mdx @@ -106,5 +106,6 @@ Include the matching workload in each policy set. Attach both policy sets to the - [Manage policy reference resources](/cloudflare-one/cloud-workload-security/guides/policy-reference/) to reuse Rego code, metadata, and cloud hierarchies. - [Proxy configuration](/cloudflare-one/cloud-workload-security/configuration/) to choose authentication, connection, and caching settings. - [Troubleshooting](/cloudflare-one/cloud-workload-security/troubleshooting/) to diagnose proxy, client, and policy issues. +- [Cloud workload security CLI commands](/cloudflare-one/cloud-workload-security/cli-commands/) to manage CWS resources from a terminal, a script, or a coding agent with the [Cloudflare CLI (`cf`)](/cf/). For availability, supported cloud providers, proxy deployment options, and connection requirements, refer to [Platform](/cloudflare-one/cloud-workload-security/platform/). diff --git a/src/content/docs/cloudflare-one/email-security/cli-commands.mdx b/src/content/docs/cloudflare-one/email-security/cli-commands.mdx new file mode 100644 index 00000000000..eee5b59b22f --- /dev/null +++ b/src/content/docs/cloudflare-one/email-security/cli-commands.mdx @@ -0,0 +1,103 @@ +--- +pcx_content_type: reference +title: Email security CLI commands +description: Manage Email security policies, settings, investigations, and submissions from the command line using the Cloudflare CLI (cf). +sidebar: + order: 18 +products: + - cloudflare-one +--- + +import { CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf email-security` commands to manage allow policies, blocked senders, trusted domains, and other Email security settings, investigate and act on messages, and submit messages for reclassification from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission (or **Cloud Email Security: Write** to make changes). + +:::note +`cf email-security` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- Your account must have Email security onboarded. Otherwise, commands return a `404 Not Found` error. +- `create` commands require every boolean option that the dashboard shows as a toggle, such as `--is-regex`. Pass `true` or `false` explicitly. +- `edit` commands update only the options you pass. `update` commands replace the whole entry, so pass every required value. +- `--expires-at` takes an RFC 3339 timestamp in the future, for example `2027-12-31T23:59:59Z`. In `cf` 1.0.0-rc.7, `--expires-at null` sends the string `"null"` instead of clearing the expiration. To clear an expiration, pass `--body '{"expires_at": null}'`. +- Use `bulk-apply` to create, update, or delete many entries in one request, for example to replace a CSV upload in the dashboard. `bulk-apply` requires `--posts`, `--patches`, `--puts`, and `--deletes`. Pass `'[]'` for operations you do not need. Pass `-f` (`--force`) to `bulk-apply` and `delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. +- List commands return JSON. `cf` does not export entries to CSV. + +::: + +## `email-security allow-policies` + +Create and manage [allow policies](/cloudflare-one/email-security/policies/inbound/allow-policies/) that exempt messages from detections. Use `--is-trusted-sender`, `--is-exempt-recipient`, or `--is-acceptable-sender` to choose the action. + + + +## `email-security block-senders` + +Manage [blocked senders](/cloudflare-one/email-security/policies/inbound/blocked-senders/) whose messages always receive a malicious disposition. + + + +## `email-security trusted-domains` + +Manage [trusted domains](/cloudflare-one/email-security/policies/inbound/trusted-domains/) that are exempt from lookalike (`--is-similarity`) and new domain (`--is-recent`) detections. + + + +## `email-security content-policies` + +Manage [blocked content](/cloudflare-one/email-security/policies/inbound/blocked-content/) policies that match a regular expression in the subject (`SUBJECT`), body (`BODY`), or both. + + + +## `email-security sending-domain-restrictions` + +Manage [partner domain TLS](/cloudflare-one/email-security/policies/inbound/partner-domain-tls/) entries that require TLS for mail from specific domains. + + + +## `email-security url-ignore-patterns` + +Manage [URL rewrite ignore patterns](/cloudflare-one/email-security/settings/detection-settings/configure-link-actions/#add-patterns-for-urls) for link actions. + + + +## `email-security impersonation-registry` + +Manage users in the [impersonation registry](/cloudflare-one/email-security/settings/detection-settings/impersonation-registry/). Entries synced from an integrated directory cannot be edited or deleted with these commands. + + + +## `email-security domains` + +List and configure the [domains](/cloudflare-one/email-security/setup/manage-domains/) that Email security protects, and check domain verification status. + + + +## `email-security investigate` + +[Search messages](/cloudflare-one/email-security/investigation/search-email/), get message details, detections, raw content, mail trace, and action logs, and move or release specific messages. + + + +## `email-security bulk-actions` + +Move or release every message that matches a search in one background job, and track or cancel the job. `--search-params-detections-only` defaults to `true`, so jobs only match messages with a detection unless you pass `--search-params-detections-only false`. Run `cf email-security investigate list` with the same search options first to review which messages match. + + + +## `email-security submissions` + +[Submit messages for reclassification](/cloudflare-one/email-security/submissions/#submit-messages-for-review) or report missed detections, and list team and user submissions. To reclassify a message as clean, set `expected_disposition` to `NONE`. + + + +## `email-security phishguard` + +List reports from the [PhishGuard](/cloudflare-one/email-security/phishguard/) team. + + + +## `email-security analytics` + +Get an aggregated monthly report of detections, dispositions, and policy activity for the trailing 12 months. + + diff --git a/src/content/docs/cloudflare-one/email-security/index.mdx b/src/content/docs/cloudflare-one/email-security/index.mdx index 74ee042dee9..3dbcc72106e 100644 --- a/src/content/docs/cloudflare-one/email-security/index.mdx +++ b/src/content/docs/cloudflare-one/email-security/index.mdx @@ -42,6 +42,8 @@ To access the Email security overview: 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Go to **Email security** > **Overview**. +You can also manage policies and settings, investigate messages, and submit messages for reclassification with the [Cloudflare CLI (`cf`)](/cf/). To manage Email security from a terminal, a script, or a coding agent, refer to [Email security CLI commands](/cloudflare-one/email-security/cli-commands/). + --- ## Troubleshooting diff --git a/src/content/docs/cloudflare-one/email-security/investigation/search-email.mdx b/src/content/docs/cloudflare-one/email-security/investigation/search-email.mdx index 36c8c9dcbba..f9b7c92188c 100644 --- a/src/content/docs/cloudflare-one/email-security/investigation/search-email.mdx +++ b/src/content/docs/cloudflare-one/email-security/investigation/search-email.mdx @@ -8,18 +8,52 @@ sidebar: order: 1 --- +import { Steps, TabItem, Tabs } from "~/components"; + With Email security, you can use different screen criteria to search through your email, reclassify and move a certain volume of messages, find similar emails, and export messages. ## Screen criteria Email security allows you to use popular, regular, and advanced screening criteria to search through your inbox. Advanced screening will give you the most in-depth investigation of your inbox. + + + To screen through your email traffic: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Investigation**, then **Run new screen**. 4. Choose between **Popular**, **Regular**, and **Advanced** screen methods. Refer to the explanation below to learn what each method does. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission. + +To search messages, run [`cf email-security investigate list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-investigate-list) with the criteria you want to match. For example, to find malicious messages from the last seven days: + +```sh +cf email-security investigate list \ + --start 2026-01-01T00:00:00Z \ + --end 2026-01-08T00:00:00Z \ + --final-disposition MALICIOUS +``` + +Replace the timestamps with an ISO 8601 date range in UTC. If you omit `--start` and `--end`, the search covers the last 30 days. Common options include: + +- `--query`: A keyword matched against the sender, recipient, subject, attachment names and hashes, and message ID, like a regular screen. +- `--final-disposition`: `MALICIOUS`, `SUSPICIOUS`, `SPOOF`, `SPAM`, `BULK`, or `NONE`. +- `--message-action`: `MOVED`, `QUARANTINE_RELEASED`, or `PREVIEW`. Use `MOVED` to find moved emails. +- `--sender`, `--recipient`, `--domain`, `--subject`, `--message-id`, `--alert-id`, and `--delivery-status`: Advanced screen criteria. +- `--detections-only`: Set to `true` to return only messages with a detection. + +Results are paginated with a cursor. To get the next page, pass the `cursor` value from the `result_info:` line on standard error to `--cursor`. Each result includes the message `id`, which you need to view, move, or release the message. + + + The results will be displayed on a table. The table allows you to review and take action on the messages that match your chosen screening criteria. @@ -79,8 +113,12 @@ To reset your screening criteria, select **Reset**. Moving messages allows you to move messages to a specific folder. You can move up to 1,000 messages at a time. + + + To move messages: + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Email security**, and select **Investigation**. 2. On the Investigation page, select all the messages you want to move. 3. Select the **Action** dropdown, then select **Move**. @@ -91,9 +129,55 @@ To move messages: - **Soft delete (user recoverable)**: Move messages to the user's Deleted Items folder. This option is for Microsoft 365 only. - **Hard delete (admin recoverable)**: Delete messages from a user's inbox. 5. Select **Save**. + To move messages in bulk, select **Select all messages** > **Action** > **Move**. + + + +:::caution +Moving messages changes users' mailboxes. Confirm the message IDs before you run the command. +::: + + +1. [Search for the messages](#screen-criteria) with `cf email-security investigate list` and note the `id` of each message. + +2. Move the messages with [`cf email-security investigate move`](/cloudflare-one/email-security/cli-commands/#cf-email-security-investigate-move): + + ```sh + cf email-security investigate move \ + --ids \ + --destination JunkEmail + ``` + + `--destination` takes one of the following folders: + + - `Inbox`: **Inbox** + - `JunkEmail`: **Junk email** + - `DeletedItems`: **Trash** + - `RecoverableItemsDeletions`: **Soft delete (user recoverable)** + - `RecoverableItemsPurges`: **Hard delete (admin recoverable)** + + +To release quarantined messages, run `cf email-security investigate release --ids `. + +To move or release every message that matches a search, create a bulk action job with [`cf email-security bulk-actions create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-bulk-actions-create). The job uses the same search criteria as `investigate list`, prefixed with `--search-params-`: + +```sh +cf email-security bulk-actions create \ + --action MOVE \ + --destination JunkEmail \ + --search-params-start 2026-01-01T00:00:00Z \ + --search-params-end 2026-01-08T00:00:00Z \ + --search-params-sender attacker@example.com +``` + +Check the progress of the job with `cf email-security bulk-actions get `. + + + + ## Find similar emails Each detection has an Email Detection Fingerprint (EDF) hash that Email security sends to the Search API to retrieve similar detections. @@ -108,14 +192,36 @@ To find similar detection results: With Email security, you can export messages to a CSV file. + + + To export messages: + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Email security**, and select **Investigation**. 2. On the Investigation page, under **Your matching messages**, select **Export to CSV**. 3. Select **Export messages** on the pop-up message. You can export up to 500 messages from the dashboard. To export up to 1,000 matching messages, use the [API](/api/resources/email_security/subresources/investigate/methods/get/). + To export messages in bulk, select **Select all messages** > **Export to CSV**. + + + +To export matching messages as JSON, run `cf email-security investigate list` with your search criteria and save the output to a file: + +```sh +cf email-security investigate list \ + --start 2026-01-01T00:00:00Z \ + --end 2026-01-08T00:00:00Z \ + --per-page 1000 > messages.json +``` + +Each request returns up to 1,000 messages. `cf` does not export messages to CSV. + + + + ## Email status Email security allows you to review the status and actions of each email. diff --git a/src/content/docs/cloudflare-one/email-security/phishguard.mdx b/src/content/docs/cloudflare-one/email-security/phishguard.mdx index 94dcb2e76d3..8079215750b 100644 --- a/src/content/docs/cloudflare-one/email-security/phishguard.mdx +++ b/src/content/docs/cloudflare-one/email-security/phishguard.mdx @@ -8,6 +8,8 @@ sidebar: order: 17 --- +import { Steps, TabItem, Tabs } from "~/components"; + PhishGuard is a team of analysts that routinely inspects your email environment and responds to threats that come through your email inbox. While Email security uses advanced technologies to protect your email inbox, PhishGuard offers an additional human component to protect your email environment against impersonation events, suspicious items, false negatives/false positives, and any new event that automated intelligent systems may miss due to a lack of context (for example, a compromised account activity). @@ -26,11 +28,34 @@ Additionally, PhishGuard analysts: - Review every [user](/cloudflare-one/email-security/investigation/search-email/#user-submissions) and [team](/cloudflare-one/email-security/investigation/search-email/#team-submissions) submission so your security team can focus on more critical activities. - Help you detect and mitigate threats faster, reducing the time attacks have access to your network. This also helps reducing business impact, because it prevents data breaches, financial loss, and reputational damage. + + + To use PhishGuard: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **PhishGuard**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission. + +To list the [reports](#reports) that the PhishGuard team has created, run [`cf email-security phishguard reports list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-phishguard-reports-list): + +```sh +cf email-security phishguard reports list \ + --start 2026-01-01T00:00:00Z \ + --end 2026-01-31T23:59:59Z +``` + +`cf` does not display the other PhishGuard metrics. To view them, use the dashboard. + + + The dashboard will display the following metrics: diff --git a/src/content/docs/cloudflare-one/email-security/policies/inbound/allow-policies.mdx b/src/content/docs/cloudflare-one/email-security/policies/inbound/allow-policies.mdx index bd256a1e59a..6e6250a331e 100644 --- a/src/content/docs/cloudflare-one/email-security/policies/inbound/allow-policies.mdx +++ b/src/content/docs/cloudflare-one/email-security/policies/inbound/allow-policies.mdx @@ -8,7 +8,7 @@ sidebar: order: 1 --- -import { Example, Details } from "~/components"; +import { Details, Example, Steps, TabItem, Tabs } from "~/components"; Email security allows you to configure allow policies. An allow policy exempts messages that match certain patterns from normal detection scanning. @@ -217,8 +217,12 @@ Below you can find a list of known services you can add when configuring an Acce ## Configure allow policies + + + To configure allow policies: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Policies & rules**, then go to **Inbound** > **Allow policies**. @@ -243,6 +247,51 @@ To configure allow policies: - After the selected date passes, the policy expires and no longer applies. - The expiration option is available to all Email security customers, regardless of plan. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Create the allow policy with [`cf email-security allow-policies create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-allow-policies-create): + + ```sh + cf email-security allow-policies create \ + --pattern "example.com" \ + --pattern-type DOMAIN \ + --is-regex false \ + --is-acceptable-sender true \ + --is-trusted-sender false \ + --is-exempt-recipient false \ + --verify-sender true \ + --expires-at 2027-12-31T23:59:59Z \ + --comments "Marketing platform" + ``` + + - `--pattern-type`: The **Rule type**. Use `EMAIL`, `DOMAIN`, or `IP`. + - `--is-regex`: Set to `true` if `--pattern` is a regular expression. + - `--is-acceptable-sender`, `--is-trusted-sender`, `--is-exempt-recipient`: The **Action**. Set one of these options to `true` for **Accept sender**, **Trust sender**, or **Exempt recipient**, and the others to `false`. All three options are required. + - `--verify-sender`: **Sender verification**. Required. + - `--expires-at`: (Optional) **Expires at**, as an RFC 3339 timestamp in the future. + - `--comments`: (Optional) **Notes**. + +2. Note the `id` in the output. You need it to edit or delete the policy. + + +To create many allow policies at once, as you would with a CSV upload, use [`cf email-security allow-policies bulk-apply`](/cloudflare-one/email-security/cli-commands/#cf-email-security-allow-policies-bulk-apply). `--posts` takes a JSON array of policies with the same fields as `create`, in `snake_case`, for example `"pattern_type": "DOMAIN"`. `bulk-apply` also requires `--patches`, `--puts`, and `--deletes`, so pass an empty array for each one you do not use: + +```sh +cf email-security allow-policies bulk-apply \ + --posts @policies.json \ + --patches '[]' \ + --puts '[]' \ + --deletes '[]' +``` + + +
@@ -308,35 +357,112 @@ whale@notaphish.com, EMAIL, false, true, true, false, true, 2036-12-31, not a ph ## Export allow policies + + + To export all allow policies: + 1. On the **Allow policies** page, select **Value(s)**. Selecting **Value(s)** will select all allow policies. 2. Select **Export to CSV**. + To export specific allow policies: + 1. On the **Allow policies** page, select the allow policies you want to export. 2. Select **Export to CSV**. + + + + + +To list your allow policies, run [`cf email-security allow-policies list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-allow-policies-list): + +```sh +cf email-security allow-policies list --per-page 1000 +``` + +To filter the list, add options such as `--pattern-type EMAIL`, `--is-trusted-sender true`, or `--search ""`. `cf` returns allow policies as JSON. It does not export them to CSV. + + + ## Edit allow policy + + + To edit an allow policy: + 1. On the **Allow policies** page, select the allow policy you want to edit. 2. Select the three dots > **Edit**. 3. Edit the allow policy. 4. Select **Save**. + + + + + + +1. Find the ID of the allow policy: + + ```sh + cf email-security allow-policies list --search "" + ``` + +2. Update the policy with [`cf email-security allow-policies edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-allow-policies-edit). Pass only the options you want to change: + + ```sh + cf email-security allow-policies edit \ + --verify-sender true \ + --comments "Updated notes" + ``` + + + + ## Delete allow policy + + + To delete an allow policy: + 1. On the **Allow policies** page, select the allow policy you want to delete. 2. Select the three dots > **Delete**. 3. On the pop-up message, select **Delete**. + To delete multiple allow policies at once: + 1. On the **Allow policies** page, select the allow policies you want to delete. 2. Select **Action**. 3. Select **Delete**. + + + + + +To delete an allow policy, run [`cf email-security allow-policies delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-allow-policies-delete): + +```sh +cf email-security allow-policies delete +``` + +To delete multiple allow policies at once, list their IDs in `--deletes`: + +```sh +cf email-security allow-policies bulk-apply \ + --deletes '[{"id":""},{"id":""}]' \ + --posts '[]' \ + --patches '[]' \ + --puts '[]' +``` + + + diff --git a/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-content.mdx b/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-content.mdx index 77567e28772..0256ad65cb9 100644 --- a/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-content.mdx +++ b/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-content.mdx @@ -8,6 +8,8 @@ sidebar: order: 4 --- +import { Steps, TabItem, Tabs } from "~/components"; + Blocked content policies are only available on Enterprise plans and Enterprise + [PhishGuard](/cloudflare-one/email-security/phishguard/) plans. Email security allows you to configure blocked content policies. A blocked content policy marks all messages containing specific words or phrases with a malicious [disposition](/cloudflare-one/email-security/reference/dispositions-and-attributes/). @@ -20,8 +22,12 @@ This is useful when your organization needs to block emails containing specific ## Create a blocked content policy + + + To create a blocked content policy: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Policies & rules**, then go to **Inbound** > **Blocked content**. @@ -41,6 +47,38 @@ To create a blocked content policy: - **Review potential matches**: Displays a list of words that your pattern could match. - **Test specific content against your regular expression**: Enter a sample text and select **Test policy** to verify whether your policy catches the expected content. 8. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Create the policy with [`cf email-security content-policies create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-content-policies-create): + + ```sh + cf email-security content-policies create \ + --name "Gift card scams" \ + --pattern 'gift\s+cards?' \ + --targets SUBJECT BODY \ + --enabled true \ + --notes "Block gift card requests" + ``` + + - `--targets`: The **Scope**. Use `SUBJECT`, `BODY`, or both. + - `--pattern`: The regular expression that defines the content to block. + - `--enabled`: **Activate policy**. Required. + - `--expires-at`: (Optional) The expiration date, as an RFC 3339 timestamp in the future. + - `--notes`: (Optional) **Note**. + +2. Note the `id` in the output. You need it to edit or delete the policy. + + +`cf` does not test a pattern against sample content. To review potential matches before you save the policy, use the dashboard. + + + ### Allowed regex modifiers @@ -66,23 +104,77 @@ When building your pattern, you can use the following regex modifiers: ## Edit a blocked content policy + + + To edit a blocked content policy: + 1. On the **Blocked content** page, select the policy you want to edit. 2. Select the three dots > **Edit**. 3. Edit the blocked content policy. 4. Select **Save**. + + + + + + +1. Find the ID of the policy: + + ```sh + cf email-security content-policies list + ``` + +2. Update the policy with [`cf email-security content-policies edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-content-policies-edit). Pass only the options you want to change. For example, to turn off the policy: + + ```sh + cf email-security content-policies edit --enabled false + ``` + + + + ## Delete a blocked content policy + + + To delete a blocked content policy: + 1. On the **Blocked content** page, select the policy you want to delete. 2. Select the three dots > **Delete**. 3. On the pop-up message, select **Delete**. + To delete multiple blocked content policies at once: + 1. On the **Blocked content** page, select the policies you want to delete. 2. Select **Action**. 3. Select **Delete**. + + + + + +To delete a blocked content policy, run [`cf email-security content-policies delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-content-policies-delete): + +```sh +cf email-security content-policies delete +``` + +To delete multiple policies at once, list their IDs in `--deletes`: + +```sh +cf email-security content-policies bulk-apply \ + --deletes '[{"id":""},{"id":""}]' \ + --posts '[]' \ + --patches '[]' \ + --puts '[]' +``` + + + diff --git a/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-senders.mdx b/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-senders.mdx index 56649824797..7ba5e0be0cd 100644 --- a/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-senders.mdx +++ b/src/content/docs/cloudflare-one/email-security/policies/inbound/blocked-senders.mdx @@ -8,6 +8,8 @@ sidebar: order: 3 --- +import { Steps, TabItem, Tabs } from "~/components"; + Email security marks all messages from these senders with a malicious [disposition](/cloudflare-one/email-security/reference/dispositions-and-attributes/). ## How blocked senders work @@ -18,8 +20,12 @@ Sometimes, the same email, IP address or domain always sends malicious emails to ## Configure blocked senders + + + To configure blocked senders: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Policies & rules**, then go to **Inbound** > **Blocked senders**. @@ -38,6 +44,45 @@ To configure blocked senders: - After the selected date passes, the policy expires and no longer applies. - The expiration option is available to all Email security customers, regardless of plan. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the blocked sender with [`cf email-security block-senders create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-block-senders-create): + + ```sh + cf email-security block-senders create \ + --pattern "attacker@example.com" \ + --pattern-type EMAIL \ + --is-regex false \ + --expires-at 2027-12-31T23:59:59Z \ + --comments "Repeated phishing sender" + ``` + + - `--pattern-type`: The **Sender type**. Use `EMAIL`, `DOMAIN`, or `IP`. + - `--is-regex`: Set to `true` if `--pattern` is a regular expression. Required. + - `--expires-at`: (Optional) **Expires at**, as an RFC 3339 timestamp in the future. + - `--comments`: (Optional) **Notes**. + +2. Note the `id` in the output. You need it to edit or delete the blocked sender. + + +To add many blocked senders at once, as you would with a CSV upload, use [`cf email-security block-senders bulk-apply`](/cloudflare-one/email-security/cli-commands/#cf-email-security-block-senders-bulk-apply). `--posts` takes a JSON array of blocked senders with the same fields as `create`, in `snake_case`. `bulk-apply` also requires `--patches`, `--puts`, and `--deletes`, so pass an empty array for each one you do not use: + +```sh +cf email-security block-senders bulk-apply \ + --posts @blocked-senders.json \ + --patches '[]' \ + --puts '[]' \ + --deletes '[]' +``` + + + ### CSV uploads @@ -55,35 +100,112 @@ example.com, DOMAIN, false, 2036-12-31, Melanie Turner ## Export blocked senders + + + To export all blocked senders: + 1. On the **Blocked senders** page, select **Sender**. Selecting **Sender** will select all blocked senders. 2. Select **Export to CSV**. + To export specific blocked senders: + 1. On the **Blocked senders** page, select **Value(s)**. Select the blocked senders you want to export. 2. Select **Export to CSV**. + + + + + +To list your blocked senders, run [`cf email-security block-senders list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-block-senders-list): + +```sh +cf email-security block-senders list --per-page 1000 +``` + +To filter the list, add options such as `--pattern-type DOMAIN` or `--search ""`. `cf` returns blocked senders as JSON. It does not export them to CSV. + + + ## Edit a blocked sender + + + To edit a blocked sender: + 1. On the **Blocked senders** page, select the blocked sender you want to edit. 2. Select the three dots > **Edit**. 3. Edit the blocked sender. 4. Select **Save**. + + + + + + +1. Find the ID of the blocked sender: + + ```sh + cf email-security block-senders list --search "" + ``` + +2. Update the blocked sender with [`cf email-security block-senders edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-block-senders-edit). Pass only the options you want to change: + + ```sh + cf email-security block-senders edit \ + --expires-at 2028-06-30T23:59:59Z \ + --comments "Updated notes" + ``` + + + + ## Delete a blocked sender + + + To delete a blocked sender: + 1. On the **Blocked senders** page, select the blocked sender you want to delete. 2. Select the three dots > **Delete**. 3. On the pop up message, select **Delete**. + To delete multiple blocked senders at once: + 1. On the **Blocked senders** page, select the senders you want to delete. 2. Select **Action** 3. Select **Delete**. + + + + + +To delete a blocked sender, run [`cf email-security block-senders delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-block-senders-delete): + +```sh +cf email-security block-senders delete +``` + +To delete multiple blocked senders at once, list their IDs in `--deletes`: + +```sh +cf email-security block-senders bulk-apply \ + --deletes '[{"id":""},{"id":""}]' \ + --posts '[]' \ + --patches '[]' \ + --puts '[]' +``` + + + diff --git a/src/content/docs/cloudflare-one/email-security/policies/inbound/partner-domain-tls.mdx b/src/content/docs/cloudflare-one/email-security/policies/inbound/partner-domain-tls.mdx index 1a241322794..abc2c749037 100644 --- a/src/content/docs/cloudflare-one/email-security/policies/inbound/partner-domain-tls.mdx +++ b/src/content/docs/cloudflare-one/email-security/policies/inbound/partner-domain-tls.mdx @@ -10,21 +10,55 @@ sidebar: order: 5 --- +import { Steps, TabItem, Tabs } from "~/components"; + To add additional TLS (Transport Layer Security) requirements for emails coming from certain domains, you can enforce higher levels of SSL/TLS inspection. If TLS is required, mail without TLS from the specified domain will be dropped. :::note To enforce TLS across all emails, you will need to enforce TLS requirements when you are onboarding your domain. To only enforce TLS for specific emails, go to **Policies & rules** > **Inbound** > **Partner domain TLS**, then select **Add a domain**. ::: + + + To set up a partner domain: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/) and select **Email security**. 2. Select **Policies & rules**, then go to **Inbound** > **Partner domain TLS**. 3. Select **Add a domain**. 4. Enter a valid domain name. You can also exclude subdomains by selecting **Add exclude**. 5. (Optional) Add an optional note to describe your rule(s). 6. Select **Save**. + To edit a partner domain, select the three dots > **Edit**. To delete a partner domain, select the three dots > **Delete**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the partner domain with [`cf email-security sending-domain-restrictions create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-create): + + ```sh + cf email-security sending-domain-restrictions create \ + --domain "partner.example.com" \ + --exclude "legacy.partner.example.com" \ + --comments "Require TLS from partner" + ``` + + - `--domain`: The domain that must send mail over TLS. + - `--exclude`: Subdomains to exclude from the TLS requirement. Required. To exclude no subdomains, pass `--exclude` without a value. + - `--comments`: (Optional) A note that describes the rule. + +2. Note the `id` in the output. You need it to edit or delete the partner domain. + + +To edit a partner domain, run [`cf email-security sending-domain-restrictions edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-edit) with the options you want to change. To delete a partner domain, run [`cf email-security sending-domain-restrictions delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-delete). To find the ID, run `cf email-security sending-domain-restrictions list`. + + + diff --git a/src/content/docs/cloudflare-one/email-security/policies/inbound/trusted-domains.mdx b/src/content/docs/cloudflare-one/email-security/policies/inbound/trusted-domains.mdx index 77931dc9bb9..b5330bf3774 100644 --- a/src/content/docs/cloudflare-one/email-security/policies/inbound/trusted-domains.mdx +++ b/src/content/docs/cloudflare-one/email-security/policies/inbound/trusted-domains.mdx @@ -8,6 +8,8 @@ sidebar: order: 2 --- +import { Steps, TabItem, Tabs } from "~/components"; + Email security allows you to exempt known partner and internal domains from typical detection scanning. Adding trusted domains helps to reduce false positives on malicious, suspicious, and spoof [dispositions](/cloudflare-one/email-security/reference/dispositions-and-attributes/). Email security only checks the date when the domain is created. ## How trusted domains work @@ -35,8 +37,12 @@ To view whether a domain is malicious or suspicious: ## Configure trusted domains + + + To configure a trusted domain: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Policies & rules**, then go to **Inbound** > **Trusted domains**. @@ -50,6 +56,45 @@ To configure a trusted domain: * **Notes**: Provide additional information about the trusted domain list. - **Upload trusted domain list**: You can upload a file no larger than 150 KB of multiple trusted domains. The file can only contain `Domain`, `Proximity`, `New`, `Is Regex`, and `Notes` fields. The first row must be a header row. Refer to [CSV uploads](#csv-uploads) for an example file. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the trusted domain with [`cf email-security trusted-domains create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-trusted-domains-create): + + ```sh + cf email-security trusted-domains create \ + --pattern "partner.example.com" \ + --is-similarity true \ + --is-recent false \ + --is-regex false \ + --comments "Partner domain" + ``` + + - `--is-similarity`: **Proximity domain**. Set to `true` to exempt a domain with similar spelling to your domains from Spoof dispositions. Required. + - `--is-recent`: **Recent domain**. Set to `true` to exempt a recently registered domain from Suspicious or Malicious dispositions. Required. + - `--is-regex`: Set to `true` if `--pattern` is a regular expression. Required. + - `--comments`: (Optional) **Notes**. + +2. Note the `id` in the output. You need it to edit or delete the trusted domain. + + +To add many trusted domains at once, as you would with a CSV upload, use [`cf email-security trusted-domains bulk-apply`](/cloudflare-one/email-security/cli-commands/#cf-email-security-trusted-domains-bulk-apply). `--posts` takes a JSON array of trusted domains with the same fields as `create`, in `snake_case`. `bulk-apply` also requires `--patches`, `--puts`, and `--deletes`, so pass an empty array for each one you do not use: + +```sh +cf email-security trusted-domains bulk-apply \ + --posts @trusted-domains.json \ + --patches '[]' \ + --puts '[]' \ + --deletes '[]' +``` + + + ### CSV uploads @@ -65,35 +110,112 @@ testdomain.com, false, true, false, New Hire ## Export trusted domains + + + To export all trusted domains: + 1. On the **Trusted domains** page, select **Domain**. Selecting **Domain** will select all trusted domains. 2. Select **Export to CSV**. + To export specific trusted domains: + 1. On the **Trusted domains** page, select the trusted domains you want to export. 2. Select **Export to CSV**. + + + + + +To list your trusted domains, run [`cf email-security trusted-domains list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-trusted-domains-list): + +```sh +cf email-security trusted-domains list --per-page 1000 +``` + +To filter the list, add options such as `--search ""`. `cf` returns trusted domains as JSON. It does not export them to CSV. + + + ## Edit trusted domains + + + To edit a trusted domain: + 1. On the **Trusted domains** page, select the trusted domains you want to edit. 2. Select the three dots > Edit. 3. Edit the trusted domain. 4. Select **Save**. + + + + + + +1. Find the ID of the trusted domain: + + ```sh + cf email-security trusted-domains list --search "" + ``` + +2. Update the trusted domain with [`cf email-security trusted-domains edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-trusted-domains-edit). Pass only the options you want to change: + + ```sh + cf email-security trusted-domains edit \ + --is-recent true \ + --comments "Updated notes" + ``` + + + + ## Delete trusted domains + + + To delete trusted domains: + 1. On the **Trusted domains** page, select the trusted domain you want to delete. 2. Select the three dots > **Delete**. 3. On the pop up message, select **Delete**. + To delete multiple trusted domains at once: + 1. On the **Trusted domains** page, select the trusted domains you want to delete. 2. Select **Action**. 3. Select **Delete**. + + + + + +To delete a trusted domain, run [`cf email-security trusted-domains delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-trusted-domains-delete): + +```sh +cf email-security trusted-domains delete +``` + +To delete multiple trusted domains at once, list their IDs in `--deletes`: + +```sh +cf email-security trusted-domains bulk-apply \ + --deletes '[{"id":""},{"id":""}]' \ + --posts '[]' \ + --patches '[]' \ + --puts '[]' +``` + + + diff --git a/src/content/docs/cloudflare-one/email-security/settings/detection-settings/configure-link-actions.mdx b/src/content/docs/cloudflare-one/email-security/settings/detection-settings/configure-link-actions.mdx index 0afdba3a373..95075f9a848 100644 --- a/src/content/docs/cloudflare-one/email-security/settings/detection-settings/configure-link-actions.mdx +++ b/src/content/docs/cloudflare-one/email-security/settings/detection-settings/configure-link-actions.mdx @@ -8,6 +8,8 @@ sidebar: order: 3 --- +import { Steps, TabItem, Tabs } from "~/components"; + You can configure how Email security handles links in emails. :::note @@ -45,10 +47,52 @@ When opening links, Email security will not allow you to: You can add patterns for URLs that should be rewritten. + + + + 1. Under **URL rewrite ignore patterns**, select **Add a pattern**. 2. Enter a valid IP, URL, or regular expression. You can enter up to 512 characters. 3. Select **Save**. + To edit a pattern, go to the pattern you want to edit, select the three dots, then **Edit**. Once you have finished modifying the URL pattern, select **Save**. To delete a pattern, go to the pattern you want to delete, select the three dots, then **Delete**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the pattern with [`cf email-security url-ignore-patterns create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-url-ignore-patterns-create): + + ```sh + cf email-security url-ignore-patterns create \ + --pattern '.*\.example\.com' \ + --comments "Internal links" + ``` + + - `--pattern`: A valid IP, URL, or regular expression, up to 512 characters. + - `--comments`: (Optional) A note that describes why the pattern is ignored. + +2. Note the `id` in the output. You need it to edit or delete the pattern. + + +To edit a pattern, run [`cf email-security url-ignore-patterns edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-url-ignore-patterns-edit) with the options you want to change: + +```sh +cf email-security url-ignore-patterns edit --pattern '.*\.example\.net' +``` + +To delete a pattern, run [`cf email-security url-ignore-patterns delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-url-ignore-patterns-delete): + +```sh +cf email-security url-ignore-patterns delete +``` + +To find a pattern ID, run `cf email-security url-ignore-patterns list`. + + + diff --git a/src/content/docs/cloudflare-one/email-security/settings/detection-settings/impersonation-registry.mdx b/src/content/docs/cloudflare-one/email-security/settings/detection-settings/impersonation-registry.mdx index c96d64099cd..f627c45b915 100644 --- a/src/content/docs/cloudflare-one/email-security/settings/detection-settings/impersonation-registry.mdx +++ b/src/content/docs/cloudflare-one/email-security/settings/detection-settings/impersonation-registry.mdx @@ -8,6 +8,8 @@ sidebar: order: 1 --- +import { Steps, TabItem, Tabs } from "~/components"; + The impersonation registry contains combinations of emails of users who are likely to be impersonated. If there is an email that is on the impersonation registry not listed as an alternative email address, that email will be reported as potential [business email compromise (BEC)](https://www.cloudflare.com/en-gb/learning/email-security/business-email-compromise-bec/). :::note @@ -17,8 +19,12 @@ The impersonation registry should contain a list of users who are likely to be i For easier tracking, the Email security team recommends syncing and structuring VIPs in groups, and avoid doing manual inputs of users. ::: + + + To add a user to the impersonation registry: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security**. 3. Select **Settings** > **Impersonation registry** > **View**. @@ -34,6 +40,36 @@ To add a user to the impersonation registry: - **Select directory**: Select your directory. - **Add users or groups**: Choose the users or groups you want to register. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the user with [`cf email-security impersonation-registry create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-impersonation-registry-create): + + ```sh + cf email-security impersonation-registry create \ + --name "Jane Doe" \ + --email "jane.doe@example.com" \ + --is-email-regex false \ + --comments "CFO" + ``` + + - `--name`: The user's **Display name**. + - `--email`: The user's email address, or a regular expression if `--is-email-regex` is `true`. + - `--is-email-regex`: Set to `true` if `--email` is a Java regular expression. Required. + - `--comments`: (Optional) A note about the entry. + +2. Note the `id` in the output. You need it to edit or remove the user. + + +`cf` adds users manually, like **Manual input** in the dashboard. To register users or groups from an integrated directory, use the dashboard. + + + ### CSV uploads @@ -55,19 +91,50 @@ Administrators can edit the names and emails of users who belong to the Email se ::: + + + To edit users from the Email security directory: + 1. Select the user you want to edit. 2. Select the three dots > **Edit**. 3. Enter the **Display name**, **Email** and **Secondary email**. 4. Select **Save**. + To edit users from other integrations: + 1. Select the user you want to edit. 2. Select the three dots > **Edit**. 3. Enter the **Secondary email**. 4. Select **Save**. + + + + + + +1. Find the ID of the user: + + ```sh + cf email-security impersonation-registry list --search "" + ``` + +2. Update the user with [`cf email-security impersonation-registry edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-impersonation-registry-edit). Pass only the options you want to change: + + ```sh + cf email-security impersonation-registry edit \ + --name "Jane Q. Doe" \ + --email "jane.q.doe@example.com" + ``` + + +You can only edit users that belong to the Email security directory. `cf` does not support secondary email addresses. To add a secondary email, use the dashboard. + + + ## Remove users @@ -85,14 +152,35 @@ To remove a user from an integrated directory: ::: + + + To remove a user from the impersonation registry: + 1. Select the user you want to remove. 2. Select the three dots > **Remove from registry**. 3. Read the pop-up message, then select **Remove user**. + To remove multiple users at once from the impersonation registry: + 1. Select all the users you want to remove. 2. Select **Action** > **Remove from registry**. 3. Read the pop-up message, then select **Remove users**. + + + + + +To remove a user, run [`cf email-security impersonation-registry delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-impersonation-registry-delete): + +```sh +cf email-security impersonation-registry delete +``` + +You can only remove users that belong to the Email security directory. To find an entry ID, run `cf email-security impersonation-registry list --search ""`. + + + diff --git a/src/content/docs/cloudflare-one/email-security/setup/manage-domains.mdx b/src/content/docs/cloudflare-one/email-security/setup/manage-domains.mdx index 5c704f3a770..85a158490db 100644 --- a/src/content/docs/cloudflare-one/email-security/setup/manage-domains.mdx +++ b/src/content/docs/cloudflare-one/email-security/setup/manage-domains.mdx @@ -7,6 +7,8 @@ sidebar: order: 4 --- +import { Steps, TabItem, Tabs } from "~/components"; + Once you have deployed your domain, Email security allows you to add, filter and edit domains. You can also choose to stop a domain from being scanned. ## Add domains @@ -19,22 +21,79 @@ To protect a new domain: ## Filter domains + + + To filter your domains: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/) > **Email security**. 2. Go to **Settings** > **Domain management** > **Domains**, then select **View**. 3. Select **Show filters** > **Configured method**. Choose among the following filters: - **MS Graph API**: To view domains connected via MS Graph API. - **BCC/Journaling**: To view domains connected via BCC/Journaling. - **MX/Inline**: To view domains connected via MX/Inline. - **Retro Scan**: To view domains scanned by Retro Scan. 4. Select **Apply filters**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission. + +To list your domains by configured method, run [`cf email-security domains list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-domains-list) with `--allowed-delivery-mode`: + +```sh +cf email-security domains list --allowed-delivery-mode API +``` + +`--allowed-delivery-mode` takes one of the following values: + +- `API`: Domains connected via MS Graph API. +- `BCC` or `JOURNAL`: Domains connected via BCC or journaling. +- `DIRECT`: Domains connected via MX/Inline. +- `RETRO_SCAN`: Domains scanned by Retro Scan. + +To filter by the delivery mode that is currently active, use `--active-delivery-mode` instead. + + + ## Edit domains + + + To edit your domains: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/) > **Email security**. 2. Go to **Settings** > **Domain management** > **Domains**, then select **View**. 3. On the **Domains** page, locate your domain, select the three dots > **Edit**. 4. If you did not manually add your domain, you will only be able to edit **Hops**. If you manually added your domain, you will be able to edit **Domain name** and **Hops**. 5. Select **Save**. + + + + + + +1. Find the ID of the domain: + + ```sh + cf email-security domains list --domain example.com + ``` + +2. Update the number of hops with [`cf email-security domains edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-domains-edit): + + ```sh + cf email-security domains edit --lookback-hops 3 + ``` + + `--lookback-hops` sets **Hops**, a value from `1` to `20`. `edit` updates only the options you pass. + + +`cf` does not change the name of a domain. To rename a manually added domain, use the dashboard. + + + ## Prevent Cloudflare from scanning a domain @@ -43,4 +102,4 @@ To stop scanning domains: 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/) > **Email security**. 2. Go to **Settings** > **Domain management** > **Domains**, then select **View**. 3. On the **Domains** page, locate your domain, select the three dots > **Stop scanning**. -4. Select **Stop scanning** again to stop Cloudflare from scanning your domain. \ No newline at end of file +4. Select **Stop scanning** again to stop Cloudflare from scanning your domain. diff --git a/src/content/docs/cloudflare-one/email-security/setup/pre-delivery-deployment/partner-domain-tls.mdx b/src/content/docs/cloudflare-one/email-security/setup/pre-delivery-deployment/partner-domain-tls.mdx index d33970c1736..4c8ca7069c5 100644 --- a/src/content/docs/cloudflare-one/email-security/setup/pre-delivery-deployment/partner-domain-tls.mdx +++ b/src/content/docs/cloudflare-one/email-security/setup/pre-delivery-deployment/partner-domain-tls.mdx @@ -10,21 +10,55 @@ sidebar: order: 5 --- +import { Steps, TabItem, Tabs } from "~/components"; + To add additional TLS (Transport Layer Security) requirements for emails coming from certain domains, you can enforce higher levels of SSL/TLS inspection. If TLS is required, mail without TLS from the specified domain will be dropped. :::note To enforce TLS across all emails, you will need to enforce TLS requirements when you are onboarding your domain. To only enforce TLS for specific emails, you can do so by going to **Settings** > **Partner domain TLS** > **Add a domain**. ::: + + + To set up a partner domain: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/) and select **Email security**. 2. Select **Settings** > **Partner domain TLS** > **View**. 3. Select **Add a domain**. 4. Enter a valid domain name. You can also exclude subdomains by selecting **Add exclude**. 5. (Optional) Add an optional note to describe your rule(s). 6. Select **Save**. + To edit a partner domain, select the three dots > **Edit**. -To delete a partner domain, select the three dots > **Delete**. \ No newline at end of file +To delete a partner domain, select the three dots > **Delete**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. Add the partner domain with [`cf email-security sending-domain-restrictions create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-create): + + ```sh + cf email-security sending-domain-restrictions create \ + --domain "partner.example.com" \ + --exclude "legacy.partner.example.com" \ + --comments "Require TLS from partner" + ``` + + - `--domain`: The domain that must send mail over TLS. + - `--exclude`: Subdomains to exclude from the TLS requirement. Required. To exclude no subdomains, pass `--exclude` without a value. + - `--comments`: (Optional) A note that describes the rule. + +2. Note the `id` in the output. You need it to edit or delete the partner domain. + + +To edit a partner domain, run [`cf email-security sending-domain-restrictions edit`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-edit) with the options you want to change. To delete a partner domain, run [`cf email-security sending-domain-restrictions delete`](/cloudflare-one/email-security/cli-commands/#cf-email-security-sending-domain-restrictions-delete). To find the ID, run `cf email-security sending-domain-restrictions list`. + + + diff --git a/src/content/docs/cloudflare-one/email-security/submissions/index.mdx b/src/content/docs/cloudflare-one/email-security/submissions/index.mdx index 14e7f12e83a..3f6955da49a 100644 --- a/src/content/docs/cloudflare-one/email-security/submissions/index.mdx +++ b/src/content/docs/cloudflare-one/email-security/submissions/index.mdx @@ -8,12 +8,18 @@ sidebar: order: 13 --- +import { Steps, TabItem, Tabs } from "~/components"; + Submitting messages allows you to choose the disposition of your messages if the disposition is incorrect. This helps improve Email security's detection accuracy and ensures proper handling of email threats. ## Submit messages for review + + + To submit a message for review: + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Email security** and select **Investigation**. 2. On the **Investigation** page, under **Your matching messages**, select the message you want to reclassify. 3. Select the three dots, then select **Submit for review**. @@ -24,11 +30,47 @@ To submit a message for review: - **Bulk**: Traffic associated with [Graymail](https://en.wikipedia.org/wiki/Graymail_%28email%29), that falls in between the definitions of `SPAM` and `SUSPICIOUS`. For example, a marketing email that intentionally obscures its unsubscribe link. - **Clean**: Traffic not associated with any phishing campaigns. 5. Select **Save**. + To submit messages in bulk, select **Select all messages** > **Action** > **Request submissions**. To release messages in bulk, select **Select all messages** > **Action** > **Release**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Write** permission. + + +1. [Search for the message](/cloudflare-one/email-security/investigation/search-email/#screen-criteria) with `cf email-security investigate list` and note its `alert_id`. + +2. Create a JSON file that lists the messages to reclassify and the new disposition for each: + + ```json title="submissions.json" + [ + { + "alert_id": "", + "expected_disposition": "SPAM" + } + ] + ``` + + Set `expected_disposition` to the **New disposition**: `MALICIOUS`, `SUSPICIOUS`, `SPOOF`, `SPAM`, `BULK`, or `NONE` for **Clean**. + +3. Submit the messages with [`cf email-security submissions create`](/cloudflare-one/email-security/cli-commands/#cf-email-security-submissions-create): + + ```sh + cf email-security submissions create \ + --type reclassification \ + --messages @submissions.json + ``` + + +To release quarantined messages, run `cf email-security investigate release --ids `. + + + + ## Upload EML files Email security classifies certain emails as "Clean". If you disagree with the disposition, you can upload an EML file and reclassify the email. @@ -43,13 +85,32 @@ On the **Investigation** page: ## View submissions + + + Once you have submitted your messages, you can access those on **Submissions**. To view submissions: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security** > **Submissions**. 3. Choose from the following submission types: - [**Team submissions**](/cloudflare-one/email-security/submissions/team-submissions/): View emails your security team submitted for submissions. - [**User submissions**](/cloudflare-one/email-security/submissions/user-submissions/): View emails your users submitted for submissions. - - [**Invalid submissions**](/cloudflare-one/email-security/submissions/invalid-submissions/): View submissions that could not be processed. \ No newline at end of file + - [**Invalid submissions**](/cloudflare-one/email-security/submissions/invalid-submissions/): View submissions that could not be processed. + + + + + +To list your submissions, run [`cf email-security submissions list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-submissions-list): + +```sh +cf email-security submissions list +``` + +To list only team or user submissions, add `--type TEAM` or `--type USER`. `cf` does not list invalid submissions. To view invalid submissions, use the dashboard. + + + diff --git a/src/content/docs/cloudflare-one/email-security/submissions/team-submissions.mdx b/src/content/docs/cloudflare-one/email-security/submissions/team-submissions.mdx index 0520ccc6a30..ca71d08c41a 100644 --- a/src/content/docs/cloudflare-one/email-security/submissions/team-submissions.mdx +++ b/src/content/docs/cloudflare-one/email-security/submissions/team-submissions.mdx @@ -8,15 +8,46 @@ sidebar: order: 1 --- +import { Steps, TabItem, Tabs } from "~/components"; + Team submissions are the emails your security team submitted for submission. All team submissions receive a human review by Cloudflare. ## View team submissions + + + To view team submissions: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security** > **Submissions**. 3. Select **Team submissions**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission. + +To list team submissions, run [`cf email-security submissions list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-submissions-list) with `--type TEAM`: + +```sh +cf email-security submissions list --type TEAM --start 2026-01-01T00:00:00Z +``` + +To filter the list, add any of the following options: + +- `--start` and `--end`: **Date Range**, as ISO 8601 timestamps in UTC. Defaults to the last 30 days. +- `--original-disposition`: **Original disposition**. +- `--requested-disposition`: **Submitted as**. +- `--outcome-disposition`: **Final disposition**. +- `--status escalated`: Submissions that have been escalated. + +Dispositions use the values `MALICIOUS`, `SUSPICIOUS`, `SPOOF`, `SPAM`, `BULK`, and `NONE` (clean). + + + ## Filter team submissions diff --git a/src/content/docs/cloudflare-one/email-security/submissions/user-submissions.mdx b/src/content/docs/cloudflare-one/email-security/submissions/user-submissions.mdx index f15d47d44db..7602ebc3182 100644 --- a/src/content/docs/cloudflare-one/email-security/submissions/user-submissions.mdx +++ b/src/content/docs/cloudflare-one/email-security/submissions/user-submissions.mdx @@ -8,6 +8,8 @@ sidebar: order: 2 --- +import { Steps, TabItem, Tabs } from "~/components"; + User submissions are the emails your users submitted for submission. User submissions help enhance our detection model, but can be escalated for human review. Any email that is reported as [phish](/cloudflare-one/email-security/settings/submission-settings/#reclassify-an-email) will be displayed under **User submissions**. @@ -18,11 +20,39 @@ Any email that is reported as [phish](/cloudflare-one/email-security/settings/su ## View user submissions + + + To view user submissions: + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com/). 2. Select **Email security** > **Submissions**. 3. Select **User submissions**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Cloud Email Security: Read** permission. + +To list user submissions, run [`cf email-security submissions list`](/cloudflare-one/email-security/cli-commands/#cf-email-security-submissions-list) with `--type USER`: + +```sh +cf email-security submissions list --type USER --start 2026-01-01T00:00:00Z +``` + +To filter the list, add any of the following options: + +- `--start` and `--end`: **Date Range**, as ISO 8601 timestamps in UTC. Defaults to the last 30 days. +- `--original-disposition`: **Original disposition**. +- `--requested-disposition`: **Submitted as**. +- `--escalated-from-user true`: Submissions that users escalated for review. + +Dispositions use the values `MALICIOUS`, `SUSPICIOUS`, `SPOOF`, `SPAM`, `BULK`, and `NONE` (clean). + + + ## Filter user submissions diff --git a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs.mdx b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs.mdx index 9f7d89409fd..7c7863bfea5 100644 --- a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs.mdx +++ b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs.mdx @@ -53,6 +53,23 @@ To view logs for identity-based authentication events: ::: 4. Select an individual timestamp to investigate the event in more detail. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Audit Logs Read** permission. + +List authentication events with `cf zero-trust access logs access-requests list`: + +```sh +cf zero-trust access logs access-requests list \ + --since 2026-01-01T00:00:00Z \ + --until 2026-01-02T00:00:00Z \ + --direction desc \ + --limit 25 +``` + +To filter the events by user, add `--email` with a full or partial email address, for example `--email @example.com`. To return only some fields, add `--fields` with a comma-separated list, for example `--fields user_email,app_domain,allowed,created_at`. + The [Access authentication logs](/api/resources/zero_trust/subresources/access/subresources/logs/subresources/access_requests/methods/list/) API endpoint provides a custom URL to export audit log events for your account. diff --git a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/admin-activity-logs.mdx b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/admin-activity-logs.mdx index 304fa8f96f0..29309c6fb5a 100644 --- a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/admin-activity-logs.mdx +++ b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/admin-activity-logs.mdx @@ -14,6 +14,18 @@ Admin activity logs record configuration changes made by members of your Cloudfl To view admin activity logs, log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and go to **Zero Trust** > **Insights** > **Logs** > **Admin activity logs**. +To list admin activity logs with the [Cloudflare CLI (`cf`)](/cf/), run `cf accounts logs audit list` and filter by the Zero Trust product category. The API token needs **Account Settings Read** permission. + +```sh +cf accounts logs audit list \ + --product-category zerotrust \ + --since 2026-01-01T00:00:00Z \ + --before 2026-01-02T00:00:00Z \ + --limit 25 +``` + +`--since` and `--before` are required. To filter by product, use `--resource-product` (for example, `access`, `gateway`, or `devices`). To filter by the member who made the change, use `--actor-email user@example.com`. + ## Explanation of the fields | Field | Description | Example Value | diff --git a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/index.mdx b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/index.mdx index d92fd1a4370..f54b7b6cdbf 100644 --- a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/index.mdx +++ b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/index.mdx @@ -10,7 +10,7 @@ sidebar: description: Review DNS queries, network traffic, and HTTP requests inspected by Gateway. --- -import { Render, GlossaryTooltip, DirectoryListing } from "~/components"; +import { DirectoryListing, GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; Gateway activity logs record the DNS queries, Network packets, and HTTP requests inspected by Gateway. You can also download encrypted [SSH command logs](/cloudflare-one/insights/logs/dashboard-logs/ssh-command-logs/) for sessions proxied by Gateway. @@ -49,9 +49,45 @@ By default, Gateway logs all events, including DNS queries and HTTP requests tha To customize what Gateway logs: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. Under **Traffic logging** > **Log traffic activity**, choose your preference for DNS, Network, and HTTP logs. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Get your current logging settings: + + ```sh + cf zero-trust gateway logging get + ``` + +2. Update the settings with [`cf zero-trust gateway logging update`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-logging-update). For example, to only log blocked DNS queries and log all Network and HTTP traffic: + + ```sh + cf zero-trust gateway logging update \ + --redact-pii false \ + --settings-by-rule-type-dns-log-all false \ + --settings-by-rule-type-dns-log-blocks true \ + --settings-by-rule-type-l4-log-all true \ + --settings-by-rule-type-l4-log-blocks false \ + --settings-by-rule-type-http-log-all true \ + --settings-by-rule-type-http-log-blocks false + ``` + + For each log type (`dns`, `l4` for Network, and `http`), set `log-all` to `true` to log all requests, or set `log-all` to `false` and `log-blocks` to `true` to only log blocked requests. To turn off logging, set both to `false`. `logging update` replaces all logging settings, so pass the current `--redact-pii` value and the settings for every log type. + + + + These settings only apply to logs displayed in Cloudflare One. Logpush data is unaffected. diff --git a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/manage-pii.mdx b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/manage-pii.mdx index 03bb75f46d2..397f4c74f40 100644 --- a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/manage-pii.mdx +++ b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/manage-pii.mdx @@ -10,6 +10,8 @@ sidebar: order: 1 --- +import { Steps, TabItem, Tabs } from "~/components"; + Cloudflare Gateway gives you multiple ways to safely handle your employees' personally identifiable information (PII) in activity logs: - **Redact PII** (default) — PII is stored in logs but hidden from view. Only the Super Administrator and users with the [Cloudflare Zero Trust PII role](/cloudflare-one/roles-permissions/#cloudflare-zero-trust-pii) can view redacted PII. The underlying data is preserved — redaction only controls who can see it. @@ -41,5 +43,40 @@ Changes to this setting do not affect PII already stored in previous logs. To turn on the setting to exclude PII: + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic policies** > **Traffic settings**. 2. In **Traffic logging**, turn on **Exclude personally identifiable information (PII) from logs**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Get your current logging settings: + + ```sh + cf zero-trust gateway logging get + ``` + +2. Turn on the setting with [`cf zero-trust gateway logging update`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-logging-update). The **Exclude personally identifiable information (PII) from logs** setting corresponds to `--redact-pii`. `logging update` replaces all logging settings, so pass your current `settings_by_rule_type` values from step 1 along with `--redact-pii true`: + + ```sh + cf zero-trust gateway logging update \ + --redact-pii true \ + --settings-by-rule-type-dns-log-all true \ + --settings-by-rule-type-dns-log-blocks false \ + --settings-by-rule-type-l4-log-all true \ + --settings-by-rule-type-l4-log-blocks false \ + --settings-by-rule-type-http-log-all true \ + --settings-by-rule-type-http-log-blocks false + ``` + + + + + diff --git a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/scim-logs.mdx b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/scim-logs.mdx index 6ce6369843b..015c161bafd 100644 --- a/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/scim-logs.mdx +++ b/src/content/docs/cloudflare-one/insights/logs/dashboard-logs/scim-logs.mdx @@ -18,6 +18,17 @@ SCIM (System for Cross-domain Identity Management) activity logs allow administr For an overview of SCIM events across all users, log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and go to **Zero Trust** > **Insights** > **Logs** > **SCIM provisioning logs**. This page lists the inbound SCIM requests that your identity providers have sent to Cloudflare. You can select an individual request to view more details about the SCIM operation. +To list SCIM requests with the [Cloudflare CLI (`cf`)](/cf/), run `cf zero-trust access logs scim updates list` with the ID of the SCIM-enabled identity provider: + +```sh +cf zero-trust access logs scim updates list \ + --idp-id \ + --since 2026-01-01T00:00:00Z \ + --limit 25 +``` + +To filter the requests, add options such as `--status FAILURE`, `--resource-type USER`, `--request-method PATCH`, or `--resource-user-email user@example.com`. To find the identity provider ID, run `cf zero-trust identity-providers list`. + To investigate how SCIM events impacted a specific user, go to their [User Registry identity](/cloudflare-one/team-and-resources/users/users/). View their last seen identity and group memberships, and track how their identity has changed over time. diff --git a/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/buckets.mdx b/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/buckets.mdx index b326012ef5d..b448fdad442 100644 --- a/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/buckets.mdx +++ b/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/buckets.mdx @@ -10,7 +10,7 @@ tags: - S3 --- -import { GlossaryTooltip, TabItem, Tabs, DashButton } from "~/components"; +import { DashButton, GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; Before you can begin a full packet capture, you must configure a cloud storage bucket where Cloudflare can write the captured traffic data. Setting up a bucket is not required for sample packet captures, which complete immediately and can be downloaded directly from the API. @@ -52,6 +52,31 @@ After the initial bucket setup, you need to confirm you have access to the bucke The **Buckets** tab displays a list of the buckets associated with your account. Refer to the **Status** column to see the status of your bucket configuration. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Magic Firewall Packet Captures - Write PCAPs API** permission. + + +1. Request an ownership challenge for the bucket. For Amazon S3, the bucket URI is in the form `s3:///?region=`, and for Google Cloud Storage the form is `gs:///`. + + ```sh + cf magic-transit pcaps ownership create --destination-conf "s3:///?region=" + ``` + + The `filename` field in the output is the name of the ownership challenge file that Cloudflare placed in your bucket. + +2. Copy the contents of the challenge file and validate the bucket: + + ```sh + cf magic-transit pcaps ownership validate \ + --destination-conf "s3:///?region=" \ + --ownership-challenge "" + ``` + + If the `status` in the output is `success`, the bucket is configured and ready to use. + + The `bucket` field should be the URI of the bucket. For Amazon S3, the `bucket` field is in the form `s3:///?region=`, and for Google Cloud Storage the form is `gs:///`. @@ -134,6 +159,13 @@ View a list of all buckets configured on your account. The list of buckets associated with your account displays. + + + +```sh +cf magic-transit pcaps ownership get +``` + ```bash title="Bucket list request example" diff --git a/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/packet-captures.mdx b/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/packet-captures.mdx index 45c45787b6a..af1fab095cd 100644 --- a/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/packet-captures.mdx +++ b/src/content/docs/cloudflare-one/insights/network-visibility/diagnostics/packet-captures.mdx @@ -10,13 +10,7 @@ tags: - Debugging --- -import { - Details, - GlossaryTooltip, - TabItem, - Tabs, - DashButton, -} from "~/components"; +import { DashButton, Details, GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; Packet captures record network traffic flowing through Cloudflare's network so you can analyze individual packets for troubleshooting or security investigations. The output is contained within one or more files in PCAP format, which you can open in tools like [Wireshark](https://www.wireshark.org/). @@ -65,6 +59,40 @@ For help determining which data center to select for a packet capture, go to [ht The **Network packet captures** page displays a list of captures. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Magic Firewall Packet Captures - Write PCAPs API** permission. + + +1. Create a JSON file with the capture request. The following example requests a sample capture. Use `"type": "simple"` for sample captures. + + ```json title="pcap.json" + { + "type": "simple", + "system": "magic-transit", + "time_limit": 300, + "packet_limit": 10000, + "filter_v1": { + "source_address": "192.0.2.1", + "destination_address": "198.51.100.1", + "destination_port": 80, + "protocol": 6 + } + } + ``` + + For a full capture, set `type` to `full` and add `byte_limit`, `colo`, and `destination_conf` with the URI of a [validated bucket](/cloudflare-one/insights/network-visibility/diagnostics/buckets/). Leave `filter_v1` empty (`{}`) to collect all packets without any filtering. + +2. Start the capture with `cf magic-transit pcaps create`: + + ```sh + cf magic-transit pcaps create --body @pcap.json + ``` + + Note the `id` in the output. While the capture is in progress, its `status` is `pending`. + + The PCAPs API needs both `system` and `type` to be specified to start a capture. A PCAP's `system` is the product or logical subsystem where packets are captured, and a PCAP's `type` is how the captured packets are built into a PCAP file. @@ -189,6 +217,15 @@ The response is a JSON body that contains the details of the job running to buil 2. Go to the **Diagnostics** tab. 3. Locate your capture under **Network packet captures**. + + + +Get the capture by its ID and review the `status` field: + +```sh +cf magic-transit pcaps get +``` + To check the status of a running job, send a request to the endpoint and specify the PCAP identifier. The PCAP identifier is received in the response of a collect request as shown in the previous step. @@ -245,6 +282,17 @@ After your request finishes processing, you can download your packet captures. Packet captures are available to download when the **Status** displays **Success**. + + + +Download a sample capture after its `status` is `success`: + +```sh +cf magic-transit pcaps download get > download.pcap +``` + +For full captures, download the files from the bucket specified in `destination_conf`. + Full captures can produce multiple PCAP files per capture because the capture can run across multiple machines at the data center. To merge these into a single file for analysis, refer to [Wireshark's mergecap documentation](https://www.wireshark.org/docs/man-pages/mergecap.html). @@ -278,6 +326,15 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/pcaps/{pcap_id}/ The list of packet captures associated with your account displays under **Network packet captures**. + + + +List up to 50 completed and ongoing capture requests: + +```sh +cf magic-transit pcaps list +``` + To view a list of sent requests, use the following command: diff --git a/src/content/docs/cloudflare-one/integrations/cloud-and-saas/index.mdx b/src/content/docs/cloudflare-one/integrations/cloud-and-saas/index.mdx index b5b2bb4fd6e..0866cc2bb42 100644 --- a/src/content/docs/cloudflare-one/integrations/cloud-and-saas/index.mdx +++ b/src/content/docs/cloudflare-one/integrations/cloud-and-saas/index.mdx @@ -35,6 +35,59 @@ The workflow pages for managing findings and webhooks appear first, followed by + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Write** permission. + +`cf` supports integrations that do not require you to sign in to the third-party application, such as integrations that use a service account or API key. For integrations that use OAuth, use the dashboard. + + + +1. List the authentication methods for the application, and review the `payload_schema` of the method you want to use. The schema describes the credentials that the integration requires: + + ```sh + cf zero-trust casb applications auth-methods list --application-id google_cloud_platform + ``` + + To list every application that CASB supports, run `cf zero-trust casb applications list`. If `human_interaction_required` is `true` for a method, use the dashboard. + +2. Create a JSON file with the credentials. For example, a Google Cloud Platform integration takes the contents of a service account JSON key: + + ```json title="credentials.json" + { + "service_account_credentials": { + "type": "service_account", + "project_id": "", + "private_key_id": "", + "private_key": "", + "client_email": "", + "client_id": "", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "" + } + } + ``` + +3. Create the integration with [`cf zero-trust casb integrations create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-integrations-create): + + ```sh + cf zero-trust casb integrations create \ + --name "Google Cloud Platform" \ + --application GOOGLE_CLOUD_PLATFORM \ + --auth-method google_cloud_platform_service_account \ + --use-cases casb \ + --credentials @credentials.json + ``` + + - `--application`: The application, in uppercase, for example `GOOGLE_CLOUD_PLATFORM`. + - `--auth-method`: The `id` of the authentication method from step 1. + - `--use-cases`: Set to `casb`. To also allow CASB to remediate findings, add `auto_remediation`. + - `--dlp-profiles`: (Optional) The IDs of [DLP profiles](/cloudflare-one/data-loss-prevention/dlp-profiles/) to scan for. + + + Terraform supports only integrations that do not use OAuth. The `cloudflare_zero_trust_casb_integration` resource requires version 5.27.0 or later of the [Cloudflare Terraform provider](/terraform/). Version 4 is not supported. diff --git a/src/content/docs/cloudflare-one/integrations/cloud-and-saas/webhooks.mdx b/src/content/docs/cloudflare-one/integrations/cloud-and-saas/webhooks.mdx index edf64dbc981..644003e8ba3 100644 --- a/src/content/docs/cloudflare-one/integrations/cloud-and-saas/webhooks.mdx +++ b/src/content/docs/cloudflare-one/integrations/cloud-and-saas/webhooks.mdx @@ -30,6 +30,7 @@ After you configure a webhook destination, you can test delivery from the **Webh + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Integrations** > **Webhooks**. 2. Select **Create webhook**. 3. Enter a **Name** for the webhook. @@ -38,6 +39,42 @@ After you configure a webhook destination, you can test delivery from the **Webh 6. Enter the required credentials, headers, or signing secret. 7. (Optional) Select **Test delivery** to validate the destination before saving. 8. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **CASB Write** permission. + + +1. (Optional) Test delivery to the destination before you create the webhook with [`cf zero-trust casb webhooks evaluate`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-evaluate): + + ```sh + cf zero-trust casb webhooks evaluate \ + --destination-url https://example.com/webhook \ + --authentication-type "Bearer Auth" \ + --headers '[{"key":"Authorization","value":"Bearer "}]' + ``` + + The output includes `success` and the `status_code` that the destination returned. + +2. Create the webhook with [`cf zero-trust casb webhooks create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-create): + + ```sh + cf zero-trust casb webhooks create \ + --label "Send to SIEM" \ + --destination-url https://example.com/webhook \ + --authentication-type "Bearer Auth" \ + --headers '[{"key":"Authorization","value":"Bearer "}]' + ``` + + - `--label`: The webhook **Name**. + - `--authentication-type`: The **Authentication method**: `None`, `Basic Auth`, `Bearer Auth`, `Static Headers`, or `HMAC-Signing`. + - `--headers`: The headers to send. Header values are not returned in the output. + - `--signing-secret`: The signing secret, for `HMAC-Signing`. + - `--status`: (Optional) `enabled` or `disabled`. Defaults to `enabled`. + +3. Note the `id` in the output. You need it to update, delete, or send findings to the webhook. + @@ -113,15 +150,40 @@ Test delivery does not send a live finding instance from your environment. To update an existing webhook: + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Integrations** > **Webhooks**. 2. Select the webhook you want to update. 3. Modify the webhook configuration. 4. Select **Save**. + To turn a webhook off or on, use the status toggle on the **Webhooks** page. To delete a webhook, open the webhook menu and select **Delete**. + + +[`cf zero-trust casb webhooks update`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-update) replaces the existing configuration, so pass `--label`, `--destination-url`, `--authentication-type`, and `--status` along with every header you want to keep. To keep a stored header value, pass its `key` without a `value`. + +For example, to turn a webhook off: + +```sh +cf zero-trust casb webhooks update \ + --label "Send to SIEM" \ + --destination-url https://example.com/webhook \ + --authentication-type "Bearer Auth" \ + --headers '[{"key":"Authorization"}]' \ + --status disabled +``` + +To test delivery to an existing webhook, run `cf zero-trust casb webhooks evaluate-existing `. + +To delete a webhook, run [`cf zero-trust casb webhooks delete`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-delete): + +```sh +cf zero-trust casb webhooks delete +``` + To update a webhook, make a `PUT` request to the [Update a webhook](/api/resources/zero_trust/subresources/casb/subresources/posture/subresources/webhooks/methods/update/) endpoint with `label`, `destination_url`, `authentication_type`, and `status`. The request replaces the existing configuration, so include every header you want to keep. To keep a stored header value, send its `key` without a `value`. @@ -192,6 +254,10 @@ data "cloudflare_zero_trust_casb_webhooks" "all" { After you configure one or more webhook destinations, you can send posture finding instances directly from the findings workflow. + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Cloud & SaaS findings** > **Posture Findings**. 2. Choose **SaaS** or **Cloud**. 3. Choose the finding you want to review, then select **Manage**. @@ -199,6 +265,31 @@ After you configure one or more webhook destinations, you can send posture findi 5. In the instance details panel, select **Send webhook**. 6. Choose the webhook destination or destinations you want to use. 7. Select **Send webhooks**. + + + + + + +1. Find the `id` of the finding with `cf zero-trust casb findings list --type Posture`, and then the `id` of the instance: + + ```sh + cf zero-trust casb findings instances list --finding-id + ``` + +2. Send the instance to one or more webhooks with [`cf zero-trust casb webhooks jobs create`](/cloudflare-one/cloud-and-saas-findings/cli-commands/#cf-zero-trust-casb-webhooks-jobs-create): + + ```sh + cf zero-trust casb webhooks jobs create \ + --webhook-ids \ + --finding-instance-ids + ``` + + CASB creates one job for each combination of webhook and instance, up to 100 jobs per request. + + + + Cloudflare queues webhook sends in the background. A success message means that Cloudflare accepted the request for delivery. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/adfs.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/adfs.mdx index 29a6d78fff0..b2905f22c83 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/adfs.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/adfs.mdx @@ -9,7 +9,7 @@ tags: description: Integrate Active Directory with Cloudflare One for secure identity management. --- -import { GlossaryTooltip, Render } from "~/components"; +import { GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; :::caution Microsoft recommends migrating your Active Directory Federation Service (AD FS) SSO to Microsoft Entra ID. For more information, refer to [Microsoft Learn](https://learn.microsoft.com/windows-server/identity/ad-fs/ad-fs-overview). @@ -139,6 +139,11 @@ Set-ADFSRelyingPartyTrust -TargetName "Name of RPT Display Name" -SamlResponseSi To enable Cloudflare One to accept the claims and assertions sent from AD FS, follow these steps: + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **SAML**. @@ -165,6 +170,46 @@ To enable Cloudflare One to accept the claims and assertions sent from AD FS, fo 8. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from AD FS: + + ```json title="adfs-idp.json" + { + "name": "AD FS", + "type": "saml", + "config": { + "sso_target_url": "https:///adfs/ls/", + "issuer_url": "", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The default AD FS sign-in endpoint, `https:///adfs/ls/`. + - `issuer_url`: Your AD FS federation service identifier, as returned by `(Get-AdfsProperties).Identifier`. Do not use the Cloudflare callback URL. + - `idp_public_certs`: The exported AD FS certificate, in PEM format with line breaks escaped as `\n`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @adfs-idp.json + ``` + +3. Note the `id` in the output. + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the identity provider you want to test. ## Download SP metadata (optional) diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-oidc.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-oidc.mdx index 16bf176c456..9c7490a8523 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-oidc.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-oidc.mdx @@ -8,7 +8,7 @@ tags: - SSO --- -import { DashButton, Render, Steps } from "~/components"; +import { DashButton, Render, Steps, TabItem, Tabs } from "~/components"; Connect authentik to Cloudflare Access with OpenID Connect (OIDC). OIDC is the recommended protocol when your identity provider supports both OIDC and SAML. @@ -48,6 +48,9 @@ For more information about authentik provider settings, refer to [OAuth 2.0 prov ## 2. Add authentik to Cloudflare Access + + + 1. In Cloudflare Zero Trust, go to **Integrations** > **Identity providers**. @@ -68,6 +71,43 @@ For more information about authentik provider settings, refer to [OAuth 2.0 prov 4. Select **Save**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from authentik: + + ```json title="authentik-idp.json" + { + "name": "authentik", + "type": "oidc", + "config": { + "client_id": "", + "client_secret": "", + "auth_url": "https:///application/o/authorize/", + "token_url": "https:///application/o/token/", + "certs_url": "https:///application/o//jwks/" + } + } + ``` + + - `client_id` and `client_secret`: The authentik **Client ID** and **Client Secret**. + - Replace `` with your authentik hostname and `` with the application slug from authentik. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @authentik-idp.json + ``` + +3. Note the `id` in the output. + + + + + The token and certificate endpoints must allow requests from Cloudflare. Interactive challenges or firewall rules on these endpoints can prevent Access from completing authentication. ## 3. Test the integration diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-saml.mdx index 56a82f895b1..cd4ec803c0b 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/authentik-saml.mdx @@ -8,7 +8,7 @@ tags: - SAML --- -import { DashButton, Render, Steps } from "~/components"; +import { DashButton, Render, Steps, TabItem, Tabs } from "~/components"; Connect authentik to Cloudflare Access with Security Assertion Markup Language (SAML) 2.0. @@ -65,6 +65,9 @@ The metadata tab also contains the SAML endpoint, entity ID, and signing certifi ## 3. Add authentik to Cloudflare Access + + + 1. In Cloudflare Zero Trust, go to **Integrations** > **Identity providers**. @@ -77,6 +80,43 @@ The metadata tab also contains the SAML endpoint, entity ID, and signing certifi 6. Select **Save**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from authentik: + + ```json title="authentik-idp.json" + { + "name": "authentik", + "type": "saml", + "config": { + "sso_target_url": "https:///application/saml//", + "issuer_url": "https:///application/saml//metadata/", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url` and `issuer_url`: The **Single Sign-On URL** and **IdP Entity ID or Issuer URL** from authentik. + - `idp_public_certs`: The signing certificate downloaded from authentik, in PEM format with line breaks escaped as `\n`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @authentik-idp.json + ``` + +3. Note the `id` in the output. + + + + + :::caution Access cannot verify SAML responses after the authentik signing certificate expires or changes. Update the certificate in Cloudflare Access before you rotate it in authentik. ::: diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/aws-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/aws-saml.mdx index 110da348897..2eeacebfdd4 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/aws-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/aws-saml.mdx @@ -9,7 +9,7 @@ tags: - AWS --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; AWS IAM Identity Center provides SSO identity management for users who interact with AWS resources (such as EC2 instances or S3 buckets). You can integrate AWS IAM with Cloudflare Zero Trust as a SAML identity provider, which allows users to authenticate to Zero Trust using their AWS credentials. @@ -53,6 +53,11 @@ https://.cloudflareaccess.com/cdn-cgi/access/callback 15. Select **Save changes**. 16. Under **Assign users and groups**, add individuals and/or groups that should be allowed to login to Cloudflare One. + + + + + 17. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 18. Under **Your identity providers**, select **Add new identity provider**. 19. Select **SAML**. @@ -61,6 +66,48 @@ https://.cloudflareaccess.com/cdn-cgi/access/callback 22. (Recommended) Enable [**Sign SAML authentication request**](/cloudflare-one/integrations/identity-providers/generic-saml/#sign-saml-authentication-request). 23. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from the IAM Identity Center SAML metadata file that you downloaded in Step 8: + + ```json title="aws-idp.json" + { + "name": "AWS", + "type": "saml", + "config": { + "sso_target_url": "", + "issuer_url": "", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "sign_request": true + } + } + ``` + + - `sso_target_url`: The single sign-on URL (`SingleSignOnService` location) from the metadata file. + - `issuer_url`: The `entityID` from the metadata file. + - `idp_public_certs`: The signing certificate (`X509Certificate`) from the metadata file, in PEM format with line breaks escaped as `\n`. + - `sign_request`: (Recommended) Set to `true` to [sign SAML authentication requests](/cloudflare-one/integrations/identity-providers/generic-saml/#sign-saml-authentication-request). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @aws-idp.json + ``` + +3. Note the `id` in the output. + + + + + To [test](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) that your connection is working, select **Test**. ## Example API configuration diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/awscognito-oidc.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/awscognito-oidc.mdx index c1bee974b9a..d822e9c1ae8 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/awscognito-oidc.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/awscognito-oidc.mdx @@ -8,7 +8,7 @@ tags: - AWS --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Amazon Cognito provides SSO identity management for end users of web and mobile apps. You can integrate Amazon Cognito as an OIDC identity provider for Cloudflare One. @@ -61,6 +61,11 @@ To retrieve those values: ### 2. Add Amazon Cognito as an identity provider + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **OpenID Connect**. @@ -69,6 +74,48 @@ To retrieve those values: 6. (Optional) Under **Optional configurations**, enter [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to users' identity. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Amazon Cognito: + + ```json title="cognito-idp.json" + { + "name": "Amazon Cognito", + "type": "oidc", + "config": { + "client_id": "", + "client_secret": "", + "auth_url": "https:///oauth2/authorize", + "token_url": "https:///oauth2/token", + "certs_url": "https://cognito-idp..amazonaws.com//.well-known/jwks.json", + "scopes": ["openid", "email", "profile"], + "claims": ["sub", "cognito:username", "name", "cognito:groups"], + "pkce_enabled": false + } + } + ``` + + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + - `claims`: (Optional) [Custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @cognito-idp.json + ``` + +3. Note the `id` in the output. To [test](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) that your connection is working, select **Test** next to the identity provider in the dashboard. + + + + + To [test](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) that your connection is working, select **Test**. ## Example API Configuration diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/centrify-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/centrify-saml.mdx index 807d190072d..8f219260af8 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/centrify-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/centrify-saml.mdx @@ -8,7 +8,7 @@ tags: description: Learn how to integrate Centrify as a SAML identity provider with Cloudflare One. --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Use Centrify as a SAML identity provider for Cloudflare Access. @@ -52,6 +52,11 @@ Use Centrify as a SAML identity provider for Cloudflare Access. ### 2. Add Centrify to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **SAML**. @@ -60,6 +65,47 @@ Use Centrify as a SAML identity provider for Cloudflare Access. 6. (Optional) Under **Optional configurations**, configure [additional SAML options](/cloudflare-one/integrations/identity-providers/generic-saml/#optional-configurations). 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Centrify: + + ```json title="centrify-saml-idp.json" + { + "name": "Centrify SAML", + "type": "saml", + "config": { + "sso_target_url": "https://.my.centrify.com/applogin/appKey//customerId/", + "issuer_url": "https://.my.centrify.com/", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The single sign-on URL from Centrify. + - `issuer_url`: The IdP entity ID or issuer URL from Centrify. + - `idp_public_certs`: The signing certificate from Centrify, in PEM format with line breaks escaped as `\n`. + - (Optional) To configure [additional SAML options](/cloudflare-one/integrations/identity-providers/generic-saml/#optional-configurations), add fields such as `sign_request`, `email_attribute_name`, `attributes`, and `header_attributes` to `config`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @centrify-saml-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-saml/#synchronize-users-and-groups). + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the identity provider you want to test. ## Download SP metadata (optional) diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/centrify.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/centrify.mdx index 33cd10d930d..68cb362b8fa 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/centrify.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/centrify.mdx @@ -9,7 +9,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Use Centrify as an OIDC identity provider for Cloudflare Access. @@ -54,6 +54,11 @@ Use Centrify as an OIDC identity provider for Cloudflare Access. ### 2. Add Centrify to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Paste in the **Client ID**, **Client Secret**, **Centrify account URL** and **Application ID**. @@ -61,6 +66,45 @@ Use Centrify as an OIDC identity provider for Cloudflare Access. 5. (Optional) Under **Optional configurations**, enter [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Centrify: + + ```json title="centrify-idp.json" + { + "name": "Centrify", + "type": "centrify", + "config": { + "client_id": "", + "client_secret": "", + "centrify_account": "https://.my.centrify.com/", + "centrify_app_id": "" + } + } + ``` + + - `centrify_account`: Your **Centrify account URL**. + - `centrify_app_id`: The **Application ID** of the Centrify application. + - `claims`: (Optional) [Custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @centrify-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-oidc/#synchronize-users-and-groups). + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the identity provider you want to test. ## Example API Config diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/citrixadc-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/citrixadc-saml.mdx index 49a5e007607..6d264c87223 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/citrixadc-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/citrixadc-saml.mdx @@ -8,6 +8,8 @@ tags: - SAML --- +import { Steps, TabItem, Tabs } from "~/components"; + Cloudflare One can integrate with Citrix ADC (formerly Citrix NetScaler ADC) as a SAML IdP. Documentation from Citrix shows you [how to configure Citrix ADC as a SAML IdP](https://docs.citrix.com/en-us/citrix-adc/12-1/aaa-tm/saml-authentication/citrix-adc-saml-idp.html). These steps are specific to Cloudflare One. ## Set up Citrix ADC (SAML) @@ -72,6 +74,11 @@ To set up Citrix ADC (SAML) as your identity provider: bind authentication vserver nsidp -policy samlPol_CloudflareAccess ``` + + + + + 3. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 4. Under **Your identity providers**, select **Add new identity provider**. 5. Configure the fields as follows: @@ -86,4 +93,46 @@ To set up Citrix ADC (SAML) as your identity provider: 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from NetScaler: + + ```json title="citrix-adc-idp.json" + { + "name": "Citrix ADC", + "type": "saml", + "config": { + "sso_target_url": "https://idp.example.com/saml/login", + "issuer_url": "https://idp.example.com/saml/login", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "email_attribute_name": "email" + } + } + ``` + + - `sso_target_url`: The FQDN of the IdP, with the path `/saml/login`. + - `issuer_url`: The same value as `sso_target_url`. + - `idp_public_certs`: The public certificate from the NetScaler, in PEM format with line breaks escaped as `\n`. + - `email_attribute_name`: The name of the SAML attribute that contains the user's email. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @citrix-adc-idp.json + ``` + +3. Note the `id` in the output. + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the identity provider you want to test. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/cli-commands.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/cli-commands.mdx new file mode 100644 index 00000000000..0855b773dbb --- /dev/null +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/cli-commands.mdx @@ -0,0 +1,56 @@ +--- +pcx_content_type: reference +title: Identity provider CLI commands +description: Manage identity provider integrations, SCIM resources, IdP federation grants, and SAML encryption certificates from the command line using the Cloudflare CLI (cf). +sidebar: + order: 101 +products: + - cloudflare-one +--- + +import { CfCommand, CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust identity-providers` commands to add and configure identity providers (IdPs), review and clean up SCIM-provisioned users and groups, share an IdP across accounts with IdP federation, and create SAML encryption certificates from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Read** permission (or **Access: Organizations, Identity Providers, and Groups Write** to make changes). + +:::note +`cf zero-trust identity-providers` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- `create` and `update` only accept `--body`. Pass the identity provider as JSON, either inline or from a file with `--body @idp.json`. The JSON uses the same `name`, `type`, `config`, and `scim_config` fields as the [Identity Providers API](/api/resources/zero_trust/subresources/identity_providers/methods/create/). `config` fields depend on `type`. For the fields of each IdP, refer to the IdP-specific pages, for example [Generic OIDC](/cloudflare-one/integrations/identity-providers/generic-oidc/) or [Okta](/cloudflare-one/integrations/identity-providers/okta/). +- `update` replaces the whole identity provider. If you omit a `config` field, it is removed. To change a setting, save the output of `get` to a file, edit it, and pass the file to `update`. `get` does not return secrets such as `client_secret`. Access keeps the stored secret if you omit it. If you change where Access sends the secret, for example the `token_url` of an OIDC IdP, you must pass the secret again. +- When you turn on SCIM with `update`, the output includes the SCIM `secret`. Copy it immediately. `get` does not return it again. +- `create` and `update` do not test the connection to your IdP. To test an IdP, use the dashboard. +- Pass `-f` (`--force`) to `delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. You cannot delete an IdP that has an [IdP federation grant](/cloudflare-one/integrations/identity-providers/idp-federation/). Delete the grant first. + +::: + +## `zero-trust identity-providers` + +Add, inspect, update, and delete the [identity providers](/cloudflare-one/integrations/identity-providers/) that users can sign in with. To list only IdPs with SCIM turned on, pass `--scim-enabled true` to `list`. + + + + + + + + + + + +## `zero-trust identity-providers scim` + +List, inspect, and delete the [SCIM-provisioned users and groups](/cloudflare-one/team-and-resources/users/scim-population-viewer/) of an IdP. Deleting a SCIM resource removes it from the IdP's SCIM population in Cloudflare. It does not delete the user or group in your IdP. + + + +## `zero-trust identity-providers federation-grants` + +Create and manage [IdP federation](/cloudflare-one/integrations/identity-providers/idp-federation/) grants, which permit an IdP to be shared with other accounts in your Cloudflare Organization. + + + +## `zero-trust identity-providers saml-certificate` + +Create the certificate that a SAML IdP uses to [encrypt SAML assertions](/cloudflare-one/integrations/identity-providers/generic-saml/#encrypt-saml-assertions). If the IdP already has a certificate, the command returns the existing certificate set. To rotate the certificate, use [`cf zero-trust access saml-encryption-certificates rotate`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-saml-encryption-certificates-rotate). + + diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/cloudflare.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/cloudflare.mdx index f98b9559eff..9b5210de374 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/cloudflare.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/cloudflare.mdx @@ -10,7 +10,7 @@ tags: - REST API --- -import { Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; Cloudflare Access can use Cloudflare itself as an identity provider, allowing you to build Access policies that match on Cloudflare account membership. This is useful for scenarios where you want to restrict access to users who are members of a specific Cloudflare account, without requiring a third-party identity provider. @@ -22,11 +22,26 @@ For newly created Zero Trust organizations, Cloudflare adds this identity provid + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **Cloudflare**. 4. (Optional) Enable **Restrict to account members** if you want to limit authentication to users who are members of your Cloudflare account. When disabled, any user with a Cloudflare account can authenticate. 5. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Add the Cloudflare identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + +```sh +cf zero-trust identity-providers create \ + --body '{"name": "Cloudflare", "type": "cloudflare", "config": {"restrict_to_account_members": true}}' +``` + +Set `restrict_to_account_members` to `true` to limit authentication to users who are members of your Cloudflare account, or to `false` to allow any user with a Cloudflare account. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/entra-id.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/entra-id.mdx index 614c84e474b..77709357ca0 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/entra-id.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/entra-id.mdx @@ -9,7 +9,7 @@ tags: - SCIM --- -import { Render, Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; You can integrate Microsoft Entra ID (formerly Azure Active Directory) with Cloudflare One and build policies based on user identity and group membership. Users will authenticate to Cloudflare One using their Entra ID credentials. @@ -96,6 +96,8 @@ More narrow permissions may be used, however this is the set of permissions that + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -116,6 +118,47 @@ More narrow permissions may be used, however this is the set of permissions that - **Email claim**: Enter the Entra ID claim that you wish to use for user identification (for example, `preferred_username`). - **OIDC Claims**: Enter [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Microsoft Entra ID: + + ```json title="entra-id-idp.json" + { + "name": "Entra ID example", + "type": "azureAD", + "config": { + "client_id": "", + "client_secret": "", + "directory_id": "", + "support_groups": true + } + } + ``` + + You can also set the following optional `config` fields: + + - `pkce_enabled`: Set to `true` to perform [PKCE](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + - `support_groups`: Corresponds to **Support Groups**. Allows Cloudflare to read a user's Entra ID group membership. + - `conditional_access_enabled`: Corresponds to **Entra ID Policy Sync**. Refer to our [Entra ID Conditional Access tutorial](/cloudflare-one/tutorials/entra-id-conditional-access/). + - `email_claim_name`: Corresponds to **Email claim**, for example `preferred_username`. + - `claims`: Corresponds to **OIDC Claims**. A list of [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @entra-id-idp.json + ``` + +3. Note the `id` in the output. To [test](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) that your connection is working, select **Test** next to the identity provider in the dashboard. + +4. (Optional) To enable SCIM, refer to [Synchronize users and groups](#synchronize-users-and-groups). + + Make a `POST` request to the [Identity Providers](/api/resources/zero_trust/subresources/identity_providers/methods/create/) endpoint: @@ -188,6 +231,10 @@ The Microsoft Entra ID integration allows you to synchronize IdP groups and auto ### 1. Enable SCIM in Cloudflare One + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Find the Entra ID integration and select **Edit**. @@ -196,17 +243,58 @@ The Microsoft Entra ID integration allows you to synchronize IdP groups and auto 4. (Optional) Configure the following settings: -* **Enable user deprovisioning**: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when they are removed from the SCIM application in Entra ID. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). -* **Remove user seat on deprovision**: [Remove a user's seat](/cloudflare-one/team-and-resources/users/seat-management/) from your Cloudflare One account when they are removed from the SCIM application in Entra ID. -* **SCIM identity update behavior**: Choose what happens in Cloudflare One when the user's identity updates in Entra ID. - - _Automatic identity updates_: Automatically update the [User Registry identity](/cloudflare-one/team-and-resources/users/users/) when Entra ID sends an updated identity or group membership through SCIM. This identity is used for Gateway policies and Cloudflare One Client [device profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/); Access will read the user's updated identity when they reauthenticate. - - _Group membership change reauthentication_: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when their group membership changes in Entra ID. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). Access will read the user's updated group membership when they reauthenticate. - - _No action_: Update the user's identity the next time they reauthenticate to Access or the Cloudflare One Client. + * **Enable user deprovisioning**: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when they are removed from the SCIM application in Entra ID. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). + * **Remove user seat on deprovision**: [Remove a user's seat](/cloudflare-one/team-and-resources/users/seat-management/) from your Cloudflare One account when they are removed from the SCIM application in Entra ID. + * **SCIM identity update behavior**: Choose what happens in Cloudflare One when the user's identity updates in Entra ID. + - _Automatic identity updates_: Automatically update the [User Registry identity](/cloudflare-one/team-and-resources/users/users/) when Entra ID sends an updated identity or group membership through SCIM. This identity is used for Gateway policies and Cloudflare One Client [device profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/); Access will read the user's updated identity when they reauthenticate. + - _Group membership change reauthentication_: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when their group membership changes in Entra ID. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). Access will read the user's updated group membership when they reauthenticate. + - _No action_: Update the user's identity the next time they reauthenticate to Access or the Cloudflare One Client. 5. Select **Regenerate Secret**. Copy the **SCIM Endpoint** and **SCIM Secret**. You will need to enter these values into Entra ID. 6. Select **Save**. + + + + + +1. Save the current configuration of the Entra ID integration to a file: + + ```sh + cf zero-trust identity-providers get > idp.json + ``` + + To find the IdP ID, run `cf zero-trust identity-providers list`. + +2. In `idp.json`, set `config.support_groups` to `true` and set the `scim_config` object. For example: + + ```json title="idp.json" + "scim_config": { + "enabled": true, + "user_deprovision": true, + "seat_deprovision": true, + "identity_update_behavior": "automatic" + } + ``` + + - `user_deprovision`: Corresponds to **Enable user deprovisioning**. + - `seat_deprovision`: Corresponds to **Remove user seat on deprovision**. + - `identity_update_behavior`: Corresponds to **SCIM identity update behavior**. Use `automatic` (_Automatic identity updates_), `reauth` (_Group membership change reauthentication_), or `no_action` (_No action_). + + Keep all other fields from the `get` output. You do not need to add the `client_secret`. + +3. Update the identity provider with [`cf zero-trust identity-providers update`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-update): + + ```sh + cf zero-trust identity-providers update --body @idp.json + ``` + +4. In the output, copy the `scim_base_url` (**SCIM Endpoint**) and `secret` (**SCIM Secret**) values from `scim_config`. You will need to enter these values into Entra ID. The secret is only shown when SCIM is first turned on. To regenerate the secret later, use the dashboard. + + + + The SCIM secret never expires, but you can manually regenerate the secret at any time. ### 2. Configure SCIM in Entra ID diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/facebook-login.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/facebook-login.mdx index de21a4873fc..f306d31d321 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/facebook-login.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/facebook-login.mdx @@ -8,7 +8,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Use these steps to set up Facebook as your identity provider. @@ -19,11 +19,54 @@ Use these steps to set up Facebook as your identity provider. 5. Fill in the necessary information and select **Next** until you reach **Overview**. Then, select **Create app**. 6. In the **My Apps** page, go to **App settings** > **Basic**. 7. Copy the **App ID** and **App Secret**. + + + + + 8. In the [Cloudflare dashboard](https://dash.cloudflare.com), go to **Zero Trust** > **Integrations** > **Identity providers**. 9. Under **Your identity providers**, select **Add an identity provider**. 10. Fill in the **App ID** and **App Secret** obtained from Facebook. 11. (Optional) Enable [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/). PKCE will be performed on all login attempts. 12. Select **Save**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Facebook: + + ```json title="facebook-idp.json" + { + "name": "Facebook", + "type": "facebook", + "config": { + "client_id": "", + "client_secret": "", + "pkce_enabled": false + } + } + ``` + + - `client_id` and `client_secret`: The **App ID** and **App Secret** obtained from Facebook. + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @facebook-idp.json + ``` + +3. Note the `id` in the output. Then continue with the next step in Facebook. + + + + + 13. Go back to **My Apps** in [developers.facebook.com](https://developers.facebook.com/), and select your app. 14. Under **App customization and requirements**, select **Customize the Authenticate and request data from users with Facebook Login use case**. 15. Select **Settings**, and ensure that **Use Strict Mode for redirect URIs** slider is set to **Yes**. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/generic-oidc.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/generic-oidc.mdx index d59846e225f..3fed8ba7bd3 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/generic-oidc.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/generic-oidc.mdx @@ -10,7 +10,7 @@ sidebar: order: 2 --- -import { Tabs, TabItem, Render, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare Access has a generic OpenID Connect (OIDC) connector to help you integrate IdPs not already set in Access. @@ -35,6 +35,8 @@ Cloudflare Access has a generic OpenID Connect (OIDC) connector to help you inte + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -51,6 +53,48 @@ Cloudflare Access has a generic OpenID Connect (OIDC) connector to help you inte 8. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your identity provider: + + ```json title="oidc-idp.json" + { + "name": "Generic OIDC example", + "type": "oidc", + "config": { + "client_id": "", + "client_secret": "", + "auth_url": "https://idp.example.com/oauth2/authorize", + "token_url": "https://idp.example.com/oauth2/token", + "certs_url": "https://idp.example.com/oauth2/keys", + "pkce_enabled": false, + "email_claim_name": "email", + "claims": ["employeeID", "groups"], + "scopes": ["openid", "email", "profile"] + } + } + ``` + + - `auth_url`, `token_url`, and `certs_url`: The `authorization_endpoint`, `token_endpoint`, and `jwks_uri` URLs from your IdP's OIDC discovery endpoint. + - `pkce_enabled`: Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts, if your IdP supports it. + - `claims`: (Optional) [Custom OIDC claims](#custom-oidc-claims) to add to users' identity. + - `email_claim_name`: (Optional) The [email claim](#email-claim) that Access uses to identify users. + - `scopes`: (Optional) Additional OAuth scopes to request from your IdP. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @oidc-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](#synchronize-users-and-groups). + + Make a `POST` request to the [Identity Providers](/api/resources/zero_trust/subresources/identity_providers/methods/create/) endpoint: @@ -148,6 +192,10 @@ All OIDC IdP integrations support the use of custom OIDC claims. Once configured To add a custom OIDC claim to an IdP integration: + + + + 1. In your identity provider, ensure that the custom claim is included in your OIDC ID token. 2. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 3. Under **Your identity providers**, find your identity provider and select **Edit**. @@ -161,6 +209,36 @@ To add a custom OIDC claim to an IdP integration: }, ``` + + + + + +1. In your identity provider, ensure that the custom claim is included in your OIDC ID token. + +2. Save the current configuration of the identity provider to a file: + + ```sh + cf zero-trust identity-providers get > idp.json + ``` + + To find the IdP ID, run `cf zero-trust identity-providers list`. + +3. In `idp.json`, add the name of your custom claim to the `config.claims` array, for example `"claims": ["oid"]`. + +4. Update the identity provider with [`cf zero-trust identity-providers update`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-update): + + ```sh + cf zero-trust identity-providers update --body @idp.json + ``` + + `update` replaces the whole identity provider, so keep all other fields from the `get` output. You do not need to add the `client_secret`. Access keeps the stored value. + +5. To verify that the custom claim appears in `oidc_fields`, select **Test** next to the identity provider in the dashboard. `cf` does not support testing identity providers. + + + + You can now build an Access policy for the custom claim using the **OIDC Claim** or **IdP OIDC Claim** selector. You can also use custom OIDC claims as [identity-based selectors in Gateway policies](/cloudflare-one/traffic-controls/identity-selectors/#oidc-claims). The custom claim will be passed to origins behind Access in a [JWT](/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/application-token/#custom-saml-attributes-and-oidc-claims). #### Email claim diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/generic-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/generic-saml.mdx index 9b32e537006..edf16731fe3 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/generic-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/generic-saml.mdx @@ -10,7 +10,7 @@ sidebar: order: 2 --- -import { Tabs, TabItem, Render, Steps } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One integrates with any identity provider that supports SAML 2.0. If your identity provider is not listed in the integration list of login methods in Cloudflare One, it can be configured using SAML 2.0 (or OpenID if OIDC based). Generic SAML can also be used if you would like to pass additional SAML headers or claims for an IdP in the integration list. @@ -65,6 +65,44 @@ To download the SAML metadata file, copy-paste the metadata endpoint into a web + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your identity provider: + + ```json title="saml-idp.json" + { + "name": "Generic SAML example", + "type": "saml", + "config": { + "sso_target_url": "https://idp.example.com/sso/saml", + "issuer_url": "https://idp.example.com", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "sign_request": false, + "email_attribute_name": "email", + "attributes": ["employeeID", "groups"] + } + } + ``` + + - `sso_target_url`: The **Single Sign on URL** from your identity provider. + - `issuer_url`: The **IdP Entity ID or Issuer URL** from your identity provider. + - `idp_public_certs`: The **Signing certificate** from your identity provider, in PEM format with line breaks escaped as `\n`. To [fetch certificates from IdP metadata](#discover-idp-signing-certificates) instead, replace `idp_public_certs` with `"metadata_url": ""`. + - `sign_request`, `email_attribute_name`, `attributes`: (Optional) Refer to [Optional configurations](#optional-configurations). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @saml-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](#synchronize-users-and-groups). + + 1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token): @@ -196,12 +234,38 @@ SAML assertion encryption is separate from [signed AuthN requests](/cloudflare-o To turn on SAML assertion encryption: + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Select your SAML identity provider and select **Edit**. 3. Under **SAML encryption**, turn on the **Enable SAML encryption** toggle. Access will automatically generate an encryption certificate. 4. Copy the displayed certificate (in PEM format) or the certificate set ID. 5. In your identity provider, upload the Cloudflare encryption certificate and turn on assertion encryption. Refer to your IdP documentation for the exact configuration steps. 6. Select **Save**. + + + + + +1. Find the ID of your SAML identity provider: + + ```sh + cf zero-trust identity-providers list + ``` + +2. Generate the encryption certificate with [`cf zero-trust identity-providers saml-certificate create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-saml-certificate-create): + + ```sh + cf zero-trust identity-providers saml-certificate create + ``` + + The output includes the certificate set ID (`uid`) and the certificate in PEM format (`current_certificate.public_certificate`). If the identity provider already has an encryption certificate, the command returns the existing certificate. + +3. In your identity provider, upload the Cloudflare encryption certificate and turn on assertion encryption. Refer to your IdP documentation for the exact configuration steps. + + + After you turn on encryption, Access will reject any unencrypted assertions from the configured IdP. If you turn off encryption, Access will reject any encrypted assertions until encryption is turned back on. @@ -228,10 +292,40 @@ Encryption certificates are valid for one year. Thirty days before a certificate To manually rotate a certificate: + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Select your SAML identity provider and select **Edit**. 3. Under **SAML encryption**, select **Rotate certificate**. 4. Upload the new certificate to your identity provider. + + + + + +1. Get the certificate set ID of your SAML identity provider from the `saml_certificate_set_id` field: + + ```sh + cf zero-trust identity-providers get + ``` + +2. Rotate the certificate with [`cf zero-trust access saml-encryption-certificates rotate`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-saml-encryption-certificates-rotate): + + ```sh + cf zero-trust access saml-encryption-certificates rotate + ``` + +3. Get the new certificate from the `current_certificate.public_certificate` field: + + ```sh + cf zero-trust access saml-encryption-certificates get + ``` + +4. Upload the new certificate to your identity provider. + + + :::caution If you rotate again before updating your IdP with the current certificate, the previous certificate will be immediately invalidated. This may break authentication for users whose IdP is still encrypting assertions with the old certificate. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/github.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/github.mdx index e5b50a41350..3ed620c2729 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/github.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/github.mdx @@ -8,7 +8,7 @@ tags: - GitHub --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One allows your team to connect to your applications using their GitHub login. You do not need to have a GitHub organization to use the integration. @@ -44,6 +44,11 @@ To configure GitHub access in both GitHub and Cloudflare One: 9. Select **Generate a new client secret** and copy the client secret to a safe place. + + + + + 10. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 11. Select **Add new identity provider** and select **GitHub**. @@ -54,6 +59,42 @@ To configure GitHub access in both GitHub and Cloudflare One: 14. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from GitHub: + + ```json title="github-idp.json" + { + "name": "GitHub", + "type": "github", + "config": { + "client_id": "", + "client_secret": "" + } + } + ``` + + - `client_id`: The **Client ID** obtained from GitHub (refer to step 8). + - `client_secret`: The **Client secret** obtained from GitHub (refer to step 9). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @github-idp.json + ``` + +3. Note the `id` in the output. To authorize the GitHub permissions, open the identity provider in the [Cloudflare dashboard](https://dash.cloudflare.com/) and continue with the next step. + + + + + 15. Select **Finish setup** to launch a GitHub authorization page. You will be asked to grant the following permissions to Cloudflare Access: - Organizations and teams (read-only) - Email addresses (read-only) diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace-saml.mdx index d1c77590693..66027b55627 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace-saml.mdx @@ -10,7 +10,7 @@ tags: - SCIM --- -import { Render, Steps } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Connect Google Workspace to Cloudflare One using a custom SAML app. You can send group membership during authentication and configure System for Cross-domain Identity Management (SCIM) to synchronize user updates and deprovision users. @@ -49,6 +49,9 @@ Group membership is sent in the SAML assertion when a user authenticates. This m ### 2. Add the SAML identity provider to Cloudflare One + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. @@ -60,6 +63,48 @@ Group membership is sent in the SAML assertion when a user authenticates. This m + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Google Workspace: + + ```json title="google-saml-idp.json" + { + "name": "Google Workspace SAML", + "type": "saml", + "config": { + "sso_target_url": "https://accounts.google.com/o/saml2/idp?idpid=", + "issuer_url": "https://accounts.google.com/o/saml2?idpid=", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "email_attribute_name": "email", + "attributes": ["groups"] + } + } + ``` + + - `sso_target_url`: Google's **SSO URL**. + - `issuer_url`: Google's **Entity ID**. + - `idp_public_certs`: The signing certificate from Google, in PEM format with line breaks escaped as `\n`. + - `email_attribute_name`: Set to `email`. + - `attributes`: If you configured group membership mapping, add `groups`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @google-saml-idp.json + ``` + +3. Note the `id` in the output. + + + + + :::caution Set a reminder for the signing certificate's expiry date. Before it expires, generate a new signing certificate in Google Workspace and update your Cloudflare configuration. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace.mdx index 539c811d417..a46fe0e5a79 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/google-workspace.mdx @@ -8,7 +8,7 @@ tags: - Google --- -import { GlossaryTooltip, Render } from "~/components"; +import { GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; :::note @@ -76,6 +76,11 @@ To use Google's built-in SCIM provisioning, follow the [Google Workspace (SAML/S ### 2. Add Google Workspace to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Select **Add new identity provider** and select **Google Workspace**. 3. Input the Client ID (**App ID** in the Cloudflare dashboard) and Client Secret fields generated previously. Additionally, enter the domain of your Google Workspace account. @@ -85,6 +90,46 @@ To use Google's built-in SCIM provisioning, follow the [Google Workspace (SAML/S 7. Select **Save**. To complete setup, you must visit the generated link. If you are not the Google Workspace administrator, share the link with the administrator. 8. The generated link will prompt you to log in to your Google admin account and to authorize Cloudflare Access to view group information. After allowing permissions, you will see a success page from Cloudflare Access. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Google Workspace: + + ```json title="google-workspace-idp.json" + { + "name": "Google Workspace", + "type": "google-apps", + "config": { + "client_id": "", + "client_secret": "", + "apps_domain": "example.com", + "pkce_enabled": false + } + } + ``` + + - `apps_domain`: The domain of your Google Workspace account. + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + - `claims`: (Optional) [Custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your user's identity. + - `prompt` and `use_login_hint`: (Optional) Refer to [Authentication options](#authentication-options). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @google-workspace-idp.json + ``` + +3. Note the `id` in the output. To complete setup, open the identity provider in the [Cloudflare dashboard](https://dash.cloudflare.com/) and visit the generated link. The link prompts you to log in to your Google admin account and to authorize Cloudflare Access to view group information. If you are not the Google Workspace administrator, share the link with the administrator. + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to Google Workspace. Your user identity and group membership should return. :::caution[SCIM Provisioning (Beta)] diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/google.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/google.mdx index a84e7017b40..b6944002c61 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/google.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/google.mdx @@ -8,7 +8,7 @@ tags: - Google --- -import { GlossaryTooltip, Render } from "~/components"; +import { GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; You can integrate Google authentication with Cloudflare Access without a Google Workspace account. The integration allows any user with a Google account to log in (if the [Access policy](/cloudflare-one/access-controls/policies/) allows them to reach the resource). Unlike the instructions for [Google Workspace](/cloudflare-one/integrations/identity-providers/google-workspace/), the steps below will not allow you to pull group membership information from a Google Workspace account. @@ -49,12 +49,54 @@ You do not need to be a Google Cloud Platform user to integrate Google as an ide ``` 9. After creating the OAuth client, select the OAuth client that you just created. Google will present the **OAuth Client ID** value and **Client secret** value. The client secret field functions like a password and should not be shared. Copy both the **OAuth Client ID** value and **Client secret** value. + + + + + 10. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 11. Under **Your identity providers**, select **Add new identity provider**. Choose **Google** on the next page. 12. Input the Client ID (**App ID** in the Cloudflare dashboard) and Client Secret fields generated previously. 13. (Optional) Enable [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/). PKCE will be performed on all login attempts. 14. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Google: + + ```json title="google-idp.json" + { + "name": "Google", + "type": "google", + "config": { + "client_id": "", + "client_secret": "", + "pkce_enabled": false + } + } + ``` + + - `client_id` and `client_secret`: The Client ID and Client Secret generated previously. + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @google-idp.json + ``` + +3. Note the `id` in the output. + + + + + ## Test your connection To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to Google. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/idp-federation.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/idp-federation.mdx index 850f71c8bbb..c661506622a 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/idp-federation.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/idp-federation.mdx @@ -10,7 +10,7 @@ tags: - REST API --- -import { Tabs, TabItem, CURL, Details } from "~/components"; +import { CURL, Details, Steps, TabItem, Tabs } from "~/components"; IdP federation allows organizations with multiple Cloudflare accounts to use a single identity provider (IdP) configuration across accounts. Instead of configuring the same IdP (for example, Okta or Entra ID) separately in every account, you configure it once in a source account and share it with the other accounts in your organization. @@ -37,14 +37,49 @@ When a user in a recipient account authenticates, the request is routed through The dashboard combines grant creation and sharing into a single flow. If a federation grant already exists for the IdP, it will be reused; otherwise, one is created automatically. + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Find the IdP you want to share and select the three dots menu. 3. Select **Share**. 4. Select the recipient accounts you want to share the IdP with. 5. Review the sharing configuration and select **Confirm**. + The IdP is shared to the selected accounts automatically. Each recipient account receives a read-only IdP connection that points to the bridge in the source account. + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. Sharing the grant also requires permission to create resource shares in your Cloudflare Organization. + + +1. Find the ID of the IdP you want to share: + + ```sh + cf zero-trust identity-providers list + ``` + +2. Create a federation grant with [`cf zero-trust identity-providers federation-grants create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-federation-grants-create): + + ```sh + cf zero-trust identity-providers federation-grants create --idp-id + ``` + + Note the grant `id` in the output. To list the federation grants in your account, run `cf zero-trust identity-providers federation-grants list`. + +3. Share the grant with `cf resource-sharing create`. To share the grant with one or more specific accounts, add one `recipient_account_id` entry per account to `--recipients`: + + ```sh + cf resource-sharing create \ + --name "Identity provider: OpenID Connect" \ + --recipients '[{"recipient_account_id": ""}]' \ + --resources '[{"resource_account_id": "", "resource_id": "", "resource_type": "idp-federation-grant", "meta": {}}]' + ``` + + To share the grant with every account in your Organization, pass `--recipients '[{"organization_id": ""}]'` instead. + + +Each recipient account is automatically provisioned with a read-only IdP connection that points to the bridge. + Sharing an IdP via the API is a two-step process: create a federation grant, then share it with specific accounts or your entire organization. @@ -133,10 +168,31 @@ Deleting the federation grant immediately removes the IdP connection from all re The dashboard handles both grant and share deletion in a single flow. + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Find the shared IdP and select the three dots menu. 3. Select **Unshare**. 4. Confirm the action. + + + + + +1. Delete the federation grant with [`cf zero-trust identity-providers federation-grants delete`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-federation-grants-delete). Deleting the grant stops the sharing and removes the read-only IdP from recipient accounts. + + ```sh + cf zero-trust identity-providers federation-grants delete -f + ``` + + To find the grant ID, run `cf zero-trust identity-providers federation-grants list`. + +2. (Optional) Find and delete the share record: + + ```sh + cf resource-sharing list --kind sent --resource-types idp-federation-grant + cf resource-sharing delete -f + ``` + diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/index.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/index.mdx index 84309e05cd8..d98dfcd6f30 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/index.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/index.mdx @@ -52,3 +52,5 @@ If your provider is not connected, another window will open in your browser. Alo ## Use The API We recommend that you use our dashboard to configure your identity providers. However, if you would like to use the [Cloudflare API](https://api.cloudflare.com/), each of the identity provider topics covered here include an example API configuration snippet as well. + +You can also add and configure identity providers with the [Cloudflare CLI (`cf`)](/cf/). To manage identity providers from a terminal, a script, or a coding agent, refer to [Identity provider CLI commands](/cloudflare-one/integrations/identity-providers/cli-commands/). diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/jumpcloud-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/jumpcloud-saml.mdx index baa5a14189c..4d7e20a2e4b 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/jumpcloud-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/jumpcloud-saml.mdx @@ -9,7 +9,7 @@ tags: - SCIM --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; [JumpCloud](https://jumpcloud.com/#platform) provides SSO identity management. Cloudflare Access integrates with JumpCloud as a SAML identity provider. @@ -58,6 +58,11 @@ The following steps are specific to setting up JumpCloud with Cloudflare Access. ### 2. Add JumpCloud to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -72,6 +77,47 @@ The following steps are specific to setting up JumpCloud with Cloudflare Access. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your JumpCloud XML metadata file: + + ```json title="jumpcloud-idp.json" + { + "name": "JumpCloud", + "type": "saml", + "config": { + "sso_target_url": "https://sso.jumpcloud.com/saml2/", + "issuer_url": "", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The single sign-on URL (`SingleSignOnService` location) from the metadata file. + - `issuer_url`: The `entityID` from the metadata file. + - `idp_public_certs`: The signing certificate (`X509Certificate`) from the metadata file, in PEM format with line breaks escaped as `\n`. + - (Optional) To configure [additional SAML options](/cloudflare-one/integrations/identity-providers/generic-saml/#optional-configurations), add fields such as `sign_request`, `email_attribute_name`, `attributes`, and `header_attributes` to `config`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @jumpcloud-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](#synchronize-users-and-groups). + + + + + You can now [test your connection](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) and create [Access policies](/cloudflare-one/access-controls/policies/) based on the configured login method and SAML attributes. ## Synchronize users and groups diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/keycloak.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/keycloak.mdx index 9c34fc62f7e..74916cc8378 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/keycloak.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/keycloak.mdx @@ -8,7 +8,7 @@ tags: - SAML --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Keycloak is an open source identity and access management solution built by JBoss. @@ -63,6 +63,11 @@ To set up Keycloak (SAML) as your identity provider: Next, you will need to integrate with Cloudflare Access. + + + + + 11. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 12. Under **Your identity providers**, select **Add new identity provider**. @@ -79,4 +84,44 @@ To set up Keycloak (SAML) as your identity provider: 14. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Keycloak: + + ```json title="keycloak-idp.json" + { + "name": "Keycloak", + "type": "saml", + "config": { + "sso_target_url": "https:///realms//protocol/saml", + "issuer_url": "https://.cloudflareaccess.com/cdn-cgi/access/callback", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The **Single Sign-On URL** of your Keycloak realm. + - `issuer_url`: The **IdP Entity ID or Issuer URL**. + - `idp_public_certs`: The X509 certificate from the Keycloak realm keys, in PEM format with line breaks escaped as `\n`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @keycloak-idp.json + ``` + +3. Note the `id` in the output. + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the login method you want to test. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/linkedin.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/linkedin.mdx index df7a6640ecc..ecb33d719e9 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/linkedin.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/linkedin.mdx @@ -9,7 +9,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare Access allows your users to use LinkedIn as their identity provider (IdP). @@ -41,6 +41,11 @@ To configure LinkedIn as an IdP: ![LinkedIn account settings where you will copy the Client ID and Client Secret](~/assets/images/cloudflare-one/identity/linkedin/lin5.png) + + + + + 10. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 11. Under **Your identity providers**, select **Add new identity provider**. @@ -51,6 +56,41 @@ To configure LinkedIn as an IdP: 14. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from LinkedIn: + + ```json title="linkedin-idp.json" + { + "name": "LinkedIn", + "type": "linkedin", + "config": { + "client_id": "", + "client_secret": "" + } + } + ``` + + - `client_id` and `client_secret`: The **Client ID** and **Client secret** from step 9. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @linkedin-idp.json + ``` + +3. Note the `id` in the output. Then continue with the next step in LinkedIn. + + + + + 15. In the **Auth** tab of your LinkedIn application, go to **OAuth 2.0 settings** and select the pencil icon next to **Authorized redirect URLs for your app**. 16. Enter the following URL: diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/okta-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/okta-saml.mdx index 1ad86fb7e17..19fc97f29f5 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/okta-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/okta-saml.mdx @@ -9,7 +9,7 @@ tags: description: Integrate Okta as a SAML identity provider with Cloudflare One. --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One can integrate SAML with Okta as an identity provider. @@ -63,6 +63,11 @@ To set up SAML with Okta as your identity provider: ![Retrieving SAML provider information in Okta](~/assets/images/cloudflare-one/identity/okta-saml/okta-saml-5.png) + + + + + 13. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity provider**. 14. Under **Your identity providers**, select **Add new identity provider**, and select _SAML_. @@ -77,10 +82,54 @@ To set up SAML with Okta as your identity provider: 17. (Recommended) Under **SAML attributes**, add the `email` and `groups` attributes. The `groups` attribute is required if you want to create policies based on [Okta groups](/cloudflare-one/traffic-controls/identity-selectors/#okta-saml). -![Adding optional SAML attributes in Cloudflare One](~/assets/images/cloudflare-one/identity/okta-saml/okta-saml-6.png) + ![Adding optional SAML attributes in Cloudflare One](~/assets/images/cloudflare-one/identity/okta-saml/okta-saml-6.png) 18. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Okta: + + ```json title="okta-saml-idp.json" + { + "name": "Okta SAML", + "type": "saml", + "config": { + "sso_target_url": "https:///app///sso/saml", + "issuer_url": "http://www.okta.com/", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "sign_request": true, + "attributes": ["email", "groups"] + } + } + ``` + + - `sso_target_url`: The Identity Provider Single-Sign-On URL from Okta. + - `issuer_url`: The Identity Provider Issuer from Okta. + - `idp_public_certs`: The X.509 Certificate from Okta, in PEM format with line breaks escaped as `\n`. + - `sign_request`: (Recommended) Set to `true` to [sign SAML authentication requests](/cloudflare-one/integrations/identity-providers/generic-saml/#sign-saml-authentication-request). + - `attributes`: (Recommended) The SAML attributes to add to users' identity. The `groups` attribute is required if you want to create policies based on [Okta groups](/cloudflare-one/traffic-controls/identity-selectors/#okta-saml). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @okta-saml-idp.json + ``` + +3. Note the `id` in the output. + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to Okta. A success response should return the configured SAML attributes. :::caution diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/okta.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/okta.mdx index ec408809e47..5a265e79557 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/okta.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/okta.mdx @@ -9,7 +9,7 @@ tags: description: Integrate Okta as an identity provider for Cloudflare One. --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Okta provides cloud software that helps companies manage and secure user authentication to modern applications, and helps developers build identity controls into applications, website web services, and devices. You can integrate Okta with Cloudflare One and build rules based on user identity and group membership. Cloudflare One supports Okta integrations using either the OIDC (default) or [SAML](/cloudflare-one/integrations/identity-providers/okta-saml/) protocol. @@ -90,8 +90,50 @@ To set up the Okta integration using the Okta Integration Network (OIN) App Cata ![Finding your Client credentials in Okta](~/assets/images/cloudflare-one/identity/okta/okta-3.png) + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you copied from Okta: + + ```json title="okta-idp.json" + { + "name": "Okta", + "type": "okta", + "config": { + "client_id": "", + "client_secret": "", + "okta_account": "https://my-company.okta.com" + } + } + ``` + + - `client_id` and `client_secret`: Your Okta client ID and client secret. + - `okta_account`: Your [Okta domain](https://developer.okta.com/docs/guides/find-your-domain/main/), for example `https://my-company.okta.com`. + - `authorization_server_id`: (Optional) The ID of your Okta [custom authorization server](https://developer.okta.com/docs/guides/customize-authz-server/main/). Required to use [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims). + - `claims`: (Optional) A list of custom OIDC claims to add to your users' identity. + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @okta-idp.json + ``` + +3. Note the `id` in the output. To [test](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) that your connection is working, select **Test** next to the identity provider in the dashboard. + + +:::note +`cf` does not yet support adding the optional Okta API token for tenants with more than 100 groups. Add the API token in the dashboard. +::: + + + ## Synchronize users and groups The Okta integration allows you to synchronize IdP groups and automatically deprovision users using [SCIM](/cloudflare-one/team-and-resources/users/scim/). To enable SCIM provisioning between Access and Okta, you need two separate app integrations in Okta: diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/one-time-pin.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/one-time-pin.mdx index d995bd2ccdc..6e8e9d60734 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/one-time-pin.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/one-time-pin.mdx @@ -10,7 +10,7 @@ tags: - REST API --- -import { Tabs, TabItem, Render, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare Access can send a one-time PIN (OTP) to approved email addresses as an alternative to integrating an identity provider. You can simultaneously configure OTP login and the identity provider of your choice to allow users to select their own authentication method. @@ -24,9 +24,24 @@ For example, if your team uses Okta but you are collaborating with someone outsi + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **One-time PIN**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Add the one-time PIN login method with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + +```sh +cf zero-trust identity-providers create \ + --body '{"name": "One-time PIN login", "type": "onetimepin", "config": {}}' +``` + +To check whether OTP is already configured, run `cf zero-trust identity-providers list` and look for an entry with `"type": "onetimepin"`. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-oidc.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-oidc.mdx index 2135bf58318..95d1babe93b 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-oidc.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-oidc.mdx @@ -9,7 +9,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; OneLogin provides SSO identity management. Cloudflare Access supports OneLogin as an OIDC identity provider. @@ -43,6 +43,11 @@ OneLogin provides SSO identity management. Cloudflare Access supports OneLogin a ### 2. Add OneLogin to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -61,6 +66,44 @@ OneLogin provides SSO identity management. Cloudflare Access supports OneLogin a 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from OneLogin: + + ```json title="onelogin-idp.json" + { + "name": "OneLogin", + "type": "onelogin", + "config": { + "client_id": "", + "client_secret": "", + "onelogin_account": "https://.onelogin.com" + } + } + ``` + + - `client_id` and `client_secret`: Your OneLogin client ID and client secret. + - `onelogin_account`: Your OneLogin domain, for example `https://.onelogin.com`. + - `claims`: (Optional) [Custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @onelogin-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-oidc/#synchronize-users-and-groups). + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to OneLogin. ## Example API Config diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-saml.mdx index 92e8734a5f6..9f31e665094 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/onelogin-saml.mdx @@ -8,7 +8,7 @@ tags: description: Integrate OneLogin as a SAML identity provider for Cloudflare One. --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; OneLogin provides SSO identity management. Cloudflare Access supports OneLogin as an SAML identity provider. @@ -56,6 +56,11 @@ OneLogin provides SSO identity management. Cloudflare Access supports OneLogin a ### 2. Add OneLogin to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -70,6 +75,47 @@ OneLogin provides SSO identity management. Cloudflare Access supports OneLogin a 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from OneLogin: + + ```json title="onelogin-saml-idp.json" + { + "name": "OneLogin SAML", + "type": "saml", + "config": { + "sso_target_url": "https://.onelogin.com/trust/saml2/http-post/sso/", + "issuer_url": "https://app.onelogin.com/saml/metadata/", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The **SAML 2.0 Endpoint (HTTP)** from OneLogin. + - `issuer_url`: The **Issuer URL** from OneLogin. + - `idp_public_certs`: The X.509 certificate from OneLogin, in PEM format with line breaks escaped as `\n`. + - (Optional) To configure [additional SAML options](/cloudflare-one/integrations/identity-providers/generic-saml/#optional-configurations), add fields such as `sign_request`, `email_attribute_name`, `attributes`, and `header_attributes` to `config`. If you added other SAML headers and attribute names to OneLogin, be sure to add them to Cloudflare. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @onelogin-saml-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-saml/#synchronize-users-and-groups). + + + + + To test that your connection is working, go to **Integrations** > **Identity providers** and select **Test** next to the login method you want to test. ## Download SP metadata (optional) diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/passkeys.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/passkeys.mdx index e6010dd250b..f0851bf768b 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/passkeys.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/passkeys.mdx @@ -8,7 +8,7 @@ tags: - REST API --- -import { CURL, DashButton, Steps, Tabs, TabItem } from "~/components"; +import { CURL, DashButton, Steps, TabItem, Tabs } from "~/components"; Cloudflare Access supports passkeys as a login method. Users can sign in with a passkey instead of entering a password or one-time PIN (OTP). @@ -34,6 +34,20 @@ If **Passkeys** is already listed under **Identity providers**, select it to rev + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Add passkeys as a login method with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + +```sh +cf zero-trust identity-providers create \ + --body '{"name": "Passkeys", "type": "passkeys", "config": {"login_page_auto_prompt": false}}' +``` + +Set `config.login_page_auto_prompt` to `true` to turn on **Automatically prompt on the login page**. To check whether passkeys are already configured, run `cf zero-trust identity-providers list` and look for an entry with `"type": "passkeys"`. + @@ -123,6 +137,9 @@ Users can add, rename, or delete their own passkeys. Administrators can remove a passkey if a device is lost or a user needs to enroll again. + + + 1. In the Cloudflare dashboard, go to **Zero Trust** > **Team & Resources** > **Users**. @@ -135,6 +152,34 @@ Administrators can remove a passkey if a device is lost or a user needs to enrol + + + + +1. Find the user's ID: + + ```sh + cf zero-trust access users list --email user@example.com + ``` + +2. Get the IDs of the user's registered passkeys from the `passkeys` array: + + ```sh + cf zero-trust access users last-seen-identity get + ``` + +3. Delete the passkey with [`cf zero-trust users passkeys delete`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-users-passkeys-delete): + + ```sh + cf zero-trust users passkeys delete --user-id + ``` + + Add `-f` to skip the confirmation prompt. + + + + + You can also [delete a user's passkey through the API](/api/resources/zero_trust/subresources/access/subresources/users/subresources/passkeys/methods/delete/). Deleting a registered passkey prevents Access from accepting it for future sign-ins. To end a user's active Access sessions, [revoke their sessions](/cloudflare-one/access-controls/access-settings/session-management/#revoke-user-sessions). diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/pingfederate-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/pingfederate-saml.mdx index 07bb834f935..f54eef407e3 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/pingfederate-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/pingfederate-saml.mdx @@ -8,7 +8,7 @@ tags: - SAML --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The PingFederate offering from PingIdentity provides SSO identity management. Cloudflare Access supports PingFederate as a SAML identity provider. @@ -46,6 +46,11 @@ In versions 9.0 above, you can leave both of these options enabled. This file shares several fields with Cloudflare Access so you do not have to input this data. + + + + + 11. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 12. Under **Your identity providers**, select **Add new identity provider**. @@ -54,16 +59,56 @@ This file shares several fields with Cloudflare Access so you do not have to inp 14. In the **IdP Entity ID** field, enter the following URL: -```txt -https://.cloudflareaccess.com/cdn-cgi/access/callback -``` + ```txt + https://.cloudflareaccess.com/cdn-cgi/access/callback + ``` - + 15. Fill the other fields with values from your Ping dashboard. 16. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your Ping dashboard: + + ```json title="pingfederate-idp.json" + { + "name": "PingFederate", + "type": "saml", + "config": { + "sso_target_url": "", + "issuer_url": "https://.cloudflareaccess.com/cdn-cgi/access/callback", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `issuer_url`: The **IdP Entity ID**. Enter `https://.cloudflareaccess.com/cdn-cgi/access/callback`. + - `sso_target_url`: The single sign-on URL from your Ping SAML metadata. + - `idp_public_certs`: The signing certificate from your Ping SAML metadata, in PEM format with line breaks escaped as `\n`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @pingfederate-idp.json + ``` + +3. Note the `id` in the output. + + + + + To test the connection, go to **Integrations** > **Identity providers** and select **Test** next to the login method. ## Example API configuration diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-oidc.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-oidc.mdx index 9776fffd8a5..c848297b985 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-oidc.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-oidc.mdx @@ -9,7 +9,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The PingOne cloud platform from PingIdentity provides SSO identity management. Cloudflare Access supports PingOne as an OIDC identity provider. @@ -37,6 +37,11 @@ The PingOne cloud platform from PingIdentity provides SSO identity management. C ### 2. Add PingOne to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Select **PingOne**. @@ -46,6 +51,45 @@ The PingOne cloud platform from PingIdentity provides SSO identity management. C 7. (Optional) Under **Optional configurations**, enter [custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. 8. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from PingOne: + + ```json title="pingone-idp.json" + { + "name": "PingOne", + "type": "pingone", + "config": { + "client_id": "", + "client_secret": "", + "ping_env_id": "", + "pkce_enabled": false + } + } + ``` + + - `ping_env_id`: The PingOne **Environment ID**. + - `pkce_enabled`: (Optional) Set to `true` to perform [Proof Key for Code Exchange (PKCE)](https://www.oauth.com/oauth2-servers/pkce/) on all login attempts. + - `claims`: (Optional) [Custom OIDC claims](/cloudflare-one/integrations/identity-providers/generic-oidc/#custom-oidc-claims) that you wish to add to your users' identity. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @pingone-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-oidc/#synchronize-users-and-groups). + + + + + You can now [test your connection](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) and create [Access policies](/cloudflare-one/access-controls/policies/) based on the configured login method. ## Example API configuration @@ -57,7 +101,7 @@ You can now [test your connection](/cloudflare-one/integrations/identity-provide "client_secret": "", "ping_env_id": "" }, - "type": "ping", + "type": "pingone", "name": "my example idp" } ``` diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-saml.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-saml.mdx index 6e57a4c1762..60c348857a2 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-saml.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/pingone-saml.mdx @@ -8,7 +8,7 @@ tags: description: Learn how to integrate PingOne as a SAML identity provider with Cloudflare One. --- -import { GlossaryTooltip } from "~/components"; +import { GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; The PingOne cloud platform from PingIdentity provides SSO identity management. Cloudflare Access supports PingOne as a SAML identity provider. @@ -53,6 +53,11 @@ The PingOne cloud platform from PingIdentity provides SSO identity management. C ### 2. Add PingOne to Cloudflare One + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. @@ -67,4 +72,45 @@ The PingOne cloud platform from PingIdentity provides SSO identity management. C 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your PingOne XML metadata file: + + ```json title="pingone-saml-idp.json" + { + "name": "PingOne SAML", + "type": "saml", + "config": { + "sso_target_url": "", + "issuer_url": "", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ] + } + } + ``` + + - `sso_target_url`: The single sign-on URL (`SingleSignOnService` location) from the metadata file. + - `issuer_url`: The `entityID` from the metadata file. + - `idp_public_certs`: The signing certificate (`X509Certificate`) from the metadata file, in PEM format with line breaks escaped as `\n`. + - (Optional) To configure [additional SAML options](/cloudflare-one/integrations/identity-providers/generic-saml/#optional-configurations), add fields such as `sign_request`, `email_attribute_name`, `attributes`, and `header_attributes` to `config`. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @pingone-saml-idp.json + ``` + +3. Note the `id` in the output. To enable SCIM, refer to [Synchronize users and groups](/cloudflare-one/integrations/identity-providers/generic-saml/#synchronize-users-and-groups). + + + + + You can now [test your connection](/cloudflare-one/integrations/identity-providers/#test-idps-in-cloudflare-one) and create [Access policies](/cloudflare-one/access-controls/policies/) based on the configured login method and SAML attributes. diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/signed_authn.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/signed_authn.mdx index ebd03b73ef1..62d21ff0b76 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/signed_authn.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/signed_authn.mdx @@ -8,6 +8,8 @@ tags: - SAML --- +import { Steps, TabItem, Tabs } from "~/components"; + In a SAML request flow, Cloudflare Access functions as the service provider (SP) to the identity provider (IdP). Cloudflare Access sends a SAML request to your IdP. The signing certificate that you upload from your SAML provider verifies the response. In some cases, administrators need to verify that the request from the SP is authentic. By validating both the requests from the SP and the responses from the IdP, teams can ensure that operations in the SAML relationship are signed in both directions. @@ -18,10 +20,55 @@ Cloudflare Access supports this requirement in the form of Signed AuthN requests To set up Signed AuthN requests: + + + + + 1. In Cloudflare One, go to **Integrations** > **Identity providers**. 2. Under **Your identity providers**, select **Add new identity provider**. 3. Choose **SAML** on the next page. 4. Complete the fields in the dialog, turn on **Sign SAML authentication request**, and save the identity provider. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from your identity provider: + + ```json title="saml-idp.json" + { + "name": "Signed SAML example", + "type": "saml", + "config": { + "sso_target_url": "https://idp.example.com/sso/saml", + "issuer_url": "https://idp.example.com", + "idp_public_certs": [ + "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----" + ], + "sign_request": true + } + } + ``` + + - `sign_request`: Set to `true` to turn on **Sign SAML authentication request**. + - For the other fields, refer to [Generic SAML 2.0](/cloudflare-one/integrations/identity-providers/generic-saml/). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @saml-idp.json + ``` + +3. Note the `id` in the output. To turn on signing for an existing SAML identity provider, save the output of `cf zero-trust identity-providers get ` to a file, set `config.sign_request` to `true`, and pass the file to `cf zero-trust identity-providers update --body @`. + + + + 5. Go to this URL to find the certificate: ```txt diff --git a/src/content/docs/cloudflare-one/integrations/identity-providers/yandex.mdx b/src/content/docs/cloudflare-one/integrations/identity-providers/yandex.mdx index ac2c705aa72..05e7aec93cd 100644 --- a/src/content/docs/cloudflare-one/integrations/identity-providers/yandex.mdx +++ b/src/content/docs/cloudflare-one/integrations/identity-providers/yandex.mdx @@ -8,7 +8,7 @@ tags: - SSO --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Yandex is a web search engine that also offers identity provider (IdP) services. @@ -48,6 +48,11 @@ To set up Yandex for Cloudflare Access: 11. Copy the **ID** and **Password**. + + + + + 12. In Cloudflare One, go to **Integrations** > **Identity providers**. 13. Under **Your identity providers**, select **Add new identity provider**. @@ -58,6 +63,41 @@ To set up Yandex for Cloudflare Access: 16. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the values that you obtained from Yandex: + + ```json title="yandex-idp.json" + { + "name": "Yandex", + "type": "yandex", + "config": { + "client_id": "", + "client_secret": "" + } + } + ``` + + - `client_id` and `client_secret`: The **ID** and **Password** that you copied from Yandex. + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @yandex-idp.json + ``` + +3. Note the `id` in the output. + + + + + ## Example API Config ```json diff --git a/src/content/docs/cloudflare-one/integrations/service-providers/crowdstrike.mdx b/src/content/docs/cloudflare-one/integrations/service-providers/crowdstrike.mdx index 8916d334f1b..dff06f772a4 100644 --- a/src/content/docs/cloudflare-one/integrations/service-providers/crowdstrike.mdx +++ b/src/content/docs/cloudflare-one/integrations/service-providers/crowdstrike.mdx @@ -10,7 +10,7 @@ sidebar: order: 4 --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "CrowdStrike" \ + --type crowdstrike_s2s \ + --integration-config-client-id "" \ + --integration-config-client-secret "" \ + --integration-config-api-url "" \ + --integration-config-customer-id "" \ + --interval 1h + ``` + + - `--integration-config-client-id` and `--integration-config-client-secret`: The **Client ID** and **Client Secret** you noted down above. + - `--integration-config-api-url`: Your CrowdStrike **Base URL** (**Rest API URL** in the dashboard). + - `--integration-config-customer-id`: Your CrowdStrike **Customer ID**. + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + ### 3. Configure the posture check + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "Custom posture provider" \ + --type custom_s2s \ + --integration-config-access-client-id "" \ + --integration-config-access-client-secret "" \ + --integration-config-api-url "https://api.example.com" \ + --interval 1h + ``` + + - `--integration-config-access-client-id` and `--integration-config-access-client-secret`: The Access service token used to authenticate to your external API. + - `--integration-config-api-url`: The external API endpoint that Cloudflare will query for posture information. For more information, refer to [External API requirements](#external-api-requirements). + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + Next, [configure a device posture check](#4-configure-the-posture-check) to determine if a given posture score constitutes a pass or fail. ### 4. Configure the posture check diff --git a/src/content/docs/cloudflare-one/integrations/service-providers/microsoft.mdx b/src/content/docs/cloudflare-one/integrations/service-providers/microsoft.mdx index 6213f5773bf..f72c76d8aee 100644 --- a/src/content/docs/cloudflare-one/integrations/service-providers/microsoft.mdx +++ b/src/content/docs/cloudflare-one/integrations/service-providers/microsoft.mdx @@ -10,7 +10,7 @@ sidebar: order: 4 --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "Microsoft Intune" \ + --type intune \ + --integration-config-client-id "" \ + --integration-config-client-secret "" \ + --integration-config-customer-id "" \ + --interval 1h + ``` + + - `--integration-config-client-id`: The Application (client) ID. + - `--integration-config-client-secret`: The client secret. + - `--integration-config-customer-id`: The Directory (tenant) ID. + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + ## 3. Configure the posture check + + 5. In **Client Secret**, enter your **API Token**. 6. In **Rest API URL**, enter `https://.sentinelone.net`. 7. Choose a **Polling frequency** for how often Cloudflare One should query SentinelOne for information. 8. Select **Test and save**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "SentinelOne" \ + --type sentinelone_s2s \ + --integration-config-client-secret "" \ + --integration-config-api-url "https://.sentinelone.net" \ + --interval 1h + ``` + + - `--integration-config-client-secret`: Your SentinelOne **API Token**. + - `--integration-config-api-url`: Your SentinelOne **Rest API URL**. + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + ### 3. Configure the posture check + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "Tanium" \ + --type tanium_s2s \ + --integration-config-client-secret "" \ + --integration-config-api-url "" \ + --interval 1h + ``` + + - `--integration-config-client-secret`: The Tanium API token **Client Secret**. + - `--integration-config-api-url`: Your Tanium Gateway root endpoint (**REST API URL**). + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + ### 3. Configure the posture check + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add the service provider with [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create): + + ```sh + cf zero-trust devices posture integrations create \ + --name "Workspace ONE" \ + --type workspace_one \ + --integration-config-client-id "" \ + --integration-config-client-secret "" \ + --integration-config-auth-url "" \ + --integration-config-api-url "" \ + --interval 1h + ``` + + - `--integration-config-client-id` and `--integration-config-client-secret`: The **Client ID** and **Client Secret** you noted down above. + - `--integration-config-auth-url`: The **Region-specific token URL**. + - `--integration-config-api-url`: The **REST API URL**. + - `--interval`: The **Polling frequency**, in minutes (`m`) or hours (`h`), for example `30m` or `1h`. + +2. Note the `id` in the output. `create` tests the credentials before it saves the integration, and returns an error if Cloudflare cannot reach the service provider. + + + + + ## 3. Configure the posture check + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). `cf` creates policies turned off unless you pass `--enabled true`: + +```sh +cf zero-trust gateway rules create \ + --name "Isolate all security threats" \ + --description "Isolate security threats such as malware and phishing" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Isolate high risk content" \ + --description "Isolate high risk content categories such as newly registered domains" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(http.request.uri.content_category[*] in {32 169 177 128})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Isolate news and media" \ + --description "Isolate news and media sites, which are targets for malvertising attacks" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(http.request.uri.content_category[*] in {122})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Isolate uncategorized content" \ + --description "Isolate content not categorized by Cloudflare Radar" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'not(any(http.request.uri.content_category[*] in {2 67 125 133 3 75 183 89 182 6 90 91 144 150 7 70 74 76 79 92 96 100 106 107 116 120 121 122 127 139 156 164 99 9 101 137 10 103 146 11 12 77 98 108 110 111 118 126 129 172 168 113 33 179 166 15 115 119 124 141 161 17 85 87 102 157 135 138 180 162 140 142 32 169 177 128 22 73 82 88 148 23 24 181 71 72 173 78 84 86 94 97 104 105 114 174 93 130 132 136 147 149 154 158 152 26 69 184 81 95 109 123 145 155 159 160 163 165 167}))' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Isolate ChatGPT" \ + --description "Isolate the use of ChatGPT" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(app.ids[*] in {1199})' \ + --rule-settings-biso-admin-controls-version v2 \ + --rule-settings-biso-admin-controls-copy disabled \ + --rule-settings-biso-admin-controls-paste disabled \ + --rule-settings-biso-admin-controls-upload disabled +``` + +The `--rule-settings-biso-admin-controls-*` flags set the [policy settings](#policy-settings). This example prevents users from copying, pasting, and uploading files. + + + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Traffic policies** > **Firewall policies** > **HTTP**. 2. Select **Add a policy** and enter a name for the policy. 3. Use the HTTP policy [selectors](/cloudflare-one/traffic-controls/http-policies/#selectors) and [operators](/cloudflare-one/traffic-controls/http-policies/#comparison-operators) to specify the websites or content you want to isolate. 4. For **Action**, choose either [_Isolate_](/cloudflare-one/remote-browser-isolation/isolation-policies/#isolate) or [_Do not Isolate_](/cloudflare-one/remote-browser-isolation/isolation-policies/#do-not-isolate). 5. (Optional) Configure [settings](/cloudflare-one/remote-browser-isolation/isolation-policies/#policy-settings) for an Isolate policy. 6. Select **Create policy**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create an HTTP policy with the `isolate` or `noisolate` action using [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, the following policy isolates all security threats and prevents users from downloading files: + +```sh +cf zero-trust gateway rules create \ + --name "Isolate all security threats" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})' \ + --rule-settings-biso-admin-controls-version v2 \ + --rule-settings-biso-admin-controls-download disabled +``` + +- `--action`: `isolate` for _Isolate_ or `noisolate` for _Do not Isolate_. +- `--rule-settings-biso-admin-controls-*`: (Optional) The [policy settings](/cloudflare-one/remote-browser-isolation/isolation-policies/#policy-settings) for an Isolate policy. +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + + + Next, [verify that your policy is working](#3-check-if-a-web-page-is-isolated). diff --git a/src/content/docs/cloudflare-one/remote-browser-isolation/setup/non-identity.mdx b/src/content/docs/cloudflare-one/remote-browser-isolation/setup/non-identity.mdx index e1b12380953..276dc2766fb 100644 --- a/src/content/docs/cloudflare-one/remote-browser-isolation/setup/non-identity.mdx +++ b/src/content/docs/cloudflare-one/remote-browser-isolation/setup/non-identity.mdx @@ -8,6 +8,8 @@ sidebar: order: 5 --- +import { TabItem, Tabs } from "~/components"; + On-ramps are the methods used to route traffic from your network to Cloudflare for inspection. With Cloudflare One, you can isolate HTTP traffic from on-ramps such as [proxy endpoints](/cloudflare-one/traffic-controls/proxy-endpoints/) (which your browser connects to via PAC files to send traffic through Gateway) or [Cloudflare WAN](/cloudflare-wan/zero-trust/cloudflare-gateway/) (formerly Magic WAN, which connects your network to Cloudflare through GRE or IPsec tunnels). Since these on-ramps do not require users to log in to the Cloudflare One Client, [identity-based policies](/cloudflare-one/traffic-controls/identity-selectors/) are not supported. :::note @@ -22,6 +24,37 @@ If you want to apply Isolate policies based on user identity, you will need to e - Configure your browser to forward traffic to a Gateway proxy endpoint with [PAC files](/cloudflare-one/traffic-controls/proxy-endpoints/) (Proxy Auto-Configuration files that tell the browser which traffic to route through the proxy). - Connect your enterprise site router to Gateway with the [anycast GRE or IPsec tunnel on-ramp to Cloudflare WAN](/cloudflare-wan/zero-trust/cloudflare-gateway/) (site-to-site encrypted tunnels between your network and Cloudflare). 3. Enable non-identity browser isolation: + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Browser isolation** > **Browser isolation settings**. 2. Turn on **Allow isolated HTTP traffic when user identity is unknown**. + + + + + Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + 1. Get your current Browser Isolation settings: + + ```sh + cf zero-trust gateway configurations get + ``` + + Note the value of `settings.browser_isolation.url_browser_isolation_enabled`. + + 2. Turn on non-identity browser isolation with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + + ```sh + cf zero-trust gateway configurations edit \ + --settings-browser-isolation-non-identity-enabled true \ + --settings-browser-isolation-url-browser-isolation-enabled + ``` + + `configurations edit` replaces the whole `browser_isolation` settings group, so pass the current value of `--settings-browser-isolation-url-browser-isolation-enabled` (**Allow users to open a remote browser without the device client**) to keep it. + + + + 4. Build a non-identity [HTTP policy](/cloudflare-one/remote-browser-isolation/isolation-policies/) to isolate websites in a remote browser. diff --git a/src/content/docs/cloudflare-one/reusable-components/custom-pages/access-custom-pages.mdx b/src/content/docs/cloudflare-one/reusable-components/custom-pages/access-custom-pages.mdx index b674f992b4b..f0f4abd5ac7 100644 --- a/src/content/docs/cloudflare-one/reusable-components/custom-pages/access-custom-pages.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/custom-pages/access-custom-pages.mdx @@ -8,7 +8,7 @@ sidebar: order: 5 --- -import { DashButton, Steps } from "~/components"; +import { DashButton, Steps, TabItem, Tabs } from "~/components"; Access custom pages let you customize the pages visitors see when they sign in, receive an Access policy denial, or approve a command-line login. Templates use HTML and Liquid to display request-specific information. @@ -33,6 +33,9 @@ Access inserts its own sign-in and approval controls into the required elements. ## Create a custom page + + + 1. In Cloudflare One, go to **Reusable components** > **Custom pages**. @@ -48,6 +51,42 @@ Access inserts its own sign-in and approval controls into the required elements. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + + +1. Save your HTML and Liquid template to a file, for example `login.html`. For a starting point, refer to the [login template example](#login-template-example). + +2. Validate the template with [`cf zero-trust access custom-pages validate`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-custom-pages-validate): + + ```sh + cf zero-trust access custom-pages validate --type login --template @login.html + ``` + + Set `--type` to `login`, `identity_denied`, `forbidden`, or `interstitial`. The output lists blocking `errors` and non-blocking `warnings`, and the template contract `version`. Resolve any errors before you continue. + +3. Create the page with [`cf zero-trust access custom-pages create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-custom-pages-create): + + ```sh + cf zero-trust access custom-pages create \ + --name "Corporate login" \ + --type login \ + --custom-html @login.html \ + --contract-version 2 + ``` + + Set `--contract-version` to the `version` from the validation output. If you omit `--contract-version`, Access saves the page as a legacy page and serves the HTML without rendering Liquid. + +4. Note the `uid` in the output. + + + + + + Publishing saves a reusable template. To display it, assign it to an application or set it as an account default. :::caution[Test the saved page] @@ -84,6 +123,9 @@ Keep `message.text` visible so visitors can understand sign-in problems. Do not For a self-hosted application: + + + 1. Go to **Access controls** > **Applications** and select the application. @@ -105,6 +147,38 @@ For a self-hosted application: + + + + + +1. Save the application's current configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, set `custom_pages` to the `uid` of each page that you want to assign: + + ```json title="app.json" + "custom_pages": ["", ""], + ``` + +3. Update the application with [`cf zero-trust access applications update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-update): + + ```sh + cf zero-trust access applications update --body @app.json + ``` + +4. Exercise the application flow. Allow time for configuration changes to propagate before retesting. + + + +To remove an assignment, remove the page `uid` from `custom_pages` and update the application again. To confirm the assignment, run `cf zero-trust access custom-pages list` and review the `app_count` of each page. + + + + To remove an application assignment, select **Cloudflare default** for that page type and save. If an account default exists, Access uses it when there is no application-specific template. ### Account defaults @@ -113,6 +187,16 @@ The **Access custom pages** list offers **Set as default** and **Remove as defau An account default affects applications that inherit that page type. Test an application-specific assignment before changing an account default. +To set the account default **Identity denied** or **Forbidden** page with `cf`, run [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit) with the page `uid`: + +```sh +cf zero-trust organization edit \ + --custom-pages-identity-denied \ + --custom-pages-forbidden +``` + +`cf` does not yet support setting account default **Login** or **Interstitial** pages. Use the dashboard. + ## Template data Select **Variables** in the editor for the selected type's variable names and descriptions. Do not assume that every page type has the same data. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/antivirus.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/antivirus.mdx index 1b02eaa266e..57e82eea0fb 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/antivirus.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/antivirus.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The Antivirus device posture attribute checks if any antivirus software is installed and active on a device. The Cloudflare One Client queries the [Windows Security Center API](https://learn.microsoft.com/en-us/windows/win32/api/iwscapi/ne-iwscapi-wsc_security_product_state) to determine the state of registered security products. For the posture check to pass, Windows Security Center must report that a security product is turned on and up to date. @@ -30,6 +30,10 @@ The Antivirus device posture attribute checks if any antivirus software is insta ## Enable the antivirus check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **Antivirus**. @@ -37,6 +41,30 @@ The Antivirus device posture attribute checks if any antivirus software is insta 5. Select your operating system. 6. (Optional) Set the maximum number of days allowed since the last antivirus signature update. If the device exceeds this limit (for example, you set 30 days but it has been 31 days since the last update), the device will fail the posture check. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the antivirus check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Antivirus on Windows" \ + --type antivirus \ + --match '[{"platform":"windows"}]' \ + --input-update-window-days 30 +``` + +- `--match`: The operating system to run the check on. Do not pass `--input-operating-system` for this check type. +- `--input-update-window-days`: (Optional) The maximum number of days allowed since the last antivirus signature update. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the antivirus check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/application-check.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/application-check.mdx index daec64a9107..955da75e74b 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/application-check.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/application-check.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The Application Check device posture attribute checks that a specific application process is running on a device. You can create multiple application checks for each operating system you need to run it on, or if you need to check for multiple applications. @@ -27,6 +27,10 @@ The Application Check device posture attribute checks that a specific applicatio ## Configure an application check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. @@ -49,6 +53,34 @@ The Application Check device posture attribute checks that a specific applicatio 6. **SHA-256 (optional)**: Enter the [SHA-256 value](#determine-the-sha-256-value) of the binary. This is used to ensure the integrity of the binary file on the device. 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the application check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Example application check" \ + --type application \ + --match '[{"platform":"mac"}]' \ + --input-operating-system mac \ + --input-path /Applications/Example.app/Contents/MacOS/Example \ + --input-thumbprint +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on (`windows`, `mac`, or `linux`). Set both to the same value. +- `--input-path`: The file path of the application binary. +- `--input-thumbprint`: (Recommended) The signing certificate thumbprint of the binary. +- `--input-sha256`: (Optional) The SHA-256 value of the binary. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the application check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/carbon-black.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/carbon-black.mdx index 9566d3c67c4..6b7fb209f10 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/carbon-black.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/carbon-black.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One can check if [Carbon Black](https://www.carbonblack.com/) is running on a device to determine if a request should be allowed to reach a protected resource. @@ -28,6 +28,10 @@ Cloudflare One can check if [Carbon Black](https://www.carbonblack.com/) is runn ## Configure the Carbon Black check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. @@ -40,5 +44,33 @@ Cloudflare One can check if [Carbon Black](https://www.carbonblack.com/) is runn 3. **Application Path**: Enter the full path to the Carbon Black process to be checked (for example, `c:\program files\CarbonBlack\CarbonBlack.exe`). 4. **Signing certificate thumbprint (recommended)**: Enter the thumbprint of the publishing certificate used to sign the binary. This proves the binary came from Carbon Black and is the recommended way to validate the process. 5. **SHA-256 (optional)**: Enter a SHA-256 value. This is used to validate the SHA256 signature of the binary and ensures the integrity of the binary file on the device. Note: do not fill out this field unless you strictly control updates to Carbon Black, as this will change between versions. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create one Carbon Black check per operating system with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Carbon Black on Windows" \ + --type carbonblack \ + --match '[{"platform":"windows"}]' \ + --input-operating-system windows \ + --input-path 'C:\Program Files\CarbonBlack\CarbonBlack.exe' \ + --input-thumbprint +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on. Set both to the same value. +- `--input-path`: The full path to the Carbon Black process. Wrap paths that contain spaces or backslashes in single quotes. +- `--input-thumbprint`: (Recommended) The signing certificate thumbprint of the binary. +- `--input-sha256`: (Optional) The SHA-256 value of the binary. Only set this value if you strictly control Carbon Black updates. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the Carbon Black check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/client-certificate.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/client-certificate.mdx index 3ed601bedaf..5f113cb3d82 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/client-certificate.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/client-certificate.mdx @@ -11,7 +11,7 @@ tags: - mTLS --- -import { Details, Render, TabItem, Tabs } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components"; The Client Certificate device posture attribute checks if the device has a valid client certificate signed by a trusted certificate. The trusted certificate is uploaded to Cloudflare and specified as part of the posture check rule. The client certificate posture check can be used in Gateway and Access policies to ensure that the user is connecting from a managed device. @@ -55,6 +55,10 @@ To generate a sample root CA for testing, refer to [Generate mTLS certificates]( ## Configure the client certificate check + + + + 1. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** and **SSL and Certificates Write** permissions. + + +1. Upload the signing certificate in PEM format with `cf ssl mtls-certificates create`: + + ```sh + cf ssl mtls-certificates create \ + --name "Device signing CA" \ + --ca true \ + --certificates @signing-ca.pem + ``` + + Pass the file with the `@` prefix. If you only use this certificate for posture checks, you do not need to upload its private key. Note the `id` in the output. + +2. Create the client certificate check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create). For example, to check the Windows trust stores: + + ```sh + cf zero-trust devices posture rules create \ + --name "Corporate client certificate" \ + --type client_certificate_v2 \ + --match '[{"platform":"windows"}]' \ + --input-operating-system windows \ + --input-certificate-id \ + --input-locations-trust-stores system user \ + --input-cn '${serial_number}_mycompany' \ + --input-check-private-key true \ + --input-extended-key-usage clientAuth + ``` + + - `--match` and `--input-operating-system`: The operating system to run the check on (`windows`, `mac`, or `linux`). Set both to the same value. + - `--input-certificate-id`: The `id` of the signing certificate that you uploaded. + - `--input-locations-trust-stores`: The **OS locations** to search, as a space-separated list. Use `system` for the Windows local machine trust store or the macOS System keychain, and `user` for the Windows user trust store. + - `--input-locations-paths`: (Linux only) Absolute paths to search instead of NSSDB, for example `--input-locations-paths /usr/local/mycompany/certs/client.pem /usr/local/mycompany/certs/client_key.pem`. + - `--input-cn`: (Optional) The **Common name** to match. Wrap values that contain `${serial_number}` or `${hostname}` in single quotes so that your shell does not expand them. + - `--input-extended-key-usage`: (Optional) `clientAuth`, `emailProtection`, or both, separated by a space. + - `--input-check-private-key`: Set to `true` (recommended) to check that the device has the private key for the client certificate. `cf` requires this option when you pass `--input-locations-*` or `--input-extended-key-usage`. + - `--input-subject-alternative-names`: (Optional) One or more **Subject Alternative Name** values to match. + +3. Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the client certificate check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/corp-device.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/corp-device.mdx index 1ed41b6aaf8..31dd7ec1aab 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/corp-device.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/corp-device.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One allows you to build Zero Trust rules based on device serial numbers. You can create these rules so that access to applications is granted only to users connecting from company devices. @@ -29,6 +29,10 @@ Cloudflare One allows you to build Zero Trust rules based on device serial numbe To create rules based on device serial numbers, you first need to create a [Gateway List](/cloudflare-one/reusable-components/lists/) of numbers. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Lists**. 2. Select **Create manual list** or **Upload CSV**. For larger teams, we recommend uploading a CSV or using Cloudflare's [API endpoint](/api/resources/zero_trust/subresources/gateway/subresources/lists/methods/list/). @@ -40,6 +44,26 @@ To create rules based on device serial numbers, you first need to create a [Gate 5. Enter the serial numbers of the devices your team manages, or upload your CSV file. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create a list of type `SERIAL` with [`cf zero-trust gateway lists create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-create): + +```sh +cf zero-trust gateway lists create \ + --name "Corporate devices" \ + --type SERIAL \ + --items '[{"value":""},{"value":""}]' +``` + +For larger teams, put the items in a JSON file and pass it with `--items @serial-numbers.json`. + + + You can now create an [Access policy](/cloudflare-one/access-controls/policies/) or a Gateway [network policy](/cloudflare-one/traffic-controls/network-policies/common-policies/#enforce-device-posture) that checks if the device presents a serial number on your list. In Access, the serial number check will appear as a _Device Posture - Serial Number List_ selector. In Gateway, your serial number list will appear in the **Value** dropdown when you choose the [Passed Device Posture Check](/cloudflare-one/traffic-controls/network-policies/#device-posture) selector. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/device-uuid.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/device-uuid.mdx index a50b92e8fd3..bee9c596740 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/device-uuid.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/device-uuid.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One allows you to build Zero Trust rules based on device UUIDs supplied in an MDM file. You can create these rules so that access to applications is granted only to users connecting from company devices. @@ -37,6 +37,10 @@ You will need to use a [managed deployment tool](/cloudflare-one/team-and-resour To create rules based on device UUIDs, you first need to create a [Gateway List](/cloudflare-one/reusable-components/lists/) of UUIDs. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Lists**. 2. Select **Create manual list** or **Upload CSV**. For larger teams, we recommend uploading a CSV or using Cloudflare's [API endpoint](/api/resources/zero_trust/subresources/gateway/subresources/lists/methods/list/). @@ -48,6 +52,26 @@ To create rules based on device UUIDs, you first need to create a [Gateway List] 5. Enter the UUIDs of the devices your team manages, or upload your CSV file. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create a list of type `DEVICE` with [`cf zero-trust gateway lists create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-create): + +```sh +cf zero-trust gateway lists create \ + --name "Corporate device UUIDs" \ + --type DEVICE \ + --items '[{"value":""},{"value":""}]' +``` + +For larger teams, put the items in a JSON file and pass it with `--items @device-uuids.json`. + + + :::note diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/disk-encryption.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/disk-encryption.mdx index 529278ab4b0..1fcaf329ec2 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/disk-encryption.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/disk-encryption.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The Disk Encryption device posture attribute ensures that disks are encrypted on a device. @@ -30,6 +30,10 @@ The Disk Encryption device posture attribute ensures that disks are encrypted on ## Enable the disk encryption check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **Disk Encryption**. @@ -37,6 +41,31 @@ The Disk Encryption device posture attribute ensures that disks are encrypted on 5. Select your operating system. 6. Either enable disk encryption for all volumes, or input the specific volume(s) you want to check for encryption (for example, `C`). 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the disk encryption check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create). To check all volumes: + +```sh +cf zero-trust devices posture rules create \ + --name "Disk encryption on Windows" \ + --type disk_encryption \ + --match '[{"platform":"windows"}]' \ + --input-require-all true +``` + +To check specific volumes instead, replace `--input-require-all true` with `--input-check-disks` and a space-separated list of volume names, for example `--input-check-disks C D`. + +- `--match`: The operating system to run the check on, for example `windows`, `mac`, or `linux`. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the disk encryption check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/domain-joined.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/domain-joined.mdx index 82a8e40767b..2da426d3a5d 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/domain-joined.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/domain-joined.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The Domain Joined device posture attribute ensures that a user is a member of a specific Windows Active Directory domain. @@ -30,6 +30,10 @@ The Domain Joined device posture attribute ensures that a user is a member of a ## Enable the Domain Joined check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **Domain Joined**. @@ -40,6 +44,30 @@ The Domain Joined device posture attribute ensures that a user is a member of a The **Domain** field is case-sensitive. If your domain is `example.com`, entering `Example.com` will fail the posture check. ::: 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the Domain Joined check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Joined to example.com" \ + --type domain_joined \ + --match '[{"platform":"windows"}]' \ + --input-operating-system windows \ + --input-domain example.com +``` + +- `--input-domain`: The Active Directory domain to check for. This value is case-sensitive. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the Domain Joined check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/file-check.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/file-check.mdx index bcf50cd8896..61027ebf5f4 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/file-check.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/file-check.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The File Check device posture attribute checks for the presence of a file on a device. You can create multiple file checks for each operating system you need to run it on, or if you need to check for multiple files. @@ -27,6 +27,10 @@ The File Check device posture attribute checks for the presence of a file on a d ## Configure a file check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. @@ -43,5 +47,36 @@ The File Check device posture attribute checks for the presence of a file on a d 5. **SHA-256 (optional)**: Enter the [SHA-256 value](/cloudflare-one/reusable-components/posture-checks/client-checks/application-check/#determine-the-sha-256-value) of the file. This is used to ensure the integrity of the file on the device. 5. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the file check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Example file check" \ + --type file \ + --match '[{"platform":"windows"}]' \ + --input-operating-system windows \ + --input-path 'C:\Program Files\Example\example.exe' \ + --input-exists true \ + --input-thumbprint \ + --input-sha256 +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on (`windows`, `mac`, or `linux`). Set both to the same value. +- `--input-path`: The file path. Wrap paths that contain spaces or backslashes in single quotes. +- `--input-exists`: Set to `true` to pass the check when the file is present. +- `--input-thumbprint`: (Recommended) The signing certificate thumbprint. +- `--input-sha256`: (Optional) The SHA-256 value of the file. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the file check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/firewall.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/firewall.mdx index 1d1d08a8022..3b7f565b3ed 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/firewall.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/firewall.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The Firewall device posture attribute ensures that a firewall is running on a device. @@ -30,6 +30,10 @@ The Firewall device posture attribute ensures that a firewall is running on a de ## Enable the firewall check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **Firewall**. @@ -43,6 +47,31 @@ The Firewall device posture attribute ensures that a firewall is running on a de The **Enable firewall check** toggle does not turn the posture check on or off; rather, the toggle determines whether the Cloudflare One Client looks for an active or inactive firewall. ::: 7. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the firewall check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Firewall enabled on macOS" \ + --type firewall \ + --match '[{"platform":"mac"}]' \ + --input-operating-system mac \ + --input-enabled true +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on (`windows` or `mac`). Set both to the same value. +- `--input-enabled`: Set to `true` (recommended) to pass the check only if the firewall is running, or `false` to pass the check only if the firewall is turned off. This corresponds to **Enable firewall check** in the dashboard. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the firewall check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/os-version.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/os-version.mdx index e30d916ac24..53a78090beb 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/os-version.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/os-version.mdx @@ -10,7 +10,7 @@ tags: - Posture --- -import { Render, TabItem, Tabs } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; The OS Version device posture attribute checks whether the version of a device's operating system matches, is greater than or lesser than the configured value. @@ -27,6 +27,10 @@ The OS Version device posture attribute checks whether the version of a device's ## Enable the OS version check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **OS version**. @@ -58,6 +62,34 @@ The OS Version device posture attribute checks whether the version of a device's 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the OS version check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "macOS 15 or later" \ + --type os_version \ + --match '[{"platform":"mac"}]' \ + --input-operating-system mac \ + --input-operator ">=" \ + --input-version 15.0.0 +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on. Set both to the same value. +- `--input-operator` and `--input-version`: How to compare the device's [OS version](#determine-the-os-version) (`<`, `<=`, `>`, `>=`, or `==`) and the version in SemVer format. +- `--input-os-version-extra`: (Optional) The Windows Update Build Revision (for example, `3803`) or the macOS or iOS Rapid Security Response version (for example, `(a)`). +- `--input-os-distro-name` and `--input-os-distro-revision`: (Optional, Linux only) The Linux distribution to match, for example `ubuntu` and `22.04`. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the OS version check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-gateway.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-gateway.mdx index ec1a5813882..83047f02def 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-gateway.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-gateway.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; With Require Gateway, you can allow access to your applications only to devices enrolled in your Zero Trust organization. Unlike [Require WARP](/cloudflare-one/reusable-components/posture-checks/client-checks/require-warp/), which will check for any WARP instance (including the consumer version), Require Gateway will only allow requests coming from devices whose traffic is filtered by your organization's Cloudflare Gateway configuration. This policy is best used when you want to protect company-owned assets by only allowing access to employees. @@ -42,11 +42,32 @@ The check result depends on the [client mode](/cloudflare-one/team-and-resources ## 1. Enable the Gateway check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. 3. Select **Gateway**, then select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the Gateway check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "Gateway" \ + --type gateway +``` + + + ## 2. Add the check to an Access application diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-warp.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-warp.mdx index 3d59486d77b..188d4423249 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-warp.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/require-warp.mdx @@ -13,7 +13,7 @@ tags: - Posture --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; :::note @@ -48,11 +48,42 @@ The check result depends on the [client mode](/cloudflare-one/team-and-resources ## 1. Enable the WARP check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. Ensure that *Allow Secure Web Gateway to proxy traffic** is enabled. 3. Go to **Reusable components** > **Posture checks**. 4. In **Cloudflare One Client checks**, select **Add a check**. 5. Select **WARP**, then select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Check that `gateway_proxy_enabled` is `true` in your global device client settings: + + ```sh + cf zero-trust devices settings get + ``` + + If it is `false`, turn on **Allow Secure Web Gateway to proxy traffic** in the dashboard or with `cf zero-trust devices settings update --gateway-proxy-enabled true`. This setting applies to all devices in your organization. + +2. Create the WARP check with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + + ```sh + cf zero-trust devices posture rules create \ + --name "WARP" \ + --type warp + ``` + + + + ## 2. Add the check to an Access policy diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/sentinel-one.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/sentinel-one.mdx index 14d73536ffe..25f2a593150 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/sentinel-one.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/client-checks/sentinel-one.mdx @@ -14,7 +14,7 @@ tags: - SentinelOne --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One can check if [SentinelOne](https://www.sentinelone.com/) is running on a device to determine if a request should be allowed to reach a protected resource. @@ -32,6 +32,10 @@ Cloudflare One can check if [SentinelOne](https://www.sentinelone.com/) is runni ## Configure the SentinelOne check + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Posture checks**. 2. Go to **Cloudflare One Client checks** and select **Add a check**. @@ -48,5 +52,33 @@ Cloudflare One can check if [SentinelOne](https://www.sentinelone.com/) is runni 4. **Signing certificate thumbprint (recommended)**: Enter the thumbprint of the publishing certificate used to sign the binary. This proves the binary came from SentinelOne and is the recommended way to validate the process. 5. **SHA-256 (optional)**: Enter a SHA-256 value. This is used to validate the SHA256 signature of the binary and ensures the integrity of the binary file on the device. Note: do not fill out this field unless you strictly control updates to SentinelOne, as this will change between versions. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create one SentinelOne check per operating system with [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create): + +```sh +cf zero-trust devices posture rules create \ + --name "SentinelOne on Windows" \ + --type sentinelone \ + --match '[{"platform":"windows"}]' \ + --input-operating-system windows \ + --input-path 'C:\Program Files\SentinelOne\Sentinel Agent \SentinelAgent.exe' \ + --input-thumbprint +``` + +- `--match` and `--input-operating-system`: The operating system to run the check on. Set both to the same value. +- `--input-path`: The full path to the SentinelOne process. Wrap paths that contain spaces or backslashes in single quotes. +- `--input-thumbprint`: (Recommended) The signing certificate thumbprint of the binary. +- `--input-sha256`: (Optional) The SHA-256 value of the binary. Only set this value if you strictly control SentinelOne updates. + +Note the `id` in the output to use the check in a [device posture policy](/cloudflare-one/reusable-components/posture-checks/#3-build-a-device-posture-policy). + + + Next, go to **Insights** > **Logs** > **Posture logs** and verify that the SentinelOne check is returning the expected results. diff --git a/src/content/docs/cloudflare-one/reusable-components/posture-checks/index.mdx b/src/content/docs/cloudflare-one/reusable-components/posture-checks/index.mdx index a044f15d221..8f402435acf 100644 --- a/src/content/docs/cloudflare-one/reusable-components/posture-checks/index.mdx +++ b/src/content/docs/cloudflare-one/reusable-components/posture-checks/index.mdx @@ -72,14 +72,14 @@ For example, if you establish an SSH session based on a successful posture check ### Expiration -By default, the posture result on Cloudflare remains valid until it is overwritten by new data. You can specify an `expiration` time using our [API](/api/resources/zero_trust/subresources/devices/subresources/posture/methods/update/). Cloudflare recommends setting the expiration to be at least double the [polling frequency](#polling-frequency). For example, if the posture check polling frequency is set to one hour, its expiration time should be set to two hours or greater. +By default, the posture result on Cloudflare remains valid until it is overwritten by new data. You can specify an `expiration` time using our [API](/api/resources/zero_trust/subresources/devices/subresources/posture/methods/update/). Cloudflare recommends setting the expiration to be at least double the [polling frequency](#polling-frequency). For example, if the posture check polling frequency is set to one hour, its expiration time should be set to two hours or greater. With the [Cloudflare CLI (`cf`)](/cf/), pass `--expiration` (for example, `--expiration 2h`) to [`cf zero-trust devices posture rules create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-rules-create) or `update`. ### Polling frequency #### Cloudflare One Client checks -By default, the Cloudflare One Client polls the device for status changes every five minutes. To modify the polling frequency, use the API to update the [`schedule`](/api/resources/zero_trust/subresources/devices/subresources/posture/methods/update/) parameter. +By default, the Cloudflare One Client polls the device for status changes every five minutes. To modify the polling frequency, use the API to update the [`schedule`](/api/resources/zero_trust/subresources/devices/subresources/posture/methods/update/) parameter. With `cf`, pass `--schedule` (for example, `--schedule 1h`) to `cf zero-trust devices posture rules create` or `update`. #### Service provider checks -When setting up a [service-to-service integration](/cloudflare-one/integrations/service-providers/), you will choose a polling frequency to determine how often Cloudflare will query the third-party API. To set the polling frequency via the API, use the [`interval`](/api/resources/zero_trust/subresources/devices/subresources/posture/subresources/integrations/methods/edit/) parameter. +When setting up a [service-to-service integration](/cloudflare-one/integrations/service-providers/), you will choose a polling frequency to determine how often Cloudflare will query the third-party API. To set the polling frequency via the API, use the [`interval`](/api/resources/zero_trust/subresources/devices/subresources/posture/subresources/integrations/methods/edit/) parameter. With `cf`, pass `--interval` to [`cf zero-trust devices posture integrations create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-posture-integrations-create) or `update`. diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cli-commands.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cli-commands.mdx new file mode 100644 index 00000000000..ef295d89c58 --- /dev/null +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cli-commands.mdx @@ -0,0 +1,102 @@ +--- +pcx_content_type: reference +title: Device CLI commands +description: Manage devices, device registrations, posture checks, managed networks, device IP profiles, client version assignments, and global device settings from the command line using the Cloudflare CLI (cf). +sidebar: + order: 10 +products: + - cloudflare-one +--- + +import { CfCommand, CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust devices` commands to manage enrolled devices and device registrations, create device posture checks and service provider integrations, configure managed networks, device IP profiles, and client version assignments, and review global device client settings from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission (or **Zero Trust Write** to make changes). + +:::note +`cf zero-trust devices` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- `cf` does not yet support [device profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/), [Split Tunnels](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/split-tunnels/), [Local Domain Fallback](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/local-domains/), or revoking and unrevoking device registrations. Use the dashboard or the API for these tasks. +- `posture rules update` and `networks update` replace the whole object. Pass the current `--name`, `--type`, `--match`, and all `--input-*` or `--network-config-*` values along with your changes. Values that you omit are removed. +- `settings update`, `ip-profiles update`, `deployment-groups update`, and `posture integrations update` only change the values that you pass. `--version-config` and `--policy-ids` on `deployment-groups update` replace the whole array. +- `devices list` and `registrations list` return one page of results. Pagination metadata, including the `cursor` for the next page, is written to standard error as a `result_info:` line. For details, refer to [Paginate results](/cf/get-started/resources/#paginate-results). `registrations list` only returns active registrations unless you pass `--status all` or `--status revoked`. +- Pass `-f` (`--force`) to `delete` and `bulk-delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. + +::: + +## `zero-trust devices` + +List, inspect, tag, and delete the physical devices enrolled in your Zero Trust organization. To include the [device profile](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/) of each device's last active registration, pass `--include last_seen_registration.policy` to `devices list`. Deleting a device also deletes all of its [device registrations](/cloudflare-one/team-and-resources/devices/device-registration/). + + + + + + + + + +## `zero-trust devices registrations` + +List, inspect, and delete [device registrations](/cloudflare-one/team-and-resources/devices/device-registration/), and retrieve [admin override codes](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/#allow-admin-override-codes) for a registration. Each registration includes its `virtual_ipv4` and `virtual_ipv6` [device IPs](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips/) and, when revoked, a `revoked_at` timestamp. + + + +## `zero-trust devices posture rules` + +Create and manage [Cloudflare One Client checks](/cloudflare-one/reusable-components/posture-checks/client-checks/) and [service provider checks](/cloudflare-one/integrations/service-providers/). Set the check with `--type`, the operating systems it runs on with `--match` (for example, `--match '[{"platform":"windows"}]'`), and the check attributes with the `--input-*` options. `--schedule` sets the [polling frequency](/cloudflare-one/reusable-components/posture-checks/#polling-frequency) and `--expiration` sets how long a posture result stays [valid](/cloudflare-one/reusable-components/posture-checks/#expiration), for example `1h`. + + + +## `zero-trust devices posture integrations` + +Create and manage [service provider integrations](/cloudflare-one/integrations/service-providers/) that send device posture signals to Cloudflare. `posture integrations create` tests the credentials against the provider's API and fails if the provider cannot be reached or the credentials are not valid. + + + +## `zero-trust devices networks` + +Create and manage [managed networks](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/managed-networks/) that the Cloudflare One Client detects with a TLS endpoint. + + + +## `zero-trust devices ip-profiles` + +Create and manage [device IP profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips/#create-an-ip-profile) that assign IPv4 subnets to devices based on user identity. Write the rules as a [wirefilter expression](/cloudflare-one/traffic-controls/expression-syntax/) in `--match`, for example `--match 'identity.email == "user@example.com"'`. To create the subnets, use [`cf network subnets warp create`](#cf-network-subnets-warp-create). + + + +## `network subnets warp` + +Create and manage the [device IP subnets](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips/) that device IP profiles assign addresses from. + + + +## `zero-trust devices deployment-groups` + +Create and manage [deployment groups](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/client-version-assignments/) that assign a target Cloudflare One Client version to devices in one or more device profiles. + + + +## `zero-trust devices client-versions` + +List the Cloudflare One Client versions and target environments that you can assign in a deployment group. `client-versions list` requires `--target-environment` (`windows` or `macos`) and `--release-track` (`ga` or `beta`). + + + +## `zero-trust devices override-codes` + +Generate device-specific and account-wide [uninstall codes](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/uninstall-protection/#generate-an-uninstall-code) for devices with uninstall protection turned on. + + + +## `zero-trust devices settings` + +Review and change [global device client settings](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/#global-device-client-settings), such as the Gateway proxy, root certificate installation, unique device IPs, the admin override code timeout, and [External Emergency Disconnect](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect/#set-up-external-emergency-disconnect). These settings apply to every device in your account. Run `settings get` to review the current values before you change them. + + + +## `zero-trust devices emergency-disconnect` + +Check and change the [Disconnect the Cloudflare One Client on all devices](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/#disconnect-the-cloudflare-one-client-on-all-devices) setting. `emergency-disconnect set --disconnect true` disconnects every Windows, macOS, and Linux device in your organization and requires the Super Administrator role. + + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips.mdx index 92b1407efd4..32a33131f36 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-ips.mdx @@ -13,7 +13,7 @@ tags: - REST API --- -import { Render, Details } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components";
@@ -57,6 +57,10 @@ Create a custom IP subnet when the [default IPv4 range](#default-device-ips) con To define a custom IPv4 subnet for device IPs: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices** > **Device profiles**. 2. Under **Device IP subnets**, select **Add new IP subnet**. 3. Enter any name for the subnet. @@ -73,6 +77,27 @@ To define a custom IPv4 subnet for device IPs: ::: 5. Select **Add subnet** to save. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the subnet with [`cf network subnets warp create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-network-subnets-warp-create): + +```sh +cf network subnets warp create \ + --name "IT department subnet" \ + --network 10.100.0.0/24 +``` + +- `--network`: An IPv4 CIDR block of size `/24` or larger within `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, or `100.64.0.0/10`. Ensure that the CIDR block does not overlap with existing internal routes. + +Note the `id` in the output to [assign this subnet](#assign-device-ips). + + + Next, [assign this subnet](#assign-device-ips) to a group of devices. @@ -88,6 +113,10 @@ Assign [custom IP subnets](#create-an-ip-subnet) to ensure devices are provision To assign IP subnets to your devices: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices** > **Device profiles**. 2. Under **Device IP profiles**, select **Add new IP profile**. 3. Enter a name for this group of devices (for example, `IT department`). @@ -95,6 +124,29 @@ To assign IP subnets to your devices: 5. Choose an existing IPv4 subnet from the dropdown menu, or [create a new subnet](#create-an-ipv4-subnet). 6. Select **Assign IP address**. 7. (Optional) In the **Device IP profiles** table, change the [order of precedence](#order-of-precedence) of IP profiles. + + + + + +Create the IP profile with [`cf zero-trust devices ip-profiles create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-ip-profiles-create): + +```sh +cf zero-trust devices ip-profiles create \ + --name "IT department" \ + --match 'any(identity.groups.name[*] in {"IT"})' \ + --subnet-id \ + --precedence 10 +``` + +- `--match`: The rules that define which users receive these IPs, as a [wirefilter expression](/cloudflare-one/traffic-controls/expression-syntax/). For example, `identity.email == "user@example.com"` matches a single user. Available fields are `identity.email`, `identity.name`, `identity.groups.id`, `identity.groups.name`, `identity.groups.email`, and `identity.saml_attributes`. +- `--subnet-id`: The `id` of the [IPv4 subnet](#create-an-ip-subnet). To list your subnets, run `cf network subnets list`. +- `--precedence`: The [order of precedence](#order-of-precedence). Profiles with lower values are evaluated first. + +To change the precedence or rules of an existing IP profile, run `cf zero-trust devices ip-profiles update ` with only the options that you want to change. + + + Devices that match your rules are assigned a random IP from this address space upon registration. Only newly registered devices will receive a new IP; existing devices will not see any impact to connectivity. To assign a new IP to an existing device, you must [delete its registration](/cloudflare-one/team-and-resources/devices/device-registration/#delete-a-device-registration) and then [re-enroll the device](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/manual-deployment/) in your Zero Trust organization. @@ -198,16 +250,41 @@ The Cloudflare One Client checks the IP profiles from top to bottom as they appe ## Verify device IPs -### Via the dashboard +### Via the dashboard or `cf` To check the virtual IP addresses assigned to a specific device registration: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices**. 2. Select your device > **View details**. :::tip[Device filters] The Cloudflare One dashboard defaults to showing devices that were last seen within the past year. You can select **Show filters** to change the date range or filter by the last active user. ::: 3. Scroll down to **Users**. You will see the registrations associated with this device along with their assigned IPv4 and IPv6 addresses. + + + + + + +1. Find the device ID: + + ```sh + cf zero-trust devices list --search "" + ``` + +2. List the device's registrations with [`cf zero-trust devices registrations list`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-registrations-list) and review the `virtual_ipv4` and `virtual_ipv6` fields: + + ```sh + cf zero-trust devices registrations list --device-id --status all + ``` + + + + ### Via the CLI @@ -219,11 +296,30 @@ To check the device IP used by the device client's virtual network interface: Monitor the consumption of your IPv4 subnets to ensure you have enough addresses for new device registrations. Devices will be unable to register if they match a subnet with no available IPs. -Use the Cloudflare One dashboard to view a high-level overview of assigned and available IPs: +To view a high-level overview of assigned and available IPs: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices** > **Device profiles**. 2. Locate the **Device IP subnets** table. 3. The **IPs assigned** column displays the total number of IPs currently assigned to active device registrations versus the total capacity of the CIDR block. + + + + + +Get the subnet and review the `capacity` field in the output: + +```sh +cf network subnets warp get +``` + +`capacity.used` is the number of IPs assigned to device registrations, and `capacity.total` is the number of IPs in the CIDR block. + + + If your subnet is approaching capacity, you can [expand your subnet](#edit-an-ip-subnet) to increase the number of available IPs. Alternatively, you can free up IPs by [deleting existing device registrations](/cloudflare-one/team-and-resources/devices/device-registration/#delete-a-device-registration), particularly revoked registrations that may be consuming IP space despite the device no longer being in use. @@ -347,9 +443,42 @@ To get a list of all device registrations in a subnet (including revoked registr Cloudflare does not support editing an existing IPv4 subnet definition. To assign a different IPv4 subnet to your devices: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices** > **Device profiles**. 2. Under **Device IP profiles**, find the device group associated with the old subnet and select **Edit**. 3. Select **Create new subnet IP range** to define a new subnet. 4. Select **Save**. + + + + + + +1. Create the new subnet: + + ```sh + cf network subnets warp create \ + --name "IT department subnet v2" \ + --network 10.101.0.0/23 + ``` + +2. Update the IP profile to use the new subnet: + + ```sh + cf zero-trust devices ip-profiles update --subnet-id + ``` + +3. (Optional) Delete the old subnet. You cannot delete a subnet while an IP profile uses it. + + ```sh + cf network subnets warp delete --force + ``` + + + + The new subnet will appear in the **Device IP subnets** table. You can now delete the old subnet. Devices will only get an IP from the new subnet when they [re-register](/cloudflare-one/team-and-resources/devices/device-registration/#delete-a-device-registration); existing registrations will retain their [current IP](#verify-device-ips). diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles.mdx index 885a7f76a5e..b92e6d44272 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles.mdx @@ -10,7 +10,7 @@ tags: - SAML --- -import { Render, TabItem, Tabs, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; @@ -110,20 +110,64 @@ Send a `POST` request to the [Devices API](/api/resources/zero_trust/subresource ## Verify device profile -### Via the dashboard +### Via the dashboard or `cf` To verify the last active device profile for a specific device: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices**. 2. Under devices, find your device. 3. Review the device profile under **Last active device profile**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + +List the device with [`cf zero-trust devices list`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-list) and include the device profile of its last active registration: + +```sh +cf zero-trust devices list \ + --search "" \ + --include last_seen_registration.policy +``` + +The device profile `id` and `name` are in the `last_seen_registration.policy` field. + + + To verify the last active device profile for a user's devices: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Users**. 2. Under **User name**, find the user you would like to investigate. 3. Select **Devices** to see all devices used by the user. 4. Find the device you want to investigate and verify the last active device profile for that device under the **Device profile** column. + + + + + +List the devices last used by the user and include the device profile of each device's last active registration: + +```sh +cf zero-trust devices list \ + --last-seen-user-email user@example.com \ + --include last_seen_registration.policy +``` + +To review the device profile of each of the user's device registrations, run `cf zero-trust devices registrations list --search user@example.com --include policy` and review the `policy` field. + + + Alternatively, you can use [DEX remote captures](/cloudflare-one/insights/dex/diagnostics/client-packet-capture/) to collect client diagnostic logs. The device profile UUID is shown in your [detection report](/cloudflare-one/insights/dex/diagnostics/client-packet-capture/#diagnostics-analyzer-beta) under `Profile ID`. diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/managed-networks.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/managed-networks.mdx index c6ed1f3112c..343201ad66f 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/managed-networks.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/managed-networks.mdx @@ -210,6 +210,26 @@ The SHA-256 fingerprint is only required if your TLS endpoint uses a self-signed 5. (Optional) In **TLS Cert SHA-256**, enter the [SHA-256 fingerprint](#2-extract-the-sha-256-fingerprint) of the TLS certificate. This field is only needed for self-signed certificates. If a TLS fingerprint is not supplied, the Cloudflare One Client validates the certificate against the local certificate store and checks that it is signed by a public certificate authority. 6. Select **Save**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Add the managed network with [`cf zero-trust devices networks create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-networks-create): + +```sh +cf zero-trust devices networks create \ + --name "Office managed network" \ + --type tls \ + --network-config-tls-sockaddr 192.168.185.198:3333 \ + --network-config-sha256 +``` + +- `--network-config-tls-sockaddr`: The private IP address and port of your [TLS endpoint](#create-a-new-tls-endpoint), in `host:port` format. +- `--network-config-sha256`: (Optional) The [SHA-256 fingerprint](#2-extract-the-sha-256-fingerprint) of the TLS certificate. Only needed for self-signed certificates. + +Note the `name` of the network to use in a [device profile](#4-configure-device-profile). `cf zero-trust devices networks update` replaces the whole managed network, so pass `--name`, `--type`, and all `--network-config-*` values when you make changes. If you omit `--network-config-sha256`, the fingerprint is removed. + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect.mdx index c6512e55b50..d7b3154e2ce 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect.mdx @@ -159,6 +159,27 @@ To configure External Emergency Disconnect using the dashboard: All Cloudflare One Clients in your organization will now start polling the external endpoint and connect or disconnect based on the response payload. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Configure and turn on External Emergency Disconnect with [`cf zero-trust devices settings update`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-settings-update): + +```sh +cf zero-trust devices settings update \ + --external-emergency-signal-enabled true \ + --external-emergency-signal-url "https://192.0.2.1:3333/status/disconnect" \ + --external-emergency-signal-fingerprint DD4F4806C57A5BBAF1AA5B080F0541DA75DB468D0A1FE731310149500CCD8662 \ + --external-emergency-signal-interval 1m +``` + +- `--external-emergency-signal-url`: The HTTPS URL from which to fetch the external disconnect signal. The URL must use an IPv4 or IPv6 address as the host. +- `--external-emergency-signal-fingerprint`: The [SHA-256 fingerprint](#2-extract-the-sha-256-fingerprint) of the HTTPS server certificate. +- `--external-emergency-signal-interval`: How often the Cloudflare One Client fetches the signal, as a duration such as `1m` or `2m30s`. The minimum is 30 seconds. + +This command only changes the settings that you pass. To review the current values, run `cf zero-trust devices settings get`. + @@ -333,6 +354,20 @@ If the external endpoint becomes unavailable or serves an invalid configuration, Cloudflare will propagate the new setting to clients, instructing them to stop polling and discard the cached emergency state. + + + +Turn off External Emergency Disconnect and remove the endpoint URL and fingerprint: + +```sh +cf zero-trust devices settings update \ + --external-emergency-signal-enabled false \ + --external-emergency-signal-url "" \ + --external-emergency-signal-fingerprint "" +``` + +Cloudflare will propagate the new settings to clients, instructing them to stop polling and discard the cached emergency state. + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/index.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/index.mdx index 393545523ab..3ca5beb7ba5 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/index.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/index.mdx @@ -14,14 +14,7 @@ tags: - MASQUE --- -import { - Details, - GlossaryTooltip, - Badge, - Render, - Tabs, - TabItem, -} from "~/components"; +import { Badge, Details, GlossaryTooltip, Render, Steps, TabItem, Tabs } from "~/components"; Device client settings (formerly WARP) allow you to customize the Cloudflare One Client modes and permissions available to end users. @@ -65,12 +58,42 @@ If [Auto connect](#auto-connect) is enabled, the Cloudflare One Client will auto To retrieve the one-time code for a user: + + + + 1. Enable **Allow admin override codes**. 2. Go to **Team & Resources** > **Devices**. 3. Select **View details** for a connected device. 4. Scroll down to **User details** and select the user's name. 5. Copy the 7-digit **Override code** shown in the side panel. 6. Share this code with the user for them to enter on their device. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + + +1. In the dashboard, enable **Allow admin override codes**. +2. Find the device registration for the user and device: + + ```sh + cf zero-trust devices registrations list --search user@example.com + ``` + +3. Get the override code for the registration with [`cf zero-trust devices registrations override-codes get`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-registrations-override-codes-get): + + ```sh + cf zero-trust devices registrations override-codes get + ``` + +4. Copy the 7-digit override code from the output and share it with the user for them to enter on their device. + + + + The user must enter the override code before the **Timeout** elapses, counted from the start of the hour in which the code was retrieved. The override then lasts for the **Timeout**, minus one hour for each new hour that has started since the code was retrieved. @@ -189,6 +212,8 @@ Requires the [Super Administrator](/cloudflare-one/roles-permissions/) role. To resume normal operations, turn off **Disconnect the Cloudflare One Client on all devices**. The Cloudflare One Client will automatically reconnect. +You can also turn this setting on or off with the [Cloudflare CLI (`cf`)](/cf/). Run [`cf zero-trust devices emergency-disconnect set`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-emergency-disconnect-set) with `--disconnect true` to disconnect all devices or `--disconnect false` to resume normal operations, and describe the reason in `--justification`. The justification appears in your audit logs. To check the current state, run `cf zero-trust devices emergency-disconnect get`. + For more information on how **Disconnect the Cloudflare One Client on all devices** works with other device client settings, refer to [Device client settings precedence](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/emergency-disconnect/#device-client-settings-precedence). ### Manage device connection using an external signal diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/uninstall-protection.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/uninstall-protection.mdx index a9219fc5a18..a8651dae991 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/uninstall-protection.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/uninstall-protection.mdx @@ -130,6 +130,33 @@ The device must receive the updated profile before uninstall protection takes ef 5. Select **Generate code**. 6. Copy the 7-digit code and share it with the user. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with at least **Zero Trust Read** permission. + + +1. Find the device ID: + + ```sh + cf zero-trust devices list --search "" + ``` + +2. Generate the code with [`cf zero-trust devices override-codes create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-override-codes-create): + + ```sh + cf zero-trust devices override-codes create \ + --type uninstall_protection \ + --scope device \ + --device-id \ + --duration-hours 4 + ``` + + Set `--duration-hours` to a value from `1` to `24`. + +3. Copy the 7-digit `code` from the output and share it with the user. + + Send a `POST` request to the [Devices API](/api/resources/zero_trust/subresources/devices/subresources/override_codes/methods/create/). Set `scope` to `device` and set `device_id` to the device ID. Set `duration_hours` to a value from `1` to `24`. The [API token](/fundamentals/api/get-started/create-token/) needs at least `Zero Trust Read` permissions: @@ -174,6 +201,20 @@ A device-specific uninstall code only works on the device it was generated for. 4. Select **Generate token**. 5. Copy the token. + + + +Generate the token with `cf zero-trust devices override-codes create`. Set `--scope` to `account` and do not pass `--device-id`: + +```sh +cf zero-trust devices override-codes create \ + --type uninstall_protection \ + --scope account \ + --duration-hours 4 +``` + +Set `--duration-hours` to a value from `1` to `24`. The `code` field in the output contains the account-wide uninstall token. + Send a `POST` request to the [Devices API](/api/resources/zero_trust/subresources/devices/subresources/override_codes/methods/create/). Set `scope` to `account` and do not include `device_id`. Set `duration_hours` to a value from `1` to `24`. The [API token](/fundamentals/api/get-started/create-token/) needs at least `Zero Trust Read` permissions: diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/client-version-assignments.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/client-version-assignments.mdx index 05ae00c319e..bfe35e0e11c 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/client-version-assignments.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/client-version-assignments.mdx @@ -8,7 +8,7 @@ sidebar: order: 6 --- -import { Details, Tabs, TabItem, APIRequest, GlossaryTooltip } from "~/components"; +import { APIRequest, Details, GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; Client version assignments let you target a specific Cloudflare One Client (formerly WARP) version at a group of devices from the Cloudflare dashboard, without touching your MDM file or asking users to update the client themselves. @@ -69,6 +69,38 @@ When a device is targeted by a deployment group, the client suppresses the local 7. Under **Assign client version**, select an operating system, a release track, and a client version. To target additional platforms with the same group, select **Add OS** and repeat. 8. Select **Save**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. List the client versions available for each operating system with [`cf zero-trust devices client-versions list`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-client-versions-list): + + ```sh + cf zero-trust devices client-versions list --target-environment windows --release-track ga + cf zero-trust devices client-versions list --target-environment macos --release-track ga + ``` + + Set `--release-track` to `ga` or `beta`. Note the `version` that you want to deploy on each platform. + +2. Find the IDs of the device profiles whose devices should receive this assignment. `cf` does not yet support listing device profiles. You can find the profile ID of enrolled devices in the `policy` field of `cf zero-trust devices registrations list --include policy`. + +3. Create the deployment group with [`cf zero-trust devices deployment-groups create`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-deployment-groups-create): + + ```sh + cf zero-trust devices deployment-groups create \ + --name "Engineering Ring 0" \ + --version-config '[{"target_environment":"windows","version":""},{"target_environment":"macos","version":""}]' \ + --policy-ids + ``` + + - `--version-config`: One entry per platform, with a `target_environment` (`windows` or `macos`) and a `version` from step 1. Version numbers can differ between platforms. + - `--policy-ids`: A space-separated list of device profile IDs. Each device profile can belong to only one deployment group at a time. + + +To change the target versions or device profiles later, run `cf zero-trust devices deployment-groups update `. `--version-config` and `--policy-ids` replace the whole list, so include the entries that you want to keep. + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/device-registration.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/device-registration.mdx index e4307d464bc..40d947fcc5c 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/device-registration.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/device-registration.mdx @@ -10,7 +10,7 @@ tags: - REST API --- -import { Render, TabItem, Tabs, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; A device registration represents an individual session of the [Cloudflare One Client](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/) on a physical device, linking a user (or service token) and the device to your [Zero Trust organization](/cloudflare-one/setup/#2-create-a-zero-trust-organization). It is created the first time the [Cloudflare One Client](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/) authenticates on that device. @@ -45,6 +45,29 @@ To review a device registration's status: 3. Scroll down to **Users** and find the user associated with the device. 4. Review the status (such as `Active` or `Revoked`) of the device registration under **Status**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission (or **Zero Trust Write** to delete registrations and devices). + + +1. Find the device ID: + + ```sh + cf zero-trust devices list --search "" + ``` + + The `active_registrations` field shows how many active device registrations are associated with each device. + +2. List all device registrations for the device, including revoked registrations, with [`cf zero-trust devices registrations list`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-registrations-list): + + ```sh + cf zero-trust devices registrations list --device-id --status all + ``` + + The `user` field shows who enrolled each registration. A `revoked_at` timestamp indicates that the registration has a [revoked status](#registration-status). If `revoked_at` is null or not present, the registration is active. + + @@ -130,6 +153,29 @@ To delete a device registration: 3. Go to **Users** and mark the checkbox next to the device registration you want to delete. 4. Select **Action** > _Delete access_. + + + + +1. Find the ID of the device registration: + + ```sh + cf zero-trust devices registrations list --device-id + ``` + +2. Delete the registration with [`cf zero-trust devices registrations delete`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-registrations-delete): + + ```sh + cf zero-trust devices registrations delete --force + ``` + + To delete multiple registrations at once, use [`cf zero-trust devices registrations bulk-delete`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-registrations-bulk-delete): + + ```sh + cf zero-trust devices registrations bulk-delete --id --force + ``` + + @@ -174,6 +220,10 @@ If a user re-authenticates while the device registration is revoked, a new devic 3. To revoke access, select **Revoke access**. This revokes access for all associated registrations on the device. 4. To unrevoke access, scroll down to the **Users** section and select one or more users using the checkbox. Select **Actions** > **Unrevoke access**. +:::note +`cf` does not yet support revoking or unrevoking device registrations. Use the dashboard or the API. +::: + ### Delete a device Deleting a device removes the physical device from your Cloudflare Zero Trust account. This action automatically deletes all associated device registrations. @@ -188,9 +238,28 @@ If you delete a device record, but the Cloudflare One Client remains installed a To delete a device: + + + + 1. In Cloudflare One > **Teams & Resources** > **Devices**. 2. Select the device and select **View details**. 3. Select **Delete**. + + + + + +Find the device ID with `cf zero-trust devices list --search ""`, then delete the device with [`cf zero-trust devices delete`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-delete): + +```sh +cf zero-trust devices delete --force +``` + +To include devices that have zero active registrations in the list, add `--active-registrations include`. + + + ## Device management diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/index.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/index.mdx index da433dfa907..c66724f0418 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/index.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/index.mdx @@ -12,4 +12,6 @@ import { DirectoryListing, Render } from "~/components"; Configure devices to send DNS queries to Cloudflare, or proxy all traffic leaving the device through Cloudflare's network. +You can also manage devices, device registrations, posture checks, and managed networks with the [Cloudflare CLI (`cf`)](/cf/). To manage devices from a terminal, a script, or a coding agent, refer to [Device CLI commands](/cloudflare-one/team-and-resources/devices/cli-commands/). + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment.mdx index 10cbcdd6207..c920f6b4fac 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment.mdx @@ -11,7 +11,7 @@ tags: - TLS --- -import { Details, Render } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components";
@@ -39,12 +39,40 @@ The certificate is required if you want to [apply HTTP policies to encrypted web To configure the Cloudflare One Client to install a root certificate on your organization's devices: + + + + 1. (Optional) [Upload](/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate/) a custom root certificate to Cloudflare. 2. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Devices** > **Management**. 3. Under **Global Cloudflare One Client settings**, turn on [**Install CA to system certificate store**](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/#install-ca-to-system-certificate-store). 4. [Install](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/download/) the Cloudflare One Client on the device. 5. [Enroll the device](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/manual-deployment/) in your Zero Trust organization. 6. (Optional) If the device is running macOS Big Sur or newer, [manually trust the certificate](#manually-trust-the-certificate). + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. (Optional) [Upload](/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate/) a custom root certificate to Cloudflare. +2. Turn on [**Install CA to system certificate store**](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/settings/#install-ca-to-system-certificate-store) with [`cf zero-trust devices settings update`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-settings-update): + + ```sh + cf zero-trust devices settings update --root-certificate-installation-enabled true + ``` + + This global setting applies to all devices in your organization. To review the current value, run `cf zero-trust devices settings get` and check `root_certificate_installation_enabled`. + +3. [Install](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/download/) the Cloudflare One Client on the device. +4. [Enroll the device](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/manual-deployment/) in your Zero Trust organization. +5. (Optional) If the device is running macOS Big Sur or newer, [manually trust the certificate](#manually-trust-the-certificate). + + + + The Cloudflare One Client will now download any [certificates set to **Available**](/cloudflare-one/team-and-resources/devices/user-side-certificates/#activate-a-root-certificate). After download, the Cloudflare One Client will add the certificates to the device's system certificate store in `installed_certs/.pem` and append the contents to the `installed_cert.pem` file. If you have any scripts using `installed_cert.pem`, Cloudflare recommends you set them to use the individual files in the `installed_certs/` directory instead. `installed_certs.pem` will be deprecated by 2025-06-31. diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate.mdx index 72ad194eb5d..05c83146098 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/custom-certificate.mdx @@ -13,7 +13,7 @@ tags: - Python --- -import { Render, Tabs, TabItem, APIRequest, Details } from "~/components"; +import { APIRequest, Details, Render, Steps, TabItem, Tabs } from "~/components"; :::note Only available on Enterprise plans. @@ -129,6 +129,45 @@ You can upload a single root certificate or a full certificate chain. When uploa You can now [use the generated custom root certificate](#use-a-custom-root-certificate) for inspection. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** and **SSL and Certificates Write** permissions. + + +1. Upload the certificate and private key with `cf ssl mtls-certificates create`: + + ```sh + cf ssl mtls-certificates create \ + --name "Custom Gateway root CA" \ + --ca true \ + --certificates @.pem \ + --private-key @.pem + ``` + + Pass the PEM files with the `@` prefix. If uploading a certificate chain, the certificate file must contain the root certificate first, followed by any intermediate certificates. Note the `id` in the output. + +2. Deploy the certificate across the Cloudflare global network with [`cf zero-trust gateway certificates activate`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-certificates-activate): + + ```sh + cf zero-trust gateway certificates activate + ``` + +3. Check that the certificate's `binding_status` is `available`: + + ```sh + cf zero-trust gateway certificates get + ``` + +4. (Optional) Verify the certificate is installed on your user's devices either [with the Cloudflare One Client](/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment/) or [manually](/cloudflare-one/team-and-resources/devices/user-side-certificates/manual-deployment/). + +5. Turn on the certificate for use in inspection with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + + ```sh + cf zero-trust gateway configurations edit --settings-certificate-id + ``` + + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/index.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/index.mdx index 8506fea951d..baf0ded3974 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/index.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/index.mdx @@ -45,6 +45,19 @@ To generate a new Cloudflare root certificate for your Zero Trust organization: 4. Choose a duration of time before the certificate expires. Cloudflare recommends expiration after five years. Alternatively, choose _Custom_ and enter a custom amount in days. 5. Select **Generate certificate**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Generate the certificate with [`cf zero-trust gateway certificates create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-certificates-create): + +```sh +cf zero-trust gateway certificates create --validity-period-days 1825 +``` + +`--validity-period-days` sets the number of days before the certificate expires, from `1` to `10950`. It defaults to `1825` (five years). The output includes the `id` and the contents of the new certificate. + @@ -78,6 +91,17 @@ To activate your root certificate: 3. Select the certificate you want to activate. 4. Select **Activate**. + + + +Activate the certificate with [`cf zero-trust gateway certificates activate`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-certificates-activate): + +```sh +cf zero-trust gateway certificates activate +``` + +To find the certificate ID, run `cf zero-trust gateway certificates list`. + @@ -102,6 +126,17 @@ Once you deploy and install your certificate, you can turn it on for use in insp 3. Select the certificate you want to turn on. 4. In **Basic information**, select **Confirm and turn on certificate**. + + + +Turn on the certificate for inspection with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit --settings-certificate-id +``` + +The certificate must have a `binding_status` of `available` before you turn it on. To check, run `cf zero-trust gateway certificates get `. + diff --git a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/manual-deployment.mdx b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/manual-deployment.mdx index 98453b3994b..cbf2a5f6bf0 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/manual-deployment.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/devices/user-side-certificates/manual-deployment.mdx @@ -12,7 +12,7 @@ tags: - TLS --- -import { Details, Render, TabItem, Tabs } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components"; :::note This procedure is only required to enable specific Cloudflare Zero Trust features, and should only be done at the direction of your IT department. This procedure is not required to enable the Cloudflare One Client for consumers. @@ -31,16 +31,49 @@ To install a certificate manually, you must: ## 1. Download a Cloudflare root certificate :::note[Download limitation] -You can only download Cloudflare-generated certificates from the Cloudflare One dashboard or with the Cloudflare One Client. +You can only download Cloudflare-generated certificates from the Cloudflare One dashboard, with the Cloudflare One Client, or with the [Cloudflare CLI (`cf`)](/cf/). ::: First, [generate](/cloudflare-one/team-and-resources/devices/user-side-certificates/#generate-a-cloudflare-root-certificate) and download a Cloudflare certificate. The certificate is available in both `.pem` and `.crt` file format. Certain applications require the certificate to be in a specific file type, so ensure you download the most appropriate file for your use case. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. Select **Certificates**. 3. Select the certificate you want to download. 4. Select **More actions**. 5. Depending on which format you want, choose **Download .pem** and/or **Download .crt**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + + +1. Find the ID of the certificate that you want to download: + + ```sh + cf zero-trust gateway certificates list + ``` + +2. Save the certificate in PEM format with [`cf zero-trust gateway certificates get`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-certificates-get). This example uses [`jq`](https://jqlang.org/) to extract the `certificate` field: + + ```sh + cf zero-trust gateway certificates get | jq -r .certificate > certificate.pem + ``` + +3. (Optional) To create a `.crt` file in DER format, convert the PEM file: + + ```sh + openssl x509 -in certificate.pem -outform der -out certificate.crt + ``` + + + + Alternatively, you can download and install a certificate [using the Cloudflare One Client](/cloudflare-one/team-and-resources/devices/user-side-certificates/automated-deployment/#install-a-certificate-using-the-cloudflare-one-client). The Cloudflare One Client will add the certificates to the device's system certificate store in `installed_certs/.pem`. diff --git a/src/content/docs/cloudflare-one/team-and-resources/users/cli-commands.mdx b/src/content/docs/cloudflare-one/team-and-resources/users/cli-commands.mdx new file mode 100644 index 00000000000..59e97884a05 --- /dev/null +++ b/src/content/docs/cloudflare-one/team-and-resources/users/cli-commands.mdx @@ -0,0 +1,64 @@ +--- +pcx_content_type: reference +title: User CLI commands +description: Review user risk scores, manage risk behaviors and risk score integrations, and remove user authenticators from the command line using the Cloudflare CLI (cf). +sidebar: + order: 10 +products: + - cloudflare-one +--- + +import { CfCommand, CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust risk-scoring` and `cf zero-trust users` commands to review [user risk scores](/cloudflare-one/team-and-resources/users/risk-score/), configure risk behaviors, send risk scores to Okta, and remove a user's passkeys or MFA authenticators from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission (or **Zero Trust Write** to make changes). Commands that return user risk scores, such as `risk-scoring get` and `risk-scoring summary get`, require **Zero Trust: PII Read**. `cf zero-trust users` commands require **Access: Users Write**. + +To list users, review their sessions and last seen identity, or revoke their sessions, use [`cf zero-trust access users`](/cloudflare-one/access-controls/cli-commands/#zero-trust-access-users). + +:::note +`cf zero-trust risk-scoring` and `cf zero-trust users` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- Risk behaviors are account-wide settings. `behaviours update` and `behaviours single update` change how Cloudflare One scores every user in your account. +- `behaviours single update` requires `--enabled`. Pass the behavior's current `enabled` value if you only want to change its risk level. +- Commands that take a user ID use the user's `id` from `cf zero-trust access users list` or `cf zero-trust risk-scoring summary get`. +- `cf` does not yet support removing users from seats. Use the dashboard or the API. +- Pass `-f` (`--force`) to `reset` and `delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. + +::: + +## `zero-trust risk-scoring` + +Get a user's [risk score](/cloudflare-one/team-and-resources/users/risk-score/#user-risk-scoring) and the risk events behind it, or [reset a user's risk score](/cloudflare-one/team-and-resources/users/risk-score/#clear-a-users-risk-score). + + + + + +## `zero-trust risk-scoring summary` + +List the users with a risk score, with their highest risk level and number of risk events. + + + +## `zero-trust risk-scoring event-clusters` + +List a user's risk events grouped by day and behavior. + + + +## `zero-trust risk-scoring behaviours` + +Turn [risk behaviors](/cloudflare-one/team-and-resources/users/risk-score/#manage-risk-behaviors) on or off and change their risk levels. Behavior IDs, such as `imp_travel` or `high_dlp`, are the keys of the `behaviors` object in the output of `behaviours get`. + + + +## `zero-trust risk-scoring integrations` + +Create and manage integrations that [send risk scores to Okta](/cloudflare-one/team-and-resources/users/risk-score/#send-risk-score-to-okta). + + + +## `zero-trust users` + +Remove a user's registered [passkeys](/cloudflare-one/integrations/identity-providers/passkeys/#remove-a-users-passkey) and [independent MFA](/cloudflare-one/access-controls/access-settings/independent-mfa/) authenticators. To find authenticator IDs, run `cf zero-trust access users last-seen-identity get ` and review the `passkeys` and `mfa_authenticators` arrays. + + diff --git a/src/content/docs/cloudflare-one/team-and-resources/users/risk-score.mdx b/src/content/docs/cloudflare-one/team-and-resources/users/risk-score.mdx index a5432fe973f..c83e1a6e486 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/users/risk-score.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/users/risk-score.mdx @@ -14,7 +14,7 @@ tags: - SentinelOne --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; :::note @@ -31,10 +31,49 @@ Cloudflare One assigns a risk score of Low, Medium, or High based on detections To view a user's risk score: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Teams & Resources**. 2. Select **Users**. 3. Select **Risk score** > **Risk scoring**. 4. Select a user's name to view their instances of risk behaviors, if any. You can select an instance of a risk behavior to view the log associated with the detection. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust: PII Read** permission. + + +1. List the users with a risk score, along with their highest risk level (`max_risk_level`) and number of risk events: + + ```sh + cf zero-trust risk-scoring summary get + ``` + + Note the `user_id` of the user. + +2. Get the user's risk score and the risk events behind it with [`cf zero-trust risk-scoring get`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-risk-scoring-get): + + ```sh + cf zero-trust risk-scoring get + ``` + + The `risk_level` field shows the user's current risk score. Each entry in `events` lists the risk behavior (`id` and `name`), its `risk_level`, and when it was detected. + +3. (Optional) To group the user's risk events by day and behavior, run: + + ```sh + cf zero-trust risk-scoring event-clusters list --user-id + ``` + + By default, this returns events from the last 7 days. + + + + Users that have had their risk score [cleared](#clear-a-users-risk-score) will not appear in the table unless they trigger another risk behavior. @@ -42,18 +81,84 @@ Users that have had their risk score [cleared](#clear-a-users-risk-score) will n If required, you can reset risk scores for specific users. Once reset, users will not appear in the associated risk table until they trigger another risk behavior. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Teams & Resources**. 2. Select **Risk score** > **Risk scoring**. 3. Select the user you want to clear the risk score for. 4. In **User risk overview**, select **Reset user risk**. 5. Select **Confirm**. + + + + + +Reset the user's risk score with [`cf zero-trust risk-scoring reset`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-risk-scoring-reset). This requires an API token with **Zero Trust Write** permission. + +```sh +cf zero-trust risk-scoring reset +``` + +To find the user ID, run `cf zero-trust risk-scoring summary get`. Add `-f` to skip the confirmation prompt. + + + ### Send risk score to Okta In addition to controls in Cloudflare One, Okta users can send risk scores to Okta to apply SSO-level policies. + + + + + + +First, configure Cloudflare One to send user risk scores to Okta. This requires an API token with **Zero Trust Write** permission. + + +1. Set up the [Okta SSO integration](/cloudflare-one/integrations/identity-providers/okta/). + +2. Find the ID of your Okta integration: + + ```sh + cf zero-trust identity-providers list + ``` + +3. Create the risk score integration with [`cf zero-trust risk-scoring integrations create`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-risk-scoring-integrations-create): + + ```sh + cf zero-trust risk-scoring integrations create \ + --integration-type Okta \ + --tenant-url https://my-company.okta.com \ + --reference-id + ``` + + - `--tenant-url`: Your Okta domain. The domain must end in an Okta domain such as `.okta.com` or `.oktapreview.com`. + - `--reference-id`: The ID of your Okta integration in Cloudflare One. + +4. Copy the `well_known_url` value in the output. + + +Next, configure Okta to receive your risk scores. + + +1. On your Okta admin dashboard, go to **Security** > **Device Integrations**. +2. Go to **Receive shared signals**, then select **Create stream**. +3. Name your integration. In **Set up integration with**, choose _Well-known URL_. +4. In **Well-known URL**, enter the `well_known_url` value. +5. Select **Create**. + + +To stop sending risk scores to Okta, delete the integration with `cf zero-trust risk-scoring integrations delete `. To find the integration ID, run `cf zero-trust risk-scoring integrations list`. + + + + For more information on configuring user risk score within Okta, refer to the [Okta documentation](https://help.okta.com/oie/en-us/content/topics/itp/overview.htm). While the Okta integration is turned on, Cloudflare One will send any user risk score updates to Okta, including score increases and resets. Score update events will appear in your [Access authentication logs](/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs/). @@ -92,12 +197,46 @@ When a risk behavior is disabled, monitoring for future activity will cease. Pre You can change the risk level for a behavior at any time. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Teams & Resources**. 2. Go to **Users**. 3. Select **Risk score** > **Risk behaviors**. 2. Select the risk behavior you want to modify. 3. In the drop-down menu, choose your desired risk level. 4. Select **Save**. + + + + + +Risk behaviors apply to every user in your account. Changing them requires an API token with **Zero Trust Write** permission. + + +1. List the risk behaviors and their current settings: + + ```sh + cf zero-trust risk-scoring behaviours get + ``` + + Each key in the `behaviors` object is a behavior ID, for example `imp_travel` for **Impossible travel**. + +2. Change the behavior's risk level with [`cf zero-trust risk-scoring behaviours single update`](/cloudflare-one/team-and-resources/users/cli-commands/#cf-zero-trust-risk-scoring-behaviours-single-update): + + ```sh + cf zero-trust risk-scoring behaviours single update imp_travel \ + --enabled true \ + --risk-level high + ``` + + - `--risk-level`: The new risk level: `info`, `low`, `medium`, or `high`. + - `--enabled`: Required. Pass `true` to keep the behavior turned on, or `false` to [disable it](#disable-risk-behaviors). + + + + ## Use risk scores in Access policies @@ -105,11 +244,36 @@ You can use risk scores to control access to applications protected by [Cloudfla To add a risk score requirement to an Access policy: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**. 2. Create a new policy or select an existing policy to edit. 3. Add a rule with the _User Risk Score_ selector. 4. For **Value**, select one or more risk levels (Low, Medium, High, or Unscored). The rule matches a user only when their current risk level is one of the selected values. 5. Save the policy. + + + + + +Add a `user_risk_score` rule to a policy's `--include`, `--exclude`, or `--require` rules. The rule matches a user only when their current risk level is one of the listed values: `low`, `medium`, `high`, or `unscored`. This requires an API token with **Access: Apps and Policies Write** permission. + +For example, to create the policy in the [following example](#example-block-high-risk-users) with [`cf zero-trust access policies create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-policies-create): + +```sh +cf zero-trust access policies create \ + --name "Block high-risk users" \ + --decision allow \ + --include '[{"email_domain": {"domain": "example.com"}}]' \ + --exclude '[{"user_risk_score": {"user_risk_score": ["high"]}}]' +``` + +To add the rule to an existing policy, use `cf zero-trust access policies update`, which replaces the whole policy. Pass the policy's current settings along with the new rule. + + + ### Example: Block high-risk users diff --git a/src/content/docs/cloudflare-one/team-and-resources/users/scim-population-viewer.mdx b/src/content/docs/cloudflare-one/team-and-resources/users/scim-population-viewer.mdx index e75f8c85490..6ae1d08162f 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/users/scim-population-viewer.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/users/scim-population-viewer.mdx @@ -10,7 +10,7 @@ sidebar: order: 3.5 --- -import { CURL, Steps } from "~/components"; +import { CURL, Steps, TabItem, Tabs } from "~/components"; The SCIM population viewer shows users and groups provisioned through an identity provider (IdP). Use it to check which resources Cloudflare has received, inspect their attributes, and investigate provisioning issues. @@ -23,6 +23,9 @@ Each view belongs to one identity provider. Its resource counts describe that pr ## Open the population viewer + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Find an identity provider with SCIM turned on. @@ -30,6 +33,36 @@ Each view belongs to one identity provider. Its resource counts describe that pr 4. Select **Users** or **Groups** to switch resource types. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Read** permission. + + +1. Find an identity provider with SCIM turned on: + + ```sh + cf zero-trust identity-providers list --scim-enabled true + ``` + +2. List the provider's SCIM users with [`cf zero-trust identity-providers scim users list`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-scim-users-list): + + ```sh + cf zero-trust identity-providers scim users list --identity-provider-id + ``` + +3. List the provider's SCIM groups with [`cf zero-trust identity-providers scim groups list`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-scim-groups-list): + + ```sh + cf zero-trust identity-providers scim groups list --identity-provider-id + ``` + + +Both commands return up to 100 resources per page. Use `--page` and `--per-page` to page through results. + + + + ![SCIM users table with search controls and blurred personal information](~/assets/images/cloudflare-one/identity/scim-population-viewer.png) The **Users** table shows each user's name, username, email, and active state when those attributes are available. The active state reflects the SCIM `active` attribute. It does not indicate recent user activity or whether the latest provisioning request succeeded. @@ -38,12 +71,36 @@ The **Groups** table shows group names and IdP resource IDs. ## Search for a resource + + + 1. Select **Users** or **Groups**. 2. Choose a search field and enter a search value. 3. Select **Search**. To remove the search, select **Clear**. + + + +Add a filter option to `scim users list` or `scim groups list`. For example: + +```sh +cf zero-trust identity-providers scim users list \ + --identity-provider-id \ + --email user@example.com +``` + +| Resource type | Filter options | +| ------------- | -------------- | +| Users | `--username`, `--email`, `--name`, `--cf-resource-id`, `--idp-resource-id` | +| Groups | `--name`, `--cf-resource-id`, `--idp-resource-id` | + +`cf` does not yet support the **Username contains** and **Name contains** searches. Use the dashboard. + + + + | Resource type | Search fields | | ------------- | --------------------------------------------------------------------------------- | | Users | Username contains, Username, Email, Name, Cloudflare resource ID, IdP resource ID | @@ -53,8 +110,24 @@ Use **Cloudflare resource ID** to match a resource with a [SCIM provisioning log ## Inspect resource details + + + For a user or group, select **View details**. Switch between **Formatted** and **JSON** to inspect the stored resource. + + + +Get the stored resource by its Cloudflare resource ID: + +```sh +cf zero-trust identity-providers scim users get --identity-provider-id +cf zero-trust identity-providers scim groups get --identity-provider-id +``` + + + + Details include resource IDs, profile attributes, membership, and metadata when present. The SCIM `id` is the Cloudflare resource ID. The `externalId` is the IdP resource ID. Metadata timestamps describe when a resource was created or modified. They do not report whether the latest provisioning request succeeded. For a group with members, select **View all group members** to inspect its member list. @@ -67,12 +140,35 @@ Deleting a resource removes it from the identity provider's SCIM population in C Do not use population cleanup as a substitute for revoking access. To remove a user's access, follow your [SCIM deprovisioning configuration](/cloudflare-one/team-and-resources/users/scim/#sync-users-and-groups-in-zero-trust-policies). ::: + + + 1. Find the user or group you want to remove. 2. Open its context menu and select **Delete**. 3. Check the resource name in the confirmation dialog, then select **Delete**. + + + +Deleting a resource requires an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Find the Cloudflare resource ID (`id`) of the user or group with `scim users list` or `scim groups list`. + +2. Delete the resource with [`cf zero-trust identity-providers scim users delete`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-scim-users-delete) or `cf zero-trust identity-providers scim groups delete`: + + ```sh + cf zero-trust identity-providers scim users delete --identity-provider-id + ``` + + The command prompts you to confirm. Add `-f` to skip the confirmation prompt. + + + + + ## Query the population through the API Use the Cloudflare API to retrieve resources for an identity provider. Create an API token with **Access: Organizations, Identity Providers, and Groups Read** permission for the target account. Use this Cloudflare API token, not the SCIM bearer token configured in your IdP. diff --git a/src/content/docs/cloudflare-one/team-and-resources/users/seat-management.mdx b/src/content/docs/cloudflare-one/team-and-resources/users/seat-management.mdx index 3632c3376a9..9c5da093d92 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/users/seat-management.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/users/seat-management.mdx @@ -8,7 +8,7 @@ sidebar: order: 2 --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare One subscriptions consist of seats that active users in your account consume. Active users are added to Cloudflare One through any [authentication event](#authentication-events). @@ -42,10 +42,35 @@ When you revoke a user, this action will terminate active sessions, but will not To revoke a user from your Zero Trust Organization: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Users**. 2. Select the checkbox next to a user with an **Active** status in the **Seat usage** column. 3. Select **Action** > **Revoke**. 4. Select **Revoke sessions**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +Revoke the user's sessions with [`cf zero-trust access users revoke`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-users-revoke): + +```sh +cf zero-trust access users revoke --email user@example.com +``` + +- `--email` or `--user-uid`: The user to revoke. To find a user ID, run `cf zero-trust access users list --email user@example.com`. +- `--devices`: (Optional) Set to `true` to also revoke all devices associated with the user. +- `--warp-session-reauth`: (Optional) Set to `true` to require the user to re-authenticate to the Cloudflare One Client for Gateway policies that enforce a client session duration. + +Add `-f` to skip the confirmation prompt. + + + Revoked users can still log in if your policies allow them. To prevent a user from authenticating, you must remove them from your [device enrollment policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/device-enrollment/) or from your Identity Provider (IdP). @@ -59,10 +84,29 @@ Cloudflare One can automatically remove any user who does not log in to an Acces To enable user seat expiration: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Settings** > **Admin controls**. 2. In **Remove inactive users from seats**, select **Edit**. 3. Select an inactivity time from the dropdown menu. 4. Select **Save**. + + + + + +Set the inactivity time with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit). This requires an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + +```sh +cf zero-trust organization edit --user-seat-expiration-inactive-time 730h +``` + +`--user-seat-expiration-inactive-time` takes a duration in hours, between `730h` (one month) and `8760h` (one year). `organization edit` only changes the settings that you pass. To check the current value, run `cf zero-trust organization get` and review `user_seat_expiration_inactive_time`. + + + If a user is removed but authenticates later, they will consume a seat again. diff --git a/src/content/docs/cloudflare-one/team-and-resources/users/users.mdx b/src/content/docs/cloudflare-one/team-and-resources/users/users.mdx index 7c574ead1fb..bea718dbf3b 100644 --- a/src/content/docs/cloudflare-one/team-and-resources/users/users.mdx +++ b/src/content/docs/cloudflare-one/team-and-resources/users/users.mdx @@ -8,14 +8,43 @@ sidebar: order: 4 --- -import { GlossaryTooltip } from "~/components"; +import { GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; User logs show a list of all users who have authenticated to Cloudflare One. For each user who has logged in, you can view their enrolled devices, login history, seat usage, and identity used for policy enforcement. ## View user logs + + + In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Team & Resources** > **Users**. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Users Read** permission. + + +1. List the users in your Zero Trust organization with [`cf zero-trust access users list`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-users-list): + + ```sh + cf zero-trust access users list --per-page 50 + ``` + + `--per-page` must be a multiple of 5. To find a specific user, add `--email user@example.com` or `--search ""`. The `access_seat` and `gateway_seat` fields show whether the user occupies a seat. Note the user's `id`. + +2. Review the user's details: + + - User Registry identity: `cf zero-trust access users last-seen-identity get ` + - Session identities: `cf zero-trust access users active-sessions list --user-id ` + - Failed login attempts: `cf zero-trust access users failed-logins list --user-id ` + + To list the devices registered to the user, refer to [Device CLI commands](/cloudflare-one/team-and-resources/devices/cli-commands/). + + + + + This page lists all users who have registered the Cloudflare One Client or authenticated to a Cloudflare Access application. You can select a user's name to view detailed logs, [revoke their session](/cloudflare-one/access-controls/access-settings/session-management/#revoke-user-sessions), or [remove their seat](/cloudflare-one/team-and-resources/users/seat-management/). ### Available logs diff --git a/src/content/docs/cloudflare-one/traffic-controls/cli-commands.mdx b/src/content/docs/cloudflare-one/traffic-controls/cli-commands.mdx new file mode 100644 index 00000000000..9b0524c269a --- /dev/null +++ b/src/content/docs/cloudflare-one/traffic-controls/cli-commands.mdx @@ -0,0 +1,101 @@ +--- +pcx_content_type: reference +title: Gateway CLI commands +description: Manage Gateway traffic policies, lists, DNS locations, proxy endpoints, certificates, and settings from the command line using the Cloudflare CLI (cf). +sidebar: + order: 17 +products: + - cloudflare-one +--- + +import { CfCommand, CfNamespace } from "~/components"; + +Use [Cloudflare CLI (`cf`)](/cf/) `cf zero-trust gateway` commands to create and manage Gateway DNS, network, HTTP, egress, and resolver policies, lists, DNS locations, proxy endpoints, PAC files, and certificates, and to review your Gateway settings from the command line. To get started, install `cf` and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission (or **Zero Trust Write** to make changes). + +:::note +`cf zero-trust gateway` commands operate on remote Cloudflare resources only (`--local` is not supported). + +- `rules create` creates policies with `--enabled false` by default. Unlike the dashboard, which turns on new policies, you must pass `--enabled true` for the policy to take effect. +- `rules update` replaces the whole policy. Pass the policy's current `--name`, `--action`, `--filters`, `--traffic`, `--identity`, `--device-posture`, `--enabled`, and rule settings along with your changes. Rule settings that you omit are removed. +- Rule settings such as block page, isolation, egress, and resolver options are individual `--rule-settings-*` flags. To pass settings that do not have a flag, use `--body` with the full request body as JSON, for example `--body @policy.json`. +- `lists update` replaces all list items when you pass `--items`. To add or remove individual items, use `lists edit` with `--append` and `--remove`. +- `proxy-endpoints create` only exposes `--kind` as a flag. Pass the endpoint name and source IPs with `--body`. +- `configurations update` and `logging update` replace the whole configuration. To change individual settings, use `configurations edit`, which replaces only the settings groups that you pass, such as `block_page` or `browser_isolation`. Pass every value in a group that you want to keep, and run `configurations get` or `logging get` first to review the current values. +- If a flag value starts with `--`, pass it with an equals sign, for example `--settings-block-page-footer-text="--footer--"`. +- Pass `-f` (`--force`) to `delete` commands to skip the confirmation prompt in scripts, CI, or coding agents. + +::: + +## `zero-trust gateway rules` + +Create and manage Gateway [DNS](/cloudflare-one/traffic-controls/dns-policies/), [network](/cloudflare-one/traffic-controls/network-policies/), [HTTP](/cloudflare-one/traffic-controls/http-policies/), [egress](/cloudflare-one/traffic-controls/egress-policies/), and [resolver](/cloudflare-one/traffic-controls/resolver-policies/) policies. Set the policy type with `--filters` (`dns`, `l4`, `http`, `egress`, or `dns_resolver`) and write the conditions as [wirefilter expressions](/cloudflare-one/traffic-controls/expression-syntax/) in `--traffic`, `--identity`, and `--device-posture`. To find policies, use `rules list` with `--search` or `--filter`, for example `--filter filters:dns`. + + + +## `zero-trust gateway lists` + +Create and manage [lists](/cloudflare-one/reusable-components/lists/) of domains, URLs, IP addresses, emails, serial numbers, and other values that you can reference in policies as `$`. Pass list items as a JSON array, for example `--items '[{"value": "example.com"}]'` or `--items @items.json`. + + + +## `zero-trust gateway locations` + +Create and manage [DNS locations](/cloudflare-one/traffic-controls/resolver-endpoints/) for networks and devices that send DNS queries to Gateway. `locations update` requires `--name`, and resets `--ecs-support` and `--dns64-enabled` to `false` and `--max-ttl-mode` to `inherit` if you omit them. Endpoint settings that you omit are kept. + + + +## `zero-trust gateway dns-destination-ips` + +List the [DNS resolver IP](/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips/) pairs that you can assign to a DNS location with `--dns-destination-ips-id`. + + + +## `zero-trust gateway proxy-endpoints` + +Create and manage [proxy endpoints](/cloudflare-one/traffic-controls/proxy-endpoints/) that forward browser traffic to Gateway. + + + +## `zero-trust gateway pacfiles` + +Create and manage [PAC files](/cloudflare-one/traffic-controls/proxy-endpoints/#create-a-pac-file) hosted by Cloudflare. `--contents` accepts the PAC file contents as a string or as `@path/to/file.pac`. `pacfiles update` requires `--contents`. + + + +## `zero-trust gateway certificates` + +Generate and manage [Cloudflare-managed root certificates](/cloudflare-one/team-and-resources/devices/user-side-certificates/) used for TLS decryption. New certificates are inactive until you run `certificates activate`. To save a certificate in PEM format, run `cf zero-trust gateway certificates get | jq -r .certificate > certificate.pem`. + + + +## `zero-trust gateway configurations` + +Get and change account-level Gateway settings, such as [TLS decryption](/cloudflare-one/traffic-controls/http-policies/tls-decryption/), the [block page](/cloudflare-one/reusable-components/custom-pages/gateway-block-page/), [anti-virus scanning](/cloudflare-one/traffic-controls/http-policies/antivirus-scanning/), [Browser Isolation](/cloudflare-one/remote-browser-isolation/setup/), and [protocol detection](/cloudflare-one/traffic-controls/network-policies/protocol-detection/). These settings apply to your whole account. Use `--dry-run` to review the request before you apply it. + + + +## `zero-trust gateway logging` + +Get and change [Gateway activity logging](/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/) settings, including which DNS, network, and HTTP events to log and whether to redact personally identifiable information (PII). + + + +## `zero-trust gateway categories` + +List the [domain categories](/cloudflare-one/traffic-controls/domain-categories/) and their IDs. Use the IDs in `dns.content_category`, `dns.security_category`, `http.request.uri.content_category`, and `http.request.uri.security_category` expressions. Subcategories are nested under each category in the `subcategories` field. + + + +## `zero-trust gateway app-types` + +List the [applications and application types](/cloudflare-one/traffic-controls/application-app-types/) and their IDs. Entries with an `application_type_id` field are applications (use their IDs in `app.ids` expressions). Entries without it are application types (use their IDs in `app.type.ids` expressions). + + + +## Zero Trust account + +Get information about the Zero Trust account for your Cloudflare account, or create a Zero Trust account for an existing Cloudflare account. + + + + diff --git a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/common-policies.mdx b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/common-policies.mdx index 0448e69d0f5..4c706738c16 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/common-policies.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/common-policies.mdx @@ -18,7 +18,7 @@ tags: import { Render, Tabs, TabItem, APIRequest } from "~/components"; -The following Cloudflare Gateway DNS policies are commonly used to secure DNS traffic. Each example includes both dashboard and API instructions that you can adapt for your organization. +The following Cloudflare Gateway DNS policies are commonly used to secure DNS traffic. Each example includes dashboard, Cloudflare CLI (`cf`), and API instructions that you can adapt for your organization. For a baseline set of recommended policies, refer to [Secure your Internet traffic and SaaS apps](/learning-paths/secure-internet-traffic/build-dns-policies/recommended-dns-policies/). @@ -36,6 +36,27 @@ This policy allows users to access official corporate domains. By deploying the + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). `cf` creates policies turned off unless you pass `--enabled true`: + +```sh +cf zero-trust gateway rules create \ + --name "Allow corporate domains" \ + --description "Allow any internal corporate domains added to a list" \ + --precedence 0 \ + --enabled true \ + --action allow \ + --filters dns \ + --traffic 'any(dns.domains[*] in $)' +``` + +To get the IDs of your lists, run `cf zero-trust gateway lists list`. + + + + + +```sh +cf zero-trust gateway rules create \ + --name "All-DNS-Bock-Category-Matches-In-Request" \ + --description "Block all category matches in the request EDNS context" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'dns.categories_in_request_context_matches' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block banned countries" \ + --description "Block access to banned countries" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.dst.geo.country[*] in {"AF" "BY" "CD" "CU" "IR" "IQ" "KP" "MM" "RU" "SD" "SY" "UA" "ZW"})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block top-level domains" \ + --description "Block top-level domains that are frequently used for malicious practices" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.domains[*] matches "[.](cn|ru)$") or any(dns.domains[*] matches "[.](rest|hair|top|live|cfd|boats|beauty|mom|skin|okinawa)$") or any(dns.domains[*] matches "[.](zip|mobi)$")' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block phishing attacks" \ + --description "Block attempts to phish specific domains targeting your organization" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'not(any(dns.domains[*] in $)) and any(dns.domains[*] matches ".*okta.*\|.*cloudflare.*\|.*mfa.*\|.sso.*")' +``` + +To get the IDs of your lists, run `cf zero-trust gateway lists list`. + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block online tracking" \ + --description "Block domains used for tracking at an OS level" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.domains[*] in $)' +``` + +To get the IDs of your lists, run `cf zero-trust gateway lists list`. + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block malicious IPs" \ + --description "Block specific IP addresses that are known to be malicious or pose a threat to your organization" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.resolved_ips[*] in $)' +``` + +To get the IDs of your lists, run `cf zero-trust gateway lists list`. + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Turn on CIPA filter" \ + --description "Block access to unwanted or harmful online content for children" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {182})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Hide explicit search results" \ + --description "Force SafeSearch on search engines to filter explicit or offensive content" \ + --enabled true \ + --action safesearch \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {145})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Check user identity" \ + --description "Filter traffic based on a user identity group name" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(app.ids[*] in {606})' \ + --identity 'any(identity.groups.name[*] in {"Contractors"})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Allow social media for Marketing" \ + --description "Allow access to social media sites for users in the Marketing group" \ + --precedence 1 \ + --enabled true \ + --action allow \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {149})' \ + --identity 'any(identity.groups.name[*] in {"Marketing"})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block social media" \ + --description "Block social media for all other users" \ + --precedence 2 \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {149})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Force IPv4" \ + --description "Force users to connect with IPv4 by blocking IPv6 resolution" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'dns.query_rtype == "AAAA"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Force IPv6" \ + --description "Force users to connect with IPv6 by blocking IPv4 resolution" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'dns.query_rtype == "A"' +``` + + + + + 1. In [Zero Trust](https://dash.cloudflare.com/one), go to **Traffic Policies** > **Traffic Settings**. 2. Under **Proxy and inspection**, find the **Configure time-to-live for DNS resolution** section. 3. Enter a value in seconds (between 60 and 36,000). 4. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Set the account-level maximum TTL, in seconds, with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit --settings-max-ttl-secs 3600 +``` + +To check the current value, run `cf zero-trust gateway configurations get` and review `settings.max_ttl_secs`. @@ -63,8 +77,9 @@ Each [DNS location](/cloudflare-one/traffic-controls/resolver-endpoints/) can ov | **Do not set max value** (`disabled`) | Disables the maximum TTL cap for this location, even if one is configured at the account level. Upstream TTL values pass through unchanged. | | **Custom** (`override`) | Sets a location-specific maximum TTL that overrides the account-level value. Requires a `ttl_secs` value between 60 and 36,000. | - + + 1. In [Zero Trust](https://dash.cloudflare.com/one), go to **Traffic controls** > **Resolver endpoints**. 2. Select a location, or create a new one. 3. In the **DNS Endpoints** tab, find the **Configure time-to-live for this location** section. @@ -73,6 +88,31 @@ Each [DNS location](/cloudflare-one/traffic-controls/resolver-endpoints/) can ov - **Do not set max value** - disables the TTL cap for this location. - **Custom** - enter a TTL value in seconds. 5. Select **Save**. + + + + + +1. Get the ID and name of the location: + + ```sh + cf zero-trust gateway locations list + ``` + +2. Set the maximum TTL mode with [`cf zero-trust gateway locations update`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-locations-update). For example, to override the account-level value: + + ```sh + cf zero-trust gateway locations update \ + --name "" \ + --max-ttl-mode override \ + --max-ttl-ttl-secs 3600 + ``` + + - `--max-ttl-mode`: `inherit`, `disabled`, or `override`. + - `--max-ttl-ttl-secs`: The custom TTL value in seconds. Required for `override`, and must be omitted for `inherit` and `disabled`. + + `locations update` requires `--name`. It also resets `--max-ttl-mode` to `inherit` and `--ecs-support` and `--dns64-enabled` to `false` if you omit them, so pass their current values. Endpoint settings that you omit are kept. + diff --git a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/test-dns-filtering.mdx b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/test-dns-filtering.mdx index 0c3c7835854..9bee04674a4 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/test-dns-filtering.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/test-dns-filtering.mdx @@ -129,6 +129,12 @@ EDNS client subnet (ECS) is a DNS extension that sends a portion of the user's I 2. Select the DNS location you are testing. 3. Note the value of **DNS over HTTPS**. + Alternatively, run [`cf zero-trust gateway locations list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-locations-list) with the [Cloudflare CLI (`cf`)](/cf/get-started/) and note the `doh_subdomain` value of the DNS location: + + ```sh + cf zero-trust gateway locations list | jq -r '.[] | "\(.name)\t\(.doh_subdomain)"' + ``` + 2. Open a terminal and run the following command: ```sh diff --git a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/timed-policies.mdx b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/timed-policies.mdx index 2633f90278c..0520b51be0e 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/dns-policies/timed-policies.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/dns-policies/timed-policies.mdx @@ -11,7 +11,7 @@ tags: - REST API --- -import { APIRequest, Tabs, TabItem } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; By default, Cloudflare Gateway policies apply at all times when turned on. With timed DNS policies, you can control when DNS policies are active — for example, to block social media only during work hours or to temporarily allow access to a restricted site for a maintenance window. You can configure a policy to be active during specific time periods or set the policy to expire after a certain duration. @@ -26,6 +26,10 @@ You can use a time-based policy duration to set a specific time frame for the po To set a duration for a DNS policy: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies** > **DNS**. 2. Create a new DNS policy or choose an existing policy and select **Edit**. 3. In **Apply durations and schedules**, turn on **Policy duration**. @@ -33,6 +37,33 @@ To set a duration for a DNS policy: - Choose _Duration_ and enter a specific amount of time until the policy turns off. - Choose _Exact end date_ and enter a specific date and time in your account's time zone for the policy to turn off. 5. Select **Save policy**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create a DNS policy with an expiration using [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "Allow gambling sites during event" \ + --enabled true \ + --action allow \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {99})' \ + --expiration-expires-at "2026-12-31T17:00:00Z" \ + --expiration-duration 360 +``` + +- `--expiration-expires-at`: The **Exact end date**, as an ISO 8601 timestamp in UTC. `cf` requires this flag whenever you set an expiration. +- `--expiration-duration`: (Optional) The **Duration** in minutes. Gateway uses this value when you [reset the policy's duration](#reset-a-policys-duration). + +To add an expiration to an existing policy, use `cf zero-trust gateway rules update` with the same flags. `rules update` replaces the whole policy, so also pass the policy's current settings. + + + When a policy turns off, it will remain off until you turn it back on. @@ -46,6 +77,12 @@ For example, you can create a policy at 12:00 PM and set it to turn off after si When a policy's time duration expires, you can turn the policy back on for the duration you originally configured. To reset a policy's duration, select the policy and choose **Reset policy duration**. +With `cf`, run [`cf zero-trust gateway rules reset-expiration`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-reset-expiration). The policy must have an `--expiration-duration`: + +```sh +cf zero-trust gateway rules reset-expiration +``` + For policies with an exact end time, you can change the time before the policy turns off. Once the policy reaches its exact end time, you will need to edit the policy and set a new end time. To set a new exact end time: 1. Select the policy. @@ -61,12 +98,36 @@ You can use Gateway to create a new DNS policy with a schedule or add a schedule + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies** > **DNS**. 2. Create a new DNS policy or choose an existing policy and select **Edit**. 3. In **Apply durations and schedules**, turn on **Policy schedule**. 4. (Optional) In **Time Zone**, choose a time zone to apply the policy based on the time zone you select, regardless of the user's location. By default, Gateway will use the end user's time zone to apply the policy based on the local time of the user making the DNS query. 5. In **Schedule template**, choose a preset schedule, or choose _Custom schedule_ to define a custom schedule. You can choose up to three non-overlapping time ranges of 15 minute intervals. 6. Select **Save policy**. + + + + + +Create a DNS policy with a schedule using [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "Block gambling sites on weekends" \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {99})' \ + --schedule-sat "08:00-17:00" \ + --schedule-sun "08:00-17:00" \ + --schedule-time-zone "Europe/Paris" +``` + +- `--schedule-mon` through `--schedule-sun`: The time ranges when the policy is active on each day, for example `"08:00-12:30,13:30-17:00"`. The policy is inactive on days that you omit. +- `--schedule-time-zone`: (Optional) The **Time Zone**. If you omit it, Gateway uses the user's time zone. + +To find the IDs of other content categories, run [`cf zero-trust gateway categories list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-categories-list). diff --git a/src/content/docs/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips.mdx b/src/content/docs/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips.mdx index 7484495063c..700a2a66da0 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips.mdx @@ -11,7 +11,7 @@ tags: - IPv6 --- -import { Details, Render } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components"; :::note Only available as an add-on to Zero Trust Enterprise plans. @@ -27,11 +27,35 @@ You can request additional dedicated egress IPs at any time. Contact your accoun To start routing traffic through dedicated egress IPs: + + + + 1. Contact your account team to obtain a dedicated egress IP. 2. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 3. Turn on **Allow Secure Web Gateway to proxy traffic**. 4. Select **TCP**. 5. (Optional) Select **UDP**. This will allow HTTP/3 traffic to egress with your dedicated IPs. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Contact your account team to obtain a dedicated egress IP. +2. Turn on the Gateway proxy for TCP and, optionally, UDP with [`cf zero-trust devices settings update`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-settings-update). UDP allows HTTP/3 traffic to egress with your dedicated IPs. + + ```sh + cf zero-trust devices settings update \ + --gateway-proxy-enabled true \ + --gateway-udp-proxy-enabled true + ``` + + + + Dedicated egress IPs are now turned on for all network and HTTP traffic proxied by Gateway. To selectively turn on dedicated egress IPs for a subset of your traffic, refer to [egress policies](/cloudflare-one/traffic-controls/egress-policies/). diff --git a/src/content/docs/cloudflare-one/traffic-controls/egress-policies/host-selectors.mdx b/src/content/docs/cloudflare-one/traffic-controls/egress-policies/host-selectors.mdx index e940e4d0532..14dd45671ab 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/egress-policies/host-selectors.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/egress-policies/host-selectors.mdx @@ -10,7 +10,15 @@ tags: - DNS --- -import { Tabs, TabItem, Details, APIRequest, Render, GlossaryTooltip } from "~/components"; +import { + APIRequest, + Details, + GlossaryTooltip, + Render, + Steps, + TabItem, + Tabs, +} from "~/components"; import HostSelectorEgressDiagram from "~/components/cf/HostSelectorEgressDiagram.astro";
@@ -45,8 +53,20 @@ To turn on the selectors for your account: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Policy settings**, turn on **Allow egress policy host selectors**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on host selectors with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit --settings-host-selector-enabled true +``` diff --git a/src/content/docs/cloudflare-one/traffic-controls/expression-syntax.mdx b/src/content/docs/cloudflare-one/traffic-controls/expression-syntax.mdx index 222cd085b8f..afa3578ad81 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/expression-syntax.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/expression-syntax.mdx @@ -95,7 +95,7 @@ http.request.host in $ any(http.request.domains[*] in $) ``` -To find a list's UUID, go to **My Team** > **Lists** in Zero Trust and select the list. The UUID appears in the browser URL. +To find a list's UUID, go to **My Team** > **Lists** in Zero Trust and select the list. The UUID appears in the browser URL. To find it with the [Cloudflare CLI (`cf`)](/cf/get-started/), run [`cf zero-trust gateway lists list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-list) and use the `id` of the list. ## Common field patterns diff --git a/src/content/docs/cloudflare-one/traffic-controls/get-started/dns.mdx b/src/content/docs/cloudflare-one/traffic-controls/get-started/dns.mdx index f8d828a2cbd..ab56ec8993a 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/get-started/dns.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/get-started/dns.mdx @@ -17,11 +17,12 @@ learning_center: --- import { + APIRequest, GlossaryTooltip, Render, - Tabs, + Steps, TabItem, - APIRequest, + Tabs, } from "~/components"; Secure Web Gateway allows you to inspect DNS traffic — the queries your devices make to translate domain names like `example.com` into IP addresses — and control which websites users can visit. Because every connection starts with a DNS lookup, DNS filtering blocks threats at the earliest stage of a connection, before the device ever reaches the destination. Use DNS policies to block malware domains, phishing sites, or entire content categories across your organization. @@ -73,6 +74,7 @@ A DNS policy has two parts: a **traffic condition** that defines which queries t + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies**. 2. In the **DNS** tab, select **Add a policy**. 3. Name the policy. @@ -83,6 +85,39 @@ A DNS policy has two parts: a **traffic condition** that defines which queries t product="cloudflare-one" /> 6. Select **Create policy**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. (Optional) Look up the IDs of the security and content categories that you want to match: + + ```sh + cf zero-trust gateway categories list + ``` + +2. Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, the following command creates a policy that blocks all default [security categories](/cloudflare-one/traffic-controls/domain-categories/#security-categories): + + ```sh + cf zero-trust gateway rules create \ + --name "Block security threats" \ + --description "Block all default Cloudflare DNS security categories" \ + --precedence 0 \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})' + ``` + + - `--filters dns`: Creates a DNS policy. + - `--traffic`: The **Traffic** condition, written as a [wirefilter expression](/cloudflare-one/traffic-controls/expression-syntax/). + - `--precedence`: The evaluation order when multiple policies match. `0` means this policy is evaluated first. + - `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/antivirus-scanning.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/antivirus-scanning.mdx index c30d063410d..cf28592bcb0 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/antivirus-scanning.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/antivirus-scanning.mdx @@ -8,7 +8,7 @@ sidebar: order: 5 --- -import { Render, Details } from "~/components"; +import { Details, Render, Steps, TabItem, Tabs } from "~/components"; Cloudflare Gateway can scan files for malware as users upload or download them. Anti-virus (AV) scanning runs inline — Gateway inspects files as they pass through the proxy and blocks any file that contains a known malicious payload. @@ -18,10 +18,39 @@ In addition to AV scanning, Gateway can quarantine previously unseen files into To turn on AV scanning: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Policy settings**, turn on **Scan files for malware**. 3. Choose whether to scan files for malicious payloads during uploads, downloads, or both. You can also block requests containing [non-scannable files](#non-scannable-files). 4. (Optional) Turn on **Display AV block notification for Cloudflare One Client** to send [block notifications](#cloudflare-one-client-block-notifications) to users connected to Gateway with the Cloudflare One Client when AV inspection blocks a file. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on AV scanning with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit \ + --settings-antivirus-enabled-download-phase true \ + --settings-antivirus-enabled-upload-phase true \ + --settings-antivirus-fail-closed false \ + --settings-antivirus-notification-settings-enabled true +``` + +- `--settings-antivirus-enabled-download-phase` and `--settings-antivirus-enabled-upload-phase`: Scan files during downloads and uploads. +- `--settings-antivirus-fail-closed`: Block requests containing [non-scannable files](#non-scannable-files). +- `--settings-antivirus-notification-settings-enabled`: (Optional) The **Display AV block notification for Cloudflare One Client** setting. To customize the notification, use `--settings-antivirus-notification-settings-msg` and `--settings-antivirus-notification-settings-support-url`. + +`configurations edit` replaces the whole `antivirus` settings group, so include every AV setting that you want to keep. To review the current values, run `cf zero-trust gateway configurations get`. + + + When a request is blocked due to the presence of malware, Gateway will log the match as a Block decision in your [HTTP logs](/cloudflare-one/insights/logs/dashboard-logs/gateway-logs/#http-logs). diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/common-policies.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/common-policies.mdx index 695a01ef612..3aa7557b90e 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/common-policies.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/common-policies.mdx @@ -41,6 +41,24 @@ Block all subdomains that use a host. + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). `cf` creates policies turned off unless you pass `--enabled true`: + +```sh +cf zero-trust gateway rules create \ + --name "Block sites by hostname" \ + --description "Block all subdomains that use a specific hostname" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'http.request.host matches ".*example.com"' +``` + + + In the following API examples, `filters: ["http"]` indicates that this is an HTTP (Layer 7) policy. @@ -74,6 +92,20 @@ Block a section of a site without blocking the entire site. For example, you can + + +```sh +cf zero-trust gateway rules create \ + --name "Block sites by URL" \ + --description "Block specific parts of a site without blocking the hostname" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'http.request.uri matches "/r/gaming"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Check user identity" \ + --description "Block access to Salesforce by temporary employees and contractors" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.ids[*] in {606})' \ + --identity 'any(identity.groups.name[*] in {"Contractors"})' +``` + + + @@ -158,6 +205,20 @@ Gateway [evaluates Do Not Inspect policies first](/cloudflare-one/traffic-contro + + +```sh +cf zero-trust gateway rules create \ + --name "Bypass incompatible applications" \ + --description "Skip TLS decryption for applications that are incompatible with Gateway" \ + --enabled true \ + --action off \ + --filters http \ + --traffic 'any(app.type.ids[*] in {16})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Require OS version" \ + --description "Perform an OS version check for minimum version" \ + --enabled true \ + --action allow \ + --filters http \ + --device-posture 'any(device_posture.checks.passed[*] in {""})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Check for specific file" \ + --description "Ensure users have a specific file on their device regardless of operating system" \ + --enabled true \ + --action allow \ + --filters http \ + --device-posture 'any(device_posture.checks.passed[*] in {""}) or any(device_posture.checks.passed[*] in {""})' +``` + + + "}) or any(device_posture.checks.passed[] in {""})', + 'any(device_posture.checks.passed[*] in {""}) or any(device_posture.checks.passed[*] in {""})', }} /> @@ -278,6 +367,20 @@ When accessing origin servers with certificates not signed by a public certifica + + +```sh +cf zero-trust gateway rules create \ + --name "Bypass internal site inspection" \ + --description "Bypass TLS decryption for internal sites with self-signed certificates" \ + --enabled true \ + --action off \ + --filters http \ + --traffic 'any(http.conn.domains[*] in {"internal.example.com"})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Isolate unreviewed or in review application status" \ + --description "Isolate Shadow IT applications that have not been reviewed or are in review in the Application Library" \ + --enabled true \ + --action isolate \ + --filters http \ + --traffic 'any(app.statuses[*] == "unreviewed") or any(app.statuses[*] == "in_review")' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block unapproved application status" \ + --description "Block Shadow IT applications that have been marked as unapproved in the Application Library" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.statuses[*] == "unapproved")' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block Google Drive downloads" \ + --description "Block file downloads from Google Drive" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.ids[*] in {554}) and http.request.uri.path_and_query matches ".(e=download|export).*"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block Google Drive uploads" \ + --description "Block file uploads to Google Drive" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.ids[*] in {554}) and http.upload.mime matches "." and not(http.request.host == "drivefrontend-pa.clients6.google.com")' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block Gmail downloads" \ + --description "Block file downloads from Gmail" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'http.request.host == "mail-attachment.googleusercontent.com" and http.request.uri.path_and_query matches "/attachment/u/0"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block Google Translate for websites" \ + --description "Block use of Google Translate to translate entire webpages" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(http.request.domains[*] matches "^(.+\.)?translate\.goog$")' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Filter WebSocket" \ + --description "Filter WebSocket traffic with HTTP response code 101" \ + --enabled true \ + --action allow \ + --filters http \ + --traffic 'http.response.status_code == 101' +``` + + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Policy settings**, turn on **Open previously unseen files in a sandbox environment**. 3. (Optional) To block requests containing [non-scannable files](#non-scannable-files), select **Block requests for files that cannot be scanned**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on file sandboxing with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit \ + --settings-sandbox-enabled true \ + --settings-sandbox-fallback-action block +``` + +`--settings-sandbox-fallback-action`: `block` to block requests containing [non-scannable files](#non-scannable-files), or `allow` to allow them. + + + You can now create [Quarantine HTTP policies](/cloudflare-one/traffic-controls/http-policies/#quarantine) to determine what files to scan in the sandbox. @@ -62,6 +85,10 @@ You can now create [Quarantine HTTP policies](/cloudflare-one/traffic-controls/h To test if file sandboxing is working, you can create a Quarantine policy that matches the [Cloudflare Sandbox Test](https://sandbox.cloudflaredemos.com/): + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies** > **HTTP**. 2. Select **Add a policy**. 3. Add the following expression: @@ -73,6 +100,32 @@ To test if file sandboxing is working, you can create a Quarantine policy that m 4. In **Sandbox file types**, select _ZIP Archive (zip)_. 5. From a device [connected to your Zero Trust organization](/cloudflare-one/team-and-resources/devices/), open a browser and go to the [Cloudflare Sandbox Test](https://sandbox.cloudflaredemos.com/). 6. Select **Download Test File**. + + + + + + +1. Create the Quarantine policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + + ```sh + cf zero-trust gateway rules create \ + --name "Sandbox test" \ + --enabled true \ + --action quarantine \ + --filters http \ + --traffic 'http.request.host == "sandbox.cloudflaredemos.com"' \ + --rule-settings-quarantine-file-types zip + ``` + + `--rule-settings-quarantine-file-types` sets the **Sandbox file types**. To sandbox more than one file type, separate the values with spaces. + +2. From a device [connected to your Zero Trust organization](/cloudflare-one/team-and-resources/devices/), open a browser and go to the [Cloudflare Sandbox Test](https://sandbox.cloudflaredemos.com/). +3. Select **Download Test File**. + + + + Gateway will quarantine and scan the file, display an interstitial status page in the browser, then release the file for download. diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/granular-controls.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/granular-controls.mdx index 9cf945c3ebe..39dbe6b8280 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/granular-controls.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/granular-controls.mdx @@ -10,7 +10,7 @@ tags: - TLS --- -import { Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; import GranularControlApplicationsList from "~/components/cf/GranularControlApplicationsList.astro"; With Application Granular Controls, you can create [Gateway HTTP policies](/cloudflare-one/traffic-controls/http-policies/) to control specific user actions within supported SaaS applications. This allows you to give users access to an application while restricting the actions that they can take within the application. @@ -31,6 +31,7 @@ To create a Gateway HTTP policy with Application Granular Controls: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies** > **HTTP**. 2. Select **Add a policy**. 3. Name the policy. @@ -43,6 +44,33 @@ To create a Gateway HTTP policy with Application Granular Controls: | Application | is | _ChatGPT_ | _Upload_ | Block | 7. Select **Create policy**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, you can create a policy to block file uploads to ChatGPT: + +```sh +cf zero-trust gateway rules create \ + --name "Block ChatGPT uploads" \ + --description "Block file uploads to ChatGPT while allowing other usage" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.ids[*] == 1199) and any(app_control.controls[*] in {1653})' +``` + +- `app.ids`: The application ID. To find application IDs, run [`cf zero-trust gateway app-types list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-app-types-list). +- `app_control.controls`: The IDs of the Application Controls or Operations to match. +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + +:::note +`cf` does not yet support listing Application Controls and Operations IDs. Use the dashboard to find them. +::: diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/http3.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/http3.mdx index c2ab3df3ff6..df9a72fc652 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/http3.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/http3.mdx @@ -11,7 +11,7 @@ tags: - UDP --- -import { Details } from "~/components"; +import { Details, Steps, TabItem, Tabs } from "~/components"; HTTP/3 uses the QUIC protocol over UDP instead of TCP. Because Gateway's default proxy only handles TCP traffic, HTTP/3 inspection requires turning on the UDP proxy. Without it, HTTP/3 traffic bypasses HTTP inspection. [Network policies](/cloudflare-one/traffic-controls/network-policies/) still apply to the underlying UDP traffic. @@ -23,10 +23,39 @@ Before you can inspect any HTTPS traffic, you must deploy a [user-side certifica To turn on the Gateway proxy for UDP and TLS decryption: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Proxy and inspection**, turn on **Allow Secure Web Gateway to proxy traffic**. 3. Select **TCP** and **UDP**. 4. Turn on **TLS decryption**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Turn on the Gateway proxy for TCP and UDP with [`cf zero-trust devices settings update`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-settings-update): + + ```sh + cf zero-trust devices settings update \ + --gateway-proxy-enabled true \ + --gateway-udp-proxy-enabled true + ``` + +2. Turn on TLS decryption with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + + ```sh + cf zero-trust gateway configurations edit --settings-tls-decrypt-enabled true + ``` + + + + ### Application limitations diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/tenant-control.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/tenant-control.mdx index 4fd9901d79a..4b6cc0cff72 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/tenant-control.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/tenant-control.mdx @@ -77,6 +77,28 @@ To create an HTTP policy with header operations: 6. For Add and Overwrite operations, enter the header name and value. To use a dynamic variable, enter the `@{...}` syntax in the value field, or select the `{}` button to see the list of available values. For Remove operations, enter only the header name. 7. Save your policy. +### Cloudflare CLI (cf) + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +To create an HTTP policy with header operations, run [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create) with the `allow` action and the `--rule-settings-add-headers`, `--rule-settings-set-headers`, and `--rule-settings-delete-headers` flags: + +```sh +cf zero-trust gateway rules create \ + --name "Forward identity headers" \ + --enabled true \ + --action allow \ + --filters http \ + --traffic 'any(http.request.domains[*] in {"app.example.com"})' \ + --rule-settings-add-headers '{"X-User-Email": ["@{identity.email}"], "X-User-Groups": ["@{identity.groups}"]}' \ + --rule-settings-set-headers '{"X-Forwarded-User": ["@{identity.email}"]}' \ + --rule-settings-delete-headers X-Debug-Token X-Internal-Only +``` + +- `--rule-settings-add-headers` and `--rule-settings-set-headers`: The **Add** and **Overwrite** operations, as a JSON object that maps each header name to a list of values, or `@path/to/file.json`. +- `--rule-settings-delete-headers`: The **Remove** operations, as one or more header names separated by spaces. +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + ### API To create an HTTP policy with header operations via the API, include `add_headers`, `set_headers`, and `delete_headers` in the `rule_settings` object. diff --git a/src/content/docs/cloudflare-one/traffic-controls/http-policies/tls-decryption.mdx b/src/content/docs/cloudflare-one/traffic-controls/http-policies/tls-decryption.mdx index 826d2dc0ad6..35977d13a13 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/http-policies/tls-decryption.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/http-policies/tls-decryption.mdx @@ -103,6 +103,18 @@ To disable automatic HTTPS upgrades for a URL across your Zero Trust organizatio 4. Select **Create policy**. + To create the policy with the [Cloudflare CLI (`cf`)](/cf/) instead, run [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create) with `--rule-settings-untrusted-cert-action pass_through`. With `cf`, match the domain with the _Domain_ selector: + + ```sh + cf zero-trust gateway rules create \ + --name "Pass through example.com" \ + --enabled true \ + --action allow \ + --filters http \ + --traffic 'any(http.request.domains[*] in {"example.com"})' \ + --rule-settings-untrusted-cert-action pass_through + ``` + The pass through policy will bypass insecure connection upgrades for any device connected to your Zero Trust organization. For more information, refer to [Untrusted certificates](/cloudflare-one/traffic-controls/http-policies/#untrusted-certificates). @@ -141,6 +153,12 @@ By default, TLS decryption can use both TLS version 1.2 and 1.3. However, some e 3. Select **Enable only cipher suites and TLS versions compliant with FIPS 140-3**. +To turn on FIPS compliance with the [Cloudflare CLI (`cf`)](/cf/), run: + +```sh +cf zero-trust gateway configurations edit --settings-fips-tls true +``` + ### Limitations When FIPS compliance is enabled, Gateway will only choose [FIPS-compliant cipher suites](#cipher-suites) when connecting to the origin. If the origin does not support FIPS-compliant ciphers, the request will fail. diff --git a/src/content/docs/cloudflare-one/traffic-controls/index.mdx b/src/content/docs/cloudflare-one/traffic-controls/index.mdx index f193229233c..7cf4fbcec9f 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/index.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/index.mdx @@ -143,6 +143,8 @@ For example, if your goal is to prevent employees from accessing known malware d For step-by-step setup guides, refer to [DNS](/cloudflare-one/traffic-controls/get-started/dns/), [Network](/cloudflare-one/traffic-controls/get-started/network/), and [HTTP](/cloudflare-one/traffic-controls/get-started/http/) policies. +You can also create policies and lists, configure DNS locations and proxy endpoints, and review Gateway settings with the [Cloudflare CLI (`cf`)](/cf/). To manage Gateway from a terminal, a script, or a coding agent, refer to [Gateway CLI commands](/cloudflare-one/traffic-controls/cli-commands/). + ### How to choose a Cloudflare Gateway policy type The following table maps common traffic-filtering goals to the best Cloudflare Gateway policy type: diff --git a/src/content/docs/cloudflare-one/traffic-controls/network-policies/common-policies.mdx b/src/content/docs/cloudflare-one/traffic-controls/network-policies/common-policies.mdx index 36fb7c062ff..84a5801f183 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/network-policies/common-policies.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/network-policies/common-policies.mdx @@ -35,6 +35,24 @@ Refer to the [network policies page](/cloudflare-one/traffic-controls/network-po + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). `cf` creates policies turned off unless you pass `--enabled true`: + +```sh +cf zero-trust gateway rules create \ + --name "Block unauthorized applications" \ + --description "Block access to unauthorized AI applications" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'any(app.type.ids[*] in {25})' +``` + + + In the following API examples, `filters: ["l4"]` indicates that this is a network (Layer 4) policy. @@ -69,6 +87,21 @@ In the following API examples, `filters: ["l4"]` indicates that this is a networ + + +```sh +cf zero-trust gateway rules create \ + --name "Check user identity" \ + --description "Block access to Salesforce by temporary employees and contractors" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'any(app.ids[*] in {606})' \ + --identity 'any(identity.groups.name[*] in {"Contractors"})' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Allow HTTP and HTTPS traffic" \ + --description "Restrict traffic to HTTP and HTTPS traffic" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'net.detected_protocol == "tls" and net.dst.port in {80 443}' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block all other traffic" \ + --description "Block all other traffic that is not HTTP or HTTPS" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'net.protocol in {"tcp" "udp"}' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Allow on inspect all ports" \ + --description "Filter HTTPS traffic when using inspect all ports" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'net.detected_protocol == "tls" or net.detected_protocol == "http"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Allow proxy endpoint traffic from specific source IPs" \ + --description "Allow traffic from proxy endpoint users with specific source IPs to reach private network" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}' +``` + + + "} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}', + 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}', identity: "", device_posture: "", }} /> -Replace `` with your proxy endpoint ID. +Replace `` with the subdomain of your proxy endpoint. @@ -252,6 +341,20 @@ Replace `` with your proxy endpoint ID. + + +```sh +cf zero-trust gateway rules create \ + --name "Block all other proxy endpoint traffic" \ + --description "Block any other proxy endpoint traffic from accessing the private network" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.dst.ip in {10.0.0.0/8}' +``` + + + ` with your proxy endpoint ID. action: "block", filters: ["l4"], traffic: - 'net.proxy_endpoint.ids[*] in {""} and net.dst.ip in {10.0.0.0/8}', + 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.dst.ip in {10.0.0.0/8}', identity: "", device_posture: "", }} /> -Replace `` with your proxy endpoint ID. +Replace `` with the subdomain of your proxy endpoint. @@ -291,6 +394,20 @@ When using [authorization proxy endpoints](/cloudflare-one/traffic-controls/prox + + +```sh +cf zero-trust gateway rules create \ + --name "Allow authorized proxy endpoint traffic from specific source IPs" \ + --description "Allow traffic from authorization proxy endpoint users with specific source IPs to reach private network" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}' +``` + + + "} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}', + 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.src.ip in {203.0.113.0/24} and net.dst.ip in {10.0.0.0/8}', identity: "", device_posture: "", }} /> -Replace `` with your proxy endpoint ID. +Replace `` with the subdomain of your proxy endpoint. @@ -325,6 +442,20 @@ Replace `` with your proxy endpoint ID. + + +```sh +cf zero-trust gateway rules create \ + --name "Block all other authorized proxy endpoint traffic" \ + --description "Block any other authorization proxy endpoint traffic from accessing the private network" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.dst.ip in {10.0.0.0/8}' +``` + + + ` with your proxy endpoint ID. action: "block", filters: ["l4"], traffic: - 'net.proxy_endpoint.ids[*] in {""} and net.dst.ip in {10.0.0.0/8}', + 'proxy.endpoint in {".proxy.cloudflare-gateway.com"} and net.dst.ip in {10.0.0.0/8}', identity: "", device_posture: "", }} /> -Replace `` with your proxy endpoint ID. +Replace `` with the subdomain of your proxy endpoint. @@ -361,6 +492,21 @@ The following example consists of two policies: the first allows specific users + + +```sh +cf zero-trust gateway rules create \ + --name "Allow company employees" \ + --description "Allow any users with an organization email to reach the application" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'net.dst.ip in {10.0.0.0/8}' \ + --identity 'identity.email matches ".*@example.com"' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Block everyone else" \ + --description "Block any other users from accessing the application" \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'net.dst.ip in {10.0.0.0/8}' +``` + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Override example.com with 1.1.1.1" \ + --description "Override a site's IP address with another IP" \ + --enabled true \ + --action l4_override \ + --filters l4 \ + --traffic 'net.dst.ip in {203.0.113.17} and net.dst.port == 80' \ + --rule-settings-l4override-ip 1.1.1.1 \ + --rule-settings-l4override-port 80 +``` + +`--rule-settings-l4override-ip` and `--rule-settings-l4override-port` set the **Override IP** and **Override Port**. + + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings** > **Proxy and inspection settings**. 2. Turn on **Allow protocol detection**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on protocol detection with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit --settings-protocol-detection-enabled true +``` + + + You can now use _Detected Protocol_ as a selector in a [Network policy](/cloudflare-one/traffic-controls/network-policies/#detected-protocol). diff --git a/src/content/docs/cloudflare-one/traffic-controls/proxy-endpoints/index.mdx b/src/content/docs/cloudflare-one/traffic-controls/proxy-endpoints/index.mdx index 24f026badde..35d6bb4b928 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/proxy-endpoints/index.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/proxy-endpoints/index.mdx @@ -11,11 +11,12 @@ tags: --- import { + APIRequest, Details, GlossaryDefinition, + Steps, TabItem, Tabs, - APIRequest, } from "~/components"; :::note @@ -98,6 +99,7 @@ All devices you add to the proxy endpoint can access your Cloudflare Tunnel appl To add an [authorization endpoint](#authorization-endpoint): + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Proxy endpoints**. 2. In **Proxy endpoints**, select **Add an endpoint**. 3. Choose **Add an authorization endpoint**. @@ -106,6 +108,7 @@ To add an [authorization endpoint](#authorization-endpoint): 6. Choose which login methods to support. To accept all login methods, turn on **Accept all available identity providers**. 7. (Optional) If only one identity provider is configured, turn on **Apply instant authentication** to skip identity provider selection when your users reach the proxy endpoint. 8. Select **Create**. +
@@ -113,6 +116,7 @@ To add an [authorization endpoint](#authorization-endpoint): To add a [source IP endpoint](#source-ip-endpoint): + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Proxy endpoints**. 2. In **Proxy endpoints**, select **Add an endpoint**. 3. Choose **Add a source IP endpoint**. @@ -121,6 +125,56 @@ To add a [source IP endpoint](#source-ip-endpoint): - **IPv4**: `192.0.2.0/8` - **IPv6**: `2001:0db8:0000:0000:0000:1234:5678:0000/32` 6. Select **Save endpoint**. + + +
+ +
+ + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** and **Access: Apps and Policies Write** permissions. + +`cf zero-trust gateway proxy-endpoints create` only exposes `--kind` as a flag, so pass the endpoint details with `--body`. + +
+ +To create an authorization endpoint: + + +1. Create the proxy endpoint with [`cf zero-trust gateway proxy-endpoints create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-proxy-endpoints-create): + + ```sh + cf zero-trust gateway proxy-endpoints create \ + --body '{"name": "Identity proxy endpoint", "kind": "identity"}' + ``` + + Note the `subdomain` value in the output. You will use it to create the Access application. + +2. Create an Access application that associates the proxy endpoint with your [Access policies](/cloudflare-one/access-controls/policies/), using [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create \ + --body '{"domain": ".proxy.cloudflare-gateway.com", "name": "Proxy Endpoint App", "session_duration": "12h", "type": "proxy_endpoint", "policies": [{"id": ""}]}' + ``` + + Replace `` with the subdomain from step 1 and `` with the ID of an existing [Access policy](/cloudflare-one/access-controls/policies/). + + +
+ +
+ +To create a source IP endpoint, run [`cf zero-trust gateway proxy-endpoints create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-proxy-endpoints-create) with the source IP addresses of your devices in CIDR notation: + +```sh +cf zero-trust gateway proxy-endpoints create \ + --body '{"name": "Office proxy endpoint", "kind": "ip", "ips": ["192.0.2.0/24", "2001:db8::/32"]}' +``` + +Gateway limits the prefix length of source networks for proxy endpoints to `/8` for IPv4 networks and `/32` for IPv6 networks. + +The output includes the `subdomain` of the endpoint. Your Cloudflare proxy server domain is `.proxy.cloudflare-gateway.com`.
@@ -254,6 +308,10 @@ When you create a PAC file in Cloudflare One, Cloudflare will host it in a publi To create a hosted PAC file: + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Proxy endpoints**. 2. Select **Proxy endpoints**. 3. [Create a proxy endpoint](#1-create-a-proxy-endpoint) or select an existing one, then select **Edit**. @@ -271,6 +329,55 @@ To create a hosted PAC file: 2. Follow the instructions in Cloudflare One to configure devices. 6. Select **Create**. + + + + + + +1. Write your PAC file. For example, the following PAC file sends traffic to a proxy endpoint, except for private IP addresses: + + ```js title="proxy.pac" + function FindProxyForURL(url, host) { + // No proxy for private (RFC 1918) IP addresses (intranet sites) + if ( + isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") || + isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") || + isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") + ) { + return "DIRECT"; + } + // Default proxy + return "HTTPS .proxy.cloudflare-gateway.com:443"; + } + ``` + + Replace `` with the subdomain of your proxy endpoint. For more examples, refer to [PAC file best practices](/cloudflare-one/traffic-controls/proxy-endpoints/best-practices/). + +2. Create the hosted PAC file with [`cf zero-trust gateway pacfiles create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-pacfiles-create): + + ```sh + cf zero-trust gateway pacfiles create \ + --name "Office PAC file" \ + --description "Route browser traffic to Gateway" \ + --slug office-pac \ + --contents @proxy.pac + ``` + + - `--contents`: The **PAC file JavaScript**, as a string or `@path/to/file.pac`. + - `--slug`: (Optional) The **URL slug**. If you omit it, Cloudflare generates one. The slug cannot be changed after creation. + + The output includes the hosted PAC file `url`. + +3. To change the PAC file later, run `cf zero-trust gateway pacfiles update --name "" --contents @proxy.pac`. `--contents` is required on every update. + + +:::note +`cf` does not provide the PAC file templates or browser setup instructions that are available in the dashboard. +::: + + + Your hosted PAC file URL will be: @@ -358,9 +465,23 @@ To get the domain of a proxy endpoint: + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Proxy endpoints**. 2. Choose the proxy endpoint. Select **Edit**. 3. In **Proxy Endpoint**, copy the domain. + + + + + + +List your proxy endpoints with [`cf zero-trust gateway proxy-endpoints list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-proxy-endpoints-list) and find the `subdomain` of the endpoint that you want to use: + +```sh +cf zero-trust gateway proxy-endpoints list +``` + +The proxy endpoint's domain is `.proxy.cloudflare-gateway.com`. @@ -477,11 +598,32 @@ You can modify proxy endpoint settings after creation. ### Edit source IP endpoint + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Proxy endpoints**. 2. Locate your source IP endpoint (indicated by **Source IP** under **Type**). 3. Select the three dots, then select **Configure**. 4. Update the endpoint name or modify the allowed source IP addresses. 5. Select **Save**. + + + + + +Update the endpoint name or the allowed source IP addresses with [`cf zero-trust gateway proxy-endpoints edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-proxy-endpoints-edit): + +```sh +cf zero-trust gateway proxy-endpoints edit \ + --name "Office proxy endpoint" \ + --ips 192.0.2.0/24 198.51.100.0/24 +``` + +`--ips` replaces the list of allowed source IP addresses, so include every address that you want to keep. To get the endpoint ID, run `cf zero-trust gateway proxy-endpoints list`. + + + ## Logs diff --git a/src/content/docs/cloudflare-one/traffic-controls/proxy.mdx b/src/content/docs/cloudflare-one/traffic-controls/proxy.mdx index 7fc4ed82a98..3f1eeb4a900 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/proxy.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/proxy.mdx @@ -12,7 +12,7 @@ tags: - ICMP --- -import { Tabs, TabItem, Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; You can forward [HTTP](/cloudflare-one/traffic-controls/get-started/http/) and [network](/cloudflare-one/traffic-controls/get-started/network/) traffic to Gateway for logging and filtering. Gateway can proxy both outbound traffic and traffic directed to resources connected via a Cloudflare Tunnel, Generic Routing Encapsulation (GRE) tunnel, or IPsec tunnel. When a user connects to the Gateway proxy, Gateway will accept the connection and establish a new, separate connection to the origin server. @@ -122,7 +122,37 @@ By default the [`cloudflared` Docker container](https://github.com/cloudflare/cl The Gateway proxy toggle only applies to traffic from Cloudflare One Client devices. Gateway will always proxy traffic sent with [PAC files](/cloudflare-one/traffic-controls/proxy-endpoints/) or [Browser Isolation](/cloudflare-one/remote-browser-isolation/) regardless of this setting. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Proxy and inspection settings**, turn on **Allow Secure Web Gateway to proxy traffic**. 3. Select **TCP**. 4. (Optional) Depending on your use case, you can select **UDP** and/or **ICMP**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on the TCP proxy, and optionally the UDP proxy, with [`cf zero-trust devices settings update`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-settings-update): + +```sh +cf zero-trust devices settings update \ + --gateway-proxy-enabled true \ + --gateway-udp-proxy-enabled true +``` + +- `--gateway-proxy-enabled`: The **TCP** option. +- `--gateway-udp-proxy-enabled`: The **UDP** option. + +To review the current values, run `cf zero-trust devices settings get`. + +:::note +`cf` does not yet support turning on the ICMP proxy. Use the dashboard. +::: + + + diff --git a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-over-tls.mdx b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-over-tls.mdx index 2d2775ecfce..2f49661111c 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-over-tls.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-over-tls.mdx @@ -11,6 +11,8 @@ sidebar: order: 2 --- +import { Steps, TabItem, Tabs } from "~/components"; + By default, DNS is sent over a plaintext connection. DNS over TLS (DoT) is a standard for encrypting DNS queries to keep them secure and private. DoT uses the same security protocol, TLS, that HTTPS websites use to encrypt and authenticate communications. Cloudflare supports DoT on standard port `853` over TLS 1.2 and TLS 1.3 in compliance with [RFC7858](https://tools.ietf.org/html/rfc7858). @@ -21,9 +23,30 @@ Cloudflare supports DoT on standard port `853` over TLS 1.2 and TLS 1.3 in compl Each Gateway DNS location has a unique DoT hostname. DNS locations and corresponding DoT hostnames have policies associated with them. + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Resolver endpoints**. 2. Under **DNS locations**, [add a new location](/cloudflare-one/traffic-controls/resolver-endpoints/) or select an existing location from the list. 3. Under **DoT endpoint**, copy the value in **DoT addresses**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + +List your DNS locations with [`cf zero-trust gateway locations list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-locations-list) and find the `doh_subdomain` of the location: + +```sh +cf zero-trust gateway locations list +``` + +The DoT hostname is `.cloudflare-gateway.com`. To use DoT, the location must have `endpoints.dot.enabled` set to `true`. + + + The DoT hostname contains your unique location name. For example, if the DoT hostname is `9y65g5srsm.cloudflare-gateway.com`, the location name is `9y65g5srsm`. diff --git a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips.mdx b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips.mdx index 2a9c2d157aa..04a75830031 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips.mdx @@ -10,13 +10,40 @@ sidebar: order: 2 --- +import { Steps, TabItem, Tabs } from "~/components"; + When you create a DNS location, Gateway assigns IPv4/IPv6 addresses and DoT/DoH hostnames to that location. These are the IP addresses and hostnames you send your DNS queries to for Gateway to resolve. To view the resolver endpoint IP addresses and hostnames for a DNS location: + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic controls** > **Resolver endpoints**. 2. Select the DNS location, then select **Edit**. 3. Go to **Setup instructions**. The addresses and hostnames will appear in **Your configuration**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + +Get the DNS location with [`cf zero-trust gateway locations get`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-locations-get). To find the location ID, run `cf zero-trust gateway locations list`. + +```sh +cf zero-trust gateway locations get +``` + +The output includes the following values: + +- `ipv4_destination` and `ipv4_destination_backup`: The IPv4 DNS resolver addresses. +- `ip`: The IPv6 DNS resolver address. +- `doh_subdomain`: The unique subdomain of the location. The DoT hostname is `.cloudflare-gateway.com`, and the DoH URL is `https://.cloudflare-gateway.com/dns-query`. + + + ## DNS query location matching diff --git a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/index.mdx b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/index.mdx index f6dee56043d..71ec3455c56 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/index.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/resolver-endpoints/index.mdx @@ -15,9 +15,6 @@ import { GlossaryDefinition, Render } from "~/components"; -10. Change the DNS resolvers on your router, browser, or OS by following the setup instructions in the UI. -11. Select **Go to DNS Location**. Your location will appear in your list of locations. - You can now apply [DNS policies](/cloudflare-one/traffic-controls/dns-policies/) to your location using the [Location selector](/cloudflare-one/traffic-controls/dns-policies/#location). ## DNS endpoints diff --git a/src/content/docs/cloudflare-one/traffic-controls/resolver-policies.mdx b/src/content/docs/cloudflare-one/traffic-controls/resolver-policies.mdx index 7f2bde1b440..e8e66182768 100644 --- a/src/content/docs/cloudflare-one/traffic-controls/resolver-policies.mdx +++ b/src/content/docs/cloudflare-one/traffic-controls/resolver-policies.mdx @@ -122,6 +122,23 @@ By default, DNS requests that Gateway sends to your custom resolvers use shared 4. Select a **Primary IPv4**, **IPv6**, and optionally a **Secondary IPv4** address from the available dedicated egress IPs. 5. Save the policy. +### Cloudflare CLI (cf) configuration + +To configure dedicated egress on a resolver policy with the [Cloudflare CLI (`cf`)](/cf/), add the `--rule-settings-egress-*` flags to [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create) or `rules update`: + +```sh +cf zero-trust gateway rules create \ + --name "Resolve example.com with dedicated egress" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"example.com"})' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "198.51.100.1"}]' \ + --rule-settings-egress-ipv4 \ + --rule-settings-egress-ipv6 \ + --rule-settings-egress-ipv4-fallback +``` + ### API configuration To configure dedicated egress on a resolver policy via the API, add an `egress` object to `rule_settings`: diff --git a/src/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx b/src/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx index ee075dde18f..7c2270ea32e 100644 --- a/src/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx +++ b/src/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx @@ -12,7 +12,14 @@ description: >- This tutorial explains how to use Cloudflare AI Gateway and Zero Trust to create a functional and secure website wrapper for an AI agent. --- -import { TabItem, Tabs, Details, Render, DashButton } from "~/components"; +import { + DashButton, + Details, + Render, + Steps, + TabItem, + Tabs, +} from "~/components"; This tutorial explains how to use [Cloudflare AI Gateway](/ai-gateway/) and Zero Trust to create a functional and secure website wrapper for an AI agent. Cloudflare Zero Trust administrators can protect access to the wrapper with [Cloudflare Access](/cloudflare-one/access-controls/policies/). Additionally, you can enforce [Gateway policies](/cloudflare-one/traffic-controls/) to control how your users interact with AI agents, including executing AI agents in an isolated browser with [Browser Isolation](/cloudflare-one/remote-browser-isolation/), enforcing [Data Loss Prevention](/cloudflare-one/data-loss-prevention/) profiles to prevent your users from sharing sensitive data, and scanning content to avoid answers from AI agents that violate internal corporate guidelines. Creating an AI agent wrapper is also an effective way to enforce tenant control if you have an enterprise plan for a specific AI provider, such as ChatGPT Enterprise. @@ -422,6 +429,10 @@ Now your AI wrapper can only be accessed by your users that successfully match y You can now block access to all unauthorized public AI agents with a Gateway [HTTP policy](/cloudflare-one/traffic-controls/http-policies/). + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies** > **HTTP**. 2. Select **Add a policy**. 3. Add the following policy: @@ -431,6 +442,28 @@ You can now block access to all unauthorized public AI agents with a Gateway [HT | Content Categories | in | _Artificial Intelligence_ | Block | 4. Select **Create policy**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). `184` is the ID of the _Artificial Intelligence_ content category: + +```sh +cf zero-trust gateway rules create \ + --name "Block public AI agents" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(http.request.uri.content_category[*] in {184})' +``` + +`cf` creates policies turned off unless you pass `--enabled true`. + + + This ensures that public AI agents are not accessible using a managed endpoint. @@ -444,6 +477,10 @@ Now that you have full control over access to your AI agent wrapper, you can enf You can use [Data Loss Prevention (DLP)](/cloudflare-one/data-loss-prevention/) to prevent your users from sending sensitive data to the AI agent. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Data loss prevention** > **Profiles**. 2. Ensure that the [DLP profiles](/cloudflare-one/data-loss-prevention/dlp-profiles/) you want to enforce are properly configured. 3. Add an HTTP policy to enforce the DLP profile for the hostname for your wrapper. For example: @@ -454,6 +491,32 @@ You can use [Data Loss Prevention (DLP)](/cloudflare-one/data-loss-prevention/) | DLP Profile | in | _AI DLP profile_ | | | 4. Select **Create policy**. + + + + + + +1. Get the ID of the [DLP profile](/cloudflare-one/data-loss-prevention/dlp-profiles/) that you want to enforce: + + ```sh + cf zero-trust dlp profiles list + ``` + +2. Add an HTTP policy to enforce the DLP profile for the hostname for your wrapper: + + ```sh + cf zero-trust gateway rules create \ + --name "Enforce DLP for AI wrapper" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'http.request.host == "ai-wrapper.example.com" and any(dlp.profiles[*] in {""})' + ``` + + + + For more information on creating DLP policies, refer to [Scan HTTP traffic](/cloudflare-one/data-loss-prevention/dlp-policies/). diff --git a/src/content/docs/cloudflare-one/tutorials/entra-id-conditional-access.mdx b/src/content/docs/cloudflare-one/tutorials/entra-id-conditional-access.mdx index 4f7d74c2502..545a03ea72a 100644 --- a/src/content/docs/cloudflare-one/tutorials/entra-id-conditional-access.mdx +++ b/src/content/docs/cloudflare-one/tutorials/entra-id-conditional-access.mdx @@ -12,6 +12,8 @@ tags: - Microsoft Entra ID --- +import { Steps, TabItem, Tabs } from "~/components"; + With [Conditional Access](https://learn.microsoft.com/entra/identity/conditional-access/overview) in Microsoft Entra ID (formerly Azure Active Directory), administrators can enforce policies on applications and users directly in Entra ID. Conditional Access has a set of checks that are specialized to Windows and are often preferred by organizations with Windows power users. ## Before you begin @@ -62,12 +64,49 @@ Once the base IdP integration is tested and working, grant permission for Cloudf To import your Conditional Access policies into Cloudflare Access: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. In **Manage your App Launcher**, select **Manage**. 3. Choose **Login methods**. 4. Find your Microsoft Entra ID integration and select **Edit**. 5. Enable **Azure AD Policy Sync**. 6. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Find the ID of your Microsoft Entra ID integration (`"type": "azureAD"`): + + ```sh + cf zero-trust identity-providers list + ``` + +2. Save the current configuration of the identity provider to a file: + + ```sh + cf zero-trust identity-providers get > entra-id.json + ``` + +3. In `entra-id.json`, set `config.conditional_access_enabled` to `true`. Keep all other fields from the `get` output. + +4. Update the identity provider with [`cf zero-trust identity-providers update`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-update): + + ```sh + cf zero-trust identity-providers update --body @entra-id.json + ``` + + Access validates the Conditional Access configuration with Entra ID when you save. If the update returns `conditional_access_invalid_config`, check the [API permission](#add-api-permission-in-entra-id) that you added in Entra ID. + + + + ## Create an Access application diff --git a/src/content/docs/cloudflare-one/tutorials/integrate-microsoft-mcas-teams.mdx b/src/content/docs/cloudflare-one/tutorials/integrate-microsoft-mcas-teams.mdx index ab595a65b90..0310595027e 100644 --- a/src/content/docs/cloudflare-one/tutorials/integrate-microsoft-mcas-teams.mdx +++ b/src/content/docs/cloudflare-one/tutorials/integrate-microsoft-mcas-teams.mdx @@ -12,6 +12,8 @@ tags: - Microsoft --- +import { Steps, TabItem, Tabs } from "~/components"; + Many security teams rely on Microsoft MCAS (Microsoft Cloud App Security), Microsoft's CASB solution, to identify and block threats on the Internet, as well as allow or block access to cloud applications. This tutorial covers how to integrate MCAS with Cloudflare Zero Trust, and create Gateway HTTP policies to ensure visibility and control over data. Microsoft provides an MCAS API endpoint to allow queries to see which applications have been marked as blocked or allowed. With an MCAS API call, you can manage a URL category that contains the blocked URLs returned by the API query, and use the output to create a Hostname List that can be used by Gateway HTTP policies to block them. @@ -67,17 +69,56 @@ curl -v "https:///api/discovery_block_scripts/?format=120&type=all ## Adding a hostname list in Cloudflare One + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com), go to **Reusable components** > **Lists** 2. Select **Upload CSV**. Even though the hostname list is not in CSV format, it will work with no issues. 3. Add a name for the list, specify _Hostnames_ as the list type, and give it a description. 4. Drag and drop your MCAS output file created via the API call, or you can select **Select a file**. 5. Select **Create**. You will see the list of hostnames that have been added to the list. 6. Save the list. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Convert the MCAS output file to a JSON array of list items, for example with `jq`: + + ```sh + jq -R '{value: .}' mcas.txt | jq -s . > mcas.json + ``` + +2. Create the list with [`cf zero-trust gateway lists create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-create): + + ```sh + cf zero-trust gateway lists create \ + --name "MCAS blocked hostnames" \ + --description "Hostnames blocked by MCAS" \ + --type DOMAIN \ + --items @mcas.json + ``` + + `--type DOMAIN` creates a _Hostnames_ list. + +3. Note the `id` in the output. You need it to reference the list in a Gateway policy. + + + + Your list is now ready to be referenced by Gateway HTTP policies. ## Creating an HTTP policy + + + + 1. Go to **Traffic policies** > **Traffic policies** > **HTTP**. 2. Select **Add a policy**. 3. Create the following policy. @@ -85,6 +126,24 @@ Your list is now ready to be referenced by Gateway HTTP policies. | Selector | Operator | Value | Action | | -------- | -------- | -------------------- | ------ | | Host | in list | \ | Block | + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). Replace `` with the `id` of the list: + +```sh +cf zero-trust gateway rules create \ + --name "Block MCAS banned applications" \ + --action block \ + --filters http \ + --traffic 'http.request.host in $' \ + --enabled true +``` + + + Now when trying to visit one of the MCAS defined sites, the user will be blocked. diff --git a/src/content/docs/cloudflare-one/tutorials/m365-dedicated-egress-ips.mdx b/src/content/docs/cloudflare-one/tutorials/m365-dedicated-egress-ips.mdx index da73823041d..715ceef0d74 100644 --- a/src/content/docs/cloudflare-one/tutorials/m365-dedicated-egress-ips.mdx +++ b/src/content/docs/cloudflare-one/tutorials/m365-dedicated-egress-ips.mdx @@ -14,6 +14,8 @@ tags: - IPv6 --- +import { Steps, TabItem, Tabs } from "~/components"; + :::note Only available on Zero Trust Enterprise plans. @@ -33,6 +35,10 @@ Make sure you have: ## Create an egress policy in Cloudflare Gateway + + + + 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Traffic policies** > **Egress policies**. 2. Select **Add a policy**. @@ -55,6 +61,35 @@ Make sure you have: | Primary IPv4 address | IPv6 address | | -------------------- | --------------- | | `203.0.113.0` | `2001:db8::/32` | + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the egress policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "Microsoft 365 egress" \ + --enabled true \ + --action egress \ + --filters egress \ + --identity 'any(identity.groups.name[*] in {"Sales and Marketing" "Retail" "U.S. Sales"})' \ + --device-posture 'any(device_posture.checks.passed[*] in {""}) and any(device_posture.checks.passed[*] in {""})' \ + --rule-settings-egress-ipv4 203.0.113.0 \ + --rule-settings-egress-ipv4-fallback 0.0.0.0 \ + --rule-settings-egress-ipv6 2001:db8::/32 +``` + +- `--identity` and `--device-posture`: The identity and device posture conditions. +- `--rule-settings-egress-ipv4` and `--rule-settings-egress-ipv6`: The dedicated egress IPv4 address and IPv6 range. +- `--rule-settings-egress-ipv4-fallback`: Required. The IPv4 address to use if the primary IPv4 address fails. Use another dedicated IPv4 address, or `0.0.0.0` to use Cloudflare's shared egress IPs. +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + + + ## Create a named IP range location in Microsoft Entra ID diff --git a/src/content/docs/cloudflare-one/tutorials/mysql-network-policy.mdx b/src/content/docs/cloudflare-one/tutorials/mysql-network-policy.mdx index e61faab4ef7..d89c4af3959 100644 --- a/src/content/docs/cloudflare-one/tutorials/mysql-network-policy.mdx +++ b/src/content/docs/cloudflare-one/tutorials/mysql-network-policy.mdx @@ -13,7 +13,7 @@ tags: - Private networks --- -import { DashButton, Render } from "~/components"; +import { DashButton, Render, Steps, TabItem, Tabs } from "~/components"; Using Cloudflare Tunnel's private networks, users can connect to arbitrary non-browser based TCP/UDP applications, like databases. You can set up network policies that implement zero trust controls to define who and what can access those applications using the Cloudflare One Client. @@ -46,6 +46,9 @@ The application and (optional) DNS server are now connected to Cloudflare. ## Create a Gateway network policy + + + 1. Go to **Traffic policies** > **Network policies**. 2. Add a [network policy](/cloudflare-one/traffic-controls/network-policies/) that targets the private IP address and the port of the MySQL database (port 3306 by default). The following example allows access to the database to the users that enrolled into the Cloudflare One Client using an `@example.com` email address. The network policies can also take into consideration [device posture checks](/cloudflare-one/reusable-components/posture-checks/). @@ -55,6 +58,28 @@ The application and (optional) DNS server are now connected to Cloudflare. | Destination Port | in | `3306` | And | | | User Email | matches regex | `.*example.com` | | | + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Add a [network policy](/cloudflare-one/traffic-controls/network-policies/) that targets the private IP address and the port of the MySQL database with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). The following example allows access to the database to the users that enrolled into the Cloudflare One Client using an `@example.com` email address: + +```sh +cf zero-trust gateway rules create \ + --name "Allow MySQL for example.com users" \ + --enabled true \ + --action allow \ + --filters l4 \ + --traffic 'net.dst.ip in {10.128.0.175} and net.dst.port in {3306}' \ + --identity 'identity.email matches ".*example.com"' +``` + +`cf` creates policies turned off unless you pass `--enabled true`. To add [device posture checks](/cloudflare-one/reusable-components/posture-checks/), pass a `--device-posture` expression. + + + + In addition to the Allow rule above, Cloudflare recommends adding a [catch-all block policy](/learning-paths/replace-vpn/build-policies/) to the bottom of your network policy list to enforce a default-deny model. Allowed Cloudflare One Client users can now connect to the MySQL server at `10.128.0.175` using the MySQL client of their choice. @@ -63,6 +88,10 @@ Allowed Cloudflare One Client users can now connect to the MySQL server at `10.1 To allow users to access the MySQL database using an internal hostname instead of the private IP address, configure a Gateway resolver policy. + + + + 1. Go to **Traffic policies** > **Resolver policies**. 2. Select **Add a policy**. @@ -82,6 +111,27 @@ To allow users to access the MySQL database using an internal hostname instead o 7. (Optional) Enter a custom port. 8. Select **Create policy**. + + + + + +Create a resolver policy that sends queries for the private domain to your DNS server: + +```sh +cf zero-trust gateway rules create \ + --name "Resolve internalrecord.com" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"internalrecord.com"})' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "", "route_through_private_network": true}]' +``` + +`"route_through_private_network": true` is the _` - Private`_ option. To use a custom port, add `"port": ` to the resolver. + + + If your internal DNS server has an `A` record for the MySQL database, users can connect to the server using this record. For example, assuming a BIND server that includes the entry: diff --git a/src/content/docs/cloudflare-one/tutorials/regional-private-dns-resolver-policies.mdx b/src/content/docs/cloudflare-one/tutorials/regional-private-dns-resolver-policies.mdx index c28047140f1..d2cc48347a9 100644 --- a/src/content/docs/cloudflare-one/tutorials/regional-private-dns-resolver-policies.mdx +++ b/src/content/docs/cloudflare-one/tutorials/regional-private-dns-resolver-policies.mdx @@ -13,7 +13,7 @@ tags: - Private networks --- -import { Render } from "~/components"; +import { Render, Steps, TabItem, Tabs } from "~/components"; Gateway resolver policies allow you to route DNS queries to custom DNS resolvers based on various criteria. This tutorial demonstrates how to configure region-specific private DNS servers to ensure your users are directed to the closest internal resources based on their geographic location. @@ -48,6 +48,9 @@ Once your private DNS servers are connected to Cloudflare, configure Gateway res For each region where you have a private DNS server: + + + 1. Go to **Traffic policies** > **Resolver policies**. 2. Select **Add a policy**. 3. Name your policy based on the region (for example, `US Internal DNS`). @@ -70,10 +73,52 @@ For each region where you have a private DNS server: | Domain | in | `internal.example.com` | And | | Source Country IP Geolocation | in | _Austria_, _Belgium_, _France_, _Germany_, _Netherlands_ | | + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Create a resolver policy for the first region with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, to match users in the United States and send their queries to a primary and a backup DNS server: + + ```sh + cf zero-trust gateway rules create \ + --name "US Internal DNS" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"internal.example.com"}) and dns.src.geo.country in {"US"}' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "10.0.1.53", "route_through_private_network": true}, {"ip": "10.0.1.54", "route_through_private_network": true}]' + ``` + + - `--traffic`: The **Domain** and **Source Country IP Geolocation** conditions. Countries use two-letter ISO country codes. + - `--rule-settings-dns-resolvers-ipv4`: The custom DNS resolvers. `"route_through_private_network": true` is the _` - Private`_ option. + - `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + +2. Repeat step 1 for each region where you have a private DNS server. For example, to create a policy to match users in the EU region: + + ```sh + cf zero-trust gateway rules create \ + --name "EU Internal DNS" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"internal.example.com"}) and dns.src.geo.country in {"AT" "BE" "FR" "DE" "NL"}' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "10.1.1.53", "route_through_private_network": true}]' + ``` + + + + + ### Create a fallback resolver policy Create a catch-all policy for users in regions without a dedicated DNS server, or if no policies match your traffic: + + + + 1. Go to **Traffic policies** > **Resolver policies**. 2. Select **Add a policy**. 3. Name your policy (for example, `Internal DNS Fallback`). @@ -86,15 +131,62 @@ Create a catch-all policy for users in regions without a dedicated DNS server, o 5. In **Select DNS resolver**, select _Configure custom DNS resolvers_. 6. Enter the private IP address of your primary DNS server. 7. Select **Create policy**. + + + + + +```sh +cf zero-trust gateway rules create \ + --name "Internal DNS Fallback" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"internal.example.com"})' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "", "route_through_private_network": true}]' +``` + + + ## 3. Configure policy order Gateway will apply resolver policies based on [order of precedence](/cloudflare-one/traffic-controls/order-of-enforcement/#order-of-precedence). Ensure your policies are ordered from most specific to least specific: + + + + 1. Go to **Traffic policies** > **Resolver policies**. 2. Use the drag handle to reorder policies: - Resolver policies with regional coverage first - Your fallback resolver policy last + + + + + +Lower `precedence` values are evaluated first. To review the current order, list your resolver policies sorted by precedence: + +```sh +cf zero-trust gateway rules list --filter filters:dns_resolver --order-by precedence +``` + +To move a policy, update it with a new `--precedence` value, for example a higher value than your regional policies for the fallback policy. [`cf zero-trust gateway rules update`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-update) replaces the whole policy, so pass the policy's current settings along with `--precedence`: + +```sh +cf zero-trust gateway rules update \ + --name "Internal DNS Fallback" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'any(dns.domains[*] in {"internal.example.com"})' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "", "route_through_private_network": true}]' \ + --precedence +``` + + + Gateway will apply the first matching policy. If no policies match your traffic, Gateway will apply the fallback resolver policy. The order between resolver policies with regional coverage does not matter. diff --git a/src/content/docs/cloudflare-one/tutorials/s3-buckets.mdx b/src/content/docs/cloudflare-one/tutorials/s3-buckets.mdx index 147c44fb231..9f981298a8b 100644 --- a/src/content/docs/cloudflare-one/tutorials/s3-buckets.mdx +++ b/src/content/docs/cloudflare-one/tutorials/s3-buckets.mdx @@ -12,7 +12,7 @@ description: >- This tutorial demonstrates how to secure access to Amazon S3 buckets with Cloudflare Zero Trust so that data in these buckets is not publicly exposed on the Internet. --- -import { DashButton } from "~/components"; +import { DashButton, Steps, TabItem, Tabs } from "~/components"; This tutorial demonstrates how to secure access to Amazon S3 buckets with Cloudflare Zero Trust so that data in these buckets is not publicly exposed on the Internet. You can combine Cloudflare Access and AWS VPC endpoints. Enterprise may also use Cloudflare Gateway egress policies with dedicated egress IPs. @@ -192,9 +192,37 @@ A bucket website endpoint will be available at `http://.s3-web ### 3. Setup a dedicated egress IP policy + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Egress policies**. Select **Add a policy**. 2. Create a policy that specifies which proxied traffic Gateway should assign a [dedicated egress IP](/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips/) to. For more information, refer to [Egress policies](/cloudflare-one/traffic-controls/egress-policies/). 3. In **Select an egress IP**, choose _Use dedicated Cloudflare egress IPs_. Select the dedicated egress IP defined in your bucket policy. 4. Select **Create policy**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create an egress policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). Use `--traffic`, `--identity`, or `--device-posture` to specify which proxied traffic Gateway should assign the [dedicated egress IP](/cloudflare-one/traffic-controls/egress-policies/dedicated-egress-ips/) to, and set the dedicated egress IP defined in your bucket policy. For example: + +```sh +cf zero-trust gateway rules create \ + --name "Egress to S3 bucket" \ + --enabled true \ + --action egress \ + --filters egress \ + --identity 'any(identity.groups.name[*] in {""})' \ + --rule-settings-egress-ipv4 \ + --rule-settings-egress-ipv4-fallback 0.0.0.0 +``` + +`--rule-settings-egress-ipv4-fallback` is required when you set an IPv4 address. Use another dedicated IPv4 address, or `0.0.0.0` to fall back to Cloudflare's shared egress IPs. `cf` creates policies turned off unless you pass `--enabled true`. + + + Traffic proxied by Gateway and assigned your specified egress IP can access your S3 bucket at `http://.s3-website..amazonaws.com`. diff --git a/src/content/docs/cloudflare-one/tutorials/user-selectable-egress-ips.mdx b/src/content/docs/cloudflare-one/tutorials/user-selectable-egress-ips.mdx index 927660cdd7a..fb92c4c6250 100644 --- a/src/content/docs/cloudflare-one/tutorials/user-selectable-egress-ips.mdx +++ b/src/content/docs/cloudflare-one/tutorials/user-selectable-egress-ips.mdx @@ -14,7 +14,14 @@ tags: - Private networks --- -import { Details, TabItem, Tabs, APIRequest, DashButton } from "~/components"; +import { + APIRequest, + DashButton, + Details, + Steps, + TabItem, + Tabs, +} from "~/components"; :::note @@ -140,6 +147,7 @@ Next, assign your dedicated egress IPs to each virtual network using Gateway egr + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Egress policies**. 2. Select **Add a policy**. @@ -157,6 +165,37 @@ Next, assign your dedicated egress IPs to each virtual network using Gateway egr 6. Select **Create policy**. 7. Repeat Steps 1-6 to create a separate egress policy for each virtual network you created. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Add a Gateway egress policy that matches the corresponding virtual network with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example: + + ```sh + cf zero-trust gateway rules create \ + --name "Egress AMER vnet" \ + --description "Egress via North America by connecting to vnet-AMER" \ + --precedence 0 \ + --enabled true \ + --action egress \ + --filters egress \ + --traffic 'net.vnet_id == ""' \ + --rule-settings-egress-ipv4 \ + --rule-settings-egress-ipv4-fallback \ + --rule-settings-egress-ipv6 + ``` + + - `--traffic`: The _Virtual Network_ selector. Enclose the virtual network ID in double quotes. + - `--rule-settings-egress-ipv4-fallback`: Required when you set an IPv4 address. Use `0.0.0.0` to fall back to Cloudflare's shared egress IPs. + - `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + +2. Repeat step 1 to create an egress policy for each virtual network you created. + @@ -176,7 +215,7 @@ Next, assign your dedicated egress IPs to each virtual network using Gateway egr ], name: "Egress AMER vnet", precedence: 0, - traffic: "net.vnet_id == ", + traffic: 'net.vnet_id == ""', rule_settings: { egress: { ipv4: "", diff --git a/src/content/partials/cloudflare-one/access/add-infrastructure-app.mdx b/src/content/partials/cloudflare-one/access/add-infrastructure-app.mdx index dd2d26e8857..1f695c4e364 100644 --- a/src/content/partials/cloudflare-one/access/add-infrastructure-app.mdx +++ b/src/content/partials/cloudflare-one/access/add-infrastructure-app.mdx @@ -3,16 +3,18 @@ --- import { - Tabs, - TabItem, - Render, APIRequest, GlossaryTooltip, + Render, + Steps, + TabItem, + Tabs, } from "~/components"; + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application**. 3. Select **Infrastructure**. @@ -37,6 +39,60 @@ import { ::: 11. Select **Add application**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create a JSON file that describes the application and its policy. Infrastructure applications do not support reusable policies, so define the policy inline in the `policies` array: + + ```json title="infra-app.json" + { + "name": "Example infrastructure app", + "type": "infrastructure", + "session_duration": "24h", + "target_criteria": [ + { + "port": 22, + "protocol": "SSH", + "include": { + "target_attributes": { "hostname": ["infra-access-target"] }, + "tags": { "environment": ["production", "staging"] } + }, + "require": { + "tags": { "team": ["platform"] } + } + } + ], + "policies": [ + { + "name": "Allow a specific email", + "decision": "allow", + "include": [{ "email": { "email": "jdoe@example.com" } }], + "connection_rules": { + "ssh": { + "usernames": ["root", "ec2-user"], + "allow_email_alias": false + } + } + } + ] + } + ``` + + - `target_criteria`: The targets that the application covers, and the **Protocol** and **Port** used to connect. Match targets by hostname, tag, or both with `include`, `require`, and `exclude`. To cover more than one port, add another entry. For details, refer to [Target criteria](/cloudflare-one/access-controls/applications/non-http/infrastructure-apps/#target-criteria). + - `connection_rules.ssh.usernames`: The **SSH user** names that users can log in as. + - `connection_rules.ssh.allow_email_alias`: Corresponds to **Allow users to log in as their email alias**. + +2. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @infra-app.json + ``` + diff --git a/src/content/partials/cloudflare-one/access/add-target-generic.mdx b/src/content/partials/cloudflare-one/access/add-target-generic.mdx index d9fc309f0b1..a7ade28d6a0 100644 --- a/src/content/partials/cloudflare-one/access/add-target-generic.mdx +++ b/src/content/partials/cloudflare-one/access/add-target-generic.mdx @@ -2,7 +2,15 @@ {} --- -import { Tabs, TabItem, Render, Details, APIRequest, GlossaryTooltip } from "~/components"; +import { + APIRequest, + Details, + GlossaryTooltip, + Render, + Steps, + TabItem, + Tabs, +} from "~/components"; A target represents a single resource in your infrastructure (such as a server, Kubernetes cluster, database, or container) that users will connect to through Cloudflare. @@ -10,6 +18,8 @@ A target represents a single resource in your infrastructure (such as a server, + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Targets**. 2. Select **Add a target**. 3. In **Target hostname**, enter a user-friendly name for the target. We recommend using the server hostname, for example `production-server`. The target hostname does not need to be unique and can be reused for multiple targets. Hostnames are used to define the targets secured by an Access application; they are not used for DNS address resolution. @@ -20,12 +30,36 @@ A target represents a single resource in your infrastructure (such as a server, - Start and end with an alphanumeric character
4. In **IP addresses**, enter the IPv4 and/or IPv6 address of the target resource. The dropdown menu will not populate until you type in the full IP address. -:::note -If the target IP does not appear in the dropdown, go to **Networking** > **Routes** and confirm that the IP routes through Cloudflare Tunnel. -::: + :::note + If the target IP does not appear in the dropdown, go to **Networking** > **Routes** and confirm that the IP routes through Cloudflare Tunnel. + ::: 5. In the dropdown menu, select the IP address and [virtual network](/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/tunnel-virtual-networks/) where the resource is located. This IP address and virtual network pairing is now assigned to this target and cannot be reused in another target by design. 6. (Optional) In **Tags**, add key-value tags to organize your target. For example, use `environment`, `team`, or `region` to group targets and match them later in [target criteria](/cloudflare-one/access-controls/applications/non-http/infrastructure-apps/#target-criteria). Each tag key can only appear once on a target. For example, a single target can have `environment:production` or `environment:staging`, but not both. 7. Select **Add target**. + + +
+ + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the target with [`cf zero-trust access targets create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-targets-create): + +```sh +cf zero-trust access targets create \ + --hostname infra-access-target \ + --ip-ipv4-ip-addr 198.51.100.10 \ + --ip-ipv4-virtual-network-id \ + --tags '{"environment":"production","team":"platform"}' +``` + +- `--hostname`: The **Target hostname**. Hostnames do not need to be unique and are not used for DNS resolution. +- `--ip-ipv4-ip-addr` and `--ip-ipv6-ip-addr`: The IPv4 and IPv6 addresses of the target. Pass at least one. +- `--ip-ipv4-virtual-network-id` and `--ip-ipv6-virtual-network-id`: (Optional) The [virtual network](/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/tunnel-virtual-networks/) where the resource is located. If you omit these options, the target uses your default virtual network. +- `--tags`: (Optional) Key-value tags for the target. Each key can only appear once on a target. + +To add many targets at once, pass a JSON array of targets to `cf zero-trust access targets bulk-create --body @targets.json`. + diff --git a/src/content/partials/cloudflare-one/access/app-launcher.mdx b/src/content/partials/cloudflare-one/access/app-launcher.mdx index f68f9f00a4d..69f60d84665 100644 --- a/src/content/partials/cloudflare-one/access/app-launcher.mdx +++ b/src/content/partials/cloudflare-one/access/app-launcher.mdx @@ -2,7 +2,7 @@ {} --- -import { GlossaryTooltip } from "~/components"; +import { GlossaryTooltip, Steps, TabItem, Tabs } from "~/components"; With the Access App Launcher, users can open all applications that they have access to from a single dashboard. @@ -18,6 +18,10 @@ By default, the App Launcher is disabled. To enable it, you must configure a pol To enable the App Launcher: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Access settings**. 2. Under the **Manage your App Launcher** card, select **Manage**. @@ -27,6 +31,47 @@ To enable the App Launcher: 4. On the **Authentication** tab, choose the identity providers users can authenticate with. 5. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + +The App Launcher is an Access application of type `app_launcher`. Your account can only have one. + + +1. Check whether your account already has an App Launcher application: + + ```sh + cf zero-trust access applications list --search app_launcher + ``` + + If an application with `"type": "app_launcher"` exists, update it with `cf zero-trust access applications update ` instead of creating a new one. + +2. Create a JSON file that describes the App Launcher. Replace `` with your [team name](/cloudflare-one/faq/getting-started-faq/#what-is-a-team-domainteam-name): + + ```json title="app-launcher.json" + { + "type": "app_launcher", + "domain": ".cloudflareaccess.com", + "policies": [{ "id": "", "precedence": 1 }], + "allowed_idps": [""] + } + ``` + + - `policies`: The reusable policies that define who can access your App Launcher portal. These rules do not impact permissions for the applications secured behind Access. + - `allowed_idps`: (Optional) The identity providers users can authenticate with. If you omit this field, all of your identity providers are allowed. + +3. Create the application with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @app-launcher.json + ``` + + + + The App Launcher is now available at `.cloudflareaccess.com`. You can always edit your App Launcher rules by going to **Access controls** > **Access settings**. @@ -36,6 +81,10 @@ Tiles have a one-to-one relationship with each application you create in Access. To show an Access application in the App Launcher: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select an application and select **Edit**. 3. Go to **Experience settings**. @@ -55,6 +104,39 @@ To show an Access application in the App Launcher: 6. In **Application domains**, choose a domain to use for the App Launcher link. 7. (Optional) In **Tags**, add [custom tags](/cloudflare-one/reusable-components/tags/) so that users can more easily find the application in their App Launcher. + + + + + + +1. Save the application's current configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, set the App Launcher fields: + + ```json title="app.json" + "app_launcher_visible": true, + "logo_url": "https://www.example.com/upload/logo.png", + "tags": ["Human Resources"], + ``` + + - `app_launcher_visible`: Corresponds to **Show application in App Launcher**. This setting does not impact the user's ability to reach the application. + - `logo_url`: (Optional) A custom logo served from an HTTPS endpoint. + - `tags`: (Optional) The names of [custom tags](/cloudflare-one/reusable-components/tags/) to show on the tile. + +3. Update the application with [`cf zero-trust access applications update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-update): + + ```sh + cf zero-trust access applications update --body @app.json + ``` + + + + ## Customize App Launcher appearance diff --git a/src/content/partials/cloudflare-one/access/block-page.mdx b/src/content/partials/cloudflare-one/access/block-page.mdx index a80edd4f927..306f3236cd9 100644 --- a/src/content/partials/cloudflare-one/access/block-page.mdx +++ b/src/content/partials/cloudflare-one/access/block-page.mdx @@ -2,6 +2,8 @@ {} --- +import { Steps, TabItem, Tabs } from "~/components"; + You can customize the block page that displays when users fail to authenticate to an Access application. Each application can have a different block page. :::note[Gateway block page] @@ -51,6 +53,10 @@ Only available on Pay-as-you-go and Enterprise plans. To create a custom block page for Access: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Custom pages**. 2. Find the **Access Custom Pages** setting and select **Manage**. @@ -77,5 +83,42 @@ To create a custom block page for Access: 7. To check the appearance of your custom page, select **Download** and open the HTML file in a browser. 8. Once you are satisfied with your custom page, select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Save the HTML code for your custom page to a file. For example: + + ```html title="block-page.html" + + + +

Access denied.

+ +

To obtain access, contact your IT administrator.

+ + + ``` + +2. Create the page with [`cf zero-trust access custom-pages create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-custom-pages-create): + + ```sh + cf zero-trust access custom-pages create \ + --name "Access denied" \ + --type identity_denied \ + --custom-html @block-page.html + ``` + + Set `--type` to `identity_denied` for an identity failure block page or `forbidden` for a non-identity failure block page. + +3. Note the `uid` in the output. To assign the page to an application, add the `uid` to the application's `custom_pages` array and run `cf zero-trust access applications update`. +
+ +
+
You can now select this block page when you [configure an Access application](/cloudflare-one/access-controls/applications/http-apps/). diff --git a/src/content/partials/cloudflare-one/access/bookmarks.mdx b/src/content/partials/cloudflare-one/access/bookmarks.mdx index 5090f69c897..3467f00852c 100644 --- a/src/content/partials/cloudflare-one/access/bookmarks.mdx +++ b/src/content/partials/cloudflare-one/access/bookmarks.mdx @@ -3,10 +3,16 @@ --- +import { Steps, TabItem, Tabs } from "~/components"; + With Cloudflare One, you can show applications on the [App Launcher](/cloudflare-one/access-controls/access-settings/app-launcher/) even if those applications are not secured behind Access. This way, users can access all the applications they need to work, all in one place — regardless of whether those applications are protected by Access. Links to applications not protected by Access can be added as bookmarks. You can assign [Access policies](/cloudflare-one/access-controls/policies/) to control which users see the bookmark in the App Launcher. Users who do not match an Allow policy will not see the bookmark tile. Unlike policies for other Access application types, bookmark policies only affect visibility in the App Launcher and do not control access to the destination URL. + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select **Create new application** > **Bookmarks**. @@ -31,6 +37,41 @@ Links to applications not protected by Access can be added as bookmarks. You can ::: 9. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + + +1. Create a JSON file that describes the bookmark: + + ```json title="bookmark.json" + { + "name": "My bookmark", + "type": "bookmark", + "domain": "https://mybookmark.com", + "app_launcher_visible": true, + "logo_url": "https://www.example.com/upload/logo.png", + "policies": [{ "id": "", "precedence": 1 }] + } + ``` + + - `domain`: The **Application URL**. + - `policies`: (Optional) The reusable policies that control who can see the bookmark. If you omit this field, the bookmark is visible to all users in your organization. To find policy IDs, run `cf zero-trust access policies list`. + - `app_launcher_visible`: Corresponds to **App Launcher visibility**. + - `logo_url`: (Optional) A custom logo served from an HTTPS endpoint. + +2. Create the bookmark with [`cf zero-trust access applications create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-create): + + ```sh + cf zero-trust access applications create --body @bookmark.json + ``` + + + + The application will show up on the Applications page labeled as `BOOKMARK`. You can always edit or delete your bookmarks, as you would any other application. diff --git a/src/content/partials/cloudflare-one/access/create-service-token.mdx b/src/content/partials/cloudflare-one/access/create-service-token.mdx index 9d53ed001dc..a2938b07306 100644 --- a/src/content/partials/cloudflare-one/access/create-service-token.mdx +++ b/src/content/partials/cloudflare-one/access/create-service-token.mdx @@ -2,10 +2,11 @@ {} --- -import { Tabs, TabItem, Details, CURL } from "~/components"; +import { CURL, Details, Steps, TabItem, Tabs } from "~/components"; + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **Service Tokens**. 2. Select **Create Service Token**. @@ -23,6 +24,31 @@ import { Tabs, TabItem, Details, CURL } from "~/components"; :::caution This is the only time Cloudflare Access will display the Client Secret. If you lose the Client Secret, you must generate a new service token. ::: + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Service Tokens Write** permission. + + +1. Create the service token with [`cf zero-trust access service-tokens create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-service-tokens-create): + + ```sh + cf zero-trust access service-tokens create \ + --name "CI/CD token" \ + --duration 8760h \ + --tags '{"environment":"production"}' + ``` + + - `--duration`: The **Service Token Duration**, in hours, for example `8760h` for one year. Use `forever` for a token that does not expire. Defaults to `8760h`. + - `--tags`: (Optional) Up to five key-value tags. + +2. Copy the `client_id` and `client_secret` values in the output. + + :::caution + This is the only time Cloudflare Access will display the Client Secret. If you lose the Client Secret, you must generate a new service token. + ::: + diff --git a/src/content/partials/cloudflare-one/access/enable-scim-on-dashboard.mdx b/src/content/partials/cloudflare-one/access/enable-scim-on-dashboard.mdx index 27d921d9ae5..8854a9647d1 100644 --- a/src/content/partials/cloudflare-one/access/enable-scim-on-dashboard.mdx +++ b/src/content/partials/cloudflare-one/access/enable-scim-on-dashboard.mdx @@ -3,6 +3,12 @@ params: - idp --- +import { Steps, TabItem, Tabs } from "~/components"; + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. Find the {props.idp} integration and select **Edit**. @@ -11,15 +17,62 @@ params: 4. (Optional) Configure the following settings: -* **Enable user deprovisioning**: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when they are removed from the SCIM application in {props.idp}. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). -* **Remove user seat on deprovision**: [Remove a user's seat](/cloudflare-one/team-and-resources/users/seat-management/) from your Cloudflare One account when they are removed from the SCIM application in {props.idp}. -* **SCIM identity update behavior**: Choose what happens in Cloudflare One when the user's identity updates in {props.idp}. - - _Automatic identity updates_: Automatically update the [User Registry identity](/cloudflare-one/team-and-resources/users/users/) when {props.idp} sends an updated identity or group membership through SCIM. This identity is used for Gateway policies and Cloudflare One Client [device profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/); Access will read the user's updated identity when they reauthenticate. - - _Group membership change reauthentication_: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when their group membership changes in {props.idp}. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). Access will read the user's updated group membership when they reauthenticate. - - _No action_: Update the user's identity the next time they reauthenticate to Access or the Cloudflare One Client. + * **Enable user deprovisioning**: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when they are removed from the SCIM application in {props.idp}. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). + * **Remove user seat on deprovision**: [Remove a user's seat](/cloudflare-one/team-and-resources/users/seat-management/) from your Cloudflare One account when they are removed from the SCIM application in {props.idp}. + * **SCIM identity update behavior**: Choose what happens in Cloudflare One when the user's identity updates in {props.idp}. + - _Automatic identity updates_: Automatically update the [User Registry identity](/cloudflare-one/team-and-resources/users/users/) when {props.idp} sends an updated identity or group membership through SCIM. This identity is used for Gateway policies and Cloudflare One Client [device profiles](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/device-profiles/); Access will read the user's updated identity when they reauthenticate. + - _Group membership change reauthentication_: [Revoke a user's active session](/cloudflare-one/access-controls/access-settings/session-management/#per-user) when their group membership changes in {props.idp}. This will invalidate all active Access sessions and prompt for reauthentication for any [Cloudflare One Client session policies](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/client-sessions/). Access will read the user's updated group membership when they reauthenticate. + - _No action_: Update the user's identity the next time they reauthenticate to Access or the Cloudflare One Client. 5. Select **Regenerate Secret**. Copy the **SCIM Endpoint** and **SCIM Secret**. You will need to enter these values into {props.idp}. 6. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Find the ID of the {props.idp} integration: + + ```sh + cf zero-trust identity-providers list + ``` + +2. Save the current configuration of the identity provider to a file: + + ```sh + cf zero-trust identity-providers get > idp.json + ``` + +3. In `idp.json`, set the `scim_config` object. For example: + + ```json title="idp.json" + "scim_config": { + "enabled": true, + "user_deprovision": true, + "seat_deprovision": true, + "identity_update_behavior": "automatic" + } + ``` + + - `user_deprovision`: Corresponds to **Enable user deprovisioning**. + - `seat_deprovision`: Corresponds to **Remove user seat on deprovision**. + - `identity_update_behavior`: Corresponds to **SCIM identity update behavior**. Use `automatic` (_Automatic identity updates_), `reauth` (_Group membership change reauthentication_), or `no_action` (_No action_). + + Keep all other fields from the `get` output. You do not need to add the `client_secret`. + +4. Update the identity provider with [`cf zero-trust identity-providers update`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-update): + + ```sh + cf zero-trust identity-providers update --body @idp.json + ``` + +5. In the output, copy the `scim_base_url` (**SCIM Endpoint**) and `secret` (**SCIM Secret**) values from `scim_config`. You will need to enter these values into {props.idp}. The secret is only shown when SCIM is first turned on. To regenerate the secret later, use the dashboard. + + + + The SCIM secret never expires, but you can manually regenerate the secret at any time. diff --git a/src/content/partials/cloudflare-one/access/idp-integration.mdx b/src/content/partials/cloudflare-one/access/idp-integration.mdx index d72214326c2..3eb02fe4b08 100644 --- a/src/content/partials/cloudflare-one/access/idp-integration.mdx +++ b/src/content/partials/cloudflare-one/access/idp-integration.mdx @@ -2,10 +2,11 @@ {} --- -import {Render, Tabs, TabItem} from "~/components" +import { Render, Steps, TabItem, Tabs } from "~/components"; + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Integrations** > **Identity providers**. 2. In the **Your identity providers** card, select **Add new identity provider**. @@ -19,6 +20,38 @@ import {Render, Tabs, TabItem} from "~/components" Each identity provider will have different required fields for you to fill in. Step-by-step instructions are shown in the dashboard side panel. Alternatively, refer to the [IdP-specific documentation](/cloudflare-one/integrations/identity-providers/). 5. Once you have filled in the necessary fields, select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create a JSON file with the identity provider's `name`, `type`, and `config`. Each identity provider type has different required `config` fields, which you obtain from your identity provider. For example, to add a Microsoft Entra ID integration: + + ```json title="idp.json" + { + "name": "Entra ID example", + "type": "azureAD", + "config": { + "client_id": "", + "client_secret": "", + "directory_id": "", + "support_groups": true + } + } + ``` + + For the `type` and `config` fields of each identity provider, refer to the [IdP-specific documentation](/cloudflare-one/integrations/identity-providers/). + +2. Add the identity provider with [`cf zero-trust identity-providers create`](/cloudflare-one/integrations/identity-providers/cli-commands/#cf-zero-trust-identity-providers-create): + + ```sh + cf zero-trust identity-providers create --body @idp.json + ``` + +3. Note the `id` in the output. You need it to update the identity provider or to allow it in an Access application. + diff --git a/src/content/partials/cloudflare-one/access/login-page.mdx b/src/content/partials/cloudflare-one/access/login-page.mdx index d43d2238fa0..32cb0371692 100644 --- a/src/content/partials/cloudflare-one/access/login-page.mdx +++ b/src/content/partials/cloudflare-one/access/login-page.mdx @@ -2,8 +2,14 @@ {} --- +import { Steps, TabItem, Tabs } from "~/components"; + To change the appearance of your login page: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Custom pages**. 2. Find the **Access login page** setting and select **Manage**. @@ -17,5 +23,38 @@ To change the appearance of your login page: Any changes you make will be reflected in real time in the **Preview** card. 4. Once you are satisfied with your customization, select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Review the current `name` and `login_design` values of your Zero Trust organization: + + ```sh + cf zero-trust organization get + ``` + +2. Update the login page with [`cf zero-trust organization edit`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-organization-edit): + + ```sh + cf zero-trust organization edit \ + --name "Example Corp" \ + --login-design-logo-path https://example.com/logo.png \ + --login-design-header-text "Sign in to Example Corp" \ + --login-design-footer-text "Contact IT for help" \ + --login-design-background-color "#ffffff" \ + --login-design-text-color "#000000" + ``` + + Pass every `--login-design-*` option, including the values that you do not want to change. + + +`cf` does not show a preview of the login page. To preview your changes, use the dashboard. + + + The login page is now updated for all of your Access applications. diff --git a/src/content/partials/cloudflare-one/access/rule-group.mdx b/src/content/partials/cloudflare-one/access/rule-group.mdx index 02763e4b912..9b22d4242c1 100644 --- a/src/content/partials/cloudflare-one/access/rule-group.mdx +++ b/src/content/partials/cloudflare-one/access/rule-group.mdx @@ -2,12 +2,13 @@ {} --- -import { TabItem, Tabs, APIRequest } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; To create an Access rule group: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Policies**, and select the **Rule groups** tab. 2. Select **Add a group**. 3. Enter a name for the group (for example, `Lisbon-team`). @@ -19,6 +20,30 @@ To create an Access rule group: | Require | Emails Ending In | `@team.com` | 5. Select **Save**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Organizations, Identity Providers, and Groups Write** permission. + + +1. Create the rule group with [`cf zero-trust access rule-groups create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-rule-groups-create). For example, the following rules define a team based in Lisbon, Portugal: + + ```sh + cf zero-trust access rule-groups create \ + --name "Lisbon-team" \ + --include '[{"geo":{"country_code":"PT"}}]' \ + --require '[{"email_domain":{"domain":"team.com"}}]' + ``` + + `--include`, `--exclude`, and `--require` each take a JSON array of [selectors](/cloudflare-one/access-controls/policies/#selectors), or `@path/to/rules.json` to read the array from a file. + +2. Note the `id` in the output. To use the rule group in an Access policy, add `{"group":{"id":""}}` to the policy's rules, for example `--include '[{"group":{"id":""}}]'`. + + +To change a rule group, run `cf zero-trust access rule-groups update ` with `--name`, `--include`, and the rules that you want to change. Exclude and Require rules that you omit are kept. To remove them, pass an empty array, for example `--exclude '[]'`. diff --git a/src/content/partials/cloudflare-one/access/tags.mdx b/src/content/partials/cloudflare-one/access/tags.mdx index 63833bef2f4..10ae827a125 100644 --- a/src/content/partials/cloudflare-one/access/tags.mdx +++ b/src/content/partials/cloudflare-one/access/tags.mdx @@ -3,16 +3,37 @@ --- +import { Steps, TabItem, Tabs } from "~/components"; + You can label an Access application with up to 25 custom tags. End users can then filter the applications in their [App Launcher](/cloudflare-one/access-controls/access-settings/app-launcher/) by their tags. ### Create a tag To create a new tag: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Tags**. 2. Select **Add a tag**. 3. Enter up to 35 alphanumeric characters for the tag (for example, `Human Resources`) and select it in the dropdown menu. 4. Select **Save**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: Apps and Policies Write** permission. + +Create the tag with [`cf zero-trust access tags create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-tags-create): + +```sh +cf zero-trust access tags create --name "Human Resources" +``` + + + You can now [add this tag](#tag-an-access-application) to an Access application. @@ -20,10 +41,43 @@ You can now [add this tag](#tag-an-access-application) to an Access application. To add a tag to an existing Access application: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Applications**. 2. Select an application and select **Edit**. 3. Go to **Additional settings**. 4. In the **Tags** dropdown, select the tags that you would like to assign to this application. The tag must be [created](#create-a-tag) before you can select it in the dropdown. 5. Select **Save**. + + + + + + +1. Save the application's current configuration to a file: + + ```sh + cf zero-trust access applications get > app.json + ``` + +2. In `app.json`, set `tags` to the names of the tags that you want to assign. The tags must already [exist](#create-a-tag). + + ```json title="app.json" + "tags": ["Human Resources"], + ``` + +3. Update the application with [`cf zero-trust access applications update`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-applications-update): + + ```sh + cf zero-trust access applications update --body @app.json + ``` + + +To check how many applications use a tag, run `cf zero-trust access tags get ""` and review `app_count`. + + + The tag will now appear on the application's App Launcher tile. diff --git a/src/content/partials/cloudflare-one/clientless-browser-isolation.mdx b/src/content/partials/cloudflare-one/clientless-browser-isolation.mdx index fe7557d4765..2fdb72fd52b 100644 --- a/src/content/partials/cloudflare-one/clientless-browser-isolation.mdx +++ b/src/content/partials/cloudflare-one/clientless-browser-isolation.mdx @@ -4,4 +4,12 @@ --- 1. In [Cloudflare One](https://one.dash.cloudflare.com/), go to **Browser isolation** > **Browser isolation settings**. -2. Turn on **Allow users to open a remote browser without the device client**. \ No newline at end of file +2. Turn on **Allow users to open a remote browser without the device client**. + + To turn on this setting with the [Cloudflare CLI (`cf`)](/cf/get-started/), run [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit). This command replaces the whole `browser_isolation` settings group, so pass the current value of `settings.browser_isolation.non_identity_enabled` from `cf zero-trust gateway configurations get` to keep it: + + ```sh + cf zero-trust gateway configurations edit \ + --settings-browser-isolation-url-browser-isolation-enabled true \ + --settings-browser-isolation-non-identity-enabled + ``` diff --git a/src/content/partials/cloudflare-one/gateway/add-block-page.mdx b/src/content/partials/cloudflare-one/gateway/add-block-page.mdx index 4c753a906be..096680e5182 100644 --- a/src/content/partials/cloudflare-one/gateway/add-block-page.mdx +++ b/src/content/partials/cloudflare-one/gateway/add-block-page.mdx @@ -15,4 +15,25 @@ import { Markdown } from "~/components"; 5. (Optional) If your account-level block page setting uses a custom Gateway block page, you can turn on **Add an additional message to your custom block page when traffic matches this policy** to add a custom message to your custom block page when traffic is blocked by this policy. This option will replace the **Message** field. 6. Select **Save policy**. +To set the block behavior with the [Cloudflare CLI (`cf`)](/cf/get-started/), pass these flags to [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +- `--rule-settings-block-page-target-uri`: The URL to redirect blocked users to. Add `--rule-settings-block-page-include-context true` to pass context information as query parameters. +- `--rule-settings-block-reason`: An additional message to show on your custom block page. +- `--rule-settings-block-page-enabled true`: Required for DNS policies to modify the block behavior. HTTP policies ignore this flag. + +For example, to redirect users blocked by a DNS policy: + +```sh +cf zero-trust gateway rules create \ + --name "Block example.com" \ + --action block \ + --filters dns \ + --traffic 'any(dns.domains[*] == "example.com")' \ + --rule-settings-block-page-enabled true \ + --rule-settings-block-page-target-uri https://blocked.example.com \ + --enabled true +``` + +To change an existing policy, use `cf zero-trust gateway rules update`. This command replaces the whole policy, so include all of its existing settings. + Depending on your settings, Gateway will display a block page in your users' browsers or redirect them to a specified URL when they are blocked by this policy. diff --git a/src/content/partials/cloudflare-one/gateway/add-locations.mdx b/src/content/partials/cloudflare-one/gateway/add-locations.mdx index 17c2e6e6719..c98595718ca 100644 --- a/src/content/partials/cloudflare-one/gateway/add-locations.mdx +++ b/src/content/partials/cloudflare-one/gateway/add-locations.mdx @@ -2,7 +2,13 @@ {} --- -import { GlossaryDefinition, GlossaryTooltip } from "~/components"; +import { + GlossaryDefinition, + GlossaryTooltip, + Steps, + TabItem, + Tabs, +} from "~/components"; @@ -12,6 +18,10 @@ The fastest way to start filtering DNS queries from a location is by changing th To add a DNS location to Gateway: + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic controls** > **Resolver endpoints**. 2. Select **Add a location**. 3. Choose a name for your DNS location. @@ -26,3 +36,45 @@ To add a DNS location to Gateway: - **DoH endpoint filtering & authentication** lets you restrict DNS resolution to only valid identities or user tokens in addition to IPv4/IPv6 addresses. 8. Select **Continue**. 9. Review the settings for your DNS location, then choose **Done**. +10. Change the DNS resolvers on your router, browser, or OS by following the setup instructions in the UI. +11. Select **Go to DNS Location**. Your location will appear in your list of locations. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Create the DNS location with [`cf zero-trust gateway locations create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-locations-create): + + ```sh + cf zero-trust gateway locations create \ + --name "Office network" \ + --endpoints-ipv4-enabled true \ + --networks '[{"network": "/32"}]' \ + --endpoints-ipv6-enabled true \ + --endpoints-doh-enabled true \ + --endpoints-dot-enabled true \ + --ecs-support true + ``` + + - `--endpoints-ipv4-enabled`, `--endpoints-ipv6-enabled`, `--endpoints-doh-enabled`, and `--endpoints-dot-enabled`: The [DNS endpoints](/cloudflare-one/traffic-controls/resolver-endpoints/#dns-endpoints) that resolve your organization's DNS queries. + - `--networks`: The source IPv4 addresses of the network. Required for the IPv4 endpoint unless you use a [dedicated DNS resolver IP](/cloudflare-one/traffic-controls/resolver-endpoints/dns-resolver-ips/#dns-resolver-ip). + - `--endpoints-doh-networks`, `--endpoints-dot-networks`, and `--endpoints-ipv6-networks`: (Optional) Source IP filtering for each endpoint, as a JSON array, for example `'[{"network": "2001:db8::/32"}]'`. + - `--endpoints-doh-require-token`: (Optional) Requires a valid user identity or token for DNS over HTTPS queries. + - `--ecs-support`: The **Enable EDNS client subnet** setting. + - `--client-default`: The **Set as Default DNS Location** setting. + - `--dns64-enabled`: The **Enable DNS64** setting. + +2. Change the DNS resolvers on your router, browser, or OS. The output of the previous command includes the values to use: + + - `ipv4_destination` and `ipv4_destination_backup`: The IPv4 DNS resolver addresses. + - `ip`: The IPv6 DNS resolver address. + - `doh_subdomain`: The unique subdomain of your DNS over HTTPS and DNS over TLS hostnames, `.cloudflare-gateway.com`. + + To get these values later, run `cf zero-trust gateway locations list`. + + + + diff --git a/src/content/partials/cloudflare-one/gateway/create-resolver-policy.mdx b/src/content/partials/cloudflare-one/gateway/create-resolver-policy.mdx index 40817932e7d..663f25912f6 100644 --- a/src/content/partials/cloudflare-one/gateway/create-resolver-policy.mdx +++ b/src/content/partials/cloudflare-one/gateway/create-resolver-policy.mdx @@ -2,7 +2,7 @@ {} --- -import { TabItem, Tabs } from "~/components"; +import { Steps, TabItem, Tabs } from "~/components"; :::caution[Virtual network limitation] Resolver policies do not automatically update when you change the virtual networks associated with a route. If you move a route from one virtual network to another, the resolver policy will still reference the old virtual network. You will need to manually remove and recreate the resolver policy to update the route. @@ -12,6 +12,7 @@ To create a resolver policy: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Resolver policies**. 2. Select **Add a policy**. 3. Create an expression for your desired traffic. For example, you can resolve a hostname for an internal service: @@ -27,9 +28,31 @@ To create a resolver policy: 6. In **Network**, choose whether to route queries publicly (to the Internet) or privately (to a private network service). 7. (Optional) Enter a custom port for each IP address. 8. Select **Create policy**. + Custom resolvers are saved to your account for future use. You can add up to 10 IPv4 and 10 IPv6 addresses to a policy. + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Make sure your destination is not subject to [Local Domain Fallback](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/local-domains/#manage-local-domains). Then, create the resolver policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "Example resolver policy" \ + --enabled true \ + --action resolve \ + --filters dns_resolver \ + --traffic 'dns.fqdn in {"internal.example.com"}' \ + --rule-settings-dns-resolvers-ipv4 '[{"ip": "192.0.2.24", "port": 53, "route_through_private_network": true, "vnet_id": ""}]' +``` + +- `--filters dns_resolver` and `--action resolve`: Creates a resolver policy. +- `--rule-settings-dns-resolvers-ipv4` and `--rule-settings-dns-resolvers-ipv6`: The custom DNS resolvers, as a JSON array or `@path/to/file.json`. For each resolver, set `ip`, an optional `port`, `route_through_private_network` (`true` to route queries privately, `false` to route them publicly), and, for private resolvers, the `vnet_id` of the [virtual network](/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/tunnel-virtual-networks/). +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + diff --git a/src/content/partials/cloudflare-one/gateway/customize-block-page.mdx b/src/content/partials/cloudflare-one/gateway/customize-block-page.mdx index 0eaa61fd3eb..2a045f31826 100644 --- a/src/content/partials/cloudflare-one/gateway/customize-block-page.mdx +++ b/src/content/partials/cloudflare-one/gateway/customize-block-page.mdx @@ -2,7 +2,7 @@ {} --- -import { Tabs, TabItem } from "~/components"; +import { Steps, TabItem, Tabs } from "~/components"; You can customize the Cloudflare-hosted block page by making global changes that Gateway will display every time a user reaches your block page. Customizations will apply regardless of the type of policy (DNS or HTTP) that blocks the traffic. @@ -10,6 +10,7 @@ To customize your block page: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Custom pages**. 2. Under **Account Gateway block page**, select **Customize**. 3. Choose **Custom Gateway block page**. Gateway will display a preview of your custom block page. Available customizations include: @@ -20,7 +21,44 @@ To customize your block page: - [Mailto link](/cloudflare-one/reusable-components/custom-pages/gateway-block-page/#allow-users-to-email-an-administrator) - Background color 4. Select **Save**. + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Review your current block page settings: + + ```sh + cf zero-trust gateway configurations get + ``` + + The block page settings are in `settings.block_page`. + +2. Turn on the custom block page and set your customizations with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + + ```sh + cf zero-trust gateway configurations edit \ + --settings-block-page-enabled true \ + --settings-block-page-mode customized_block_page \ + --settings-block-page-name "Example Inc." \ + --settings-block-page-logo-path "https://example.com/logo.png" \ + --settings-block-page-header-text "This website is blocked" \ + --settings-block-page-footer-text "Contact your IT team for help" \ + --settings-block-page-mailto-address admin@example.com \ + --settings-block-page-mailto-subject "Blocked Request" \ + --settings-block-page-background-color "#ffffff" + ``` + + - `--settings-block-page-enabled true` and `--settings-block-page-mode customized_block_page`: Selects **Custom Gateway block page**. + - `--settings-block-page-name`: Your organization's name. + - `--settings-block-page-header-text` and `--settings-block-page-footer-text`: The header text and the global block message. + - `--settings-block-page-mailto-address` and `--settings-block-page-mailto-subject`: The [mailto link](/cloudflare-one/reusable-components/custom-pages/gateway-block-page/#allow-users-to-email-an-administrator). + + `configurations edit` replaces the whole `block_page` settings group, so include every block page setting that you want to keep. If a value starts with `--`, pass it with an equals sign, for example `--settings-block-page-footer-text="--footer--"`. + diff --git a/src/content/partials/cloudflare-one/gateway/enable-tls-decryption.mdx b/src/content/partials/cloudflare-one/gateway/enable-tls-decryption.mdx index 07c7d64a068..e5074760581 100644 --- a/src/content/partials/cloudflare-one/gateway/enable-tls-decryption.mdx +++ b/src/content/partials/cloudflare-one/gateway/enable-tls-decryption.mdx @@ -2,12 +2,27 @@ {} --- -import { TabItem, Tabs } from "~/components"; +import { Steps, TabItem, Tabs } from "~/components"; + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Traffic settings**. 2. In **Proxy and inspection**, turn on **Inspect HTTPS requests with TLS decryption**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Turn on TLS decryption with [`cf zero-trust gateway configurations edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-configurations-edit): + +```sh +cf zero-trust gateway configurations edit --settings-tls-decrypt-enabled true +``` + +This command changes only the TLS decryption setting. To check the current value, run `cf zero-trust gateway configurations get` and review `settings.tls_decrypt`. diff --git a/src/content/partials/cloudflare-one/gateway/extended-email.mdx b/src/content/partials/cloudflare-one/gateway/extended-email.mdx index d6581a87179..d4d3fc14f31 100644 --- a/src/content/partials/cloudflare-one/gateway/extended-email.mdx +++ b/src/content/partials/cloudflare-one/gateway/extended-email.mdx @@ -61,4 +61,4 @@ By default, Gateway will either filter only exact matches or all extended varian
-To force Gateway to match all email address variants, go to **Traffic policies** > **Traffic settings** > **Policy settings** and turn on **Match extended email addresses**. This setting applies to all firewall, egress, and resolver policies. +To force Gateway to match all email address variants, go to **Traffic policies** > **Traffic settings** > **Policy settings** and turn on **Match extended email addresses**. This setting applies to all firewall, egress, and resolver policies. With the [Cloudflare CLI (`cf`)](/cf/), run `cf zero-trust gateway configurations edit --settings-extended-email-matching-enabled true`. diff --git a/src/content/partials/cloudflare-one/gateway/get-started/create-http-policy.mdx b/src/content/partials/cloudflare-one/gateway/get-started/create-http-policy.mdx index 00b8f31e38c..815ac8091c8 100644 --- a/src/content/partials/cloudflare-one/gateway/get-started/create-http-policy.mdx +++ b/src/content/partials/cloudflare-one/gateway/get-started/create-http-policy.mdx @@ -2,12 +2,13 @@ {} --- -import { Render, Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; To create a new HTTP policy: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies**. 2. In the **HTTP** tab, select **Add a policy**. 3. Name the policy. @@ -27,6 +28,46 @@ To create a new HTTP policy: /> 6. Select **Create policy**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + + +1. Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, if you have configured TLS decryption, some applications that use [embedded certificates](/cloudflare-one/traffic-controls/http-policies/tls-decryption/#inspection-limitations) may not support HTTP inspection, such as some Google products. You can create a policy to bypass inspection for these applications: + + ```sh + cf zero-trust gateway rules create \ + --name "Do not inspect applications" \ + --description "Bypass TLS decryption for unsupported applications" \ + --precedence 0 \ + --enabled true \ + --action off \ + --filters http \ + --traffic 'any(app.type.ids[*] in {16})' + ``` + + - `--filters http`: Creates an HTTP policy. + - `--action off`: The **Do Not Inspect** action. + - `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + +2. Cloudflare also recommends adding a policy to block [known threats](/cloudflare-one/traffic-controls/domain-categories/#security-categories) such as Command & Control, Botnet and Malware based on Cloudflare's threat intelligence: + + ```sh + cf zero-trust gateway rules create \ + --name "Block known risks" \ + --description "Block all default Cloudflare HTTP security categories" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})' + ``` + + To get the IDs of other security and content categories, run [`cf zero-trust gateway categories list`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-categories-list). + diff --git a/src/content/partials/cloudflare-one/gateway/get-started/create-network-policy.mdx b/src/content/partials/cloudflare-one/gateway/get-started/create-network-policy.mdx index 5bdb0c1e1a7..ae948dd0329 100644 --- a/src/content/partials/cloudflare-one/gateway/get-started/create-network-policy.mdx +++ b/src/content/partials/cloudflare-one/gateway/get-started/create-network-policy.mdx @@ -2,12 +2,13 @@ {} --- -import { Render, Tabs, TabItem, APIRequest } from "~/components"; +import { APIRequest, Render, Steps, TabItem, Tabs } from "~/components"; To create a new network policy: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Traffic policies** > **Firewall policies**. 2. In the **Network** tab, select **Add a network policy**. 3. Name the policy. @@ -20,6 +21,33 @@ To create a new network policy: /> 6. Select **Create policy**. + + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create). For example, you can use a list of [device serial numbers](/cloudflare-one/reusable-components/posture-checks/client-checks/corp-device/) to ensure users can only access an application if they connect with the Cloudflare One Client from a company device: + +```sh +cf zero-trust gateway rules create \ + --name "Enforce device posture" \ + --description "Ensure only devices in Zero Trust organization can connect to application" \ + --precedence 0 \ + --enabled true \ + --action block \ + --filters l4 \ + --traffic 'any(net.sni.domains[*] == "internalapp.com")' \ + --device-posture 'not(any(device_posture.checks.passed[*] in {""}))' +``` + +- `--filters l4`: Creates a network policy. +- `--traffic`, `--identity`, and `--device-posture`: The **Traffic**, **Identity**, and **Device posture** conditions, written as [wirefilter expressions](/cloudflare-one/traffic-controls/expression-syntax/). +- `--enabled true`: Turns on the policy. `cf` creates policies turned off unless you pass this flag. + +The output includes the policy `id`, which you need to update or delete the policy. diff --git a/src/content/partials/cloudflare-one/gateway/lists.mdx b/src/content/partials/cloudflare-one/gateway/lists.mdx index 55e2caf5b34..4f79c11d1a5 100644 --- a/src/content/partials/cloudflare-one/gateway/lists.mdx +++ b/src/content/partials/cloudflare-one/gateway/lists.mdx @@ -2,7 +2,7 @@ {} --- -import { TabItem, Tabs, APIRequest } from "~/components"; +import { APIRequest, Steps, TabItem, Tabs } from "~/components"; ## Create a list from a CSV file @@ -27,11 +27,43 @@ To upload the list to the Cloudflare dashboard: + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Lists**. 2. Select **Upload CSV**. 3. Next, specify a **List name**, enter an optional description, and choose a **List type**. 4. Drag and drop a file into the **CSV file** window, or select a file. 5. Select **Create**. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Write** permission. + +`cf` takes list items as JSON instead of CSV. + + +1. Convert the CSV file to a JSON array of items. For example, with [`jq`](https://jqlang.org/): + + ```sh + jq -Rn '[inputs | select(length > 0) | split(",") | {value: .[0], description: .[1]}] | .[1:]' list-test.csv > list-test.json + ``` + + This command skips the header row and assumes that descriptions do not contain commas. + +2. Create the list with [`cf zero-trust gateway lists create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-create): + + ```sh + cf zero-trust gateway lists create \ + --name "IPs imported from CSV" \ + --description "Imported from list-test.csv" \ + --type IP \ + --items @list-test.json + ``` + + - `--type`: The **List type**, for example `IP`, `DOMAIN`, `URL`, `EMAIL`, or `SERIAL`. + - `--items`: The list entries, as a JSON array of objects with a `value` and an optional `description`. + @@ -68,11 +100,46 @@ You can now use this list in the policy builder by choosing the _in list_ operat + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Reusable components** > **Lists**. 2. Select **Create manual list**. 3. Next, specify a **List name**, enter an optional description, and choose a **List type**. 4. Enter your list element manually into the **Add entry** field and select **Add**. 5. Select **Save**. + + + + + + +1. Create the list with [`cf zero-trust gateway lists create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-create): + + ```sh + cf zero-trust gateway lists create \ + --name "Corporate IP list" \ + --description "Private application IPs" \ + --type IP \ + --items '[{"value": "10.226.0.177/32"}, {"value": "10.226.1.177/32"}]' + ``` + + The output includes the list `id`. To reference the list in a policy expression, use `$`, for example `net.dst.ip in $`. + +2. To add or remove entries later, use [`cf zero-trust gateway lists edit`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-lists-edit): + + ```sh + cf zero-trust gateway lists edit \ + --append '[{"value": "10.226.2.177/32", "description": "New application server"}]' \ + --remove 10.226.0.177/32 + ``` + + `--remove` takes one or more item values separated by spaces. To replace all entries in the list, use `cf zero-trust gateway lists update --name "" --items ''` instead. + +3. To review the entries in a list, run: + + ```sh + cf zero-trust gateway lists items list --list-id + ``` + diff --git a/src/content/partials/cloudflare-one/gateway/policies/block-file-types.mdx b/src/content/partials/cloudflare-one/gateway/policies/block-file-types.mdx index d217acfb3a2..35f7602f9ea 100644 --- a/src/content/partials/cloudflare-one/gateway/policies/block-file-types.mdx +++ b/src/content/partials/cloudflare-one/gateway/policies/block-file-types.mdx @@ -15,6 +15,22 @@ Block the upload or download of files based on their type. + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "Block file types" \ + --description "Block the upload or download of files based on their type" \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(http.upload.file.types[*] in {"docx"}) and any(http.download.file.types[*] in {"pdf"})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-DNS-Application-Blocklist" \ + --description "Block access to unauthorized AI applications" \ + --precedence 40 \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(app.type.ids[*] in {25})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-DNS-ContentCategories-Blocklist" \ + --description "Block common content categories that may pose a risk" \ + --precedence 30 \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.content_category[*] in {17 85 87 102 157 135 138 180 162 32 169 177 128 15 115 119 124 141 161})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-DNS-SecurityCategories-Blocklist" \ + --description "Block security categories based on Cloudflare's threat intelligence" \ + --precedence 20 \ + --enabled true \ + --action block \ + --filters dns \ + --traffic 'any(dns.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-HTTP-Application-Blocklist" \ + --description "Limit access to shadow IT by blocking web-based tools and applications" \ + --precedence 60 \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(app.type.ids[*] in {25})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-HTTP-ContentCategories-Blocklist" \ + --description "Block access to questionable content and potential security risks" \ + --precedence 40 \ + --enabled true \ + --action block \ + --filters http \ + --traffic 'any(http.request.uri.content_category[*] in {17 85 87 102 157 135 138 180 162 32 169 177 128 15 115 119 124 141 161 2 67 125 133 99})' +``` + + + + + +Create the policy with [`cf zero-trust gateway rules create`](/cloudflare-one/traffic-controls/cli-commands/#cf-zero-trust-gateway-rules-create): + +```sh +cf zero-trust gateway rules create \ + --name "All-NET-ApplicationAccess-Allow" \ + --description "Ensure access to the application comes from authorized WARP clients" \ + --precedence 70 \ + --action block \ + --filters l4 \ + --traffic 'any(net.sni.domains[*] == "internalapp.com")' \ + --device-posture 'not(any(device_posture.checks.passed[*] in {""}))' +``` + + + + + 1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), go to **Zero Trust** > **Access controls** > **Service credentials** > **SSH**. 2. Select **Add a certificate**. @@ -16,6 +17,28 @@ import { Render, Details, APIRequest, Tabs, TabItem } from "~/components"; 4. Select the **SSH with Access for Infrastructure** certificate. 5. Copy its **CA public key**. You can return to copy this public key at any time. + + + + + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Access: SSH Auditing Edit** permission. + + +1. Check whether your account already has a Cloudflare SSH CA: + + ```sh + cf zero-trust access infrastructure ssh-ca list + ``` + +2. If the output is empty, generate the SSH CA with [`cf zero-trust access infrastructure ssh-ca create`](/cloudflare-one/access-controls/cli-commands/#cf-zero-trust-access-infrastructure-ssh-ca-create): + + ```sh + cf zero-trust access infrastructure ssh-ca create + ``` + +3. Copy the `public_key` value in the output. + diff --git a/src/content/partials/cloudflare-one/troubleshooting/warp-client.mdx b/src/content/partials/cloudflare-one/troubleshooting/warp-client.mdx index 7132d6835bf..1d5e6a9cf8b 100644 --- a/src/content/partials/cloudflare-one/troubleshooting/warp-client.mdx +++ b/src/content/partials/cloudflare-one/troubleshooting/warp-client.mdx @@ -68,6 +68,20 @@ After updating the Cloudflare One Client, monitor the issue to see if it recurs. 3. Find the device's client version under **Client version** in the side menu. 4. Compare your device's version with the [latest version of the Cloudflare One Client](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/download/). +#### Via the Cloudflare CLI + +Install the [Cloudflare CLI (`cf`)](/cf/get-started/) and sign in with `cf auth login`, or set `CLOUDFLARE_API_TOKEN` to an API token with **Zero Trust Read** permission. + + +1. Find the device and review its `client_version` field with [`cf zero-trust devices list`](/cloudflare-one/team-and-resources/devices/cli-commands/#cf-zero-trust-devices-list): + + ```sh + cf zero-trust devices list --search "" + ``` + +2. Compare the device's version with the [latest version of the Cloudflare One Client](/cloudflare-one/team-and-resources/devices/cloudflare-one-client/download/). To list the versions available for Windows or macOS, run `cf zero-trust devices client-versions list --target-environment windows --release-track ga`. + + ### Client basics Understand the Cloudflare One Client's architecture, installation paths, and modes to help you diagnose issues with greater accuracy. @@ -399,6 +413,8 @@ When troubleshooting the Cloudflare One Client for managed network issues: 2. Go to **Managed networks** > **Edit**. 3. Compare the TLS Cert SHA-256 in the dashboard with the returned fingerprint in your terminal to ensure they match. + Alternatively, run `cf zero-trust devices networks list` and compare the `config.sha256` value of the managed network with the returned fingerprint. + 2. Use a single profile for a single location. To simplify management and prevent errors, avoid creating multiple managed network profiles for the same location. For example, if you have multiple TLS endpoints in one office, link them all to a single device profile. This reduces the risk of a device matching an unintended profile due to a configuration error.