Skip to content

Commit c790da2

Browse files
committed
tlshd: Add parsing for tag definitions
TLS session tags are defined in files that reside in /etc/tlshd/tags.d/*.{yaml,yml}. On daemon start-up, the tag definitions are read into a data structure that is shared with forked children processes. Unfortunately the libyaml parser is nothing more than a token emitter. A nicer API exists in libcyaml, but that library does not appear to be available in many distributions. Thus the new tag config file parsing code implements a full finite state parser of the session tags files. Session tag configuration errors are reported but are not fatal. Nothing is done with these tags yet, and documentation is added in a subsequent patch. Signed-off-by: Chuck Lever <[email protected]>
1 parent 817db09 commit c790da2

File tree

2 files changed

+376
-1
lines changed

2 files changed

+376
-1
lines changed

man/man7/tls-session-tags.7

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,44 @@ For example:
239239
This blurb defines a filter named "monsters-university".
240240
It uses a wildcard match that looks for "O=Monsters University"
241241
in the "issuer" field of each incoming x.509 certificate.
242+
.SS Tags
243+
The definition of each tag is a YAML mapping that specifies
244+
the unique name of the tag
245+
and
246+
a list of filters, as defined in the Filters mapping,
247+
that all must match for the tag to be assigned to
248+
a TLS session. For example:
249+
250+
tags:
251+
...
252+
ror-mu-chapter:
253+
filter:
254+
- monsters-university
255+
- not fear-tech
256+
- fraternity-ror
257+
...
258+
259+
This defines a tag named "ror-mu-chapter".
260+
The "monsters-university" and "fraternity-ror" filters must
261+
match, and the "fear-tech" filter must not match,
262+
in order for the
263+
.B tlshd
264+
program to assign the
265+
.I ror-mu-chapter
266+
tag to an incoming TLS session.
267+
.SS Handshake completion
268+
Once a TLS handshake is successful, the
269+
.B tlshd
270+
program scans the peer's certificate using the configured filter and
271+
tag definitions.
272+
Any tag matches are attached to the new TLS session and are made
273+
visible to the kernel consumer that is to use that session.
274+
Note that
275+
the session's authentication material,
276+
any filter types,
277+
and
278+
filter names
279+
are not exposed to kernel consumers.
242280
.SH STANDARDS
243281
x.509
244282
.BR

0 commit comments

Comments
 (0)