From 79f37a1460cc52ce6c63110f4df33316a36af3a5 Mon Sep 17 00:00:00 2001 From: An Xiao Date: Wed, 4 Sep 2019 23:43:45 +0800 Subject: Add plugin ACL for source ip filtering (#3103) * Add plugin ACL for source ip filtering Signed-off-by: An Xiao * Allow all arguments to be optional and support multiple qtypes in a single policy Signed-off-by: An Xiao * Add newline before third party imports Signed-off-by: An Xiao * Use camel instead of underscore in method name Signed-off-by: An Xiao * Start with an upper case letter in t.Errorf() Signed-off-by: An Xiao * Use the qtype parse logic in miekg/dns Signed-off-by: An Xiao * Use third party trie implementation as the ip filter Signed-off-by: An Xiao * Update based on rdrozhdzh's comment Signed-off-by: An Xiao * Change the type of action to int Signed-off-by: An Xiao * Add IPv6 support Signed-off-by: An Xiao * Update plugin.cfg Signed-off-by: An Xiao * Remove file functionality Signed-off-by: An Xiao * Update Signed-off-by: Xiao An * Update README Signed-off-by: Xiao An * remove comments Signed-off-by: Xiao An * update Signed-off-by: Xiao An * Update dependency Signed-off-by: Xiao An * Update Signed-off-by: Xiao An * Update test Signed-off-by: Xiao An * Add OWNERS Signed-off-by: Xiao An * Refactor shouldBlock and skip useless check Signed-off-by: Xiao An * Introduce ActionNone Signed-off-by: Xiao An * Update label name Signed-off-by: Xiao An * Avoid capitalizing private types Signed-off-by: Xiao An --- plugin/acl/metrics.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugin/acl/metrics.go (limited to 'plugin/acl/metrics.go') diff --git a/plugin/acl/metrics.go b/plugin/acl/metrics.go new file mode 100644 index 000000000..442ea2374 --- /dev/null +++ b/plugin/acl/metrics.go @@ -0,0 +1,24 @@ +package acl + +import ( + "github.com/coredns/coredns/plugin" + + "github.com/prometheus/client_golang/prometheus" +) + +var ( + // RequestBlockCount is the number of DNS requests being blocked. + RequestBlockCount = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: "dns", + Name: "request_block_count_total", + Help: "Counter of DNS requests being blocked.", + }, []string{"server", "zone"}) + // RequestAllowCount is the number of DNS requests being Allowed. + RequestAllowCount = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: "dns", + Name: "request_allow_count_total", + Help: "Counter of DNS requests being allowed.", + }, []string{"server"}) +) -- cgit v1.2.3