aboutsummaryrefslogtreecommitdiff
path: root/plugin/acl/setup_test.go
diff options
context:
space:
mode:
authorGravatar George Shammas <georgyo@gmail.com> 2021-02-01 09:52:23 -0500
committerGravatar GitHub <noreply@github.com> 2021-02-01 06:52:23 -0800
commit117a389e40832cdbee69bd9daa04ca35611082ff (patch)
tree93303c8a557e3118aa529a5742053a1a9a47cb05 /plugin/acl/setup_test.go
parentd289b4ea2623dcd0dd13ab7ed88ab764a7408f91 (diff)
downloadcoredns-117a389e40832cdbee69bd9daa04ca35611082ff.tar.gz
coredns-117a389e40832cdbee69bd9daa04ca35611082ff.tar.zst
coredns-117a389e40832cdbee69bd9daa04ca35611082ff.zip
plugin/acl: add the ability to filter records (#4389)
Currently ACLs only allow for allow and block, however it isn't always desirable to set the status code to REFUSED. Often times you want to completely hide the fact that those records even exist. Adding the ability to acl to filter results makes it significantly harder for a third party to know that the records are being masked. Signed-off-by: George Shammas <george@shamm.as>
Diffstat (limited to 'plugin/acl/setup_test.go')
-rw-r--r--plugin/acl/setup_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugin/acl/setup_test.go b/plugin/acl/setup_test.go
index 2bf7e778b..1d25dd7af 100644
--- a/plugin/acl/setup_test.go
+++ b/plugin/acl/setup_test.go
@@ -43,6 +43,13 @@ func TestSetup(t *testing.T) {
false,
},
{
+ "Filter 1",
+ `acl {
+ filter type A net 192.168.0.0/16
+ }`,
+ false,
+ },
+ {
"Whitelist 1",
`acl {
allow type * net 192.168.0.0/16
@@ -154,6 +161,13 @@ func TestSetup(t *testing.T) {
false,
},
{
+ "Filter 1 IPv6",
+ `acl {
+ filter type A net 2001:0db8:85a3:0000:0000:8a2e:0370:7334
+ }`,
+ false,
+ },
+ {
"Whitelist 1 IPv6",
`acl {
allow net 2001:db8:abcd:0012::0/64