idnits 2.17.1 draft-wkumari-opsawg-sdi-04.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 (June 12, 2019) is 1780 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'AU' is mentioned on line 554, but not defined == Missing Reference: 'Some-State' is mentioned on line 555, but not defined == Unused Reference: 'I-D.ietf-sidr-iana-objects' is defined on line 469, but no explicit reference was found in the text 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: December 14, 2019 Juniper Networks 6 June 12, 2019 8 Secure Device Install 9 draft-wkumari-opsawg-sdi-04 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 December 14, 2019. 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 . . . . . . . . . . . . . . . . . . 9 78 5.1. Key storage . . . . . . . . . . . . . . . . . . . . . . . 9 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 . . . . . . . . . . . . . . 12 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. . . . . . . . . . . . . . . . . . . . . . . . 13 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. . . . . . 14 98 B.3. Step 3: Decrypting and using the config. . . . . . . . . 14 99 B.3.1. Step 3.1: Fetch encrypted config file from config 100 server. . . . . . . . . . . . . . . . . . . . . . . . 14 101 B.3.2. Step 3.2: Decrypt and use the config. . . . . . . . . 15 102 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 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", "MAY", and "OPTIONAL" in this 152 document are to be interpreted as described in [RFC2119]. 154 2. Overview / Example Scenario 156 Sirius Cybernetics Corp needs another peering router, and so they 157 order another router from Acme Network Widgets, to be drop-shipped to 158 the Point of Presence (POP) / datacenter. Acme begins assembling the 159 new device, and tells Sirius what the new device's serial number will 160 be (SN:17894321). When Acme first installs the firmware on the 161 device and boots it, the device generates a public-private keypair, 162 and Acme publishes it on their keyserver (in a certificate, for ease 163 of use). 165 While the device is being shipped, Sirius generates the initial 166 device configuration, fetches the certificate from Acme keyservers by 167 providing the serial number of the new device. Sirius then encrypts 168 the device configuration and puts this encrypted config on a (local) 169 TFTP server. 171 When the device arrives at the POP, it gets installed in Sirius' 172 rack, and cabled as instructed. The new device powers up and 173 discovers that it has not yet been configured. It enters its 174 autoboot state, and begins the DHCP process. Sirius' DHCP server 175 provides it with an IP address and the address of the configuration 176 server. The router uses TFTP to fetch its config file (note that all 177 this is existing functionality). The device attempts to load the 178 config file - if the config file is unparsable, (new functionality) 179 the devies tries to uses its private key to decrypt the file, and, 180 assuming it validates, installs the new configuration. 182 Only the "correct" device will have the required private key and be 183 able to decrypt and use the config file (See Security 184 Considerations). An attacker would be able to connect to the network 185 and get an IP address. They would also be able to retrieve 186 (encrypted) config files by guessing serial numbers (or perhaps the 187 server would allow directory listing), but without the private keys 188 an attacker will not be able to decrypt the files. 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 uses TFTP because that is what many vendors 201 use in their auto-install / ZTP feature. It could easily instead be 202 HTTP, FTP, etc. ] 204 3. Vendor Role / Requirements 206 This section describes the vendors roles and responsibilities and 207 provides an overview of what the device needs to do. 209 3.1. Device key generation 211 During the manufacturing stage, when the device is intially powered 212 on, it will generate a public-private keypair. It will send its 213 unique identifier and the public key to the vendor's Certificate 214 Publication Server to be published. The mechanism used to do this is 215 left undefined. Note that some devices may be contrained, and so may 216 send the raw public key and unique identifier to the certificate 217 publication server, while mode capable devices may generate and send 218 self-signed certifcates. 220 3.2. Certificate Publication Server 222 The certificate publication server contains a database of 223 certificates. If newly manufactured devices upload certificates the 224 certificate publication server can simply publish these, if the 225 devices provide raw public keys and unique identfiers the certificate 226 publication server will need to wrap these in a certificate. Note 227 that the certificat publication server MUST only accept certifcates 228 or keys from the vendor's manufacturing facilities. 230 The customers (e.g Sirius Cybernetics Corp) query this server with 231 the serial number (or other provided unique identifier) of a device, 232 and retrieve the associated certificate. It is expected that 233 operators will receive the unique identifier (serial number) of 234 devices when they purchase them, and will download and store / cache 235 the certificate. This means that there is not a hard requirement on 236 the uptime / reachability of the certificate publication server. 238 +------------+ 239 +------+ |Certificate | 240 |Device| |Publication | 241 +------+ | Server | 242 +------------+ 243 +----------------+ +--------------+ 244 | +---------+ | | | 245 | | Initial | | | | 246 | | boot? | | | | 247 | +----+----+ | | | 248 | | | | | 249 | +------v-----+ | | | 250 | | Generate | | | | 251 | |Self-signed | | | | 252 | |Certificate | | | | 253 | +------------+ | | | 254 | | | | +-------+ | 255 | +-------|---|-->|Receive| | 256 | | | +---+---+ | 257 | | | | | 258 | | | +---v---+ | 259 | | | |Publish| | 260 | | | +-------+ | 261 | | | | 262 +----------------+ +--------------+ 264 Initial certificate generation and publication. 266 4. Operator Role / Responsibilities 268 4.1. Administrative 270 When purchasing a new device, the accounting department will need to 271 get the unique device identifier (likely serial number) of the new 272 device and communicate it to the operations group. 274 4.2. Technical 276 The operator will contact the vendor's publication server, and 277 download the certificate (by providing the unique device identifier 278 of the device). The operator SHOULD fetch the certificate using a 279 secure transport (e.g HTTPS). The operator will then encrypt the 280 initial configuration to the key in the certifcate, and place it on 281 their TFTP server. See Appendix B for examples. 283 +------------+ 284 +--------+ |Certificate | 285 |Operator| |Publication | 286 +--------+ | Server | 287 +------------+ 288 +----------------+ +----------------+ 289 | +-----------+ | | +-----------+ | 290 | | Fetch | | | | | | 291 | | Device |<------>|Certificate| | 292 | |Certificate| | | | | | 293 | +-----+-----+ | | +-----------+ | 294 | | | | | 295 | +-----v------+ | | | 296 | | Encrypt | | | | 297 | | Device | | | | 298 | | Config | | | | 299 | +-----+------+ | | | 300 | | | | | 301 | +-----v------+ | | | 302 | | Publish | | | | 303 | | TFTP | | | | 304 | | Server | | | | 305 | +------------+ | | | 306 | | | | 307 +----------------+ +----------------+ 309 Fetching the certificate, encrypting the configuration, publishing 310 the encrypted configuration. 312 4.3. Initial Customer Boot 314 When the device is first booted by the customer (and on subsequent 315 boots), if the device has no valid configuration, it will use 316 existing auto-install type functionality - it performs DHCP Discovery 317 until it gets a DHCP offer including DHCP option 66 or 150, contact 318 the server listed in these DHCP options and download its config file. 320 After retrieving the config file, the device will examine the file 321 and determine if it seems to be a valid config, and if so, proceeds 322 as it normally would. Note that this is existing functionality (for 323 example, Cisco devices fetch the config file named by the Bootfile- 324 Name DHCP option (67)). 326 If the file appears be "garbage", the device will attempt to decrypt 327 the configuration file using its private key. If it is able to 328 decrypt and validate the file it will install the configuration, and 329 start using it. The exact method that the device uses to determine 330 if a config file is "valid" is implementation specific, but a normal 331 config file looks significantly different to an encrypted blob. 333 Note that the device only needs DHCP and to be able to download the 334 config file; after the initial power-on in the factory it never need 335 to access the Internet or vendor or certifcate publication server - 336 it (and only it) has the private key and so has the ability to 337 decrypt the config file. 339 +--------+ +--------------+ 340 | Device | |Config server | 341 +--------+ | (e.g TFTP) | 342 +--------------+ 343 +---------------------------+ +------------------+ 344 | +-----------+ | | | 345 | | | | | | 346 | | DHCP | | | | 347 | | | | | | 348 | +-----+-----+ | | | 349 | | | | | 350 | +-----v------+ | | +-----------+ | 351 | | | | | | Encrypted | | 352 | |Fetch config|<------------------>| config | | 353 | | | | | | file | | 354 | +-----+------+ | | +-----------+ | 355 | | | | | 356 | X | | | 357 | / \ | | | 358 | / \ Y +--------+ | | | 359 | |Sane?|---->|Install,| | | | 360 | \ / | Boot | | | | 361 | \ / +--------+ | | | 362 | V | | | 363 | |N | | | 364 | | | | | 365 | +-----v------+ | | | 366 | |Decrypt with| | | | 367 | |private key | | | | 368 | +-----+------+ | | | 369 | | | | | 370 | | +--------+ | | | 371 | | |Install,| | | | 372 | +------->| Boot | | | | 373 | +--------+ | | | 374 | | | | 375 | | | | 376 +---------------------------+ +------------------+ 378 Device boot, fetch and install config file 380 5. Additional Considerations 382 5.1. Key storage 384 Ideally, the keypair would be stored in a TPM on something which is 385 identified as the "router" - for example, the chassis / backplane. 386 This is so that a keypair is bound to what humans think of as the 387 "device", and not, for example (redundant) routing engines. Devices 388 which implement IEEE 802.1AR could choose to use the IDevID for this 389 purpose. 391 5.2. Key replacement 393 It is anticipated that some operator may want to replace the (vendor 394 provided) keys after installing the device. There are two options 395 when implementing this - a vendor could allow the operator's key to 396 completely replace the initial device generated key (which means 397 that, if the device is ever sold, the new owner couldn't use this 398 technique to install the device), or the device could prefer the 399 operators installed key. This is an implementation decision left to 400 the vendor. 402 5.3. Device reinstall 404 Increasingly, operations is moving towards an automated model of 405 device management, whereby portions (or the entire) configuration is 406 programmatically generated. This means that operators may want to 407 generate an entire configuration after the device has been initially 408 installed and ask the device to load and use this new configuration. 409 It is expected (but not defined in this document, as it is vendor 410 specific) that vendors will allow the operator to copy a new, 411 encrypted config (or part of a config) onto a device and then request 412 that the device decrypt and install it (e.g: 'load replace 413 encrypted)). The operator could also choose to reset the device to 414 factory defaults, and allow the device to act as though it were the 415 initial boot (see Section 4.3). 417 6. IANA Considerations 419 This document makes no requests of the IANA. 421 7. Security Considerations 423 This mechanism is intended to replace either expensive (traveling 424 employees) or insecure mechanisms of installing newly deployed 425 devices such as: unencrypted config files which can be downloaded by 426 connecting to unprotected ports in datacenters, mailing initial 427 config files on flash drives, or emailing config files and asking a 428 third-party to copy and paste it over a serial terminal. It does not 429 protect against devices with malicious firmware, nor theft and reuse 430 of devices. 432 An attacker (e.g a malicious datacenter employee) who has physical 433 access to the device before it is connected to the network the 434 attacker may be able to extract the device private key (especially if 435 it isn't stored in a TPM), pretend to be the device when connecting 436 to the network, and download and extract the (encrypted) config file. 438 This mechanism does not protect against a malicious vendor - while 439 the keypair should be generated on the device, and the private key 440 should be securely stored, the mechanism cannot detect or protect 441 against a vendor who claims to do this, but instead generates the 442 keypair off device and keeps a copy of the private key. It is 443 largely understood in the operator community that a malicious vendor 444 or attacker with physical access to the device is largely a "Game 445 Over" situation. 447 Even when using a secure bootstrapping mechanism, security conscious 448 operators may wish to bootstrapping devices with a minimal / less 449 sensitive config, and then replace this with a more complete one 450 after install. 452 8. Acknowledgements 454 The authors wish to thank everyone who contributed, including Benoit 455 Claise, Sam Ribeiro, Michael Richardson, Sean Turner and Kent Watsen. 456 Joe Clarke provided significant comments and review. 458 9. References 460 9.1. Normative References 462 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 463 Requirement Levels", BCP 14, RFC 2119, 464 DOI 10.17487/RFC2119, March 1997, 465 . 467 9.2. Informative References 469 [I-D.ietf-sidr-iana-objects] 470 Manderson, T., Vegoda, L., and S. Kent, "RPKI Objects 471 issued by IANA", draft-ietf-sidr-iana-objects-03 (work in 472 progress), May 2011. 474 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 475 Unique IDentifier (UUID) URN Namespace", RFC 4122, 476 DOI 10.17487/RFC4122, July 2005, 477 . 479 [RFC8572] Watsen, K., Farrer, I., and M. Abrahamsson, "Secure Zero 480 Touch Provisioning (SZTP)", RFC 8572, 481 DOI 10.17487/RFC8572, April 2019, 482 . 484 Appendix A. Changes / Author Notes. 486 [RFC Editor: Please remove this section before publication ] 488 From -00 to -01 490 o Nothing changed in the template! 492 From -01 to -03: 494 o See github commit log (AKA, we forgot to update this!) 496 o Added Colin Doyle. 498 From -03 to -04: 500 Addressed a number of comments received before / at IETF104 (Prague). 501 These include: 503 o Pointer to https://datatracker.ietf.org/doc/draft-ietf-netconf- 504 zerotouch -- included reference to (now) RFC8572 (KW) 506 o Suggested that 802.1AR IDevID (or similar) could be used. Stress 507 that this is designed for simplicity (MR) 509 o Added text to explain that any unique device identifier can be 510 used, not just serial number - serial number is simple and easy, 511 but anything which is unique (and can be communicated to the 512 customer) will work (BF). 514 o Lots of clarifications from Joe Clarke. 516 o Make it clear it should first try use the config, and if it 517 doesn't work, then try decrypt and use it. 519 o The CA part was confusing people - the certificate is simply a 520 wrapper for the key, and the Subject just an index, and so removed 521 that. 523 o Added a bunch of ASCII diagrams 525 Appendix B. Demo / proof of concept 527 This section contains a rough demo / proof of concept of the system. 528 It is only intended for illustration; presumably things like 529 algorithms, key lengths, format / containers will provide much fodder 530 for discussion. 532 It uses OpenSSL from the command line, in production something more 533 automated would be used. In this example, the unique identifier is 534 the serial number of the router, SN19842256. 536 B.1. Step 1: Generating the certificate. 538 This step is performed by the router. It generates a key, then a 539 csr, and then a self signed certificate. 541 B.1.1. Step 1.1: Generate the private key. 543 $ openssl genrsa -out key.pem 2048 544 Generating RSA private key, 2048 bit long modulus 545 ................................................. 546 ................................................. 547 ..........................+++ 548 ...................+++ 549 e is 65537 (0x10001) 551 B.1.2. Step 1.2: Generate the certificate signing request. 553 $ openssl req -new -key key.pem -out SN19842256.csr 554 Country Name (2 letter code) [AU]:. 555 State or Province Name (full name) [Some-State]:. 556 Locality Name (eg, city) []:. 557 Organization Name (eg, company) [Internet Widgits Pty Ltd]:. 558 Organizational Unit Name (eg, section) []:. 559 Common Name (e.g. server FQDN or YOUR name) []:SN19842256 560 Email Address []:. 562 Please enter the following 'extra' attributes 563 to be sent with your certificate request 564 A challenge password []: 565 An optional company name []:. 567 B.1.3. Step 1.3: Generate the (self signed) certificate itself. 569 $ openssl req -x509 -days 36500 -key key.pem -in SN19842256.csr -out 570 SN19842256.crt 572 The router then sends the key to the vendor's keyserver for 573 publication (not shown). 575 B.2. Step 2: Generating the encrypted config. 577 The operator now wants to deploy the new router. 579 They generate the initial config (using whatever magic tool generates 580 router configs!), fetch the router's certificate and encrypt the 581 config file to that key. This is done by the operator. 583 B.2.1. Step 2.1: Fetch the certificate. 585 $ wget http://keyserv.example.net/certificates/SN19842256.crt 587 B.2.2. Step 2.2: Encrypt the config file. 589 I'm using S/MIME because it is simple to demonstrate. This is almost 590 definitely not the best way to do this. 592 $ openssl smime -encrypt -aes-256-cbc -in SN19842256.cfg\ 593 -out SN19842256.enc -outform PEM SN19842256.crt 594 $ more SN19842256.enc 595 -----BEGIN PKCS7----- 596 MIICigYJKoZIhvcNAQcDoIICezCCAncCAQAxggE+MIIBOgIBADAiMBUxEzARBgNV 597 BAMMClNOMTk4NDIyNTYCCQDJVuBlaTOb1DANBgkqhkiG9w0BAQEFAASCAQBABvM3 598 ... 599 LZoq08jqlWhZZWhTKs4XPGHUdmnZRYIP8KXyEtHt 600 -----END PKCS7----- 602 B.2.3. Step 2.3: Copy config to the config server. 604 $ scp SN19842256.enc config.example.com:/tftpboot 606 B.3. Step 3: Decrypting and using the config. 608 When the router connects to the operator's network it will detect 609 that does not have a valid configuration file, and will start the 610 "autoboot" process. This is a well documented process, but the high 611 level overview is that it will use DHCP to obtain an IP address and 612 config server. It will then use TFTP to download a configuration 613 file, based upon its serial number (this document modifies the 614 solution to fetch an encrypted config file (ending in .enc)). It 615 will then then decrypt the config file, and install it. 617 B.3.1. Step 3.1: Fetch encrypted config file from config server. 619 $ tftp 192.0.2.1 -c get SN19842256.enc 621 B.3.2. Step 3.2: Decrypt and use the config. 623 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 624 -out config.cfg -inkey key.pem 626 If an attacker does not have the correct key, they will not be able 627 to decrypt the config: 629 $ openssl smime -decrypt -in SN19842256.enc -inform pkcs7\ 630 -out config.cfg -inkey wrongkey.pem 631 Error decrypting PKCS#7 structure 632 140352450692760:error:06065064:digital envelope 633 routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:592: 634 $ echo $? 635 4 637 Authors' Addresses 639 Warren Kumari 640 Google 641 1600 Amphitheatre Parkway 642 Mountain View, CA 94043 643 US 645 Email: warren@kumari.net 647 Colin Doyle 648 Juniper Networks 649 1133 Innovation Way 650 Sunnyvale, CA 94089 651 US 653 Email: cdoyle@juniper.net