00001 # $Id: __init__.py 2510 2009-06-09 20:25:16Z 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 --*_id options refer to the primary keys of previously created 00676 # objects. 00677 # 00678 # The remaining options are specific to the particular commands, and 00679 # follow directly from the protocol specifications. 00680 # 00681 # A trailing "=" in the above option summary indicates that an option 00682 # takes a value, eg, "--action create" or "--action=create". Options 00683 # without a trailing "=" correspond to boolean control attributes. 00684 # 00685 # The default %config file for irbe_cli is irbe_cli.conf, start 00686 # irbe_cli with "-c filename" (or "--config filename") to choose a 00687 # different %config file. All options are in the section 00688 # "[irbe_cli]". Certificates, keys, and trust anchors may be in 00689 # either DER or PEM format. 00690 # 00691 # %Config file options: 00692 # 00693 # @li @c rpkid-bpki-ta: 00694 # Name of file containing BPKI trust anchor to 00695 # use when authenticating messages from rpkid. 00696 # 00697 # @li @c rpkid-irbe-cert: 00698 # Name of file containing BPKI certificate 00699 # irbe_cli should use when talking to rpkid. 00700 # 00701 # @li @c rpkid-irbe-key: 00702 # Name of file containing RSA key corresponding to 00703 # rpkid-irbe-cert. 00704 # 00705 # @li @c rpkid-cert: 00706 # Name of file containing rpkid's BPKI certificate. 00707 # 00708 # @li @c rpkid-url: 00709 # Service URL for rpkid. Must be a %https:// URL. 00710 # 00711 # @li @c pubd-bpki-ta: 00712 # Name of file containing BPKI trust anchor to 00713 # use when authenticating messages from pubd. 00714 # 00715 # @li @c pubd-irbe-cert: 00716 # Name of file containing BPKI certificate 00717 # irbe_cli should use when talking to pubd. 00718 # 00719 # @li @c pubd-irbe-key: 00720 # Name of file containing RSA key corresponding to 00721 # pubd-irbe-cert. 00722 # 00723 # @li @c pubd-cert: 00724 # Name of file containing pubd's BPKI certificate. 00725 # 00726 # @li @c pubd-url: 00727 # Service URL for pubd. Must be a %https:// URL. 00728 # 00729 # 00730 # 00731 # @section cross_certify cross_certify.py 00732 # 00733 # cross_certify.py is a small tool to extract certain fields from an 00734 # existing X.509 certificate and generate issue a new certificate that 00735 # can be used as part of a cross-certification chain. cross_certify 00736 # doesn't take a config file, all of its arguments are specified on 00737 # the command line. 00738 # 00739 # @verbatim 00740 # python cross_certify.py { -i | --in } input_cert 00741 # { -c | --ca } issuing_cert 00742 # { -k | --key } issuing_cert_key 00743 # { -s | --serial } serial_filename 00744 # [ { -h | --help } ] 00745 # [ { -o | --out } filename ] 00746 # [ { -l | --lifetime } timedelta ] 00747 # @endverbatim 00748 # 00749 # 00750 # @section irbe_setup irbe-setup.py config file 00751 # 00752 # @warning 00753 # irbe-setup is old code, not currently used, kept in case it is 00754 # useful at some later date. It may not work properly or at all. If 00755 # you don't understand what it does, you don't need it. You have been 00756 # warned. 00757 # 00758 # The default %config file is irbe.conf, start rpkid with "-c filename" 00759 # to choose a different %config file. Most options are in the section 00760 # "[irbe_cli]", but a few are in the section "[irdbd]". Certificates, 00761 # keys, and trust anchors may be in either DER or PEM format. 00762 # 00763 # Options in the "[irbe_cli]" section: 00764 # 00765 # @li @c bpki-ta: 00766 # Name of file containing BPKI trust anchor. 00767 # 00768 # @li @c irbe-cert: 00769 # Name of file containing BPKI certificate 00770 # irbe-setup should use. 00771 # 00772 # @li @c irbe-key: 00773 # Name of file containing RSA key corresponding 00774 # to irbe-cert. 00775 # 00776 # @li @c rpkid-cert: 00777 # Name of file containing rpkid's BPKI 00778 # certificate. 00779 # 00780 # @li @c https-url: 00781 # Service URL for rpkid. Must be a %https:// URL. 00782 # 00783 # Options in the "[irdbd]" section: 00784 # 00785 # @li @c sql-username: 00786 # Username to hand to MySQL when connecting to 00787 # irdbd's database. 00788 # 00789 # @li @c sql-database: 00790 # MySQL's database name for irdbd's database. 00791 # 00792 # @li @c sql-password: 00793 # Password to hand to MySQL when connecting to 00794 # irdbd's database. 00795 # 00796 # 00797 # @section cronjob cronjob.py 00798 # 00799 # This is a trivial program to trigger a cron run within rpkid. Once 00800 # rpkid has been converted to the planned event-driven model, this 00801 # function will be handled internally, but for now it has to be 00802 # triggered by an external program. For pseudo-production use one would 00803 # run this program under the system cron daemon. For scripted testing 00804 # it happens to be useful to be able to control when cron cycles occur, 00805 # so at the current stage of code development use of an external trigger 00806 # is a useful feature. 00807 # 00808 # The default %config file is cronjob.conf, start cronjob with "-c 00809 # filename" to choose a different %config file. All options are in the 00810 # section "[cronjob]". Certificates, keys, and trust anchors may be in 00811 # either DER or PEM format. 00812 # 00813 # %Config file options: 00814 # 00815 # @li @c bpki-ta: 00816 # Name of file containing BPKI trust anchor. 00817 # 00818 # @li @c irbe-cert: 00819 # Name of file containing cronjob.py's BPKI 00820 # certificate. 00821 # 00822 # @li @c https-key: 00823 # Name of file containing RSA key corresponding 00824 # to irbe-cert. 00825 # 00826 # @li @c rpkid-cert: 00827 # Name of file containing rpkid's BPKI certificate. 00828 # 00829 # @li @c https-url: 00830 # Service URL for rpkid. Must be a %https:// URL. 00831 # 00832 # 00833 # @section testbed testbed.py: 00834 # 00835 # testbed is a test harness to set up and run a collection of rpkid and 00836 # irdbd instances under scripted control. testbed is a very recent 00837 # addition to the toolset and is still evolving rapidly. 00838 # 00839 # Unlike the programs described above, testbed takes two configuration 00840 # files in different languages. The first configuration file uses the 00841 # same syntax as the above configuration files but is completely 00842 # optional. The second configuration file is the test script, which is 00843 # encoded using the YAML serialization language (see 00844 # http://www.yaml.org/ for more information on YAML). The YAML script 00845 # is not optional, as it describes the test layout. testbed is designed 00846 # to support running a fairly wide set of test configurations as canned 00847 # scripts without writing any new control code. The intent is to make 00848 # it possible to write meaningful regression tests. 00849 # 00850 # All of the options in in the first (optional) configuration file are 00851 # just overrides for wired-in default values. In most cases the 00852 # defaults will suffice, and the set of options is still in flux, so 00853 # only a few of the options are described here. The default name for 00854 # this configuration file is testbed.conf, run testbed with "-c 00855 # filename" to change it. 00856 # 00857 # testbed.conf options: 00858 # 00859 # @li @c testbed_dir: 00860 # Working directory into which testbed should write the 00861 # (many) files it generates. Default is "testbed.dir". 00862 # 00863 # @li @c irdb_db_pass: 00864 # MySQL password for the "irdb" user. Default is 00865 # "fnord". You may want to override this. 00866 # 00867 # @li @c rpki_db_pass: 00868 # MySQL password for the "rpki" user. Default is 00869 # "fnord". You may want to override this. 00870 # 00871 # @li @c rootd_sia: 00872 # rsync URI naming a (perhaps fictious) directory to use 00873 # as the id-ad-caRepository SIA value in the generated 00874 # root resource certificate. Default is 00875 # "rsync://wombat.invalid/". You may want to override 00876 # this if you intend to run an rsync server and test 00877 # against the generated results using rcynic. This 00878 # default will likely change if and when testbed learns 00879 # how to run rcynic itself as part of the test suite. 00880 # 00881 # The second configuration file is named testbed.yaml by default, run 00882 # testbed with "-y filename" to change it. The YAML file contains 00883 # multiple YAML "documents". The first document describes the initial 00884 # test layout and resource allocations, subsequent documents describe 00885 # modifications to the initial allocations and other parameters. 00886 # Resources listed in the initial layout are aggregated automatically, 00887 # so that a node in the resource hierarchy automatically receives the 00888 # resources it needs to issue whatever its children are listed as 00889 # holding. Actions in the subsequent documents are modifications to the 00890 # current resource set, modifications to validity dates or other 00891 # non-resource parameters, or special commands like "sleep". The 00892 # details are still evolving, but here's an example of current usage: 00893 # 00894 # @verbatim 00895 # name: RIR 00896 # valid_for: 2d 00897 # sia_base: "rsync://wombat.invalid/" 00898 # kids: 00899 # - name: LIR0 00900 # kids: 00901 # - name: Alice 00902 # ipv4: 192.0.2.1-192.0.2.33 00903 # asn: 64533 00904 # --- 00905 # - name: Alice 00906 # valid_add: 10 00907 # --- 00908 # - name: Alice 00909 # add_as: 33 00910 # valid_add: 2d 00911 # --- 00912 # - name: Alice 00913 # valid_sub: 2d 00914 # --- 00915 # - name: Alice 00916 # valid_for: 10d 00917 # @endverbatim 00918 # 00919 # This specifies an initial layout consisting of an RPKI engine named 00920 # "RIR", with one child "LIR0", which in turn has one child "Alice". 00921 # Alice has a set of assigned resources, and all resources in the system 00922 # are initially set to be valid for two days from the time at which the 00923 # test is started. The first subsequent document adds ten seconds to 00924 # the validity interval for Alice's resources and makes no other 00925 # modifications. The second subsequent document grants Alice additional 00926 # resources and adds another two days to the validity interval for 00927 # Alice's resources. The next document subtracts two days from the 00928 # validity interval for Alice's resources. The final document sets the 00929 # validity interval for Alice's resources to ten days. 00930 # 00931 # Operators in subsequent (update) documents: 00932 # 00933 # @li @c add_as, @c add_v4, @c add_v6: 00934 # These add ASN, IPv4, or IPv6 resources, respectively. 00935 # 00936 # @li @c sub_as, @c sub_v4, @c sub_v6: 00937 # These subtract resources. 00938 # 00939 # @li @c valid_until: 00940 # Set an absolute expiration date. 00941 # 00942 # @li @c valid_for: 00943 # Set a relative expiration date. 00944 # 00945 # @li @c valid_add, @c valid_sub: 00946 # Add to or subtract from validity interval. 00947 # 00948 # @li @c sleep [interval]: 00949 # Sleep for specified interval, or until testbed receives a SIGALRM signal. 00950 # 00951 # Absolute timestamps should be in the form shown (UTC timestamp format 00952 # as used in XML). 00953 # 00954 # Intervals (@c valid_add, @c valid_sub, @c valid_for, @c sleep) are either 00955 # integers, in which case they're interpreted as seconds, or are a 00956 # string of the form "wD xH yM zS" where w, x, y, and z are integers and 00957 # D, H, M, and S indicate days, hours, minutes, and seconds. In the 00958 # latter case all of the fields are optional, but at least one must be 00959 # specified. For example, "3D4H" means "three days plus four hours". 00960 # 00961 # 00962 # @section testpoke testpoke.py 00963 # 00964 # This is a command-line client for the up-down protocol. Unlike all of 00965 # the above programs, testpoke does not accept a %config file in 00966 # OpenSSL-compatable format at all. Instead, it is configured 00967 # exclusively by a YAML script. testpoke's design was constrained by a 00968 # desire to have it be compatable with APNIC's rpki_poke.pl tool, so 00969 # that the two tools could use a common configuration language to 00970 # simplify scripted testing. There are minor variations due to slightly 00971 # different feature sets, but YAML files intended for one program will 00972 # usually work with the other. 00973 # 00974 # README for APNIC's tool describing the input language can be found at 00975 # <a href="http://mirin.apnic.net/svn/rpki_engine/branches/gary-poker/client/poke/README"> 00976 # http://mirin.apnic.net/svn/rpki_engine/branches/gary-poker/client/poke/README</a>. 00977 # 00978 # testpoke.py takes a simplified command line and uses only one YAML 00979 # input file. 00980 # 00981 # @verbatim 00982 # Usage: python testpoke.py [ { -y | --yaml } configfile ] 00983 # [ { -r | --request } requestname ] 00984 # [ { -h | --help } ] 00985 # @endverbatim 00986 # 00987 # Default configuration file is testpoke.yaml, override with --yaml 00988 # option. 00989 # 00990 # The --request option specifies the specific command within the YAML 00991 # file to execute. 00992 # 00993 # Sample configuration file: 00994 # 00995 # @verbatim 00996 # --- 00997 # # Sample YAML configuration file for testpoke.py 00998 # 00999 # version: 1 01000 # posturl: https://localhost:4433/up-down/1 01001 # recipient-id: wombat 01002 # sender-id: "1" 01003 # 01004 # cms-cert-file: biz-certs/Frank-EE.cer 01005 # cms-key-file: biz-certs/Frank-EE.key 01006 # cms-ca-cert-file: biz-certs/Bob-Root.cer 01007 # cms-cert-chain-file: [ biz-certs/Frank-CA.cer ] 01008 # 01009 # ssl-cert-file: biz-certs/Frank-EE.cer 01010 # ssl-key-file: biz-certs/Frank-EE.key 01011 # ssl-ca-cert-file: biz-certs/Bob-Root.cer 01012 # 01013 # requests: 01014 # list: 01015 # type: list 01016 # issue: 01017 # type: issue 01018 # class: 1 01019 # sia: [ "rsync://bandicoot.invalid/some/where/" ] 01020 # revoke: 01021 # type: revoke 01022 # class: 1 01023 # ski: "CB5K6APY-4KcGAW9jaK_cVPXKX0" 01024 # @endverbatim 01025 # 01026 # testpoke adds one extension to the language described in APNIC's 01027 # README: the cms-cert-chain-* and ssl-cert-chain-* options, which allow 01028 # one to specify a chain of intermediate certificates to be presented in 01029 # the CMS or TLS protocol. APNIC's initial implementation required 01030 # direct knowledge of the issuing certificate (ie, it supported a 01031 # maximum chain length of one); subsequent APNIC code changes have 01032 # probably relaxed this restriction, and with luck APNIC has copied 01033 # testpoke's syntax to express chains of intermediate certificates. 01034 01035 ## @page Left-right Left-right protocol 01036 # 01037 # The left-right protocol is really two separate client/server 01038 # protocols over separate channels between the RPKI engine and the IR 01039 # back end (IRBE). The IRBE is the client for one of the 01040 # subprotocols, the RPKI engine is the client for the other. 01041 # 01042 # @section Terminology 01043 # 01044 # @li @em IRBE: Internet Registry Back End 01045 # 01046 # @li @em IRDB: Internet Registry Data Base 01047 # 01048 # @li @em BPKI: Business PKI 01049 # 01050 # @li @em RPKI: Resource PKI 01051 # 01052 # @section Operations initiated by the IRBE 01053 # 01054 # This part of the protcol uses a kind of message-passing. Each %object 01055 # that the RPKI engine knows about takes five messages: "create", "set", 01056 # "get", "list", and "destroy". Actions which are not just data 01057 # operations on %objects are handled via an SNMP-like mechanism, as if 01058 # they were fields to be set. For example, to generate a keypair one 01059 # "sets" the "generate-keypair" field of a BSC %object, even though there 01060 # is no such field in the %object itself as stored in SQL. This is a bit 01061 # of a kludge, but the reason for doing it as if these were variables 01062 # being set is to allow composite operations such as creating a BSC, 01063 # populating all of its data fields, and generating a keypair, all as a 01064 # single operation. With this model, that's trivial, otherwise it's at 01065 # least two round trips. 01066 # 01067 # Fields can be set in either "create" or "set" operations, the 01068 # difference just being whether the %object already exists. A "get" 01069 # operation returns all visible fields of the %object. A "list" 01070 # operation returns a %list containing what "get" would have returned on 01071 # each of those %objects. 01072 # 01073 # Left-right protocol %objects are encoded as signed CMS messages 01074 # containing XML as eContent and using an eContentType OID of @c id-ct-xml 01075 # (1.2.840.113549.1.9.16.1.28). These CMS messages are in turn passed 01076 # as the data for HTTPS POST operations, with an HTTP content type of 01077 # "application/x-rpki" for both the POST data and the response data. 01078 # 01079 # All operations allow an optional "tag" attribute which can be any 01080 # alphanumeric token. The main purpose of the tag attribute is to allow 01081 # batching of multiple requests into a single PDU. 01082 # 01083 # @subsection self_obj <self/> object 01084 # 01085 # A @c <self/> %object represents one virtual RPKI engine. In simple cases 01086 # where the RPKI engine operator operates the engine only on their own 01087 # behalf, there will only be one @c <self/> %object, representing the engine 01088 # operator's organization, but in environments where the engine operator 01089 # hosts other entities, there will be one @c @c <self/> %object per hosted 01090 # entity (probably including the engine operator's own organization, 01091 # considered as a hosted customer of itself). 01092 # 01093 # Some of the RPKI engine's configured parameters and data are shared by 01094 # all hosted entities, but most are tied to a specific @c <self/> %object. 01095 # Data which are shared by all hosted entities are referred to as 01096 # "per-engine" data, data which are specific to a particular @c <self/> 01097 # %object are "per-self" data. 01098 # 01099 # Since all other RPKI engine %objects refer to a @c <self/> %object via a 01100 # "self_id" value, one must create a @c <self/> %object before one can 01101 # usefully configure any other left-right protocol %objects. 01102 # 01103 # Every @c <self/> %object has a self_id attribute, which must be specified 01104 # for the "set", "get", and "destroy" actions. 01105 # 01106 # Payload data which can be configured in a @c <self/> %object: 01107 # 01108 # @li @c use_hsm (attribute): 01109 # Whether to use a Hardware Signing Module. At present this option 01110 # has no effect, as the implementation does not yet support HSMs. 01111 # 01112 # @li @c crl_interval (attribute): 01113 # Positive integer representing the planned lifetime of an RPKI CRL 01114 # for this @c <self/>, measured in seconds. 01115 # 01116 # @li @c regen_margin (attribute): 01117 # Positive integer representing how long before expiration of an 01118 # RPKI certificiate a new one should be generated, measured in 01119 # seconds. At present this only affects the one-off EE certificates 01120 # associated with ROAs. 01121 # 01122 # @li @c bpki_cert (element): 01123 # BPKI CA certificate for this @c <self/>. This is used as part of the 01124 # certificate chain when validating incoming TLS and CMS messages, 01125 # and should be the issuer of cross-certification BPKI certificates 01126 # used in @c <repository/>, @c <parent/>, and @c <child/> %objects. If the 01127 # bpki_glue certificate is in use (below), the bpki_cert certificate 01128 # should be issued by the bpki_glue certificate; otherwise, the 01129 # bpki_cert certificate should be issued by the per-engine bpki_ta 01130 # certificate. 01131 # 01132 # @li @c bpki_glue (element): 01133 # Another BPKI CA certificate for this @c <self/>, usually not needed. 01134 # Certain pathological cross-certification cases require a 01135 # two-certificate chain due to issuer name conflicts. If used, the 01136 # bpki_glue certificate should be the issuer of the bpki_cert 01137 # certificate and should be issued by the per-engine bpki_ta 01138 # certificate; if not needed, the bpki_glue certificate should be 01139 # left unset. 01140 # 01141 # Control attributes that can be set to "yes" to force actions: 01142 # 01143 # @li @c rekey: 01144 # Start a key rollover for every RPKI CA associated with every 01145 # @c <parent/> %object associated with this @c <self/> %object. This is the 01146 # first phase of a key rollover operation. 01147 # 01148 # @li @c revoke: 01149 # Revoke any remaining certificates for any expired key associated 01150 # with any RPKI CA for any @c <parent/> %object associated with this 01151 # @c <self/> %object. This is the second (cleanup) phase for a key 01152 # rollover operation; it's separate from the first phase to leave 01153 # time for new RPKI certificates to propegate and be installed. 01154 # 01155 # @li @c reissue: 01156 # Not implemented, may be removed from protocol. Original theory 01157 # was that this operation would force reissuance of any %object with 01158 # a changed key, but as that happens automatically as part of the 01159 # key rollover mechanism this operation seems unnecessary. 01160 # 01161 # @li @c run_now: 01162 # Force immediate processing for all tasks associated with this 01163 # @c <self/> %object that would ordinarily be performed under cron. Not 01164 # currently implemented. 01165 # 01166 # @li @c publish_world_now: 01167 # Force (re)publication of every publishable %object for this @c <self/> 01168 # %object. Not currently implemented. Intended to aid in recovery 01169 # if RPKI engine and publication engine somehow get out of sync. 01170 # 01171 # 01172 # @subsection bsc_obj <bsc/> object 01173 # 01174 # The @c <bsc/> ("business signing context") %object represents all the BPKI 01175 # data needed to sign outgoing CMS or HTTPS messages. Various other 01176 # %objects include pointers to a @c <bsc/> %object. Whether a particular 01177 # @c <self/> uses only one @c <bsc/> or multiple is a configuration decision 01178 # based on external requirements: the RPKI engine code doesn't care, it 01179 # just cares that, for any %object representing a relationship for which 01180 # it must sign messages, there be a @c <bsc/> %object that it can use to 01181 # produce that signature. 01182 # 01183 # Every @c <bsc/> %object has a bsc_id, which must be specified for the 01184 # "get", "set", and "destroy" actions. Every @c <bsc/> also has a self_id 01185 # attribute which indicates the @c <self/> %object with which this @c <bsc/> 01186 # %object is associated. 01187 # 01188 # Payload data which can be configured in a @c <isc/> %object: 01189 # 01190 # @li @c signing_cert (element): 01191 # BPKI certificate to use when generating a signature. 01192 # 01193 # @li @c signing_cert_crl (element): 01194 # CRL which would %list signing_cert if it had been revoked. 01195 # 01196 # Control attributes that can be set to "yes" to force actions: 01197 # 01198 # @li @c generate_keypair: 01199 # Generate a new BPKI keypair and return a PKCS #10 certificate 01200 # request. The resulting certificate, once issued, should be 01201 # configured as this @c <bsc/> %object's signing_cert. 01202 # 01203 # Additional attributes which may be specified when specifying 01204 # "generate_keypair": 01205 # 01206 # @li @c key_type: 01207 # Type of BPKI keypair to generate. "rsa" is both the default and, 01208 # at the moment, the only allowed value. 01209 # 01210 # @li @c hash_alg: 01211 # Cryptographic hash algorithm to use with this keypair. "sha256" 01212 # is both the default and, at the moment, the only allowed value. 01213 # 01214 # @li @c key_length: 01215 # Length in bits of the keypair to be generated. "2048" is both the 01216 # default and, at the moment, the only allowed value. 01217 # 01218 # Replies to "create" and "set" actions that specify "generate-keypair" 01219 # include a <bsc_pkcs10/> element, as do replies to "get" and "list" 01220 # actions for a @c <bsc/> %object for which a "generate-keypair" command has 01221 # been issued. The RPKI engine stores the PKCS #10 request, which 01222 # allows the IRBE to reuse the request if and when it needs to reissue 01223 # the corresponding BPKI signing certificate. 01224 # 01225 # @subsection parent_obj <parent/> object 01226 # 01227 # The @c <parent/> %object represents the RPKI engine's view of a particular 01228 # parent of the current @c <self/> %object in the up-down protocol. Due to 01229 # the way that the resource hierarchy works, a given @c <self/> may obtain 01230 # resources from multiple parents, but it will always have at least one; 01231 # in the case of IANA or an RIR, the parent RPKI engine may be a trivial 01232 # stub. 01233 # 01234 # Every @c <parent/> %object has a parent_id, which must be specified for 01235 # the "get", "set", and "destroy" actions. Every @c <parent/> also has a 01236 # self_id attribute which indicates the @c <self/> %object with which this 01237 # @c <parent/> %object is associated, a bsc_id attribute indicating the @c <bsc/> 01238 # %object to be used when signing messages sent to this parent, and a 01239 # repository_id indicating the @c <repository/> %object to be used when 01240 # publishing issued by the certificate issued by this parent. 01241 # 01242 # Payload data which can be configured in a @c <parent/> %object: 01243 # 01244 # @li @c peer_contact_uri (attribute): 01245 # HTTPS URI used to contact this parent. 01246 # 01247 # @li @c sia_base (attribute): 01248 # The leading portion of an rsync URI that the RPKI engine should 01249 # use when composing the publication URI for %objects issued by the 01250 # RPKI certificate issued by this parent. 01251 # 01252 # @li @c sender_name (attribute): 01253 # Sender name to use in the up-down protocol when talking to this 01254 # parent. The RPKI engine doesn't really care what this value is, 01255 # but other implementations of the up-down protocol do care. 01256 # 01257 # @li @c recipient_name (attribute): 01258 # Recipient name to use in the up-down protocol when talking to this 01259 # parent. The RPKI engine doesn't really care what this value is, 01260 # but other implementations of the up-down protocol do care. 01261 # 01262 # @li @c bpki_cms_cert (element): 01263 # BPKI CMS CA certificate for this @c <parent/>. This is used as part 01264 # of the certificate chain when validating incoming CMS messages If 01265 # the bpki_cms_glue certificate is in use (below), the bpki_cms_cert 01266 # certificate should be issued by the bpki_cms_glue certificate; 01267 # otherwise, the bpki_cms_cert certificate should be issued by the 01268 # bpki_cert certificate in the @c <self/> %object. 01269 # 01270 # @li @c bpki_cms_glue (element): 01271 # Another BPKI CMS CA certificate for this @c <parent/>, usually not 01272 # needed. Certain pathological cross-certification cases require a 01273 # two-certificate chain due to issuer name conflicts. If used, the 01274 # bpki_cms_glue certificate should be the issuer of the 01275 # bpki_cms_cert certificate and should be issued by the bpki_cert 01276 # certificate in the @c <self/> %object; if not needed, the 01277 # bpki_cms_glue certificate should be left unset. 01278 # 01279 # @li @c bpki_https_cert (element): 01280 # BPKI HTTPS CA certificate for this @c <parent/>. This is like the 01281 # bpki_cms_cert %object, only used for validating incoming TLS 01282 # messages rather than CMS. 01283 # 01284 # @li @c bpki_cms_glue (element): 01285 # Another BPKI HTTPS CA certificate for this @c <parent/>, usually not 01286 # needed. This is like the bpki_cms_glue certificate, only used for 01287 # validating incoming TLS messages rather than CMS. 01288 # 01289 # Control attributes that can be set to "yes" to force actions: 01290 # 01291 # @li @c rekey: 01292 # This is like the rekey command in the @c <self/> %object, but limited 01293 # to RPKI CAs under this parent. 01294 # 01295 # @li @c reissue: 01296 # This is like the reissue command in the @c <self/> %object, but limited 01297 # to RPKI CAs under this parent. 01298 # 01299 # @li @c revoke: 01300 # This is like the revoke command in the @c <self/> %object, but limited 01301 # to RPKI CAs under this parent. 01302 # 01303 # @subsection child_obj <child/> object 01304 # 01305 # The @c <child/> %object represents the RPKI engine's view of particular 01306 # child of the current @c <self/> in the up-down protocol. 01307 # 01308 # Every @c <child/> %object has a parent_id, which must be specified for the 01309 # "get", "set", and "destroy" actions. Every @c <child/> also has a 01310 # self_id attribute which indicates the @c <self/> %object with which this 01311 # @c <child/> %object is associated. 01312 # 01313 # Payload data which can be configured in a @c <child/> %object: 01314 # 01315 # @li @c bpki_cert (element): 01316 # BPKI CA certificate for this @c <child/>. This is used as part of 01317 # the certificate chain when validating incoming TLS and CMS 01318 # messages. If the bpki_glue certificate is in use (below), the 01319 # bpki_cert certificate should be issued by the bpki_glue 01320 # certificate; otherwise, the bpki_cert certificate should be issued 01321 # by the bpki_cert certificate in the @c <self/> %object. 01322 # 01323 # @li @c bpki_glue (element): 01324 # Another BPKI CA certificate for this @c <child/>, usually not needed. 01325 # Certain pathological cross-certification cases require a 01326 # two-certificate chain due to issuer name conflicts. If used, the 01327 # bpki_glue certificate should be the issuer of the bpki_cert 01328 # certificate and should be issued by the bpki_cert certificate in 01329 # the @c <self/> %object; if not needed, the bpki_glue certificate 01330 # should be left unset. 01331 # 01332 # Control attributes that can be set to "yes" to force actions: 01333 # 01334 # @li @c reissue: 01335 # Not implemented, may be removed from protocol. 01336 # 01337 # @subsection repository_obj <repository/> object 01338 # 01339 # The @c <repository/> %object represents the RPKI engine's view of a 01340 # particular publication repository used by the current @c <self/> %object. 01341 # 01342 # Every @c <repository/> %object has a repository_id, which must be 01343 # specified for the "get", "set", and "destroy" actions. Every 01344 # @c <repository/> also has a self_id attribute which indicates the @c <self/> 01345 # %object with which this @c <repository/> %object is associated. 01346 # 01347 # Payload data which can be configured in a @c <repository/> %object: 01348 # 01349 # @li @c peer_contact_uri (attribute): 01350 # HTTPS URI used to contact this repository. 01351 # 01352 # @li @c bpki_cms_cert (element): 01353 # BPKI CMS CA certificate for this @c <repository/>. This is used as part 01354 # of the certificate chain when validating incoming CMS messages If 01355 # the bpki_cms_glue certificate is in use (below), the bpki_cms_cert 01356 # certificate should be issued by the bpki_cms_glue certificate; 01357 # otherwise, the bpki_cms_cert certificate should be issued by the 01358 # bpki_cert certificate in the @c <self/> %object. 01359 # 01360 # @li @c bpki_cms_glue (element): 01361 # Another BPKI CMS CA certificate for this @c <repository/>, usually not 01362 # needed. Certain pathological cross-certification cases require a 01363 # two-certificate chain due to issuer name conflicts. If used, the 01364 # bpki_cms_glue certificate should be the issuer of the 01365 # bpki_cms_cert certificate and should be issued by the bpki_cert 01366 # certificate in the @c <self/> %object; if not needed, the 01367 # bpki_cms_glue certificate should be left unset. 01368 # 01369 # @li @c bpki_https_cert (element): 01370 # BPKI HTTPS CA certificate for this @c <repository/>. This is like the 01371 # bpki_cms_cert %object, only used for validating incoming TLS 01372 # messages rather than CMS. 01373 # 01374 # @li @c bpki_cms_glue (element): 01375 # Another BPKI HTTPS CA certificate for this @c <repository/>, usually not 01376 # needed. This is like the bpki_cms_glue certificate, only used for 01377 # validating incoming TLS messages rather than CMS. 01378 # 01379 # At present there are no control attributes for @c <repository/> %objects. 01380 # 01381 # @subsection route_origin_obj <route_origin/> object 01382 # 01383 # This section is out-of-date. The @c <route_origin/> %object 01384 # has been replaced by the @c <list_roa_requests/> IRDB query, 01385 # but the documentation for that hasn't been written yet. 01386 # 01387 # The @c <route_origin/> %object is a kind of prototype for a ROA. It 01388 # contains all the information needed to generate a ROA once the RPKI 01389 # engine obtains the appropriate RPKI certificates from its parent(s). 01390 # 01391 # Note that a @c <route_origin/> %object represents a ROA to be generated on 01392 # behalf of @c <self/>, not on behalf of a @c <child/>. Thus, a hosted entity 01393 # that has no children but which does need to generate ROAs would be 01394 # represented by a hosted @c <self/> with no @c <child/> %objects but one or 01395 # more @c <route_origin/> %objects. While lumping ROA generation in with 01396 # the other RPKI engine activities may seem a little odd at first, it's 01397 # a natural consequence of the design requirement that the RPKI daemon 01398 # never transmit private keys across the network in any form; given this 01399 # requirement, the RPKI engine that holds the private keys for an RPKI 01400 # certificate must also be the engine which generates any ROAs that 01401 # derive from that RPKI certificate. 01402 # 01403 # The precise content of the @c <route_origin/> has changed over time as 01404 # the underlying ROA specification has changed. The current 01405 # implementation as of this writing matches what we expect to see in 01406 # draft-ietf-sidr-roa-format-03, once it is issued. In particular, note 01407 # that the exactMatch boolean from the -02 draft has been replaced by 01408 # the prefix and maxLength encoding used in the -03 draft. 01409 # 01410 # Payload data which can be configured in a @c <route_origin/> %object: 01411 # 01412 # @li @c asn (attribute): 01413 # Autonomous System Number (ASN) to place in the generated ROA. A 01414 # single ROA can only grant authorization to a single ASN; multiple 01415 # ASNs require multiple ROAs, thus multiple @c <route_origin/> %objects. 01416 # 01417 # @li @c ipv4 (attribute): 01418 # %List of IPv4 prefix and maxLength values, see below for format. 01419 # 01420 # @li @c ipv6 (attribute): 01421 # %List of IPv6 prefix and maxLength values, see below for format. 01422 # 01423 # Control attributes that can be set to "yes" to force actions: 01424 # 01425 # @li @c suppress_publication: 01426 # Not implemented, may be removed from protocol. 01427 # 01428 # The lists of IPv4 and IPv6 prefix and maxLength values are represented 01429 # as comma-separated text strings, with no whitespace permitted. Each 01430 # entry in such a string represents a single prefix/maxLength pair. 01431 # 01432 # ABNF for these address lists: 01433 # 01434 # @verbatim 01435 # 01436 # <ROAIPAddress> ::= <address> "/" <prefixlen> [ "-" <max_prefixlen> ] 01437 # ; Where <max_prefixlen> defaults to the same 01438 # ; value as <prefixlen>. 01439 # 01440 # <ROAIPAddressList> ::= <ROAIPAddress> *( "," <ROAIPAddress> ) 01441 # 01442 # @endverbatim 01443 # 01444 # For example, @c "10.0.1.0/24-32,10.0.2.0/24", which is a shorthand 01445 # form of @c "10.0.1.0/24-32,10.0.2.0/24-24". 01446 # 01447 # @section irdb_queries Operations initiated by the RPKI engine 01448 # 01449 # The left-right protocol also includes queries from the RPKI engine 01450 # back to the IRDB. These queries do not follow the message-passing 01451 # pattern used in the IRBE-initiated part of the protocol. Instead, 01452 # there's a single query back to the IRDB, with a corresponding 01453 # response. The CMS and HTTPS encoding are the same as in the rest of 01454 # the protocol, but the BPKI certificates will be different as the 01455 # back-queries and responses form a separate communication channel. 01456 # 01457 # @subsection list_resources_msg <list_resources/> messages 01458 # 01459 # The @c <list_resources/> query and response allow the RPKI engine to ask 01460 # the IRDB for information about resources assigned to a particular 01461 # child. The query must include both a @c "self_id" attribute naming 01462 # the @c <self/> that is making the request and also a @c "child_id" 01463 # attribute naming the child that is the subject of the query. The 01464 # query and response also allow an optional @c "tag" attribute of the 01465 # same form used elsewhere in this protocol, to allow batching. 01466 # 01467 # A @c <list_resources/> response includes the following attributes, along 01468 # with the @c tag (if specified), @c self_id, and @c child_id copied 01469 # from the request: 01470 # 01471 # @li @c valid_until: 01472 # A timestamp indicating the date and time at which certificates 01473 # generated by the RPKI engine for these data should expire. The 01474 # timestamp is expressed as an XML @c xsd:dateTime, must be 01475 # expressed in UTC, and must carry the "Z" suffix indicating UTC. 01476 # 01477 # @li @c asn: 01478 # A %list of autonomous sequence numbers, expressed as a 01479 # comma-separated sequence of decimal integers with no whitespace. 01480 # 01481 # @li @c ipv4: 01482 # A %list of IPv4 address prefixes and ranges, expressed as a 01483 # comma-separated %list of prefixes and ranges with no whitespace. 01484 # See below for format details. 01485 # 01486 # @li @c ipv6: 01487 # A %list of IPv6 address prefixes and ranges, expressed as a 01488 # comma-separated %list of prefixes and ranges with no whitespace. 01489 # See below for format details. 01490 # 01491 # Entries in a %list of address prefixes and ranges can be either 01492 # prefixes, which are written in the usual address/prefixlen notation, 01493 # or ranges, which are expressed as a pair of addresses denoting the 01494 # beginning and end of the range, written in ascending order separated 01495 # by a single "-" character. This format is superficially similar to 01496 # the format used for prefix and maxLength values in the @c <route_origin/> 01497 # %object, but the semantics differ: note in particular that 01498 # @c <route_origin/> %objects don't allow ranges, while @c <list_resources/> 01499 # messages don't allow a maxLength specification. 01500 # 01501 # @section left_right_error_handling Error handling 01502 # 01503 # Error in this protocol are handled at two levels. 01504 # 01505 # Since all messages in this protocol are conveyed over HTTPS 01506 # connections, basic errors are indicated via the HTTP response code. 01507 # 4xx and 5xx responses indicate that something bad happened. Errors 01508 # that make it impossible to decode a query or encode a response are 01509 # handled in this way. 01510 # 01511 # Where possible, errors will result in a @c <report_error/> message which 01512 # takes the place of the expected protocol response message. 01513 # @c <report_error/> messages are CMS-signed XML messages like the rest of 01514 # this protocol, and thus can be archived to provide an audit trail. 01515 # 01516 # @c <report_error/> messages only appear in replies, never in queries. 01517 # The @c <report_error/> message can appear on either the "forward" (IRBE 01518 # as client of RPKI engine) or "back" (RPKI engine as client of IRDB) 01519 # communication channel. 01520 # 01521 # The @c <report_error/> message includes an optional @c "tag" attribute to 01522 # assist in matching the error with a particular query when using 01523 # batching, and also includes a @c "self_id" attribute indicating the 01524 # @c <self/> that issued the error. 01525 # 01526 # The error itself is conveyed in the @c error_code (attribute). The 01527 # value of this attribute is a token indicating the specific error that 01528 # occurred. At present this will be the name of a Python exception; the 01529 # production version of this protocol will nail down the allowed error 01530 # tokens here, probably in the RelaxNG schema. 01531 # 01532 # The body of the @c <report_error/> element itself is an optional text 01533 # string; if present, this is debugging information. At present this 01534 # capabilty is not used, debugging information goes to syslog. 01535 01536 ## @page Publication Publication protocol 01537 # 01538 # The %publication protocol is really two separate client/server 01539 # protocols, between different parties. The first is a configuration 01540 # protocol for an IRBE to use to configure a %publication engine, 01541 # the second is the interface by which authorized clients request 01542 # %publication of specific objects. 01543 # 01544 # Much of the architecture of the %publication protocol is borrowed 01545 # from the @link Left-right left-right protocol: @endlink like the 01546 # left-right protocol, the %publication protocol uses CMS-wrapped XML 01547 # over HTTPS with the same eContentType OID and the same HTTPS 01548 # content-type, and the overall style of the XML messages is very 01549 # similar to the left-right protocol. All operations allow an 01550 # optional "tag" attribute to allow batching. 01551 # 01552 # The %publication engine operates a single HTTPS server which serves 01553 # both of these subprotocols. The two subprotocols share a single 01554 # server port, but use distinct URLs to allow demultiplexing. 01555 # 01556 # @section Terminology 01557 # 01558 # @li @em IRBE: Internet Registry Back End 01559 # 01560 # @li @em IRDB: Internet Registry Data Base 01561 # 01562 # @li @em BPKI: Business PKI 01563 # 01564 # @li @em RPKI: Resource PKI 01565 # 01566 # @section Publication-control Publication control subprotocol 01567 # 01568 # The control subprotocol reuses the message-passing design of the 01569 # left-right protocol. Configured objects support the "create", "set", 01570 # "get", "list", and "destroy" actions, or a subset thereof when the 01571 # full set of actions doesn't make sense. 01572 # 01573 # @subsection config_obj <config/> object 01574 # 01575 # The <config/> %object allows configuration of data that apply to the 01576 # entire %publication server rather than a particular client. 01577 # 01578 # There is exactly one <config/> %object in the %publication server, and 01579 # it only supports the "set" and "get" actions -- it cannot be created 01580 # or destroyed. 01581 # 01582 # Payload data which can be configured in a <config/> %object: 01583 # 01584 # @li @c bpki_crl (element): 01585 # This is the BPKI CRL used by the %publication server when 01586 # signing the CMS wrapper on responses in the %publication 01587 # subprotocol. As the CRL must be updated at regular intervals, 01588 # it's not practical to restart the %publication server when the 01589 # BPKI CRL needs to be updated. The BPKI model doesn't require 01590 # use of a BPKI CRL between the IRBE and the %publication server, 01591 # so we can use the %publication control subprotocol to update the 01592 # BPKI CRL. 01593 # 01594 # @subsection client_obj <client/> object 01595 # 01596 # The <client/> %object represents one client authorized to use the 01597 # %publication server. 01598 # 01599 # The <client/> %object supports the full set of "create", "set", "get", 01600 # "list", and "destroy" actions. Each client has a "client_id" 01601 # attribute, which is used in responses and must be specified in "set", 01602 # "get", or "destroy" actions. 01603 # 01604 # Payload data which can be configured in a <client/> %object: 01605 # 01606 # @li @c base_uri (attribute): 01607 # This is the base URI below which this client is allowed to publish 01608 # data. The %publication server may impose additional constraints in 01609 # the case of a child publishing beneath its parent. 01610 # 01611 # @li @c bpki_cert (element): 01612 # BPKI CA certificate for this <client/>. This is used as part of 01613 # the certificate chain when validating incoming TLS and CMS 01614 # messages. If the bpki_glue certificate is in use (below), the 01615 # bpki_cert certificate should be issued by the bpki_glue 01616 # certificate; otherwise, the bpki_cert certificate should be issued 01617 # by the %publication engine's bpki_ta certificate. 01618 # 01619 # @li @c bpki_glue (element): 01620 # Another BPKI CA certificate for this <client/>, usually not 01621 # needed. Certain pathological cross-certification cases require a 01622 # two-certificate chain due to issuer name conflicts. If used, the 01623 # bpki_glue certificate should be the issuer of the bpki_cert 01624 # certificate and should be issued by the %publication engine's 01625 # bpki_ta certificate; if not needed, the bpki_glue certificate 01626 # should be left unset. 01627 # 01628 # @section Publication-publication Publication subprotocol 01629 # 01630 # The %publication subprotocol is structured somewhat differently from 01631 # the %publication control protocol. Objects in the %publication 01632 # subprotocol represent objects to be published or objects to be 01633 # withdrawn from %publication. Each kind of %object supports two actions: 01634 # "publish" and "withdraw". In each case the XML element representing 01635 # hte %object to be published or withdrawn has a "uri" attribute which 01636 # contains the %publication URI. For "publish" actions, the XML element 01637 # body contains the DER %object to be published, encoded in Base64; for 01638 # "withdraw" actions, the XML element body is empty. 01639 # 01640 # In theory, the detailed access control for each kind of %object might 01641 # be different. In practice, as of this writing, access control for all 01642 # objects is a simple check that the client's @c "base_uri" is a leading 01643 # substring of the %publication URI. Details of why access control might 01644 # need to become more complicated are discussed in a later section. 01645 # 01646 # @subsection certificate_obj <certificate/> object 01647 # 01648 # The <certificate/> %object represents an RPKI certificate to be 01649 # published or withdrawn. 01650 # 01651 # @subsection crl_obj <crl/> object 01652 # 01653 # The <crl/> %object represents an RPKI CRL to be published or withdrawn. 01654 # 01655 # @subsection manifest_obj <manifest/> object 01656 # 01657 # The <manifest/> %object represents an RPKI %publication %manifest to be 01658 # published or withdrawn. 01659 # 01660 # Note that part of the reason for the batching support in the 01661 # %publication protocol is because @em every %publication or withdrawal 01662 # action requires a new %manifest, thus every %publication or withdrawal 01663 # action will involve at least two objects. 01664 # 01665 # @subsection roa_obj <roa/> object 01666 # 01667 # The <roa/> %object represents a ROA to be published or withdrawn. 01668 # 01669 # @section publication_error_handling Error handling 01670 # 01671 # Error in this protocol are handled at two levels. 01672 # 01673 # Since all messages in this protocol are conveyed over HTTPS 01674 # connections, basic errors are indicated via the HTTP response code. 01675 # 4xx and 5xx responses indicate that something bad happened. Errors 01676 # that make it impossible to decode a query or encode a response are 01677 # handled in this way. 01678 # 01679 # Where possible, errors will result in a <report_error/> message which 01680 # takes the place of the expected protocol response message. 01681 # <report_error/> messages are CMS-signed XML messages like the rest of 01682 # this protocol, and thus can be archived to provide an audit trail. 01683 # 01684 # <report_error/> messages only appear in replies, never in 01685 # queries. The <report_error/> message can appear in both the 01686 # control and publication subprotocols. 01687 # 01688 # The <report_error/> message includes an optional @c "tag" attribute to 01689 # assist in matching the error with a particular query when using 01690 # batching. 01691 # 01692 # The error itself is conveyed in the @c error_code (attribute). The 01693 # value of this attribute is a token indicating the specific error that 01694 # occurred. At present this will be the name of a Python exception; the 01695 # production version of this protocol will nail down the allowed error 01696 # tokens here, probably in the RelaxNG schema. 01697 # 01698 # The body of the <report_error/> element itself is an optional text 01699 # string; if present, this is debugging information. At present this 01700 # capabilty is not used, debugging information goes to syslog. 01701 # 01702 # @section publication_access_control Additional access control considerations. 01703 # 01704 # As detailed above, the %publication protocol is trivially simple. This 01705 # glosses over two bits of potential complexity: 01706 # 01707 # @li In the case where parent and child are sharing a repository, we'd 01708 # like to nest child under parent, because testing has demonstrated 01709 # that even on relatively slow hardware the delays involved in 01710 # setting up separate rsync connections tend to dominate 01711 # synchronization time for relying parties. 01712 # 01713 # @li The repository operator might also want to do some checks to 01714 # assure itself that what it's about to allow the RPKI engine to 01715 # publish is not dangerous toxic waste. 01716 # 01717 # The up-down protocol includes a mechanism by which a parent can 01718 # suggest a %publication URI to each of its children. The children are 01719 # not required to accept this hint, and the children must make separate 01720 # arrangements with the repository operator (who might or might not be 01721 # the same as the entity that hosts the children's RPKI engine 01722 # operations) to use the suggested %publication point, but if everything 01723 # works out, this allows children to nest cleanly under their parents 01724 # %publication points, which helps reduce synchronization time for 01725 # relying parties. 01726 # 01727 # In this case, one could argue that the %publication server is 01728 # responsible for preventing one of its clients (the child in the above 01729 # description) from stomping on data published by another of its clients 01730 # (the parent in the above description). This goes beyond the basic 01731 # access check and requires the %publication server to determine whether 01732 # the parent has given its consent for the child to publish under the 01733 # parent. Since the RPKI certificate profile requires the child's 01734 # %publication point to be indicated in an SIA extension in a certificate 01735 # issued by the parent to the child, the %publication engine can infer 01736 # this permission from the parent's issuance of a certificate to the 01737 # child. Since, by definition, the parent also uses this %publication 01738 # server, this is an easy check, as the %publication server should 01739 # already have the parent's certificate available by the time it needs 01740 # to check the child's certificate. 01741 # 01742 # The previous paragraph only covers a "publish" action for a 01743 # <certificate/> %object. For "publish" actions on other 01744 # objects, the %publication server would need to trace permission back 01745 # to the certificate issued by the parent; for "withdraw" actions, 01746 # the %publication server would have to perform the same checks it 01747 # would perform for a "publish" action, using the current published 01748 # data before withdrawing it. The latter in turn implies an ordering 01749 # constraint on "withdraw" actions in order to preserve the data 01750 # necessary for these access control decisions; as this may prove 01751 # impractical, the %publication server may probably need to make 01752 # periodic sweeps over its published data looking for orphaned 01753 # objects, but that's probably a good idea anyway. 01754 # 01755 # Note that, in this %publication model, any agreement that the 01756 # repository makes to publish the RPKI engine's output is conditional 01757 # upon the %object to be published passing whatever access control checks 01758 # the %publication server imposes. 01759 01760 ## @page sql-schemas SQL database schemas 01761 # 01762 # @li @subpage rpkid-sql "rpkid database schema" 01763 # @li @subpage pubd-sql "pubd database schema" 01764 # @li @subpage irdbd-sql "irdbd database schema" 01765 01766 ## @page rpkid-sql rpkid SQL schema 01767 # 01768 # @dotfile rpkid.dot "Diagram of rpkid.sql" 01769 # 01770 # @verbinclude rpkid.sql 01771 01772 ## @page pubd-sql pubd SQL Schema 01773 # 01774 # @dotfile pubd.dot "Diagram of pubd.sql" 01775 # 01776 # @verbinclude pubd.sql 01777 01778 ## @page irdbd-sql irdbd SQL Schema 01779 # 01780 # @dotfile irdbd.dot "Diagram of irdbd.sql" 01781 # 01782 # @verbinclude irdbd.sql 01783 01784 ## @page bpki-model BPKI model 01785 # 01786 # The "business PKI" (BPKI) is the PKI used to authenticate 01787 # communication on the up-down, left-right, and %publication protocols. 01788 # BPKI certificates are @em not resource PKI (RPKI) certificates. The 01789 # BPKI is a separate PKI that represents relationships between the 01790 # various entities involved in the production side of the RPKI system. 01791 # In most cases the BPKI tree will follow existing business 01792 # relationships, hence the name "BPKI". 01793 # 01794 # Setup of the BPKI is handled by the back end; for the most part, 01795 # rpkid and pubd just use the result. The one place where the engines 01796 # are directly involved in creation of new BPKI certificates is in the 01797 # production of end-entity certificates for use by the engines. 01798 # 01799 # There are a few design principals that underly the chosen BPKI model: 01800 # @li Each engine should rely on a single BPKI trust anchor which is 01801 # controlled by the back end entity that runs the engine; all 01802 # other trust material should be cross-certified into the engine's 01803 # BPKI tree. 01804 # @li Private keys must never transit the network. 01805 # @li Except for end entity certificates, the engine should only have 01806 # access to the BPKI certificates; in particular, the private key 01807 # for the BPKI trust anchor should not be accessible to the engine. 01808 # @li The number of BPKI keys and certificates that the engine has to 01809 # manage should be no larger than is necessary. 01810 # 01811 # rpkid's hosting model adds an additional constraint: rpkid's BPKI 01812 # trust anchor belongs to the entity operating rpkid, but the entities 01813 # hosted by rpkid should have control of their own BPKI private keys. 01814 # This implies the need for an additional layer of BPKI certificate 01815 # hierarchy within rpkid. 01816 # 01817 # Here is a simplified picture of what the BPKI might look like for an 01818 # rpkid operator that hosts two entities, "Alice" and "Ellen": 01819 # 01820 # @dot 01821 # // Color code: 01822 # // Black: Hosting entity 01823 # // Blue: Hosted entity 01824 # // Red: Cross-certified peer 01825 # // 01826 # // Shape code: 01827 # // Octagon: TA 01828 # // Diamond: CA 01829 # // Record: EE 01830 # 01831 # digraph bpki_rpkid { 01832 # splines = true; 01833 # size = "14,14"; 01834 # node [ fontname = Times, fontsize = 9 ]; 01835 # 01836 # // Hosting entity 01837 # node [ color = black, shape = record ]; 01838 # TA [ shape = octagon, label = "BPKI TA" ]; 01839 # rpkid [ label = "rpkid|{HTTPS server|HTTPS left-right client|CMS left-right}" ]; 01840 # irdbd [ label = "irdbd|{HTTPS left-right server|CMS left-right}" ]; 01841 # irbe [ label = "IRBE|{HTTPS left-right client|CMS left-right}" ]; 01842 # 01843 # // Hosted entities 01844 # node [ color = blue, fontcolor = blue ]; 01845 # Alice_CA [ shape = diamond ]; 01846 # Alice_EE [ label = "Alice\nBSC EE|{HTTPS up-down client|CMS up-down}" ]; 01847 # Ellen_CA [ shape = diamond ]; 01848 # Ellen_EE [ label = "Ellen\nBSC EE|{HTTPS up-down client|CMS up-down}" ]; 01849 # 01850 # // Peers 01851 # node [ color = red, fontcolor = red, shape = diamond ]; 01852 # Bob_CA; 01853 # Carol_CA; 01854 # Dave_CA; 01855 # Frank_CA; 01856 # Ginny_CA; 01857 # Harry_CA; 01858 # node [ shape = record ]; 01859 # Bob_EE [ label = "Bob\nEE|{HTTPS up-down|CMS up-down}" ]; 01860 # Carol_EE [ label = "Carol\nEE|{HTTPS up-down|CMS up-down}" ]; 01861 # Dave_EE [ label = "Dave\nEE|{HTTPS up-down|CMS up-down}" ]; 01862 # Frank_EE [ label = "Frank\nEE|{HTTPS up-down|CMS up-down}" ]; 01863 # Ginny_EE [ label = "Ginny\nEE|{HTTPS up-down|CMS up-down}" ]; 01864 # Harry_EE [ label = "Bob\nEE|{HTTPS up-down|CMS up-down}" ]; 01865 # 01866 # edge [ color = black, style = solid ]; 01867 # TA -> Alice_CA; 01868 # TA -> Ellen_CA; 01869 # 01870 # edge [ color = black, style = dotted ]; 01871 # TA -> rpkid; 01872 # TA -> irdbd; 01873 # TA -> irbe; 01874 # 01875 # edge [ color = blue, style = solid ]; 01876 # Alice_CA -> Bob_CA; 01877 # Alice_CA -> Carol_CA; 01878 # Alice_CA -> Dave_CA; 01879 # Ellen_CA -> Frank_CA; 01880 # Ellen_CA -> Ginny_CA; 01881 # Ellen_CA -> Harry_CA; 01882 # 01883 # edge [ color = blue, style = dotted ]; 01884 # Alice_CA -> Alice_EE; 01885 # Ellen_CA -> Ellen_EE; 01886 # 01887 # edge [ color = red, style = solid ]; 01888 # Bob_CA -> Bob_EE; 01889 # Carol_CA -> Carol_EE; 01890 # Dave_CA -> Dave_EE; 01891 # Frank_CA -> Frank_EE; 01892 # Ginny_CA -> Ginny_EE; 01893 # Harry_CA -> Harry_EE; 01894 # } 01895 # @enddot 01896 # 01897 # Black objects belong to the hosting entity, blue objects belong to 01898 # the hosted entities, red objects are cross-certified objects from 01899 # the hosted entities' peers. The arrows indicate certificate 01900 # issuance: solid arrows are the ones that rpkid will care about 01901 # during certificate validation, dotted arrows show the origin of the 01902 # EE certificates that rpkid uses to sign CMS and TLS messages. 01903 # 01904 # There's one nasty bit where the model had to bend to fit the current 01905 # state of the underlying protocols: it's not possible to use exactly 01906 # the same BPKI keys and certificates for HTTPS and CMS. The reason 01907 # for this is simple: each hosted entity has its own BPKI, as does the 01908 # hosting entity, but the HTTPS listener is shared. The only ways to 01909 # avoid sharing the HTTPS server certificate would be to use separate 01910 # listeners for each hosted entity, which scales poorly, or to rely on 01911 # the TLS "Server Name Indication" extension (RFC 4366 3.1) which is 01912 # not yet widely implemented. 01913 # 01914 # The certificate tree looks complicated, but the set of certificates 01915 # needed to build any particular validation chain is obvious, again 01916 # excepting the HTTPS server case, where the client certificate is the 01917 # first hint that the engine has of the client's identity, so the 01918 # server must be prepared to accept any current client certificate. 01919 # 01920 # Detailed instructions on how to build a BPKI are beyond the scope of 01921 # this document, but one can handle simple cases using the OpenSSL 01922 # command line tool and cross_certify.py; the latter is a tool 01923 # designed specifically for the purpose of generating the 01924 # cross-certification certificates needed to splice foreign trust 01925 # material into a BPKI tree. 01926 # 01927 # The BPKI tree for a pubd instance is similar to to the BPKI tree for 01928 # an rpkid instance, but is a bit simpler, as pubd does not provide 01929 # hosting in the same sense that rpkid does: pubd is a relatively 01930 # simple server that publishes objects as instructed by its clients. 01931 # 01932 # Here's a simplified picture of what the BPKI might look like for a 01933 # pubd operator that serves two clients, "Alice" and "Bob": 01934 # 01935 # @dot 01936 # // Color code: 01937 # // Black: Operating entity 01938 # // Red: Cross-certified client 01939 # // 01940 # // Shape code: 01941 # // Octagon: TA 01942 # // Diamond: CA 01943 # // Record: EE 01944 # 01945 # digraph bpki_pubd { 01946 # splines = true; 01947 # size = "14,14"; 01948 # node [ fontname = Times, fontsize = 9 ]; 01949 # 01950 # // Operating entity 01951 # node [ color = black, fontcolor = black, shape = record ]; 01952 # TA [ shape = octagon, label = "BPKI TA" ]; 01953 # pubd [ label = "pubd|{HTTPS server|CMS}" ]; 01954 # ctl [ label = "Control|{HTTPS client|CMS}" ]; 01955 # 01956 # // Clients 01957 # node [ color = red, fontcolor = red, shape = diamond ]; 01958 # Alice_CA; 01959 # Bob_CA; 01960 # node [ color = red, fontcolor = red, shape = record ]; 01961 # Alice_EE [ label = "Alice\nEE|{HTTPS client|CMS}" ]; 01962 # Bob_EE [ label = "Bob\nEE|{HTTPS client|CMS}" ]; 01963 # 01964 # edge [ color = black, style = dotted ]; 01965 # TA -> pubd; 01966 # TA -> ctl; 01967 # 01968 # edge [ color = black, style = solid ]; 01969 # TA -> Alice_CA; 01970 # TA -> Bob_CA; 01971 # 01972 # edge [ color = red, style = solid ]; 01973 # Alice_CA -> Alice_EE; 01974 # Bob_CA -> Bob_EE; 01975 # } 01976 # @enddot 01977 # 01978 # While it is likely that RIRs (at least) will operate both rpkid and 01979 # pubd instances, the two functions are conceptually separate. As far 01980 # as pubd is concerned, it doesn't matter who operates the rpkid 01981 # instance: pubd just has clients, each of which has trust material 01982 # that has been cross-certified into pubd's BPKI. Similarly, rpkid 01983 # doesn't really care who operates a pubd instance that it's been 01984 # configured to use, it just treats that pubd as a foreign BPKI whose 01985 # trust material has to be cross-certified into its own BPKI. Cross 01986 # certification itself is done by the back end operator, using 01987 # cross_certify or some equivalent tool; the resulting BPKI 01988 # certificates are configured into rpkid and pubd via the left-right 01989 # protocol and the control subprotocol of the publication protocol, 01990 # respectively. 01991 # 01992 # Because the BPKI tree is almost entirely controlled by the operating 01993 # entity, CRLs are not necessary for most of the BPKI. The one 01994 # exception to this is the EE certificates issued under the 01995 # cross-certification points. These EE certificates are generated by 01996 # the peer, not the local operator, and thus require CRLs. Because of 01997 # this, both rpkid and pubd require regular updates of certain BPKI 01998 # CRLs, again via the left-right and publication control protocols. 01999 # 02000 # Because the left-right protocol and the publication control 02001 # subprotocol are used to configure BPKI certificates and CRLs, they 02002 # cannot themselves use certificates and CRLs configured in this way. 02003 # This is why the configuration files for rpkid and pubd require 02004 # static configuration of the left-right and publication control 02005 # certificates. 02006 02007 # Local Variables: 02008 # compile-command: "cd .. && make doc" 02009 # End: