: Advanced Rule Settings Using Regular Expressions
Focus
Focus

Advanced Rule Settings Using Regular Expressions

Table of Contents

Advanced Rule Settings Using Regular Expressions

When configuring a new issuing template, you can use regular expressions (regex), such as .* and [a-z], to create complex and powerful patterns in any of the following fields on the New Issuing Template page:
  • Common Name
  • DNS SAN
  • IP Addresses SAN
  • URI SAN
  • Email Addresses SAN

Examples of Common Uses

Common Name example that allows all subdomains of acme.com:
.*[.]acme[.]com
DNS SAN example that allows all subdomains except wildcards for acme.com:
[a-z-A-Z-0-9]*[.]acme.com
IP Addresses SAN example that ensures the value complies with RFC 1918 (IPv4 private address):
^(10|172[.](1[6-9]|2[0-9]|3[0-1])|192[.]168)[.].*
URI SAN example that allows any subdomain of acme.com that starts with https://, ldaps://, or spiffe://:
(https|ldaps|spiffe)://.*\.acme\.com
Email Addresses SAN example that allows all addresses that end in acme.com:
.*@acme[.]com

Regular Expression Syntax Reference

SyntaxDescriptionExampleMatches
*Matches any number of characters including none..*[.]acme[.]comsite-1.acme.com, www.acme.com, \*.acme.com
.Matches a single character..?team[.]acme[.]comateam.acme.com, bteam.acme.com, 1team.acme.com
[abc]Matches one character given in the bracket.[tmb]ike[.]acme[.]comtike.acme.com, mike.acme.com, bike.acme.com
[a-z]Matches one character from the range given in the bracket.[w-z]-net[.]acme[.]comw‑net.acme.com, x‑net.acme.com, y‑net.acme.com, z‑net.acme.com
[^0-9]Matches one character outside the range given in the bracket.[^0-3][yz][.]acme[.]com4y.acme.com, 5z.acme.com, 6y.acme.com