tls-session-tags(7)
π NAME π
okay bestie, welcome to tls-session-tags β the TLS session tags page π
β¨ (that's tls-session-tags(7) out of the Miscellaneous Information Manual, if you're keeping track π).
This is the one that explains how you get cute little labels stamped onto TLS sessions so the kernel knows who's who. no cap. π·οΈπ¦
β¨ SYNOPSIS β¨
/etc/tlshd/tags.d/
that's it. that's the vibe. one directory, endless power πΈ
π DESCRIPTION π
so, the tlshd program runs a user agent that services TLS handshake requests on behalf of kernel TLS consumers π«Ά. its configuration files live under the /etc/tlshd directory, and they hold the info that tlshd reads when it starts up. these config files are the ones telling tlshd where to find stuff about which trust store and which signing and encryption algorithms are supposed to be used. and like β important β these configuration files are considered a trusted source of information. they're the main character, they don't get questioned π
.
when a peer shows up with an X.509 certificate during a TLS handshake, tlshd is the one responsible for verifying that the certificate was issued by a certificate authority that the receiver recognizes and trusts πβ
. once that verification goes through, the receiver can trust the content of that certificate, including all the info about the peer identity presented in it (e.g., a DNS hostname or IP address, and so on π).
and once a peer's certificate is trusted?? that's when it gets good. tlshd can be configured to scan the fields in the peer's certificate π₯. based on that scan, tlshd can assign tags to the new TLS session that indicate the server recognizes the peer's identity π·οΈπ. for example, tlshd can be configured to look for a specific string in subject fields, and assign tags to TLS sessions where the peer presented a certificate with matching content in that field. kernel consumers can then use those tags to authorize or deny access to resources based on the identity presented in peer certificates. literally access control but make it fashion π
the following sections describe how to configure this facility. buckle up π§
π FORMAT π
TLS session tag definitions are YAML documents stored in files in the /etc/tlshd/tags.d directory π. when it launches, tlshd reads all files in that directory with either the .yml or .yaml extension. heads up though: modifications to the content of these files take effect only when the tlshd program is restarted β so edit, save, restart, slay πβ¨.
tlshd populates two dictionaries from the contents of these files:
filtersβ every filter defined in this dictionary specifies the name of a field in an X.509 certificate, plus the conditions under which the contents of that field are considered a match π.tagsβ each tag is a list of one or more filters (the ones defined in thefiltersdictionary) that all must be matched in order for that tag to get assigned to a new TLS session π·οΈ.
πΈ Filter types πΈ
a filter's type decides which part of the incoming authentication material tlshd examines to figure out if there's a match π. for example, for the x509.tbs.subject filter type, a string argument specifies a simple wildcard pattern that gets matched against an incoming X.509 certificate's subject field. the complete list of filter types lives down in the FILTER TYPE REFERENCE section below ππ.
π FILTER TYPE REFERENCE π
tlshd currently implements the following filter types π«Ά:
x509.cert.signatureAlgorithmβ filters of this type examine an incoming X.509 certificate'ssignatureAlgorithmfield, as defined in RFC 5280, Section 4.1.1.2 π. the filter takes an additional string wildcard pattern, which can be an algorithm name or an algorithm OID.x509.tbs.versionβ filters of this type examine an incoming X.509 certificate'sversionfield, which is part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.1 π. the filter takes an additional numeric value that gets matched against the certificate's version.x509.tbs.serialNumberβ filters of this type examine an incoming X.509 certificate'sserialNumberfield, part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.2 π. the filter takes an additional string wildcard pattern that matches a hexadecimal number.x509.tbs.issuerβ filters of this type examine an incoming X.509 certificate'sissuerfield, part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.4 π. the filter takes an additional string wildcard pattern that matches the distinguished name part of the certificate'sissuerfield.x509.tbs.validity.notBeforeβ filters of this type examine an incoming X.509 certificate's activation time field, part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.5 π. the filter takes a date and time string. it matches when the certificate's activation time is equal to or later than the specified threshold β°. use this one when you want to accept only certificates issued on or after a particular date. no old certs allowed π .x509.tbs.validity.notAfterβ filters of this type examine an incoming X.509 certificate's expiration time field, part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.5 π. the filter takes a date and time string. it matches when the certificate's expiration time is equal to or earlier than the specified threshold β°. use this one to accept only certificates that expire on or before a particular date. expired-and-proud stays OUT π .x509.tbs.subjectβ filters of this type examine an incoming X.509 certificate'ssubjectfield, part of the To-Be-Signed section of the certificate, as defined in RFC 5280, Section 4.1.2.6 π. the filter takes an additional string wildcard pattern that matches the distinguished name part of the certificate'ssubjectfield.x509.extension.keyUsageβ filters of this type examine an incoming X.509 certificate'skeyUsagefield, which is one of the standard certificate extensions π. the filter takes a list of bit names that must all be set in the field for the filter to match. that list contains zero or more of the following bit names:digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement,keyCertSign,cRLSign,encipherOnly, ordecipherOnly. β¨x509.extension.extendedKeyUsageβ filters of this type examine an incoming X.509 certificate'sextendedKeyUsagefield, one of the standard certificate extensions. this filter type is not yet implemented π sorry bestie, it's giving "coming soon", it does nothing yet.x509.derived.fingerprintβ filters of this type locally compute an incoming X.509 certificate's SHA1 and SHA256 fingerprint π«. the filter takes an additional string wildcard pattern that matches the hexadecimal value of either the derived SHA1 or the derived SHA256 fingerprint.x509.derived.selfSignedβ filters of this type match when an incoming X.509 certificate'sissuerandsubjectdistinguished names are exactly equal πͺ.
π¦ Filters π¦
the definition of each filter is a YAML mapping that specifies the unique name of the filter, its filter type, and zero or more specific match arguments to be used π«Ά. for example:
filters:
...
monsters-university:
type: "x509.tbs.issuer"
pattern: "*,O=Monsters University,*"
...
this example defines a filter named "monsters-university" πΉπ. the filter performs a wildcard match for "O=Monsters University" in the issuer field of each incoming X.509 certificate. iconic behavior honestly.
π Tags π
the definition of each tag is a YAML mapping that specifies the unique name of the tag and a list of filters β as defined in the Filters mapping β that all must match for the tag to be assigned to a TLS session π·οΈ.
a filter name can be prefixed with "not " to invert its matching behavior π. when a filter is negated, the tag matches only if that filter does not match. a tag matches when all non-negated filters match and all negated filters do not match. periodt.
for example:
tags:
...
ror-mu-chapter:
filter:
- monsters-university
- not fear-tech
- fraternity-ror
...
this example defines a tag named "ror-mu-chapter" ποΈ. the peer's certificate must satisfy both the "monsters-university" and "fraternity-ror" filter conditions, and must fail to satisfy the "fear-tech" filter condition, in order for tlshd to assign the ror-mu-chapter tag to an incoming TLS session. the way that it's a whole membership check ππ
β¨ Handshake completion β¨
once a TLS handshake is successful π€, tlshd scans the peer's certificate using the configured filter and tag definitions. for each tag whose filter conditions the certificate satisfies, tlshd attaches that tag's name to the new TLS session π·οΈβ¨. and here's the slay part: the kernel consumer receives only the list of matching tag names β the session's authentication material, filter types, and filter names all stay private to tlshd π. gatekeeping, but correctly.
π STANDARDS π
π SEE ALSO π
tlshd(8), tlshd.conf(5) π
π«Ά AUTHOR π«Ά
Chuck Lever π
and that's the whole page bestie, ty for coming to my TED talk πβ¨ this was the Miscellaneous Information Manual's tls-session-tags(7) β dated 28 Dec 2025 π
β mwah, go tag some sessions, ily π
ππ¦
π¦ where this page comes from
- fedora 43: ktls-utils 1.4.0-1.fc43 Β· GPL-2.0-only AND (GPL-2.0-only OR BSD-3-Clause)
- fedora 44: ktls-utils 1.4.0-1.fc44 Β· GPL-2.0-only AND (GPL-2.0-only OR BSD-3-Clause)
- Copyright (c) 2025 Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms