Skip to content

Commit 196ee58

Browse files
committed
Update another file
1 parent 0850d52 commit 196ee58

File tree

1 file changed

+45
-41
lines changed
  • src/content/docs/learning-paths/mtls/mtls-cloudflare-access

1 file changed

+45
-41
lines changed

src/content/docs/learning-paths/mtls/mtls-cloudflare-access/index.mdx

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This requires an active Enterprise [Account](/fundamentals/setup/accounts-and-zo
1111

1212
Setting up [mTLS](/cloudflare-one/identity/devices/access-integrations/mutual-tls-authentication/) with [Cloudflare Access](/cloudflare-one/policies/access/) can help in cases where the customer:
1313

14-
- Already has existing Client Certificates on devices.
15-
- Needs to protect Access applications with Bring Your Own CA (BYOCA).
14+
- Already has existing Client Certificates on devices.
15+
- Needs to protect Access applications with Bring Your Own CA (BYOCA).
1616
- Needs to integrate with a Zero Trust solution.
1717

1818
## 1. Create a CA
@@ -25,42 +25,42 @@ In case you want to [create your own CA](/cloudflare-one/identity/devices/access
2525

2626
```json
2727
{
28-
"CN": "Cloudflare Access Testing CA",
29-
"key": {
30-
"algo": "rsa",
31-
"size": 4096
32-
},
33-
"names": [
34-
{
35-
"C": "US",
36-
"L": "LA",
37-
"O": "Access Testing",
38-
"OU": "CA",
39-
"ST": "California"
40-
}
41-
]
42-
}
28+
"CN": "Cloudflare Access Testing CA",
29+
"key": {
30+
"algo": "rsa",
31+
"size": 4096
32+
},
33+
"names": [
34+
{
35+
"C": "US",
36+
"L": "LA",
37+
"O": "Access Testing",
38+
"OU": "CA",
39+
"ST": "California"
40+
}
41+
]
42+
}
4343
```
4444

4545
2. Create a JSON file called `ca-config.json`:
4646

4747
```json
4848
{
49-
"signing": {
50-
"default": {
51-
"expiry": "8760h"
52-
},
53-
"profiles": {
54-
"server": {
55-
"usages": ["signing", "key encipherment", "server auth"],
56-
"expiry": "8760h"
57-
},
58-
"client": {
59-
"usages": ["signing","key encipherment","client auth"],
60-
"expiry": "8760h"
61-
}
62-
}
63-
}
49+
"signing": {
50+
"default": {
51+
"expiry": "8760h"
52+
},
53+
"profiles": {
54+
"server": {
55+
"usages": ["signing", "key encipherment", "server auth"],
56+
"expiry": "8760h"
57+
},
58+
"client": {
59+
"usages": ["signing", "key encipherment", "client auth"],
60+
"expiry": "8760h"
61+
}
62+
}
63+
}
6464
}
6565
```
6666

@@ -92,11 +92,11 @@ cfssl gencert -initca ca-csr.json | cfssljson -bare ca
9292
}
9393
]
9494
}
95-
```
95+
```
9696

9797
2. Now you can run the following command to generate the Client Certificates, which will output the files `client.pem`, `client-key.pem` and `client.csr`:
9898

99-
```txt
99+
```sh
100100
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=client client-csr.json | cfssljson -bare client
101101
```
102102

@@ -114,7 +114,7 @@ Additionally, authenticated requests also send the `Cf-Access-Jwt-Assertion\` JW
114114

115115
## 4. Create the self-hosted applications
116116

117-
Finally, the hostname you want to protect with mTLS needs to be added as a [self-hosted app](/cloudflare-one/applications/configure-apps/self-hosted-apps/) in Cloudflare Access, defining an [Access Policy](/cloudflare-one/policies/access/) which uses the action [Service Auth](/cloudflare-one/policies/access/#service-auth) and the Selector *Valid Certificate*, or simply requiring an [IdP](/cloudflare-one/identity/idp-integration/) authentication. You can also take advantage of extra requirements, such as the Common Name (CN), which expects the indicated hostname, and more [Selectors](/cloudflare-one/policies/access/#selectors). Alternatively, one can also [extend ZTNA with external authorization and serverless computing](/reference-architecture/diagrams/sase/augment-access-with-serverless/).
117+
Finally, the hostname you want to protect with mTLS needs to be added as a [self-hosted app](/cloudflare-one/applications/configure-apps/self-hosted-apps/) in Cloudflare Access, defining an [Access Policy](/cloudflare-one/policies/access/) which uses the action [Service Auth](/cloudflare-one/policies/access/#service-auth) and the Selector _"Valid Certificate"_, or simply requiring an [IdP](/cloudflare-one/identity/idp-integration/) authentication. You can also take advantage of extra requirements, such as the "Common Name" (CN), which expects the indicated hostname, and more [Selectors](/cloudflare-one/policies/access/#selectors). Alternatively, one can also [extend ZTNA with external authorization and serverless computing](/reference-architecture/diagrams/sase/augment-access-with-serverless/).
118118

119119
## Demo
120120

@@ -124,18 +124,22 @@ Make sure that you are not using any VPN that could interfere with the certifica
124124

125125
With the Public and Private Client Certificates in the same directory, with this cURL command, we will gain access:
126126

127-
```curl
127+
```sh
128128
curl -IXGET --cert client.pem --key client-key.pem https://mtls-access.example.com/
129+
```
129130

130-
HTTP/2 200
131+
```txt output
132+
HTTP/2 200
131133
server: cloudflare
132134
```
133135

134-
Without the certificates, we'd see the following:
136+
Without the certificates, we would see the following:
135137

136-
```curl
138+
```sh
137139
curl -I https://mtls-access.example.com/mtls-test
140+
```
138141

139-
HTTP/2 401
142+
```txt output
143+
HTTP/2 401
140144
server: cloudflare
141-
```
145+
```

0 commit comments

Comments
 (0)