Skip to content

Commit 3146ea8

Browse files
committed
mock recursive dns via RPZ
1 parent d286591 commit 3146ea8

2 files changed

Lines changed: 33 additions & 15 deletions

File tree

certbot-ci/certbot_integration_tests/assets/bind-config/conf/named.conf

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,40 @@ options {
55
listen-on { any; };
66
listen-on-v6 { any; };
77

8-
// Not allowing recursion to prevent query leaks to the internet.
9-
// This should be okay for Pebble because it only makes queries to the authoritative
10-
// zone, but perhaps not for Boulder which will do e.g. CAA tree climbing.
11-
// In the latter case, we might need to write an RPZ to do some local responses.
12-
allow-recursion {
13-
none;
14-
};
15-
16-
allow-transfer {
17-
none;
18-
};
19-
20-
allow-update {
21-
none;
22-
};
8+
// We are allowing BIND to service recursive queries, but only in an extremely limimited sense
9+
// where it is entirely disconnected from public DNS:
10+
// - Iterative queries are disabled. Only forwarding to a non-existent forwarder.
11+
// - The only recursive answers we can get (that will not be a SERVFAIL) will come from the
12+
// RPZ "mock-recursion" zone. Effectively this means we are mocking out the entirety of
13+
// public DNS.
14+
allow-recursion { any; }; // BIND will only answer using RPZ if recursion is enabled
15+
forwarders { 192.0.2.254; }; // Nobody is listening, this is TEST-NET-1
16+
forward only; // Do NOT perform iterative queries from the root zone
17+
dnssec-validation no; // Do not bother fetching the root DNSKEY set (performance)
18+
response-policy { // All recursive queries will be served from here.
19+
zone "mock-recursion"
20+
log yes;
21+
} recursive-only no // Allow RPZs to affect authoritative zones too.
22+
qname-wait-recurse no // No real recursion.
23+
nsip-wait-recurse no; // No real recursion.
24+
25+
allow-transfer { none; };
26+
allow-update { none; };
2327
};
2428

2529
key "default-key." {
2630
algorithm hmac-sha512;
2731
secret "91CgOwzihr0nAVEHKFXJPQCbuBBbBI19Ks5VAweUXgbF40NWTD83naeg3c5y2MPdEiFRXnRLJxL6M+AfHCGLNw==";
2832
};
2933

34+
zone "mock-recursion" {
35+
type primary;
36+
file "/var/lib/bind/rpz.mock-recursion";
37+
allow-query {
38+
none;
39+
};
40+
};
41+
3042
zone "example.com." {
3143
type primary;
3244
file "/var/lib/bind/db.example.com";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$TTL 3600
2+
3+
@ SOA ns1.example.test. dummy.example.test. 1 12h 15m 3w 2h
4+
NS ns1.example.test.
5+
6+
_acme-challenge.aliased.example IN CNAME _acme-challenge.example.com.

0 commit comments

Comments
 (0)