Skip to content

Commit 4432ac9

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 b4c6ae8 commit 4432ac9

File tree

2 files changed

+341
-1
lines changed

2 files changed

+341
-1
lines changed

src/tlshd/etc/tls-session-tags.man

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

0 commit comments

Comments
 (0)