-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[ZT] add Terraform IdP to implementation guide #20238
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c439f4b
update OTP
ranbel 81e8dca
update generic oidc
ranbel 87b906a
update generic saml
ranbel dd24f61
update entra ID
ranbel 244e8dc
add IdP TF tab to implementation guide
ranbel 9fad5aa
Update src/content/partials/learning-paths/zero-trust/configure-idp.mdx
ranbel 41c2224
Update src/content/partials/cloudflare-one/access/idp-integration.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ pcx_content_type: how-to | |
| title: Microsoft Entra ID | ||
| --- | ||
|
|
||
| import { Render } from "~/components"; | ||
| import { Render, Tabs, TabItem } from "~/components"; | ||
|
|
||
| You can integrate Microsoft Entra ID (formerly Azure Active Directory) with Cloudflare Zero Trust and build policies based on user identity and group membership. Users will authenticate to Zero Trust using their Entra ID credentials. | ||
|
|
||
|
|
@@ -93,6 +93,8 @@ More narrow permissions may be used, however this is the set of permissions that | |
|
|
||
| ### 3. Add Entra ID as an identity provider | ||
|
|
||
| <Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard"> | ||
|
|
||
| 1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Settings** > **Authentication**. | ||
|
|
||
| 2. Under **Login methods**, select **Add new**. | ||
|
|
@@ -114,6 +116,45 @@ More narrow permissions may be used, however this is the set of permissions that | |
|
|
||
| To [test](/cloudflare-one/identity/idp-integration/#test-idps-in-zero-trust) that your connection is working, select **Test**. | ||
|
|
||
| </TabItem> <TabItem label="API"> | ||
|
|
||
| 1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions: | ||
| | Type | Item | Permission | | ||
| | ------- | ---------------- | ---------- | | ||
| | Account | Access: Organizations, Identity Providers, and Groups | Edit | | ||
|
|
||
| 2. Make a `POST` request to the [Identity Providers](/api/resources/zero_trust/subresources/identity_providers/methods/create/) endpoint: | ||
|
|
||
| ```sh | ||
| curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers \ | ||
| --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ | ||
| --data '{ | ||
| "name": "Entra ID example", | ||
| "type": "azureAD", | ||
| "config": { | ||
| "client_id": "<your client id>", | ||
| "client_secret": "<your client secret>", | ||
| "directory_id": "<your azure directory uuid>", | ||
| "support_groups": true | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> <TabItem label="Terraform"> | ||
|
|
||
| :::note[Provider versions] | ||
| The following example requires Cloudflare provider version `>=4.40.0`. | ||
| ::: | ||
|
|
||
| 1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token): | ||
| - `Access: Organizations, Identity Providers, and Groups Write` | ||
|
|
||
| 2. Configure the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource: | ||
|
|
||
| <Render file="access/entra-id-terraform" /> | ||
|
|
||
| </TabItem> </Tabs> | ||
|
|
||
| #### UPN and email | ||
|
|
||
| If your organization's UPNs do not match users' email addresses, you must add a custom claim for email. For example, if your organization's email format is `[email protected]` but the UPN is `[email protected]`, you must create an email claim if you are configuring email-based policies. | ||
|
|
@@ -264,18 +305,3 @@ You can require users to re-enter their credentials into Entra ID whenever they | |
| "scim_base_url": "https://<TEAM_NAME>.cloudflareaccess.com/populations/f174e90a-fafe-4643-bbbc-4a0ed4fc8415/scim/v2" | ||
| }' | ||
| ``` | ||
|
|
||
| ## Example API Configuration | ||
|
|
||
| ```json | ||
| { | ||
| "config": { | ||
| "client_id": "<your client id>", | ||
| "client_secret": "<your client secret>", | ||
| "directory_id": "<your azure directory uuid>", | ||
| "support_groups": true | ||
| }, | ||
| "type": "azureAD", | ||
| "name": "my example idp" | ||
| } | ||
| ``` | ||
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
18 changes: 18 additions & 0 deletions
18
src/content/partials/cloudflare-one/access/entra-id-terraform.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,18 @@ | ||
| --- | ||
| {} | ||
| --- | ||
|
|
||
|
|
||
| ```tf | ||
| resource "cloudflare_zero_trust_access_identity_provider" "microsoft_entra_id" { | ||
| account_id = var.cloudflare_account_id | ||
| name = "Entra ID example" | ||
| type = "azureAD" | ||
| config { | ||
| client_id = var.entra_id_client_id | ||
| client_secret = var.entra_id_client_secret | ||
| directory_id = var.entra_id_directory_id | ||
| support_groups = true | ||
| } | ||
| } | ||
| ``` |
6 changes: 6 additions & 0 deletions
6
src/content/partials/cloudflare-one/access/idp-integration-note.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,6 @@ | ||
| --- | ||
| params: | ||
| - verb | ||
| --- | ||
|
|
||
| If you do not see your identity provider listed, these providers can typically still be enabled. If they support OIDC or OAuth, {props.verb} the [generic OIDC](/cloudflare-one/identity/idp-integration/generic-oidc/) option. If they support SAML, {props.verb} the [generic SAML](/cloudflare-one/identity/idp-integration/generic-saml/) option. Cloudflare supports all SAML and OIDC providers and can integrate with the majority of OAuth providers. If your provider supports both SAML and OIDC, we recommend OIDC for ease of configuration. |
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
Oops, something went wrong.
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.