idnits 2.17.00 (12 Aug 2021) /tmp/idnits53941/draft-ietf-opsawg-sdi-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 06, 2020) is 806 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'AU' is mentioned on line 639, but not defined == Missing Reference: 'Some-State' is mentioned on line 640, but not defined == Outdated reference: draft-gutmann-scep has been published as RFC 8894 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group W. Kumari 3 Internet-Draft Google 4 Intended status: Informational C. Doyle 5 Expires: September 7, 2020 Juniper Networks 6 March 06, 2020 8 Secure Device Install 9 draft-ietf-opsawg-sdi-05 11 Abstract 13 Deploying a new network device often requires that an employee 14 physically travel to a datacenter to perform the initial install and 15 configuration, even in shared datacenters with "smart-hands" type 16 support. In many cases, this could be avoided if there were a 17 standard, secure way to initially provision the devices. 19 This document extends existing auto-install / Zero-Touch Provisioning 20 mechanisms to make the process more secure. 22 [ Ed note: Text inside square brackets ([]) is additional background 23 information, answers to frequently asked questions, general musings, 24 etc. They will be removed before publication. This document is 25 being collaborated on in Github at: https://github.com/wkumari/draft- 26 wkumari-opsawg-sdi. The most recent version of the document, open 27 issues, etc should all be available here. The authors (gratefully) 28 accept pull requests. ] 30 [ Ed note: This document introduces concepts and serves as the basic 31 for discussion - because of this, it is conversational, and would 32 need to be firmed up before being published ] 34 Status of This Memo 36 This Internet-Draft is submitted in full conformance with the 37 provisions of BCP 78 and BCP 79. 39 Internet-Drafts are working documents of the Internet Engineering 40 Task Force (IETF). Note that other groups may also distribute 41 working documents as Internet-Drafts. The list of current Internet- 42 Drafts is at https://datatracker.ietf.org/drafts/current/. 44 Internet-Drafts are draft documents valid for a maximum of six months 45 and may be updated, replaced, or obsoleted by other documents at any 46 time. It is inappropriate to use Internet-Drafts as reference 47 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on September 7, 2020. 50 Copyright Notice 52 Copyright (c) 2020 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (https://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 1.1. Requirements notation . . . . . . . . . . . . . . . . . . 4 69 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 70 2.1. Example Scenario . . . . . . . . . . . . . . . . . . . . 5 71 3. Vendor Role / Requirements . . . . . . . . . . . . . . . . . 6 72 3.1. Device key generation . . . . . . . . . . . . . . . . . . 6 73 3.2. Certificate Publication Server . . . . . . . . . . . . . 6 74 4. Operator Role / Responsibilities . . . . . . . . . . . . . . 7 75 4.1. Administrative . . . . . . . . . . . . . . . . . . . . . 7 76 4.2. Technical . . . . . . . . . . . . . . . . . . . . . . . . 7 77 4.3. Initial Customer Boot . . . . . . . . . . . . . . . . . . 8 78 5. Additional Considerations . . . . . . . . . . . . . . . . . . 11 79 5.1. Key storage . . . . . . . . . . . . . . . . . . . . . . . 11 80 5.2. Key replacement . . . . . . . . . . . . . . . . . . . . . 11 81 5.3. Device reinstall . . . . . . . . . . . . . . . . . . . . 11 82 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 83 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11 84 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 85 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 86 9.1. Normative References . . . . . . . . . . . . . . . . . . 12 87 9.2. Informative References . . . . . . . . . . . . . . . . . 13 88 Appendix A. Changes / Author Notes. . . . . . . . . . . . . . . 13 89 Appendix B. Demo / proof of concept . . . . . . . . . . . . . . 14 90 B.1. Step 1: Generating the certificate. . . . . . . . . . . . 14 91 B.1.1. Step 1.1: Generate the private key. . . . . . . . . . 15 92 B.1.2. Step 1.2: Generate the certificate signing request. . 15 93 B.1.3. Step 1.3: Generate the (self signed) certificate 94 itself. . . . . . . . . . . . . . . . . . . . . . . . 15 95 B.2. Step 2: Generating the encrypted config. . . . . . . . . 15 96 B.2.1. Step 2.1: Fetch the certificate. . . . . . . . . . . 15 97 B.2.2. Step 2.2: Encrypt the config file. . . . . . . . . . 16 98 B.2.3. Step 2.3: Copy config to the config server. . . . . . 16 99 B.3. Step 3: Decrypting and using the config. . . . . . . . . 16 100 B.3.1. Step 3.1: Fetch encrypted config file from config 101 server. . . . . . . . . . . . . . . . . . . . . . . . 16 102 B.3.2. Step 3.2: Decrypt and use the config. . . . . . . . . 16 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 105 1. Introduction 107 In a growing, global network, significant amounts of time and money 108 are spent simply deploying new devices and "forklift" upgrading 109 existing devices. In many cases, these devices are in shared 110 datacenters (for example, Internet Exchange Points (IXP) or "carrier 111 neutral datacenters"), which have staff on hand that can be 112 contracted to perform tasks including physical installs, device 113 reboots, loading initial configurations, etc. There are also a 114 number of (often vendor proprietary) protocols to perform initial 115 device installs and configurations - for example, many network 116 devices will attempt to use DHCP to get an IP address and 117 configuration server, and then fetch and install a configuration when 118 they are first powered on. 120 Network device configurations contain a significant amount of 121 security related and / or proprietary information (for example, 122 RADIUS or TACACS+ secrets). Exposing these to a third party to load 123 onto a new device (or using an auto-install techniques which fetch an 124 unencrypted config file via something like TFTP) is simply not 125 acceptable to many operators, and so they have to send employees to 126 remote locations to perform the initial configuration work. As well 127 as having a significant monetary cost, it also takes significantly 128 longer to install devices and is generally inefficient. 130 There are some workarounds to this, such as asking the vendor to pre- 131 configure the devices before shipping it; asking the smart-hands to 132 install a terminal server; providing a minimal, unsecured 133 configuration and using that to bootstrap to a complete 134 configuration, etc; but these are often clumsy and have security 135 issues - for example, in the terminal server case, the console port 136 connection could be easily snooped. 138 This document layers security onto existing auto-install solutions to 139 provide a secure method to initially configure new devices. It is 140 optimized for simplicity, both for the implementor and the operator; 141 it is explicitly not intended to be an "all singing, all dancing" 142 fully featured system for managing installed / deployed devices, nor 143 is it intended to solve all use-cases - rather it is a simple 144 targeted solution to solve a common operational issue. Solutions 145 such as Secure Zero Touch Provisioning (SZTP)" [RFC8572] are much 146 more fully featured, but also more complex to implement and / or are 147 not widely deployed yet. 149 This solution is specifically designed to be a simple method on top 150 of exiting device functionality. If devices do not support this new 151 method, they can continue to use the existing functionality. In 152 addition, operators can choose to use this to protect their 153 configuration information, or can continue to use the existing 154 functionality. 156 The issue of securely installing devices is in no way a new issue, 157 nor is it limited to network devices; it occurs when deploying 158 servers, PCs, IoT devices, and in many other situations. While the 159 solution described in this document is obvious (encrypt the config, 160 then decrypt it with a device key), this document only discusses the 161 use for network devices, such as routers and switches. 163 1.1. Requirements notation 165 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 166 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 167 "OPTIONAL" in this document are to be interpreted as described in BCP 168 14 [RFC2119] [RFC8174] when, and only when, they appear in all 169 capitals, as shown here. 171 2. Overview 173 Most network devices already include some sort of initial 174 bootstrapping logic (sometimes called 'autoboot', or 'autoinstall'). 175 This generally works by having a newly installed / unconfigured 176 device obtain an IP address and address of a config server (often 177 called 'next-server', 'siaddr' or 'tftp-server-name') using DHCP. 178 The device then contacts this configuration server to download its 179 initial configuration, which is often identified using the devices 180 serial number, MAC address or similar. This document extends this 181 (vendor specific) paradigm by allowing the configuration file to be 182 encrypted. 184 This document describes a concept, and some example ways of 185 implementing this concept. As devices have different capabilities, 186 and use different configuration paradigms, one method will not suit 187 all, and so it is expected that vendors will differ in exactly how 188 they implement this. 190 This document uses the serial number of the device as a unique 191 identifier for simplicity; some vendors may not want to implement the 192 system using the serial number as the identifier for business reasons 193 (a competitor or similar could enumerate the serial numbers and 194 determine how many devices have been manufactured). Implementors are 195 free to choose some other way of generating identifiers (e.g., UUID 196 [RFC4122]), but this will likely make it somewhat harder for 197 operators to use (the serial number is usually easy to find on a 198 device, a more complex system is likely harder to track). 200 [ Ed note: This example also uses TFTP because that is what many 201 vendors use in their auto-install / ZTP feature. It could easily 202 instead be HTTP, FTP, etc. ] 204 2.1. Example Scenario 206 Sirius Cybernetics Corp needs another peering router, and so they 207 order another router from Acme Network Widgets, to be drop-shipped to 208 the Point of Presence (POP) / datacenter. Acme begins assembling the 209 new device, and tells Sirius what the new device's serial number will 210 be (SN:17894321). When Acme first installs the firmware on the 211 device and boots it, the device generates a public-private keypair, 212 and Acme publishes it on their keyserver (in a public key 213 certificate, for ease of use). 215 While the device is being shipped, Sirius generates the initial 216 device configuration, fetches the certificate from Acme keyservers by 217 providing the serial number of the new device. Sirius then encrypts 218 the device configuration and puts this encrypted config on a (local) 219 TFTP server. 221 When the device arrives at the POP, it gets installed in Sirius' 222 rack, and cabled as instructed. The new device powers up and 223 discovers that it has not yet been configured. It enters its 224 autoboot state, and begins the DHCP process. Sirius' DHCP server 225 provides it with an IP address and the address of the configuration 226 server. The router uses TFTP to fetch its config file (note that all 227 this is existing functionality). The device attempts to load the 228 config file - if the config file is unparsable, (new functionality) 229 the device tries to use its private key to decrypt the file, and, 230 assuming it validates, installs the new configuration. 232 Only the "correct" device will have the required private key and be 233 able to decrypt and use the config file (See Security 234 Considerations). An attacker would be able to connect to the network 235 and get an IP address. They would also be able to retrieve 236 (encrypted) config files by guessing serial numbers (or perhaps the 237 server would allow directory listing), but without the private keys 238 an attacker will not be able to decrypt the files. 240 3. Vendor Role / Requirements 242 This section describes the vendors roles and responsibilities and 243 provides an overview of what the device needs to do. 245 3.1. Device key generation 247 Each devices requires a public-private key keypair, and for the 248 public part to be published and retrievable by the operator. This 249 section illustrates one method, but, as with much of this document 250 the exact mechanism may will vary by vendor. [I-D.gutmann-scep] is 251 one method which vendors may want to strongly consider. 253 During the manufacturing stage, when the device is initially powered 254 on, it will generate a public-private keypair. It will send its 255 unique identifier and the public key to the vendor's Certificate 256 Publication Server to be published. The vendor's Certificate 257 Publication Server should only accept certificates from the 258 manufacturing facility, and which match vendor defined policies (for 259 example, extended key usage, extensions, etc.) Note that some 260 devices may be constrained, and so may send the raw public key and 261 unique identifier to the certificate publication server, while more 262 capable devices may generate and send self-signed certificates. 264 3.2. Certificate Publication Server 266 The certificate publication server contains a database of 267 certificates. If newly manufactured devices upload certificates the 268 certificate publication server can simply publish these, if the 269 devices provide raw public keys and unique identifiers the 270 certificate publication server will need to wrap these in a 271 certificate. Note that the certificate publication server MUST only 272 accept certificates or keys from the vendor's manufacturing 273 facilities. 275 The customers (e.g., Sirius Cybernetics Corp) query this server with 276 the serial number (or other provided unique identifier) of a device, 277 and retrieve the associated certificate. It is expected that 278 operators will receive the unique identifier (serial number) of 279 devices when they purchase them, and will download and store / cache 280 the certificate. This means that there is not a hard requirement on 281 the uptime / reachability of the certificate publication server. 283 +------------+ 284 +------+ |Certificate | 285 |Device| |Publication | 286 +------+ | Server | 287 +------------+ 288 +----------------+ +--------------+ 289 | +---------+ | | | 290 | | Initial | | | | 291 | | boot? | | | | 292 | +----+----+ | | | 293 | | | | | 294 | +------v-----+ | | | 295 | | Generate | | | | 296 | |Self-signed | | | | 297 | |Certificate | | | | 298 | +------------+ | | | 299 | | | | +-------+ | 300 | +-------|---|-->|Receive| | 301 | | | +---+---+ | 302 | | | | | 303 | | | +---v---+ | 304 | | | |Publish| | 305 | | | +-------+ | 306 | | | | 307 +----------------+ +--------------+ 309 Initial certificate generation and publication. 311 4. Operator Role / Responsibilities 313 4.1. Administrative 315 When purchasing a new device, the accounting department will need to 316 get the unique device identifier (likely serial number) of the new 317 device and communicate it to the operations group. 319 4.2. Technical 321 The operator will contact the vendor's publication server, and 322 download the certificate (by providing the unique device identifier 323 of the device). The operator SHOULD fetch the certificate using a 324 secure transport (e.g., HTTPS). The operator will then encrypt the 325 initial configuration (for example, using SMIME) using the key in the 326 certificate, and place it on their TFTP server. See Appendix B for 327 examples. 329 +------------+ 330 +--------+ |Certificate | 331 |Operator| |Publication | 332 +--------+ | Server | 333 +------------+ 334 +----------------+ +----------------+ 335 | +-----------+ | | +-----------+ | 336 | | Fetch | | | | | | 337 | | Device |<------>|Certificate| | 338 | |Certificate| | | | | | 339 | +-----+-----+ | | +-----------+ | 340 | | | | | 341 | +-----v------+ | | | 342 | | Encrypt | | | | 343 | | Device | | | | 344 | | Config | | | | 345 | +-----+------+ | | | 346 | | | | | 347 | +-----v------+ | | | 348 | | Publish | | | | 349 | | TFTP | | | | 350 | | Server | | | | 351 | +------------+ | | | 352 | | | | 353 +----------------+ +----------------+ 355 Fetching the certificate, encrypting the configuration, publishing 356 the encrypted configuration. 358 4.3. Initial Customer Boot 360 When the device is first booted by the customer (and on subsequent 361 boots), if the device does not have a valid configuration, it will 362 use existing auto-install functionality. As an example, it performs 363 DHCP Discovery until it gets a DHCP offer including DHCP option 66 364 (Server-Name) or 150 (TFTP server address), contact the server listed 365 in these DHCP options and downloads its config file. Note that this 366 is existing functionality (for example, Cisco devices fetch the 367 config file named by the Bootfile-Name DHCP option (67)). 369 After retrieving the config file, the device needs to determine if it 370 is encrypted or not. If it is not encrypted, the existing behavior 371 is used. If the configuration is encrypted, the process continues as 372 described in this document. The method used to determine if the 373 config is encrypted or not is implementation dependant; there are a 374 number of (obvious) options, including having a magic string in the 375 file header, using a file name extension (e.g., config.enc), or using 376 specific DHCP options. 378 If the file is encrypted, the device will attempt to decrypt and 379 parse the file. It able, it will install the configuration, and 380 start using it. If this fails, the device with either abort the 381 auto-install process, or will repeat this process until it succeeds. 383 Note that the device only needs DHCP and to be able to download the 384 config file; after the initial power-on in the factory it never needs 385 to access the Internet or vendor or certificate publication server - 386 it (and only it) has the private key and so has the ability to 387 decrypt the config file. 389 +--------+ +--------------+ 390 | Device | |Config server | 391 +--------+ | (e.g. TFTP) | 392 +--------------+ 393 +---------------------------+ +------------------+ 394 | +-----------+ | | | 395 | | | | | | 396 | | DHCP | | | | 397 | | | | | | 398 | +-----+-----+ | | | 399 | | | | | 400 | +-----v------+ | | +-----------+ | 401 | | | | | | Encrypted | | 402 | |Fetch config|<------------------>| config | | 403 | | | | | | file | | 404 | +-----+------+ | | +-----------+ | 405 | | | | | 406 | X | | | 407 | / \ | | | 408 | / \ N +--------+ | | | 409 | | Enc?|---->|Install,| | | | 410 | \ / | Boot | | | | 411 | \ / +--------+ | | | 412 | V | | | 413 | |Y | | | 414 | | | | | 415 | +-----v------+ | | | 416 | |Decrypt with| | | | 417 | |private key | | | | 418 | +-----+------+ | | | 419 | | | | | 420 | v | | | 421 | / \ | | | 422 | / \ Y +--------+ | | | 423 | |Sane?|---->|Install,| | | | 424 | \ / | Boot | | | | 425 | \ / +--------+ | | | 426 | V | | | 427 | |N | | | 428 | | | | | 429 | +----v---+ | | | 430 | |Give up | | | | 431 | |go home | | | | 432 | +--------+ | | | 433 | | | | 434 +---------------------------+ +------------------+ 436 Device boot, fetch and install config file 438 5. Additional Considerations 440 5.1. Key storage 442 Ideally, the keypair would be stored in a Trusted Platform Module 443 (TPM) on something which is identified as the "router" - for example, 444 the chassis / backplane. This is so that a keypair is bound to what 445 humans think of as the "device", and not, for example (redundant) 446 routing engines. Devices which implement IEEE 802.1AR could choose 447 to use the IDevID for this purpose. 449 5.2. Key replacement 451 It is anticipated that some operator may want to replace the (vendor 452 provided) keys after installing the device. There are two options 453 when implementing this - a vendor could allow the operator's key to 454 completely replace the initial device generated key (which means 455 that, if the device is ever sold, the new owner couldn't use this 456 technique to install the device), or the device could prefer the 457 operators installed key. This is an implementation decision left to 458 the vendor. 460 5.3. Device reinstall 462 Increasingly, operations is moving towards an automated model of 463 device management, whereby portions (or the entire) configuration is 464 programmatically generated. This means that operators may want to 465 generate an entire configuration after the device has been initially 466 installed and ask the device to load and use this new configuration. 467 It is expected (but not defined in this document, as it is vendor 468 specific) that vendors will allow the operator to copy a new, 469 encrypted config (or part of a config) onto a device and then request 470 that the device decrypt and install it (e.g.: 'load replace 471 encrypted)). The operator could also choose to reset the 472 device to factory defaults, and allow the device to act as though it 473 were the initial boot (see Section 4.3). 475 6. IANA Considerations 477 This document makes no requests of the IANA. 479 7. Security Considerations 481 This mechanism is intended to replace either expensive (traveling 482 employees) or insecure mechanisms of installing newly deployed 483 devices such as: unencrypted config files which can be downloaded by 484 connecting to unprotected ports in datacenters, mailing initial 485 config files on flash drives, or emailing config files and asking a 486 third-party to copy and paste it over a serial terminal. It does not 487 protect against devices with malicious firmware, nor theft and reuse 488 of devices. 490 An attacker (e.g., a malicious datacenter employee) who has physical 491 access to the device before it is connected to the network the 492 attacker may be able to extract the device private key (especially if 493 it isn't stored in a TPM), pretend to be the device when connecting 494 to the network, and download and extract the (encrypted) config file. 496 This mechanism does not protect against a malicious vendor - while 497 the keypair should be generated on the device, and the private key 498 should be securely stored, the mechanism cannot detect or protect 499 against a vendor who claims to do this, but instead generates the 500 keypair off device and keeps a copy of the private key. It is 501 largely understood in the operator community that a malicious vendor 502 or attacker with physical access to the device is largely a "Game 503 Over" situation. 505 Even when using a secure bootstrapping mechanism, security conscious 506 operators may wish to bootstrapping devices with a minimal / less 507 sensitive config, and then replace this with a more complete one 508 after install. 510 8. Acknowledgments 512 The authors wish to thank everyone who contributed, including Benoit 513 Claise, Francis Dupont, Tom Petch, Sam Ribeiro, Michael Richardson, 514 Sean Turner and Kent Watsen. Joe Clarke also provided significant 515 comments and review. 517 9. References 519 9.1. Normative References 521 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 522 Requirement Levels", BCP 14, RFC 2119, 523 DOI 10.17487/RFC2119, March 1997, 524 . 526 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 527 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 528 May 2017, . 530 9.2. Informative References 532 [I-D.gutmann-scep] 533 Gutmann, P., "Simple Certificate Enrolment Protocol", 534 draft-gutmann-scep-15 (work in progress), February 2020. 536 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 537 Unique IDentifier (UUID) URN Namespace", RFC 4122, 538 DOI 10.17487/RFC4122, July 2005, 539 . 541 [RFC8572] Watsen, K., Farrer, I., and M. Abrahamsson, "Secure Zero 542 Touch Provisioning (SZTP)", RFC 8572, 543 DOI 10.17487/RFC8572, April 2019, 544 . 546 Appendix A. Changes / Author Notes. 548 [RFC Editor: Please remove this section before publication ] 550 From -03 to -04 552 o Addressed Joe's WGLC comments. This involved changing the "just 553 try decrypt and pray" to vendor specific, like a file extension, 554 magic header sting, etc. 556 o Addressed tom's comments. 558 From individual WG-01 to -03: 560 o Addressed Joe Clarke's comments - 561 https://mailarchive.ietf.org/arch/msg/opsawg/JTzsdVXw- 562 XtWXZIIFhH7aW_-0YY 564 o Many typos / nits 566 o Broke Overview and Example Scenario into 2 sections. 568 o Reordered text for above. 570 From individual -04 to WG-01: 572 o Renamed from draft-wkumari-opsawg-sdi-04 -> draft-ietf-opsawg- 573 sdi-00 575 From -00 to -01 577 o Nothing changed in the template! 578 From -01 to -03: 580 o See github commit log (AKA, we forgot to update this!) 582 o Added Colin Doyle. 584 From -03 to -04: 586 Addressed a number of comments received before / at IETF104 (Prague). 587 These include: 589 o Pointer to https://datatracker.ietf.org/doc/draft-ietf-netconf- 590 zerotouch -- included reference to (now) RFC8572 (KW) 592 o Suggested that 802.1AR IDevID (or similar) could be used. Stress 593 that this is designed for simplicity (MR) 595 o Added text to explain that any unique device identifier can be 596 used, not just serial number - serial number is simple and easy, 597 but anything which is unique (and can be communicated to the 598 customer) will work (BF). 600 o Lots of clarifications from Joe Clarke. 602 o Make it clear it should first try use the config, and if it 603 doesn't work, then try decrypt and use it. 605 o The CA part was confusing people - the certificate is simply a 606 wrapper for the key, and the Subject just an index, and so removed 607 that. 609 o Added a bunch of ASCII diagrams 611 Appendix B. Demo / proof of concept 613 This section contains a rough demo / proof of concept of the system. 614 It is only intended for illustration, and is not intended to be used 615 in production. 617 It uses OpenSSL from the command line, in production something more 618 automated would be used. In this example, the unique identifier is 619 the serial number of the router, SN19842256. 621 B.1. Step 1: Generating the certificate. 623 This step is performed by the router. It generates a key, then a 624 csr, and then a self signed certificate. 626 B.1.1. Step 1.1: Generate the private key. 628 $ openssl genrsa -out key.pem 2048 629 Generating RSA private key, 2048 bit long modulus 630 ................................................. 631 ................................................. 632 ..........................+++ 633 ...................+++ 634 e is 65537 (0x10001) 636 B.1.2. Step 1.2: Generate the certificate signing request. 638 $ openssl req -new -key key.pem -out SN19842256.csr 639 Country Name (2 letter code) [AU]:. 640 State or Province Name (full name) [Some-State]:. 641 Locality Name (eg, city) []:. 642 Organization Name (eg, company) [Internet Widgits Pty Ltd]:. 643 Organizational Unit Name (eg, section) []:. 644 Common Name (e.g. server FQDN or YOUR name) []:SN19842256 645 Email Address []:. 647 Please enter the following 'extra' attributes 648 to be sent with your certificate request 649 A challenge password []: 650 An optional company name []:. 652 B.1.3. Step 1.3: Generate the (self signed) certificate itself. 654 $ openssl req -x509 -days 36500 -key key.pem -in SN19842256.csr -out 655 SN19842256.crt 657 The router then sends the key to the vendor's keyserver for 658 publication (not shown). 660 B.2. Step 2: Generating the encrypted config. 662 The operator now wants to deploy the new router. 664 They generate the initial config (using whatever magic tool generates 665 router configs!), fetch the router's certificate and encrypt the 666 config file to that key. This is done by the operator. 668 B.2.1. Step 2.1: Fetch the certificate. 670 $ wget http://keyserv.example.net/certificates/SN19842256.crt 672 B.2.2. Step 2.2: Encrypt the config file. 674 I'm using S/MIME because it is simple to demonstrate. This is almost 675 definitely not the best way to do this. 677 $ openssl smime -encrypt -aes-256-cbc -in SN19842256.cfg\ 678 -out SN19842256.enc -outform PEM SN19842256.crt 679 $ more SN19842256.enc 680 -----BEGIN PKCS7----- 681 MIICigYJKoZIhvcNAQcDoIICezCCAncCAQAxggE+MIIBOgIBADAiMBUxEzARBgNV 682 BAMMClNOMTk4NDIyNTYCCQDJVuBlaTOb1DANBgkqhkiG9w0BAQEFAASCAQBABvM3 683 ... 684 LZoq08jqlWhZZWhTKs4XPGHUdmnZRYIP8KXyEtHt 685 -----END PKCS7----- 687 B.2.3. Step 2.3: Copy config to the config server. 689 $ scp SN19842256.enc config.example.com:/tftpboot 691 B.3. Step 3: Decrypting and using the config. 693 When the router connects to the operator's network it will detect 694 that does not have a valid configuration file, and will start the 695 "autoboot" process. This is a well documented process, but the high 696 level overview is that it will use DHCP to obtain an IP address and 697 config server. It will then use TFTP to download a configuration 698 file, based upon its serial number (this document modifies the 699 solution to fetch an encrypted config file (ending in .enc)). It 700 will then decrypt the config file, and install it. 702 B.3.1. Step 3.1: Fetch encrypted config file from config server. 704 $ tftp 192.0.2.1 -c get SN19842256.enc 706 B.3.2. Step 3.2: Decrypt and use the config. 708 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 709 -out config.cfg -inkey key.pem 711 If an attacker does not have the correct key, they will not be able 712 to decrypt the config: 714 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 715 -out config.cfg -inkey wrongkey.pem 716 Error decrypting PKCS#7 structure 717 140352450692760:error:06065064:digital envelope 718 routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:592: 719 $ echo $? 720 4 722 Authors' Addresses 724 Warren Kumari 725 Google 726 1600 Amphitheatre Parkway 727 Mountain View, CA 94043 728 US 730 Email: warren@kumari.net 732 Colin Doyle 733 Juniper Networks 734 1133 Innovation Way 735 Sunnyvale, CA 94089 736 US 738 Email: cdoyle@juniper.net