idnits 2.17.1 draft-ietf-sidr-bgpsec-protocol-11.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 (January 19, 2015) is 3383 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 January 19, 2015 5 Expires: July 19, 2015, 2015 7 BGPsec Protocol Specification 8 draft-ietf-sidr-bgpsec-protocol-11 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. The information in 297 Secure_Path is used by BGPsec speakers in the same way that 298 information from the AS_PATH is used by non-BGPsec speakers. The 299 format of the Secure_Path is described below in Section 3.1. 301 The BGPsec_Path attribute will contain one or two Signature_Blocks, 302 each of which corresponds to a different algorithm suite. Each of 303 the Signature_Blocks will contain a signature segment for each AS 304 number (i.e., Secure_Path segment) in the Secure_Path. In the most 305 common case, the BGPsec_Path attribute will contain only a single 306 Signature_Block. However, in order to enable a transition from an 307 old algorithm suite to a new algorithm suite (without a flag day), it 308 will be necessary to include two Signature_Blocks (one for the old 309 algorithm suite and one for the new algorithm suite) during the 310 transition period. (See Section 6.1 for more discussion of algorithm 311 transitions.) The format of the Signature_Blocks is described below 312 in Section 3.2. 314 3.1. Secure_Path 316 Here we provide a detailed description of the Secure_Path information 317 in the BGPsec_Path attribute. 319 Secure_Path 321 +-----------------------------------------------+ 322 | Secure_Path Length (2 octets) | 323 +-----------------------------------------------+ 324 | One or More Secure_Path Segments (variable) | 325 +-----------------------------------------------+ 327 The Secure_Path Length contains the length (in octets) of the entire 328 Secure_Path (including the two octets used to express this length 329 field). As explained below, each Secure_Path segment is six octets 330 long. Note that this means the Secure_Path Length is two greater 331 than six times the number Secure_Path Segments (i.e., the number of 332 AS numbers in the path). 334 The Secure_Path contains one Secure_Path Segment for each (distinct) 335 Autonomous System in the path to the originating AS of the NLRI 336 specified in the update message. 338 Secure_Path Segment 340 +----------------------------+ 341 | AS Number (4 octets) | 342 +----------------------------+ 343 | pCount (1 octet) | 344 +----------------------------+ 345 | Flags (1 octet) | 346 +----------------------------+ 348 The AS Number is the AS number of the BGP speaker that added this 349 Secure_Path segment to the BGPsec_Path attribute. (See Section 4 for 350 more information on populating this field.) 352 The pCount field contains the number of repetitions of the associated 353 autonomous system number that the signature covers. This field 354 enables a BGPsec speaker to mimic the semantics of prepending 355 multiple copies of their AS to the AS_PATH without requiring the 356 speaker to generate multiple signatures. The pCount field is also 357 useful in managing route servers (see Section 4.2) and AS Number 358 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 omits the BGPsec_Path attribute. When propagating a received route 443 advertisement to an internal peer, the BGPsec speaker populates the 444 BGPsec_Path attribute by copying the BGPsec_Path attribute from the 445 received update message. That is, the BGPsec_Path attribute is 446 copied verbatim. Note that in the case that a BGPsec speaker chooses 447 to forward to an iBGP peer a BGPsec update message that has not been 448 successfully validated (see Section 5), the BGPsec_Path attribute 449 SHOULD NOT be removed. (See Section 7 for the security ramifications 450 of removing BGPsec signatures.) 452 The information protected by the signature on a BGPsec update message 453 includes the AS number of the peer to whom the update message is 454 being sent. Therefore, if a BGPsec speaker wishes to send a BGPsec 455 update to multiple BGP peers, it MUST generate a separate BGPsec 456 update message for each unique peer AS to which the update message is 457 sent. 459 A BGPsec update message MUST advertise a route to only a single NLRI. 460 This is because a BGPsec speaker receiving an update message with 461 multiple NLRI would be unable to construct a valid BGPsec update 462 message (i.e., valid path signatures) containing a subset of the NLRI 463 in the received update. If a BGPsec speaker wishes to advertise 464 routes to multiple NLRI, then it MUST generate a separate BGPsec 465 update message for each NLRI. 467 In order to create or add a new signature to a BGPsec update message 468 with a given algorithm suite, the BGPsec speaker must possess a 469 private key suitable for generating signatures for this algorithm 470 suite. Additionally, this private key must correspond to the public 471 key in a valid Resource PKI end-entity certificate whose AS number 472 resource extension includes the BGPsec speaker's AS number [10]. Note 473 also that new signatures are only added to a BGPsec update message 474 when a BGPsec speaker is generating an update message to send to an 475 external peer (i.e., when the AS number of the peer is not equal to 476 the BGPsec speaker's own AS number). Therefore, a BGPsec speaker who 477 only sends BGPsec update messages to peers within its own AS, it does 478 not need to possess any private signature keys. 480 Section 4.3 contains special processing instructions for members of 481 an autonomous system confederation [5]. A BGPsec speaker that is not 482 a member of such a confederation MUST set the Flags field of the 483 Secure_Path Segment to zero in all BGPsec update messages it sends. 485 Section 4.4 contains instructions for reconstructing the AS_Path 486 attribute in cases where a BGPsec speaker receives an update message 487 with a BGPsec_Path attribute and wishes to propagate the update 488 message to a peer who does not support BGPsec. 490 4.1. Originating a New BGPsec Update 492 In an update message that originates a new route advertisement (i.e., 493 an update whose path will contain only a single AS number), when 494 sending the route advertisement to an external, BGPsec-speaking peer, 495 the BGPsec speaker creates a new BGPsec_Path attribute as follows. 497 First, the BGPsec speaker constructs the Secure_Path with a single 498 Secure_Path Segment. The AS in this path is the BGPsec speaker's own 499 AS number. In particular, this AS number MUST match an AS number in 500 the AS number resource extension field of the Resource PKI router 501 certificate(s) [10] that will be used to verify the digital 502 signature(s) constructed by this BGPsec speaker. 504 The BGPsec_Path attribute and the AS_Path attribute are mutually 505 exclusive. That is, any update message containing the BGPsec_Path 506 attribute MUST NOT contain the AS_Path attribute. The information 507 that would be contained in the AS_Path attribute is instead conveyed 508 in the Secure_Path portion of the BGPsec_Path attribute. 510 The Resource PKI enables the legitimate holder of IP address 511 prefix(es) to issue a signed object, called a Route Origination 512 Authorization (ROA), that authorizes a given AS to originate routes 513 to a given set of prefixes (see [8]). It is expected that most 514 relying parties will utilize BGPsec in tandem with origin validation 515 (see [19] and [20]). Therefore, it is RECOMMENDED that a BGPsec 516 speaker only originate a BGPsec update advertising a route for a 517 given prefix if there exists a valid ROA authorizing the BGPsec 518 speaker's AS to originate routes to this prefix. 520 The pCount field of the Secure_Path Segment is typically set to the 521 value 1. However, a BGPsec speaker may set the pCount field to a 522 value greater than 1. Setting the pCount field to a value greater 523 than one has the same semantics as repeating an AS number multiple 524 times in the AS_PATH of a non-BGPsec update message (e.g., for 525 traffic engineering purposes). Setting the pCount field to a value 526 greater than one permits this repetition without requiring a separate 527 digital signature for each repetition. 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 certificate 550 corresponding to the BGPsec speaker. The digital signature is 551 computed as follows: 553 o Construct a sequence of octets by concatenating the Target AS 554 Number, the Secure_Path (Origin AS, pCount, and Flags), Algorithm 555 Suite Identifier, and NLRI. The Target AS Number is the AS to 556 whom the BGPsec speaker intends to send the update message. (Note 557 that the Target AS number is the AS number announced by the peer 558 in the OPEN message of the BGP session within which the update is 559 sent.) 560 Sequence of Octets to be Signed 561 +------------------------------------+ 562 | Target AS Number (4 octets) | 563 +------------------------------------+ 564 | Origin AS Number (4 octets) | ---\ 565 +------------------------------------+ \ 566 | pCount (1 octet) | > Secure_Path 567 +------------------------------------+ / 568 | Flags (1 octet) | ---/ 569 +------------------------------------+ 570 | Algorithm Suite Id. (1 octet) | 571 +------------------------------------+ 572 | NLRI Length (1 octet) | 573 +------------------------------------+ 574 | NLRI Prefix (variable) | 575 +------------------------------------+ 577 o Apply to this octet sequence the digest algorithm (for the 578 algorithm suite of this Signature_Block) to obtain a digest value. 580 o Apply to this digest value the signature algorithm, (for the 581 algorithm suite of this Signature_Block) to obtain the digital 582 signature. Then populate the Signature Field with this digital 583 signature. 585 The Signature Length field is populated with the length (in octets) 586 of the Signature field. 588 4.2. Propagating a Route Advertisement 590 When a BGPsec speaker receives a BGPsec update message containing a 591 BGPsec_Path attribute (with one or more signatures) from an (internal 592 or external) peer, it may choose to propagate the route advertisement 593 by sending to its (internal or external) peers by creating a new 594 BGPsec advertisement for the same prefix. 596 If a BGPsec router has received only a non-BGPsec update message 597 (without the BGPsec_Path attribute), containing the AS_Path 598 attribute, from a peer for a given prefix then it MUST NOT attach a 599 BGPsec_Path attribute when it propagates the update message. (Note 600 that a BGPsec router may also receive a non-BGPsec update message 601 from an internal peer without the AS_Path attribute, i.e., with just 602 the NLRI in it. In that case, the prefix is originating from that AS 603 and hence the BGPsec speaker SHOULD sign and forward the update to 604 its external peers, as specified in Section 4.1.) 606 Conversely, if a BGPsec router has received a BGPsec update message 607 (with the BGPsec_Path attribute) from a peer for a given prefix and 608 it chooses to propagate that peer's route for the prefix, then it 609 SHOULD propagate the route as a BGPsec update message containing the 610 BGPsec_Path attribute. 612 Note that removing BGPsec signatures (i.e., propagating a route 613 advertisement without the BGPsec_Path attribute) has significant 614 security ramifications. (See Section 7 for discussion of the 615 security ramifications of removing BGPsec signatures.) Therefore, 616 when a route advertisement is received via a BGPsec update message, 617 propagating the route advertisement without the BGPsec_Path attribute 618 is NOT RECOMMENDED, unless the message is sent to a peer that did not 619 advertise the capability to receive BGPsec update messages (see 620 Section 4.4). 622 Furthermore, note that when a BGPsec speaker propagates a route 623 advertisement with the BGPsec_Path attribute it is not attesting to 624 the validation state of the update message it received. (See Section 625 7 for more discussion of the security semantics of BGPsec 626 signatures.) 628 If the BGPsec speaker is producing an update message which would, in 629 the absence of BGPsec, contain an AS_SET (e.g., the BGPsec speaker is 630 performing proxy aggregation), then the BGPsec speaker MUST NOT 631 include the BGPsec_Path attribute. In such a case, the BGPsec 632 speaker must remove any existing BGPsec_Path in the received 633 advertisement(s) for this prefix and produce a traditional (non- 634 BGPsec) update message. It should be noted that BCP 172 [13] 635 recommends against the use of AS_SET and AS_CONFED_SET in the AS_PATH 636 of BGP updates. 638 To generate the BGPsec_Path attribute on the outgoing update message, 639 the BGPsec speaker first prepends a new Secure_Path Segment (places 640 in first position) to the Secure_Path. The AS number in this 641 Secure_Path segment MUST match the AS number in the AS number 642 resource extension field of the Resource PKI router certificate(s) 643 that will be used to verify the digital signature(s) constructed by 644 this BGPsec speaker[10]. 646 The pCount is typically set to the value 1. A BGPsec speaker may set 647 the pCount field to a value greater than 1. (See Section 4.1 for a 648 discussion of setting pCount to a value greater than 1.) 650 A route server that participates in the BGP control path, but does 651 not act as a transit AS in the data plane, may choose to set pCount 652 to 0. This option enables the route server to participate in BGPsec 653 and obtain the associated security guarantees without increasing the 654 effective length of the AS path. (Note that BGPsec speakers compute 655 the effective length of the AS path by summing the pCount values in 656 the BGPsec_Path attribute, see Section 5.) However, when a route 657 server sets the pCount value to 0, it still inserts its AS number 658 into the Secure_Path segment, as this information is needed to 659 validate the signature added by the route server. (See [18] for a 660 discussion of setting pCount to 0 to facilitate AS Number Migration.) 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. (That is, pCount is only to be set to zero in 664 cases such as route servers or AS Number Migration where the BGPsec 665 speaker's peer expects pCount to be set to zero.) 667 If the received BGPsec update message contains two Signature_ Blocks 668 and the BGPsec speaker supports both of the corresponding algorithms 669 suites, then the new update message generated by the BGPsec speaker 670 SHOULD include both of the Signature_Blocks. If the received BGPsec 671 update message contains two Signature_Blocks and the BGPsec speaker 672 only supports one of the two corresponding algorithm suites, then the 673 BGPsec speaker MUST remove the Signature_Block corresponding to the 674 algorithm suite that it does not understand. If the BGPsec speaker 675 does not support the algorithm suites in any of the Signature_Blocks 676 contained in the received update message, then the BGPsec speaker 677 MUST NOT propagate the route advertisement with the BGPsec_Path 678 attribute. (That is, if it chooses to propagate this route 679 advertisement at all, it must do so as an unsigned BGP update 680 message). 682 Note that in the case where the BGPsec_Path has two Signature_Blocks 683 (corresponding to different algorithm suites), the validation 684 algorithm (see Section 5.2) deems a BGPsec update message to be 685 'Valid' if there is at least one supported algorithm suite (and 686 corresponding Signature_Block) that is deemed 'Valid'. This means 687 that a 'Valid' BGPsec update message may contain a Signature_Block 688 which is not deemed 'Valid' (e.g., contains signatures that the 689 BGPsec does not successfully verify). Nonetheless, such 690 Signature_Blocks MUST NOT be removed. (See Section 7 for a 691 discussion of the security ramifications of this design choice.) 693 For each Signature_Block corresponding to an algorithm suite that the 694 BGPsec speaker does support, the BGPsec speaker adds a new Signature 695 Segment to the Signature_Block. This Signature Segment is prepended 696 to the list of Signature Segments (placed in the first position) so 697 that the list of Signature Segments appear in the same order as the 698 corresponding Secure_Path segments. The BGPsec speaker populates the 699 fields of this new signature segment as follows. 701 The Subject Key Identifier field in the new segment is populated with 702 the identifier contained in the Subject Key Identifier extension of 703 the RPKI router certificate corresponding to the BGPsec speaker [10]. 705 This Subject Key Identifier will be used by recipients of the route 706 advertisement to identify the proper certificate to use in verifying 707 the signature. 709 The Signature field in the new segment contains a digital signature 710 that binds the NLRI and BGPsec_Path attribute to the RPKI router 711 certificate corresponding to the BGPsec speaker. The digital 712 signature is computed as follows: 714 o Construct a sequence of octets by concatenating the Target AS 715 number, the Secure_Path segment that is being added by the BGPsec 716 speaker constructing the signature, and the signature field of the 717 most recent Signature Segment (the one corresponding to AS from 718 whom the BGPsec speaker's AS received the announcement). Note 719 that the Target AS number is the AS number announced by the peer 720 in the OPEN message of the BGP session within which the BGPsec 721 update message is sent. 723 Sequence of Octets to be Signed 724 +--------------------------------------+ 725 | Target AS Number (4 octets) | 726 +--------------------------------------+ 727 | Signer's AS Number (4 octets) | ---\ 728 +--------------------------------------+ \ 729 | pCount (1 octet) | > Secure_Path 730 +--------- ----------------------------+ / 731 | Flags (1 octet) | ---/ 732 +--------------------------------------+ 733 | Most Recent Sig Field (variable) | 734 +--------------------------------------+ 736 o Apply to this octet sequence the digest algorithm (for the 737 algorithm suite of this Signature_Block) to obtain a digest value. 739 o Apply to this digest value the signature algorithm, (for the 740 algorithm suite of this Signature_Block) to obtain the digital 741 signature. Then populate the Signature Field with this digital 742 signature. 744 The Signature Length field is populated with the length (in octets) 745 of the Signature field. 747 4.3. Processing Instructions for Confederation Members 749 Members of autonomous system confederations [5] MUST additionally 750 follow the instructions in this section for processing BGPsec update 751 messages. 753 When a confederation member sends a BGPsec update message to a peer 754 that is a member of the same confederation, the confederation member 755 puts its (private) Member-AS Number (as opposed to the public AS 756 Confederation Identifier) in the AS Number field of the Secure_Path 757 Segment that it adds to the BGPsec update message. Furthermore, when 758 a confederation member sends a BGPsec update message to a peer that 759 is a member of the same confederation, the BGPsec speaker that 760 generates the Secure_Path Segment sets the Confed_Segment flag to 761 one. This means that in a BGPsec update message, an AS number 762 appears in a Secure_Path Segment with the Confed_Segment flag set 763 whenever, in a non-BGPsec update message, the AS number would appear 764 in a segment of type AS_CONFED_SEQUENCE in a non-BGPsec update 765 message. 767 Within a confederation, the verification of BGPsec signatures added 768 by other members of the confederation is optional. If a 769 confederation chooses not to have its members verify signatures added 770 by other confederation members, then when sending a BGPsec update 771 message to a peer that is a member of the same confederation, the 772 confederation members MAY set the Signature field within the 773 Signature_Segment that it generates to be zero (in lieu of 774 calculating the correct digital signature as described in Sections 775 4.1 and 4.2). Note that if a confederation chooses not to verify 776 digital signatures within the confederation, then BGPsec is able to 777 provide no assurances about the integrity of the (private) Member-AS 778 Numbers placed in Secure_Path segments where the Confed_Segment flag 779 is set to one. 781 When a confederation member receives a BGPsec update message from a 782 peer within the confederation and propagates it to a peer outside the 783 confederation, it needs to remove all of the Secure_Path Segments 784 added by confederation members as well as the corresponding Signature 785 Segments. To do this, the confederation member propagating the route 786 outside the confederation does the following: 788 o First, starting with the most recently added Secure_Path segment, 789 remove all of the consecutive Secure_Path segments that have the 790 Confed_Segment flag set to one. Stop this process once a 791 Scure_Path segment is reached which has its Confed_Segment flag 792 set to zero. Keep a count of the number of segments removed in 793 this fashion. 795 o Second, starting with the most recently added Signature Segment, 796 remove a number of Signature Segments equal to the number of 797 Secure_Path Segments removed in the previous step. (That is, 798 remove the K most recently added signature segments, where K is 799 the number of Secure_Path Segments removed in the previous step.) 801 o Finally, add a Secure_Path Segment containing, in the AS field, 802 the AS Confederation Identifier (the public AS number of the 803 confederation) as well as a corresponding Signature Segment. Note 804 that all fields other that the AS field are populated as per 805 Sections 4.1 and 4.2. 807 When validating a received BGPsec update message, confederation 808 members need to make the following adjustment to the algorithm 809 presented in Section 5.2. When a confederation member processes 810 (validates) a Signature Segment and its corresponding Secure_Path 811 Segment, the confederation member must note the following. For a 812 signature produced by a peer BGPsec speaker outside of a 813 confederation, the Target AS will always be the AS Confederation 814 Identifier (the public AS number of the confederation) as opposed to 815 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. Typically, a BGPsec speaker will also wish to perform 916 origin validation (see [19] and [20]) on an incoming BGPsec update 917 message, but such validation is independent of the validation 918 described in this section. 920 Section 5.1 provides an overview of BGPsec validation and Section 5.2 921 provides a specific algorithm for performing such validation. (Note 922 that an implementation need not follow the specific algorithm in 923 Section 5.2 as long as the input/output behavior of the validation is 924 identical to that of the algorithm in Section 5.2.) During 925 exceptional conditions (e.g., the BGPsec speaker receives an 926 incredibly large number of update messages at once) a BGPsec speaker 927 MAY temporarily defer validation of incoming BGPsec update messages. 928 The treatment of such BGPsec update messages, whose validation has 929 been deferred, is a matter of local 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 examines the Signature_Blocks in the 1074 BGPsec_Path attribute. A Signature_Block corresponding to an 1075 algorithm suite that the BGPsec speaker does not support is not 1076 considered in validation. If there is no Signature_Block 1077 corresponding to an algorithm suite that the BGPsec speaker supports, 1078 then the BGPsec speaker MUST treat the update message in the same 1079 manner that the BGPsec speaker would treat an (unsigned) update 1080 message that arrived without a BGPsec_Path attribute. 1082 For each remaining Signature_Block (corresponding to an algorithm 1083 suite supported by the BGPsec speaker), the BGPsec speaker iterates 1084 through the Signature segments in the Signature_Block, starting with 1085 the most recently added segment (and concluding with the least 1086 recently added segment). Note that there is a one-to-one 1087 correspondence between Signature segments and Secure_Path segments 1088 within the BGPsec_Path attribute. The following steps make use of 1089 this correspondence. 1091 o (Step I): Locate the public key needed to verify the signature (in 1092 the current Signature segment). To do this, consult the valid 1093 RPKI router certificate data and look up all valid (AS, SKI, 1094 Public Key) triples in which the AS matches the AS number in the 1095 corresponding Secure_Path segment. Of these triples that match 1096 the AS number, check whether there is an SKI that matches the 1097 value in the Subject Key Identifier field of the Signature 1098 segment. If this check finds no such matching SKI value, then 1099 mark the entire Signature_Block as 'Not Valid' and proceed to the 1100 next Signature_Block. 1102 o (Step II): Compute the digest function (for the given algorithm 1103 suite) on the appropriate data. If the segment is not the (least 1104 recently added) segment corresponding to the origin AS, then the 1105 digest function should be computed on the following sequence of 1106 octets: 1108 Sequence of Octets to be Hashed 1110 +-------------------------------------------+ 1111 | AS Number of Target AS (4 octets) | 1112 +-------------------------------------------+ 1113 | AS Number (4 octets) | ---\ 1114 +-------------------------------------------+ \ 1115 | pCount (1 octet) | > Secure_Path 1116 +-------------------------------------------+ / 1117 | Flags (1 octet) | ---/ 1118 +-------------------------------------------+ 1119 | Sig Field in the Next Segment (variable) | 1120 +-------------- ----------------------------+ 1122 For the first segment to be processed (the most recently added 1123 segment), the 'AS Number of Target AS' is the AS number of the BGPsec 1124 speaker validating the update message. Note that if a BGPsec speaker 1125 uses multiple AS Numbers (e.g., the BGPsec speaker is a member of a 1126 confederation), the AS number used here MUST be the AS number 1127 announced in the OPEN message for the BGP session over which the 1128 BGPsec update was received. 1130 For each other Signature Segment, the 'AS Number of Target AS' is the 1131 AS number in the Secure_Path segment that corresponds to the 1132 Signature Segment added immediately after the one being processed. 1133 (That is, in the Secure_Path segment that corresponds to the 1134 Signature segment that the validator just finished processing.) 1136 The AS Number, pCount and Flags fields are taken from the Secure_Path 1137 segment that corresponds to the Signature segment currently being 1138 processed. The 'Signature Field in the Next Segment' is the 1139 Signature field found in the Signature segment that is next to be 1140 processed (that is, the next most recently added Signature Segment). 1142 Alternatively, if the segment being processed corresponds to the 1143 origin AS (i.e., if it is the least recently added segment), then the 1144 digest function should be computed on the following sequence of 1145 octets: 1147 Sequence of Octets to be Hashed 1148 +------------------------------------+ 1149 | AS Number of Target AS (4 octets) | 1150 +------------------------------------+ 1151 | Origin AS Number (4 octets) | ---\ 1152 +------------------------------------+ \ 1153 | pCount (1 octet) | > Secure_Path 1154 +------------------------------------+ / 1155 | Flags (1 octet) | ---/ 1156 +------------------------------------+ 1157 | Algorithm Suite Id. (1 octet) | 1158 +------------------------------------+ 1159 | NLRI Length (1 octet) | 1160 +------------------------------------+ 1161 | NLRI Prefix (variable) | 1162 +------------------------------------+ 1164 The NLRI Length, NLRI Prefix, and Algorithm Suite Identifier are all 1165 obtained in a straight forward manner from the NLRI of the update 1166 message or the BGPsec_Path attribute being validated. The Origin AS 1167 Number, pCount, and Flags fields are taken from the Secure_Path 1168 segment corresponding to the Signature Segment currently being 1169 processed. 1171 The 'AS Number of Target AS' is the AS Number from the Secure_Path 1172 segment that was added immediately after the Secure_Path segment 1173 containing the Origin AS Number. (That is, the Secure_Path segment 1174 corresponding to the Signature segment that the receiver just 1175 finished processing prior to the current Signature segment.) 1177 o (Step III): Use the signature validation algorithm (for the given 1178 algorithm suite) to verify the signature in the current segment. 1179 That is, invoke the signature validation algorithm on the 1180 following three inputs: the value of the Signature field in the 1181 current segment; the digest value computed in Step II above; and 1182 the public key obtained from the valid RPKI data in Step I above. 1183 If the signature validation algorithm determines that the 1184 signature is invalid, then mark the entire Signature_Block as 'Not 1185 Valid' and proceed to the next Signature_Block. If the signature 1186 validation algorithm determines that the signature is valid, then 1187 continue processing Signature Segments (within the current 1188 Signature_Block). 1190 If all Signature Segments within a Signature_Block pass validation 1191 (i.e., all segments are processed and the Signature_Block has not yet 1192 been marked 'Not Valid'), then the Signature_Block is marked as 1193 'Valid'. 1195 If at least one Signature_Block is marked as 'Valid', then the 1196 validation algorithm terminates and the BGPsec update message is 1197 deemed to be 'Valid'. (That is, if a BGPsec update message contains 1198 two Signature_Blocks then the update message is deemed 'Valid' if the 1199 first Signature_Block is marked 'Valid' OR the second Signature_Block 1200 is marked 'Valid'.) 1202 6. Algorithms and Extensibility 1204 6.1. Algorithm Suite Considerations 1206 Note that there is currently no support for bilateral negotiation 1207 (using BGP capabilities) between BGPsec peers to use of a particular 1208 (digest and signature) algorithm suite. This is because the algorithm 1209 suite used by the sender of a BGPsec update message must be 1210 understood not only by the peer to whom he is directly sending the 1211 message, but also by all BGPsec speakers to whom the route 1212 advertisement is eventually propagated. Therefore, selection of an 1213 algorithm suite cannot be a local matter negotiated by BGP peers, but 1214 instead must be coordinated throughout the Internet. 1216 To this end, a mandatory algorithm suites document will be created 1217 which specifies a mandatory-to-use 'current' algorithm suite for use 1218 by all BGPsec speakers [11]. 1220 It is anticipated that, in the future mandatory, the algorithm suites 1221 document will be updated to specify a transition from the 'current' 1222 algorithm suite to a 'new' algorithm suite. During the period of 1223 transition (likely a small number of years), all BGPsec update 1224 messages SHOULD simultaneously use both the 'current' algorithm suite 1225 and the 'new' algorithm suite. (Note that Sections 3 and 4 specify 1226 how the BGPsec_Path attribute can contain signatures, in parallel, 1227 for two algorithm suites.) Once the transition is complete, use of 1228 the old 'current' algorithm will be deprecated, use of the 'new' 1229 algorithm will be mandatory, and a subsequent 'even newer' algorithm 1230 suite may be specified as recommend to implement. Once the 1231 transition has successfully been completed in this manner, BGPsec 1232 speakers SHOULD include only a single Signature_Block (corresponding 1233 to the 'new' algorithm). 1235 6.2. Extensibility Considerations 1237 This section discusses potential changes to BGPsec that would require 1238 substantial changes to the processing of the BGPsec_Path and thus 1239 necessitate a new version of BGPsec. Examples of such changes 1240 include: 1242 o A new type of signature algorithm that produces signatures of 1243 variable length 1245 o A new type of signature algorithm for which the number of 1246 signatures in the Signature_Block is not equal to the number of 1247 ASes in the Secure_Path (e.g., aggregate signatures) 1249 o Changes to the data that is protected by the BGPsec signatures 1250 (e.g., attributes other than the AS path) 1252 In the case that such a change to BGPsec were deemed desirable, it is 1253 expected that a subsequent version of BGPsec would be created and 1254 that this version of BGPsec would specify a new BGP path attribute, 1255 let's call it BGPsec_PATH_TWO, which is designed to accommodate the 1256 desired changes to BGPsec. In such a case, the mandatory algorithm 1257 suites document would be updated to specify algorithm suites 1258 appropriate for the new version of BGPsec. 1260 At this point a transition would begin which is analogous to the 1261 algorithm transition discussed in Section 6.1. During the transition 1262 period all BGPsec speakers SHOULD simultaneously include both the 1263 BGPsec_Path attribute and the new BGPsec_PATH_TWO attribute. Once 1264 the transition is complete, the use of BGPsec_Path could then be 1265 deprecated, at which point BGPsec speakers SHOULD include only the 1266 new BGPsec_PATH_TWO attribute. Such a process could facilitate a 1267 transition to a new BGPsec semantics in a backwards compatible 1268 fashion. 1270 7. Security Considerations 1272 For a discussion of the BGPsec threat model and related security 1273 considerations, please see [14]. 1275 7.1 Security Guarantees 1277 When used in conjunction with Origin Validation (see [19] and [20]), 1278 a BGPsec speaker who receives a valid BGPsec update message, 1279 containing a route advertisement for a given prefix, is provided with 1280 the following security guarantees: 1282 o The origin AS number corresponds to an autonomous system that has 1283 been authorized, in the RPKI, by the IP address space holder to 1284 originate route advertisements for the given prefix. 1286 o For each AS in the path, a BGPsec speaker authorized by the holder 1287 of the AS number intentionally chose (in accordance with local 1288 policy) to propagate the route advertisement to the subsequent AS 1289 in the path. 1291 That is, the recipient of a valid BGPsec Update message is assured 1292 that the Secure_Path portion of the BGPsec_Path attribute corresponds 1293 to a sequence of autonomous systems who have all agreed in principle 1294 to forward packets to the given prefix along the indicated path. (It 1295 should be noted that BGPsec does not offer any guarantee that the 1296 data packets would flow along the indicated path; it only guarantees 1297 that the BGP update conveying the path indeed propagated along the 1298 indicated path.) Furthermore, the recipient is assured that this 1299 path terminates in an autonomous system that has been authorized by 1300 the IP address space holder as a legitimate destination for traffic 1301 to the given prefix. 1303 Note that although BGPsec provides a mechanism for an AS to validate 1304 that a received update message has certain security properties, the 1305 use of such a mechanism to influence route selection is completely a 1306 matter of local policy. Therefore, a BGPsec speaker can make no 1307 assumptions about the validity of a route received from an external 1308 BGPsec peer. That is, a compliant BGPsec peer may (depending on the 1309 local policy of the peer) send update messages that fail the validity 1310 test in Section 5. Thus, a BGPsec speaker MUST completely validate 1311 all BGPsec update messages received from external peers. (Validation 1312 of update messages received from internal peers is a matter of local 1313 policy, see Section 5). 1315 7.2 On the Removal of BGPsec Signatures 1317 There may be cases where a BGPsec speaker deems 'Valid' (as per the 1318 validation algorithm in Section 5.2) a BGPsec update message that 1319 contains both a 'Valid' and a 'Not Valid' Signature_Block. That is, 1320 the update message contains two sets of signatures corresponding to 1321 two algorithm suites, and one set of signatures verifies correctly 1322 and the other set of signatures fails to verify. In this case, the 1323 protocol specifies that a BGPsec speaker choosing to propagate the 1324 route advertisement in such an update message SHOULD add its 1325 signature to each of the Signature_Blocks. Thus the BGPsec speaker 1326 creates a signature using both algorithm suites and creates a new 1327 update message that contains both the 'Valid' and the 'Not Valid' set 1328 of signatures (from its own vantage point). 1330 To understand the reason for such a design decision consider the case 1331 where the BGPsec speaker receives an update message with both a set 1332 of algorithm A signatures which are 'Valid' and a set of algorithm B 1333 signatures which are 'Not Valid'. In such a case it is possible 1334 (perhaps even likely, depending on the state of the algorithm 1335 transition) that some of the BGPsec speaker's peers (or other 1336 entities further 'downstream' in the BGP topology) do not support 1337 algorithm A. Therefore, if the BGPsec speaker were to remove the 'Not 1338 Valid' set of signatures corresponding to algorithm B, such entities 1339 would treat the message as though it were unsigned. By including the 1340 'Not Valid' set of signatures when propagating a route advertisement, 1341 the BGPsec speaker ensures that 'downstream' entities have as much 1342 information as possible to make an informed opinion about the 1343 validation status of a BGPsec update. 1345 Note also that during a period of partial BGPsec deployment, a 1346 'downstream' entity might reasonably treat unsigned messages 1347 differently from BGPsec updates that contain a single set of 'Not 1348 Valid' signatures. That is, by removing the set of 'Not Valid' 1349 signatures the BGPsec speaker might actually cause a downstream 1350 entity to 'upgrade' the status of a route advertisement from 'Not 1351 Valid' to unsigned. Finally, note that in the above scenario, the 1352 BGPsec speaker might have deemed algorithm A signatures 'Valid' only 1353 because of some issue with RPKI state local to his AS (for example, 1354 his AS might not yet have obtained a CRL indicating that a key used 1355 to verify an algorithm A signature belongs to a newly revoked 1356 certificate). In such a case, it is highly desirable for a 1357 downstream entity to treat the update as 'Not Valid' (due to the 1358 revocation) and not as 'unsigned' (which would happen if the 'Not 1359 Valid' Signature_Blocks were removed). 1361 A similar argument applies to the case where a BGPsec speaker (for 1362 some reason such as lack of viable alternatives) selects as his best 1363 path (to a given prefix) a route obtained via a 'Not Valid' BGPsec 1364 update message. In such a case, the BGPsec speaker should propagate a 1365 signed BGPsec update message, adding his signature to the 'Not Valid' 1366 signatures that already exist. Again, this is to ensure that 1367 'downstream' entities are able to make an informed decision and not 1368 erroneously treat the route as unsigned. It should also be noted 1369 that due to possible differences in RPKI data observed at different 1370 vantage points in the network, a BGPsec update deemed 'Not Valid' at 1371 an upstream BGPsec speaker may be deemed 'Valid' by another BGP 1372 speaker downstream. 1374 Indeed, when a BGPsec speaker signs an outgoing update message, it is 1375 not attesting to a belief that all signatures prior to its are valid. 1376 Instead it is merely asserting that: 1378 o The BGPsec speaker received the given route advertisement with the 1379 indicated NLRI and Secure_Path; and 1381 o The BGPsec speaker chose to propagate an advertisement for this 1382 route to the peer (implicitly) indicated by the 'Target AS' 1384 7.3 Mitigation of Denial of Service Attacks 1386 The BGPsec update validation procedure is a potential target for 1387 denial of service attacks against a BGPsec speaker. Here we consider 1388 the mitigation only of denial of service attacks that are specific to 1389 BGPsec. 1391 To mitigate the effectiveness of such denial of service attacks, 1392 BGPsec speakers should implement an update validation algorithm that 1393 performs expensive checks (e.g., signature verification) after 1394 performing less expensive checks (e.g., syntax checks). The 1395 validation algorithm specified in Section 5.2 was chosen so as to 1396 perform checks which are likely to be expensive after checks that are 1397 likely to be inexpensive. However, the relative cost of performing 1398 required validation steps may vary between implementations, and thus 1399 the algorithm specified in Section 5.2 may not provide the best 1400 denial of service protection for all implementations. 1402 Additionally, sending update messages with very long AS paths (and 1403 hence a large number of signatures) is a potential mechanism to 1404 conduct denial of service attacks. For this reason, it is important 1405 that an implementation of the validation algorithm stops attempting 1406 to verify signatures as soon as an invalid signature is found. (This 1407 ensures that long sequences of invalid signatures cannot be used for 1408 denial of service attacks.) Furthermore, implementations can mitigate 1409 such attacks by only performing validation on update messages that, 1410 if valid, would be selected as the best path. That is, if an update 1411 message contains a route that would lose out in best path selection 1412 for other reasons (e.g., a very long AS path) then it is not 1413 necessary to determine the BGPsec-validity status of the route. 1415 7.4 Additional Security Considerations 1417 The mechanism of setting the pCount field to zero is included in this 1418 specification to enable route servers in the control path to 1419 participate in BGPsec without increasing the effective length of the 1420 AS-PATH. However, entities other than route servers could 1421 conceivably use this mechanism (set the pCount to zero) to attract 1422 traffic (by reducing the effective length of the AS-PATH) 1423 illegitimately. This risk is largely mitigated if every BGPsec 1424 speaker drops incoming update messages that set pCount to zero but 1425 come from a peer that is not a route server. However, note that a 1426 recipient of a BGPsec update message within which an upstream entity 1427 two or more hops away has set pCount to zero is unable to verify for 1428 themselves whether pCount was set to zero legitimately. 1430 BGPsec does not provide protection against attacks at the transport 1431 layer. As with any BGP session, an adversary on the path between a 1432 BGPsec speaker and its peer is able to perform attacks such as 1433 modifying valid BGPsec updates to cause them to fail validation, 1434 injecting (unsigned) BGP update messages without 1435 BGPsec_Path_Signature attributes, injecting BGPsec update messages 1436 with BGPsec_Path_Signature attributes that fail validation, or 1437 causing the peer to tear-down the BGP session. The use of BGPsec does 1438 nothing to increase the power of an on-path adversary -- in 1439 particular, even an on-path adversary cannot cause a BGPsec speaker 1440 to believe a BGPsec-invalid route is valid. However, as with any BGP 1441 session, BGPsec sessions SHOULD be protected by appropriate transport 1442 security mechanisms. 1444 8. IANA Considerations 1446 TBD: Need IANA to assign numbers for the two capabilities and the 1447 BGPsec_PATH attribute. 1449 This document does not create any new IANA registries. 1451 9. Contributors 1453 9.1. Authors 1455 Rob Austein 1456 Dragon Research Labs 1457 sra@hactrn.net 1459 Steven Bellovin 1460 Columbia University 1461 smb@cs.columbia.edu 1463 Randy Bush 1464 Internet Initiative Japan 1465 randy@psg.com 1467 Russ Housley 1468 Vigil Security 1469 housley@vigilsec.com 1471 Matt Lepinski 1472 BBN Technologies 1473 mlepinski.ietf@gmail.com 1475 Stephen Kent 1476 BBN Technologies 1477 kent@bbn.com 1479 Warren Kumari 1480 Google 1481 warren@kumari.net 1483 Doug Montgomery 1484 USA National Institute of Standards and Technology 1485 dougm@nist.gov 1487 Kotikalapudi Sriram 1488 USA National Institute of Standards and Technology 1489 kotikalapudi.sriram@nist.gov 1491 Samuel Weiler 1492 Sparta 1493 weiler+ietf@watson.org 1495 9.2. Acknowledgements 1497 The authors would like to thank Michael Baer, Luke Berndt, Sharon 1498 Goldberg, Ed Kern, Chris Morrow, Doug Maughan, Pradosh Mohapatra, 1499 Russ Mundy, Sandy Murphy, Keyur Patel, Mark Reynolds, Heather 1500 Schiller, Jason Schiller, John Scudder, Ruediger Volk and David Ward 1501 for their valuable input and review. 1503 10. Normative References 1505 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1506 Levels", BCP 14, RFC 2119, March 1997. 1508 [2] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border 1509 Gateway Protocol 4", RFC 4271, January 2006. 1511 [3] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 1512 "Multiprotocol Extensions for BGP-4", RFC 4760, January 2007. 1514 [4] Vohra, Q. and E. Chen, "BGP Support for Four-octet AS Number 1515 Space", RFC 4893, May 2007. 1517 [5] Traina, P., McPherson, D., and J. Scudder, "Autonomous System 1518 Confederations for BGP", RFC 5065, August 2007. 1520 [6] Scudder, J. and R. Chandra, "Capabilities Advertisement with 1521 BGP-4", RFC 5492, February 2009. 1523 [7] Lepinski, M. and S. Kent, "An Infrastructure to Support Secure 1524 Internet Routing", RFC 6480, February 2012. 1526 [8] Lepinski, M., Kent, S., and D. Kong, "A Profile for Route 1527 Origin Authorizations (ROAs)", RFC 6482, February 2012. 1529 [9] Patel, K., Ward, D., and R. Bush, "Extended Message support for 1530 BGP", draft-ietf-idr-bgp-extended-messages (work in progress), 1531 January 2015. 1533 [10] Reynolds, M., Turner, S., and S. Kent, "A Profile for BGPsec 1534 Router Certificates, Certificate Revocation Lists, and 1535 Certification Requests", draft-ietf-sidr-bgpsec-pki-profiles 1536 (work in progress), November 2014. 1538 [11] Turner, S., "BGP Algorithms, Key Formats, & Signature Formats", 1539 draft-ietf-sidr-bgpsec-algs (work in progress), July 2014. 1541 [12] Scudder, J., Chen, E., Mohapatra, P., and K. Patel, "Revised 1542 Error Handling for BGP UPDATE Messages", draft-ietf-idr-error- 1543 handling (work in progress), December 2014. 1545 11. Informative References 1547 [13] Kumari, W. and K. Sriram, "Recommendation for Not Using AS_SET 1548 and AS_CONFED_SET in BGP", RFC 6472, December 2011. 1550 [14] Kent, S. and A. Chi, "Threat Model for BGP Path Security", RFC 1551 7132, February 2014. 1553 [15] Bush, R. and R. Austein, "The Resource Public Key 1554 Infrastructure (RPKI) to Router Protocol", RFC 6810, January 1555 2013. 1557 [16] Bush, R., Patel, K., and S. Turner, "Router Key PDU for RPKI- 1558 Router Protocol", draft-ymbk-rpki-rtr-keys (work in progress), 1559 April 2013. 1561 [17] Bush, R., "BGPsec Operational Considerations", draft-ietf-sidr- 1562 bgpsec-ops (work in progress), May 2012. 1564 [18] George, W. and S. Murphy, "BGPsec Considerations for AS 1565 Migration", draft-ietf-sidr-as-migration (work in progress), 1566 July 2014. 1568 [19] Huston, G. and G. Michaelson, "Validation of Route Origination 1569 Using the Resource Certificate Public Key Infrastructure (PKI) 1570 and Route Origin Authorizations (ROAs)", RFC 6483, February 1571 2013. 1573 [20] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. Austein, 1574 "BGP Prefix Origin Validation", RFC 6811, January 2013. 1576 Author's Address 1578 Matthew Lepinski (editor) 1579 BBN Technologies 1580 10 Moulton St 1581 Cambridge, MA 55409 1582 US 1584 Phone: +1 617 873 5939 1585 Email: mlepinski.ietf@gmail.com