plugin/acl: adding ability to drop queries (#5722)

Both block and filter actions write responses to the client based upon
the source IP address of the UDP packet containing the query.  An
attacker spoofing the source IP address to that of their target, can
elicit a response to be sent to the victim host, known as DNS
Reflection.  If an attacker is able to elicit a large response from a
relatively small query, with a spoofed source IP address, they are able
to increase the amount of data sent to the victim, known as DNS
Amplification.  Scaling this from one to many queries allows an attacker
to perform an effective Denial of Service (DoS) attack against their
target.

Adding the drop action enables CoreDNS to ignore queries of a given
type or network range from being processed and a response written,
where an operator knows ahead of time, should not originate or be
destined to.

Signed-off-by: rsclarke <hey@rsclarke.dev>

Signed-off-by: rsclarke <hey@rsclarke.dev>
This commit is contained in:
rsclarke 2022-11-01 17:16:55 +08:00 committed by GitHub
parent faaf2b446e
commit ead84e1fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 194 additions and 2 deletions

View file

@ -56,8 +56,10 @@ func parse(c *caddy.Controller) (ACL, error) {
p.action = actionBlock
} else if action == "filter" {
p.action = actionFilter
} else if action == "drop" {
p.action = actionDrop
} else {
return a, c.Errf("unexpected token %q; expect 'allow', 'block', or 'filter'", c.Val())
return a, c.Errf("unexpected token %q; expect 'allow', 'block', 'filter' or 'drop'", c.Val())
}
p.qtypes = make(map[uint16]struct{})