idnits 2.17.1 draft-ietf-opsawg-sdi-00.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 (July 22, 2019) is 1740 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'AU' is mentioned on line 568, but not defined == Missing Reference: 'Some-State' is mentioned on line 569, but not defined Summary: 0 errors (**), 0 flaws (~~), 3 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: January 23, 2020 Juniper Networks 6 July 22, 2019 8 Secure Device Install 9 draft-ietf-opsawg-sdi-00 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 January 23, 2020. 50 Copyright Notice 52 Copyright (c) 2019 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 / Example Scenario . . . . . . . . . . . . . . . . . 4 70 3. Vendor Role / Requirements . . . . . . . . . . . . . . . . . 5 71 3.1. Device key generation . . . . . . . . . . . . . . . . . . 5 72 3.2. Certificate Publication Server . . . . . . . . . . . . . 5 73 4. Operator Role / Responsibilities . . . . . . . . . . . . . . 6 74 4.1. Administrative . . . . . . . . . . . . . . . . . . . . . 6 75 4.2. Technical . . . . . . . . . . . . . . . . . . . . . . . . 6 76 4.3. Initial Customer Boot . . . . . . . . . . . . . . . . . . 7 77 5. Additional Considerations . . . . . . . . . . . . . . . . . . 10 78 5.1. Key storage . . . . . . . . . . . . . . . . . . . . . . . 10 79 5.2. Key replacement . . . . . . . . . . . . . . . . . . . . . 10 80 5.3. Device reinstall . . . . . . . . . . . . . . . . . . . . 10 81 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 82 7. Security Considerations . . . . . . . . . . . . . . . . . . . 10 83 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 84 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 85 9.1. Normative References . . . . . . . . . . . . . . . . . . 11 86 9.2. Informative References . . . . . . . . . . . . . . . . . 11 87 Appendix A. Changes / Author Notes. . . . . . . . . . . . . . . 12 88 Appendix B. Demo / proof of concept . . . . . . . . . . . . . . 13 89 B.1. Step 1: Generating the certificate. . . . . . . . . . . . 13 90 B.1.1. Step 1.1: Generate the private key. . . . . . . . . . 13 91 B.1.2. Step 1.2: Generate the certificate signing request. . 13 92 B.1.3. Step 1.3: Generate the (self signed) certificate 93 itself. . . . . . . . . . . . . . . . . . . . . . . . 14 94 B.2. Step 2: Generating the encrypted config. . . . . . . . . 14 95 B.2.1. Step 2.1: Fetch the certificate. . . . . . . . . . . 14 96 B.2.2. Step 2.2: Encrypt the config file. . . . . . . . . . 14 97 B.2.3. Step 2.3: Copy config to the config server. . . . . . 15 98 B.3. Step 3: Decrypting and using the config. . . . . . . . . 15 99 B.3.1. Step 3.1: Fetch encrypted config file from config 100 server. . . . . . . . . . . . . . . . . . . . . . . . 15 101 B.3.2. Step 3.2: Decrypt and use the config. . . . . . . . . 15 102 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16 104 1. Introduction 106 In a growing, global network, significant amounts of time and money 107 are spent simply deploying new devices and "forklift" upgrading 108 existing devices. In many cases, these devices are in shared 109 datacenters (for example, Internet Exchange Points (IXP) or "carrier 110 neutral datacenters"), which have staff on hand that can be 111 contracted to perform tasks including physical installs, device 112 reboots, loading initial configurations, etc. There are also a 113 number of (often vendor proprietary) protocols to perform initial 114 device installs and configurations - for example, many network 115 devices will attempt to use DHCP to get an IP address and 116 configuration server, and then fetch and install a configuration when 117 they are first powered on. 119 Network device configurations contain a significant amount of 120 security related and / or proprietary information (for example, 121 RADIUS or TACACS+ secrets). Exposing these to a third party to load 122 onto a new device (or using an auto-install techniques which fetch an 123 (unencrypted) config file via something like TFTP) is simply not 124 acceptable to many operators, and so they have to send employees to 125 remote locations to perform the initial configuration work. As well 126 as having a significant monetary cost, it also takes significantly 127 longer to install devices and is generally inefficient. 129 There are some workarounds to this, such as asking the vendor to pre- 130 configure the devices before shipping it; asking the smart-hands to 131 install a terminal server; providing a minimal, unsecured 132 configuration and using that to bootstrap to a complete 133 configuration, etc; but these are often clumsy and have security 134 issues - for example, in the terminal server case, the console port 135 connection could be easily snooped. 137 This document layers security onto existing auto-install solutions to 138 provide a secure method to initially configure new devices. It is 139 optimized for simplicity, both for the implementor and the operator; 140 it is explicitly not intended to be an "all singing, all dancing" 141 fully featured system for managing installed / deployed devices, nor 142 is it intended to solve all use-cases - rather it is a simple 143 targeted solution to solve a common operational issue. Solutions 144 such as Secure Zero Touch Provisioning (SZTP)" [RFC8572] are much 145 more fully featured, but also more complex to implement and / or are 146 not widely deployed yet. 148 1.1. Requirements notation 150 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 151 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 152 "OPTIONAL" in this document are to be interpreted as described in BCP 153 14 [RFC2119] [RFC8174] when, and only when, they appear in all 154 capitals, as shown here. 156 2. Overview / Example Scenario 158 Sirius Cybernetics Corp needs another peering router, and so they 159 order another router from Acme Network Widgets, to be drop-shipped to 160 the Point of Presence (POP) / datacenter. Acme begins assembling the 161 new device, and tells Sirius what the new device's serial number will 162 be (SN:17894321). When Acme first installs the firmware on the 163 device and boots it, the device generates a public-private keypair, 164 and Acme publishes it on their keyserver (in a certificate, for ease 165 of use). 167 While the device is being shipped, Sirius generates the initial 168 device configuration, fetches the certificate from Acme keyservers by 169 providing the serial number of the new device. Sirius then encrypts 170 the device configuration and puts this encrypted config on a (local) 171 TFTP server. 173 When the device arrives at the POP, it gets installed in Sirius' 174 rack, and cabled as instructed. The new device powers up and 175 discovers that it has not yet been configured. It enters its 176 autoboot state, and begins the DHCP process. Sirius' DHCP server 177 provides it with an IP address and the address of the configuration 178 server. The router uses TFTP to fetch its config file (note that all 179 this is existing functionality). The device attempts to load the 180 config file - if the config file is unparsable, (new functionality) 181 the devies tries to uses its private key to decrypt the file, and, 182 assuming it validates, installs the new configuration. 184 Only the "correct" device will have the required private key and be 185 able to decrypt and use the config file (See Security 186 Considerations). An attacker would be able to connect to the network 187 and get an IP address. They would also be able to retrieve 188 (encrypted) config files by guessing serial numbers (or perhaps the 189 server would allow directory listing), but without the private keys 190 an attacker will not be able to decrypt the files. 192 This document uses the serial number of the device as a unique 193 identifier for simplicity; some vendors may not want to implement the 194 system using the serial number as the identifier for business reasons 195 (a competitor or similar could enumerate the serial numbers and 196 determine how many devices have been manufactured). Implementors are 197 free to choose some other way of generating identifiers (e.g UUID 198 [RFC4122]), but this will likely make it somewhat harder for 199 operators to use (the serial number is usually easy to find on a 200 device, a more complex system is likely harder to track). 202 [ Ed note: This example uses TFTP because that is what many vendors 203 use in their auto-install / ZTP feature. It could easily instead be 204 HTTP, FTP, etc. ] 206 3. Vendor Role / Requirements 208 This section describes the vendors roles and responsibilities and 209 provides an overview of what the device needs to do. 211 3.1. Device key generation 213 During the manufacturing stage, when the device is intially powered 214 on, it will generate a public-private keypair. It will send its 215 unique identifier and the public key to the vendor's Certificate 216 Publication Server to be published. The mechanism used to do this is 217 left undefined. Note that some devices may be contrained, and so may 218 send the raw public key and unique identifier to the certificate 219 publication server, while mode capable devices may generate and send 220 self-signed certifcates. 222 3.2. Certificate Publication Server 224 The certificate publication server contains a database of 225 certificates. If newly manufactured devices upload certificates the 226 certificate publication server can simply publish these, if the 227 devices provide raw public keys and unique identfiers the certificate 228 publication server will need to wrap these in a certificate. Note 229 that the certificat publication server MUST only accept certifcates 230 or keys from the vendor's manufacturing facilities. 232 The customers (e.g Sirius Cybernetics Corp) query this server with 233 the serial number (or other provided unique identifier) of a device, 234 and retrieve the associated certificate. It is expected that 235 operators will receive the unique identifier (serial number) of 236 devices when they purchase them, and will download and store / cache 237 the certificate. This means that there is not a hard requirement on 238 the uptime / reachability of the certificate publication server. 240 +------------+ 241 +------+ |Certificate | 242 |Device| |Publication | 243 +------+ | Server | 244 +------------+ 245 +----------------+ +--------------+ 246 | +---------+ | | | 247 | | Initial | | | | 248 | | boot? | | | | 249 | +----+----+ | | | 250 | | | | | 251 | +------v-----+ | | | 252 | | Generate | | | | 253 | |Self-signed | | | | 254 | |Certificate | | | | 255 | +------------+ | | | 256 | | | | +-------+ | 257 | +-------|---|-->|Receive| | 258 | | | +---+---+ | 259 | | | | | 260 | | | +---v---+ | 261 | | | |Publish| | 262 | | | +-------+ | 263 | | | | 264 +----------------+ +--------------+ 266 Initial certificate generation and publication. 268 4. Operator Role / Responsibilities 270 4.1. Administrative 272 When purchasing a new device, the accounting department will need to 273 get the unique device identifier (likely serial number) of the new 274 device and communicate it to the operations group. 276 4.2. Technical 278 The operator will contact the vendor's publication server, and 279 download the certificate (by providing the unique device identifier 280 of the device). The operator SHOULD fetch the certificate using a 281 secure transport (e.g HTTPS). The operator will then encrypt the 282 initial configuration to the key in the certifcate, and place it on 283 their TFTP server. See Appendix B for examples. 285 +------------+ 286 +--------+ |Certificate | 287 |Operator| |Publication | 288 +--------+ | Server | 289 +------------+ 290 +----------------+ +----------------+ 291 | +-----------+ | | +-----------+ | 292 | | Fetch | | | | | | 293 | | Device |<------>|Certificate| | 294 | |Certificate| | | | | | 295 | +-----+-----+ | | +-----------+ | 296 | | | | | 297 | +-----v------+ | | | 298 | | Encrypt | | | | 299 | | Device | | | | 300 | | Config | | | | 301 | +-----+------+ | | | 302 | | | | | 303 | +-----v------+ | | | 304 | | Publish | | | | 305 | | TFTP | | | | 306 | | Server | | | | 307 | +------------+ | | | 308 | | | | 309 +----------------+ +----------------+ 311 Fetching the certificate, encrypting the configuration, publishing 312 the encrypted configuration. 314 4.3. Initial Customer Boot 316 When the device is first booted by the customer (and on subsequent 317 boots), if the device has no valid configuration, it will use 318 existing auto-install type functionality - it performs DHCP Discovery 319 until it gets a DHCP offer including DHCP option 66 or 150, contact 320 the server listed in these DHCP options and download its config file. 322 After retrieving the config file, the device will examine the file 323 and determine if it seems to be a valid config, and if so, proceeds 324 as it normally would. Note that this is existing functionality (for 325 example, Cisco devices fetch the config file named by the Bootfile- 326 Name DHCP option (67)). 328 If the file appears be "garbage", the device will attempt to decrypt 329 the configuration file using its private key. If it is able to 330 decrypt and validate the file it will install the configuration, and 331 start using it. The exact method that the device uses to determine 332 if a config file is "valid" is implementation specific, but a normal 333 config file looks significantly different to an encrypted blob. 335 Note that the device only needs DHCP and to be able to download the 336 config file; after the initial power-on in the factory it never need 337 to access the Internet or vendor or certifcate publication server - 338 it (and only it) has the private key and so has the ability to 339 decrypt the config file. 341 +--------+ +--------------+ 342 | Device | |Config server | 343 +--------+ | (e.g TFTP) | 344 +--------------+ 345 +---------------------------+ +------------------+ 346 | +-----------+ | | | 347 | | | | | | 348 | | DHCP | | | | 349 | | | | | | 350 | +-----+-----+ | | | 351 | | | | | 352 | +-----v------+ | | +-----------+ | 353 | | | | | | Encrypted | | 354 | |Fetch config|<------------------>| config | | 355 | | | | | | file | | 356 | +-----+------+ | | +-----------+ | 357 | | | | | 358 | X | | | 359 | / \ | | | 360 | / \ Y +--------+ | | | 361 | |Sane?|---->|Install,| | | | 362 | \ / | Boot | | | | 363 | \ / +--------+ | | | 364 | V | | | 365 | |N | | | 366 | | | | | 367 | +-----v------+ | | | 368 | |Decrypt with| | | | 369 | |private key | | | | 370 | +-----+------+ | | | 371 | | | | | 372 | v | | | 373 | / \ | | | 374 | / \ Y +--------+ | | | 375 | |Sane?|---->|Install,| | | | 376 | \ / | Boot | | | | 377 | \ / +--------+ | | | 378 | V | | | 379 | |N | | | 380 | | | | | 381 | +----v---+ | | | 382 | |Give up | | | | 383 | |go home | | | | 384 | +--------+ | | | 385 | | | | 386 +---------------------------+ +------------------+ 388 Device boot, fetch and install config file 390 5. Additional Considerations 392 5.1. Key storage 394 Ideally, the keypair would be stored in a TPM on something which is 395 identified as the "router" - for example, the chassis / backplane. 396 This is so that a keypair is bound to what humans think of as the 397 "device", and not, for example (redundant) routing engines. Devices 398 which implement IEEE 802.1AR could choose to use the IDevID for this 399 purpose. 401 5.2. Key replacement 403 It is anticipated that some operator may want to replace the (vendor 404 provided) keys after installing the device. There are two options 405 when implementing this - a vendor could allow the operator's key to 406 completely replace the initial device generated key (which means 407 that, if the device is ever sold, the new owner couldn't use this 408 technique to install the device), or the device could prefer the 409 operators installed key. This is an implementation decision left to 410 the vendor. 412 5.3. Device reinstall 414 Increasingly, operations is moving towards an automated model of 415 device management, whereby portions (or the entire) configuration is 416 programmatically generated. This means that operators may want to 417 generate an entire configuration after the device has been initially 418 installed and ask the device to load and use this new configuration. 419 It is expected (but not defined in this document, as it is vendor 420 specific) that vendors will allow the operator to copy a new, 421 encrypted config (or part of a config) onto a device and then request 422 that the device decrypt and install it (e.g: 'load replace 423 encrypted)). The operator could also choose to reset the device to 424 factory defaults, and allow the device to act as though it were the 425 initial boot (see Section 4.3). 427 6. IANA Considerations 429 This document makes no requests of the IANA. 431 7. Security Considerations 433 This mechanism is intended to replace either expensive (traveling 434 employees) or insecure mechanisms of installing newly deployed 435 devices such as: unencrypted config files which can be downloaded by 436 connecting to unprotected ports in datacenters, mailing initial 437 config files on flash drives, or emailing config files and asking a 438 third-party to copy and paste it over a serial terminal. It does not 439 protect against devices with malicious firmware, nor theft and reuse 440 of devices. 442 An attacker (e.g a malicious datacenter employee) who has physical 443 access to the device before it is connected to the network the 444 attacker may be able to extract the device private key (especially if 445 it isn't stored in a TPM), pretend to be the device when connecting 446 to the network, and download and extract the (encrypted) config file. 448 This mechanism does not protect against a malicious vendor - while 449 the keypair should be generated on the device, and the private key 450 should be securely stored, the mechanism cannot detect or protect 451 against a vendor who claims to do this, but instead generates the 452 keypair off device and keeps a copy of the private key. It is 453 largely understood in the operator community that a malicious vendor 454 or attacker with physical access to the device is largely a "Game 455 Over" situation. 457 Even when using a secure bootstrapping mechanism, security conscious 458 operators may wish to bootstrapping devices with a minimal / less 459 sensitive config, and then replace this with a more complete one 460 after install. 462 8. Acknowledgements 464 The authors wish to thank everyone who contributed, including Benoit 465 Claise, Sam Ribeiro, Michael Richardson, Sean Turner and Kent Watsen. 466 Joe Clarke provided significant comments and review. 468 9. References 470 9.1. Normative References 472 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 473 Requirement Levels", BCP 14, RFC 2119, 474 DOI 10.17487/RFC2119, March 1997, 475 . 477 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 478 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 479 May 2017, . 481 9.2. Informative References 483 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 484 Unique IDentifier (UUID) URN Namespace", RFC 4122, 485 DOI 10.17487/RFC4122, July 2005, 486 . 488 [RFC8572] Watsen, K., Farrer, I., and M. Abrahamsson, "Secure Zero 489 Touch Provisioning (SZTP)", RFC 8572, 490 DOI 10.17487/RFC8572, April 2019, 491 . 493 Appendix A. Changes / Author Notes. 495 [RFC Editor: Please remove this section before publication ] 497 From individual -04 to WG-01: 499 o Renamed from draft-wkumari-opsawg-sdi-04 -> draft-ietf-opsawg- 500 sdi-00 502 From -00 to -01 504 o Nothing changed in the template! 506 From -01 to -03: 508 o See github commit log (AKA, we forgot to update this!) 510 o Added Colin Doyle. 512 From -03 to -04: 514 Addressed a number of comments received before / at IETF104 (Prague). 515 These include: 517 o Pointer to https://datatracker.ietf.org/doc/draft-ietf-netconf- 518 zerotouch -- included reference to (now) RFC8572 (KW) 520 o Suggested that 802.1AR IDevID (or similar) could be used. Stress 521 that this is designed for simplicity (MR) 523 o Added text to explain that any unique device identifier can be 524 used, not just serial number - serial number is simple and easy, 525 but anything which is unique (and can be communicated to the 526 customer) will work (BF). 528 o Lots of clarifications from Joe Clarke. 530 o Make it clear it should first try use the config, and if it 531 doesn't work, then try decrypt and use it. 533 o The CA part was confusing people - the certificate is simply a 534 wrapper for the key, and the Subject just an index, and so removed 535 that. 537 o Added a bunch of ASCII diagrams 539 Appendix B. Demo / proof of concept 541 This section contains a rough demo / proof of concept of the system. 542 It is only intended for illustration; presumably things like 543 algorithms, key lengths, format / containers will provide much fodder 544 for discussion. 546 It uses OpenSSL from the command line, in production something more 547 automated would be used. In this example, the unique identifier is 548 the serial number of the router, SN19842256. 550 B.1. Step 1: Generating the certificate. 552 This step is performed by the router. It generates a key, then a 553 csr, and then a self signed certificate. 555 B.1.1. Step 1.1: Generate the private key. 557 $ openssl genrsa -out key.pem 2048 558 Generating RSA private key, 2048 bit long modulus 559 ................................................. 560 ................................................. 561 ..........................+++ 562 ...................+++ 563 e is 65537 (0x10001) 565 B.1.2. Step 1.2: Generate the certificate signing request. 567 $ openssl req -new -key key.pem -out SN19842256.csr 568 Country Name (2 letter code) [AU]:. 569 State or Province Name (full name) [Some-State]:. 570 Locality Name (eg, city) []:. 571 Organization Name (eg, company) [Internet Widgits Pty Ltd]:. 572 Organizational Unit Name (eg, section) []:. 573 Common Name (e.g. server FQDN or YOUR name) []:SN19842256 574 Email Address []:. 576 Please enter the following 'extra' attributes 577 to be sent with your certificate request 578 A challenge password []: 579 An optional company name []:. 581 B.1.3. Step 1.3: Generate the (self signed) certificate itself. 583 $ openssl req -x509 -days 36500 -key key.pem -in SN19842256.csr -out 584 SN19842256.crt 586 The router then sends the key to the vendor's keyserver for 587 publication (not shown). 589 B.2. Step 2: Generating the encrypted config. 591 The operator now wants to deploy the new router. 593 They generate the initial config (using whatever magic tool generates 594 router configs!), fetch the router's certificate and encrypt the 595 config file to that key. This is done by the operator. 597 B.2.1. Step 2.1: Fetch the certificate. 599 $ wget http://keyserv.example.net/certificates/SN19842256.crt 601 B.2.2. Step 2.2: Encrypt the config file. 603 I'm using S/MIME because it is simple to demonstrate. This is almost 604 definitely not the best way to do this. 606 $ openssl smime -encrypt -aes-256-cbc -in SN19842256.cfg\ 607 -out SN19842256.enc -outform PEM SN19842256.crt 608 $ more SN19842256.enc 609 -----BEGIN PKCS7----- 610 MIICigYJKoZIhvcNAQcDoIICezCCAncCAQAxggE+MIIBOgIBADAiMBUxEzARBgNV 611 BAMMClNOMTk4NDIyNTYCCQDJVuBlaTOb1DANBgkqhkiG9w0BAQEFAASCAQBABvM3 612 ... 613 LZoq08jqlWhZZWhTKs4XPGHUdmnZRYIP8KXyEtHt 614 -----END PKCS7----- 616 B.2.3. Step 2.3: Copy config to the config server. 618 $ scp SN19842256.enc config.example.com:/tftpboot 620 B.3. Step 3: Decrypting and using the config. 622 When the router connects to the operator's network it will detect 623 that does not have a valid configuration file, and will start the 624 "autoboot" process. This is a well documented process, but the high 625 level overview is that it will use DHCP to obtain an IP address and 626 config server. It will then use TFTP to download a configuration 627 file, based upon its serial number (this document modifies the 628 solution to fetch an encrypted config file (ending in .enc)). It 629 will then then decrypt the config file, and install it. 631 B.3.1. Step 3.1: Fetch encrypted config file from config server. 633 $ tftp 192.0.2.1 -c get SN19842256.enc 635 B.3.2. Step 3.2: Decrypt and use the config. 637 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 638 -out config.cfg -inkey key.pem 640 If an attacker does not have the correct key, they will not be able 641 to decrypt the config: 643 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 644 -out config.cfg -inkey wrongkey.pem 645 Error decrypting PKCS#7 structure 646 140352450692760:error:06065064:digital envelope 647 routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:592: 648 $ echo $? 649 4 651 Authors' Addresses 653 Warren Kumari 654 Google 655 1600 Amphitheatre Parkway 656 Mountain View, CA 94043 657 US 659 Email: warren@kumari.net 661 Colin Doyle 662 Juniper Networks 663 1133 Innovation Way 664 Sunnyvale, CA 94089 665 US 667 Email: cdoyle@juniper.net