idnits 2.17.1 draft-ietf-sidr-bgpsec-protocol-09.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 (July 4, 2014) is 3577 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 July 4, 2014 5 Expires: January 5, 2015 7 BGPSEC Protocol Specification 8 draft-ietf-sidr-bgpsec-protocol-09 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 two properties: 100 1. The route was originated by an AS explicitly authorized by the 101 holder of the IP address prefix to originate route advertisements 102 for that prefix. 104 2. Every AS on the path of ASes listed in the update message has 105 explicitly authorized the advertisement of the route to the 106 subsequent AS in the path. 108 This document specifies a new optional (non-transitive) BGP path 109 attribute, BGPSEC_Path. It also describes how a BGPSEC-compliant BGP 110 speaker (referred to hereafter as a BGPSEC speaker) can generate, 111 propagate, and validate BGP update messages containing this attribute 112 to obtain the above assurances. 114 BGPSEC relies on the Resource Public Key Infrastructure (RPKI) 115 certificates that attest to the allocation of AS number and IP 116 address resources. (For more information on the RPKI, see [7] and 117 the documents referenced therein.) Any BGPSEC speaker who wishes to 118 send, to external (eBGP) peers, BGP update messages containing the 119 BGPSEC_Path needs to possess a private key associated with an RPKI 120 router certificate [10] that corresponds to the BGPSEC speaker's AS 121 number. Note, however, that a BGPSEC speaker does not need such a 122 certificate in order to validate received update messages containing 123 the BGPSEC_Path attribute. 125 2. BGPSEC Negotiation 127 This document defines a new BGP capability [6] that allows a BGP 128 speaker to advertise to a neighbor the ability to send or to receive 129 BGPSEC update messages (i.e., update messages containing the 130 BGPSEC_Path attribute). 132 2.1. The BGPSEC Capability 134 This capability has capability code : TBD 136 The capability length for this capability MUST be set to 3. 138 The three octets of the capability value are specified as follows. 140 BGPSEC Send Capability Value: 142 0 1 2 3 4 5 6 7 143 +---------------------------------------+ 144 | Version | Dir | Reserved | 145 +---------------------------------------+ 146 | | 147 +------ AFI -----+ 148 | | 149 +---------------------------------------+ 151 The first four bits of the first octet indicate the version of BGPSEC 152 for which the BGP speaker is advertising support. This document 153 defines only BGPSEC version 0 (all four bits set to zero). Other 154 versions of BGPSEC may be defined in future documents. A BGPSEC 155 speaker MAY advertise support for multiple versions of BGPSEC by 156 including multiple versions of the BGPSEC capability in its BGP OPEN 157 message. 159 The fifth bit of the first octet is a direction bit which indicates 160 whether the BGP speaker is advertising the capability to send BGPSEC 161 update messages or receive BGPSEC update messages. The BGP speaker 162 sets this bit to 0 to indicate the capability to receive BGPSEC 163 update messages. The BGP speaker sets this bit to 1 to indicate the 164 capability to send BGPSEC update messages. 166 The remaining three bits of the first octet are reserved for future 167 use. These bits are set to zero by the sender of the capability and 168 ignored by the receiver of the capability. 170 The second and third octets contain the 16-bit Address Family 171 Identifier (AFI) which indicates the address family for which the 172 BGPSEC speaker is advertising support for BGPSEC. This document only 173 specifies BGPSEC for use with two address families, IPv4 and IPv6, 174 AFI values 1 and 2 respectively. BGPSEC for use with other address 175 families may be specified in future documents. 177 2.2. Negotiating BGPSEC Support 179 In order to indicate that a BGP speaker is willing to send BGPSEC 180 update messages (for a particular address family), a BGP speaker 181 sends the BGPSEC Capability (see Section 2.1) with the Direction bit 182 (the fifth bit of the first octet) set to 1. In order to indicate 183 that the speaker is willing to receive BGP update messages containing 184 the BGPSEC_Path attribute (for a particular address family), a BGP 185 speaker sends the BGPSEC capability with the Direction bit set to 0. 186 In order to advertise the capability to both send and receive BGPSEC 187 update messages, the BGP speaker sends two copies of the BGPSEC 188 capability (one with the direction bit set to 0 and one with the 189 direction bit set to 1). 191 Similarly, if a BGP speaker wishes to use BGPSEC with two different 192 address families (i.e., IPv4 and IPv6) over the same BGP session, 193 then the speaker includes two instances of this capability (one for 194 each address family) in the BGP OPEN message. A BGP speaker SHOULD 195 NOT advertise the capability of BGPSEC support for a particular AFI 196 unless it has also advertised the multiprotocol extension capability 197 for the same AFI combination [3]. 199 In a session where BGP session, a peer is permitted to send update 200 messages containing the BGPSEC_Path attribute if, and only if: 202 o The given peer sent the BGPSEC capability for a particular version 203 of BGPSEC and a particular address family with the Direction bit 204 set to 1; and 206 o The other peer sent the BGPSEC capability for the same version of 207 BGPSEC and the same address family with the Direction bit set to 208 0. 210 In such a session, we say that the use of (the particular version of) 211 BGPSEC has been negotiated (for a particular address family). BGP 212 update messages without the BGPSEC_Path attribute MAY be sent within 213 a session regardless of whether or not the use of BGPSEC is 214 successfully negotiated. However, if BGPSEC is not successfully 215 negotiated, then BGP update messages containing the BGPSEC_Path 216 attribute MUST NOT be sent. 218 This document defines the behavior of implementations in the case 219 where BGPSEC version zero is the only version that has been 220 successfully negotiated. Any future document which specifies 221 additional versions of BGPSEC will need to specify behavior in the 222 case that support for multiple versions is negotiated. 224 BGPSEC cannot provide meaningful security guarantees without support 225 for four-byte AS numbers. Therefore, any BGP speaker that announces 226 the BGPSEC capability, MUST also announce the capability for four- 227 byte AS support [4]. If a BGP speaker sends the BGPSEC capability but 228 not the four-byte AS support capability then BGPSEC has not been 229 successfully negotiated, and update messages containing the 230 BGPSEC_Path attribute MUST NOT be sent within such a session. 232 Note that BGPSEC update messages can be quite large, therefore any 233 BGPSEC speaker announcing the capability to receive BGPSEC messages 234 SHOULD also announce support for the capability to receive BGP 235 extended messages [9]. 237 3. The BGPSEC_Path Attribute 238 The BGPSEC_Path attribute is a new optional non-transitive BGP path 239 attribute. 241 This document registers a new attribute type code for this attribute 242 : TBD 244 The BGPSEC_Path attribute carries the secured information regarding 245 the path of ASes through which an update message passes. This 246 includes the digital signatures used to protect the path information. 247 We refer to those update messages that contain the BGPSEC_Path 248 attribute as "BGPSEC Update messages". The BGPSEC_Path attribute 249 replaces the AS_PATH attribute in a BGPSEC update message. That is, 250 update messages that contain the BGPSEC_Path attribute MUST NOT 251 contain the AS_PATH attribute, and vice versa. 253 The BGPSEC_Path attribute is made up of several parts. The following 254 high-level diagram provides an overview of the structure of the 255 BGPSEC_Path attribute: 257 High-Level Diagram of the BGPSEC_Path Attribute 258 +---------------------------------------------------------+ 259 | +-----------------+ | 260 | | Secure Path | | 261 | +-----------------+ | 262 | | AS X | | 263 | | pCount X | | 264 | | Flags X | | 265 | | AS Y | | 266 | | pCount Y | | 267 | | Flags Y | | 268 | | ... | | 269 | +-----------------+ | 270 | | 271 | +-----------------+ +-----------------+ | 272 | | Sig Block 1 | | Sig Block 2 | | 273 | +-----------------+ +-----------------+ | 274 | | Alg Suite 1 | | Alg Suite 2 | | 275 | | SKI X1 | | SKI X1 | | 276 | | Signature X1 | | Signature X1 | | 277 | | SKI Y1 | | SKI Y1 | | 278 | | Signature Y1 | | Signature Y1 | | 279 | | ... | | .... | | 280 | +-----------------+ +-----------------+ | 281 | | 282 +---------------------------------------------------------+ 284 The following is the specification of the format for the BGPSEC_Path 285 attribute. 287 BGPSEC_Path Attribute 289 +-------------------------------------------------------+ 290 | Secure_Path (variable) | 291 +-------------------------------------------------------+ 292 | Sequence of one or two Signature_Blocks (variable) | 293 +-------------------------------------------------------+ 295 The Secure_Path contains AS path information for the BGPSEC update 296 message. This is logically equivalent to the information that is 297 contained in a non-BGPSEC AS_PATH attribute. A BGPSEC update message 298 containing the BGPSEC_Path attribute MUST NOT contain the AS_PATH 299 attribute. The Secure_Path is used by BGPSEC speakers in the same 300 way that information from the AS_PATH is used by non-BGPSEC speakers. 301 The format of the Secure_Path is described below in Section 3.1. 303 The BGPSEC_Path attribute will contain one or two Signature_Blocks, 304 each of which corresponds to a different algorithm suite. Each of 305 the Signature_Blocks will contain a signature segment for one AS 306 number (i.e, secure path segment) in the Secure_Path. In the most 307 common case, the BGPSEC_Path attribute will contain only a single 308 Signature_Block. However, in order to enable a transition from an 309 old algorithm suite to a new algorithm suite (without a flag day), it 310 will be necessary to include two Signature_Blocks (one for the old 311 algorithm suite and one for the new algorithm suite) during the 312 transition period. (See Section 6.1 for more discussion of algorithm 313 transitions.) The format of the Signature_Blocks is described below 314 in Section 3.2. 316 3.1. Secure_Path 318 Here we provide a detailed description of the Secure_Path information 319 in the BGPSEC_Path attribute. 321 Secure_Path 323 +-----------------------------------------------+ 324 | Secure_Path Length (2 octets) | 325 +-----------------------------------------------+ 326 | One or More Secure_Path Segments (variable) | 327 +-----------------------------------------------+ 329 The Secure_Path Length contains the length (in octets) of the entire 330 Secure_Path (including the two octets used to express this length 331 field). As explained below, each Secure_Path segment is six octets 332 long. Note that this means the Secure_Path Length is two greater 333 than six times the number Secure_Path Segments (i.e., the number of 334 AS numbers in the path). 336 The Secure_Path contains one Secure_Path Segment for each (distinct) 337 Autonomous System in the path to the originating AS of the NLRI 338 specified in the update message. 340 Secure_Path Segment 342 +----------------------------+ 343 | AS Number (4 octets) | 344 +----------------------------+ 345 | pCount (1 octet) | 346 +----------------------------+ 347 | Flags (1 octet) | 348 +----------------------------+ 350 The AS Number is the AS number of the BGP speaker that added this 351 Secure_Path segment to the BGPSEC_Path attribute. (See Section 4 for 352 more information on populating this field.) 354 The pCount field contains the number of repetitions of the associated 355 autonomous system number that the signature covers. This field 356 enables a BGPSEC speaker to mimic the semantics of prepending 357 multiple copies of their AS to the AS_PATH without requiring the 358 speaker to generate multiple signatures. 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]). Note that validation of a 505 BGPSEC update message will fail (i.e., the validation algorithm, 506 specified in Section 5.2, returns 'Not Valid') unless there exists a 507 valid ROA authorizing the first AS in the Secure_Path portion of the 508 BGPSEC_Path attribute to originate routes to the prefix being 509 advertised. Therefore, a BGPSEC speaker SHOULD NOT originate a 510 BGPSEC update advertising a route for a given prefix unless there 511 exists a valid ROA authorizing the BGPSEC speaker's AS to originate 512 routes to this prefix. 514 The pCount field of the Secure_Path Segment is typically set to the 515 value 1. However, a BGPSEC speaker may set the pCount field to a 516 value greater than 1. Setting the pCount field to a value greater 517 than one has the same semantics as repeating an AS number multiple 518 times in the AS_PATH of a non-BGPSEC update message (e.g., for 519 traffic engineering purposes). Setting the pCount field to a value 520 greater than one permits this repetition without requiring a separate 521 digital signature for each repetition. 523 If the BGPSEC speaker is not a member of an autonomous system 524 confederation [5], then the Flags field of the Secure_Path Segment 525 MUST be set to zero. (Members of a confederation should follow the 526 special processing instructions for confederation members in Section 527 4.4.) 529 Typically, a BGPSEC speaker will use only a single algorithm suite, 530 and thus create only a single Signature_Block in the BGPSEC_Path 531 attribute. However, to ensure backwards compatibility during a 532 period of transition from a 'current' algorithm suite to a 'new' 533 algorithm suite, it will be necessary to originate update messages 534 that contain a Signature_Block for both the 'current' and the 'new' 535 algorithm suites (see Section 6.1). 537 When originating a new route advertisement, each Signature_Block MUST 538 consist of a single Signature Segment. The following describes how 539 the BGPSEC speaker populates the fields of the Signature_Block. 541 The Subject Key Identifier field (see Section 3) is populated with 542 the identifier contained in the Subject Key Identifier extension of 543 the RPKI router certificate corresponding to the BGPSEC speaker[10]. 544 This Subject Key Identifier will be used by recipients of the route 545 advertisement to identify the proper certificate to use in verifying 546 the signature. 548 The Signature field contains a digital signature that binds the NLRI 549 and BGPSEC_Path attribute to the RPKI router corresponding to the 550 BGPSEC speaker. The digital signature is computed as follows: 552 o Construct a sequence of octets by concatenating the Target AS 553 Number, the Secure_Path (Origin AS, pCount, and Flags), Algorithm 554 Suite Identifier, and NLRI. The Target AS Number is the AS to 555 whom the BGPSEC speaker intends to send the update message. (Note 556 that the Target AS number is the AS number announced by the peer 557 in the OPEN message of the BGP session within which the update is 558 sent.) 559 Sequence of Octets to be Signed 560 +------------------------------------+ 561 | Target AS Number (4 octets) | 562 +------------------------------------+ 563 | Origin AS Number (4 octets) | ---\ 564 +------------------------------------+ \ 565 | pCount (1 octet) | > Secure_Path 566 +------------------------------------+ / 567 | Flags (1 octet) | ---/ 568 +------------------------------------+ 569 | Algorithm Suite Id. (1 octet) | 570 +------------------------------------+ 571 | NLRI Length (1 octet) | 572 +------------------------------------+ 573 | NLRI Prefix (variable) | 574 +------------------------------------+ 576 o Apply to this octet sequence the digest algorithm (for the 577 algorithm suite of this Signature_Block) to obtain a digest value. 579 o Apply to this digest value the signature algorithm, (for the 580 algorithm suite of this Signature_Block) to obtain the digital 581 signature. Then populate the Signature Field with this digital 582 signature. 584 The Signature Length field is populated with the length (in octets) 585 of the Signature field. 587 4.2. Propagating a Route Advertisement 589 When a BGPSEC speaker receives a BGPSEC update message containing a 590 BGPSEC_Path attribute (with one or more signatures) from an (internal 591 or external) peer, it may choose to propagate the route advertisement 592 by sending to its (internal or external) peers by creating a new 593 BGPSEC advertisement for the same prefix. 595 If a BGPSEC router has received only a non-BGPSEC update message 596 (without the BGPSEC_Path attribute), containing the AS_Path 597 attribute, from a peer for a given prefix then it MUST NOT attach a 598 BGPSEC_Path attribute when it propagates the update message. (Note 599 that a BGPSEC router may also receive a non-BGPSEC update message 600 from an internal peer without the AS_Path attribute, i.e., with just 601 the NLRI in it. In that case, the prefix is originating from that AS 602 and hence the BGPSEC speaker SHOULD sign and forward the update to 603 its external peers, as specified in Section 4.1.) 605 Conversely, if a BGPSEC router has received a BGPSEC update message 606 (with the BGPSEC_Path attribute) from a peer for a given prefix and 607 it chooses to propagate that peer's route for the prefix, then it 608 SHOULD propagate the route as a BGPSEC update message containing the 609 BGPSEC_Path attribute. 611 Note that removing BGPSEC signatures (i.e., propagating a route 612 advertisement without the BGPSEC_Path attribute) has significant 613 security ramifications. (See Section 7 for discussion of the 614 security ramifications of removing BGPSEC signatures.) Therefore, 615 when a route advertisement is received via a BGPSEC update message, 616 propagating the route advertisement without the BGPSEC_Path attribute 617 is NOT RECOMMENDED, unless the message is sent to a peer that did not 618 advertise the capability to receive BGPSEC update messages (see 619 Section 4.4). 621 Furthermore, note that when a BGPSEC speaker propagates a route 622 advertisement with the BGPSEC_Path attribute it is not attesting to 623 the validation state of the update message it received. (See Section 624 7 for more discussion of the security semantics of BGPSEC 625 signatures.) 627 If the BGPSEC speaker is producing an update message which would, in 628 the absence of BGPSEC, contain an AS_SET (e.g., the BGPSEC speaker is 629 performing proxy aggregation), then the BGPSEC speaker MUST NOT 630 include the BGPSEC_Path attribute. In such a case, the BGPSEC 631 speaker must remove any existing BGPSEC_Path in the received 632 advertisement(s) for this prefix and produce a traditional (non- 633 BGPSEC) update message. It should be noted that BCP 172 [13] 634 recommends against the use of AS_SET and AS_CONFED_SET in the AS_PATH 635 of BGP updates. 637 To generate the BGPSEC_Path attribute on the outgoing update message, 638 the BGPSEC speaker first prepends a new Secure_Path Segment (places 639 in first position) to the Secure_Path. The AS number in this 640 Secure_Path segment MUST match the AS number in the AS number 641 resource extension field of the Resource PKI router certificate(s) 642 that will be used to verify the digital signature(s) constructed by 643 this BGPSEC speaker[10]. 645 The pCount is typically set to the value 1. A BGPSEC speaker may set 646 the pCount field to a value greater than 1. (See Section 4.1 for a 647 discussion of setting pCount to a value greater than 1.) A route 648 server that participates in the BGP control path, but does not act as 649 a transit AS in the data plane, may choose to set pCount to 0. This 650 option enables the route server to participate in BGPSEC and obtain 651 the associated security guarantees without increasing the effective 652 length of the AS path. (Note that BGPSEC speakers compute the 653 effective length of the AS path by summing the pCount values in the 654 BGPSEC_Path attribute, see Section 5.) However, when a route server 655 sets the pCount value to 0, it still inserts its AS number into the 656 Secure_Path segment, as this information is needed to validate the 657 signature added by the route server. Note that the option of setting 658 pCount to 0 is intended only for use by route servers that desire not 659 to increase the effective AS-PATH length of routes they advertise. 660 The pCount field SHOULD NOT be set to 0 in other circumstances. 661 BGPSEC speakers SHOULD drop incoming update messages with pCount set 662 to zero in cases where the BGPSEC speaker does not expect its peer to 663 set pCount to zero (i.e., cases where the peer is not acting as a 664 route server). 666 If the BGPSEC speaker is not a member of an autonomous system 667 confederation [5], then the Confed_Segment bit of the Flags field of 668 the Secure_Path Segment MUST be set to zero. (Members of a 669 confederation should follow the special processing instructions for 670 confederation members in Section 4.3.) 672 If the received BGPSEC update message contains two Signature_ Blocks 673 and the BGPSEC speaker supports both of the corresponding algorithms 674 suites, then the new update message generated by the BGPSEC speaker 675 SHOULD include both of the Signature_Blocks. If the received BGPSEC 676 update message contains two Signature_Blocks and the BGPSEC speaker 677 only supports one of the two corresponding algorithm suites, then the 678 BGPSEC speaker MUST remove the Signature_Block corresponding to the 679 algorithm suite that it does not understand. If the BGPSEC speaker 680 does not support the algorithm suites in any of the Signature_Blocks 681 contained in the received update message, then the BGPSEC speaker 682 MUST NOT propagate the route advertisement with the BGPSEC_Path 683 attribute. (That is, if it chooses to propagate this route 684 advertisement at all, it must do so as an unsigned BGP update 685 message). 687 Note that in the case where the BGPSEC_Path has two Signature_Blocks 688 (corresponding to different algorithm suites), the validation 689 algorithm (see Section 5.2) deems a BGPSEC update message to be 690 'Valid' if there is at least one supported algorithm suite (and 691 corresponding Signature_Block) that is deemed 'Valid'. This means 692 that a 'Valid' BGPSEC update message may contain a Signature_Block 693 which is not deemed 'Valid' (e.g., contains signatures that the 694 BGPSEC does not successfully verify). Nonetheless, such 695 Signature_Blocks MUST NOT be removed. (See Section 7 for a 696 discussion of the security ramifications of this design choice.) 698 For each Signature_Block corresponding to an algorithm suite that the 699 BGPSEC speaker does support, the BGPSEC speaker adds a new Signature 700 Segment to the Signature_Block. This Signature Segment is prepended 701 to the list of Signature Segments (placed in the first position) so 702 that the list of Signature Segments appear in the same order as the 703 corresponding Secure_Path segments. The BGPSEC speaker populates the 704 fields of this new signature segment as follows. 706 The Subject Key Identifier field in the new segment is populated with 707 the identifier contained in the Subject Key Identifier extension of 708 the RPKI router corresponding to the BGPSEC speaker [10]. This 709 Subject Key Identifier will be used by recipients of the route 710 advertisement to identify the proper certificate to use in verifying 711 the signature. 713 The Signature field in the new segment contains a digital signature 714 that binds the NLRI and BGPSEC_Path attribute to the RPKI router 715 certificate corresponding to the BGPSEC speaker. The digital 716 signature is computed as follows: 718 o Construct a sequence of octets by concatenating the Target AS 719 number, the Secure_Path segment that is being added by the BGPSEC 720 speaker constructing the signature, and the signature field of the 721 most recent Signature Segment (the one corresponding to AS from 722 whom the BGPSEC speaker's AS received the announcement). Note 723 that the Target AS number is the AS number announced by the peer 724 in the OPEN message of the BGP session within which the BGPSEC 725 update message is sent. 727 Sequence of Octets to be Signed 728 +--------------------------------------+ 729 | Target AS Number (4 octets) | 730 +--------------------------------------+ 731 | Signer's AS Number (4 octets) | ---\ 732 +--------------------------------------+ \ 733 | pCount (1 octet) | > Secure_Path 734 +--------- ----------------------------+ / 735 | Flags (1 octet) | ---/ 736 +--------------------------------------+ 737 | Most Recent Sig Field (variable) | 738 +--------------------------------------+ 740 o Apply to this octet sequence the digest algorithm (for the 741 algorithm suite of this Signature_Block) to obtain a digest value. 743 o Apply to this digest value the signature algorithm, (for the 744 algorithm suite of this Signature_Block) to obtain the digital 745 signature. Then populate the Signature Field with this digital 746 signature. 748 The Signature Length field is populated with the length (in octets) 749 of the Signature field. 751 4.3. Processing Instructions for Confederation Members 753 Members of autonomous system confederations [5] MUST additionally 754 follow the instructions in this section for processing BGPSEC update 755 messages. 757 When a confederation member sends a BGPSEC update message to a peer 758 that is a member of the same confederation, the confederation member 759 puts its (private) Member-AS Number (as opposed to the public AS 760 Confederation Identifier) in the AS Number field of the Secure_Path 761 Segment that it adds to the BGPSEC update message. Furthermore, when 762 a confederation member sends a BGPSEC update message to a peer that 763 is a member of the same confederation, the BGPSEC speaker that 764 generates the Secure_Path Segment sets the Confed_Segment flag to 765 one. This means that in a BGPSEC update message, an AS number 766 appears in a Secure_Path Segment with the Confed_Segment flag set 767 whenever, in a non-BGPSEC update message, the AS number would appear 768 in a segment of type AS_CONFED_SEQUENCE in a non-BGPSEC update 769 message. 771 Within a confederation, the verification of BGPSEC signatures added 772 by other members of the confederation is optional. If a 773 confederation chooses not to have its members verify signatures added 774 by other confederation members, then when sending a BGPSEC update 775 message to a peer that is a member of the same confederation, the 776 confederation members MAY set the Signature field within the 777 Signature_Segment that it generates to be zero (in lieu of 778 calculating the correct digital signature as described in Sections 779 4.1 and 4.2). Note that if a confederation chooses not to verify 780 digital signatures within the confederation, then BGPSEC is able to 781 provide no assurances about the integrity of the (private) Member-AS 782 Numbers placed in Secure_Path segments where the Confed_Segment flag 783 is set to one. 785 When a confederation member receives a BGPSEC update message from a 786 peer within the confederation and propagates it to a peer outside the 787 confederation, it needs to remove all of the Secure_Path Segments 788 added by confederation members as well as the corresponding Signature 789 Segments. To do this, the confederation member propagating the route 790 outside the confederation does the following: 792 o First, starting with the most recently added Secure_Path segments, 793 remove all of the consecutive Secure_Path segments that have the 794 Confed_Segment flag set to one. Stop this process once a 795 Scure_Path segment is reached which has its Confed_Segment flag 796 set to zero. Keep a count of the number of segments removed in 797 this fashion. 799 o Second, starting with the most recently added Signature Segment, 800 remove a number of Signature Segments equal to the number of 801 Secure_Path Segments removed in the previous step. (That is, 802 remove the K most recently added signature segments, where K is 803 the number of Secure_Path Segments removed in the previous step.) 805 o Finally, add a Secure_Path Segment containing, in the AS field, 806 the AS Confederation Identifier (the public AS number of the 807 confederation) as well as a corresponding Signature Segment. Note 808 that all fields other that the AS field are populated as per 809 Sections 4.1 and 4.2. 811 When validating a received BGPSEC update message, confederation 812 members need to make the following adjustment to the algorithm 813 presented in Section 5.2. When a confederation member processes 814 (validates) a Signature Segment and its corresponding Secure_Path 815 Segment, the confederation member must note that for a signature 816 produced by a BGPSEC speaker outside of a confederation, the Target 817 AS will always be the AS Confederation Identifier (the public AS 818 number of the confederation) as opposed to the Member-AS Number. 820 To handle this case, when a BGPSEC speaker (that is a confederation 821 member) processes a current Secure_Path Segment that has the 822 Confed_Segment flag set to zero, if the next most recently added 823 Secure_Path segment has the Confed_Segment flag set to one then, when 824 computing the digest for the current Secure_Path segment, the BGPSEC 825 speaker takes the Target AS Number to be the AS Confederation 826 Identifier of the validating BGPSEC speaker's own confederation. 827 (Note that the algorithm in Section 5.2 processes Secure_Path 828 Segments in order from most recently added to least recently added, 829 therefore this special case will apply to the first Secure_Path 830 segment that the algorithm encounters that has the Confed_Segment 831 flag set to zero.) 833 Finally, as discussed above, an AS confederation may optionally 834 decide that its members will not verify digital signatures added by 835 members. In such a federation, when a confederation member runs the 836 algorithm in Section 5.2, the confederation member, during processing 837 of a Signature_Segment, first checks whether the Confed_Sequence flag 838 in the corresponding Secure_Path segment is set to one. If the 839 Confed_Sequence flag is set to one in the corresponding Secure_Path 840 segment, the confederation member does not perform any further checks 841 on the Signature_Segment and immediately moves on to the next 842 Signature_Segment (and checks its corresponding Secure_Path segment). 843 Note that as specified in Section 5.2, it is an error when a BGPSEC 844 speaker receives from a peer, who is not in the same AS 845 confederation, a BGPSEC update containing a Confed_Sequence flag set 846 to one. (As discussed in Section 5.2, any error in the BGPSEC_Path 847 attribute MUST be handled using the "treat-as-withdraw", approach as 848 defined in RFC WXYZ [12].) 850 4.4. Reconstructing the AS_PATH Attribute 852 BGPSEC update messages do not contain the AS_PATH attribute. 853 However, the AS_PATH attribute can be reconstructed from the 854 BGPSEC_Path attribute. This is necessary in the case where a route 855 advertisement is received via a BGPSEC update message and then 856 propagated to a peer via a non-BGPSEC update message (e.g., because 857 the latter peer does not support BGPSEC). Note that there may be 858 additional cases where an implementation finds it useful to perform 859 this reconstruction. 861 The AS_PATH attribute can be constructed from the BGPSEC_Path 862 attribute as follows. Starting with an empty AS_PATH attribute, 863 process the Secure_Path segments in order from least-recently added 864 (corresponding to the origin) to most-recently added. For each 865 Secure_Path segment perform the following steps: 867 1. If the Confed_Segment flag in the Secure_Path segment is set to 868 one, then look at the most-recently added segment in the AS_PATH. 870 * In the case where the AS_PATH is empty or in the case where 871 the most-recently added segment is of type AS_SEQUENCE then 872 add (prepend to the AS_PATH) a new AS_PATH segment of type 873 AS_CONFED_SEQUENCE. This segment of type AS_CONFED_SEQUENCE 874 shall contain a number of elements equal to the pCount field 875 in the current Secure_Path segment. Each of these elements 876 shall be the AS number contained in the current Secure_Path 877 segment. (That is, if the pCount field is X, then the segment 878 of type AS_CONFED_SEQUENCE contains X copies of the 879 Secure_Path segment's AS Number field.) 881 * In the case where the most-recently added segment in the 882 AS_PATH is of type AS_CONFED_SEQUENCE then add (prepend to the 883 segment) a number of elements equal to the pCount field in the 884 current Secure_Path segment. The value of each of these 885 elements shall be the AS number contained in the current 886 Secure_Path segment. (That is, if the pCount field is X, then 887 add X copies of the Secure_Path segment's AS Number field to 888 the existing AS_CONFED_SEQUENCE.) 890 2. If the Confed_Segment flag in the Secure_Path segment is set to 891 zero, then look at the most-recently added segment in the 892 AS_PATH. 894 * In the case where the AS_PATH is empty, and the pCount field 895 in the Secure_Path segment is greater than zero, add (prepend 896 to the AS_PATH) a new AS_PATH segment of type AS_SEQUENCE. 897 This segment of type AS_SEQUENCE shall contain a number of 898 elements equal to the pCount field in the current Secure_Path 899 segment. Each of these elements shall be the AS number 900 contained in the current Secure_Path segment. (That is, if 901 the pCount field is X, then the segment of type AS_SEQUENCE 902 contains X copies of the Secure_Path segment's AS Number 903 field.) 905 * In the case where the most recently added segment in the 906 AS_PATH is of type AS_SEQUENCE then add (prepend to the 907 segment) a number of elements equal to the pCount field in the 908 current Secure_Path segment. The value of each of these 909 elements shall be the AS number contained in the current 910 Secure_Path segment. (That is, if the pCount field is X, then 911 add X copies of the Secure_Path segment's AS Number field to 912 the existing AS_SEQUENCE.) 914 5. Processing a Received BGPSEC Update 916 Upon receiving a BGPSEC update message from an external (eBGP) peer, 917 a BGPSEC speaker SHOULD validate the message to determine the 918 authenticity of the path information contained in the BGPSEC_Path 919 attribute. Section 5.1 provides an overview of BGPSEC validation and 920 Section 5.2 provides a specific algorithm for performing such 921 validation. (Note that an implementation need not follow the 922 specific algorithm in Section 5.2 as long as the input/output 923 behavior of the validation is identical to that of the algorithm in 924 Section 5.2.) During exceptional conditions (e.g., the BGPSEC 925 speaker receives an incredibly large number of update messages at 926 once) a BGPSEC speaker MAY temporarily defer validation of incoming 927 BGPSEC update messages. The treatment of such BGPSEC update 928 messages, whose validation has been deferred, is a matter of local 929 policy. 931 The validity of BGPSEC update messages is a function of the current 932 RPKI state. When a BGPSEC speaker learns that RPKI state has changed 933 (e.g., from an RPKI validating cache via the RTR protocol), the 934 BGPSEC speaker MUST re-run validation on all affected update messages 935 stored in its ADJ-RIB-IN. That is, when a given RPKI certificate 936 ceases to be valid (e.g., it expires or is revoked), all update 937 messages containing a signature whose SKI matches the SKI in the 938 given certificate must be re-assessed to determine if they are still 939 valid. If this reassessment determines that the validity state of an 940 update has changed then, depending on local policy, it may be 941 necessary to re-run best path selection. 943 BGPSEC update messages do not contain an AS_PATH attribute. 944 Therefore, a BGPSEC speaker MUST utilize the AS path information in 945 the BGPSEC_Path attribute in all cases where it would otherwise use 946 the AS path information in the AS_PATH attribute. The only exception 947 to this rule is when AS path information must be updated in order to 948 propagate a route to a peer (in which case the BGPSEC speaker follows 949 the instructions in Section 4). Section 4.4 provides an algorithm 950 for constructing an AS_PATH attribute from a BGPSEC_Path attribute. 951 Whenever the use of AS path information is called for (e.g., loop 952 detection, or use of AS path length in best path selection) the 953 externally visible behavior of the implementation shall be the same 954 as if the implementation had run the algorithm in Section 4.4 and 955 used the resulting AS_PATH attribute as it would for a non-BGPSEC 956 update message. 958 Many signature algorithms are non-deterministic. That is, many 959 signature algorithms will produce different signatures each time they 960 are run (even when they are signing the same data with the same key). 961 Therefore, if an implementation receives a BGPSEC update from a peer 962 and later receives a second BGPSEC update message from the same peer, 963 the implementation SHOULD treat the second message as a duplicate 964 update message if it differs from the first update message only in 965 the Signature fields (within the BGPSEC_Path attribute). That is, if 966 all the fields in the second update are identical to the fields in 967 the first update message, except for the Signature fields, then the 968 second update message should be treated as a duplicate of the first 969 update message. Note that if other fields (e.g., the Subject Key 970 Identifier field) within a Signature segment differ between two 971 update messages then the two updates are not duplicates. 973 With regards to the processing of duplicate update messages, if the 974 first update message is valid, then an implementation SHOULD NOT run 975 the validation procedure on the second, duplicate update message 976 (even if the bits of the signature field are different). If the 977 first update message is not valid, then an implementation SHOULD run 978 the validation procedure on the second duplicate update message (as 979 the signatures in the second update may be valid even though the 980 first contained a signature that was invalid). 982 5.1. Overview of BGPSEC Validation 984 Validation of a BGPSEC update messages makes use of data from RPKI 985 certificates and signed Route Origination Authorizations (ROA). In 986 particular, to validate update messages containing the BGPSEC_Path 987 attribute, it is necessary that the recipient have access to the 988 following data obtained from valid RPKI certificates and ROAs: 990 o For each valid RPKI router certificate, the AS Number, Public Key 991 and Subject Key Identifier are required, 993 o For each valid ROA, the AS Number and the list of IP address 994 prefixes. 996 Note that the BGPSEC speaker could perform the validation of RPKI 997 certificates and ROAs on its own and extract the required data, or it 998 could receive the same data from a trusted cache that performs RPKI 999 validation on behalf of (some set of) BGPSEC speakers. (For example, 1000 the trusted cache could deliver the necessary validity information to 1001 the BGPSEC speaker using the router key PDU [16] for the RTR protocol 1002 [15].) 1004 To validate a BGPSEC update message containing the BGPSEC_Path 1005 attribute, the recipient performs the validation steps specified in 1006 Section 5.2. The validation procedure results in one of two states: 1007 'Valid' and 'Not Valid'. 1009 It is expected that the output of the validation procedure will be 1010 used as an input to BGP route selection. However, BGP route 1011 selection, and thus the handling of the two validation states is a 1012 matter of local policy, and is handled using local policy mechanisms. 1014 It is expected that BGP peers will generally prefer routes received 1015 via 'Valid' BGPSEC update messages over both routes received via 'Not 1016 Valid' BGPSEC update messages and routes received via update messages 1017 that do not contain the BGPSEC_Path attribute. However, BGPSEC 1018 specifies no changes to the BGP decision process. (See [17] for 1019 related operational considerations.) 1021 BGPSEC validation needs only be performed at the eBGP edge. The 1022 validation status of a BGP signed/unsigned update MAY be conveyed via 1023 iBGP from an ingress edge router to an egress edge router via some 1024 mechanism, according to local policy within an AS. As discussed in 1025 Section 4, when a BGPSEC speaker chooses to forward a (syntactically 1026 correct) BGPSEC update message, it SHOULD be forwarded with its 1027 BGPSEC_Path attribute intact (regardless of the validation state of 1028 the update message). Based entirely on local policy, an egress 1029 router receiving a BGPSEC update message from within its own AS MAY 1030 choose to perform its own validation. 1032 5.2. Validation Algorithm 1034 This section specifies an algorithm for validation of BGPSEC update 1035 messages. A conformant implementation MUST include a BGPSEC update 1036 validation algorithm that is functionally equivalent to the 1037 externally visible behavior of this algorithm. 1039 First, the recipient of a BGPSEC update message performs a check to 1040 ensure that the message is properly formed. Specifically, the 1041 recipient performs the following checks: 1043 1. Check to ensure that the entire BGPSEC_Path attribute is 1044 syntactically correct (conforms to the specification in this 1045 document). 1047 2. Check that each Signature_Block contains one Signature segment 1048 for each Secure_Path segment in the Secure_Path portion of the 1049 BGPSEC_Path attribute. (Note that the entirety of each 1050 Signature_Block must be checked to ensure that it is well formed, 1051 even though the validation process may terminate before all 1052 signatures are cryptographically verified.) 1054 3. Check that the update message does not contain an AS_PATH 1055 attribute. 1057 4. If the update message was received from a peer that is not a 1058 member of the BGPSEC speaker's AS confederation, check to ensure 1059 that none of the Secure_Path segments contain a Flags field with 1060 the Confed_Sequence flag set to one. 1062 5. If the update message was received from a peer that is not 1063 expected to set pCount equal to zero (see Section 4.2) then check 1064 to ensure that the pCount field in the most-recently added 1065 Secure_Path segment is not equal to zero. 1067 If any of these checks fail, it is an error in the BGPSEC_Path 1068 attribute. Any of these errors in the BGPSEC_Path attribute are 1069 handled as per RFC WXYZ [12]. BGPSEC speakers MUST handle these 1070 errors using the "treat-as-withdraw" approach as defined in RFC WXYZ 1071 [12]. 1073 Next, the BGPSEC speaker verifies that the origin AS is authorized to 1074 advertise the prefix in question. To do this, consult the valid ROA 1075 data to obtain a list of AS numbers that are associated with the 1076 given IP address prefix in the update message. Then locate the last 1077 (least recently added) AS number in the Secure_Path portion of the 1078 BGPSEC_Path attribute. If the origin AS in the Secure_Path is not in 1079 the set of AS numbers associated with the given prefix, then the 1080 BGPSEC update message is 'Not Valid' and the validation algorithm 1081 terminates. 1083 Finally, the BGPSEC speaker examines the Signature_Blocks in the 1084 BGPSEC_Path attribute. A Signature_Block corresponding to an 1085 algorithm suite that the BGPSEC speaker does not support is not 1086 considered in validation. If there is no Signature_Block 1087 corresponding to an algorithm suite that the BGPSEC speaker supports, 1088 then the BGPSEC speaker MUST treat the update message in the same 1089 manner that the BGPSEC speaker would treat an (unsigned) update 1090 message that arrived without a BGPSEC_Path attribute. 1092 For each remaining Signature_Block (corresponding to an algorithm 1093 suite supported by the BGPSEC speaker), the BGPSEC speaker iterates 1094 through the Signature segments in the Signature_Block, starting with 1095 the most recently added segment (and concluding with the least 1096 recently added segment). Note that there is a one-to-one 1097 correspondence between Signature segments and Secure_Path segments 1098 within the BGPSEC_Path attribute. The following steps make use of 1099 this correspondence. 1101 o (Step I): Locate the public key needed to verify the signature (in 1102 the current Signature segment). To do this, consult the valid 1103 RPKI router certificate data and look up all valid (AS, SKI, 1104 Public Key) triples in which the AS matches the AS number in the 1105 corresponding Secure_Path segment. Of these triples that match 1106 the AS number, check whether there is an SKI that matches the 1107 value in the Subject Key Identifier field of the Signature 1108 segment. If this check finds no such matching SKI value, then 1109 mark the entire Signature_Block as 'Not Valid' and proceed to the 1110 next Signature_Block. 1112 o (Step II): Compute the digest function (for the given algorithm 1113 suite) on the appropriate data. If the segment is not the (least 1114 recently added) segment corresponding to the origin AS, then the 1115 digest function should be computed on the following sequence of 1116 octets: 1118 Sequence of Octets to be Hashed 1120 +-------------------------------------------+ 1121 | AS Number of Target AS (4 octets) | 1122 +-------------------------------------------+ 1123 | AS Number (4 octets) | ---\ 1124 +-------------------------------------------+ \ 1125 | pCount (1 octet) | > Secure_Path 1126 +-------------------------------------------+ / 1127 | Flags (1 octet) | ---/ 1128 +-------------------------------------------+ 1129 | Sig Field in the Next Segment (variable) | 1130 +-------------- ----------------------------+ 1132 For the first segment to be processed (the most recently added 1133 segment), the 'AS Number of Target AS' is the AS number of the BGPSEC 1134 speaker validating the update message. Note that if a BGPSEC speaker 1135 uses multiple AS Numbers (e.g., the BGPSEC speaker is a member of a 1136 confederation), the AS number used here MUST be the AS number 1137 announced in the OPEN message for the BGP session over which the 1138 BGPSEC update was received. 1140 For each other Signature Segment, the 'AS Number of Target AS' is the 1141 AS number in the Secure_Path segment that corresponds to the 1142 Signature Segment added immediately after the one being processed. 1143 (That is, in the Secure_Path segment that corresponds to the 1144 Signature segment that the validator just finished processing.) 1146 The AS Number, pCount and Flags fields are taken from the Secure_Path 1147 segment that corresponds to the Signature segment currently being 1148 processed. The 'Signature Field in the Next Segment' is the 1149 Signature field found in the Signature segment that is next to be 1150 processed (that is, the next most recently added Signature Segment). 1152 Alternatively, if the segment being processed corresponds to the 1153 origin AS (i.e., if it is the least recently added segment), then the 1154 digest function should be computed on the following sequence of 1155 octets: 1157 Sequence of Octets to be Hashed 1158 +------------------------------------+ 1159 | AS Number of Target AS (4 octets) | 1160 +------------------------------------+ 1161 | Origin AS Number (4 octets) | ---\ 1162 +------------------------------------+ \ 1163 | pCount (1 octet) | > Secure_Path 1164 +------------------------------------+ / 1165 | Flags (1 octet) | ---/ 1166 +------------------------------------+ 1167 | Algorithm Suite Id. (1 octet) | 1168 +------------------------------------+ 1169 | NLRI Length (1 octet) | 1170 +------------------------------------+ 1171 | NLRI Prefix (variable) | 1172 +------------------------------------+ 1174 The NLRI Length, NLRI Prefix, and Algorithm Suite Identifier are all 1175 obtained in a straight forward manner from the NLRI of the update 1176 message or the BGPSEC_Path attribute being validated. The Origin AS 1177 Number, pCount, and Flags fields are taken from the Secure_Path 1178 segment corresponding to the Signature Segment currently being 1179 processed. 1181 The 'AS Number of Target AS' is the AS Number from the Secure_Path 1182 segment that was added immediately after the Secure_Path segment 1183 containing the Origin AS Number. (That is, the Secure_Path segment 1184 corresponding to the Signature segment that the receiver just 1185 finished processing prior to the current Signature segment.) 1187 o (Step III): Use the signature validation algorithm (for the given 1188 algorithm suite) to verify the signature in the current segment. 1189 That is, invoke the signature validation algorithm on the 1190 following three inputs: the value of the Signature field in the 1191 current segment; the digest value computed in Step II above; and 1192 the public key obtained from the valid RPKI data in Step I above. 1193 If the signature validation algorithm determines that the 1194 signature is invalid, then mark the entire Signature_Block as 'Not 1195 Valid' and proceed to the next Signature_Block. If the signature 1196 validation algorithm determines that the signature is valid, then 1197 continue processing Signature Segments (within the current 1198 Signature_Block). 1200 If all Signature Segments within a Signature_Block pass validation 1201 (i.e., all segments are processed and the Signature_Block has not yet 1202 been marked 'Not Valid'), then the Signature_Block is marked as 1203 'Valid'. 1205 If at least one Signature_Block is marked as 'Valid', then the 1206 validation algorithm terminates and the BGPSEC update message is 1207 deemed to be 'Valid'. (That is, if a BGPSEC update message contains 1208 two Signature_Blocks then the update message is deemed 'Valid' if the 1209 first Signature_Block is marked 'Valid' OR the second Signature_Block 1210 is marked 'Valid'.) 1212 6. Algorithms and Extensibility 1214 6.1. Algorithm Suite Considerations 1216 Note that there is currently no support for bilateral negotiation 1217 (using BGP capabilities) between BGPSEC peers to use of a particular 1218 (digest and signature) algorithm suite. This is because the algorithm 1219 suite used by the sender of a BGPSEC update message must be 1220 understood not only by the peer to whom he is directly sending the 1221 message, but also by all BGPSEC speakers to whom the route 1222 advertisement is eventually propagated. Therefore, selection of an 1223 algorithm suite cannot be a local matter negotiated by BGP peers, but 1224 instead must be coordinated throughout the Internet. 1226 To this end, a mandatory algorithm suites document will be created 1227 which specifies a mandatory-to-use 'current' algorithm suite for use 1228 by all BGPSEC speakers [11]. 1230 It is anticipated that, in the future mandatory, the algorithm suites 1231 document will be updated to specify a transition from the 'current' 1232 algorithm suite to a 'new' algorithm suite. During the period of 1233 transition (likely a small number of years), all BGPSEC update 1234 messages SHOULD simultaneously use both the 'current' algorithm suite 1235 and the 'new' algorithm suite. (Note that Sections 3 and 4 specify 1236 how the BGPSEC_Path attribute can contain signatures, in parallel, 1237 for two algorithm suites.) Once the transition is complete, use of 1238 the old 'current' algorithm will be deprecated, use of the 'new' 1239 algorithm will be mandatory, and a subsequent 'even newer' algorithm 1240 suite may be specified as recommend to implement. Once the 1241 transition has successfully been completed in this manner, BGPSEC 1242 speakers SHOULD include only a single Signature_Block (corresponding 1243 to the 'new' algorithm). 1245 6.2. Extensibility Considerations 1247 This section discusses potential changes to BGPSEC that would require 1248 substantial changes to the processing of the BGPSEC_Path and thus 1249 necessitate a new version of BGPSEC. Examples of such changes 1250 include: 1252 o A new type of signature algorithm that produces signatures of 1253 variable length 1255 o A new type of signature algorithm for which the number of 1256 signatures in the Signature_Block is not equal to the number of 1257 ASes in the Secure_Path (e.g., aggregate signatures) 1259 o Changes to the data that is protected by the BGPSEC signatures 1260 (e.g., attributes other than the AS path) 1262 In the case that such a change to BGPSEC were deemed desirable, it is 1263 expected that a subsequent version of BGPSEC would be created and 1264 that this version of BGPSEC would specify a new BGP path attribute, 1265 let's call it BGPSEC_PATH_TWO, which is designed to accommodate the 1266 desired changes to BGPSEC. In such a case, the mandatory algorithm 1267 suites document would be updated to specify algorithm suites 1268 appropriate for the new version of BGPSEC. 1270 At this point a transition would begin which is analogous to the 1271 algorithm transition discussed in Section 6.1. During the transition 1272 period all BGPSEC speakers SHOULD simultaneously include both the 1273 BGPSEC_Path attribute and the new BGPSEC_PATH_TWO attribute. Once 1274 the transition is complete, the use of BGPSEC_Path could then be 1275 deprecated, at which point BGPSEC speakers SHOULD include only the 1276 new BGPSEC_PATH_TWO attribute. Such a process could facilitate a 1277 transition to a new BGPSEC semantics in a backwards compatible 1278 fashion. 1280 7. Security Considerations 1282 For discussion of the BGPSEC threat model and related security 1283 considerations, please see [14]. 1285 7.1 Security Guarantees 1287 A BGPSEC speaker who receives a valid BGPSEC update message, 1288 containing a route advertisement for a given prefix, is provided with 1289 the following security guarantees: 1291 o The origin AS number corresponds to an autonomous system that has 1292 been authorized, in the RPKI, by the IP address space holder to 1293 originate route advertisements for the given prefix. 1295 o For each AS in the path, a BGPSEC speaker authorized by the holder 1296 of the AS number intentionally chose (in accordance with local 1297 policy) to propagate the route advertisement to the subsequent AS 1298 in the path. 1300 That is, the recipient of a valid BGPSEC Update message is assured 1301 that the Secure_Path portion of the BGPSEC_Path attribute corresponds 1302 to a sequence of autonomous systems who have all agreed in principle 1303 to forward packets to the given prefix along the indicated path. (It 1304 should be noted that BGPSEC does not offer any guarantee that the 1305 data packets would flow along the indicated path; it only guarantees 1306 that the BGP update conveying the path indeed propagated along the 1307 indicated path.) Furthermore, the recipient is assured that this 1308 path terminates in an autonomous system that has been authorized by 1309 the IP address space holder as a legitimate destination for traffic 1310 to the given prefix. 1312 Note that although BGPSEC provides a mechanism for an AS to validate 1313 that a received update message has certain security properties, the 1314 use of such a mechanism to influence route selection is completely a 1315 matter of local policy. Therefore, a BGPSEC speaker can make no 1316 assumptions about the validity of a route received from an external 1317 BGPSEC peer. That is, a compliant BGPSEC peer may (depending on the 1318 local policy of the peer) send update messages that fail the validity 1319 test in Section 5. Thus, a BGPSEC speaker MUST completely validate 1320 all BGPSEC update messages received from external peers. (Validation 1321 of update messages received from internal peers is a matter of local 1322 policy, see Section 5). 1324 7.2 On the Removal of BGPSEC Signatures 1326 There may be cases where a BGPSEC speaker deems 'Valid' (as per the 1327 validation algorithm in Section 5.2) a BGPSEC update message that 1328 contains both a 'Valid' and a 'Not Valid' Signature_Block. That is, 1329 the update message contains two sets of signatures corresponding to 1330 two algorithm suites, and one set of signatures verifies correctly 1331 and the other set of signatures fails to verify. In this case, the 1332 protocol specifies that a BGPSEC speaker choosing to propagate the 1333 route advertisement in such an update message SHOULD add its 1334 signature to each of the Signature_Blocks. Thus the BGPSEC speaker 1335 creates a signature using both algorithm suites and creates a new 1336 update message that contains both the 'Valid' and the 'Not Valid' set 1337 of signatures (from its own vantage point). 1339 To understand the reason for such a design decision consider the case 1340 where the BGPSEC speaker receives an update message with both a set 1341 of algorithm A signatures which are 'Valid' and a set of algorithm B 1342 signatures which are 'Not Valid'. In such a case it is possible 1343 (perhaps even likely, depending on the state of the algorithm 1344 transition) that some of the BGPSEC speaker's peers (or other 1345 entities further 'downstream' in the BGP topology) do not support 1346 algorithm A. Therefore, if the BGPSEC speaker were to remove the 'Not 1347 Valid' set of signatures corresponding to algorithm B, such entities 1348 would treat the message as though it were unsigned. By including the 1349 'Not Valid' set of signatures when propagating a route advertisement, 1350 the BGPSEC speaker ensures that 'downstream' entities have as much 1351 information as possible to make an informed opinion about the 1352 validation status of a BGPSEC update. 1354 Note also that during a period of partial BGPSEC deployment, a 1355 'downstream' entity might reasonably treat unsigned messages 1356 differently from BGPSEC updates that contain a single set of 'Not 1357 Valid' signatures. That is, by removing the set of 'Not Valid' 1358 signatures the BGPSEC speaker might actually cause a downstream 1359 entity to 'upgrade' the status of a route advertisement from 'Not 1360 Valid' to unsigned. Finally, note that in the above scenario, the 1361 BGPSEC speaker might have deemed algorithm A signatures 'Valid' only 1362 because of some issue with RPKI state local to his AS (for example, 1363 his AS might not yet have obtained a CRL indicating that a key used 1364 to verify an algorithm A signature belongs to a newly revoked 1365 certificate). In such a case, it is highly desirable for a 1366 downstream entity to treat the update as 'Not Valid' (due to the 1367 revocation) and not as 'unsigned' (which would happen if the 'Not 1368 Valid' Signature_Blocks were removed). 1370 A similar argument applies to the case where a BGPSEC speaker (for 1371 some reason such as lack of viable alternatives) selects as his best 1372 path (to a given prefix) a route obtained via a 'Not Valid' BGPSEC 1373 update message. In such a case, the BGPSEC speaker should propagate a 1374 signed BGPSEC update message, adding his signature to the 'Not Valid' 1375 signatures that already exist. Again, this is to ensure that 1376 'downstream' entities are able to make an informed decision and not 1377 erroneously treat the route as unsigned. It should also be noted 1378 that due to possible differences in RPKI data observed at different 1379 vantage points in the network, a BGPSEC update deemed 'Not Valid' at 1380 an upstream BGPSEC speaker may be deemed 'Valid' by another BGP 1381 speaker downstream. 1383 Indeed, when a BGPSEC speaker signs an outgoing update message, it is 1384 not attesting to a belief that all signatures prior to its are valid. 1385 Instead it is merely asserting that: 1387 o The BGPSEC speaker received the given route advertisement with the 1388 indicated NLRI and Secure_Path; and 1390 o The BGPSEC speaker chose to propagate an advertisement for this 1391 route to the peer (implicitly) indicated by the 'Target AS' 1393 7.3 Mitigation of Denial of Service Attacks 1394 The BGPSEC update validation procedure is a potential target for 1395 denial of service attacks against a BGPSEC speaker. To mitigate the 1396 effectiveness of such denial of service attacks, BGPSEC speakers 1397 should implement an update validation algorithm that performs 1398 expensive checks (e.g., signature verification) after performing less 1399 expensive checks (e.g., syntax checks). The validation algorithm 1400 specified in Section 5.2 was chosen so as to perform checks which are 1401 likely to be expensive after checks that are likely to be 1402 inexpensive. However, the relative cost of performing required 1403 validation steps may vary between implementations, and thus the 1404 algorithm specified in Section 5.2 may not provide the best denial of 1405 service protection for all implementations. 1407 7.4 Additional Security Considerations 1409 The mechanism of setting the pCount field to zero is included in this 1410 specification to enable route servers in the control path to 1411 participate in BGPSEC without increasing the effective length of the 1412 AS-PATH. However, entities other than route servers could 1413 conceivably use this mechanism (set the pCount to zero) to attract 1414 traffic (by reducing the effective length of the AS-PATH) 1415 illegitimately. This risk is largely mitigated if every BGPSEC 1416 speaker drops incoming update messages that set pCount to zero but 1417 come from a peer that is not a route server. However, note that a 1418 recipient of a BGPSEC update message within which an upstream entity 1419 two or more hops away has set pCount to zero is unable to verify for 1420 themselves whether pCount was set to zero legitimately. 1422 BGPSEC does not provide protection against attacks at the transport 1423 layer. An adversary on the path between a BGPSEC speaker and its 1424 peer is able to perform attacks such as modifying valid BGPSEC 1425 updates to cause them to fail validation, injecting (unsigned) BGP 1426 update messages without BGPSEC_Path_Signature attributes, or 1427 injecting BGPSEC update messages with BGPSEC_Path_Signature 1428 attributes that fail validation, or causing the peer to tear-down the 1429 BGP session. Therefore, BGPSEC sessions SHOULD be protected by 1430 appropriate transport security mechanisms. 1432 8. IANA Considerations 1434 TBD: Need IANA to assign numbers for the two capabilities and the 1435 BGPSEC_PATH attribute. 1437 This document does not create any new IANA registries. 1439 9. Contributors 1441 9.1. Authors 1443 Rob Austein 1444 Dragon Research Labs 1445 sra@hactrn.net 1447 Steven Bellovin 1448 Columbia University 1449 smb@cs.columbia.edu 1451 Randy Bush 1452 Internet Initiative Japan 1453 randy@psg.com 1455 Russ Housley 1456 Vigil Security 1457 housley@vigilsec.com 1459 Matt Lepinski 1460 BBN Technologies 1461 mlepinski.ietf@gmail.com 1463 Stephen Kent 1464 BBN Technologies 1465 kent@bbn.com 1467 Warren Kumari 1468 Google 1469 warren@kumari.net 1471 Doug Montgomery 1472 USA National Institute of Standards and Technology 1473 dougm@nist.gov 1475 Kotikalapudi Sriram 1476 USA National Institute of Standards and Technology 1477 kotikalapudi.sriram@nist.gov 1479 Samuel Weiler 1480 Sparta 1481 weiler+ietf@watson.org 1483 9.2. Acknowledgements 1485 The authors would like to thank Michael Baer, Luke Berndt, Sharon 1486 Goldberg, Ed Kern, Chris Morrow, Doug Maughan, Pradosh Mohapatra, 1487 Russ Mundy, Sandy Murphy, Keyur Patel, Mark Reynolds, Heather 1488 Schiller, Jason Schiller, John Scudder, Ruediger Volk and David Ward 1489 for their valuable input and review. 1491 10. Normative References 1493 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1494 Levels", BCP 14, RFC 2119, March 1997. 1496 [2] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border 1497 Gateway Protocol 4", RFC 4271, January 2006. 1499 [3] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 1500 "Multiprotocol Extensions for BGP-4", RFC 4760, January 2007. 1502 [4] Vohra, Q. and E. Chen, "BGP Support for Four-octet AS Number 1503 Space", RFC 4893, May 2007. 1505 [5] Traina, P., McPherson, D., and J. Scudder, "Autonomous System 1506 Confederations for BGP", RFC 5065, August 2007. 1508 [6] Scudder, J. and R. Chandra, "Capabilities Advertisement with 1509 BGP-4", RFC 5492, February 2009. 1511 [7] Lepinski, M. and S. Kent, "An Infrastructure to Support Secure 1512 Internet Routing", RFC 6480, February 2012. 1514 [8] Lepinski, M., Kent, S., and D. Kong, "A Profile for Route 1515 Origin Authorizations (ROAs)", RFC 6482, February 2012. 1517 [9] Patel, K., Ward, D., and R. Bush, "Extended Message support for 1518 BGP", draft-ietf-idr-bgp-extended-messages (work in progress), 1519 January 2014. 1521 [10] Reynolds, M., Turner, S., and S. Kent, "A Profile for BGPSEC 1522 Router Certificates, Certificate Revocation Lists, and 1523 Certification Requests", draft-ietf-sidr-bgpsec-pki-profiles 1524 (work in progress), March 2014. 1526 [11] Turner, S., "BGP Algorithms, Key Formats, & Signature Formats", 1527 draft-ietf-sidr-bgpsec-algs (work in progress), July 2014. 1529 [12] Scudder, J., Chen, E., Mohapatra, P., and K. Patel, "Revised 1530 Error Handling for BGP UPDATE Messages", draft-ietf-idr-error- 1531 handling (work in progress), June 2014. 1533 11. Informative References 1535 [13] Kumari, W. and K. Sriram, "Recommendation for Not Using AS_SET 1536 and AS_CONFED_SET in BGP", RFC 6472, December 2011. 1538 [14] Kent, S., "Threat Model for BGP Path Security", draft-ietf- 1539 sidr-bgpsec-threats (work in progress), December 2013. 1541 [15] Bush, R. and R. Austein, "The Resource Public Key 1542 Infrastructure (RPKI) to Router Protocol", RFC 6810, January 1543 2013. 1545 [16] Bush, R., Patel, K., and S. Turner, "Router Key PDU for RPKI- 1546 Router Protocol", draft-ymbk-rpki-rtr-keys (work in progress), 1547 April 2013. 1549 [17] Bush, R., "BGPsec Operational Considerations", draft-ietf-sidr- 1550 bgpsec-ops (work in progress), May 2012. 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