blob: c0bd3325e63cd4e885c1dedfd8cd8128bed13d10 [file] [log] [blame]
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -07001Validator Configuration File Format
2===================================
3
Yingdi Yu4e99f532014-08-25 19:40:57 -07004You can set up a ``Validator`` via a configuration file. Next, we will show you how to
5write a configuration file.
6
7The configuration file consists of **rules** and **trust-anchors** that will be used in
8validation. **Rules** tell the validator how to validate a packet, while **trust-anchors**
9tell the validator which certificates are valid immediately. Here is an example of
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080010configuration file containing two rules and a trust anchor.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070011
12::
13
14 rule
15 {
16 id "Simple Rule"
17 for data
18 filter
19 {
20 type name
21 name /localhost/example
22 relation is-prefix-of
23 }
24 checker
25 {
26 type customized
27 sig-type rsa-sha256
28 key-locator
29 {
30 type name
Alexander Afanasyevc381bca2017-10-15 14:51:49 -040031 name /ndn/edu/ucla/yingdi/KEY/1234
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070032 relation equal
33 }
34 }
35 }
36 rule
37 {
38 id "Testbed Validation Rule"
39 for data
40 checker
41 {
42 type hierarchical
43 sig-type rsa-sha256
44 }
45 }
46 trust-anchor
47 {
48 type file
49 file-name "testbed-trust-anchor.cert"
50 }
51
Davide Pesavento487cc9a2025-05-01 23:32:05 -040052.. important:: The order of rules MATTERS!
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070053
54A rule can be broken into two parts:
55
56- The first part is to qualify packets to which the rule can be
57 applied;
58- The second part is to check whether further validation process is
59 necessary.
60
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080061When a packet is presented for validation, the validator will check the rules one-by-one
62in the configuration file using **for** and **filter** conditions against the packet,
63until finding a rule for which the packet qualifies. After that, the **checker**
64conditions of the matched rule will be used to check the validity of the packet. If the
65packet does not match any rules, it is treated as an invalid packet. Once a packet has
66been matched by a rule, the remaining rules are not applied to the packet (i.e., the
67matched rule "captures" the packet). Therefore, you should always put the most specific
68rule first.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070069
Yingdi Yu4e99f532014-08-25 19:40:57 -070070In the example configuration, the first rule indicates that all the data packets under the
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080071name prefix ``/localhost/example`` must be signed by a certificate whose name (the key
Alexander Afanasyevc381bca2017-10-15 14:51:49 -040072part) is ``/ndn/edu/ucla/yingdi/KEY/1234``. If a packet does not have a name under
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080073prefix ``/localhost/example``, the validator will skip the first rule and apply the second
74rule. The second rule indicates that all other data packets must be validated using the
75hierarchical policy (data name should be prefix or equal to the identity part of the
76certificate name). The example configuration defines that all certificate chains must be
77rooted in the certificate defined in the file "testbed-trust-anchor.cert".
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070078
79Rules in general
80----------------
81
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080082A rule has four properties: **id**, **for**, **filter**, and **checker**.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070083
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080084The **id** property uniquely identifies the rule in the configuration file. As long as
Yingdi Yu4e99f532014-08-25 19:40:57 -070085being unique, any name can be given to a rule, e.g., "Simple Rule", "Testbed Validation
86Rule". A rule must have one and only one **id** property.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070087
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080088A rule is either used to validate a data packet or an interest packet. This information
89is specified in the **for** property, which can be either **data** or **interest**. A
90rule must have exactly one **for** property.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070091
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080092The **filter** property further constrains the packets that can be checked by the
93rule. The filter property is not required in a rule; if omitted, the rule will capture all
94packets passed to it. A rule may contain multiple filters, in this case, a packet
95is captured by the rule only if all filters are satisfied.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070096
Davide Pesavento487cc9a2025-05-01 23:32:05 -040097.. caution:: A packet that satisfies all the filters may not be valid.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070098
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -080099The **checker** property defines the conditions that a matched packet must fulfill to be
Zhiyi Zhang044bb7e2016-06-10 00:02:37 -0700100treated as a valid packet. A rule must have at least one **checker** property. A packet is
101treated as valid if it can pass at least one of the checkers and as invalid when it cannot
102pass any checkers.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700103
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700104Filter Property
105---------------
106
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800107Filter has a **type** property and type-specific properties. Although a rule can contain
108more than one filters, there can be at most one filter of each type.
109
110Currently, only the packet name filter is defined.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700111
112Name Filter
113~~~~~~~~~~~
114
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800115There are two ways to express the conditions on packet name:
116
117- relationship between the packet name and the specified name
118- :doc:`NDN regular expression <utils-ndn-regex>` match.
119
120Name and Relation
121^^^^^^^^^^^^^^^^^
122
123In the first case, two more properties are required: **name** and **relation**. A packet
124can fulfill the condition if the **name** has a **relation** to the packet's name. Three
125types of **relation** has been defined: **equal**, **is-prefix-of**,
126**is-strict-prefix-of**. For example, the filter
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700127
128::
129
130 filter
131 {
132 type name
133 name /localhost/example
134 relation equal
135 }
136
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800137will capture only a packet with the exact name ``/localhost/example``.
138
139The filter
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700140
141::
142
143 filter
144 {
145 type name
146 name /localhost/example
147 relation is-prefix-of
148 }
149
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800150will capture a packet with name ``/localhost/example`` or ``/localhost/example/data``, but
151will not capture a packet with name ``/localhost/another_example``. And the filter
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700152
153::
154
155 filter
156 {
157 type name
158 name /localhost/example
159 relation is-strict-prefix-of
160 }
161
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800162will capture a packet with name ``/localhost/example/data``, but will not capture a packet
Yingdi Yu4e99f532014-08-25 19:40:57 -0700163with name ``/localhost/example``.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700164
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800165NDN Regular Expression Match
166^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167
Yingdi Yu4e99f532014-08-25 19:40:57 -0700168The second way is to specify an :doc:`utils-ndn-regex` that can match the packet. In this
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800169case, only one property **regex** is required. For example, the filter
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700170
171::
172
173 filter
174 {
175 type name
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800176 regex ^<>*<KEY><><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700177 }
178
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800179will capture all certificates.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700180
181Checker Property
182----------------
183
Yingdi Yu4e99f532014-08-25 19:40:57 -0700184Passing all the filters in a rule only indicates that a packet can be checked using the
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800185rule, and it does not necessarily imply that the packet is valid. The validity of a
Yingdi Yu4e99f532014-08-25 19:40:57 -0700186packet is determined by the property **checker**, which defines the conditions that a
187valid packet must fulfill.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700188
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800189Same as **filter**, **checker** has a property **type**. We have defined two types of
190checkers:
191
192- **customized** is a checker that allows customization of the conditions according to specific
193 requirements;
194
195- **hierarchical** is a checker with pre-defined hierarchical trust model.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700196
197Customized Checker
198~~~~~~~~~~~~~~~~~~
199
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400200The customized checker can include optional **sig-type** property, which specifies the acceptable signature
201type. If not specified, the checker will only accept ECDSA signature. Possible values for **sig-type** are:
202
203- **ecdsa-sha256**: ECDSA signature required (default if **sig-type** not specified)
204- **rsa-sha256**: RSA signature required
205- **sha256** (not recommended, as it is not a real signature): SHA256 digest is required
206
207If sig-type is **rsa-sha256** or **ecdsa-sha256**, the customized checker requires
208**key-locator** property. If sig-type is **sha256**, **key-locator** property can be
209specified, but is optional.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700210
211::
212
213 checker
214 {
215 type customized
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400216 sig-type rsa-sha256
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700217 key-locator
218 {
219 ...
220 }
221 }
222
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400223 checker
224 {
225 type customized
226 sig-type sha256
227 }
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700228
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400229The **key-locator** property is a nested configuration property that can appear exactly once
230and specifies conditions on ``KeyLocator``. It requires **type** property that currently
231supports only one value: **name**.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700232
233::
234
235 key-locator
236 {
237 type name
238 ...
239 }
240
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400241``KeyLocator`` conditions can be specified in the same way as the name filter. For example, a
242checker that requires ``SignatureSha256WithRsa`` signature type with ``KeyLocator`` to be exactly
243``/ndn/edu/ucla/yingdi/KEY/1234`` can be written as follows:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700244
245::
246
247 checker
248 {
249 type customized
250 sig-type rsa-sha256
251 key-locator
252 {
253 type name
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400254 name /ndn/edu/ucla/yingdi/KEY/1234
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700255 relation equal
256 }
257 }
258
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400259Similarly, a checker that requires ``SignatureSha256WithEcdsa`` signature with ``KeyLocator``
260that follows a regular expression pattern ``<ndn><>*<KEY><>{1,3}`` can be written as follows:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700261
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400262::
263
264 checker
265 {
266 type customized
267 sig-type ecdsa-sha256
268 key-locator
269 {
270 type name
271 regex <ndn><>*<KEY><>{1,3}
272 relation equal
273 }
274 }
275
276
277In addition, ``KeyLocator`` can be further constrained using information extracted from the
278packet name using the **hyper-relation** property.
279The **hyper-relation** property consists of three parts:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700280
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800281- an NDN regular expression that extracts information from the packet name
282- an NDN regular expression that extracts information from the ``KeyLocator`` name
283- relation from the part extracted from the ``KeyLocator`` name to the one extracted from
284 the packet name
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700285
286For example, a checker:
287
288::
289
290 checker
291 {
292 type customized
293 sig-type rsa-sha256
294 key-locator
295 {
296 type name
297 hyper-relation
298 {
Alexander Afanasyev17d4b932021-03-17 17:58:40 -0400299 k-regex ^(<>*)<KEY><>{1,3}$
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800300 k-expand \\1
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700301 h-relation is-prefix-of
302 p-regex ^(<>*)$
303 p-expand \\1
304
305 }
306 }
307 }
308
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800309requires the packet name must be under the corresponding namespace (identity part) of the
310``KeyLocator`` name.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700311
312Hierarchical Checker
313~~~~~~~~~~~~~~~~~~~~
314
Yingdi Yu4e99f532014-08-25 19:40:57 -0700315As implied by its name, hierarchical checker requires that the packet name must be under
316the namespace of the packet signer. A hierarchical checker:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700317
318::
319
320 checker
321 {
322 type hierarchical
323 sig-type rsa-sha256
324 }
325
326is equivalent to a customized checker:
327
328::
329
330 checker
331 {
332 type customized
333 sig-type rsa-sha256
334 key-locator
335 {
336 type name
337 hyper-relation
338 {
Junxiao Shi5dc75602021-02-19 11:33:00 -0700339 k-regex ^(<>*)<KEY><>{1,3}$
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800340 k-expand \\1
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700341 h-relation is-prefix-of
342 p-regex ^(<>*)$
343 p-expand \\1
344 }
345 }
346 }
347
Alexander Afanasyevd36dd552014-06-30 12:42:46 -0700348.. _validator-conf-trust-anchors:
349
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700350Trust Anchors
351-------------
352
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800353**trust-anchor** is a necessary option in order to properly validate packets. A
354configuration file may contain more than one trust anchors and the order of trust anchors
355does not matter. The structure of trust-anchor is as follows:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700356
357::
358
359 trust-anchor
360 {
361 type file
362 file-name "trusted-signer.cert"
363 }
364 trust-anchor
365 {
366 type base64
367 base64-string "Bv0DGwdG...amHFvHIMDw=="
368 }
369
Yingdi Yu4e99f532014-08-25 19:40:57 -0700370You may also specify a trust-anchor directory. All certificates under this directory are
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800371taken as static trust anchors. For example, if all trust anchors are put into
Yingdi Yu4e99f532014-08-25 19:40:57 -0700372``/usr/local/etc/ndn/keys``.
Yingdi Yub4650652014-04-17 10:19:59 -0700373
374::
375
376 trust-anchor
377 {
378 type dir
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800379 dir /usr/local/etc/ndn/keys
Yingdi Yub4650652014-04-17 10:19:59 -0700380 }
381
Yingdi Yu4e99f532014-08-25 19:40:57 -0700382If certificates under the directory might be changed during runtime, you can set a refresh
Davide Pesavento487cc9a2025-05-01 23:32:05 -0400383period::
Yingdi Yub4650652014-04-17 10:19:59 -0700384
385 trust-anchor
386 {
387 type dir
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800388 dir /usr/local/etc/ndn/keys
Davide Pesavento487cc9a2025-05-01 23:32:05 -0400389 refresh 1h ; refresh certs every hour, other supported units are 'm' (for minutes) and 's' (for seconds)
Yingdi Yub4650652014-04-17 10:19:59 -0700390 }
391
Davide Pesavento487cc9a2025-05-01 23:32:05 -0400392There is also a special trust anchor: ``any``. As long as such a trust anchor is defined
Yingdi Yu4e99f532014-08-25 19:40:57 -0700393in config file, packet validation will be turned off.
Yingdi Yu44d190c2014-04-16 17:05:46 -0700394
Yingdi Yu44d190c2014-04-16 17:05:46 -0700395::
396
397 trust-anchor
398 {
399 type any
400 }
401
Davide Pesavento487cc9a2025-05-01 23:32:05 -0400402.. danger::
403 This type of trust anchor is insecure. You should used it only when you want
404 to disable packet validation temporarily (e.g., debugging code, building a demo).
405
Yingdi Yub4650652014-04-17 10:19:59 -0700406
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700407Example Configuration For NLSR
408------------------------------
409
Yingdi Yu4e99f532014-08-25 19:40:57 -0700410The trust model of NLSR is semi-hierarchical. An example certificate signing hierarchy is:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700411
412::
413
414 root
415 |
416 +--------------+---------------+
417 site1 site2
418 | |
419 +---------+---------+ +
420 operator1 operator2 operator3
421 | | |
422 +-----+-----+ +----+-----+ +-----+-----+--------+
423 router1 router2 router3 router4 router5 router6 router7
424 | | | | | | |
425 + + + + + + +
426 NLSR NSLR NSLR NSLR NSLR NSLR NSLR
427
428However, entities name may not follow the signing hierarchy, for
429example:
430
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700431+------------+-------------------------------------------------------------------------------------+
432| Entity | Identity name and examples |
433+============+=====================================================================================+
434| root | ``/<network>`` |
435| | |
436| | Identity example: ``/ndn`` |
437| | |
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400438| | Certificate name example: ``/ndn/KEY/1/%00/%01`` |
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700439+------------+-------------------------------------------------------------------------------------+
440| site | ``/<network>/<site>`` |
441| | |
442| | Identity example: ``/ndn/edu/ucla`` |
443| | |
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400444| | Certificate name example: ``/ndn/edu/ucla/KEY/2/%00/%01`` |
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700445+------------+-------------------------------------------------------------------------------------+
446| operator | ``/<network>/<site>/%C1.O.N./<operator-id>`` |
447| | |
448| | Identity example: ``/ndn/edu/ucla/%C1.O.N./op1`` |
449| | |
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400450| | Certificate name example: ``/ndn/edu/ucla/%C1.O.N./op1/KEY/3/%00/%01`` |
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700451+------------+-------------------------------------------------------------------------------------+
452| router | ``/<network>/<site>/%C1.O.R./<router-id>`` |
453| | |
454| | Identity example: ``/ndn/edu/ucla/%C1.O.R./rt1`` |
455| | |
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400456| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/KEY/4/%00/%01`` |
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700457+------------+-------------------------------------------------------------------------------------+
458| NLSR | ``/<network>/<site>/%C1.O.R./<router-id>/NLSR`` |
459| | |
460| | Identity example: ``/ndn/edu/ucla/%C1.O.R./rt1/NLSR`` |
461| | |
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400462| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/NLSR/KEY/5/%00/%01`` |
Alexander Afanasyev3aeeaeb2014-04-22 23:34:23 -0700463+------------+-------------------------------------------------------------------------------------+
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700464
465Assume that a typical NLSR data name is
Yingdi Yu4e99f532014-08-25 19:40:57 -0700466``/ndn/edu/ucla/%C1.O.R./rt1/NLSR/LSA/LSType.1/%01``. Then, the exception of naming
467hierarchy is "operator-router". So we can write a configuration file with three rules. The
468first one is a customized rule that capture the normal NLSR data. The second one is a
469customized rule that handles the exception case of the hierarchy (operator->router). And
470the last one is a hierarchical rule that handles the normal cases of the hierarchy.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700471
Yingdi Yu4e99f532014-08-25 19:40:57 -0700472We put the NLSR data rule to the first place, because NLSR data packets are the most
473frequently checked. The hierarchical exception rule is put to the second, because it is
474more specific than the last one.
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700475
476And here is the configuration file:
477
478::
479
480 rule
481 {
482 id "NSLR LSA Rule"
483 for data
484 filter
485 {
486 type name
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400487 regex ^<>*<NLSR><LSA><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700488 }
489 checker
490 {
491 type customized
492 sig-type rsa-sha256
493 key-locator
494 {
495 type name
496 hyper-relation
497 {
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400498 k-regex ^(<>*)<KEY><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700499 k-expand \\1
500 h-relation equal
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400501 p-regex ^(<>*)<NLSR><LSA><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700502 p-expand \\1
503 }
504 }
505 }
506 }
507 rule
508 {
509 id "NSLR Hierarchy Exception Rule"
510 for data
511 filter
512 {
513 type name
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400514 regex ^<>*<%C1.O.R.><><KEY><><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700515 }
516 checker
517 {
518 type customized
519 sig-type rsa-sha256
520 key-locator
521 {
522 type name
523 hyper-relation
524 {
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400525 k-regex ^(<>*)<%C1.O.N.><><KEY><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700526 k-expand \\1
527 h-relation equal
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400528 p-regex ^(<>*)<%C1.O.R.><><KEY><><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700529 p-expand \\1
530 }
531 }
532 }
533 }
534 rule
535 {
536 id "NSLR Hierarchical Rule"
537 for data
538 filter
539 {
540 type name
Alexander Afanasyevc381bca2017-10-15 14:51:49 -0400541 regex ^<>*<KEY><><><>$
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700542 }
543 checker
544 {
545 type hierarchical
546 sig-type rsa-sha256
547 }
548 }
549 trust-anchor
550 {
551 type file
552 file-name "testbed-trust-anchor.cert"
553 }
554
Yingdi Yu4e99f532014-08-25 19:40:57 -0700555Example Configuration For NFD RIB Management
556--------------------------------------------
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700557
Davide Pesavento0530b5b2016-11-07 03:23:58 +0100558Assume `NFD RIB Management <https://redmine.named-data.net/projects/nfd/wiki/RibMgmt>`_
Yingdi Yu4e99f532014-08-25 19:40:57 -0700559allows any valid testbed certificate to register prefix, the configuration file could be
560written as:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700561
562::
563
Alexander Afanasyeve5a19b82017-01-30 22:30:46 -0800564 rule
565 {
566 id "RIB Prefix Registration Command Rule"
567 for interest ; rule for Interests (to validate CommandInterests)
568 filter
569 {
570 type name ; condition on interest name (w/o signature)
571 regex ^[<localhop><localhost>]<nfd><rib>[<register><unregister>]<><><>$ ; prefix before
572 ; SigInfo & SigValue
573 }
574 checker
575 {
576 type customized
577 sig-type rsa-sha256 ; interest must have a rsa-sha256 signature
578 key-locator
579 {
580 type name ; key locator must be the certificate name of the
581 ; signing key
582 regex ^<>*<KEY><><><>$
583 }
584 }
585 checker
586 {
587 type customized
588 sig-type ecdsa-sha256 ; interest must have a ecdsa-sha256 signature
589 key-locator
590 {
591 type name ; key locator must be the certificate name of the
592 ; signing key
593 regex ^<>*<KEY><><><>$
594 }
595 }
596 }
597 rule
598 {
599 id "NDN Testbed Hierarchy Rule"
600 for data ; rule for Data (to validate NDN certificates)
601 filter
602 {
603 type name ; condition on data name
604 regex ^<>*<KEY><><><>$
605 }
606 checker
607 {
608 type hierarchical ; the certificate name of the signing key and
609 ; the data name must follow the hierarchical model
610 sig-type rsa-sha256 ; data must have a rsa-sha256 signature
611 }
612 checker
613 {
614 type hierarchical ; the certificate name of the signing key and
615 ; the data name must follow the hierarchical model
616 sig-type ecdsa-sha256 ; data must have a ecdsa-sha256 signature
617 }
618 }
619 trust-anchor
620 {
621 type file
622 file-name keys/ndn-testbed-root.ndncert.base64
623 }