diff --git a/dns/Makefile b/dns/Makefile index 83a25830788b..688e151d3864 100644 --- a/dns/Makefile +++ b/dns/Makefile @@ -1,248 +1,249 @@ COMMENT = Domain Name Service tools SUBDIR += adns SUBDIR += adsuck SUBDIR += amass SUBDIR += ares SUBDIR += axfr2acl SUBDIR += bind-tools SUBDIR += bind9-devel SUBDIR += bind911 SUBDIR += bind916 SUBDIR += bindgraph SUBDIR += blocky SUBDIR += bundy SUBDIR += c-ares SUBDIR += cli53 SUBDIR += coredns SUBDIR += crossip SUBDIR += curvedns SUBDIR += ddclient SUBDIR += ddns SUBDIR += denominator SUBDIR += dhisd SUBDIR += djbdns SUBDIR += djbdns-tools SUBDIR += dlint SUBDIR += dnrd SUBDIR += dns-ui SUBDIR += dns2blackhole SUBDIR += dns2tcp SUBDIR += dns_balance SUBDIR += dnsblast SUBDIR += dnscap SUBDIR += dnscheckengine SUBDIR += dnscontrol SUBDIR += dnscrypt-proxy2 SUBDIR += dnscrypt-wrapper SUBDIR += dnsdbck SUBDIR += dnsdbflex SUBDIR += dnsdbq SUBDIR += dnsdist SUBDIR += dnsenum SUBDIR += dnsflood SUBDIR += dnsforwarder SUBDIR += dnshistory SUBDIR += dnsjava SUBDIR += dnsmasq SUBDIR += dnsmasq-devel SUBDIR += dnsmax-perl SUBDIR += dnsperf SUBDIR += dnsproxy SUBDIR += dnsrecon SUBDIR += dnsreflector SUBDIR += dnstable SUBDIR += dnstable-convert SUBDIR += dnstop SUBDIR += dnstracer SUBDIR += dnsutl SUBDIR += dnsviz SUBDIR += dnswalk SUBDIR += dnswall SUBDIR += doc SUBDIR += dog SUBDIR += doggo SUBDIR += doh-proxy SUBDIR += dq SUBDIR += drool SUBDIR += dsc SUBDIR += dsp SUBDIR += dynip SUBDIR += encrypted-dns-server SUBDIR += erlang-idna SUBDIR += fastresolve SUBDIR += firedns SUBDIR += flamethrower SUBDIR += fpdns SUBDIR += gdnsd2 SUBDIR += gdnsd3 SUBDIR += gen6dns SUBDIR += getdns SUBDIR += hesiod SUBDIR += hetzner_ddns SUBDIR += hostdb SUBDIR += idnkit SUBDIR += idnkit2 SUBDIR += inadyn SUBDIR += ipcheck SUBDIR += ironsides SUBDIR += kadnode SUBDIR += kf5-kdnssd SUBDIR += knock SUBDIR += knot-resolver SUBDIR += knot3 SUBDIR += knot3-lib SUBDIR += ldapdns SUBDIR += ldns SUBDIR += libasr SUBDIR += libasr-devel SUBDIR += libbind SUBDIR += libdjbdns SUBDIR += libidn SUBDIR += libidn2 SUBDIR += libmicrodns SUBDIR += libnspsl SUBDIR += libpsl SUBDIR += linux-c7-libasyncns SUBDIR += mDNSResponder_nss SUBDIR += maradns SUBDIR += mdnsd SUBDIR += mydns SUBDIR += mydns-ng SUBDIR += namesilo_ddns SUBDIR += nextdns SUBDIR += noip SUBDIR += nsd SUBDIR += nslint SUBDIR += nsnotifyd SUBDIR += nsping SUBDIR += nss_mdns SUBDIR += nss_resinit SUBDIR += opendnssec2 SUBDIR += openresolv SUBDIR += p5-AnyEvent-CacheDNS SUBDIR += p5-AnyEvent-DNS-EtcHosts SUBDIR += p5-App-DSC-DataTool SUBDIR += p5-BIND-Conf_Parser SUBDIR += p5-BIND-Config-Parser SUBDIR += p5-DNS-Config SUBDIR += p5-DNS-EasyDNS SUBDIR += p5-DNS-Ldns SUBDIR += p5-DNS-Zone SUBDIR += p5-DNS-ZoneParse SUBDIR += p5-DNS-nsdiff SUBDIR += p5-DSC SUBDIR += p5-Data-Validate-Domain SUBDIR += p5-IO-Async-Resolver-DNS SUBDIR += p5-Mozilla-PublicSuffix SUBDIR += p5-Net-Amazon-Route53 SUBDIR += p5-Net-Bonjour SUBDIR += p5-Net-DNS SUBDIR += p5-Net-DNS-Async SUBDIR += p5-Net-DNS-Check SUBDIR += p5-Net-DNS-Codes SUBDIR += p5-Net-DNS-Lite SUBDIR += p5-Net-DNS-Match SUBDIR += p5-Net-DNS-RR-SRV-Helper SUBDIR += p5-Net-DNS-Resolver-Mock SUBDIR += p5-Net-DNS-Resolver-Programmable SUBDIR += p5-Net-DNS-SEC SUBDIR += p5-Net-DNS-TestNS SUBDIR += p5-Net-DNS-ToolKit SUBDIR += p5-Net-DNS-Zone-Parser SUBDIR += p5-Net-DNS-ZoneFile-Fast SUBDIR += p5-Net-DNSBL-MultiDaemon SUBDIR += p5-Net-DNSBL-Statistics SUBDIR += p5-Net-DRI SUBDIR += p5-Net-Domain-ExpireDate SUBDIR += p5-Net-Domain-TLD SUBDIR += p5-Net-LibIDN SUBDIR += p5-Net-LibIDN2 SUBDIR += p5-Net-Nslookup SUBDIR += p5-Net-RBLClient SUBDIR += p5-Net-RNDC SUBDIR += p5-POE-Component-Client-DNS SUBDIR += p5-POE-Component-Client-DNS-Recursive SUBDIR += p5-POE-Component-Client-DNSBL SUBDIR += p5-POE-Component-Resolver SUBDIR += p5-POE-Component-Server-DNS SUBDIR += p5-POE-Filter-DNS-TCP SUBDIR += p5-Tie-DNS SUBDIR += p5-URBL-Prepare SUBDIR += packetq SUBDIR += pdnsd SUBDIR += pear-File_DNS SUBDIR += pear-Horde_Idna SUBDIR += pear-Net_DNS2 SUBDIR += powerdns SUBDIR += powerdns-recursor + SUBDIR += prometheus-dnssec-exporter SUBDIR += public_suffix_list SUBDIR += py-adns SUBDIR += py-aiodns SUBDIR += py-cloudflare SUBDIR += py-dns-crawler SUBDIR += py-dns-lexicon SUBDIR += py-dnspython SUBDIR += py-dnspython2 SUBDIR += py-easyzone SUBDIR += py-idna SUBDIR += py-idna_ssl SUBDIR += py-ldns SUBDIR += py-localzone SUBDIR += py-namebench SUBDIR += py-ns1-python SUBDIR += py-publicsuffix SUBDIR += py-publicsuffix2 SUBDIR += py-publicsuffixlist SUBDIR += py-py3dns SUBDIR += py-pybonjour SUBDIR += py-pycares SUBDIR += py-pydnstable SUBDIR += py-pywdns SUBDIR += py-tld SUBDIR += py-tldextract SUBDIR += qmdnsengine SUBDIR += radns SUBDIR += rbldnsd SUBDIR += rbllookup SUBDIR += rbllookup-ng SUBDIR += rdap SUBDIR += renewck SUBDIR += rpsl2acl SUBDIR += rubygem-dnsruby SUBDIR += rubygem-gitlab-net-dns SUBDIR += rubygem-google-apis-dns_v1 SUBDIR += rubygem-google-cloud-dns SUBDIR += rubygem-idn-ruby SUBDIR += rubygem-net-dns SUBDIR += rubygem-public_suffix SUBDIR += rubygem-public_suffix_service SUBDIR += rubygem-resolv SUBDIR += rubygem-resolv-replace SUBDIR += rubygem-simpleidn SUBDIR += rubygem-validates_hostname SUBDIR += rubygem-zonefile SUBDIR += samba-nsupdate SUBDIR += scavenge SUBDIR += sheerdns SUBDIR += sleuth SUBDIR += subfinder SUBDIR += tinystats SUBDIR += totd SUBDIR += udns SUBDIR += unbound SUBDIR += updatedd SUBDIR += utdns SUBDIR += validns SUBDIR += vhostcname SUBDIR += vizone SUBDIR += void-zones-tools SUBDIR += walker SUBDIR += wdns SUBDIR += whoseip SUBDIR += wrapsrv SUBDIR += yadifa SUBDIR += zkt SUBDIR += zonenotify .include diff --git a/dns/prometheus-dnssec-exporter/Makefile b/dns/prometheus-dnssec-exporter/Makefile new file mode 100644 index 000000000000..2d71a7d54762 --- /dev/null +++ b/dns/prometheus-dnssec-exporter/Makefile @@ -0,0 +1,51 @@ +PORTNAME= prometheus-dnssec-exporter +DISTVERSION= g20181110 +CATEGORIES= dns + +MAINTAINER= philip@FreeBSD.org +COMMENT= DNSSEC exporter for Prometheus + +LICENSE= MIT + +USES= go +USE_GITHUB= yes +USE_RC_SUBR= dnssec_exporter + +GH_ACCOUNT= chrj +GH_TAGNAME= caa7d89 +GH_TUPLE= beorn7:perks:v1.0.1:perks/vendor/github.com/beorn7/perks \ + cespare:xxhash:v1.1.0:xxhash/vendor/github.com/cespare/xxhash \ + cespare:xxhash:v2.1.2:xxhash/vendor/github.com/cespare/xxhash/v2 \ + golang:crypto:089bfa567519:crypto/vendor/golang.org/x/crypto \ + golang:net:4a448f8816b3:net/vendor/golang.org/x/net \ + golang:sys:39c9dd37992c:sys/vendor/golang.org/x/sys \ + golang:protobuf:v1.5.2:protobuf/vendor/github.com/golang/protobuf \ + matttproud:golang_protobuf_extensions:v1.0.1:extensions/vendor/github.com/matttproud/golang_protobuf_extensions \ + miekg:dns:v1.0.12:dns/vendor/github.com/miekg/dns \ + naoina:go-stringutil:v0.1.0:go_stringutil/vendor/github.com/naoina/go-stringutil \ + naoina:toml:v0.1.1:toml/vendor/github.com/naoina/toml \ + prometheus:client_golang:v1.11.0:client_golang/vendor/github.com/prometheus/client_golang \ + prometheus:client_model:v0.2.0:client_model/vendor/github.com/prometheus/client_model \ + prometheus:common:v0.32.1:common/vendor/github.com/prometheus/common \ + prometheus:procfs:v0.7.3:procfs/vendor/github.com/prometheus/procfs \ + protocolbuffers:protobuf-go:v1.27.1:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} + +USERS= nobody +GROUPS= nobody + +SUB_FILES= pkg-message +SUB_LIST= USERS=${USERS} GROUPS=${GROUPS} + +PLIST_FILES= bin/prometheus-dnssec-exporter \ + "@sample etc/prometheus-dnssec-checks.sample" + +post-patch: + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/main.go + +post-install: + ${INSTALL_DATA} ${WRKSRC}/config.sample \ + ${STAGEDIR}${PREFIX}/etc/prometheus-dnssec-checks.sample + +.include diff --git a/dns/prometheus-dnssec-exporter/distinfo b/dns/prometheus-dnssec-exporter/distinfo new file mode 100644 index 000000000000..fed8a6d05622 --- /dev/null +++ b/dns/prometheus-dnssec-exporter/distinfo @@ -0,0 +1,33 @@ +TIMESTAMP = 1635830663 +SHA256 (chrj-prometheus-dnssec-exporter-g20211102-caa7d89_GH0.tar.gz) = f31bae782197c302777757f28993358aec40922ac7c5f7737886a3739c15891a +SIZE (chrj-prometheus-dnssec-exporter-g20211102-caa7d89_GH0.tar.gz) = 6359 +SHA256 (beorn7-perks-v1.0.1_GH0.tar.gz) = 98db84bb0224a26094e6adba91b7ee7a1a7ace28cb648d818f8e779e6a19f825 +SIZE (beorn7-perks-v1.0.1_GH0.tar.gz) = 10867 +SHA256 (cespare-xxhash-v2.1.2_GH0.tar.gz) = 471399cfcf0b1bd188add8d34435b91e7011cedbfe76e29687803a9d74320352 +SIZE (cespare-xxhash-v2.1.2_GH0.tar.gz) = 11244 +SHA256 (golang-crypto-089bfa567519_GH0.tar.gz) = 2ed1af12d13ad0cfe08ac49d51dfad4b8d7f5e4693fbddfa3ef53bd80c9555ab +SIZE (golang-crypto-089bfa567519_GH0.tar.gz) = 1734789 +SHA256 (golang-net-4a448f8816b3_GH0.tar.gz) = 83961440fb234cd01f1c1ae945cec6cae35fdab6c7b085820e79ea90926e2a9d +SIZE (golang-net-4a448f8816b3_GH0.tar.gz) = 1262428 +SHA256 (golang-sys-39c9dd37992c_GH0.tar.gz) = e6a83d750fadf594d79e4656aa27226b8bd97c55d227b4162995c598a21ff284 +SIZE (golang-sys-39c9dd37992c_GH0.tar.gz) = 1222118 +SHA256 (golang-protobuf-v1.5.2_GH0.tar.gz) = 088cc0f3ba18fb8f9d00319568ff0af5a06d8925a6e6cb983bb837b4efb703b3 +SIZE (golang-protobuf-v1.5.2_GH0.tar.gz) = 171702 +SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b +SIZE (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184 +SHA256 (miekg-dns-v1.0.12_GH0.tar.gz) = d58efc343a82d27938d9976e8d922229be264e6260a68da65e6fb4973cb41362 +SIZE (miekg-dns-v1.0.12_GH0.tar.gz) = 1315036 +SHA256 (naoina-go-stringutil-v0.1.0_GH0.tar.gz) = 0d9d4e4d8d1112e7ac7a5ea6089bdf18585a22274802bcac6ef5f02aa2c43edc +SIZE (naoina-go-stringutil-v0.1.0_GH0.tar.gz) = 6136 +SHA256 (naoina-toml-v0.1.1_GH0.tar.gz) = 5f0875fb6eb8ed9683f925329c05cdbaa809a1ec9b676c43ea14899c25462fee +SIZE (naoina-toml-v0.1.1_GH0.tar.gz) = 41259 +SHA256 (prometheus-client_golang-v1.11.0_GH0.tar.gz) = a3bc3312bde4182e507042ca0e7ca88aac6656bbf8d516d732e34c3f14bb612a +SIZE (prometheus-client_golang-v1.11.0_GH0.tar.gz) = 168706 +SHA256 (prometheus-client_model-v0.2.0_GH0.tar.gz) = 4ab1be9cdfa702d7f49beeb09a256bcc6a2aad55e8a0a37e7732a46934264e12 +SIZE (prometheus-client_model-v0.2.0_GH0.tar.gz) = 10986 +SHA256 (prometheus-common-v0.32.1_GH0.tar.gz) = de06f354e24dec3bfeba9a3bd43bd3170b4231dfff3cd338b688a6e8c8050af6 +SIZE (prometheus-common-v0.32.1_GH0.tar.gz) = 146585 +SHA256 (prometheus-procfs-v0.7.3_GH0.tar.gz) = 5514e8b18c38b6376a84c623d59735d4eefb61fb3a14eb1f45e0a4c848f14a2b +SIZE (prometheus-procfs-v0.7.3_GH0.tar.gz) = 178957 +SHA256 (protocolbuffers-protobuf-go-v1.27.1_GH0.tar.gz) = 3ec41a8324431e72f85e0dc0c2c098cc14c3cb1ee8820996c8f46afca2d65609 +SIZE (protocolbuffers-protobuf-go-v1.27.1_GH0.tar.gz) = 1278521 diff --git a/dns/prometheus-dnssec-exporter/files/dnssec_exporter.in b/dns/prometheus-dnssec-exporter/files/dnssec_exporter.in new file mode 100644 index 000000000000..38c5d9a84034 --- /dev/null +++ b/dns/prometheus-dnssec-exporter/files/dnssec_exporter.in @@ -0,0 +1,63 @@ +#!/bin/sh + +# PROVIDE: dnssec_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# dnssec_exporter_enable (bool): Set to NO by default +# Set it to YES to enable prometheus-dnssec-exporter +# dnssec_exporter_user (string): Set user to run dnssec_exporter +# Default is "%%USERS%%" +# dnssec_exporter_group (string): Set group to run prometheus-dnssec-exporter +# Default is "%%GROUPS%%" +# dnssec_exporter_log_file (string): Set file that prometheus-dnssec-exporter will log to +# Default is "/var/log/dnssec_exporter.log" +# dnssec_exporter_resolvers (string): Set resolvers to use (comma separated) +# Default is "9.9.9.9:53" +# dnssec_exporter_timeout (string): Set timeout for network operations +# Default is 10s +# dnssec_exporter_bind (string): Set address to listen on +# Default is localhost:9204 +# dnssec_exporter_args (string): Set additional command line arguments +# Default is "" + +. /etc/rc.subr + +name=dnssec_exporter +rcvar=dnssec_exporter_enable + +load_rc_config $name + +: ${dnssec_exporter_enable:=NO} +: ${dnssec_exporter_user:=%%USERS%%} +: ${dnssec_exporter_group:=%%GROUPS%%} +: ${dnssec_exporter_bind="localhost:9204"} +: ${dnssec_exporter_resolvers="9.9.9.9:53"} +: ${dnssec_exporter_timeout="10s"} +: ${dnssec_exporter_log_file=/var/log/dnssec_exporter.log} + +pidfile=/var/run/dnssec_exporter.pid +command=/usr/sbin/daemon +procname="%%PREFIX%%/bin/prometheus-dnssec-exporter" +command_args="-p ${pidfile} /usr/bin/env ${procname} \ + -listen-address ${dnssec_exporter_bind} \ + -resolvers ${dnssec_exporter_resolvers} \ + -timeout ${dnssec_exporter_timeout} \ + ${dnssec_exporter_args} > ${dnssec_exporter_log_file} 2>&1" + +start_precmd=dnssec_exporter_startprecmd + +dnssec_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${dnssec_exporter_user} -g ${dnssec_exporter_group} /dev/null ${pidfile}; + fi + if [ ! -f "${dnssec_exporter_log_file}" ]; then + install -o ${dnssec_exporter_user} -g ${dnssec_exporter_group} -m 640 /dev/null ${dnssec_exporter_log_file}; + fi +} + +run_rc_command "$1" diff --git a/dns/prometheus-dnssec-exporter/files/patch-main.go b/dns/prometheus-dnssec-exporter/files/patch-main.go new file mode 100644 index 000000000000..ac59d3105a65 --- /dev/null +++ b/dns/prometheus-dnssec-exporter/files/patch-main.go @@ -0,0 +1,11 @@ +--- main.go.orig 2021-11-02 05:13:52 UTC ++++ main.go +@@ -17,7 +17,7 @@ import ( + ) + + var addr = flag.String("listen-address", ":9204", "Prometheus metrics port") +-var conf = flag.String("config", "/etc/dnssec-checks", "Configuration file") ++var conf = flag.String("config", "%%PREFIX%%/etc/prometheus-dnssec-checks", "Configuration file") + var resolvers = flag.String("resolvers", "8.8.8.8:53,1.1.1.1:53", "Resolvers to use (comma separated)") + var timeout = flag.Duration("timeout", 10*time.Second, "Timeout for network operations") + diff --git a/dns/prometheus-dnssec-exporter/files/pkg-message.in b/dns/prometheus-dnssec-exporter/files/pkg-message.in new file mode 100644 index 000000000000..cf3f16683af0 --- /dev/null +++ b/dns/prometheus-dnssec-exporter/files/pkg-message.in @@ -0,0 +1,17 @@ +[ +{ type: install + message: <