Skip to content

Commit d7c195b

Browse files
committed
update mtls example
1 parent 852784f commit d7c195b

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

src/content/partials/cloudflare-one/warp/device-enrollment-mtls.mdx

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ To check for an mTLS certificate:
2121

2222
4. On your device, add the client certificate to the [system keychain](/cloudflare-one/identity/devices/access-integrations/mutual-tls-authentication/#test-in-the-browser).
2323

24-
</TabItem> <TabItem label="Terraform (v4)">
24+
</TabItem> <TabItem label="Terraform (v5)">
2525

26-
:::note[Provider versions]
27-
The following example requires Cloudflare provider version `>=4.40.0`.
28-
:::
29-
30-
1. Add the following permissions to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0/docs/resources/api_token):
26+
1. Add the following permissions to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
3127
- `Access: Mutual TLS Certificates Write`
3228
- `Access: Apps and Policies Write`
3329

34-
2. Use the [`cloudflare_zero_trust_access_mtls_certificate`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0/docs/resources/zero_trust_access_mtls_certificate) resource to add an mTLS certificate to your account:
30+
2. Use the [`cloudflare_zero_trust_access_mtls_certificate`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_mtls_certificate) resource to add an mTLS certificate to your account:
3531

3632
```tf
3733
resource "cloudflare_zero_trust_access_mtls_certificate" "example_mtls_cert" {
@@ -47,26 +43,38 @@ The following example requires Cloudflare provider version `>=4.40.0`.
4743
}
4844
```
4945

50-
3. Add the following policy to your [WARP enrollment Access application](/cloudflare-one/connections/connect-devices/warp/deployment/device-enrollment/#set-device-enrollment-permissions):
46+
3. Create the following Access policy:
5147

5248
```tf
53-
resource "cloudflare_zero_trust_access_policy" "warp_enrollment_employees" {
54-
application_id = cloudflare_zero_trust_access_application.warp_enrollment_app.id
49+
resource "cloudflare_zero_trust_access_policy" "warp_enrollment_mtls" {
5550
account_id = var.cloudflare_account_id
56-
name = "Allow company emails"
51+
name = "Allow employees with mTLS cert"
5752
decision = "allow"
58-
precedence = 1
59-
60-
include {
61-
email_domain = ["company.com"]
62-
}
63-
64-
require {
65-
common_names = ["Common name 1", "Common name 2"]
66-
}
53+
include = [
54+
{
55+
email_domain = {
56+
domain = "@example.com"
57+
}
58+
}
59+
]
60+
61+
require = [
62+
{
63+
common_name = {
64+
common_name = "Common name 1"
65+
}
66+
},
67+
{
68+
common_name = {
69+
common_name = "Common name 2"
70+
}
71+
}
72+
]
6773
}
6874
```
6975

70-
4. On your device, add the client certificate to the [system keychain](/cloudflare-one/identity/devices/access-integrations/mutual-tls-authentication/#test-in-the-browser).
76+
4. Add the policy to your [`cloudflared_zero_trust_access_application` for WARP](/cloudflare-one/connections/connect-devices/warp/deployment/device-enrollment/#set-device-enrollment-permissions).
77+
78+
5. On your device, add the client certificate to the [system keychain](/cloudflare-one/identity/devices/access-integrations/mutual-tls-authentication/#test-in-the-browser).
7179

7280
</TabItem> </Tabs>

src/content/partials/cloudflare-one/warp/service-token-enrollment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { Tabs, TabItem } from '~/components';
4747
]
4848
}
4949
```
50-
4. Add the policy to your [WARP enrollment Access application](/cloudflare-one/connections/connect-devices/warp/deployment/device-enrollment/#set-device-enrollment-permissions).
50+
4. Add the policy to your [`cloudflared_zero_trust_access_application` for WARP](/cloudflare-one/connections/connect-devices/warp/deployment/device-enrollment/#set-device-enrollment-permissions).
5151

5252
5. In your MDM [deployment parameters](/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/parameters/), add the following fields:
5353
* `auth_client_id`: The **Client ID** of your service token.

0 commit comments

Comments
 (0)