Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
14aa0c5d
Commit
14aa0c5d
authored
Aug 04, 2020
by
Mark Andrews
Committed by
Michał Kępień
Aug 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
parent
5bf457e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
bin/tests/system/nsupdate/ns1/named.conf.in
bin/tests/system/nsupdate/ns1/named.conf.in
+6
-0
bin/tests/system/nsupdate/tests.sh
bin/tests/system/nsupdate/tests.sh
+31
-4
No files found.
bin/tests/system/nsupdate/ns1/named.conf.in
View file @
14aa0c5d
...
...
@@ -42,6 +42,11 @@ key restricted.example.nil {
secret "1234abcd8765";
};
key zonesub-key.example.nil {
algorithm hmac-md5;
secret "1234subk8765";
};
include "ddns.key";
zone "example.nil" {
...
...
@@ -50,6 +55,7 @@ zone "example.nil" {
check-integrity no;
check-mx ignore;
update-policy {
grant zonesub-key.example.nil zonesub TXT;
grant ddns-key.example.nil subdomain example.nil ANY;
grant restricted.example.nil subdomain restricted.example.nil ANY;
};
...
...
bin/tests/system/nsupdate/tests.sh
View file @
14aa0c5d
...
...
@@ -430,7 +430,7 @@ EOF
# this also proves that the server is still running.
$DIG
$DIGOPTS
+tcp +noadd +nosea +nostat +noquest +nocmd +norec example.
\
@10.53.0.3 nsec3param
>
dig.out.ns3.
$n
||
ret
=
1
grep
"ANSWER: 0"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
grep
"ANSWER: 0
,
"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
grep
"flags:[^;]* aa[ ;]"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
[
$ret
=
0
]
||
{
echo_i
"failed"
;
status
=
1
;
}
...
...
@@ -445,7 +445,7 @@ EOF
$DIG
$DIGOPTS
+tcp +noadd +nosea +nostat +noquest +nocmd +norec nsec3param.test.
\
@10.53.0.3 nsec3param
>
dig.out.ns3.
$n
||
ret
=
1
grep
"ANSWER: 1"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
grep
"ANSWER: 1
,
"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
grep
"3600.*NSEC3PARAM"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
grep
"flags:[^;]* aa[ ;]"
dig.out.ns3.
$n
>
/dev/null
||
ret
=
1
[
$ret
=
0
]
||
{
echo_i
"failed"
;
status
=
1
;
}
...
...
@@ -462,7 +462,7 @@ EOF
_ret
=
1
for
i
in
0 1 2 3 4 5 6 7 8 9
;
do
$DIG
$DIGOPTS
+tcp +norec +time
=
1 +tries
=
1 @10.53.0.3 nsec3param.test. NSEC3PARAM
>
dig.out.ns3.
$n
||
_ret
=
1
if
grep
"ANSWER: 2"
dig.out.ns3.
$n
>
/dev/null
;
then
if
grep
"ANSWER: 2
,
"
dig.out.ns3.
$n
>
/dev/null
;
then
_ret
=
0
break
fi
...
...
@@ -487,7 +487,7 @@ EOF
_ret
=
1
for
i
in
0 1 2 3 4 5 6 7 8 9
;
do
$DIG
$DIGOPTS
+tcp +norec +time
=
1 +tries
=
1 @10.53.0.3 nsec3param.test. NSEC3PARAM
>
dig.out.ns3.
$n
||
_ret
=
1
if
grep
"ANSWER: 1"
dig.out.ns3.
$n
>
/dev/null
;
then
if
grep
"ANSWER: 1
,
"
dig.out.ns3.
$n
>
/dev/null
;
then
_ret
=
0
break
fi
...
...
@@ -665,6 +665,33 @@ $DIG $DIGOPTS +tcp @10.53.0.1 example.nil TXT > dig.out.2.test$n || ret=1
grep
"TXT.*everywhere"
dig.out.2.test
$n
>
/dev/null
&&
ret
=
1
[
$ret
=
0
]
||
{
echo_i
"failed"
;
status
=
1
;
}
n
=
`
expr
$n
+ 1
`
ret
=
0
echo_i
"check that 'update-policy zonesub' is properly enforced (
$n
)"
# grant zonesub-key.example.nil zonesub TXT;
# the A record update should be rejected as it is not in the type list
$NSUPDATE
-d
<<
END
> nsupdate.out1-
$n
2>&1 && ret=1
server 10.53.0.1
${
PORT
}
key zonesub-key.example.nil 1234subk8765
update add zonesub.example.nil 0 IN A 1.2.3.4
send
END
$DIG
$DIGOPTS
+tcp @10.53.0.1 zonesub.example.nil A
>
dig.out.1.test
$n
||
ret
=
1
grep
"status: REFUSED"
nsupdate.out1-
$n
>
/dev/null
||
ret
=
1
grep
"ANSWER: 0,"
dig.out.1.test
$n
>
/dev/null
||
ret
=
1
# the TXT record update should be accepted as it is in the type list
$NSUPDATE
-d
<<
END
> nsupdate.out2-
$n
2>&1 || ret=1
server 10.53.0.1
${
PORT
}
key zonesub-key.example.nil 1234subk8765
update add zonesub.example.nil 0 IN TXT everywhere.
send
END
$DIG
$DIGOPTS
+tcp @10.53.0.1 zonesub.example.nil TXT
>
dig.out.2.test
$n
||
ret
=
1
grep
"status: REFUSED"
nsupdate.out2-
$n
>
/dev/null
&&
ret
=
1
grep
"ANSWER: 1,"
dig.out.2.test
$n
>
/dev/null
||
ret
=
1
grep
"TXT.*everywhere"
dig.out.2.test
$n
>
/dev/null
||
ret
=
1
[
$ret
=
0
]
||
{
echo_i
"failed"
;
status
=
1
;
}
n
=
`
expr
$n
+ 1
`
ret
=
0
echo_i
"check that changes to the DNSKEY RRset TTL do not have side effects (
$n
)"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment