00001 # $Id: __init__.py 2511 2009-06-09 20:49:09Z sra $ 00002 00003 # Copyright (C) 2009 Internet Systems Consortium ("ISC") 00004 # 00005 # Permission to use, copy, modify, and distribute this software for any 00006 # purpose with or without fee is hereby granted, provided that the above 00007 # copyright notice and this permission notice appear in all copies. 00008 # 00009 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 00010 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00011 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 00012 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00013 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00014 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00015 # PERFORMANCE OF THIS SOFTWARE. 00016 00017 # Portions copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN") 00018 # 00019 # Permission to use, copy, modify, and distribute this software for any 00020 # purpose with or without fee is hereby granted, provided that the above 00021 # copyright notice and this permission notice appear in all copies. 00022 # 00023 # THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH 00024 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00025 # AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT, 00026 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00027 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00028 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00029 # PERFORMANCE OF THIS SOFTWARE. 00030 00031 00032 # This file exists to tell Python that this the content of this 00033 # directory constitute a Python package. Since we're not doing 00034 # anything exotic, this file doesn't need to contain any code, but 00035 # since its existance defines the package, it's as sensible a place as 00036 # any to put the Doxygen mainpage. 00037 00038 # The "usage" text for irbe_cli in the OPERATIONS section is generated 00039 # automatically by running the program with its --help command. 00040 # Should do the same with the other programs. Don't yet have a sane 00041 # way to automate options in config files, though. Would be nice. 00042 00043 ## @mainpage RPKI Engine Reference Manual 00044 # 00045 # This collection of Python modules implements a prototype of the 00046 # RPKI Engine. This is a work in progress. 00047 # 00048 # See http://viewvc.hactrn.net/subvert-rpki.hactrn.net/ for code, 00049 # design documents, a text mirror of portions of APNIC's Wiki, etc. 00050 # 00051 # The RPKI Engine is an implementation of the production-side tools 00052 # for generating certificates, CRLs, and ROAs. The 00053 # <a href="http://viewvc.hactrn.net/subvert-rpki.hactrn.net/rcynic/">relying party tools</a> 00054 # are a separate (and much simpler) package. 00055 # 00056 # The Subversion repository for the entire project is available for 00057 # (read-only) anonymous access at http://subvert-rpki.hactrn.net/. 00058 # 00059 # The documentation you're reading is generated automatically by 00060 # Doxygen from comments and documentation in 00061 # <a href="http://viewvc.hactrn.net/subvert-rpki.hactrn.net/rpkid/rpki/">the code</a>. 00062 # 00063 # Besides the automatically-generated code documentation, this manual 00064 # also includes documentation of the overall package: 00065 # 00066 # @li The @subpage Installation "installation instructions" 00067 # @li The @subpage Operation "operation instructions" 00068 # @li A description of the @subpage Left-right "left-right protocol" 00069 # @li A description of the @subpage Publication "publication protocol" 00070 # @li A description of the @subpage bpki-model "BPKI model" 00071 # used to secure the up-down, left-right, and %publication protocols 00072 # @li A description of the several @subpage sql-schemas "SQL database schemas" 00073 # @li Some suggestions for @subpage further-reading "further reading" 00074 # 00075 # This work was funded from 2006 through 2008 by <a 00076 # href="http://www.arin.net/">ARIN</a>, in collaboration with the 00077 # other Regional Internet Registries. Current work is funded by DHS. 00078 00079 ## @page further-reading Further Reading 00080 # 00081 # If you're interested in this package you might also be interested 00082 # in: 00083 # 00084 # @li <a href="http://viewvc.hactrn.net/subvert-rpki.hactrn.net/rcynic/">The rcynic validation tool</a> 00085 # @li <a href="http://www.hactrn.net/opaque/rcynic.html">A live sample of rcynic's summary output</a> 00086 # @li <a href="http://mirin.apnic.net/resourcecerts/wiki/">APNIC's Wiki</a> 00087 # @li <a href="http://mirin.apnic.net/trac/">APNIC's project Trac instance</a> 00088 00089 ## @page Installation Installation Guide 00090 # 00091 # Preliminary installation instructions for rpkid et al. These are the 00092 # production-side RPKI tools, for Internet Registries (RIRs, LIRs, etc). 00093 # See the "rcynic" program for relying party tools. 00094 # 00095 # rpkid is a set of Python modules supporting generation and maintenance 00096 # of resource certificates. Most of the code is in the rpkid/rpki/ 00097 # directory. rpkid itself is a relatively small program that calls the 00098 # library modules. There are several other programs that make use of 00099 # the same libraries, as well as a collection of test programs. 00100 # 00101 # At present the package is intended to be run out of its build 00102 # directory. Setting up proper installation in a system area using the 00103 # Python distutils package would likely not be very hard but has not yet 00104 # been done. 00105 # 00106 # Note that initial development of this code has been on FreeBSD, so 00107 # installation will probably be easiest on FreeBSD. 00108 # 00109 # Before attempting to build the package, you need to install any 00110 # missing prerequisites. Note that the Python code requires Python 00111 # version 2.5. rpkid et al are mostly self-contained, but do require 00112 # a small number of external packages to run. 00113 # 00114 # <ul> 00115 # <li> 00116 # <a href="http://codespeak.net/lxml/">http://codespeak.net/lxml/</a>. 00117 # lxml in turn requires the Gnome LibXML2 C libraries. 00118 # <ul> 00119 # <li>FreeBSD: /usr/ports/devel/py-lxml</li> 00120 # <li>Fedora: python-lxml.i386</li> 00121 # </ul> 00122 # </li> 00123 # <li> 00124 # <a href="http://sourceforge.net/projects/mysql-python/">http://sourceforge.net/projects/mysql-python/</a>. 00125 # MySQLdb in turn requires MySQL client and server. rpkid et al have 00126 # been tested with MySQL 5.0 and 5.1. 00127 # <ul> 00128 # <li>FreeBSD: /usr/ports/databases/py-MySQLdb</li> 00129 # <li>Fedora: MySQL-python.i386</li> 00130 # </ul> 00131 # </li> 00132 # </ul> 00133 # 00134 # rpkid et al also make heavy use of a modified copy of the Python 00135 # OpenSSL Wrappers (POW) package, but this copy has enough modifications 00136 # and additions that it's included in the subversion tree. 00137 # 00138 # The next step is to build the OpenSSL and POW binaries. At present 00139 # the OpenSSL code is just a copy of the stock OpenSSL 0.9.8g release, 00140 # compiled with special options to enable RFC 3779 support that ISC 00141 # wrote under previous contract to ARIN. The POW (Python OpenSSL 00142 # Wrapper) library is an extended copy of the stock POW release. 00143 # 00144 # To build these, cd to the top-level directory in the distribution and 00145 # type "make". 00146 # 00147 # @verbatim 00148 # $ cd $top 00149 # $ make 00150 # @endverbatim 00151 # 00152 # This should automatically build everything, in the right order, 00153 # including staticly linking the POW extension module with the OpenSSL 00154 # library to provide RFC 3779 support. 00155 # 00156 # You will also need a MySQL installation. This code was developed 00157 # using MySQL 5.1 and has been tested with MySQL 5.0 and 5.1. 00158 # 00159 # The architecture is intended to support hardware signing modules 00160 # (HSMs), but the code to support them has not been written. 00161 # 00162 # At this point, you should have all the necessary software installed. 00163 # You will probably want to test it. All tests should be run from the 00164 # rpkid/ directory. The test suite requires a few more external 00165 # packages, only one of which is Python code. 00166 # 00167 # <ul> 00168 # <li> 00169 # <a href="http://pyyaml.org/">http://pyyaml.org/</a>. 00170 # testpoke.py (an up-down protocol command line test client) and 00171 # testbed.py (a test harness) use PyYAML. 00172 # <ul> 00173 # <li>FreeBSD: /usr/ports/devel/py-yaml</li> 00174 # </ul> 00175 # </li> 00176 # <li> 00177 # <a href="http://xmlsoft.org/XSLT/">http://xmlsoft.org/XSLT/</a>. 00178 # Some of the test code uses xsltproc, from the Gnome LibXSLT 00179 # package. 00180 # <ul> 00181 # <li>FreeBSD: /usr/ports/textproc/libxslt</li> 00182 # </ul> 00183 # </li> 00184 # <li> 00185 # <a href="http://w3m.sourceforge.net/">http://w3m.sourceforge.net/</a>. 00186 # testbed.py uses w3m to display the summary output from rcynic. 00187 # Nothing terrible will happen if w3m isn't available, testbed.py 00188 # will just complain about it being missing and won't display 00189 # rcynic's output. 00190 # <ul> 00191 # <li>FreeBSD: /usr/ports/www/w3m</li> 00192 # </ul> 00193 # </li> 00194 # </ul> 00195 # 00196 # Some of the tests require MySQL databases to store their data. To set 00197 # up all the databases that the tests will need, run the SQL commands in 00198 # rpkid/testbed.sql. The MySQL command line client is usually the 00199 # easiest way to do this, eg: 00200 # 00201 # @verbatim 00202 # $ cd $top/rpkid 00203 # $ mysql -u root -p <testbed.sql 00204 # @endverbatim 00205 # 00206 # To run the tests, run "make all-tests": 00207 # 00208 # @verbatim 00209 # $ cd $top/rpkid 00210 # $ make all-tests 00211 # @endverbatim 00212 # 00213 # If nothing explodes, your installation is probably ok. Any Python 00214 # backtraces in the output indicate a problem. 00215 # 00216 # There's a last set of tools that only developers should need, as 00217 # they're only used when modifying schemas or regenerating the 00218 # documentation. These tools are listed here for completeness. 00219 # 00220 # <ul> 00221 # <li> 00222 # <a href="http://www.doxygen.org/">http://www.doxygen.org/</a>. 00223 # Doxygen in turn pulls in several other tools, notably Graphviz, 00224 # pdfLaTeX, and Ghostscript. 00225 # <ul> 00226 # <li>FreeBSD: /usr/ports/devel/doxygen</li> 00227 # </ul> 00228 # </li> 00229 # <li> 00230 # <a href="http://lynx.isc.org/current/">http://lynx.isc.org/current/</a>. 00231 # The documentation build process uses xsltproc and Lynx to dump 00232 # flat text versions of a few critical documentation pages. 00233 # <ul> 00234 # <li>FreeBSD: /usr/ports/www/lynx</li> 00235 # </ul> 00236 # </li> 00237 # <li> 00238 # <a href="http://www.thaiopensource.com/relaxng/trang.html">http://www.thaiopensource.com/relaxng/trang.html</a>. 00239 # Trang is used to convert RelaxNG schemas from the human-readable 00240 # "compact" form to the XML form that LibXML2 understands. Trang in 00241 # turn requires Java. 00242 # <ul> 00243 # <li>FreeBSD: /usr/ports/textproc/trang</li> 00244 # </ul> 00245 # </li> 00246 # <li> 00247 # <a href="http://search.cpan.org/dist/SQL-Translator/">http://search.cpan.org/dist/SQL-Translator/</a>. 00248 # SQL-Translator, also known as "SQL Fairy", includes code to parse 00249 # an SQL schema and dump a description of it as Graphviz input. 00250 # SQL Fairy in turn requires Perl. 00251 # </li> 00252 # </ul> 00253 00254 ## @page Operation Operation Guide 00255 # 00256 # Preliminary operation instructions for rpkid et al. These are the 00257 # production-side RPKI tools, for Internet Registries (RIRs, LIRs, etc). 00258 # See rcynic/README for relying party tools. 00259 # 00260 # @warning 00261 # rpkid is still in development, and the code changes more often than 00262 # the hand-maintained portions of this documentation. The following 00263 # text was reasonably accurate at the time it was written but may be 00264 # obsolete by the time you read it. 00265 # 00266 # At present the package is intended to be run out of the @c rpkid/ 00267 # directory. 00268 # 00269 # In addition to the library routines in the @c rpkid/rpki/ directory, 00270 # the package includes the following programs: 00271 # 00272 # @li @c rpkid.py: 00273 # The main RPKI engine daemon. 00274 # 00275 # @li @c pubd.py: 00276 # The publication engine daemon. 00277 # 00278 # @li @c rootd.py: 00279 # A separate daemon for handling the root of an RPKI 00280 # certificate tree. This is essentially a stripped down 00281 # version of rpkid with no SQL database, no left-right 00282 # protocol implementation, and only the parent side of 00283 # the up-down protocol. It's separate because the root 00284 # is a special case in several ways and it was simpler 00285 # to keep the special cases out of the main daemon. 00286 # 00287 # @li @c irdbd.py: 00288 # A sample implementation of an IR database daemon. 00289 # rpkid calls into this to perform lookups via the 00290 # left-right protocol. 00291 # 00292 # @li @c irbe_cli.py: 00293 # A command-line client for the left-right control 00294 # protocol. 00295 # 00296 # @li @c cross_certify.py: 00297 # A BPKI cross-certification tool. 00298 # 00299 # @li @c irbe-setup.py: 00300 # An example of a script to set up the mappings between 00301 # the IRDB and rpkid's own database, using the 00302 # left-right control protocol. 00303 # 00304 # @li @c cronjob.py: 00305 # A trivial HTTP client used to drive rpkid cron events. 00306 # 00307 # @li @c testbed.py: 00308 # A test tool for running a collection of rpkid and irdb 00309 # instances under common control, driven by a unified 00310 # test script. 00311 # 00312 # @li @c testpoke.py: 00313 # A simple client for the up-down protocol, mostly 00314 # compatable with APNIC's rpki_poke.pl tool. 00315 # 00316 # Most of these programs take configuration files in a common format 00317 # similar to that used by the OpenSSL command line tool. The test 00318 # programs also take input in YAML format to drive the tests. Runs of 00319 # the testbed.py test tool will generate a fairly complete set 00320 # configuration files which may be useful as examples. 00321 # 00322 # Basic operation consists of creating the appropriate MySQL databases, 00323 # starting rpkid, pubd, rootd, and irdbd, using the left-right control 00324 # protocol to set up rpkid's internal state, and setting up a cron job 00325 # to invoke rpkid's cron action at regular intervals. All other 00326 # operations should occur either as a result of cron events or as a 00327 # result of incoming left-right and up-down protocol requests. 00328 # 00329 # Note that the full event-driven model for rpkid hasn't yet been 00330 # implemented. The design is intended to allow an arbitrary number of 00331 # hosted RPKI engines to run in a single rpkid instance, but without the 00332 # event-driven tasking model one must set up a separate rpkid instance 00333 # for each hosted RPKI engine. 00334 # 00335 # At present the daemon programs all run in foreground, that is, if one 00336 # wants them to run in background one must do so manually, eg, using 00337 # Bourne shell syntax: 00338 # 00339 # @verbatim 00340 # $ python whatever.py & 00341 # $ echo >whatever.pid "$!" 00342 # @endverbatim 00343 # 00344 # All of the daemons use syslog. At present they all set LOG_PERROR, so 00345 # all logging also goes to stderr. 00346 # 00347 # 00348 # @section rpkid rpkid.py 00349 # 00350 # rpkid is the main RPKI engine daemon. Configuration of rpkid is a 00351 # two step process: a %config file to bootstrap rpkid to the point 00352 # where it can speak using the @link Left-right left-right protocol, 00353 # @endlink followed by dynamic configuration via the left-right 00354 # protocol. In production use the latter stage would be handled by 00355 # the IRBE stub; for test and develoment purposes it's handled by the 00356 # irbe_cli.py command line interface or by the testbed.py test 00357 # framework. 00358 # 00359 # rpkid stores dynamic data in an SQL database, which must have been 00360 # created for it, as explained in the @link Installation installation 00361 # guide. @endlink 00362 # 00363 # The default %config file is rpkid.conf, start rpkid with "-c filename" 00364 # to choose a different %config file. All options are in the section 00365 # "[rpkid]". Certificates, keys, and trust anchors may be in either DER 00366 # or PEM format. 00367 # 00368 # %Config file options: 00369 # 00370 # @li @c startup-message: 00371 # String to %log on startup, useful when 00372 # debugging a collection of rpkid instances at 00373 # once. 00374 # 00375 # @li @c sql-username: 00376 # Username to hand to MySQL when connecting to 00377 # rpkid's database. 00378 # 00379 # @li @c sql-database: 00380 # MySQL's database name for rpkid's database. 00381 # 00382 # @li @c sql-password: 00383 # Password to hand to MySQL when connecting to 00384 # rpkid's database. 00385 # 00386 # @li @c bpki-ta: 00387 # Name of file containing BPKI trust anchor. 00388 # All BPKI certificate verification within rpkid 00389 # traces back to this trust anchor. 00390 # 00391 # @li @c rpkid-cert: 00392 # Name of file containing rpkid's own BPKI EE 00393 # certificate. 00394 # 00395 # @li @c rpkid-key: 00396 # Name of file containing RSA key corresponding 00397 # to rpkid-cert. 00398 # 00399 # @li @c irbe-cert: 00400 # Name of file containing BPKI certificate used 00401 # by IRBE when talking to rpkid. 00402 # 00403 # @li @c irdb-cert: 00404 # Name of file containing BPKI certificate used 00405 # by irdbd. 00406 # 00407 # @li @c irdb-url: 00408 # Service URL for irdbd. Must be a %https:// URL. 00409 # 00410 # @li @c server-host: 00411 # Hostname or IP address on which to listen for 00412 # HTTPS connections. Current default is 00413 # INADDR_ANY (IPv4 0.0.0.0); this will need to 00414 # be hacked to support IPv6 for production. 00415 # 00416 # @li @c server-port: 00417 # TCP port on which to listen for HTTPS 00418 # connections. 00419 # 00420 # 00421 # @section pubd pubd.py 00422 # 00423 # pubd is the publication daemon. It implements the server side of 00424 # the publication protocol, and is used by rpkid to publish the 00425 # certificates and other objects that rpkid generates. 00426 # 00427 # pubd is separate from rpkid for two reasons: 00428 # 00429 # @li The hosting model allows entities which choose to run their own 00430 # copies of rpkid to publish their output under a common 00431 # publication point. In general, encouraging shared publication 00432 # services where practical is a good thing for relying parties, 00433 # as it will speed up rcynic synchronization time. 00434 # 00435 # @li The publication server has to run on (or at least close to) the 00436 # publication point itself, which in turn must be on a publically 00437 # reachable server to be useful. rpkid, on the other hand, need 00438 # only be reachable by the IRBE and its children in the RPKI tree. 00439 # rpkid is a much more complex piece of software than pubd, so in 00440 # some situations it might make sense to wrap tighter firewall 00441 # constraints around rpkid than would be practical if rpkid and 00442 # pubd were a single program. 00443 # 00444 # pubd stores dynamic data in an SQL database, which must have been 00445 # created for it, as explained in the installation guide. pubd also 00446 # stores the published objects themselves as disk files in a 00447 # configurable location which should correspond to an appropriate 00448 # module definition in rsync.conf. 00449 # 00450 # The default %config file is pubd.conf, start pubd with "-c 00451 # filename" to choose a different %config file. ALl options are in 00452 # the section "[pubd]". Certifiates, keys, and trust anchors may be 00453 # either DER or PEM format. 00454 # 00455 # %Config file options: 00456 # 00457 # @li @c sql-username: 00458 # Username to hand to MySQL when connecting to 00459 # pubd's database. 00460 # 00461 # @li @c sql-database: 00462 # MySQL's database name for pubd's database. 00463 # 00464 # @li @c sql-password: 00465 # Password to hand to MySQL when connecting to 00466 # pubd's database. 00467 # 00468 # @li @c bpki-ta: 00469 # Name of file containing master BPKI trust 00470 # anchor for pubd. All BPKI validation in pubd 00471 # traces back to this trust anchor. 00472 # 00473 # @li @c irbe-cert: 00474 # Name of file containing BPKI certificate used 00475 # by IRBE when talking to pubd. 00476 # 00477 # @li @c pubd-cert: 00478 # Name of file containing BPKI certificate used 00479 # by pubd. 00480 # 00481 # @li @c pubd-key: 00482 # Name of file containing RSA key corresponding 00483 # to @c pubd-cert. 00484 # 00485 # @li @c server-host: 00486 # Hostname or IP address on which to listen for 00487 # HTTPS connections. Current default is 00488 # INADDR_ANY (IPv4 0.0.0.0); this will need to 00489 # be hacked to support IPv6 for production. 00490 # 00491 # @li @c server-port: 00492 # TCP port on which to listen for HTTPS 00493 # connections. 00494 # 00495 # @li @c publication-base: 00496 # Path to base of filesystem tree where pubd 00497 # should store publishable objects. Default is 00498 # "publication/". 00499 # 00500 # 00501 # @section rootd rootd.py 00502 # 00503 # rootd is a stripped down implmenetation of (only) the server side of 00504 # the up-down protocol. It's a separate program because the root 00505 # certificate of an RPKI certificate tree requires special handling and 00506 # may also require a special handling policy. rootd is a simple 00507 # implementation intended for test use, it's not suitable for use in a 00508 # production system. All configuration comes via the %config file. 00509 # 00510 # The default %config file is rootd.conf, start rootd with "-c filename" 00511 # to choose a different %config file. All options are in the section 00512 # "[rootd]". Certificates, keys, and trust anchors may be in either DER 00513 # or PEM format. 00514 # 00515 # %Config file options: 00516 # 00517 # @li @c bpki-ta: 00518 # Name of file containing BPKI trust anchor. All 00519 # BPKI certificate validation in rootd traces 00520 # back to this trust anchor. 00521 # 00522 # @li @c rootd-bpki-cert: 00523 # Name of file containing rootd's own BPKI 00524 # certificate. 00525 # 00526 # @li @c rootd-bpki-key: 00527 # Name of file containing RSA key corresponding to 00528 # rootd-bpki-cert. 00529 # 00530 # @li @c rootd-bpki-crl: 00531 # Name of file containing BPKI CRL that would 00532 # cover rootd-bpki-cert had it been revoked. 00533 # 00534 # @li @c child-bpki-cert: 00535 # Name of file containing BPKI certificate for 00536 # rootd's one and only child (RPKI engine to 00537 # which rootd issues an RPKI certificate). 00538 # 00539 # @li @c server-host: 00540 # Hostname or IP address on which to listen for 00541 # HTTPS connections. Default is localhost. 00542 # 00543 # @li @c server-port: 00544 # TCP port on which to listen for HTTPS 00545 # connections. 00546 # 00547 # @li @c rpki-root-key: 00548 # Name of file containing RSA key to use in 00549 # signing resource certificates. 00550 # 00551 # @li @c rpki-root-cert: 00552 # Name of file containing self-signed root 00553 # resource certificate corresponding to 00554 # rpki-root-key. 00555 # 00556 # @li @c rpki-root-dir: 00557 # Name of directory where rootd should write 00558 # RPKI subject certificate, manifest, and CRL. 00559 # 00560 # @li @c rpki-subject-cert: 00561 # Name of file that rootd should use to save the 00562 # one and only certificate it issues. 00563 # Default is "Subroot.cer". 00564 # 00565 # @li @c rpki-root-crl: 00566 # Name of file to which rootd should save its 00567 # RPKI CRL. Default is "Root.crl". 00568 # 00569 # @li @c rpki-root-manifest: 00570 # Name of file to which rootd should save its 00571 # RPKI manifest. Default is "Root.mnf". 00572 # 00573 # @li @c rpki-subject-pkcs10: 00574 # Name of file that rootd should use when saving 00575 # a copy of the received PKCS #10 request for a 00576 # resource certificate. This is only used for 00577 # debugging. Default is not to save the PKCS 00578 # #10 request. 00579 # 00580 # 00581 # @section irdbd irdbd.py 00582 # 00583 # irdbd is a sample implemntation of the server side of the IRDB 00584 # callback subset of the left-right protocol. In production use this 00585 # service is a function of the IRBE stub; irdbd may be suitable for 00586 # production use in simple cases, but an IR with a complex IRDB may need 00587 # to extend or rewrite irdbd. 00588 # 00589 # irdbd requires a pre-populated database to represent the IR's 00590 # customers. irdbd expects this database to use the SQL schema defined 00591 # in rpkid/irdbd.sql. Once this database has been populated, the 00592 # IRBE stub needs to create the appropriate objects in rpkid's database 00593 # via the control subset of the left-right protocol, and store the 00594 # linkage IDs (foreign keys into rpkid's database, basicly) in the 00595 # IRDB. The irbe-setup.py program shows an example of how to do this. 00596 # 00597 # irdbd's default %config file is irdbd.conf, start irdbd with "-c 00598 # filename" to choose a different %config file. All options are in the 00599 # section "[irdbd]". Certificates, keys, and trust anchors may be in 00600 # either DER or PEM format. 00601 # 00602 # %Config file options: 00603 # 00604 # @li @c startup-message: 00605 # String to %log on startup, useful when 00606 # debugging a collection of irdbd instances at 00607 # once. 00608 # 00609 # @li @c sql-username: 00610 # Username to hand to MySQL when connecting to 00611 # irdbd's database. 00612 # 00613 # @li @c sql-database: 00614 # MySQL's database name for irdbd's database. 00615 # 00616 # @li @c sql-password: 00617 # Password to hand to MySQL when connecting to 00618 # irdbd's database. 00619 # 00620 # @li @c bpki-ta: 00621 # Name of file containing BPKI trust anchor. All 00622 # BPKI certificate validation in irdbd traces 00623 # back to this trust anchor. 00624 # 00625 # @li @c irdbd-cert: 00626 # Name of file containing irdbd's own BPKI 00627 # certificate. 00628 # 00629 # @li @c irdbd-key: 00630 # Name of file containing RSA key corresponding 00631 # to irdbd-cert. 00632 # 00633 # @li @c rpkid-cert: 00634 # Name of file containing certificate used the 00635 # one and only by rpkid instance authorized to 00636 # contact this irdbd instance. 00637 # 00638 # @li @c https-url: 00639 # Service URL for irdbd. Must be a %https:// URL. 00640 # 00641 # 00642 # @section irdbd_cli irbe_cli.py 00643 # 00644 # irbe_cli is a simple command line client for the control subsets of 00645 # the @link Left-right left-right @endlink and @link Publication 00646 # publication @endlink protocols. In production use this 00647 # functionality would be part of the IRBE stub. 00648 # 00649 # Basic configuration of irbe_cli is handled via a %config file. The 00650 # specific action or actions to be performed are specified on the 00651 # command line, and map closely to the protocols themselves. 00652 # 00653 # At present the user is assumed to be able to read the (XML) 00654 # left-right and publication protocol messages, and with one 00655 # exception, irdbd-cli makes no attempt to interpret the responses 00656 # other than to check for signature and syntax errors. The one 00657 # exception is that, if the @c --pem_out option is specified on the 00658 # command line, any PKCS \#10 requests received from rpkid will be 00659 # written in PEM format to that file; this makes it easier to hand 00660 # these requests off to the business PKI (BPKI in order to issue signing 00661 # certs corresponding to newly generated business keys. 00662 # 00663 # @verbinclude irbe_cli.usage 00664 # 00665 # Global options (@c --config, @c --help, @c --pem_out) come first, 00666 # then zero or more commands (@c parent, @c repository, @c self, @c 00667 # child, @c bsc, @c config, @c client), each followed by its own set 00668 # of options. The commands map to elements in the protocols, and the 00669 # command-specific options map to attributes or subelements for those 00670 # commands. 00671 # 00672 # @c --tag is an optional arbitrary tag (think IMAP) to simplify 00673 # matching up replies with batched queries. 00674 # 00675 # @c --*_handle options refer to object primary keys. 00676 # 00677 # The remaining options are specific to the particular commands, and 00678 # follow directly from the protocol specifications. 00679 # 00680 # A trailing "=" in the above option summary indicates that an option 00681 # takes a value, eg, "--action create" or "--action=create". Options 00682 # without a trailing "=" correspond to boolean control attributes. 00683 # 00684 # The default %config file for irbe_cli is irbe_cli.conf, start 00685 # irbe_cli with "-c filename" (or "--config filename") to choose a 00686 # different %config file. All options are in the section 00687 # "[irbe_cli]". Certificates, keys, and trust anchors may be in 00688 # either DER or PEM format. 00689 # 00690 # %Config file options: 00691 # 00692 # @li @c rpkid-bpki-ta: 00693 # Name of file containing BPKI trust anchor to 00694 # use when authenticating messages from rpkid. 00695 # 00696 # @li @c rpkid-irbe-cert: 00697 # Name of file containing BPKI certificate 00698 # irbe_cli should use when talking to rpkid. 00699 # 00700 # @li @c rpkid-irbe-key: 00701 # Name of file containing RSA key corresponding to 00702 # rpkid-irbe-cert. 00703 # 00704 # @li @c rpkid-cert: 00705 # Name of file containing rpkid's BPKI certificate. 00706 # 00707 # @li @c rpkid-url: 00708 # Service URL for rpkid. Must be a %https:// URL. 00709 # 00710 # @li @c pubd-bpki-ta: 00711 # Name of file containing BPKI trust anchor to 00712 # use when authenticating messages from pubd. 00713 # 00714 # @li @c pubd-irbe-cert: 00715 # Name of file containing BPKI certificate 00716 # irbe_cli should use when talking to pubd. 00717 # 00718 # @li @c pubd-irbe-key: 00719 # Name of file containing RSA key corresponding to 00720 # pubd-irbe-cert. 00721 # 00722 # @li @c pubd-cert: 00723 # Name of file containing pubd's BPKI certificate. 00724 # 00725 # @li @c pubd-url: 00726 # Service URL for pubd. Must be a %https:// URL. 00727 # 00728 # 00729 # 00730 # @section cross_certify cross_certify.py 00731 # 00732 # cross_certify.py is a small tool to extract certain fields from an 00733 # existing X.509 certificate and generate issue a new certificate that 00734 # can be used as part of a cross-certification chain. cross_certify 00735 # doesn't take a config file, all of its arguments are specified on 00736 # the command line. 00737 # 00738 # @verbatim 00739 # python cross_certify.py { -i | --in } input_cert 00740 # { -c | --ca } issuing_cert 00741 # { -k | --key } issuing_cert_key 00742 # { -s | --serial } serial_filename 00743 # [ { -h | --help } ] 00744 # [ { -o | --out } filename ] 00745 # [ { -l | --lifetime } timedelta ] 00746 # @endverbatim 00747 # 00748 # 00749 # @section irbe_setup irbe-setup.py config file 00750 # 00751 # @warning 00752 # irbe-setup is old code, not currently used, kept in case it is 00753 # useful at some later date. It may not work properly or at all. If 00754 # you don't understand what it does, you don't need it. You have been 00755 # warned. 00756 # 00757 # The default %config file is irbe.conf, start rpkid with "-c filename" 00758 # to choose a different %config file. Most options are in the section 00759 # "[irbe_cli]", but a few are in the section "[irdbd]". Certificates, 00760 # keys, and trust anchors may be in either DER or PEM format. 00761 # 00762 # Options in the "[irbe_cli]" section: 00763 # 00764 # @li @c bpki-ta: 00765 # Name of file containing BPKI trust anchor. 00766 # 00767 # @li @c irbe-cert: 00768 # Name of file containing BPKI certificate 00769 # irbe-setup should use. 00770 # 00771 # @li @c irbe-key: 00772 # Name of file containing RSA key corresponding 00773 # to irbe-cert. 00774 # 00775 # @li @c rpkid-cert: 00776 # Name of file containing rpkid's BPKI 00777 # certificate. 00778 # 00779 # @li @c https-url: 00780 # Service URL for rpkid. Must be a %https:// URL. 00781 # 00782 # Options in the "[irdbd]" section: 00783 # 00784 # @li @c sql-username: 00785 # Username to hand to MySQL when connecting to 00786 # irdbd's database. 00787 # 00788 # @li @c sql-database: 00789 # MySQL's database name for irdbd's database. 00790 # 00791 # @li @c sql-password: 00792 # Password to hand to MySQL when connecting to 00793 # irdbd's database. 00794 # 00795 # 00796 # @section cronjob cronjob.py 00797 # 00798 # This is a trivial program to trigger a cron run within rpkid. Once 00799 # rpkid has been converted to the planned event-driven model, this 00800 # function will be handled internally, but for now it has to be 00801 # triggered by an external program. For pseudo-production use one would 00802 # run this program under the system cron daemon. For scripted testing 00803 # it happens to be useful to be able to control when cron cycles occur, 00804 # so at the current stage of code development use of an external trigger 00805 # is a useful feature. 00806 # 00807 # The default %config file is cronjob.conf, start cronjob with "-c 00808 # filename" to choose a different %config file. All options are in the 00809 # section "[cronjob]". Certificates, keys, and trust anchors may be in 00810 # either DER or PEM format. 00811 # 00812 # %Config file options: 00813 # 00814 # @li @c bpki-ta: 00815 # Name of file containing BPKI trust anchor. 00816 # 00817 # @li @c irbe-cert: 00818 # Name of file containing cronjob.py's BPKI 00819 # certificate. 00820 # 00821 # @li @c https-key: 00822 # Name of file containing RSA key corresponding 00823 # to irbe-cert. 00824 # 00825 # @li @c rpkid-cert: 00826 # Name of file containing rpkid's BPKI certificate. 00827 # 00828 # @li @c https-url: 00829 # Service URL for rpkid. Must be a %https:// URL. 00830 # 00831 # 00832 # @section testbed testbed.py: 00833 # 00834 # testbed is a test harness to set up and run a collection of rpkid and 00835 # irdbd instances under scripted control. testbed is a very recent 00836 # addition to the toolset and is still evolving rapidly. 00837 # 00838 # Unlike the programs described above, testbed takes two configuration 00839 # files in different languages. The first configuration file uses the 00840 # same syntax as the above configuration files but is completely 00841 # optional. The second configuration file is the test script, which is 00842 # encoded using the YAML serialization language (see 00843 # http://www.yaml.org/ for more information on YAML). The YAML script 00844 # is not optional, as it describes the test layout. testbed is designed 00845 # to support running a fairly wide set of test configurations as canned 00846 # scripts without writing any new control code. The intent is to make 00847 # it possible to write meaningful regression tests. 00848 # 00849 # All of the options in in the first (optional) configuration file are 00850 # just overrides for wired-in default values. In most cases the 00851 # defaults will suffice, and the set of options is still in flux, so 00852 # only a few of the options are described here. The default name for 00853 # this configuration file is testbed.conf, run testbed with "-c 00854 # filename" to change it. 00855 # 00856 # testbed.conf options: 00857 # 00858 # @li @c testbed_dir: 00859 # Working directory into which testbed should write the 00860 # (many) files it generates. Default is "testbed.dir". 00861 # 00862 # @li @c irdb_db_pass: 00863 # MySQL password for the "irdb" user. Default is 00864 # "fnord". You may want to override this. 00865 # 00866 # @li @c rpki_db_pass: 00867 # MySQL password for the "rpki" user. Default is 00868 # "fnord". You may want to override this. 00869 # 00870 # @li @c rootd_sia: 00871 # rsync URI naming a (perhaps fictious) directory to use 00872 # as the id-ad-caRepository SIA value in the generated 00873 # root resource certificate. Default is 00874 # "rsync://wombat.invalid/". You may want to override 00875 # this if you intend to run an rsync server and test 00876 # against the generated results using rcynic. This 00877 # default will likely change if and when testbed learns 00878 # how to run rcynic itself as part of the test suite. 00879 # 00880 # The second configuration file is named testbed.yaml by default, run 00881 # testbed with "-y filename" to change it. The YAML file contains 00882 # multiple YAML "documents". The first document describes the initial 00883 # test layout and resource allocations, subsequent documents describe 00884 # modifications to the initial allocations and other parameters. 00885 # Resources listed in the initial layout are aggregated automatically, 00886 # so that a node in the resource hierarchy automatically receives the 00887 # resources it needs to issue whatever its children are listed as 00888 # holding. Actions in the subsequent documents are modifications to the 00889 # current resource set, modifications to validity dates or other 00890 # non-resource parameters, or special commands like "sleep". The 00891 # details are still evolving, but here's an example of current usage: 00892 # 00893 # @verbatim 00894 # name: RIR 00895 # valid_for: 2d 00896 # sia_base: "rsync://wombat.invalid/" 00897 # kids: 00898 # - name: LIR0 00899 # kids: 00900 # - name: Alice 00901 # ipv4: 192.0.2.1-192.0.2.33 00902 # asn: 64533 00903 # --- 00904 # - name: Alice 00905 # valid_add: 10 00906 # --- 00907 # - name: Alice 00908 # add_as: 33 00909 # valid_add: 2d 00910 # --- 00911 # - name: Alice 00912 # valid_sub: 2d 00913 # --- 00914 # - name: Alice 00915 # valid_for: 10d 00916 # @endverbatim 00917 # 00918 # This specifies an initial layout consisting of an RPKI engine named 00919 # "RIR", with one child "LIR0", which in turn has one child "Alice". 00920 # Alice has a set of assigned resources, and all resources in the system 00921 # are initially set to be valid for two days from the time at which the 00922 # test is started. The first subsequent document adds ten seconds to 00923 # the validity interval for Alice's resources and makes no other 00924 # modifications. The second subsequent document grants Alice additional 00925 # resources and adds another two days to the validity interval for 00926 # Alice's resources. The next document subtracts two days from the 00927 # validity interval for Alice's resources. The final document sets the 00928 # validity interval for Alice's resources to ten days. 00929 # 00930 # Operators in subsequent (update) documents: 00931 # 00932 # @li @c add_as, @c add_v4, @c add_v6: 00933 # These add ASN, IPv4, or IPv6 resources, respectively. 00934 # 00935 # @li @c sub_as, @c sub_v4, @c sub_v6: 00936 # These subtract resources. 00937 # 00938 # @li @c valid_until: 00939 # Set an absolute expiration date. 00940 # 00941 # @li @c valid_for: 00942 # Set a relative expiration date. 00943 # 00944 # @li @c valid_add, @c valid_sub: 00945 # Add to or subtract from validity interval. 00946 # 00947 # @li @c sleep [interval]: 00948 # Sleep for specified interval, or until testbed receives a SIGALRM signal. 00949 # 00950 # Absolute timestamps should be in the form shown (UTC timestamp format 00951 # as used in XML). 00952 # 00953 # Intervals (@c valid_add, @c valid_sub, @c valid_for, @c sleep) are either 00954 # integers, in which case they're interpreted as seconds, or are a 00955 # string of the form "wD xH yM zS" where w, x, y, and z are integers and 00956 # D, H, M, and S indicate days, hours, minutes, and seconds. In the 00957 # latter case all of the fields are optional, but at least one must be 00958 # specified. For example, "3D4H" means "three days plus four hours". 00959 # 00960 # 00961 # @section testpoke testpoke.py 00962 # 00963 # This is a command-line client for the up-down protocol. Unlike all of 00964 # the above programs, testpoke does not accept a %config file in 00965 # OpenSSL-compatable format at all. Instead, it is configured 00966 # exclusively by a YAML script. testpoke's design was constrained by a 00967 # desire to have it be compatable with APNIC's rpki_poke.pl tool, so 00968 # that the two tools could use a common configuration language to 00969 # simplify scripted testing. There are minor variations due to slightly 00970 # different feature sets, but YAML files intended for one program will 00971 # usually work with the other. 00972 # 00973 # README for APNIC's tool describing the input language can be found at 00974 # <a href="http://mirin.apnic.net/svn/rpki_engine/branches/gary-poker/client/poke/README"> 00975 # http://mirin.apnic.net/svn/rpki_engine/branches/gary-poker/client/poke/README</a>. 00976 # 00977 # testpoke.py takes a simplified command line and uses only one YAML 00978 # input file. 00979 # 00980 # @verbatim 00981 # Usage: python testpoke.py [ { -y | --yaml } configfile ] 00982 # [ { -r | --request } requestname ] 00983 # [ { -h | --help } ] 00984 # @endverbatim 00985 # 00986 # Default configuration file is testpoke.yaml, override with --yaml 00987 # option. 00988 # 00989 # The --request option specifies the specific command within the YAML 00990 # file to execute. 00991 # 00992 # Sample configuration file: 00993 # 00994 # @verbatim 00995 # --- 00996 # # Sample YAML configuration file for testpoke.py 00997 # 00998 # version: 1 00999 # posturl: https://localhost:4433/up-down/1 01000 # recipient-id: wombat 01001 # sender-id: "1" 01002 # 01003 # cms-cert-file: biz-certs/Frank-EE.cer 01004 # cms-key-file: biz-certs/Frank-EE.key 01005 # cms-ca-cert-file: biz-certs/Bob-Root.cer 01006 # cms-cert-chain-file: [ biz-certs/Frank-CA.cer ] 01007 # 01008 # ssl-cert-file: biz-certs/Frank-EE.cer 01009 # ssl-key-file: biz-certs/Frank-EE.key 01010 # ssl-ca-cert-file: biz-certs/Bob-Root.cer 01011 # 01012 # requests: 01013 # list: 01014 # type: list 01015 # issue: 01016 # type: issue 01017 # class: 1 01018 # sia: [ "rsync://bandicoot.invalid/some/where/" ] 01019 # revoke: 01020 # type: revoke 01021 # class: 1 01022 # ski: "CB5K6APY-4KcGAW9jaK_cVPXKX0" 01023 # @endverbatim 01024 # 01025 # testpoke adds one extension to the language described in APNIC's 01026 # README: the cms-cert-chain-* and ssl-cert-chain-* options, which allow 01027 # one to specify a chain of intermediate certificates to be presented in 01028 # the CMS or TLS protocol. APNIC's initial implementation required 01029 # direct knowledge of the issuing certificate (ie, it supported a 01030 # maximum chain length of one); subsequent APNIC code changes have 01031 # probably relaxed this restriction, and with luck APNIC has copied 01032 # testpoke's syntax to express chains of intermediate certificates. 01033 01034 ## @page Left-right Left-right protocol 01035 # 01036 # The left-right protocol is really two separate client/server 01037 # protocols over separate channels between the RPKI engine and the IR 01038 # back end (IRBE). The IRBE is the client for one of the 01039 # subprotocols, the RPKI engine is the client for the other. 01040 # 01041 # @section Terminology 01042 # 01043 # @li @em IRBE: Internet Registry Back End 01044 # 01045 # @li @em IRDB: Internet Registry Data Base 01046 # 01047 # @li @em BPKI: Business PKI 01048 # 01049 # @li @em RPKI: Resource PKI 01050 # 01051 # @section Operations initiated by the IRBE 01052 # 01053 # This part of the protcol uses a kind of message-passing. Each %object 01054 # that the RPKI engine knows about takes five messages: "create", "set", 01055 # "get", "list", and "destroy". Actions which are not just data 01056 # operations on %objects are handled via an SNMP-like mechanism, as if 01057 # they were fields to be set. For example, to generate a keypair one 01058 # "sets" the "generate-keypair" field of a BSC %object, even though there 01059 # is no such field in the %object itself as stored in SQL. This is a bit 01060 # of a kludge, but the reason for doing it as if these were variables 01061 # being set is to allow composite operations such as creating a BSC, 01062 # populating all of its data fields, and generating a keypair, all as a 01063 # single operation. With this model, that's trivial, otherwise it's at 01064 # least two round trips. 01065 # 01066 # Fields can be set in either "create" or "set" operations, the 01067 # difference just being whether the %object already exists. A "get" 01068 # operation returns all visible fields of the %object. A "list" 01069 # operation returns a %list containing what "get" would have returned on 01070 # each of those %objects. 01071 # 01072 # Left-right protocol %objects are encoded as signed CMS messages 01073 # containing XML as eContent and using an eContentType OID of @c id-ct-xml 01074 # (1.2.840.113549.1.9.16.1.28). These CMS messages are in turn passed 01075 # as the data for HTTPS POST operations, with an HTTP content type of 01076 # "application/x-rpki" for both the POST data and the response data. 01077 # 01078 # All operations allow an optional "tag" attribute which can be any 01079 # alphanumeric token. The main purpose of the tag attribute is to allow 01080 # batching of multiple requests into a single PDU. 01081 # 01082 # @subsection self_obj <self/> object 01083 # 01084 # A @c <self/> %object represents one virtual RPKI engine. In simple cases 01085 # where the RPKI engine operator operates the engine only on their own 01086 # behalf, there will only be one @c <self/> %object, representing the engine 01087 # operator's organization, but in environments where the engine operator 01088 # hosts other entities, there will be one @c @c <self/> %object per hosted 01089 # entity (probably including the engine operator's own organization, 01090 # considered as a hosted customer of itself). 01091 # 01092 # Some of the RPKI engine's configured parameters and data are shared by 01093 # all hosted entities, but most are tied to a specific @c <self/> %object. 01094 # Data which are shared by all hosted entities are referred to as 01095 # "per-engine" data, data which are specific to a particular @c <self/> 01096 # %object are "per-self" data. 01097 # 01098 # Since all other RPKI engine %objects refer to a @c <self/> %object via a 01099 # "self_handle" value, one must create a @c <self/> %object before one can 01100 # usefully configure any other left-right protocol %objects. 01101 # 01102 # Every @c <self/> %object has a self_handle attribute, which must be specified 01103 # for the "create", "set", "get", and "destroy" actions. 01104 # 01105 # Payload data which can be configured in a @c <self/> %object: 01106 # 01107 # @li @c use_hsm (attribute): 01108 # Whether to use a Hardware Signing Module. At present this option 01109 # has no effect, as the implementation does not yet support HSMs. 01110 # 01111 # @li @c crl_interval (attribute): 01112 # Positive integer representing the planned lifetime of an RPKI CRL 01113 # for this @c <self/>, measured in seconds. 01114 # 01115 # @li @c regen_margin (attribute): 01116 # Positive integer representing how long before expiration of an 01117 # RPKI certificiate a new one should be generated, measured in 01118 # seconds. At present this only affects the one-off EE certificates 01119 # associated with ROAs. 01120 # 01121 # @li @c bpki_cert (element): 01122 # BPKI CA certificate for this @c <self/>. This is used as part of the 01123 # certificate chain when validating incoming TLS and CMS messages, 01124 # and should be the issuer of cross-certification BPKI certificates 01125 # used in @c <repository/>, @c <parent/>, and @c <child/> %objects. If the 01126 # bpki_glue certificate is in use (below), the bpki_cert certificate 01127 # should be issued by the bpki_glue certificate; otherwise, the 01128 # bpki_cert certificate should be issued by the per-engine bpki_ta 01129 # certificate. 01130 # 01131 # @li @c bpki_glue (element): 01132 # Another BPKI CA certificate for this @c <self/>, usually not needed. 01133 # Certain pathological cross-certification cases require a 01134 # two-certificate chain due to issuer name conflicts. If used, the 01135 # bpki_glue certificate should be the issuer of the bpki_cert 01136 # certificate and should be issued by the per-engine bpki_ta 01137 # certificate; if not needed, the bpki_glue certificate should be 01138 # left unset. 01139 # 01140 # Control attributes that can be set to "yes" to force actions: 01141 # 01142 # @li @c rekey: 01143 # Start a key rollover for every RPKI CA associated with every 01144 # @c <parent/> %object associated with this @c <self/> %object. This is the 01145 # first phase of a key rollover operation. 01146 # 01147 # @li @c revoke: 01148 # Revoke any remaining certificates for any expired key associated 01149 # with any RPKI CA for any @c <parent/> %object associated with this 01150 # @c <self/> %object. This is the second (cleanup) phase for a key 01151 # rollover operation; it's separate from the first phase to leave 01152 # time for new RPKI certificates to propegate and be installed. 01153 # 01154 # @li @c reissue: 01155 # Not implemented, may be removed from protocol. Original theory 01156 # was that this operation would force reissuance of any %object with 01157 # a changed key, but as that happens automatically as part of the 01158 # key rollover mechanism this operation seems unnecessary. 01159 # 01160 # @li @c run_now: 01161 # Force immediate processing for all tasks associated with this 01162 # @c <self/> %object that would ordinarily be performed under cron. Not 01163 # currently implemented. 01164 # 01165 # @li @c publish_world_now: 01166 # Force (re)publication of every publishable %object for this @c <self/> 01167 # %object. Not currently implemented. Intended to aid in recovery 01168 # if RPKI engine and publication engine somehow get out of sync. 01169 # 01170 # 01171 # @subsection bsc_obj <bsc/> object 01172 # 01173 # The @c <bsc/> ("business signing context") %object represents all the BPKI 01174 # data needed to sign outgoing CMS or HTTPS messages. Various other 01175 # %objects include pointers to a @c <bsc/> %object. Whether a particular 01176 # @c <self/> uses only one @c <bsc/> or multiple is a configuration decision 01177 # based on external requirements: the RPKI engine code doesn't care, it 01178 # just cares that, for any %object representing a relationship for which 01179 # it must sign messages, there be a @c <bsc/> %object that it can use to 01180 # produce that signature. 01181 # 01182 # Every @c <bsc/> %object has a bsc_handle, which must be specified for the 01183 # "create", "get", "set", and "destroy" actions. Every @c <bsc/> also has a self_handle 01184 # attribute which indicates the @c <self/> %object with which this @c <bsc/> 01185 # %object is associated. 01186 # 01187 # Payload data which can be configured in a @c <isc/> %object: 01188 # 01189 # @li @c signing_cert (element): 01190 # BPKI certificate to use when generating a signature. 01191 # 01192 # @li @c signing_cert_crl (element): 01193 # CRL which would %list signing_cert if it had been revoked. 01194 # 01195 # Control attributes that can be set to "yes" to force actions: 01196 # 01197 # @li @c generate_keypair: 01198 # Generate a new BPKI keypair and return a PKCS #10 certificate 01199 # request. The resulting certificate, once issued, should be 01200 # configured as this @c <bsc/> %object's signing_cert. 01201 # 01202 # Additional attributes which may be specified when specifying 01203 # "generate_keypair": 01204 # 01205 # @li @c key_type: 01206 # Type of BPKI keypair to generate. "rsa" is both the default and, 01207 # at the moment, the only allowed value. 01208 # 01209 # @li @c hash_alg: 01210 # Cryptographic hash algorithm to use with this keypair. "sha256" 01211 # is both the default and, at the moment, the only allowed value. 01212 # 01213 # @li @c key_length: 01214 # Length in bits of the keypair to be generated. "2048" is both the 01215 # default and, at the moment, the only allowed value. 01216 # 01217 # Replies to "create" and "set" actions that specify "generate-keypair" 01218 # include a <bsc_pkcs10/> element, as do replies to "get" and "list" 01219 # actions for a @c <bsc/> %object for which a "generate-keypair" command has 01220 # been issued. The RPKI engine stores the PKCS #10 request, which 01221 # allows the IRBE to reuse the request if and when it needs to reissue 01222 # the corresponding BPKI signing certificate. 01223 # 01224 # @subsection parent_obj <parent/> object 01225 # 01226 # The @c <parent/> %object represents the RPKI engine's view of a particular 01227 # parent of the current @c <self/> %object in the up-down protocol. Due to 01228 # the way that the resource hierarchy works, a given @c <self/> may obtain 01229 # resources from multiple parents, but it will always have at least one; 01230 # in the case of IANA or an RIR, the parent RPKI engine may be a trivial 01231 # stub. 01232 # 01233 # Every @c <parent/> %object has a parent_handle, which must be specified for 01234 # the "create", "get", "set", and "destroy" actions. Every @c <parent/> also has a 01235 # self_handle attribute which indicates the @c <self/> %object with which this 01236 # @c <parent/> %object is associated, a bsc_handle attribute indicating the @c <bsc/> 01237 # %object to be used when signing messages sent to this parent, and a 01238 # repository_handle indicating the @c <repository/> %object to be used when 01239 # publishing issued by the certificate issued by this parent. 01240 # 01241 # Payload data which can be configured in a @c <parent/> %object: 01242 # 01243 # @li @c peer_contact_uri (attribute): 01244 # HTTPS URI used to contact this parent. 01245 # 01246 # @li @c sia_base (attribute): 01247 # The leading portion of an rsync URI that the RPKI engine should 01248 # use when composing the publication URI for %objects issued by the 01249 # RPKI certificate issued by this parent. 01250 # 01251 # @li @c sender_name (attribute): 01252 # Sender name to use in the up-down protocol when talking to this 01253 # parent. The RPKI engine doesn't really care what this value is, 01254 # but other implementations of the up-down protocol do care. 01255 # 01256 # @li @c recipient_name (attribute): 01257 # Recipient name to use in the up-down protocol when talking to this 01258 # parent. The RPKI engine doesn't really care what this value is, 01259 # but other implementations of the up-down protocol do care. 01260 # 01261 # @li @c bpki_cms_cert (element): 01262 # BPKI CMS CA certificate for this @c <parent/>. This is used as part 01263 # of the certificate chain when validating incoming CMS messages If 01264 # the bpki_cms_glue certificate is in use (below), the bpki_cms_cert 01265 # certificate should be issued by the bpki_cms_glue certificate; 01266 # otherwise, the bpki_cms_cert certificate should be issued by the 01267 # bpki_cert certificate in the @c <self/> %object. 01268 # 01269 # @li @c bpki_cms_glue (element): 01270 # Another BPKI CMS CA certificate for this @c <parent/>, usually not 01271 # needed. Certain pathological cross-certification cases require a 01272 # two-certificate chain due to issuer name conflicts. If used, the 01273 # bpki_cms_glue certificate should be the issuer of the 01274 # bpki_cms_cert certificate and should be issued by the bpki_cert 01275 # certificate in the @c <self/> %object; if not needed, the 01276 # bpki_cms_glue certificate should be left unset. 01277 # 01278 # @li @c bpki_https_cert (element): 01279 # BPKI HTTPS CA certificate for this @c <parent/>. This is like the 01280 # bpki_cms_cert %object, only used for validating incoming TLS 01281 # messages rather than CMS. 01282 # 01283 # @li @c bpki_cms_glue (element): 01284 # Another BPKI HTTPS CA certificate for this @c <parent/>, usually not 01285 # needed. This is like the bpki_cms_glue certificate, only used for 01286 # validating incoming TLS messages rather than CMS. 01287 # 01288 # Control attributes that can be set to "yes" to force actions: 01289 # 01290 # @li @c rekey: 01291 # This is like the rekey command in the @c <self/> %object, but limited 01292 # to RPKI CAs under this parent. 01293 # 01294 # @li @c reissue: 01295 # This is like the reissue command in the @c <self/> %object, but limited 01296 # to RPKI CAs under this parent. 01297 # 01298 # @li @c revoke: 01299 # This is like the revoke command in the @c <self/> %object, but limited 01300 # to RPKI CAs under this parent. 01301 # 01302 # @subsection child_obj <child/> object 01303 # 01304 # The @c <child/> %object represents the RPKI engine's view of particular 01305 # child of the current @c <self/> in the up-down protocol. 01306 # 01307 # Every @c <child/> %object has a child_handle, which must be specified for the 01308 # "create", "get", "set", and "destroy" actions. Every @c <child/> also has a 01309 # self_handle attribute which indicates the @c <self/> %object with which this 01310 # @c <child/> %object is associated. 01311 # 01312 # Payload data which can be configured in a @c <child/> %object: 01313 # 01314 # @li @c bpki_cert (element): 01315 # BPKI CA certificate for this @c <child/>. This is used as part of 01316 # the certificate chain when validating incoming TLS and CMS 01317 # messages. If the bpki_glue certificate is in use (below), the 01318 # bpki_cert certificate should be issued by the bpki_glue 01319 # certificate; otherwise, the bpki_cert certificate should be issued 01320 # by the bpki_cert certificate in the @c <self/> %object. 01321 # 01322 # @li @c bpki_glue (element): 01323 # Another BPKI CA certificate for this @c <child/>, usually not needed. 01324 # Certain pathological cross-certification cases require a 01325 # two-certificate chain due to issuer name conflicts. If used, the 01326 # bpki_glue certificate should be the issuer of the bpki_cert 01327 # certificate and should be issued by the bpki_cert certificate in 01328 # the @c <self/> %object; if not needed, the bpki_glue certificate 01329 # should be left unset. 01330 # 01331 # Control attributes that can be set to "yes" to force actions: 01332 # 01333 # @li @c reissue: 01334 # Not implemented, may be removed from protocol. 01335 # 01336 # @subsection repository_obj <repository/> object 01337 # 01338 # The @c <repository/> %object represents the RPKI engine's view of a 01339 # particular publication repository used by the current @c <self/> %object. 01340 # 01341 # Every @c <repository/> %object has a repository_handle, which must be 01342 # specified for the "create", "get", "set", and "destroy" actions. Every 01343 # @c <repository/> also has a self_handle attribute which indicates the @c <self/> 01344 # %object with which this @c <repository/> %object is associated. 01345 # 01346 # Payload data which can be configured in a @c <repository/> %object: 01347 # 01348 # @li @c peer_contact_uri (attribute): 01349 # HTTPS URI used to contact this repository. 01350 # 01351 # @li @c bpki_cms_cert (element): 01352 # BPKI CMS CA certificate for this @c <repository/>. This is used as part 01353 # of the certificate chain when validating incoming CMS messages If 01354 # the bpki_cms_glue certificate is in use (below), the bpki_cms_cert 01355 # certificate should be issued by the bpki_cms_glue certificate; 01356 # otherwise, the bpki_cms_cert certificate should be issued by the 01357 # bpki_cert certificate in the @c <self/> %object. 01358 # 01359 # @li @c bpki_cms_glue (element): 01360 # Another BPKI CMS CA certificate for this @c <repository/>, usually not 01361 # needed. Certain pathological cross-certification cases require a 01362 # two-certificate chain due to issuer name conflicts. If used, the 01363 # bpki_cms_glue certificate should be the issuer of the 01364 # bpki_cms_cert certificate and should be issued by the bpki_cert 01365 # certificate in the @c <self/> %object; if not needed, the 01366 # bpki_cms_glue certificate should be left unset. 01367 # 01368 # @li @c bpki_https_cert (element): 01369 # BPKI HTTPS CA certificate for this @c <repository/>. This is like the 01370 # bpki_cms_cert %object, only used for validating incoming TLS 01371 # messages rather than CMS. 01372 # 01373 # @li @c bpki_cms_glue (element): 01374 # Another BPKI HTTPS CA certificate for this @c <repository/>, usually not 01375 # needed. This is like the bpki_cms_glue certificate, only used for 01376 # validating incoming TLS messages rather than CMS. 01377 # 01378 # At present there are no control attributes for @c <repository/> %objects. 01379 # 01380 # @subsection route_origin_obj <route_origin/> object 01381 # 01382 # This section is out-of-date. The @c <route_origin/> %object 01383 # has been replaced by the @c <list_roa_requests/> IRDB query, 01384 # but the documentation for that hasn't been written yet. 01385 # 01386 # The @c <route_origin/> %object is a kind of prototype for a ROA. It 01387 # contains all the information needed to generate a ROA once the RPKI 01388 # engine obtains the appropriate RPKI certificates from its parent(s). 01389 # 01390 # Note that a @c <route_origin/> %object represents a ROA to be generated on 01391 # behalf of @c <self/>, not on behalf of a @c <child/>. Thus, a hosted entity 01392 # that has no children but which does need to generate ROAs would be 01393 # represented by a hosted @c <self/> with no @c <child/> %objects but one or 01394 # more @c <route_origin/> %objects. While lumping ROA generation in with 01395 # the other RPKI engine activities may seem a little odd at first, it's 01396 # a natural consequence of the design requirement that the RPKI daemon 01397 # never transmit private keys across the network in any form; given this 01398 # requirement, the RPKI engine that holds the private keys for an RPKI 01399 # certificate must also be the engine which generates any ROAs that 01400 # derive from that RPKI certificate. 01401 # 01402 # The precise content of the @c <route_origin/> has changed over time as 01403 # the underlying ROA specification has changed. The current 01404 # implementation as of this writing matches what we expect to see in 01405 # draft-ietf-sidr-roa-format-03, once it is issued. In particular, note 01406 # that the exactMatch boolean from the -02 draft has been replaced by 01407 # the prefix and maxLength encoding used in the -03 draft. 01408 # 01409 # Payload data which can be configured in a @c <route_origin/> %object: 01410 # 01411 # @li @c asn (attribute): 01412 # Autonomous System Number (ASN) to place in the generated ROA. A 01413 # single ROA can only grant authorization to a single ASN; multiple 01414 # ASNs require multiple ROAs, thus multiple @c <route_origin/> %objects. 01415 # 01416 # @li @c ipv4 (attribute): 01417 # %List of IPv4 prefix and maxLength values, see below for format. 01418 # 01419 # @li @c ipv6 (attribute): 01420 # %List of IPv6 prefix and maxLength values, see below for format. 01421 # 01422 # Control attributes that can be set to "yes" to force actions: 01423 # 01424 # @li @c suppress_publication: 01425 # Not implemented, may be removed from protocol. 01426 # 01427 # The lists of IPv4 and IPv6 prefix and maxLength values are represented 01428 # as comma-separated text strings, with no whitespace permitted. Each 01429 # entry in such a string represents a single prefix/maxLength pair. 01430 # 01431 # ABNF for these address lists: 01432 # 01433 # @verbatim 01434 # 01435 # <ROAIPAddress> ::= <address> "/" <prefixlen> [ "-" <max_prefixlen> ] 01436 # ; Where <max_prefixlen> defaults to the same 01437 # ; value as <prefixlen>. 01438 # 01439 # <ROAIPAddressList> ::= <ROAIPAddress> *( "," <ROAIPAddress> ) 01440 # 01441 # @endverbatim 01442 # 01443 # For example, @c "10.0.1.0/24-32,10.0.2.0/24", which is a shorthand 01444 # form of @c "10.0.1.0/24-32,10.0.2.0/24-24". 01445 # 01446 # @section irdb_queries Operations initiated by the RPKI engine 01447 # 01448 # The left-right protocol also includes queries from the RPKI engine 01449 # back to the IRDB. These queries do not follow the message-passing 01450 # pattern used in the IRBE-initiated part of the protocol. Instead, 01451 # there's a single query back to the IRDB, with a corresponding 01452 # response. The CMS and HTTPS encoding are the same as in the rest of 01453 # the protocol, but the BPKI certificates will be different as the 01454 # back-queries and responses form a separate communication channel. 01455 # 01456 # @subsection list_resources_msg <list_resources/> messages 01457 # 01458 # The @c <list_resources/> query and response allow the RPKI engine to ask 01459 # the IRDB for information about resources assigned to a particular 01460 # child. The query must include both a @c "self_handle" attribute naming 01461 # the @c <self/> that is making the request and also a @c "child_handle" 01462 # attribute naming the child that is the subject of the query. The 01463 # query and response also allow an optional @c "tag" attribute of the 01464 # same form used elsewhere in this protocol, to allow batching. 01465 # 01466 # A @c <list_resources/> response includes the following attributes, along 01467 # with the @c tag (if specified), @c self_handle, and @c child_handle copied 01468 # from the request: 01469 # 01470 # @li @c valid_until: 01471 # A timestamp indicating the date and time at which certificates 01472 # generated by the RPKI engine for these data should expire. The 01473 # timestamp is expressed as an XML @c xsd:dateTime, must be 01474 # expressed in UTC, and must carry the "Z" suffix indicating UTC. 01475 # 01476 # @li @c asn: 01477 # A %list of autonomous sequence numbers, expressed as a 01478 # comma-separated sequence of decimal integers with no whitespace. 01479 # 01480 # @li @c ipv4: 01481 # A %list of IPv4 address prefixes and ranges, expressed as a 01482 # comma-separated %list of prefixes and ranges with no whitespace. 01483 # See below for format details. 01484 # 01485 # @li @c ipv6: 01486 # A %list of IPv6 address prefixes and ranges, expressed as a 01487 # comma-separated %list of prefixes and ranges with no whitespace. 01488 # See below for format details. 01489 # 01490 # Entries in a %list of address prefixes and ranges can be either 01491 # prefixes, which are written in the usual address/prefixlen notation, 01492 # or ranges, which are expressed as a pair of addresses denoting the 01493 # beginning and end of the range, written in ascending order separated 01494 # by a single "-" character. This format is superficially similar to 01495 # the format used for prefix and maxLength values in the @c <route_origin/> 01496 # %object, but the semantics differ: note in particular that 01497 # @c <route_origin/> %objects don't allow ranges, while @c <list_resources/> 01498 # messages don't allow a maxLength specification. 01499 # 01500 # @section left_right_error_handling Error handling 01501 # 01502 # Error in this protocol are handled at two levels. 01503 # 01504 # Since all messages in this protocol are conveyed over HTTPS 01505 # connections, basic errors are indicated via the HTTP response code. 01506 # 4xx and 5xx responses indicate that something bad happened. Errors 01507 # that make it impossible to decode a query or encode a response are 01508 # handled in this way. 01509 # 01510 # Where possible, errors will result in a @c <report_error/> message which 01511 # takes the place of the expected protocol response message. 01512 # @c <report_error/> messages are CMS-signed XML messages like the rest of 01513 # this protocol, and thus can be archived to provide an audit trail. 01514 # 01515 # @c <report_error/> messages only appear in replies, never in queries. 01516 # The @c <report_error/> message can appear on either the "forward" (IRBE 01517 # as client of RPKI engine) or "back" (RPKI engine as client of IRDB) 01518 # communication channel. 01519 # 01520 # The @c <report_error/> message includes an optional @c "tag" attribute to 01521 # assist in matching the error with a particular query when using 01522 # batching, and also includes a @c "self_handle" attribute indicating the 01523 # @c <self/> that issued the error. 01524 # 01525 # The error itself is conveyed in the @c error_code (attribute). The 01526 # value of this attribute is a token indicating the specific error that 01527 # occurred. At present this will be the name of a Python exception; the 01528 # production version of this protocol will nail down the allowed error 01529 # tokens here, probably in the RelaxNG schema. 01530 # 01531 # The body of the @c <report_error/> element itself is an optional text 01532 # string; if present, this is debugging information. At present this 01533 # capabilty is not used, debugging information goes to syslog. 01534 01535 ## @page Publication Publication protocol 01536 # 01537 # The %publication protocol is really two separate client/server 01538 # protocols, between different parties. The first is a configuration 01539 # protocol for an IRBE to use to configure a %publication engine, 01540 # the second is the interface by which authorized clients request 01541 # %publication of specific objects. 01542 # 01543 # Much of the architecture of the %publication protocol is borrowed 01544 # from the @link Left-right left-right protocol: @endlink like the 01545 # left-right protocol, the %publication protocol uses CMS-wrapped XML 01546 # over HTTPS with the same eContentType OID and the same HTTPS 01547 # content-type, and the overall style of the XML messages is very 01548 # similar to the left-right protocol. All operations allow an 01549 # optional "tag" attribute to allow batching. 01550 # 01551 # The %publication engine operates a single HTTPS server which serves 01552 # both of these subprotocols. The two subprotocols share a single 01553 # server port, but use distinct URLs to allow demultiplexing. 01554 # 01555 # @section Terminology 01556 # 01557 # @li @em IRBE: Internet Registry Back End 01558 # 01559 # @li @em IRDB: Internet Registry Data Base 01560 # 01561 # @li @em BPKI: Business PKI 01562 # 01563 # @li @em RPKI: Resource PKI 01564 # 01565 # @section Publication-control Publication control subprotocol 01566 # 01567 # The control subprotocol reuses the message-passing design of the 01568 # left-right protocol. Configured objects support the "create", "set", 01569 # "get", "list", and "destroy" actions, or a subset thereof when the 01570 # full set of actions doesn't make sense. 01571 # 01572 # @subsection config_obj <config/> object 01573 # 01574 # The <config/> %object allows configuration of data that apply to the 01575 # entire %publication server rather than a particular client. 01576 # 01577 # There is exactly one <config/> %object in the %publication server, and 01578 # it only supports the "set" and "get" actions -- it cannot be created 01579 # or destroyed. 01580 # 01581 # Payload data which can be configured in a <config/> %object: 01582 # 01583 # @li @c bpki_crl (element): 01584 # This is the BPKI CRL used by the %publication server when 01585 # signing the CMS wrapper on responses in the %publication 01586 # subprotocol. As the CRL must be updated at regular intervals, 01587 # it's not practical to restart the %publication server when the 01588 # BPKI CRL needs to be updated. The BPKI model doesn't require 01589 # use of a BPKI CRL between the IRBE and the %publication server, 01590 # so we can use the %publication control subprotocol to update the 01591 # BPKI CRL. 01592 # 01593 # @subsection client_obj <client/> object 01594 # 01595 # The <client/> %object represents one client authorized to use the 01596 # %publication server. 01597 # 01598 # The <client/> %object supports the full set of "create", "set", "get", 01599 # "list", and "destroy" actions. Each client has a "client_handle" 01600 # attribute, which is used in responses and must be specified in "create", "set", 01601 # "get", or "destroy" actions. 01602 # 01603 # Payload data which can be configured in a <client/> %object: 01604 # 01605 # @li @c base_uri (attribute): 01606 # This is the base URI below which this client is allowed to publish 01607 # data. The %publication server may impose additional constraints in 01608 # the case of a child publishing beneath its parent. 01609 # 01610 # @li @c bpki_cert (element): 01611 # BPKI CA certificate for this <client/>. This is used as part of 01612 # the certificate chain when validating incoming TLS and CMS 01613 # messages. If the bpki_glue certificate is in use (below), the 01614 # bpki_cert certificate should be issued by the bpki_glue 01615 # certificate; otherwise, the bpki_cert certificate should be issued 01616 # by the %publication engine's bpki_ta certificate. 01617 # 01618 # @li @c bpki_glue (element): 01619 # Another BPKI CA certificate for this <client/>, usually not 01620 # needed. Certain pathological cross-certification cases require a 01621 # two-certificate chain due to issuer name conflicts. If used, the 01622 # bpki_glue certificate should be the issuer of the bpki_cert 01623 # certificate and should be issued by the %publication engine's 01624 # bpki_ta certificate; if not needed, the bpki_glue certificate 01625 # should be left unset. 01626 # 01627 # @section Publication-publication Publication subprotocol 01628 # 01629 # The %publication subprotocol is structured somewhat differently from 01630 # the %publication control protocol. Objects in the %publication 01631 # subprotocol represent objects to be published or objects to be 01632 # withdrawn from %publication. Each kind of %object supports two actions: 01633 # "publish" and "withdraw". In each case the XML element representing 01634 # hte %object to be published or withdrawn has a "uri" attribute which 01635 # contains the %publication URI. For "publish" actions, the XML element 01636 # body contains the DER %object to be published, encoded in Base64; for 01637 # "withdraw" actions, the XML element body is empty. 01638 # 01639 # In theory, the detailed access control for each kind of %object might 01640 # be different. In practice, as of this writing, access control for all 01641 # objects is a simple check that the client's @c "base_uri" is a leading 01642 # substring of the %publication URI. Details of why access control might 01643 # need to become more complicated are discussed in a later section. 01644 # 01645 # @subsection certificate_obj <certificate/> object 01646 # 01647 # The <certificate/> %object represents an RPKI certificate to be 01648 # published or withdrawn. 01649 # 01650 # @subsection crl_obj <crl/> object 01651 # 01652 # The <crl/> %object represents an RPKI CRL to be published or withdrawn. 01653 # 01654 # @subsection manifest_obj <manifest/> object 01655 # 01656 # The <manifest/> %object represents an RPKI %publication %manifest to be 01657 # published or withdrawn. 01658 # 01659 # Note that part of the reason for the batching support in the 01660 # %publication protocol is because @em every %publication or withdrawal 01661 # action requires a new %manifest, thus every %publication or withdrawal 01662 # action will involve at least two objects. 01663 # 01664 # @subsection roa_obj <roa/> object 01665 # 01666 # The <roa/> %object represents a ROA to be published or withdrawn. 01667 # 01668 # @section publication_error_handling Error handling 01669 # 01670 # Error in this protocol are handled at two levels. 01671 # 01672 # Since all messages in this protocol are conveyed over HTTPS 01673 # connections, basic errors are indicated via the HTTP response code. 01674 # 4xx and 5xx responses indicate that something bad happened. Errors 01675 # that make it impossible to decode a query or encode a response are 01676 # handled in this way. 01677 # 01678 # Where possible, errors will result in a <report_error/> message which 01679 # takes the place of the expected protocol response message. 01680 # <report_error/> messages are CMS-signed XML messages like the rest of 01681 # this protocol, and thus can be archived to provide an audit trail. 01682 # 01683 # <report_error/> messages only appear in replies, never in 01684 # queries. The <report_error/> message can appear in both the 01685 # control and publication subprotocols. 01686 # 01687 # The <report_error/> message includes an optional @c "tag" attribute to 01688 # assist in matching the error with a particular query when using 01689 # batching. 01690 # 01691 # The error itself is conveyed in the @c error_code (attribute). The 01692 # value of this attribute is a token indicating the specific error that 01693 # occurred. At present this will be the name of a Python exception; the 01694 # production version of this protocol will nail down the allowed error 01695 # tokens here, probably in the RelaxNG schema. 01696 # 01697 # The body of the <report_error/> element itself is an optional text 01698 # string; if present, this is debugging information. At present this 01699 # capabilty is not used, debugging information goes to syslog. 01700 # 01701 # @section publication_access_control Additional access control considerations. 01702 # 01703 # As detailed above, the %publication protocol is trivially simple. This 01704 # glosses over two bits of potential complexity: 01705 # 01706 # @li In the case where parent and child are sharing a repository, we'd 01707 # like to nest child under parent, because testing has demonstrated 01708 # that even on relatively slow hardware the delays involved in 01709 # setting up separate rsync connections tend to dominate 01710 # synchronization time for relying parties. 01711 # 01712 # @li The repository operator might also want to do some checks to 01713 # assure itself that what it's about to allow the RPKI engine to 01714 # publish is not dangerous toxic waste. 01715 # 01716 # The up-down protocol includes a mechanism by which a parent can 01717 # suggest a %publication URI to each of its children. The children are 01718 # not required to accept this hint, and the children must make separate 01719 # arrangements with the repository operator (who might or might not be 01720 # the same as the entity that hosts the children's RPKI engine 01721 # operations) to use the suggested %publication point, but if everything 01722 # works out, this allows children to nest cleanly under their parents 01723 # %publication points, which helps reduce synchronization time for 01724 # relying parties. 01725 # 01726 # In this case, one could argue that the %publication server is 01727 # responsible for preventing one of its clients (the child in the above 01728 # description) from stomping on data published by another of its clients 01729 # (the parent in the above description). This goes beyond the basic 01730 # access check and requires the %publication server to determine whether 01731 # the parent has given its consent for the child to publish under the 01732 # parent. Since the RPKI certificate profile requires the child's 01733 # %publication point to be indicated in an SIA extension in a certificate 01734 # issued by the parent to the child, the %publication engine can infer 01735 # this permission from the parent's issuance of a certificate to the 01736 # child. Since, by definition, the parent also uses this %publication 01737 # server, this is an easy check, as the %publication server should 01738 # already have the parent's certificate available by the time it needs 01739 # to check the child's certificate. 01740 # 01741 # The previous paragraph only covers a "publish" action for a 01742 # <certificate/> %object. For "publish" actions on other 01743 # objects, the %publication server would need to trace permission back 01744 # to the certificate issued by the parent; for "withdraw" actions, 01745 # the %publication server would have to perform the same checks it 01746 # would perform for a "publish" action, using the current published 01747 # data before withdrawing it. The latter in turn implies an ordering 01748 # constraint on "withdraw" actions in order to preserve the data 01749 # necessary for these access control decisions; as this may prove 01750 # impractical, the %publication server may probably need to make 01751 # periodic sweeps over its published data looking for orphaned 01752 # objects, but that's probably a good idea anyway. 01753 # 01754 # Note that, in this %publication model, any agreement that the 01755 # repository makes to publish the RPKI engine's output is conditional 01756 # upon the %object to be published passing whatever access control checks 01757 # the %publication server imposes. 01758 01759 ## @page sql-schemas SQL database schemas 01760 # 01761 # @li @subpage rpkid-sql "rpkid database schema" 01762 # @li @subpage pubd-sql "pubd database schema" 01763 # @li @subpage irdbd-sql "irdbd database schema" 01764 01765 ## @page rpkid-sql rpkid SQL schema 01766 # 01767 # @dotfile rpkid.dot "Diagram of rpkid.sql" 01768 # 01769 # @verbinclude rpkid.sql 01770 01771 ## @page pubd-sql pubd SQL Schema 01772 # 01773 # @dotfile pubd.dot "Diagram of pubd.sql" 01774 # 01775 # @verbinclude pubd.sql 01776 01777 ## @page irdbd-sql irdbd SQL Schema 01778 # 01779 # @dotfile irdbd.dot "Diagram of irdbd.sql" 01780 # 01781 # @verbinclude irdbd.sql 01782 01783 ## @page bpki-model BPKI model 01784 # 01785 # The "business PKI" (BPKI) is the PKI used to authenticate 01786 # communication on the up-down, left-right, and %publication protocols. 01787 # BPKI certificates are @em not resource PKI (RPKI) certificates. The 01788 # BPKI is a separate PKI that represents relationships between the 01789 # various entities involved in the production side of the RPKI system. 01790 # In most cases the BPKI tree will follow existing business 01791 # relationships, hence the name "BPKI". 01792 # 01793 # Setup of the BPKI is handled by the back end; for the most part, 01794 # rpkid and pubd just use the result. The one place where the engines 01795 # are directly involved in creation of new BPKI certificates is in the 01796 # production of end-entity certificates for use by the engines. 01797 # 01798 # There are a few design principals that underly the chosen BPKI model: 01799 # @li Each engine should rely on a single BPKI trust anchor which is 01800 # controlled by the back end entity that runs the engine; all 01801 # other trust material should be cross-certified into the engine's 01802 # BPKI tree. 01803 # @li Private keys must never transit the network. 01804 # @li Except for end entity certificates, the engine should only have 01805 # access to the BPKI certificates; in particular, the private key 01806 # for the BPKI trust anchor should not be accessible to the engine. 01807 # @li The number of BPKI keys and certificates that the engine has to 01808 # manage should be no larger than is necessary. 01809 # 01810 # rpkid's hosting model adds an additional constraint: rpkid's BPKI 01811 # trust anchor belongs to the entity operating rpkid, but the entities 01812 # hosted by rpkid should have control of their own BPKI private keys. 01813 # This implies the need for an additional layer of BPKI certificate 01814 # hierarchy within rpkid. 01815 # 01816 # Here is a simplified picture of what the BPKI might look like for an 01817 # rpkid operator that hosts two entities, "Alice" and "Ellen": 01818 # 01819 # @dot 01820 # // Color code: 01821 # // Black: Hosting entity 01822 # // Blue: Hosted entity 01823 # // Red: Cross-certified peer 01824 # // 01825 # // Shape code: 01826 # // Octagon: TA 01827 # // Diamond: CA 01828 # // Record: EE 01829 # 01830 # digraph bpki_rpkid { 01831 # splines = true; 01832 # size = "14,14"; 01833 # node [ fontname = Times, fontsize = 9 ]; 01834 # 01835 # // Hosting entity 01836 # node [ color = black, shape = record ]; 01837 # TA [ shape = octagon, label = "BPKI TA" ]; 01838 # rpkid [ label = "rpkid|{HTTPS server|HTTPS left-right client|CMS left-right}" ]; 01839 # irdbd [ label = "irdbd|{HTTPS left-right server|CMS left-right}" ]; 01840 # irbe [ label = "IRBE|{HTTPS left-right client|CMS left-right}" ]; 01841 # 01842 # // Hosted entities 01843 # node [ color = blue, fontcolor = blue ]; 01844 # Alice_CA [ shape = diamond ]; 01845 # Alice_EE [ label = "Alice\nBSC EE|{HTTPS up-down client|CMS up-down}" ]; 01846 # Ellen_CA [ shape = diamond ]; 01847 # Ellen_EE [ label = "Ellen\nBSC EE|{HTTPS up-down client|CMS up-down}" ]; 01848 # 01849 # // Peers 01850 # node [ color = red, fontcolor = red, shape = diamond ]; 01851 # Bob_CA; 01852 # Carol_CA; 01853 # Dave_CA; 01854 # Frank_CA; 01855 # Ginny_CA; 01856 # Harry_CA; 01857 # node [ shape = record ]; 01858 # Bob_EE [ label = "Bob\nEE|{HTTPS up-down|CMS up-down}" ]; 01859 # Carol_EE [ label = "Carol\nEE|{HTTPS up-down|CMS up-down}" ]; 01860 # Dave_EE [ label = "Dave\nEE|{HTTPS up-down|CMS up-down}" ]; 01861 # Frank_EE [ label = "Frank\nEE|{HTTPS up-down|CMS up-down}" ]; 01862 # Ginny_EE [ label = "Ginny\nEE|{HTTPS up-down|CMS up-down}" ]; 01863 # Harry_EE [ label = "Bob\nEE|{HTTPS up-down|CMS up-down}" ]; 01864 # 01865 # edge [ color = black, style = solid ]; 01866 # TA -> Alice_CA; 01867 # TA -> Ellen_CA; 01868 # 01869 # edge [ color = black, style = dotted ]; 01870 # TA -> rpkid; 01871 # TA -> irdbd; 01872 # TA -> irbe; 01873 # 01874 # edge [ color = blue, style = solid ]; 01875 # Alice_CA -> Bob_CA; 01876 # Alice_CA -> Carol_CA; 01877 # Alice_CA -> Dave_CA; 01878 # Ellen_CA -> Frank_CA; 01879 # Ellen_CA -> Ginny_CA; 01880 # Ellen_CA -> Harry_CA; 01881 # 01882 # edge [ color = blue, style = dotted ]; 01883 # Alice_CA -> Alice_EE; 01884 # Ellen_CA -> Ellen_EE; 01885 # 01886 # edge [ color = red, style = solid ]; 01887 # Bob_CA -> Bob_EE; 01888 # Carol_CA -> Carol_EE; 01889 # Dave_CA -> Dave_EE; 01890 # Frank_CA -> Frank_EE; 01891 # Ginny_CA -> Ginny_EE; 01892 # Harry_CA -> Harry_EE; 01893 # } 01894 # @enddot 01895 # 01896 # Black objects belong to the hosting entity, blue objects belong to 01897 # the hosted entities, red objects are cross-certified objects from 01898 # the hosted entities' peers. The arrows indicate certificate 01899 # issuance: solid arrows are the ones that rpkid will care about 01900 # during certificate validation, dotted arrows show the origin of the 01901 # EE certificates that rpkid uses to sign CMS and TLS messages. 01902 # 01903 # There's one nasty bit where the model had to bend to fit the current 01904 # state of the underlying protocols: it's not possible to use exactly 01905 # the same BPKI keys and certificates for HTTPS and CMS. The reason 01906 # for this is simple: each hosted entity has its own BPKI, as does the 01907 # hosting entity, but the HTTPS listener is shared. The only ways to 01908 # avoid sharing the HTTPS server certificate would be to use separate 01909 # listeners for each hosted entity, which scales poorly, or to rely on 01910 # the TLS "Server Name Indication" extension (RFC 4366 3.1) which is 01911 # not yet widely implemented. 01912 # 01913 # The certificate tree looks complicated, but the set of certificates 01914 # needed to build any particular validation chain is obvious, again 01915 # excepting the HTTPS server case, where the client certificate is the 01916 # first hint that the engine has of the client's identity, so the 01917 # server must be prepared to accept any current client certificate. 01918 # 01919 # Detailed instructions on how to build a BPKI are beyond the scope of 01920 # this document, but one can handle simple cases using the OpenSSL 01921 # command line tool and cross_certify.py; the latter is a tool 01922 # designed specifically for the purpose of generating the 01923 # cross-certification certificates needed to splice foreign trust 01924 # material into a BPKI tree. 01925 # 01926 # The BPKI tree for a pubd instance is similar to to the BPKI tree for 01927 # an rpkid instance, but is a bit simpler, as pubd does not provide 01928 # hosting in the same sense that rpkid does: pubd is a relatively 01929 # simple server that publishes objects as instructed by its clients. 01930 # 01931 # Here's a simplified picture of what the BPKI might look like for a 01932 # pubd operator that serves two clients, "Alice" and "Bob": 01933 # 01934 # @dot 01935 # // Color code: 01936 # // Black: Operating entity 01937 # // Red: Cross-certified client 01938 # // 01939 # // Shape code: 01940 # // Octagon: TA 01941 # // Diamond: CA 01942 # // Record: EE 01943 # 01944 # digraph bpki_pubd { 01945 # splines = true; 01946 # size = "14,14"; 01947 # node [ fontname = Times, fontsize = 9 ]; 01948 # 01949 # // Operating entity 01950 # node [ color = black, fontcolor = black, shape = record ]; 01951 # TA [ shape = octagon, label = "BPKI TA" ]; 01952 # pubd [ label = "pubd|{HTTPS server|CMS}" ]; 01953 # ctl [ label = "Control|{HTTPS client|CMS}" ]; 01954 # 01955 # // Clients 01956 # node [ color = red, fontcolor = red, shape = diamond ]; 01957 # Alice_CA; 01958 # Bob_CA; 01959 # node [ color = red, fontcolor = red, shape = record ]; 01960 # Alice_EE [ label = "Alice\nEE|{HTTPS client|CMS}" ]; 01961 # Bob_EE [ label = "Bob\nEE|{HTTPS client|CMS}" ]; 01962 # 01963 # edge [ color = black, style = dotted ]; 01964 # TA -> pubd; 01965 # TA -> ctl; 01966 # 01967 # edge [ color = black, style = solid ]; 01968 # TA -> Alice_CA; 01969 # TA -> Bob_CA; 01970 # 01971 # edge [ color = red, style = solid ]; 01972 # Alice_CA -> Alice_EE; 01973 # Bob_CA -> Bob_EE; 01974 # } 01975 # @enddot 01976 # 01977 # While it is likely that RIRs (at least) will operate both rpkid and 01978 # pubd instances, the two functions are conceptually separate. As far 01979 # as pubd is concerned, it doesn't matter who operates the rpkid 01980 # instance: pubd just has clients, each of which has trust material 01981 # that has been cross-certified into pubd's BPKI. Similarly, rpkid 01982 # doesn't really care who operates a pubd instance that it's been 01983 # configured to use, it just treats that pubd as a foreign BPKI whose 01984 # trust material has to be cross-certified into its own BPKI. Cross 01985 # certification itself is done by the back end operator, using 01986 # cross_certify or some equivalent tool; the resulting BPKI 01987 # certificates are configured into rpkid and pubd via the left-right 01988 # protocol and the control subprotocol of the publication protocol, 01989 # respectively. 01990 # 01991 # Because the BPKI tree is almost entirely controlled by the operating 01992 # entity, CRLs are not necessary for most of the BPKI. The one 01993 # exception to this is the EE certificates issued under the 01994 # cross-certification points. These EE certificates are generated by 01995 # the peer, not the local operator, and thus require CRLs. Because of 01996 # this, both rpkid and pubd require regular updates of certain BPKI 01997 # CRLs, again via the left-right and publication control protocols. 01998 # 01999 # Because the left-right protocol and the publication control 02000 # subprotocol are used to configure BPKI certificates and CRLs, they 02001 # cannot themselves use certificates and CRLs configured in this way. 02002 # This is why the configuration files for rpkid and pubd require 02003 # static configuration of the left-right and publication control 02004 # certificates. 02005 02006 # Local Variables: 02007 # compile-command: "cd .. && make doc" 02008 # End: