Skip to content

Commit a22f2b2

Browse files
authored
Merge pull request #676 from cybozu-go/backport-1.26-dnssec
Backport #675 to enable DNSSEC validation
2 parents 8f156a8 + 241bb66 commit a22f2b2

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

docs/k8s.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ CoreDNS.
5555

5656
For other domain names such as `www.google.com`, node-local DNS cache servers can be
5757
configured to send queries to upstream DNS servers defined in [cluster.yml](./cluster.md).
58+
CKE validates the integrity of the replies using DNSSEC validation.
5859

5960
## Certificates for admission webhooks
6061

images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
ToolsImage = Image("quay.io/cybozu/cke-tools:1.26.0")
1616
PauseImage = Image("quay.io/cybozu/pause:3.9.0.1")
1717
CoreDNSImage = Image("quay.io/cybozu/coredns:1.10.1.1")
18-
UnboundImage = Image("quay.io/cybozu/unbound:1.17.1.4")
18+
UnboundImage = Image("ghcr.io/cybozu/unbound:1.18.0.2")
1919
UnboundExporterImage = Image("quay.io/cybozu/unbound_exporter:0.4.1.5")
2020
)
2121

mtest/kubernetes_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ func testKubernetes() {
149149
}
150150
return nil
151151
}).Should(Succeed())
152+
153+
Eventually(func() error {
154+
stdout, stderr, err := kubectl("get", "service", "-n="+namespace, "httpd", "-o", "jsonpath='{.spec.clusterIP}'")
155+
if err != nil {
156+
return fmt.Errorf("%v: stderr=%s", err, stderr)
157+
}
158+
ip := string(stdout)
159+
160+
_, stderr, err = kubectl("exec", "-n="+namespace, "client", "getent", "hosts", ip)
161+
if err != nil {
162+
return fmt.Errorf("%v: stderr=%s", err, stderr)
163+
}
164+
return nil
165+
}).Should(Succeed())
152166
})
153167

154168
It("updates unbound config", func() {
@@ -236,7 +250,7 @@ func testKubernetes() {
236250
return nil
237251
}).Should(Succeed())
238252

239-
By("querying www.google.com using node DNS from ubuntu pod")
253+
By("querying www.cybozu.com using node DNS from ubuntu pod")
240254
_, stderr, err = kubectl("run", "-n="+namespace, "--image=quay.io/cybozu/ubuntu:22.04", "--restart=Never",
241255
"client", "--", "pause")
242256
Expect(err).NotTo(HaveOccurred(), "stderr: %s", stderr)
@@ -245,6 +259,12 @@ func testKubernetes() {
245259
return err
246260
}).Should(Succeed())
247261

262+
By("querying www.dnssec-failed.org using node DNS from ubuntu pod")
263+
Consistently(func() error {
264+
_, _, err := kubectl("exec", "-n="+namespace, "client", "getent", "hosts", "www.dnssec-failed.org")
265+
return err
266+
}).WithTimeout(time.Second * 5).WithPolling(time.Second * 1).ShouldNot(Succeed())
267+
248268
By("getting metrics from unbound_exporter")
249269
Eventually(func() error {
250270
stdout, _, err := kubectl("exec", "-n=kube-system", "daemonset/node-dns", "-c", "unbound", "--", "curl", "-sSf", "http://127.0.0.1:9167/metrics")

op/nodedns/nodedns.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ server:
6969
local-zone: "29.172.in-addr.arpa." transparent
7070
local-zone: "30.172.in-addr.arpa." transparent
7171
local-zone: "31.172.in-addr.arpa." transparent
72+
trust-anchor-file: "/usr/local/unbound/etc/unbound/root.key"
73+
domain-insecure: "{{ .Domain }}"
74+
domain-insecure: "10.in-addr.arpa."
75+
domain-insecure: "168.192.in-addr.arpa."
76+
domain-insecure: "16.172.in-addr.arpa."
77+
domain-insecure: "17.172.in-addr.arpa."
78+
domain-insecure: "18.172.in-addr.arpa."
79+
domain-insecure: "19.172.in-addr.arpa."
80+
domain-insecure: "20.172.in-addr.arpa."
81+
domain-insecure: "21.172.in-addr.arpa."
82+
domain-insecure: "22.172.in-addr.arpa."
83+
domain-insecure: "23.172.in-addr.arpa."
84+
domain-insecure: "24.172.in-addr.arpa."
85+
domain-insecure: "25.172.in-addr.arpa."
86+
domain-insecure: "26.172.in-addr.arpa."
87+
domain-insecure: "27.172.in-addr.arpa."
88+
domain-insecure: "28.172.in-addr.arpa."
89+
domain-insecure: "29.172.in-addr.arpa."
90+
domain-insecure: "30.172.in-addr.arpa."
91+
domain-insecure: "31.172.in-addr.arpa."
7292
remote-control:
7393
control-enable: yes
7494
control-interface: {{ if .LocalControl }} /var/run/unbound/unbound.sock {{ else }} 127.0.0.1 {{ end }}

static/resources.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)