idnits 2.17.1 draft-ietf-sidr-bgpsec-protocol-10.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (October 27, 2014) is 3466 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4893 (ref. '4') (Obsoleted by RFC 6793) ** Downref: Normative reference to an Informational RFC: RFC 6480 (ref. '7') Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Lepinski, Ed. 3 Internet-Draft BBN 4 Intended status: Standards Track October 27, 2014 5 Expires: April 27, 2015 7 BGPSEC Protocol Specification 8 draft-ietf-sidr-bgpsec-protocol-10 10 Abstract 12 This document describes BGPSEC, an extension to the Border Gateway 13 Protocol (BGP) that provides security for the path of autonomous 14 systems through which a BGP update message passes. BGPSEC is 15 implemented via a new optional non-transitive BGP path attribute that 16 carries a digital signature produced by each autonomous system that 17 propagates the update message. 19 Requirements Language 21 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 22 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 23 "OPTIONAL" are to be interpreted as described in RFC 2119 [1] only 24 when they appear in all upper case. They may also appear in lower or 25 mixed case as English words, without normative meaning 27 Status of this Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on January 5, 2015. 44 Copyright Notice 46 Copyright (c) 2014 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 62 2. BGPSEC Negotiation . . . . . . . . . . . . . . . . . . . . . . 3 63 2.1. The BGPSEC Capability . . . . . . . . . . . . . . . . . . 3 64 2.2. Negotiating BGPSEC Support . . . . . . . . . . . . . . . . 4 65 3. The BGPSEC_Path Attribute . . . . . . . . . . . . . . . . . . 5 66 3.1. Secure_Path . . . . . . . . . . . . . . . . . . . . . . . 7 67 3.2. Signature_Block . . . . . . . . . . . . . . . . . . . . . 8 68 4. Generating a BGPSEC Update . . . . . . . . . . . . . . . . . . 10 69 4.1. Originating a New BGPSEC Update . . . . . . . . . . . . . 11 70 4.2. Propagating a Route Advertisement . . . . . . . . . . . . 13 71 4.3. Processing Instructions for Confederation Members . . . . 17 72 4.4. Reconstructing the AS_PATH Attribute . . . . . . . . . . . 19 73 5. Processing a Received BGPSEC Update . . . . . . . . . . . . . 20 74 5.1. Overview of BGPSEC Validation . . . . . . . . . . . . . . 22 75 5.2. Validation Algorithm . . . . . . . . . . . . . . . . . . . 23 76 6. Algorithms and Extensibility . . . . . . . . . . . . . . . . . 27 77 6.1. Algorithm Suite Considerations . . . . . . . . . . . . . . 27 78 6.2. Extensibility Considerations . . . . . . . . . . . . . . . 27 79 7. Security Considerations . . . . . . . . . . . . . . . . . . . 28 80 7.1 Security Guarantees . . . . . . . . . . . . . . . . . . . . 28 81 7.2 On the Removal of BGPSEC Signatures . . . . . . . . . . . . 29 82 7.3 Mitigation of Denial of Service Attacks . . . . . . . . . . 30 83 7.4 Additional Security Considerations . . . . . . . . . . . . . 31 84 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31 85 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 32 86 9.1. Authors . . . . . . . . . . . . . . . . . . . . . . . . . 32 87 9.2. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 32 88 10. Normative References . . . . . . . . . . . . . . . . . . . . 33 89 11. Informative References . . . . . . . . . . . . . . . . . . . 33 90 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 34 92 1. Introduction 94 This document describes BGPSEC, a mechanism for providing path 95 security for Border Gateway Protocol (BGP) [2] route advertisements. 96 That is, a BGP speaker who receives a valid BGPSEC update has 97 cryptographic assurance that the advertised route has the following 98 property: Every AS on the path of ASes listed in the update message 99 has explicitly authorized the advertisement of the route to the 100 subsequent AS in the path. 102 This document specifies a new optional (non-transitive) BGP path 103 attribute, BGPSEC_Path. It also describes how a BGPSEC-compliant BGP 104 speaker (referred to hereafter as a BGPSEC speaker) can generate, 105 propagate, and validate BGP update messages containing this attribute 106 to obtain the above assurances. 108 BGPSEC is intended to be used to supplement BGP Origin Validation 109 [19] and when used in conjunction with origin validation, it is 110 possible to prevent a wide variety of route hijacking attacks against 111 BGP. 113 BGPSEC relies on the Resource Public Key Infrastructure (RPKI) 114 certificates that attest to the allocation of AS number and IP 115 address resources. (For more information on the RPKI, see [7] and 116 the documents referenced therein.) Any BGPSEC speaker who wishes to 117 send, to external (eBGP) peers, BGP update messages containing the 118 BGPSEC_Path needs to possess a private key associated with an RPKI 119 router certificate [10] that corresponds to the BGPSEC speaker's AS 120 number. Note, however, that a BGPSEC speaker does not need such a 121 certificate in order to validate received update messages containing 122 the BGPSEC_Path attribute. 124 2. BGPSEC Negotiation 126 This document defines a new BGP capability [6] that allows a BGP 127 speaker to advertise to a neighbor the ability to send or to receive 128 BGPSEC update messages (i.e., update messages containing the 129 BGPSEC_Path attribute). 131 2.1. The BGPSEC Capability 133 This capability has capability code : TBD 135 The capability length for this capability MUST be set to 3. 137 The three octets of the capability value are specified as follows. 139 BGPSEC Send Capability Value: 141 0 1 2 3 4 5 6 7 142 +---------------------------------------+ 143 | Version | Dir | Reserved | 144 +---------------------------------------+ 145 | | 146 +------ AFI -----+ 147 | | 148 +---------------------------------------+ 150 The first four bits of the first octet indicate the version of BGPSEC 151 for which the BGP speaker is advertising support. This document 152 defines only BGPSEC version 0 (all four bits set to zero). Other 153 versions of BGPSEC may be defined in future documents. A BGPSEC 154 speaker MAY advertise support for multiple versions of BGPSEC by 155 including multiple versions of the BGPSEC capability in its BGP OPEN 156 message. 158 The fifth bit of the first octet is a direction bit which indicates 159 whether the BGP speaker is advertising the capability to send BGPSEC 160 update messages or receive BGPSEC update messages. The BGP speaker 161 sets this bit to 0 to indicate the capability to receive BGPSEC 162 update messages. The BGP speaker sets this bit to 1 to indicate the 163 capability to send BGPSEC update messages. 165 The remaining three bits of the first octet are reserved for future 166 use. These bits are set to zero by the sender of the capability and 167 ignored by the receiver of the capability. 169 The second and third octets contain the 16-bit Address Family 170 Identifier (AFI) which indicates the address family for which the 171 BGPSEC speaker is advertising support for BGPSEC. This document only 172 specifies BGPSEC for use with two address families, IPv4 and IPv6, 173 AFI values 1 and 2 respectively. BGPSEC for use with other address 174 families may be specified in future documents. 176 2.2. Negotiating BGPSEC Support 178 In order to indicate that a BGP speaker is willing to send BGPSEC 179 update messages (for a particular address family), a BGP speaker 180 sends the BGPSEC Capability (see Section 2.1) with the Direction bit 181 (the fifth bit of the first octet) set to 1. In order to indicate 182 that the speaker is willing to receive BGP update messages containing 183 the BGPSEC_Path attribute (for a particular address family), a BGP 184 speaker sends the BGPSEC capability with the Direction bit set to 0. 185 In order to advertise the capability to both send and receive BGPSEC 186 update messages, the BGP speaker sends two copies of the BGPSEC 187 capability (one with the direction bit set to 0 and one with the 188 direction bit set to 1). 190 Similarly, if a BGP speaker wishes to use BGPSEC with two different 191 address families (i.e., IPv4 and IPv6) over the same BGP session, 192 then the speaker includes two instances of this capability (one for 193 each address family) in the BGP OPEN message. A BGP speaker SHOULD 194 NOT advertise the capability of BGPSEC support for a particular AFI 195 unless it has also advertised the multiprotocol extension capability 196 for the same AFI combination [3]. 198 In a session where BGP session, a peer is permitted to send update 199 messages containing the BGPSEC_Path attribute if, and only if: 201 o The given peer sent the BGPSEC capability for a particular version 202 of BGPSEC and a particular address family with the Direction bit 203 set to 1; and 205 o The other peer sent the BGPSEC capability for the same version of 206 BGPSEC and the same address family with the Direction bit set to 207 0. 209 In such a session, we say that the use of (the particular version of) 210 BGPSEC has been negotiated (for a particular address family). BGP 211 update messages without the BGPSEC_Path attribute MAY be sent within 212 a session regardless of whether or not the use of BGPSEC is 213 successfully negotiated. However, if BGPSEC is not successfully 214 negotiated, then BGP update messages containing the BGPSEC_Path 215 attribute MUST NOT be sent. 217 This document defines the behavior of implementations in the case 218 where BGPSEC version zero is the only version that has been 219 successfully negotiated. Any future document which specifies 220 additional versions of BGPSEC will need to specify behavior in the 221 case that support for multiple versions is negotiated. 223 BGPSEC cannot provide meaningful security guarantees without support 224 for four-byte AS numbers. Therefore, any BGP speaker that announces 225 the BGPSEC capability, MUST also announce the capability for four- 226 byte AS support [4]. If a BGP speaker sends the BGPSEC capability but 227 not the four-byte AS support capability then BGPSEC has not been 228 successfully negotiated, and update messages containing the 229 BGPSEC_Path attribute MUST NOT be sent within such a session. 231 Note that BGPSEC update messages can be quite large, therefore any 232 BGPSEC speaker announcing the capability to receive BGPSEC messages 233 SHOULD also announce support for the capability to receive BGP 234 extended messages [9]. 236 3. The BGPSEC_Path Attribute 237 The BGPSEC_Path attribute is a new optional non-transitive BGP path 238 attribute. 240 This document registers a new attribute type code for this attribute 241 : TBD 243 The BGPSEC_Path attribute carries the secured information regarding 244 the path of ASes through which an update message passes. This 245 includes the digital signatures used to protect the path information. 246 We refer to those update messages that contain the BGPSEC_Path 247 attribute as "BGPSEC Update messages". The BGPSEC_Path attribute 248 replaces the AS_PATH attribute in a BGPSEC update message. That is, 249 update messages that contain the BGPSEC_Path attribute MUST NOT 250 contain the AS_PATH attribute, and vice versa. 252 The BGPSEC_Path attribute is made up of several parts. The following 253 high-level diagram provides an overview of the structure of the 254 BGPSEC_Path attribute: 256 High-Level Diagram of the BGPSEC_Path Attribute 257 +---------------------------------------------------------+ 258 | +-----------------+ | 259 | | Secure Path | | 260 | +-----------------+ | 261 | | AS X | | 262 | | pCount X | | 263 | | Flags X | | 264 | | AS Y | | 265 | | pCount Y | | 266 | | Flags Y | | 267 | | ... | | 268 | +-----------------+ | 269 | | 270 | +-----------------+ +-----------------+ | 271 | | Sig Block 1 | | Sig Block 2 | | 272 | +-----------------+ +-----------------+ | 273 | | Alg Suite 1 | | Alg Suite 2 | | 274 | | SKI X1 | | SKI X1 | | 275 | | Signature X1 | | Signature X1 | | 276 | | SKI Y1 | | SKI Y1 | | 277 | | Signature Y1 | | Signature Y1 | | 278 | | ... | | .... | | 279 | +-----------------+ +-----------------+ | 280 | | 281 +---------------------------------------------------------+ 283 The following is the specification of the format for the BGPSEC_Path 284 attribute. 286 BGPSEC_Path Attribute 288 +-------------------------------------------------------+ 289 | Secure_Path (variable) | 290 +-------------------------------------------------------+ 291 | Sequence of one or two Signature_Blocks (variable) | 292 +-------------------------------------------------------+ 294 The Secure_Path contains AS path information for the BGPSEC update 295 message. This is logically equivalent to the information that is 296 contained in a non-BGPSEC AS_PATH attribute. A BGPSEC update message 297 containing the BGPSEC_Path attribute MUST NOT contain the AS_PATH 298 attribute. The Secure_Path is used by BGPSEC speakers in the same 299 way that information from the AS_PATH is used by non-BGPSEC speakers. 300 The format of the Secure_Path is described below in Section 3.1. 302 The BGPSEC_Path attribute will contain one or two Signature_Blocks, 303 each of which corresponds to a different algorithm suite. Each of 304 the Signature_Blocks will contain a signature segment for one AS 305 number (i.e, secure path segment) in the Secure_Path. In the most 306 common case, the BGPSEC_Path attribute will contain only a single 307 Signature_Block. However, in order to enable a transition from an 308 old algorithm suite to a new algorithm suite (without a flag day), it 309 will be necessary to include two Signature_Blocks (one for the old 310 algorithm suite and one for the new algorithm suite) during the 311 transition period. (See Section 6.1 for more discussion of algorithm 312 transitions.) The format of the Signature_Blocks is described below 313 in Section 3.2. 315 3.1. Secure_Path 317 Here we provide a detailed description of the Secure_Path information 318 in the BGPSEC_Path attribute. 320 Secure_Path 322 +-----------------------------------------------+ 323 | Secure_Path Length (2 octets) | 324 +-----------------------------------------------+ 325 | One or More Secure_Path Segments (variable) | 326 +-----------------------------------------------+ 328 The Secure_Path Length contains the length (in octets) of the entire 329 Secure_Path (including the two octets used to express this length 330 field). As explained below, each Secure_Path segment is six octets 331 long. Note that this means the Secure_Path Length is two greater 332 than six times the number Secure_Path Segments (i.e., the number of 333 AS numbers in the path). 335 The Secure_Path contains one Secure_Path Segment for each (distinct) 336 Autonomous System in the path to the originating AS of the NLRI 337 specified in the update message. 339 Secure_Path Segment 341 +----------------------------+ 342 | AS Number (4 octets) | 343 +----------------------------+ 344 | pCount (1 octet) | 345 +----------------------------+ 346 | Flags (1 octet) | 347 +----------------------------+ 349 The AS Number is the AS number of the BGP speaker that added this 350 Secure_Path segment to the BGPSEC_Path attribute. (See Section 4 for 351 more information on populating this field.) 353 The pCount field contains the number of repetitions of the associated 354 autonomous system number that the signature covers. This field 355 enables a BGPSEC speaker to mimic the semantics of prepending 356 multiple copies of their AS to the AS_PATH without requiring the 357 speaker to generate multiple signatures. (The pCount field is also 358 useful in managing AS Number migrations, see [18] for details.) 360 The first bit of the Flags field is the Confed_Segment flag. The 361 Confed_Segment flag is set to one to indicate that the BGPSEC speaker 362 that constructed this Secure_Path segment is sending the update 363 message to a peer AS within the same Autonomous System confederation 364 [5]. (That is, the Confed_Segment flag is set in a BGPSEC update 365 message whenever, in a non-BGPSEC update message, the BGP speaker's 366 AS would appear in a AS_PATH segment of type AS_CONFED_SEQUENCE.) In 367 all other cases the Confed_Segment flag is set to zero. 369 The remaining seven bits of the Flags MUST be set to zero by the 370 sender, and ignored by the receiver. Note, however, that the 371 signature is computed over all eight bits of the flags field. 373 3.2. Signature_Block 375 Here we provide a detailed description of the Signature_Blocks in the 376 BGPSEC_Path attribute. 378 Signature_Block 380 +---------------------------------------------+ 381 | Signature_Block Length (2 octets) | 382 +---------------------------------------------+ 383 | Algorithm Suite Identifier (1 octet) | 384 +---------------------------------------------+ 385 | Sequence of Signature Segments (variable) | 386 +---------------------------------------------+ 388 The Signature_Block Length is the total number of octets in the 389 Signature_Block (including the two octets used to express this length 390 field). 392 The Algorithm Suite Identifier is a one-octet identifier specifying 393 the digest algorithm and digital signature algorithm used to produce 394 the digital signature in each Signature Segment. An IANA registry of 395 algorithm identifiers for use in BGPSEC is specified in the BGPSEC 396 algorithms document [11]. 398 A Signature_Block has exactly one Signature Segment for each 399 Secure_Path Segment in the Secure_Path portion of the BGPSEC_Path 400 Attribute. (That is, one Signature Segment for each distinct AS on 401 the path for the NLRI in the Update message.) 403 Signature Segments 404 +---------------------------------------------+ 405 | Subject Key Identifier (20 octets) | 406 +---------------------------------------------+ 407 | Signature Length (2 octets) | 408 +---------------------------------------------+ 409 | Signature (variable) | 410 +---------------------------------------------+ 412 The Subject Key Identifier contains the value in the Subject Key 413 Identifier extension of the RPKI router certificate [10] that is used 414 to verify the signature (see Section 5 for details on validity of 415 BGPSEC update messages). 417 The Signature Length field contains the size (in octets) of the value 418 in the Signature field of the Signature Segment. 420 The Signature contains a digital signature that protects the NLRI and 421 the BGPSEC_Path attribute (see Sections 4 and 5 for details on 422 signature generation and validation, respectively). 424 4. Generating a BGPSEC Update 426 Sections 4.1 and 4.2 cover two cases in which a BGPSEC speaker may 427 generate an update message containing the BGPSEC_Path attribute. The 428 first case is that in which the BGPSEC speaker originates a new route 429 advertisement (Section 4.1). That is, the BGPSEC speaker is 430 constructing an update message in which the only AS to appear in the 431 BGPSEC_Path is the speaker's own AS. The second case is that in 432 which the BGPSEC speaker receives a route advertisement from a peer 433 and then decides to propagate the route advertisement to an external 434 (eBGP) peer (Section 4.2). That is, the BGPSEC speaker has received 435 a BGPSEC update message and is constructing a new update message for 436 the same NLRI in which the BGPSEC_Path attribute will contain AS 437 number(s) other than the speaker's own AS. 439 The remaining case is where the BGPSEC speaker sends the update 440 message to an internal (iBGP) peer. When originating a new route 441 advertisement and sending it to an internal peer, the BGPSEC speaker 442 creates a new BGPSEC_Path attribute with zero Secure_Path segments 443 and zero Signature Segments. When propagating a received route 444 advertisement to an internal peer, the BGPSEC speaker populates the 445 BGPSEC_Path attribute by copying the BGPSEC_Path attribute from the 446 received update message. That is, the BGPSEC_Path attribute is 447 copied verbatim. Note that in the case that a BGPSEC speaker chooses 448 to forward to an iBGP peer a BGPSEC update message that has not been 449 successfully validated (see Section 5), the BGPSEC_Path attribute 450 SHOULD NOT be removed. (See Section 7 for the security ramifications 451 of removing BGPSEC signatures.) 453 The information protected by the signature on a BGPSEC update message 454 includes the AS number of the peer to whom the update message is 455 being sent. Therefore, if a BGPSEC speaker wishes to send a BGPSEC 456 update to multiple BGP peers, it MUST generate a separate BGPSEC 457 update message for each unique peer AS to which the update message is 458 sent. 460 A BGPSEC update message MUST advertise a route to only a single NLRI. 461 This is because a BGPSEC speaker receiving an update message with 462 multiple NLRI would be unable to construct a valid BGPSEC update 463 message (i.e., valid path signatures) containing a subset of the NLRI 464 in the received update. If a BGPSEC speaker wishes to advertise 465 routes to multiple NLRI, then it MUST generate a separate BGPSEC 466 update message for each NLRI. 468 In order to create or add a new signature to a BGPSEC update message 469 with a given algorithm suite, the BGPSEC speaker must possess a 470 private key suitable for generating signatures for this algorithm 471 suite. Additionally, this private key must correspond to the public 472 key in a valid Resource PKI end-entity certificate whose AS number 473 resource extension includes the BGPSEC speaker's AS number [10]. Note 474 also that new signatures are only added to a BGPSEC update message 475 when a BGPSEC speaker is generating an update message to send to an 476 external peer (i.e., when the AS number of the peer is not equal to 477 the BGPSEC speaker's own AS number). Therefore, a BGPSEC speaker who 478 only sends BGPSEC update messages to peers within its own AS, it does 479 not need to possess any private signature keys. 481 4.1. Originating a New BGPSEC Update 483 In an update message that originates a new route advertisement (i.e., 484 an update whose path will contain only a single AS number), when 485 sending the route advertisement to an external, BGPSEC-speaking peer, 486 the BGPSEC speaker creates a new BGPSEC_Path attribute as follows. 488 First, the BGPSEC speaker constructs the Secure_Path with a single 489 Secure_Path Segment. The AS in this path is the BGPSEC speaker's own 490 AS number. In particular, this AS number MUST match an AS number in 491 the AS number resource extension field of the Resource PKI router 492 certificate(s) [10] that will be used to verify the digital 493 signature(s) constructed by this BGPSEC speaker. 495 The BGPSEC_Path attribute and the AS_Path attribute are mutually 496 exclusive. That is, any update message containing the BGPSEC_Path 497 attribute MUST NOT contain the AS_Path attribute. The information 498 that would be contained in the AS_Path attribute is instead conveyed 499 in the Secure_Path portion of the BGPSEC_Path attribute. 501 The Resource PKI enables the legitimate holder of IP address 502 prefix(es) to issue a signed object, called a Route Origination 503 Authorization (ROA), that authorizes a given AS to originate routes 504 to a given set of prefixes (see [8]). It is expected that most 505 relying parties will utilize BGPSEC in tandem with origin validation 506 (see [19] and [20]). Therefore, it is RECOMMENDED that a BGPSEC 507 speaker only originate a BGPSEC update advertising a route for a 508 given prefix if there exists a valid ROA authorizing the BGPSEC 509 speaker's AS to originate routes to this prefix. 511 The pCount field of the Secure_Path Segment is typically set to the 512 value 1. However, a BGPSEC speaker may set the pCount field to a 513 value greater than 1. Setting the pCount field to a value greater 514 than one has the same semantics as repeating an AS number multiple 515 times in the AS_PATH of a non-BGPSEC update message (e.g., for 516 traffic engineering purposes). Setting the pCount field to a value 517 greater than one permits this repetition without requiring a separate 518 digital signature for each repetition. 520 If the BGPSEC speaker is not a member of an autonomous system 521 confederation [5], then the Flags field of the Secure_Path Segment 522 MUST be set to zero. (Members of a confederation should follow the 523 special processing instructions for confederation members in Section 524 4.4.) 526 Typically, a BGPSEC speaker will use only a single algorithm suite, 527 and thus create only a single Signature_Block in the BGPSEC_Path 528 attribute. However, to ensure backwards compatibility during a 529 period of transition from a 'current' algorithm suite to a 'new' 530 algorithm suite, it will be necessary to originate update messages 531 that contain a Signature_Block for both the 'current' and the 'new' 532 algorithm suites (see Section 6.1). 534 When originating a new route advertisement, each Signature_Block MUST 535 consist of a single Signature Segment. The following describes how 536 the BGPSEC speaker populates the fields of the Signature_Block. 538 The Subject Key Identifier field (see Section 3) is populated with 539 the identifier contained in the Subject Key Identifier extension of 540 the RPKI router certificate corresponding to the BGPSEC speaker[10]. 541 This Subject Key Identifier will be used by recipients of the route 542 advertisement to identify the proper certificate to use in verifying 543 the signature. 545 The Signature field contains a digital signature that binds the NLRI 546 and BGPSEC_Path attribute to the RPKI router corresponding to the 547 BGPSEC speaker. The digital signature is computed as follows: 549 o Construct a sequence of octets by concatenating the Target AS 550 Number, the Secure_Path (Origin AS, pCount, and Flags), Algorithm 551 Suite Identifier, and NLRI. The Target AS Number is the AS to 552 whom the BGPSEC speaker intends to send the update message. (Note 553 that the Target AS number is the AS number announced by the peer 554 in the OPEN message of the BGP session within which the update is 555 sent.) 556 Sequence of Octets to be Signed 557 +------------------------------------+ 558 | Target AS Number (4 octets) | 559 +------------------------------------+ 560 | Origin AS Number (4 octets) | ---\ 561 +------------------------------------+ \ 562 | pCount (1 octet) | > Secure_Path 563 +------------------------------------+ / 564 | Flags (1 octet) | ---/ 565 +------------------------------------+ 566 | Algorithm Suite Id. (1 octet) | 567 +------------------------------------+ 568 | NLRI Length (1 octet) | 569 +------------------------------------+ 570 | NLRI Prefix (variable) | 571 +------------------------------------+ 573 o Apply to this octet sequence the digest algorithm (for the 574 algorithm suite of this Signature_Block) to obtain a digest value. 576 o Apply to this digest value the signature algorithm, (for the 577 algorithm suite of this Signature_Block) to obtain the digital 578 signature. Then populate the Signature Field with this digital 579 signature. 581 The Signature Length field is populated with the length (in octets) 582 of the Signature field. 584 4.2. Propagating a Route Advertisement 586 When a BGPSEC speaker receives a BGPSEC update message containing a 587 BGPSEC_Path attribute (with one or more signatures) from an (internal 588 or external) peer, it may choose to propagate the route advertisement 589 by sending to its (internal or external) peers by creating a new 590 BGPSEC advertisement for the same prefix. 592 If a BGPSEC router has received only a non-BGPSEC update message 593 (without the BGPSEC_Path attribute), containing the AS_Path 594 attribute, from a peer for a given prefix then it MUST NOT attach a 595 BGPSEC_Path attribute when it propagates the update message. (Note 596 that a BGPSEC router may also receive a non-BGPSEC update message 597 from an internal peer without the AS_Path attribute, i.e., with just 598 the NLRI in it. In that case, the prefix is originating from that AS 599 and hence the BGPSEC speaker SHOULD sign and forward the update to 600 its external peers, as specified in Section 4.1.) 602 Conversely, if a BGPSEC router has received a BGPSEC update message 603 (with the BGPSEC_Path attribute) from a peer for a given prefix and 604 it chooses to propagate that peer's route for the prefix, then it 605 SHOULD propagate the route as a BGPSEC update message containing the 606 BGPSEC_Path attribute. 608 Note that removing BGPSEC signatures (i.e., propagating a route 609 advertisement without the BGPSEC_Path attribute) has significant 610 security ramifications. (See Section 7 for discussion of the 611 security ramifications of removing BGPSEC signatures.) Therefore, 612 when a route advertisement is received via a BGPSEC update message, 613 propagating the route advertisement without the BGPSEC_Path attribute 614 is NOT RECOMMENDED, unless the message is sent to a peer that did not 615 advertise the capability to receive BGPSEC update messages (see 616 Section 4.4). 618 Furthermore, note that when a BGPSEC speaker propagates a route 619 advertisement with the BGPSEC_Path attribute it is not attesting to 620 the validation state of the update message it received. (See Section 621 7 for more discussion of the security semantics of BGPSEC 622 signatures.) 624 If the BGPSEC speaker is producing an update message which would, in 625 the absence of BGPSEC, contain an AS_SET (e.g., the BGPSEC speaker is 626 performing proxy aggregation), then the BGPSEC speaker MUST NOT 627 include the BGPSEC_Path attribute. In such a case, the BGPSEC 628 speaker must remove any existing BGPSEC_Path in the received 629 advertisement(s) for this prefix and produce a traditional (non- 630 BGPSEC) update message. It should be noted that BCP 172 [13] 631 recommends against the use of AS_SET and AS_CONFED_SET in the AS_PATH 632 of BGP updates. 634 To generate the BGPSEC_Path attribute on the outgoing update message, 635 the BGPSEC speaker first prepends a new Secure_Path Segment (places 636 in first position) to the Secure_Path. The AS number in this 637 Secure_Path segment MUST match the AS number in the AS number 638 resource extension field of the Resource PKI router certificate(s) 639 that will be used to verify the digital signature(s) constructed by 640 this BGPSEC speaker[10]. 642 The pCount is typically set to the value 1. A BGPSEC speaker may set 643 the pCount field to a value greater than 1. (See Section 4.1 for a 644 discussion of setting pCount to a value greater than 1.) 646 A route server that participates in the BGP control path, but does 647 not act as a transit AS in the data plane, may choose to set pCount 648 to 0. This option enables the route server to participate in BGPSEC 649 and obtain the associated security guarantees without increasing the 650 effective length of the AS path. (Note that BGPSEC speakers compute 651 the effective length of the AS path by summing the pCount values in 652 the BGPSEC_Path attribute, see Section 5.) However, when a route 653 server sets the pCount value to 0, it still inserts its AS number 654 into the Secure_Path segment, as this information is needed to 655 validate the signature added by the route server. (See [18] for a 656 discussion of setting pCount to 0 to facilitate AS Number Migration.) 657 BGPSEC speakers SHOULD drop incoming update messages with pCount set 658 to zero in cases where the BGPSEC speaker does not expect its peer to 659 set pCount to zero. (That is, pCount is only to be set to zero in 660 cases such as route servers or AS Number Migration where the BGPSEC 661 speaker's peer expects pCount to be set to zero.) 663 If the BGPSEC speaker is not a member of an autonomous system 664 confederation [5], then the Confed_Segment bit of the Flags field of 665 the Secure_Path Segment MUST be set to zero. (Members of a 666 confederation should follow the special processing instructions for 667 confederation members in Section 4.3.) 669 If the received BGPSEC update message contains two Signature_ Blocks 670 and the BGPSEC speaker supports both of the corresponding algorithms 671 suites, then the new update message generated by the BGPSEC speaker 672 SHOULD include both of the Signature_Blocks. If the received BGPSEC 673 update message contains two Signature_Blocks and the BGPSEC speaker 674 only supports one of the two corresponding algorithm suites, then the 675 BGPSEC speaker MUST remove the Signature_Block corresponding to the 676 algorithm suite that it does not understand. If the BGPSEC speaker 677 does not support the algorithm suites in any of the Signature_Blocks 678 contained in the received update message, then the BGPSEC speaker 679 MUST NOT propagate the route advertisement with the BGPSEC_Path 680 attribute. (That is, if it chooses to propagate this route 681 advertisement at all, it must do so as an unsigned BGP update 682 message). 684 Note that in the case where the BGPSEC_Path has two Signature_Blocks 685 (corresponding to different algorithm suites), the validation 686 algorithm (see Section 5.2) deems a BGPSEC update message to be 687 'Valid' if there is at least one supported algorithm suite (and 688 corresponding Signature_Block) that is deemed 'Valid'. This means 689 that a 'Valid' BGPSEC update message may contain a Signature_Block 690 which is not deemed 'Valid' (e.g., contains signatures that the 691 BGPSEC does not successfully verify). Nonetheless, such 692 Signature_Blocks MUST NOT be removed. (See Section 7 for a 693 discussion of the security ramifications of this design choice.) 695 For each Signature_Block corresponding to an algorithm suite that the 696 BGPSEC speaker does support, the BGPSEC speaker adds a new Signature 697 Segment to the Signature_Block. This Signature Segment is prepended 698 to the list of Signature Segments (placed in the first position) so 699 that the list of Signature Segments appear in the same order as the 700 corresponding Secure_Path segments. The BGPSEC speaker populates the 701 fields of this new signature segment as follows. 703 The Subject Key Identifier field in the new segment is populated with 704 the identifier contained in the Subject Key Identifier extension of 705 the RPKI router corresponding to the BGPSEC speaker [10]. This 706 Subject Key Identifier will be used by recipients of the route 707 advertisement to identify the proper certificate to use in verifying 708 the signature. 710 The Signature field in the new segment contains a digital signature 711 that binds the NLRI and BGPSEC_Path attribute to the RPKI router 712 certificate corresponding to the BGPSEC speaker. The digital 713 signature is computed as follows: 715 o Construct a sequence of octets by concatenating the Target AS 716 number, the Secure_Path segment that is being added by the BGPSEC 717 speaker constructing the signature, and the signature field of the 718 most recent Signature Segment (the one corresponding to AS from 719 whom the BGPSEC speaker's AS received the announcement). Note 720 that the Target AS number is the AS number announced by the peer 721 in the OPEN message of the BGP session within which the BGPSEC 722 update message is sent. 724 Sequence of Octets to be Signed 725 +--------------------------------------+ 726 | Target AS Number (4 octets) | 727 +--------------------------------------+ 728 | Signer's AS Number (4 octets) | ---\ 729 +--------------------------------------+ \ 730 | pCount (1 octet) | > Secure_Path 731 +--------- ----------------------------+ / 732 | Flags (1 octet) | ---/ 733 +--------------------------------------+ 734 | Most Recent Sig Field (variable) | 735 +--------------------------------------+ 737 o Apply to this octet sequence the digest algorithm (for the 738 algorithm suite of this Signature_Block) to obtain a digest value. 740 o Apply to this digest value the signature algorithm, (for the 741 algorithm suite of this Signature_Block) to obtain the digital 742 signature. Then populate the Signature Field with this digital 743 signature. 745 The Signature Length field is populated with the length (in octets) 746 of the Signature field. 748 4.3. Processing Instructions for Confederation Members 750 Members of autonomous system confederations [5] MUST additionally 751 follow the instructions in this section for processing BGPSEC update 752 messages. 754 When a confederation member sends a BGPSEC update message to a peer 755 that is a member of the same confederation, the confederation member 756 puts its (private) Member-AS Number (as opposed to the public AS 757 Confederation Identifier) in the AS Number field of the Secure_Path 758 Segment that it adds to the BGPSEC update message. Furthermore, when 759 a confederation member sends a BGPSEC update message to a peer that 760 is a member of the same confederation, the BGPSEC speaker that 761 generates the Secure_Path Segment sets the Confed_Segment flag to 762 one. This means that in a BGPSEC update message, an AS number 763 appears in a Secure_Path Segment with the Confed_Segment flag set 764 whenever, in a non-BGPSEC update message, the AS number would appear 765 in a segment of type AS_CONFED_SEQUENCE in a non-BGPSEC update 766 message. 768 Within a confederation, the verification of BGPSEC signatures added 769 by other members of the confederation is optional. If a 770 confederation chooses not to have its members verify signatures added 771 by other confederation members, then when sending a BGPSEC update 772 message to a peer that is a member of the same confederation, the 773 confederation members MAY set the Signature field within the 774 Signature_Segment that it generates to be zero (in lieu of 775 calculating the correct digital signature as described in Sections 776 4.1 and 4.2). Note that if a confederation chooses not to verify 777 digital signatures within the confederation, then BGPSEC is able to 778 provide no assurances about the integrity of the (private) Member-AS 779 Numbers placed in Secure_Path segments where the Confed_Segment flag 780 is set to one. 782 When a confederation member receives a BGPSEC update message from a 783 peer within the confederation and propagates it to a peer outside the 784 confederation, it needs to remove all of the Secure_Path Segments 785 added by confederation members as well as the corresponding Signature 786 Segments. To do this, the confederation member propagating the route 787 outside the confederation does the following: 789 o First, starting with the most recently added Secure_Path segments, 790 remove all of the consecutive Secure_Path segments that have the 791 Confed_Segment flag set to one. Stop this process once a 792 Scure_Path segment is reached which has its Confed_Segment flag 793 set to zero. Keep a count of the number of segments removed in 794 this fashion. 796 o Second, starting with the most recently added Signature Segment, 797 remove a number of Signature Segments equal to the number of 798 Secure_Path Segments removed in the previous step. (That is, 799 remove the K most recently added signature segments, where K is 800 the number of Secure_Path Segments removed in the previous step.) 802 o Finally, add a Secure_Path Segment containing, in the AS field, 803 the AS Confederation Identifier (the public AS number of the 804 confederation) as well as a corresponding Signature Segment. Note 805 that all fields other that the AS field are populated as per 806 Sections 4.1 and 4.2. 808 When validating a received BGPSEC update message, confederation 809 members need to make the following adjustment to the algorithm 810 presented in Section 5.2. When a confederation member processes 811 (validates) a Signature Segment and its corresponding Secure_Path 812 Segment, the confederation member must note that for a signature 813 produced by a BGPSEC speaker outside of a confederation, the Target 814 AS will always be the AS Confederation Identifier (the public AS 815 number of the confederation) as opposed to the Member-AS Number. 817 To handle this case, when a BGPSEC speaker (that is a confederation 818 member) processes a current Secure_Path Segment that has the 819 Confed_Segment flag set to zero, if the next most recently added 820 Secure_Path segment has the Confed_Segment flag set to one then, when 821 computing the digest for the current Secure_Path segment, the BGPSEC 822 speaker takes the Target AS Number to be the AS Confederation 823 Identifier of the validating BGPSEC speaker's own confederation. 824 (Note that the algorithm in Section 5.2 processes Secure_Path 825 Segments in order from most recently added to least recently added, 826 therefore this special case will apply to the first Secure_Path 827 segment that the algorithm encounters that has the Confed_Segment 828 flag set to zero.) 830 Finally, as discussed above, an AS confederation may optionally 831 decide that its members will not verify digital signatures added by 832 members. In such a federation, when a confederation member runs the 833 algorithm in Section 5.2, the confederation member, during processing 834 of a Signature_Segment, first checks whether the Confed_Sequence flag 835 in the corresponding Secure_Path segment is set to one. If the 836 Confed_Sequence flag is set to one in the corresponding Secure_Path 837 segment, the confederation member does not perform any further checks 838 on the Signature_Segment and immediately moves on to the next 839 Signature_Segment (and checks its corresponding Secure_Path segment). 840 Note that as specified in Section 5.2, it is an error when a BGPSEC 841 speaker receives from a peer, who is not in the same AS 842 confederation, a BGPSEC update containing a Confed_Sequence flag set 843 to one. (As discussed in Section 5.2, any error in the BGPSEC_Path 844 attribute MUST be handled using the "treat-as-withdraw", approach as 845 defined in RFC WXYZ [12].) 847 4.4. Reconstructing the AS_PATH Attribute 849 BGPSEC update messages do not contain the AS_PATH attribute. However, 850 the AS_PATH attribute can be reconstructed from the BGPSEC_Path 851 attribute. This is necessary in the case where a route advertisement 852 is received via a BGPSEC update message and then propagated to a peer 853 via a non-BGPSEC update message (e.g., because the latter peer does 854 not support BGPSEC). Note that there may be additional cases where an 855 implementation finds it useful to perform this reconstruction. 857 The AS_PATH attribute can be constructed from the BGPSEC_Path 858 attribute as follows. Starting with an empty AS_PATH attribute, 859 process the Secure_Path segments in order from least-recently added 860 (corresponding to the origin) to most-recently added. For each 861 Secure_Path segment perform the following steps: 863 1. If the Confed_Segment flag in the Secure_Path segment is set to 864 one, then look at the most-recently added segment in the AS_PATH. 866 * In the case where the AS_PATH is empty or in the case where 867 the most-recently added segment is of type AS_SEQUENCE then 868 add (prepend to the AS_PATH) a new AS_PATH segment of type 869 AS_CONFED_SEQUENCE. This segment of type AS_CONFED_SEQUENCE 870 shall contain a number of elements equal to the pCount field 871 in the current Secure_Path segment. Each of these elements 872 shall be the AS number contained in the current Secure_Path 873 segment. (That is, if the pCount field is X, then the segment 874 of type AS_CONFED_SEQUENCE contains X copies of the 875 Secure_Path segment's AS Number field.) 877 * In the case where the most-recently added segment in the 878 AS_PATH is of type AS_CONFED_SEQUENCE then add (prepend to the 879 segment) a number of elements equal to the pCount field in the 880 current Secure_Path segment. The value of each of these 881 elements shall be the AS number contained in the current 882 Secure_Path segment. (That is, if the pCount field is X, then 883 add X copies of the Secure_Path segment's AS Number field to 884 the existing AS_CONFED_SEQUENCE.) 886 2. If the Confed_Segment flag in the Secure_Path segment is set to 887 zero, then look at the most-recently added segment in the 888 AS_PATH. 890 * In the case where the AS_PATH is empty, and the pCount field 891 in the Secure_Path segment is greater than zero, add (prepend 892 to the AS_PATH) a new AS_PATH segment of type AS_SEQUENCE. 893 This segment of type AS_SEQUENCE shall contain a number of 894 elements equal to the pCount field in the current Secure_Path 895 segment. Each of these elements shall be the AS number 896 contained in the current Secure_Path segment. (That is, if 897 the pCount field is X, then the segment of type AS_SEQUENCE 898 contains X copies of the Secure_Path segment's AS Number 899 field.) 901 * In the case where the most recently added segment in the 902 AS_PATH is of type AS_SEQUENCE then add (prepend to the 903 segment) a number of elements equal to the pCount field in the 904 current Secure_Path segment. The value of each of these 905 elements shall be the AS number contained in the current 906 Secure_Path segment. (That is, if the pCount field is X, then 907 add X copies of the Secure_Path segment's AS Number field to 908 the existing AS_SEQUENCE.) 910 5. Processing a Received BGPSEC Update 912 Upon receiving a BGPSEC update message from an external (eBGP) peer, 913 a BGPSEC speaker SHOULD validate the message to determine the 914 authenticity of the path information contained in the BGPSEC_Path 915 attribute. Section 5.1 provides an overview of BGPSEC validation and 916 Section 5.2 provides a specific algorithm for performing such 917 validation. (Note that an implementation need not follow the 918 specific algorithm in Section 5.2 as long as the input/output 919 behavior of the validation is identical to that of the algorithm in 920 Section 5.2.) During exceptional conditions (e.g., the BGPSEC 921 speaker receives an incredibly large number of update messages at 922 once) a BGPSEC speaker MAY temporarily defer validation of incoming 923 BGPSEC update messages. The treatment of such BGPSEC update 924 messages, whose validation has been deferred, is a matter of local 925 policy. 927 The validity of BGPSEC update messages is a function of the current 928 RPKI state. When a BGPSEC speaker learns that RPKI state has changed 929 (e.g., from an RPKI validating cache via the RTR protocol), the 930 BGPSEC speaker MUST re-run validation on all affected update messages 931 stored in its ADJ-RIB-IN. That is, when a given RPKI certificate 932 ceases to be valid (e.g., it expires or is revoked), all update 933 messages containing a signature whose SKI matches the SKI in the 934 given certificate must be re-assessed to determine if they are still 935 valid. If this reassessment determines that the validity state of an 936 update has changed then, depending on local policy, it may be 937 necessary to re-run best path selection. 939 BGPSEC update messages do not contain an AS_PATH attribute. 940 Therefore, a BGPSEC speaker MUST utilize the AS path information in 941 the BGPSEC_Path attribute in all cases where it would otherwise use 942 the AS path information in the AS_PATH attribute. The only exception 943 to this rule is when AS path information must be updated in order to 944 propagate a route to a peer (in which case the BGPSEC speaker follows 945 the instructions in Section 4). Section 4.4 provides an algorithm 946 for constructing an AS_PATH attribute from a BGPSEC_Path attribute. 947 Whenever the use of AS path information is called for (e.g., loop 948 detection, or use of AS path length in best path selection) the 949 externally visible behavior of the implementation shall be the same 950 as if the implementation had run the algorithm in Section 4.4 and 951 used the resulting AS_PATH attribute as it would for a non-BGPSEC 952 update message. 954 Many signature algorithms are non-deterministic. That is, many 955 signature algorithms will produce different signatures each time they 956 are run (even when they are signing the same data with the same key). 957 Therefore, if an implementation receives a BGPSEC update from a peer 958 and later receives a second BGPSEC update message from the same peer, 959 the implementation SHOULD treat the second message as a duplicate 960 update message if it differs from the first update message only in 961 the Signature fields (within the BGPSEC_Path attribute). That is, if 962 all the fields in the second update are identical to the fields in 963 the first update message, except for the Signature fields, then the 964 second update message should be treated as a duplicate of the first 965 update message. Note that if other fields (e.g., the Subject Key 966 Identifier field) within a Signature segment differ between two 967 update messages then the two updates are not duplicates. 969 With regards to the processing of duplicate update messages, if the 970 first update message is valid, then an implementation SHOULD NOT run 971 the validation procedure on the second, duplicate update message 972 (even if the bits of the signature field are different). If the 973 first update message is not valid, then an implementation SHOULD run 974 the validation procedure on the second duplicate update message (as 975 the signatures in the second update may be valid even though the 976 first contained a signature that was invalid). 978 5.1. Overview of BGPSEC Validation 980 Validation of a BGPSEC update messages makes use of data from RPKI 981 certificates and signed Route Origination Authorizations (ROA). In 982 particular, to validate update messages containing the BGPSEC_Path 983 attribute, it is necessary that the recipient have access to the 984 following data obtained from valid RPKI certificates and ROAs: 986 o For each valid RPKI router certificate, the AS Number, Public Key 987 and Subject Key Identifier are required, 989 o For each valid ROA, the AS Number and the list of IP address 990 prefixes. 992 Note that the BGPSEC speaker could perform the validation of RPKI 993 certificates and ROAs on its own and extract the required data, or it 994 could receive the same data from a trusted cache that performs RPKI 995 validation on behalf of (some set of) BGPSEC speakers. (For example, 996 the trusted cache could deliver the necessary validity information to 997 the BGPSEC speaker using the router key PDU [16] for the RTR protocol 998 [15].) 1000 To validate a BGPSEC update message containing the BGPSEC_Path 1001 attribute, the recipient performs the validation steps specified in 1002 Section 5.2. The validation procedure results in one of two states: 1003 'Valid' and 'Not Valid'. 1005 It is expected that the output of the validation procedure will be 1006 used as an input to BGP route selection. However, BGP route 1007 selection, and thus the handling of the two validation states is a 1008 matter of local policy, and is handled using local policy mechanisms. 1010 It is expected that BGP peers will generally prefer routes received 1011 via 'Valid' BGPSEC update messages over both routes received via 'Not 1012 Valid' BGPSEC update messages and routes received via update messages 1013 that do not contain the BGPSEC_Path attribute. However, BGPSEC 1014 specifies no changes to the BGP decision process. (See [17] for 1015 related operational considerations.) 1017 BGPSEC validation needs only be performed at the eBGP edge. The 1018 validation status of a BGP signed/unsigned update MAY be conveyed via 1019 iBGP from an ingress edge router to an egress edge router via some 1020 mechanism, according to local policy within an AS. As discussed in 1021 Section 4, when a BGPSEC speaker chooses to forward a (syntactically 1022 correct) BGPSEC update message, it SHOULD be forwarded with its 1023 BGPSEC_Path attribute intact (regardless of the validation state of 1024 the update message). Based entirely on local policy, an egress 1025 router receiving a BGPSEC update message from within its own AS MAY 1026 choose to perform its own validation. 1028 5.2. Validation Algorithm 1030 This section specifies an algorithm for validation of BGPSEC update 1031 messages. A conformant implementation MUST include a BGPSEC update 1032 validation algorithm that is functionally equivalent to the 1033 externally visible behavior of this algorithm. 1035 First, the recipient of a BGPSEC update message performs a check to 1036 ensure that the message is properly formed. Specifically, the 1037 recipient performs the following checks: 1039 1. Check to ensure that the entire BGPSEC_Path attribute is 1040 syntactically correct (conforms to the specification in this 1041 document). 1043 2. Check that each Signature_Block contains one Signature segment 1044 for each Secure_Path segment in the Secure_Path portion of the 1045 BGPSEC_Path attribute. (Note that the entirety of each 1046 Signature_Block must be checked to ensure that it is well formed, 1047 even though the validation process may terminate before all 1048 signatures are cryptographically verified.) 1050 3. Check that the update message does not contain an AS_PATH 1051 attribute. 1053 4. If the update message was received from a peer that is not a 1054 member of the BGPSEC speaker's AS confederation, check to ensure 1055 that none of the Secure_Path segments contain a Flags field with 1056 the Confed_Sequence flag set to one. 1058 5. If the update message was received from a peer that is not 1059 expected to set pCount equal to zero (see Section 4.2) then check 1060 to ensure that the pCount field in the most-recently added 1061 Secure_Path segment is not equal to zero. 1063 If any of these checks fail, it is an error in the BGPSEC_Path 1064 attribute. Any of these errors in the BGPSEC_Path attribute are 1065 handled as per RFC WXYZ [12]. BGPSEC speakers MUST handle these 1066 errors using the "treat-as-withdraw" approach as defined in RFC WXYZ 1067 [12]. 1069 Next, the BGPSEC speaker examines the Signature_Blocks in the 1070 BGPSEC_Path attribute. A Signature_Block corresponding to an 1071 algorithm suite that the BGPSEC speaker does not support is not 1072 considered in validation. If there is no Signature_Block 1073 corresponding to an algorithm suite that the BGPSEC speaker supports, 1074 then the BGPSEC speaker MUST treat the update message in the same 1075 manner that the BGPSEC speaker would treat an (unsigned) update 1076 message that arrived without a BGPSEC_Path attribute. 1078 For each remaining Signature_Block (corresponding to an algorithm 1079 suite supported by the BGPSEC speaker), the BGPSEC speaker iterates 1080 through the Signature segments in the Signature_Block, starting with 1081 the most recently added segment (and concluding with the least 1082 recently added segment). Note that there is a one-to-one 1083 correspondence between Signature segments and Secure_Path segments 1084 within the BGPSEC_Path attribute. The following steps make use of 1085 this correspondence. 1087 o (Step I): Locate the public key needed to verify the signature (in 1088 the current Signature segment). To do this, consult the valid 1089 RPKI router certificate data and look up all valid (AS, SKI, 1090 Public Key) triples in which the AS matches the AS number in the 1091 corresponding Secure_Path segment. Of these triples that match 1092 the AS number, check whether there is an SKI that matches the 1093 value in the Subject Key Identifier field of the Signature 1094 segment. If this check finds no such matching SKI value, then 1095 mark the entire Signature_Block as 'Not Valid' and proceed to the 1096 next Signature_Block. 1098 o (Step II): Compute the digest function (for the given algorithm 1099 suite) on the appropriate data. If the segment is not the (least 1100 recently added) segment corresponding to the origin AS, then the 1101 digest function should be computed on the following sequence of 1102 octets: 1104 Sequence of Octets to be Hashed 1106 +-------------------------------------------+ 1107 | AS Number of Target AS (4 octets) | 1108 +-------------------------------------------+ 1109 | AS Number (4 octets) | ---\ 1110 +-------------------------------------------+ \ 1111 | pCount (1 octet) | > Secure_Path 1112 +-------------------------------------------+ / 1113 | Flags (1 octet) | ---/ 1114 +-------------------------------------------+ 1115 | Sig Field in the Next Segment (variable) | 1116 +-------------- ----------------------------+ 1118 For the first segment to be processed (the most recently added 1119 segment), the 'AS Number of Target AS' is the AS number of the BGPSEC 1120 speaker validating the update message. Note that if a BGPSEC speaker 1121 uses multiple AS Numbers (e.g., the BGPSEC speaker is a member of a 1122 confederation), the AS number used here MUST be the AS number 1123 announced in the OPEN message for the BGP session over which the 1124 BGPSEC update was received. 1126 For each other Signature Segment, the 'AS Number of Target AS' is the 1127 AS number in the Secure_Path segment that corresponds to the 1128 Signature Segment added immediately after the one being processed. 1129 (That is, in the Secure_Path segment that corresponds to the 1130 Signature segment that the validator just finished processing.) 1132 The AS Number, pCount and Flags fields are taken from the Secure_Path 1133 segment that corresponds to the Signature segment currently being 1134 processed. The 'Signature Field in the Next Segment' is the 1135 Signature field found in the Signature segment that is next to be 1136 processed (that is, the next most recently added Signature Segment). 1138 Alternatively, if the segment being processed corresponds to the 1139 origin AS (i.e., if it is the least recently added segment), then the 1140 digest function should be computed on the following sequence of 1141 octets: 1143 Sequence of Octets to be Hashed 1144 +------------------------------------+ 1145 | AS Number of Target AS (4 octets) | 1146 +------------------------------------+ 1147 | Origin AS Number (4 octets) | ---\ 1148 +------------------------------------+ \ 1149 | pCount (1 octet) | > Secure_Path 1150 +------------------------------------+ / 1151 | Flags (1 octet) | ---/ 1152 +------------------------------------+ 1153 | Algorithm Suite Id. (1 octet) | 1154 +------------------------------------+ 1155 | NLRI Length (1 octet) | 1156 +------------------------------------+ 1157 | NLRI Prefix (variable) | 1158 +------------------------------------+ 1160 The NLRI Length, NLRI Prefix, and Algorithm Suite Identifier are all 1161 obtained in a straight forward manner from the NLRI of the update 1162 message or the BGPSEC_Path attribute being validated. The Origin AS 1163 Number, pCount, and Flags fields are taken from the Secure_Path 1164 segment corresponding to the Signature Segment currently being 1165 processed. 1167 The 'AS Number of Target AS' is the AS Number from the Secure_Path 1168 segment that was added immediately after the Secure_Path segment 1169 containing the Origin AS Number. (That is, the Secure_Path segment 1170 corresponding to the Signature segment that the receiver just 1171 finished processing prior to the current Signature segment.) 1173 o (Step III): Use the signature validation algorithm (for the given 1174 algorithm suite) to verify the signature in the current segment. 1175 That is, invoke the signature validation algorithm on the 1176 following three inputs: the value of the Signature field in the 1177 current segment; the digest value computed in Step II above; and 1178 the public key obtained from the valid RPKI data in Step I above. 1179 If the signature validation algorithm determines that the 1180 signature is invalid, then mark the entire Signature_Block as 'Not 1181 Valid' and proceed to the next Signature_Block. If the signature 1182 validation algorithm determines that the signature is valid, then 1183 continue processing Signature Segments (within the current 1184 Signature_Block). 1186 If all Signature Segments within a Signature_Block pass validation 1187 (i.e., all segments are processed and the Signature_Block has not yet 1188 been marked 'Not Valid'), then the Signature_Block is marked as 1189 'Valid'. 1191 If at least one Signature_Block is marked as 'Valid', then the 1192 validation algorithm terminates and the BGPSEC update message is 1193 deemed to be 'Valid'. (That is, if a BGPSEC update message contains 1194 two Signature_Blocks then the update message is deemed 'Valid' if the 1195 first Signature_Block is marked 'Valid' OR the second Signature_Block 1196 is marked 'Valid'.) 1198 6. Algorithms and Extensibility 1200 6.1. Algorithm Suite Considerations 1202 Note that there is currently no support for bilateral negotiation 1203 (using BGP capabilities) between BGPSEC peers to use of a particular 1204 (digest and signature) algorithm suite. This is because the algorithm 1205 suite used by the sender of a BGPSEC update message must be 1206 understood not only by the peer to whom he is directly sending the 1207 message, but also by all BGPSEC speakers to whom the route 1208 advertisement is eventually propagated. Therefore, selection of an 1209 algorithm suite cannot be a local matter negotiated by BGP peers, but 1210 instead must be coordinated throughout the Internet. 1212 To this end, a mandatory algorithm suites document will be created 1213 which specifies a mandatory-to-use 'current' algorithm suite for use 1214 by all BGPSEC speakers [11]. 1216 It is anticipated that, in the future mandatory, the algorithm suites 1217 document will be updated to specify a transition from the 'current' 1218 algorithm suite to a 'new' algorithm suite. During the period of 1219 transition (likely a small number of years), all BGPSEC update 1220 messages SHOULD simultaneously use both the 'current' algorithm suite 1221 and the 'new' algorithm suite. (Note that Sections 3 and 4 specify 1222 how the BGPSEC_Path attribute can contain signatures, in parallel, 1223 for two algorithm suites.) Once the transition is complete, use of 1224 the old 'current' algorithm will be deprecated, use of the 'new' 1225 algorithm will be mandatory, and a subsequent 'even newer' algorithm 1226 suite may be specified as recommend to implement. Once the 1227 transition has successfully been completed in this manner, BGPSEC 1228 speakers SHOULD include only a single Signature_Block (corresponding 1229 to the 'new' algorithm). 1231 6.2. Extensibility Considerations 1233 This section discusses potential changes to BGPSEC that would require 1234 substantial changes to the processing of the BGPSEC_Path and thus 1235 necessitate a new version of BGPSEC. Examples of such changes 1236 include: 1238 o A new type of signature algorithm that produces signatures of 1239 variable length 1241 o A new type of signature algorithm for which the number of 1242 signatures in the Signature_Block is not equal to the number of 1243 ASes in the Secure_Path (e.g., aggregate signatures) 1245 o Changes to the data that is protected by the BGPSEC signatures 1246 (e.g., attributes other than the AS path) 1248 In the case that such a change to BGPSEC were deemed desirable, it is 1249 expected that a subsequent version of BGPSEC would be created and 1250 that this version of BGPSEC would specify a new BGP path attribute, 1251 let's call it BGPSEC_PATH_TWO, which is designed to accommodate the 1252 desired changes to BGPSEC. In such a case, the mandatory algorithm 1253 suites document would be updated to specify algorithm suites 1254 appropriate for the new version of BGPSEC. 1256 At this point a transition would begin which is analogous to the 1257 algorithm transition discussed in Section 6.1. During the transition 1258 period all BGPSEC speakers SHOULD simultaneously include both the 1259 BGPSEC_Path attribute and the new BGPSEC_PATH_TWO attribute. Once 1260 the transition is complete, the use of BGPSEC_Path could then be 1261 deprecated, at which point BGPSEC speakers SHOULD include only the 1262 new BGPSEC_PATH_TWO attribute. Such a process could facilitate a 1263 transition to a new BGPSEC semantics in a backwards compatible 1264 fashion. 1266 7. Security Considerations 1268 For discussion of the BGPSEC threat model and related security 1269 considerations, please see [14]. 1271 7.1 Security Guarantees 1273 When used in conjunction with Origin Validation (see [19] and [20]), 1274 A BGPSEC speaker who receives a valid BGPSEC update message, 1275 containing a route advertisement for a given prefix, is provided with 1276 the following security guarantees: 1278 o The origin AS number corresponds to an autonomous system that has 1279 been authorized, in the RPKI, by the IP address space holder to 1280 originate route advertisements for the given prefix. 1282 o For each AS in the path, a BGPSEC speaker authorized by the holder 1283 of the AS number intentionally chose (in accordance with local 1284 policy) to propagate the route advertisement to the subsequent AS 1285 in the path. 1287 That is, the recipient of a valid BGPSEC Update message is assured 1288 that the Secure_Path portion of the BGPSEC_Path attribute corresponds 1289 to a sequence of autonomous systems who have all agreed in principle 1290 to forward packets to the given prefix along the indicated path. (It 1291 should be noted that BGPSEC does not offer any guarantee that the 1292 data packets would flow along the indicated path; it only guarantees 1293 that the BGP update conveying the path indeed propagated along the 1294 indicated path.) Furthermore, the recipient is assured that this 1295 path terminates in an autonomous system that has been authorized by 1296 the IP address space holder as a legitimate destination for traffic 1297 to the given prefix. 1299 Note that although BGPSEC provides a mechanism for an AS to validate 1300 that a received update message has certain security properties, the 1301 use of such a mechanism to influence route selection is completely a 1302 matter of local policy. Therefore, a BGPSEC speaker can make no 1303 assumptions about the validity of a route received from an external 1304 BGPSEC peer. That is, a compliant BGPSEC peer may (depending on the 1305 local policy of the peer) send update messages that fail the validity 1306 test in Section 5. Thus, a BGPSEC speaker MUST completely validate 1307 all BGPSEC update messages received from external peers. (Validation 1308 of update messages received from internal peers is a matter of local 1309 policy, see Section 5). 1311 7.2 On the Removal of BGPSEC Signatures 1313 There may be cases where a BGPSEC speaker deems 'Valid' (as per the 1314 validation algorithm in Section 5.2) a BGPSEC update message that 1315 contains both a 'Valid' and a 'Not Valid' Signature_Block. That is, 1316 the update message contains two sets of signatures corresponding to 1317 two algorithm suites, and one set of signatures verifies correctly 1318 and the other set of signatures fails to verify. In this case, the 1319 protocol specifies that a BGPSEC speaker choosing to propagate the 1320 route advertisement in such an update message SHOULD add its 1321 signature to each of the Signature_Blocks. Thus the BGPSEC speaker 1322 creates a signature using both algorithm suites and creates a new 1323 update message that contains both the 'Valid' and the 'Not Valid' set 1324 of signatures (from its own vantage point). 1326 To understand the reason for such a design decision consider the case 1327 where the BGPSEC speaker receives an update message with both a set 1328 of algorithm A signatures which are 'Valid' and a set of algorithm B 1329 signatures which are 'Not Valid'. In such a case it is possible 1330 (perhaps even likely, depending on the state of the algorithm 1331 transition) that some of the BGPSEC speaker's peers (or other 1332 entities further 'downstream' in the BGP topology) do not support 1333 algorithm A. Therefore, if the BGPSEC speaker were to remove the 'Not 1334 Valid' set of signatures corresponding to algorithm B, such entities 1335 would treat the message as though it were unsigned. By including the 1336 'Not Valid' set of signatures when propagating a route advertisement, 1337 the BGPSEC speaker ensures that 'downstream' entities have as much 1338 information as possible to make an informed opinion about the 1339 validation status of a BGPSEC update. 1341 Note also that during a period of partial BGPSEC deployment, a 1342 'downstream' entity might reasonably treat unsigned messages 1343 differently from BGPSEC updates that contain a single set of 'Not 1344 Valid' signatures. That is, by removing the set of 'Not Valid' 1345 signatures the BGPSEC speaker might actually cause a downstream 1346 entity to 'upgrade' the status of a route advertisement from 'Not 1347 Valid' to unsigned. Finally, note that in the above scenario, the 1348 BGPSEC speaker might have deemed algorithm A signatures 'Valid' only 1349 because of some issue with RPKI state local to his AS (for example, 1350 his AS might not yet have obtained a CRL indicating that a key used 1351 to verify an algorithm A signature belongs to a newly revoked 1352 certificate). In such a case, it is highly desirable for a 1353 downstream entity to treat the update as 'Not Valid' (due to the 1354 revocation) and not as 'unsigned' (which would happen if the 'Not 1355 Valid' Signature_Blocks were removed). 1357 A similar argument applies to the case where a BGPSEC speaker (for 1358 some reason such as lack of viable alternatives) selects as his best 1359 path (to a given prefix) a route obtained via a 'Not Valid' BGPSEC 1360 update message. In such a case, the BGPSEC speaker should propagate a 1361 signed BGPSEC update message, adding his signature to the 'Not Valid' 1362 signatures that already exist. Again, this is to ensure that 1363 'downstream' entities are able to make an informed decision and not 1364 erroneously treat the route as unsigned. It should also be noted 1365 that due to possible differences in RPKI data observed at different 1366 vantage points in the network, a BGPSEC update deemed 'Not Valid' at 1367 an upstream BGPSEC speaker may be deemed 'Valid' by another BGP 1368 speaker downstream. 1370 Indeed, when a BGPSEC speaker signs an outgoing update message, it is 1371 not attesting to a belief that all signatures prior to its are valid. 1372 Instead it is merely asserting that: 1374 o The BGPSEC speaker received the given route advertisement with the 1375 indicated NLRI and Secure_Path; and 1377 o The BGPSEC speaker chose to propagate an advertisement for this 1378 route to the peer (implicitly) indicated by the 'Target AS' 1380 7.3 Mitigation of Denial of Service Attacks 1382 The BGPSEC update validation procedure is a potential target for 1383 denial of service attacks against a BGPSEC speaker. To mitigate the 1384 effectiveness of such denial of service attacks, BGPSEC speakers 1385 should implement an update validation algorithm that performs 1386 expensive checks (e.g., signature verification) after performing less 1387 expensive checks (e.g., syntax checks). The validation algorithm 1388 specified in Section 5.2 was chosen so as to perform checks which are 1389 likely to be expensive after checks that are likely to be 1390 inexpensive. However, the relative cost of performing required 1391 validation steps may vary between implementations, and thus the 1392 algorithm specified in Section 5.2 may not provide the best denial of 1393 service protection for all implementations. 1395 7.4 Additional Security Considerations 1397 The mechanism of setting the pCount field to zero is included in this 1398 specification to enable route servers in the control path to 1399 participate in BGPSEC without increasing the effective length of the 1400 AS-PATH. However, entities other than route servers could 1401 conceivably use this mechanism (set the pCount to zero) to attract 1402 traffic (by reducing the effective length of the AS-PATH) 1403 illegitimately. This risk is largely mitigated if every BGPSEC 1404 speaker drops incoming update messages that set pCount to zero but 1405 come from a peer that is not a route server. However, note that a 1406 recipient of a BGPSEC update message within which an upstream entity 1407 two or more hops away has set pCount to zero is unable to verify for 1408 themselves whether pCount was set to zero legitimately. 1410 BGPSEC does not provide protection against attacks at the transport 1411 layer. An adversary on the path between a BGPSEC speaker and its 1412 peer is able to perform attacks such as modifying valid BGPSEC 1413 updates to cause them to fail validation, injecting (unsigned) BGP 1414 update messages without BGPSEC_Path_Signature attributes, or 1415 injecting BGPSEC update messages with BGPSEC_Path_Signature 1416 attributes that fail validation, or causing the peer to tear-down the 1417 BGP session. Therefore, BGPSEC sessions SHOULD be protected by 1418 appropriate transport security mechanisms. 1420 8. IANA Considerations 1422 TBD: Need IANA to assign numbers for the two capabilities and the 1423 BGPSEC_PATH attribute. 1425 This document does not create any new IANA registries. 1427 9. Contributors 1429 9.1. Authors 1431 Rob Austein 1432 Dragon Research Labs 1433 sra@hactrn.net 1435 Steven Bellovin 1436 Columbia University 1437 smb@cs.columbia.edu 1439 Randy Bush 1440 Internet Initiative Japan 1441 randy@psg.com 1443 Russ Housley 1444 Vigil Security 1445 housley@vigilsec.com 1447 Matt Lepinski 1448 BBN Technologies 1449 mlepinski.ietf@gmail.com 1451 Stephen Kent 1452 BBN Technologies 1453 kent@bbn.com 1455 Warren Kumari 1456 Google 1457 warren@kumari.net 1459 Doug Montgomery 1460 USA National Institute of Standards and Technology 1461 dougm@nist.gov 1463 Kotikalapudi Sriram 1464 USA National Institute of Standards and Technology 1465 kotikalapudi.sriram@nist.gov 1467 Samuel Weiler 1468 Sparta 1469 weiler+ietf@watson.org 1471 9.2. Acknowledgements 1473 The authors would like to thank Michael Baer, Luke Berndt, Sharon 1474 Goldberg, Ed Kern, Chris Morrow, Doug Maughan, Pradosh Mohapatra, 1475 Russ Mundy, Sandy Murphy, Keyur Patel, Mark Reynolds, Heather 1476 Schiller, Jason Schiller, John Scudder, Ruediger Volk and David Ward 1477 for their valuable input and review. 1479 10. Normative References 1481 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1482 Levels", BCP 14, RFC 2119, March 1997. 1484 [2] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border 1485 Gateway Protocol 4", RFC 4271, January 2006. 1487 [3] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 1488 "Multiprotocol Extensions for BGP-4", RFC 4760, January 2007. 1490 [4] Vohra, Q. and E. Chen, "BGP Support for Four-octet AS Number 1491 Space", RFC 4893, May 2007. 1493 [5] Traina, P., McPherson, D., and J. Scudder, "Autonomous System 1494 Confederations for BGP", RFC 5065, August 2007. 1496 [6] Scudder, J. and R. Chandra, "Capabilities Advertisement with 1497 BGP-4", RFC 5492, February 2009. 1499 [7] Lepinski, M. and S. Kent, "An Infrastructure to Support Secure 1500 Internet Routing", RFC 6480, February 2012. 1502 [8] Lepinski, M., Kent, S., and D. Kong, "A Profile for Route 1503 Origin Authorizations (ROAs)", RFC 6482, February 2012. 1505 [9] Patel, K., Ward, D., and R. Bush, "Extended Message support for 1506 BGP", draft-ietf-idr-bgp-extended-messages (work in progress), 1507 January 2014. 1509 [10] Reynolds, M., Turner, S., and S. Kent, "A Profile for BGPSEC 1510 Router Certificates, Certificate Revocation Lists, and 1511 Certification Requests", draft-ietf-sidr-bgpsec-pki-profiles 1512 (work in progress), March 2014. 1514 [11] Turner, S., "BGP Algorithms, Key Formats, & Signature Formats", 1515 draft-ietf-sidr-bgpsec-algs (work in progress), July 2014. 1517 [12] Scudder, J., Chen, E., Mohapatra, P., and K. Patel, "Revised 1518 Error Handling for BGP UPDATE Messages", draft-ietf-idr-error- 1519 handling (work in progress), June 2014. 1521 11. Informative References 1523 [13] Kumari, W. and K. Sriram, "Recommendation for Not Using AS_SET 1524 and AS_CONFED_SET in BGP", RFC 6472, December 2011. 1526 [14] Kent, S., "Threat Model for BGP Path Security", draft-ietf- 1527 sidr-bgpsec-threats (work in progress), December 2013. 1529 [15] Bush, R. and R. Austein, "The Resource Public Key 1530 Infrastructure (RPKI) to Router Protocol", RFC 6810, January 1531 2013. 1533 [16] Bush, R., Patel, K., and S. Turner, "Router Key PDU for RPKI- 1534 Router Protocol", draft-ymbk-rpki-rtr-keys (work in progress), 1535 April 2013. 1537 [17] Bush, R., "BGPsec Operational Considerations", draft-ietf-sidr- 1538 bgpsec-ops (work in progress), May 2012. 1540 [18] George, W. and S. Murphy, "BGPsec Considerations for AS 1541 Migration", draft-ietf-sidr-as-migration (work in progress), 1542 July 2014. 1544 [19] Huston, G. and G. Michaelson, "Validation of Route Origination 1545 Using the Resource Certificate Public Key Infrastructure (PKI) 1546 and Route Origin Authorizations (ROAs)", RFC 6483, February 1547 2013. 1549 [20] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. Austein, 1550 "BGP Prefix Origin Validation", RFC 6811, January 2013. 1552 Author's Address 1554 Matthew Lepinski (editor) 1555 BBN Technologies 1556 10 Moulton St 1557 Cambridge, MA 55409 1558 US 1560 Phone: +1 617 873 5939 1561 Email: mlepinski.ietf@gmail.com