Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: add a Rule Selector to match DoT rules #14060

Open
franklouwers opened this issue Apr 11, 2024 · 3 comments
Open

dnsdist: add a Rule Selector to match DoT rules #14060

franklouwers opened this issue Apr 11, 2024 · 3 comments

Comments

@franklouwers
Copy link
Contributor

  • Program: dnsdist
  • Issue type: Feature request

Short description

A selector which matches DoT (and DoT only) packets should exist, so I can do the following:

addAction(DOTRule('.*'), LuaAction(dot_handling))

Usecase

A single dnsdist instance can handle multiple "transport mechanisms" of the DNS protocol: udp/53, tcp/53, DoH, DoQ, DoT, some of these wrapped in Proxy Protocol capsules.

As a dns operator, I might want to handle some of those transport mechanisms differently than others on the same node.

For most of those, I can use a proper Selection Rule in combination with an addAction() to apply a certain function or behaviour.

Selectors exist for DoH (-variants) using HTTPHeaderRule(), for EDNS options, for the Proxy Protocol etc.

However, there is currently no way to select only DoT traffic.

Description

The closest thing would be SNIRule(), but that matches both DoT and DoH.

We would use DSTPortRule() to target only the DoT pool, but properly selecting DoT would of course be better.

Alternative would be to send all traffic to a rule, and use dq:getProtocol() and string-matching to branch out to different functions.

@rgacogne
Copy link
Member

I agree a rule to match on the incoming protocol would be useful, perhaps something like: IncomingProtocolRule(protocol), with the protocol as a (case-insensitive) string.

I'm not sure I understand what .* represents in your example?

@franklouwers
Copy link
Contributor Author

Could be regexp match on the SNI, but just on the protocol would be enough...

@rgacogne
Copy link
Member

Understood, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants