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: function to clear/remove EDNS Options #14920

Open
pieterlexis-tomtom opened this issue Dec 3, 2024 · 0 comments
Open

dnsdist: function to clear/remove EDNS Options #14920

pieterlexis-tomtom opened this issue Dec 3, 2024 · 0 comments

Comments

@pieterlexis-tomtom
Copy link

pieterlexis-tomtom commented Dec 3, 2024

  • Program: dnsdist
  • Issue type: Feature request

Short description

dnsdist already supports adding and modifying EDNS options in queries (e.g. DNSQuestion:setEDNSOption). There is no way, however, to remove an option from the EDNS Options. It would be great to have one.

Usecase

There might be options one does not wish to pass to a backend as it might not be properly supported, or one does not want the backend to receive these options for any other reason.

Description

Having a function e.g. like DNSQuestion:clearEDNSOptions([TABLE]) that removes the options specified in TABLE. if TABLE is non-existent, wipe all options.

e.g.

function removeAllOptions(dq)
  dq:clearEDNSOptions()
  return DNSAction.None, ""
end

function removeCookieOption(dq)
  dq:clearEDNSOptions({EDNSOptionCode.COOKIE})
  return DNSAction.None, ""
end

-- dumb matching rules
addAction(HTTPPathRule('/foo'), LuaAction(removeCookieOption))
addAction(OpcodeRule(DNSOpcode.NOTIFY), LuaAction(removeAllOptions))

Another option would be to have a ClearEDNSOptionsAction([TABLE]), but I think this functionality is sufficiently advanced to hide behind a Lua(Response)Action.

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