acl

package
v0.0.0-...-a18f4d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ALLOW allows authorized queries to recurse.
	ALLOW string = "allow"
	// BLOCK blocks unauthorized queries towards protected DNS zones.
	BLOCK string = "block"
)
View Source
const (
	// QtypeAll is used to match any kinds of DNS records type.
	// NOTE: The value of QtypeAll should be different with other QTYPEs defined in miekg/dns.
	QtypeAll uint16 = dns.TypeANY
)

Variables

View Source
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"})
)
View Source
var (
	// PrivateNets defines all ip addresses reserved for private networks.
	// i.e., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
	PrivateNets = []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"}
)

Functions

This section is empty.

Types

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

Policy defines the ACL policy for DNS queries. A policy performs the specified action (block/allow) on all DNS queries matched by source IP or QTYPE.

type Rule

type Rule struct {
	Zones    []string
	Policies []Policy
}

Rule defines a list of Zones and some ACL policies which will be enforced on them.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL