Skip to content

Commit 996f82d

Browse files
committed
PCX review
1 parent 8990dac commit 996f82d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/content/docs/api-shield/security/mtls/configure.mdx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ sidebar:
66
head:
77
- tag: title
88
content: Configure mTLS
9-
109
---
1110

12-
import { Render } from "~/components"
11+
import { Render } from "~/components";
1312

1413
When you specify API hosts in [mTLS authentication](/api-shield/security/mtls/), Cloudflare will block all requests that do not have a [client certificate](/ssl/client-certificates/) for mTLS authentication.
1514

@@ -40,20 +39,23 @@ The first expression — `not cf.tls_client_auth.cert_verified` — returns `tru
4039

4140
The second expression uses the `http.request.uri.path` field, combined with the `in` operator, to capture the URI paths your mTLS rule applies to.
4241

43-
Because the [action](/ruleset-engine/rules-language/actions/) for your rule is *Block*, only requests that present a valid client certificate can access the specified hosts.
44-
45-
For enhanced security, we recommend validating the SHA-256 certificate hash alongside the verified certificate field. This ensures that only requests presenting a valid client certificate with a specific fingerprint are allowed.
42+
Because the [action](/ruleset-engine/rules-language/actions/) for your rule is _Block_, only requests that present a valid client certificate can access the specified hosts.
4643

47-
You can implement this by using the following expression:
48-
`not (cf.tls_client_auth.cert_verified and cf.tls_client_auth.cert_fingerprint_sha256 eq "253E08C1AB67EB7630C61734D377D75D5DCCDE2F6E69986C221D66E848B64321")`
44+
For enhanced security, Cloudflare recommends that you validate the SHA-256 certificate hash alongside the verified certificate field. This ensures that only requests presenting a valid client certificate with a specific fingerprint are allowed.
4945

50-
To retrieve the SHA-256 fingerprint of your client certificate, run the following OpenSSL command:
46+
You can implement this by using an expression similar to the following:
5147

52-
`openssl x509 -noout -fingerprint -sha256 -inform pem -in mtls.crt | cut -d "=" -f 2 | tr -d ':'`
48+
```txt
49+
not (cf.tls_client_auth.cert_verified and cf.tls_client_auth.cert_fingerprint_sha256 eq "253E08C1AB67EB7630C61734D377D75D5DCCDE2F6E69986C221D66E848B64321")
50+
```
5351

54-
Example output:
52+
To obtain the SHA-256 fingerprint of a client certificate stored in the `mtls.crt` file, you can run the following OpenSSL command:
5553

54+
```sh
55+
openssl x509 -noout -fingerprint -sha256 -inform pem -in mtls.crt | cut -d "=" -f 2 | tr -d ':'
5656
```
57+
58+
```txt output
5759
253E08C1AB67EB7630C61734D377D75D5DCCDE2F6E69986C221D66E848B64321
5860
```
5961

@@ -69,5 +71,5 @@ When a request includes a revoked certificate, the `cf.tls_client_auth.cert_revo
6971

7072
:::caution
7173

72-
This check only applies to client certificates issued by the Cloudflare managed CA. Cloudflare currently does not check certificate revocation lists (CRL) for [CAs that have been uploaded](/ssl/client-certificates/byo-ca/).
74+
This check only applies to client certificates issued by the Cloudflare managed CA. Cloudflare currently does not check certificate revocation lists (CRL) for [CAs that have been uploaded](/ssl/client-certificates/byo-ca/).
7375
:::

0 commit comments

Comments
 (0)