-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[ZT] Generic s2s #16698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[ZT] Generic s2s #16698
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a8542c9
create add-service-provider partial
ranbel 9b4c610
update UI
ranbel d90d6ee
update posture check steps
ranbel 7b8de16
add new service provider page
ranbel 395682b
link to device posture policy info
ranbel e205a15
update tutorials layout
ranbel 19432cb
create new tutorial placeholder
ranbel d8df357
access jwt verification
ranbel dd7c662
Merge branch 'production' into ranbel/generic-s2s
ranbel 19ae67a
remove Worker references
ranbel 4b61579
clarify test button
ranbel 8894184
Merge branch 'production' into ranbel/generic-s2s
ranbel 65ef37e
fix front matter
ranbel 071629c
fix score
ranbel 099fdd9
Update src/content/docs/cloudflare-one/identity/devices/service-provi…
ranbel 8554090
Update src/content/docs/cloudflare-one/identity/devices/service-provi…
ranbel dca4812
Update src/content/docs/cloudflare-one/identity/devices/service-provi…
ranbel b4079f2
Update src/content/docs/cloudflare-one/identity/devices/service-provi…
ranbel a45da28
link to Workers example
ranbel 168e033
update partial frontmatter
ranbel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
src/content/docs/cloudflare-one/identity/devices/service-providers/custom.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,127 @@ | ||||||
| --- | ||||||
| pcx_content_type: how-to | ||||||
| title: Custom device posture integration | ||||||
| sidebar: | ||||||
| label: Custom integration | ||||||
| order: 1 | ||||||
| hidden: true | ||||||
ranbel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| import { Render } from "~/components" | ||||||
|
|
||||||
| Cloudflare Zero Trust allows you to enforce custom device posture checks on your applications. This involves configuring a WARP service-to-service integration that periodially calls the external API of your choice, whether it is a third-party endpoint provider or a home built solution. When called, the API will receive device identifying information from Cloudflare and be expected to return a value between 0 to 100. You can then set up a device posture check that determines if the returned value counts as a pass or fail; for example, you could allow access to a user only if their device has a posture value greater than 60. | ||||||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ```mermaid | ||||||
| sequenceDiagram | ||||||
| participant WARP | ||||||
| participant Cloudflare Access | ||||||
| participant External API | ||||||
| WARP->>Cloudflare Access: Client ID and Secret | ||||||
| Cloudflare Access->>External API: Application token | ||||||
| WARP->>External API: JSON with user and device identity | ||||||
| External API-->>WARP: JSON with 0-100 result | ||||||
| ``` | ||||||
|
|
||||||
| ## External API requirements | ||||||
|
|
||||||
| The custom service provider integration works with any API service that meets the following specifications. | ||||||
|
|
||||||
| ### Authentication | ||||||
|
|
||||||
| The WARP client authenticates to the external API through Cloudflare Access. The external API should [validate the application token](/cloudflare-one/identity/authorization-cookie/validating-json/) issued by Cloudflare Access to ensure that any requests which bypass Access (for example, due to a network misconfiguration) are rejected. | ||||||
|
|
||||||
| ### Data passed to external API | ||||||
|
|
||||||
| Cloudflare will pass the following parameters to the configured API endpoint. You can use this data to identify the device and assign a posture score. For some devices, not all identifying information will apply, in which case the field will be blank. A maximum of 1000 devices will be sent per a request. | ||||||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| | Field | Description | | ||||||
| | ----- | ----------- | | ||||||
| | device_id | Device UUID assigned by the WARP client | | ||||||
| | email | Email address used to authenticate the WARP client | | ||||||
| | serial_number | Device serial number | | ||||||
| | mac_address | Device MAC address | | ||||||
| | virtual_ipv4 | Device virtual IPv4 address | | ||||||
| | hostname | Device name | | ||||||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| Example request body: | ||||||
| ```json | ||||||
| { | ||||||
| "devices": { | ||||||
| [ | ||||||
| { | ||||||
| "device_id": "9ece5fab-7398-488a-a575-e25a9a3dec07", | ||||||
| "email": "[email protected]", | ||||||
| "serial_number": "jdR44P3d", | ||||||
| "mac_address": "74:1d:3e:23:e0:fe", | ||||||
| "virtual_ipv4": "100.96.0.10", | ||||||
| "hostname": "string", | ||||||
| }, | ||||||
| {...}, | ||||||
| {...} | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ### Expected response from external API | ||||||
|
|
||||||
| For each Cloudflare `device_id`, the API service is expected to return a posture score and optionally a third-party device ID. | ||||||
|
|
||||||
| | Field | Description | | ||||||
| | ----- | ----------- | | ||||||
| | s2s_id | Third party device ID (empty string if unavailable) | | ||||||
| | score | Integer value between 0 - 100 | | ||||||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| Example response body: | ||||||
| ```json | ||||||
| { | ||||||
| "result": { | ||||||
| "9ece5fab-7398-488a-a575-e25a9a3dec07": { | ||||||
| "s2s_id": "", | ||||||
| "score": 10 | ||||||
| }, | ||||||
| "device_id2": {...}, | ||||||
| "device_id3": {...} | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ## Set up custom device posture checks | ||||||
|
|
||||||
| ### 1. Create a service token | ||||||
|
|
||||||
| WARP uses an Access Client ID and Access Client Secret to securely authenticate to the external API. If you do not already have an Access Client ID and Access Client Secret, [create a new service token](/cloudflare-one/identity/service-tokens/#create-a-service-token). | ||||||
|
|
||||||
| ### 2. Create an Access application | ||||||
|
|
||||||
| Next, secure the external API behind Cloudflare Access so that WARP can authenticate with the service token. To add the API endpoint to Access: | ||||||
|
|
||||||
| 1. [Create a self-hosted application](/cloudflare-one/applications/configure-apps/self-hosted-apps/) for your API endpoint. | ||||||
| 2. Add the following Access policy to the application. Make sure that **Action** is set to _Service Auth_ (not _Allow_). | ||||||
|
|
||||||
| | Action | Rule type | Selector | Value | | ||||||
| | ------ | --------- | ----------------- | ------------------------------------- | | ||||||
| | Service Auth | Include | Service Token | `<TOKEN-NAME>` | | ||||||
|
|
||||||
| ### 3. Add a service provider integration | ||||||
|
|
||||||
| To create a custom service-to-service integration: | ||||||
|
|
||||||
| <Render file="posture/add-service-provider" params={{ one: "Custom service provider" }} /> | ||||||
| 5. In **Access client ID** and **Access client secret**, enter the Access service token used to authenticate to your external API. | ||||||
| 6. In **Rest API URL**, enter the external API endpoint that Cloudflare will query for posture information (for example, `https://api.example.com`). For more information, refer to [External API requirements](#external-api-requirements). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Issues:
Fix Explanation: The term 'api' should be capitalized to 'API' to comply with the style guide. This is a simple capitalization fix to ensure consistency and professionalism in the documentation. |
||||||
| 7. In **Polling frequency**, choose how often Cloudflare Zero Trust should query the external API for information. | ||||||
| 8. Select **Test and save**. The test checks if Cloudflare can authenticate to the API URL using the provided Access credentials. | ||||||
|
|
||||||
| Next, [configure a device posture check](#configure-the-posture-check) to determine if a given posture score constitutes a pass or fail. | ||||||
|
|
||||||
| ### 4. Configure the posture check | ||||||
|
|
||||||
| <Render file="posture/configure-posture-check" params={{ one: "Custom service provider" }} /> | ||||||
|
|
||||||
| ## Device posture attributes | ||||||
|
|
||||||
| | Selector | Description | Value | | ||||||
| | ------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | ||||||
| | Score | Posture score returned by external API | `1` to `100` | | ||||||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/content/partials/cloudflare-one/posture/add-service-provider.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| inputParameters: param1 | ||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| import { Markdown } from "~/components" | ||
|
|
||
| 1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Settings** > **WARP Client**. | ||
| 2. Scroll down to **Third-party service provider integrations** and select **Add new**. | ||
| 3. Select **{props.one}**. | ||
| 4. Enter any name for the provider. This name will be used throughout the dashboard to reference this connection. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.