Skip to content

Commit be1d079

Browse files
[API Shield] Update mTLS example from cert SHA-256 to cert issuer SKI (#19722)
--------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent b67f1cd commit be1d079

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ The second expression uses the `http.request.uri.path` field, combined with the
4141

4242
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.
4343

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.
44+
For enhanced security, Cloudflare recommends that you validate the issuer Subject Key Identifier (SKI) hash alongside the verified certificate field. This ensures that only requests presenting a valid client certificate with a specific issuer are allowed.
4545

4646
You can implement this by using an expression similar to the following:
4747

4848
```txt
49-
not (cf.tls_client_auth.cert_verified and cf.tls_client_auth.cert_fingerprint_sha256 eq "253E08C1AB67EB7630C61734D377D75D5DCCDE2F6E69986C221D66E848B64321")
49+
not (cf.tls_client_auth.cert_verified and cf.tls_client_auth.cert_issuer_ski eq "A5AC554235DBA6D963B9CDE0185CFAD6E3F55E9F")
5050
```
5151

52-
To obtain the SHA-256 fingerprint of a client certificate stored in the `mtls.crt` file, you can run the following OpenSSL command:
52+
To obtain the issuer Subject Key Identifier (SKI) hash of a client certificate stored in the `mtls.crt` file, you can run the following OpenSSL command:
5353

5454
```sh
55-
openssl x509 -noout -fingerprint -sha256 -inform pem -in mtls.crt | cut -d "=" -f 2 | tr -d ':'
55+
openssl x509 -noout -ext authorityKeyIdentifier -in mtls.crt | tail -n1 | tr -d ': '
5656
```
5757

5858
```txt output
59-
253E08C1AB67EB7630C61734D377D75D5DCCDE2F6E69986C221D66E848B64321
59+
A5AC554235DBA6D963B9CDE0185CFAD6E3F55E9F
6060
```
6161

6262
### Check for revoked certificates

0 commit comments

Comments
 (0)