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