]> git.saurik.com Git - apple/network_cmds.git/blame - unbound/testdata/autotrust_valid_use.rpl
network_cmds-596.100.2.tar.gz
[apple/network_cmds.git] / unbound / testdata / autotrust_valid_use.rpl
CommitLineData
89c4ed63
A
1; config options
2server:
3 target-fetch-policy: "0 0 0 0 0"
4 log-time-ascii: yes
5stub-zone:
6 name: "."
7 stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.
8; initial content (say from dig example.com DNSKEY > example.com.key)
9AUTOTRUST_FILE example.com
10example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b}
11example.com. 10800 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}
12AUTOTRUST_END
13CONFIG_END
14
15SCENARIO_BEGIN Test autotrust with using a valid key for validation
16
17; K-ROOT
18RANGE_BEGIN 0 100
19 ADDRESS 193.0.14.129
20ENTRY_BEGIN
21MATCH opcode qname qtype
22ADJUST copy_id copy_query
23REPLY QR AA
24SECTION QUESTION
25. IN NS
26SECTION ANSWER
27. IN NS k.root-servers.net.
28SECTION ADDITIONAL
29k.root-servers.net IN A 193.0.14.129
30ENTRY_END
31
32ENTRY_BEGIN
33MATCH opcode subdomain
34ADJUST copy_id copy_query
35REPLY QR
36SECTION QUESTION
37com. IN NS
38SECTION AUTHORITY
39com. IN NS a.gtld-servers.net.
40SECTION ADDITIONAL
41a.gtld-servers.net. IN A 192.5.6.30
42ENTRY_END
43RANGE_END
44
45; a.gtld-servers.net.
46RANGE_BEGIN 0 100
47 ADDRESS 192.5.6.30
48ENTRY_BEGIN
49MATCH opcode subdomain
50ADJUST copy_id copy_query
51REPLY QR
52SECTION QUESTION
53example.com. IN NS
54SECTION AUTHORITY
55example.com. IN NS ns.example.com.
56SECTION ADDITIONAL
57ns.example.com. IN A 1.2.3.4
58ENTRY_END
59RANGE_END
60
61; ns.example.com. KSK 55582
62RANGE_BEGIN 0 10
63 ADDRESS 1.2.3.4
64ENTRY_BEGIN
65MATCH opcode qname qtype
66ADJUST copy_id
67REPLY QR AA
68SECTION QUESTION
69www.example.com. IN A
70SECTION ANSWER
71www.example.com. 3600 IN A 10.20.30.40
72www.example.com. 3600 IN RRSIG A 5 3 3600 20090924111500 20090821111500 30899 example.com. pYGxVLsWUvOp1wSf0iwPap+JnECfC5GAm1lRqy3YEqecNGld7U7x/5Imo3CerbdZrVptUQs2oH0lcjwYJXMnsw== ;{id = 30899}
73SECTION AUTHORITY
74example.com. 3600 IN NS ns.example.com.
75example.com. 3600 IN RRSIG NS 5 2 3600 20090924111500 20090821111500 30899 example.com. J5wxRq0jgwQL6yy530kvo9cHqNAUHV8IF4dvaYZL0bNraO2Oe6dVXqlJl4+cxNHI2TMsstwFPr2Zz8tv6Az2mQ== ;{id = 30899}
76SECTION ADDITIONAL
77ns.example.com. 3600 IN A 1.2.3.4
78ns.example.com. 3600 IN RRSIG A 5 3 3600 20090924111500 20090821111500 30899 example.com. JsXbS18oyc0zkVaOWGSFdIQuOsZKflT0GraT9afDPoWLCgH4ApF7jNgfJV7Pqy1sTBRajME5IUAhpANwGBuW4A== ;{id = 30899}
79ENTRY_END
80
81ENTRY_BEGIN
82MATCH opcode qname qtype
83ADJUST copy_id
84REPLY QR AA
85SECTION QUESTION
86example.com. IN DNSKEY
87SECTION ANSWER
88; KSK 1
89example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b}
90; ZSK 1
91example.com. 10800 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}
92; signatures
93example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20090924111500 20090821111500 30899 example.com. b/HK231jIQLX8IhlZfup3r0yhpXaasbPE6LzxoEVVvWaTZWcLmeV8jDIcn0qO7Yvs7bIJN20lwVAV0GcHH3hWQ== ;{id = 30899}
94example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20090924111500 20090821111500 55582 example.com. PCHme1QLoULxqjhg5tMlpR0qJlBfstEUVq18TtNoKQe9le1YhJ9caheXcTWoK+boLhXxg9u6Yyvq8FboQh0OjA== ;{id = 55582}
95ENTRY_END
96RANGE_END
97
98; ns.example.com. KSK 55582 and 60946
99RANGE_BEGIN 11 30
100 ADDRESS 1.2.3.4
101ENTRY_BEGIN
102MATCH opcode qname qtype
103ADJUST copy_id
104REPLY QR AA
105SECTION QUESTION
106example.com. IN DNSKEY
107SECTION ANSWER
108; KSK 1
109example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b}
110; KSK 2
111example.com. 10800 IN DNSKEY 257 3 5 AwEAAeiaUiUIpWMfYz5L0sfJTZWnuN9IyBX4em9VjsoqQTsOD1HDQpNb4buvJo7pN2aBCxNS7e0OL8e2mVB6CLZ+8ek= ;{id = 60946 (ksk), size = 512b}
112; ZSK 1
113example.com. 10800 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}
114; signatures
115example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091024111500 20090921111500 30899 example.com. rkaCUpTFPWVu4Om5oMTR+39Mct6ZMs56xrE0rbxMMOokfvIQheIxsAEc5BFJeA/2y5WTewl6diCD6yQXCybrDg== ;{id = 30899}
116example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091024111500 20090921111500 55582 example.com. CoMon+lWPAsUvgfpCTDPx8Zn8dQpky3lu2O6T+oJ2Mat9a/u1YwGhSQHGPn7ZNG/4vKM97tx84sSlUGz3geD1w== ;{id = 55582}
117example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091024111500 20090921111500 60946 example.com. o+Cbs7DcYPYlSLd4hi3vkSVQpXGnKgKSi9MpHGfu1Uahv5190U2DUOxP1du/HOYbf+IHYL8zLbMZjVEG5wgnTg== ;{id = 60946}
118ENTRY_END
119RANGE_END
120
121; probe failures
122RANGE_BEGIN 31 40
123 ADDRESS 1.2.3.4
124ENTRY_BEGIN
125MATCH opcode qname qtype
126ADJUST copy_id
127REPLY QR AA SERVFAIL
128SECTION QUESTION
129example.com. IN DNSKEY
130ENTRY_END
131
132ENTRY_BEGIN
133MATCH opcode qname qtype
134ADJUST copy_id
135REPLY QR AA SERVFAIL
136SECTION QUESTION
137ns.example.com. IN AAAA
138ENTRY_END
139RANGE_END
140
141; ns.example.com. KSK 55582 and 60946 (signatures updated)
142RANGE_BEGIN 41 50
143 ADDRESS 1.2.3.4
144ENTRY_BEGIN
145MATCH opcode qname qtype
146ADJUST copy_id
147REPLY QR AA
148SECTION QUESTION
149ns.example.com. IN A
150SECTION ANSWER
151ns.example.com. 3600 IN A 1.2.3.4
152ns.example.com. 3600 IN RRSIG A 5 3 3600 20090924111500 20090821111500 30899 example.com. JsXbS18oyc0zkVaOWGSFdIQuOsZKflT0GraT9afDPoWLCgH4ApF7jNgfJV7Pqy1sTBRajME5IUAhpANwGBuW4A== ;{id = 30899}
153SECTION AUTHORITY
154example.com. 3600 IN NS ns.example.com.
155example.com. 3600 IN RRSIG NS 5 2 3600 20090924111500 20090821111500 30899 example.com. J5wxRq0jgwQL6yy530kvo9cHqNAUHV8IF4dvaYZL0bNraO2Oe6dVXqlJl4+cxNHI2TMsstwFPr2Zz8tv6Az2mQ== ;{id = 30899}
156SECTION ADDITIONAL
157ENTRY_END
158
159ENTRY_BEGIN
160MATCH opcode qname qtype
161ADJUST copy_id
162REPLY QR AA
163SECTION QUESTION
164ns.example.com. IN AAAA
165SECTION ANSWER
166SECTION AUTHORITY
167example.com. 3600 IN NS ns.example.com.
168example.com. 3600 IN RRSIG NS 5 2 3600 20090924111500 20090821111500 30899 example.com. J5wxRq0jgwQL6yy530kvo9cHqNAUHV8IF4dvaYZL0bNraO2Oe6dVXqlJl4+cxNHI2TMsstwFPr2Zz8tv6Az2mQ== ;{id = 30899}
169SECTION ADDITIONAL
170ns.example.com. 3600 IN A 1.2.3.4
171ns.example.com. 3600 IN RRSIG A 5 3 3600 20090924111500 20090821111500 30899 example.com. JsXbS18oyc0zkVaOWGSFdIQuOsZKflT0GraT9afDPoWLCgH4ApF7jNgfJV7Pqy1sTBRajME5IUAhpANwGBuW4A== ;{id = 30899}
172ENTRY_END
173
174ENTRY_BEGIN
175MATCH opcode qname qtype
176ADJUST copy_id
177REPLY QR AA
178SECTION QUESTION
179example.com. IN DNSKEY
180SECTION ANSWER
181; KSK 1
182example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b}
183; KSK 2
184example.com. 10800 IN DNSKEY 257 3 5 AwEAAeiaUiUIpWMfYz5L0sfJTZWnuN9IyBX4em9VjsoqQTsOD1HDQpNb4buvJo7pN2aBCxNS7e0OL8e2mVB6CLZ+8ek= ;{id = 60946 (ksk), size = 512b}
185; ZSK 1
186example.com. 10800 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}
187; signatures
188example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091124111500 20091018111500 30899 example.com. rkaCUpTFPWVu4Om5oMTR+39Mct6ZMs56xrE0rbxMMOokfvIQheIxsAEc5BFJeA/2y5WTewl6diCD6yQXCybrDg== ;{id = 30899}
189example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091124111500 20091018111500 55582 example.com. v/HJbdpeVMpbhwYXrT1EDGpAFMvEgdKQII1cAbP6o8KHYNKDh8TIJ25/pXe3daEXfej6/Z5kpqJ79okPKUoi1Q== ;{id = 55582}
190example.com. 10800 IN RRSIG DNSKEY 5 2 10800 20091124111500 20091018111500 60946 example.com. HgXol1hdvbomOM1CFRW8qsHd3D0qOnN72EeMHTcpxIBBiuNLKZn4n1M14Voxj3vo0eAMNuG/y7EjQkxKvSsaDA== ;{id = 60946}
191ENTRY_END
192
193ENTRY_BEGIN
194MATCH opcode qname qtype
195ADJUST copy_id
196REPLY QR AA
197SECTION QUESTION
198www.example.com. IN A
199SECTION ANSWER
200www.example.com. 3600 IN A 10.20.30.40
201www.example.com. 3600 IN RRSIG A 5 3 3600 20091124111500 20091018111500 60946 example.com. pI3iwElQXjhje3SnAfwAG/VwdRskQcLdiApbKdUbR7MIsDUpqVjxIUtSIRu/aXNt8EVA8SwZQXNmTYA2SrrBhA== ;{id = 60946}
202ENTRY_END
203
204RANGE_END
205
206; set date/time to Aug 24 07:46:40 (2009).
207STEP 5 TIME_PASSES ELAPSE 1251100000
208STEP 6 TRAFFIC ; the initial probe
209STEP 7 ASSIGN t0 = ${time}
210STEP 8 ASSIGN probe0 = ${range 4800 ${timeout} 5400}
211
212; the auto probing should have been done now.
213STEP 10 CHECK_AUTOTRUST example.com
214FILE_BEGIN
215; autotrust trust anchor file
216;;id: example.com. 1
217;;last_queried: ${$t0} ;;${ctime $t0}
218;;last_success: ${$t0} ;;${ctime $t0}
219;;next_probe_time: ${$t0 + $probe0} ;;${ctime $t0 + $probe0}
220;;query_failed: 0
221;;query_interval: 5400
222;;retry_time: 3600
223example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [ VALID ] ;;count=0 ;;lastchange=${$t0} ;;${ctime $t0}
224FILE_END
225
226; key prepublished. First poll. 30 days later
227STEP 11 TIME_PASSES EVAL ${30*24*3600}
228STEP 12 TRAFFIC
229STEP 13 ASSIGN t1 = ${time}
230STEP 14 ASSIGN probe1 = ${range 4800 ${timeout} 5400}
231STEP 15 CHECK_AUTOTRUST example.com
232FILE_BEGIN
233; autotrust trust anchor file
234;;id: example.com. 1
235;;last_queried: ${$t1} ;;${ctime $t1}
236;;last_success: ${$t1} ;;${ctime $t1}
237;;next_probe_time: ${$t1 + $probe1} ;;${ctime $t1 + $probe1}
238;;query_failed: 0
239;;query_interval: 5400
240;;retry_time: 3600
241example.com. 10800 IN DNSKEY 257 3 5 AwEAAeiaUiUIpWMfYz5L0sfJTZWnuN9IyBX4em9VjsoqQTsOD1HDQpNb4buvJo7pN2aBCxNS7e0OL8e2mVB6CLZ+8ek= ;{id = 60946 (ksk), size = 512b} ;;state=1 [ ADDPEND ] ;;count=1 ;;lastchange=${$t1} ;;${ctime $t1}
242example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [ VALID ] ;;count=0 ;;lastchange=${$t0} ;;${ctime $t0}
243FILE_END
244
245; Second poll. 10 days later
246STEP 21 TIME_PASSES EVAL ${10*24*3600}
247STEP 22 TRAFFIC
248STEP 23 ASSIGN t2 = ${time}
249STEP 24 ASSIGN probe2 = ${range 4800 ${timeout} 5400}
250STEP 25 CHECK_AUTOTRUST example.com
251FILE_BEGIN
252; autotrust trust anchor file
253;;id: example.com. 1
254;;last_queried: ${$t2} ;;${ctime $t2}
255;;last_success: ${$t2} ;;${ctime $t2}
256;;next_probe_time: ${$t2 + $probe2} ;;${ctime $t2 + $probe2}
257;;query_failed: 0
258;;query_interval: 5400
259;;retry_time: 3600
260example.com. 10800 IN DNSKEY 257 3 5 AwEAAeiaUiUIpWMfYz5L0sfJTZWnuN9IyBX4em9VjsoqQTsOD1HDQpNb4buvJo7pN2aBCxNS7e0OL8e2mVB6CLZ+8ek= ;{id = 60946 (ksk), size = 512b} ;;state=1 [ ADDPEND ] ;;count=2 ;;lastchange=${$t1} ;;${ctime $t1}
261example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [ VALID ] ;;count=0 ;;lastchange=${$t0} ;;${ctime $t0}
262FILE_END
263
264; put this almost one hour before expiration so that the next query arrives
265; before the next poll timer.
266; Make this probe fail to keep DNSKEY out of the cache
267; Third poll. 10 days later
268STEP 31 TIME_PASSES EVAL ${ ${20*24*3600} - 3000 }
269STEP 32 TRAFFIC
270STEP 33 ASSIGN t3 = ${time}
271STEP 34 ASSIGN probe3 = ${range 3200 ${timeout} 3600}
272STEP 35 CHECK_AUTOTRUST example.com
273FILE_BEGIN
274; autotrust trust anchor file
275;;id: example.com. 1
276;;last_queried: ${$t2} ;;${ctime $t2}
277;;last_success: ${$t2} ;;${ctime $t2}
278;;next_probe_time: ${$t2 + $probe2} ;;${ctime $t2 + $probe2}
279;;query_failed: 0
280;;query_interval: 5400
281;;retry_time: 3600
282example.com. 10800 IN DNSKEY 257 3 5 AwEAAeiaUiUIpWMfYz5L0sfJTZWnuN9IyBX4em9VjsoqQTsOD1HDQpNb4buvJo7pN2aBCxNS7e0OL8e2mVB6CLZ+8ek= ;{id = 60946 (ksk), size = 512b} ;;state=1 [ ADDPEND ] ;;count=2 ;;lastchange=${$t1} ;;${ctime $t1}
283example.com. 10800 IN DNSKEY 257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [ VALID ] ;;count=0 ;;lastchange=${$t0} ;;${ctime $t0}
284FILE_END
285
286; 3010 seconds later, hold down has lapsed.
287; but the probe timer does not expire yet!
288; key 60946 becomes valid. Use it.
289; check this with a data query.
290STEP 41 TIME_PASSES EVAL ${3010}
291STEP 42 QUERY
292ENTRY_BEGIN
293REPLY RD DO
294SECTION QUESTION
295www.example.com. IN A
296ENTRY_END
297
298; Note the data is signed with the newly valid KSK to make sure it can be used.
299STEP 43 CHECK_ANSWER
300ENTRY_BEGIN
301MATCH all
302REPLY QR RD RA AD DO NOERROR
303SECTION QUESTION
304www.example.com. IN A
305SECTION ANSWER
306www.example.com. 3600 IN A 10.20.30.40
307www.example.com. 3600 IN RRSIG A 5 3 3600 20091124111500 20091018111500 60946 example.com. pI3iwElQXjhje3SnAfwAG/VwdRskQcLdiApbKdUbR7MIsDUpqVjxIUtSIRu/aXNt8EVA8SwZQXNmTYA2SrrBhA== ;{id = 60946}
308ENTRY_END
309
310SCENARIO_END