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

Add metric for num.rpz.action #70

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
volumes:
- socket:/var/run/socket:rw
- ./unbound-example.conf:/opt/unbound/etc/unbound/unbound.conf
- ./droplist.zone:/opt/unbound/etc/unbound/droplist.zone
ports:
- "1053:1053/udp"
- "1053:1053/tcp"
Expand Down
2 changes: 2 additions & 0 deletions droplist.zone
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.example.com IN A 127.0.0.1
*.example.net IN A 127.0.0.1
15 changes: 12 additions & 3 deletions unbound-example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ remote-control:
# The rest of this file is standard Unbound configuration
# There's nothing special here.
server:
module-config: "respip validator iterator"
extended-statistics: yes
cache-max-ttl: 86400
cache-min-ttl: 300
directory: "/opt/unbound/etc/unbound"
do-ip4: yes
do-ip6: no
do-ip6: no
do-tcp: yes
do-udp: yes
edns-buffer-size: 1232
Expand Down Expand Up @@ -53,7 +55,7 @@ server:
access-control: 10.0.0.0/8 allow
access-control: fc00::/7 allow
access-control: ::1/128 allow
auto-trust-anchor-file: "var/root.key"
auto-trust-anchor-file: "/opt/unbound/etc/unbound/var/root.key"
chroot: ""
deny-any: yes
harden-algo-downgrade: yes
Expand All @@ -65,7 +67,7 @@ server:
harden-short-bufsize: yes
hide-http-user-agent: no
hide-identity: yes
hide-version: yes
hide-version: no
http-user-agent: "DNS"
identity: "DNS"
private-address: 10.0.0.0/8
Expand All @@ -82,3 +84,10 @@ server:
val-clean-additional: yes
include: /opt/unbound/etc/unbound/a-records.conf
include: /opt/unbound/etc/unbound/srv-records.conf

rpz:
name: unbound_exporter_cloak
zonefile: /opt/unbound/etc/unbound/droplist.zone
rpz-log: yes
rpz-log-name: unbound_exporter_cloak
rpz-action-override: nxdomain
7 changes: 7 additions & 0 deletions unbound_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ var (
prometheus.GaugeValue,
nil,
"^rrset\\.cache\\.count$"),
newUnboundMetric(
"rpz_action_count",
"Total number of triggered Response Policy Zone actions, by type.",
prometheus.CounterValue,
[]string{"type"},
"^num\\.rpz\\.action\\.rpz-([\\w-]+)$",
),
}
)

Expand Down
Loading