idnits 2.17.1 draft-ietf-sidr-bgpsec-protocol-07.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 (February 25, 2013) is 4071 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) == Unused Reference: '15' is defined on line 1534, but no explicit reference was found in the text ** Obsolete normative reference: RFC 4893 (ref. '4') (Obsoleted by RFC 6793) ** Downref: Normative reference to an Informational RFC: RFC 6480 (ref. '7') -- Possible downref: Non-RFC (?) normative reference: ref. '9' -- Possible downref: Non-RFC (?) normative reference: ref. '10' -- Possible downref: Non-RFC (?) normative reference: ref. '11' Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 4 comments (--). 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 February 25, 2013 5 Expires: August 25, 2013 7 BGPSEC Protocol Specification 8 draft-ietf-sidr-bgpsec-protocol-07 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 April 25, 2013. 44 Copyright Notice 46 Copyright (c) 2012 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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 62 2. BGPSEC Negotiation . . . . . . . . . . . . . . . . . . . . . . 3 63 2.1. BGPSEC Send Capability . . . . . . . . . . . . . . . . . . 3 64 2.2. BGPSEC Receive Capability . . . . . . . . . . . . . . . . 4 65 2.3. Negotiating BGPSEC Support . . . . . . . . . . . . . . . . 5 66 3. The BGPSEC_Path Attribute . . . . . . . . . . . . . . . . . . 6 67 3.1. Secure_Path . . . . . . . . . . . . . . . . . . . . . . . 8 68 3.2. Signature_Block . . . . . . . . . . . . . . . . . . . . . 9 69 4. Generating a BGPSEC Update . . . . . . . . . . . . . . . . . . 11 70 4.1. Originating a New BGPSEC Update . . . . . . . . . . . . . 12 71 4.2. Propagating a Route Advertisement . . . . . . . . . . . . 14 72 4.3. Processing Instructions for Confederation Members . . . . 18 73 4.4. Reconstructing the AS_PATH Attribute . . . . . . . . . . . 20 74 5. Processing a Received BGPSEC Update . . . . . . . . . . . . . 21 75 5.1. Overview of BGPSEC Validation . . . . . . . . . . . . . . 23 76 5.2. Validation Algorithm . . . . . . . . . . . . . . . . . . . 24 77 6. Algorithms and Extensibility . . . . . . . . . . . . . . . . . 28 78 6.1. Algorithm Suite Considerations . . . . . . . . . . . . . . 28 79 6.2. Extensibility Considerations . . . . . . . . . . . . . . . 28 80 7. Security Considerations . . . . . . . . . . . . . . . . . . . 29 81 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 82 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 32 83 9.1. Authors . . . . . . . . . . . . . . . . . . . . . . . . . 32 84 9.2. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 34 85 10. Normative References . . . . . . . . . . . . . . . . . . . . . 34 86 11. Informative References . . . . . . . . . . . . . . . . . . . . 35 87 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 35 89 1. Introduction 91 This document describes BGPSEC, a mechanism for providing path 92 security for Border Gateway Protocol (BGP) [2] route advertisements. 93 That is, a BGP speaker who receives a valid BGPSEC update has 94 cryptographic assurance that the advertised route has the following 95 two properties: 97 1. The route was originated by an AS that has been explicitly 98 authorized by the holder of the IP address prefix to originate 99 route advertisements for that prefix. 101 2. Every AS on the path of ASes through which the update message 102 passes has explicitly authorized the advertisement of the route 103 to the subsequent AS in the path. 105 This document specifies a new optional (non-transitive) BGP path 106 attribute, BGPSEC_Path. It also describes how a BGPSEC-compliant BGP 107 speaker (referred to hereafter as a BGPSEC speaker) can generate, 108 propagate, and validate BGP update messages containing this attribute 109 to obtain the above assurances. 111 BGPSEC relies on the Resource Public Key Infrastructure (RPKI) 112 certificates that attest to the allocation of AS number and IP 113 address resources. (For more information on the RPKI, see [7] and 114 the documents referenced therein.) Any BGPSEC speaker who wishes to 115 send BGP update messages to external peers (eBGP) containing the 116 BGPSEC_Path needs to have the private key associated with an RPKI 117 router certificate [10] that corresponds to the BGPSEC speaker's AS 118 number. Note, however, that a BGPSEC speaker does not need such a 119 certificate in order to validate update messages containing the 120 BGPSEC_Path attribute. 122 2. BGPSEC Negotiation 124 This document defines a new BGP capability [6] that allows a BGP 125 speaker to advertise to a neighbor the ability to send or to receive 126 BGPSEC update messages (i.e., update messages containing the 127 BGPSEC_Path attribute). 129 2.1. The BGPSEC Capability 131 This capability has capability code : TBD 133 The capability length for this capability MUST be set to 3. 135 The three octets of the capability value are specified as follows. 137 BGPSEC Send Capability Value: 139 0 1 2 3 4 5 6 7 140 +---------------------------------------+ 141 | Version | Dir | Reserved | 142 +---------------------------------------+ 143 | | 144 +------ AFI -----+ 145 | | 146 +---------------------------------------+ 148 The first four bits of the first octet indicate the version of BGPSEC 149 for which the BGP speaker is advertising support. This document 150 defines only BGPSEC version 0 (all four bits set to zero). Other 151 versions of BGPSEC may be defined in future documents. A BGPSEC 152 speaker MAY advertise support for multiple versions of BGPSEC by 153 including multiple versions of the BGPSEC capability in its BGP OPEN 154 message. 156 The fifth bit of the first octet is a direction bit which indicates 157 whether the BGP speaker is advertising the capability to send BGPSEC 158 update message or receive BGPSEC update messages. The BGP speaker 159 sets this bit to 0 to indicate the capability to receive BGPSEC 160 update messages. The BGP speaker sets this bit to 1 to indicate the 161 capability to send BGPSEC update messages. 163 The remaining three bits of the first octet are reserved for future 164 use. These bits are set to zero by the sender of the capability and 165 ignored by the receiver of the capability. 167 The second and third octets contain the 16-bit Address Family 168 Identifier (AFI) which indicates the address family for which the 169 BGPSEC speaker is advertising support for BGPSEC. This document only 170 specifies BGPSEC for use with two address families, IPv4 and IPv6, 171 AFI values 1 and 2 respectively. BGPSEC for use with other address 172 families may be specified in future documents. 174 2.2. Negotiating BGPSEC Support 176 In order to indicate that a BGP speaker is willing to send BGPSEC 177 update messages (for a particular address family), a BGP speaker 178 sends the BGPSEC Capability (see Section 2.1) with the Direction bit 179 (the fifth bit of the first octet) set to 1. In order to indicate 180 that the speaker is willing to receive BGP update messages containing 181 the BGPSEC_Path attribute (for a particular address family), a BGP 182 speaker sends the BGPSEC capability with the Direction bit set to 0. 183 In order to advertise the capability to both send and receive BGPSEC 184 update messages, the BGP speaker sends two copies of the BGPSEC 185 capability (one with the direction bit set to 0 and one with the 186 direction bit set to 1). 188 Similarly, if a BGP speaker wishes to use BGPSEC with two different 189 address families (i.e., IPv4 and IPv6) over the same BGP session, 190 then the speaker includes two instances of this capability (one for 191 each address family) in the BGP OPEN message. A BGP speaker SHOULD 192 NOT advertise the capability of BGPSEC support for a particular AFI 193 unless it has also advertised the multiprotocol extension capability 194 for the same AFI combination [3]. 196 In a session where BGP session, a peer is permitted to send update 197 messages containing the BGPSEC_Path attribute if, and only if: 199 o The given peer has sent the BGPSEC capability for a particular 200 version of BGPSEC and a particular address family with the 201 Direction bit set to 1; and 203 o The other peer has sent the BGPSEC capability for the same version 204 of BGPSEC and the same address family with the Direction bit set 205 to 0. 207 In such a session, we say that the use of (the particular version of) 208 BGPSEC has been negotiated (for a particular address family). BGP 209 update messages without the BGPSEC_PATH attribute MAY be sent within 210 a session regardless of whether or not the use of BGPSEC is 211 successfully negotiated. However, if BGPSEC is not successfully 212 negotiated, then BGP update messages containing the BGPSEC_PATH 213 attribute MUST NOT be sent. 215 This document defines the behavior of implementations in the case 216 where BGPSEC version zero is the only version that has been 217 successfully negotiated. If there exist multiple versions have 218 BGPSEC that are negotiated for a particular session, the behavior of 219 the peers (e.g., which version of BGPSEC shall actually be used) will 220 be specified in a future document. 222 BGPSEC cannot provide meaningful security guarantees without support 223 for four-byte AS numbers. Therefore, any BGP speaker that announces 224 the BGPSEC capability, MUST also announce the capability for four- 225 byte AS support [4]. If a BGP speaker sends the BGPSEC capability 226 but not the four-byte AS support capability then BGPSEC has not been 227 successfully negotiated, and update messages containing the 228 BGPSEC_Path attribute MUST NOT be sent within such a session. 230 Note that BGPSEC update messages can be quite large, therefore any 231 BGPSEC speaker announcing the capability to receive BGPSEC messages 232 SHOULD also announce support for the capability to receive BGP 233 extended messages [9]. 235 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 this information. We 246 refer to those update messages that contain the BGPSEC_Path attribute 247 as "BGPSEC Update messages". The BGPSEC_Path attribute replaces the 248 AS_PATH attribute in a BGPSEC update message. That is, update 249 messages that contain the BGPSEC_Path attribute MUST NOT contain the 250 AS_PATH attribute, and vice versa. 252 The BGPSEC_Path attribute is made up of several parts. The following 253 high-level diagram provides an overview of the structure of the 254 BGPSEC_Path attribute: 256 High-Level Diagram of the BGPSEC_Path Attribute 257 +---------------------------------------------------------+ 258 | +-----------------+ | 259 | | Secure Path | | 260 | +-----------------+ | 261 | | AS X | | 262 | | pCount X | | 263 | | Flags X | | 264 | | AS Y | | 265 | | pCount Y | | 266 | | Flags Y | | 267 | | ... | | 268 | +-----------------+ | 269 | | 270 | +-----------------+ +-----------------+ | 271 | | Sig Block 1 | | Sig Block 2 | | 272 | +-----------------+ +-----------------+ | 273 | | Alg Suite 1 | | Alg Suite 2 | | 274 | | SKI X1 | | SKI X1 | | 275 | | Signature X1 | | Signature X1 | | 276 | | SKI Y1 | | SKI Y1 | | 277 | | Signature Y1 | | Signature Y1 | | 278 | | ... | | .... | | 279 | +-----------------+ +-----------------+ | 280 | | 281 +---------------------------------------------------------+ 283 The following is the specification of the format for the BGPSEC_Path 284 attribute. 286 BGPSEC_Path Attribute 288 +-------------------------------------------------------+ 289 | Secure_Path (variable) | 290 +-------------------------------------------------------+ 291 | Sequence of one or two Signature_Blocks (variable) | 292 +-------------------------------------------------------+ 294 The Secure_Path contains AS path information for the BGPSEC update 295 message. This is logically equivalent to the information that is 296 contained in a non-BGPSEC AS_PATH attribute. A BGPSEC update message 297 containing the BGPSEC_PATH attribute MUST NOT contain the AS_PATH 298 attribute. The Secure_Path is used by BGPSEC speakers in the same 299 way that information from the AS_PATH is used by non-BGPSEC speakers. 300 The format of the Secure_Path is described below in Section 3.1. 302 The BGPSEC_Path attribute will contain one or two Signature_Blocks, 303 each of which corresponds to a different algorithm suite. Each of 304 the Signature_Blocks will contain a signature segment for one AS 305 number (i.e, secure path segment) in the Secure_Path. In the most 306 common case, the BGPSEC_Path attribute will contain only a single 307 Signature_Block. However, in order to enable a transition from an 308 old algorithm suite to a new algorithm suite (without a flag day), it 309 will be necessary to include two Signature_Blocks (one for the old 310 algorithm suite and one for the new algorithm suite) during the 311 transition period. (See Section 6.1 for more discussion of algorithm 312 transitions.) The format of the Signature_Blocks is described below 313 in Section 3.2. 315 3.1. Secure_Path 317 Here we provide a detailed description of the Secure_Path information 318 in the BGPSEC_Path attribute. 320 Secure_Path 322 +-----------------------------------------------+ 323 | Secure_Path Length (2 octets) | 324 +-----------------------------------------------+ 325 | One or More Secure_Path Segments (variable) | 326 +-----------------------------------------------+ 328 The Secure_Path Length contains the length (in octets) of the entire 329 Secure_Path (including the two octets used to express this length 330 field). As explained below, each Secure_Path segment is six octets 331 long. Note that this means the Secure_Path Length is two greater 332 than six times the number Secure_Path Segments (i.e., the number of 333 AS numbers in the path). 335 The Secure_Path contains one Secure_Path Segment for each (distinct) 336 Autonomous System in the path to the originating AS of the NLRI 337 specified in the update message. 339 Secure_Path Segment 341 +----------------------------+ 342 | AS Number (4 octets) | 343 +----------------------------+ 344 | pCount (1 octet) | 345 +----------------------------+ 346 | Flags (1 octet) | 347 +----------------------------+ 349 The AS Number is the AS number of the BGP speaker that added this 350 Secure_Path segment to the BGPSEC_Path attribute. (See Section 4 for 351 more information on populating this field.) 353 The pCount field contains the number of repetitions of the associated 354 autonomous system number that the signature covers. This field 355 enables a BGPSEC speaker to mimic the semantics of prepending 356 multiple copies of their AS to the AS_PATH without requiring the 357 speaker to generate multiple signatures. 359 The first bit of the Flags field is the Confed_Segment flag. The 360 Confed_Segment flag is set to one to indicate that the BGPSEC speaker 361 that constructed this Secure_Path segment is sending the update 362 message to a peer AS within the same Autonomous System confederation 363 [5]. (That is, the Confed_Segment flag is set in a BGPSEC update 364 message whenever in a non-BGPSEC update message the BGP speaker's AS 365 would appear in a AS_PATH segment of type AS_CONFED_SEQUENCE.) In 366 all other cases the Confed_Segment flag is set to zero. 368 The remaining seven bits of the Flags MUST be set to zero by the 369 sender, and ignored by the receiver. Note, however, that the 370 signature is computed over all eight bits of the flags field. 372 3.2. Signature_Block 374 Here we provide a detailed description of the Signature_Blocks in the 375 BGPSEC_Path attribute. 377 Signature_Block 379 +---------------------------------------------+ 380 | Signature_Block Length (2 octets) | 381 +---------------------------------------------+ 382 | Algorithm Suite Identifier (1 octet) | 383 +---------------------------------------------+ 384 | Sequence of Signature Segments (variable) | 385 +---------------------------------------------+ 387 The Signature_Block Length is the total number of octets in the 388 Signature_Block (including the two octets used to express this length 389 field). 391 The Algorithm Suite Identifier is a one-octet identifier specifying 392 the digest algorithm and digital signature algorithm used to produce 393 the digital signature in each Signature Segment. An IANA registry of 394 algorithm identifiers for use in BGPSEC is created in the BGPSEC 395 algorithms document[11]. 397 A Signature_Block has exactly one Signature Segment for each 398 Secure_Path Segment in the Secure_Path portion of the BGPSEC_Path 399 Attribute. (That is, one Signature Segment for each distinct AS on 400 the path for the NLRI in the Update message.) 402 Signature Segments 403 +---------------------------------------------+ 404 | Subject Key Identifier (20 octets) | 405 +---------------------------------------------+ 406 | Signature Length (2 octets) | 407 +---------------------------------------------+ 408 | Signature (variable) | 409 +---------------------------------------------+ 411 The Subject Key Identifier contains the value in the Subject Key 412 Identifier extension of the RPKI router certificate [10] that is used 413 to verify the signature (see Section 5 for details on validity of 414 BGPSEC update messages). 416 The Signature Length field contains the size (in octets) of the value 417 in the Signature field of the Signature Segment. 419 The Signature contains a digital signature that protects the NLRI and 420 the BGPSEC_Path attribute (see Sections 4 and 5 for details on 421 signature generation and validation, respectively). 423 4. Generating a BGPSEC Update 425 Sections 4.1 and 4.2 cover two cases in which a BGPSEC speaker may 426 generate an update message containing the BGPSEC_Path attribute. The 427 first case is that in which the BGPSEC speaker originates a new route 428 advertisement (Section 4.1). That is, the BGPSEC speaker is 429 constructing an update message in which the only AS to appear in the 430 BGPSEC_Path is the speaker's own AS. The second case is that in 431 which the BGPSEC speaker receives a route advertisement from a peer 432 and then decides to propagate the route advertisement to an external 433 (eBGP) peer (Section 4.2). That is, the BGPSEC speaker has received 434 a BGPSEC update message and is constructing a new update message for 435 the same NLRI in which the BGPSEC_Path attribute will contain AS 436 number(s) other than the speaker's own AS. 438 The remaining case is where the BGPSEC speaker sends the update 439 message to an internal (iBGP) peer. When originating a new route 440 advertisement and sending it to an internal peer, the BGPSEC speaker 441 creates a new BGPSEC_Path attribute with zero Secure_Path segments 442 and zero Signature Segments. 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 4.1. Originating a New BGPSEC Update 482 In an update message that originates a new route advertisement (i.e., 483 an update whose path will contain only a single AS number), when 484 sending the route advertisement to an external, BGPSEC-speaking peer, 485 the BGPSEC speaker creates a new BGPSEC_Path attribute as follows. 487 First, the BGPSEC speaker constructs the Secure_Path with a single 488 Secure_Path Segment. The AS in this path is the BGPSEC speaker's own 489 AS number. In particular, this AS number MUST match an AS number in 490 the AS number resource extension field of the Resource PKI router 491 certificate(s) [10] that will be used to verify the digital 492 signature(s) constructed by this BGPSEC speaker. 494 The BGPSEC_Path attribute and the AS_Path attribute are mutually 495 exclusive. That is, any update message containing the BGPSEC_Path 496 attribute MUST NOT contain the AS_Path attribute. The information 497 that would be contained in the AS_Path attribute is instead conveyed 498 in the Secure_Path portion of the BGPSEC_Path attribute. 500 The Resource PKI enables the legitimate holder of IP address 501 prefix(es) to issue a signed object, called a Route Origination 502 Authorization (ROA), that authorizes a given AS to originate routes 503 to a given set of prefixes (see [8]). Note that validation of a 504 BGPSEC update message will fail (i.e., the validation algorithm, 505 specified in Section 5.2, returns 'Not Valid') unless there exists a 506 valid ROA authorizing the first AS in the Secure_Path portion of the 507 BGPSEC_Path attribute to originate routes to the prefix being 508 advertised. Therefore, a BGPSEC speaker SHOULD NOT originate a 509 BGPSEC update advertising a route for a given prefix unless there 510 exists a valid ROA authorizing the BGPSEC speaker's AS to originate 511 routes to this prefix. 513 The pCount field of the Secure_Path Segment is typically set to the 514 value 1. However, a BGPSEC speaker may set the pCount field to a 515 value greater than 1. Setting the pCount field to a value greater 516 than one has the same semantics as repeating an AS number multiple 517 times in the AS_PATH of a non-BGPSEC update message (e.g., for 518 traffic engineering purposes). Setting the pCount field to a value 519 greater than one permits this repetition without requiring a separate 520 digital signature for each repetition. 522 If the BGPSEC speaker is not a member of an autonomous system 523 confederation [5], then the Flags field of the Secure_Path Segment 524 MUST be set to zero. (Members of a confederation should follow the 525 special processing instructions for confederation members in Section 526 4.4.) 528 Typically, a BGPSEC speaker will use only a single algorithm suite, 529 and thus create only a single Signature_Block in the BGPSEC_Path 530 attribute. However, to ensure backwards compatibility during a 531 period of transition from a 'current' algorithm suite to a 'new' 532 algorithm suite, it will be necessary to originate update messages 533 that contain a Signature_Block for both the 'current' and the 'new' 534 algorithm suites (see Section 6.1). 536 When originating a new route advertisement, each Signature_Block MUST 537 consist of a single Signature Segment. The following describes how 538 the BGPSEC speaker populates the fields of the Signature_Block. 540 The Subject Key Identifier field (see Section 3) is populated with 541 the identifier contained in the Subject Key Identifier extension of 542 the RPKI router certificate corresponding to the BGPSEC speaker[10]. 543 This Subject Key Identifier will be used by recipients of the route 544 advertisement to identify the proper certificate to use in verifying 545 the signature. 547 The Signature field contains a digital signature that binds the NLRI 548 and BGPSEC_Path attribute to the RPKI router corresponding to the 549 BGPSEC speaker. The digital signature is computed as follows: 551 o Construct a sequence of octets by concatenating the Target AS 552 Number, the Secure_Path (Origin AS, pCount, and Flags), Algorithm 553 Suite Identifier, and NLRI. The Target AS Number is the AS to 554 whom the BGPSEC speaker intends to send the update message. (Note 555 that the Target AS number is the AS number announced by the peer 556 in the OPEN message of the BGP session within which the update is 557 sent.) 558 Sequence of Octets to be Signed 559 +------------------------------------+ 560 | Target AS Number (4 octets) | 561 +------------------------------------+ 562 | Origin AS Number (4 octets) | ---\ 563 +------------------------------------+ \ 564 | pCount (1 octet) | > Secure_Path 565 +------------------------------------+ / 566 | Flags (1 octet) | ---/ 567 +------------------------------------+ 568 | Algorithm Suite Id. (1 octet) | 569 +------------------------------------+ 570 | NLRI Length (1 octet) | 571 +------------------------------------+ 572 | NLRI Prefix (variable) | 573 +------------------------------------+ 575 o Apply to this octet sequence the digest algorithm (for the 576 algorithm suite of this Signature_Block) to obtain a digest value. 578 o Apply to this digest value the signature algorithm, (for the 579 algorithm suite of this Signature_Block) to obtain the digital 580 signature. Then populate the Signature Field with this digital 581 signature. 583 The Signature Length field is populated with the length (in octets) 584 of the Signature field. 586 4.2. Propagating a Route Advertisement 588 When a BGPSEC speaker receives a BGPSEC update message containing a 589 BGPSEC_Path attribute (with one or more signatures) from an (internal 590 or external) peer, it may choose to propagate the route advertisement 591 by sending to its (internal or external) peers by creating a new 592 BGPSEC advertisement for the same prefix. 594 If a BGPSEC router has received only a non-BGPSEC update message 595 (without the BGPSEC_Path attribute), containing the AS_Path 596 attribute, from a peer for a given prefix and if it chooses to 597 propagate that peer's route for the prefix, then it MUST NOT attach 598 any BGPSEC_Path attribute to the corresponding update being 599 propagated. (Note that a BGPSEC router may also receive a non-BGPSEC 600 update message from an internal peer without the AS_Path attribute, 601 i.e., with just the NLRI in it. In that case, the prefix is 602 originating from that AS and hence the BGPSEC speaker SHOULD sign and 603 forward the update to its external peers, as specified in Section 604 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. However, the BGPSEC speaker MAY propagate the 610 route as a (unsigned) BGP update message without the BGPSEC_Path 611 attribute. 613 Note that removing BGPSEC signatures (i.e., propagating a route 614 advertisement without the BGPSEC_Path attribute) has significant 615 security ramifications. (See Section 7 for discussion of the 616 security ramifications of removing BGPSEC signatures.) Therefore, 617 when a route advertisement is received via a BGPSEC update message, 618 propagating the route advertisement without the BGPSEC_Path attribute 619 is NOT RECOMMENDED, unless the message is sent to a peer that did not 620 advertise the capability to receive BGPSEC update messages (see 621 Section 4.4). 623 Furthermore, note that when a BGPSEC speaker propagates a route 624 advertisement with the BGPSEC_Path attribute it is not attesting to 625 the validation state of the update message it received. (See Section 626 7 for more discussion of the security semantics of BGPSEC 627 signatures.) 629 If the BGPSEC speaker is producing an update message which would, in 630 the absence of BGPSEC, contain an AS_SET (e.g., the BGPSEC speaker is 631 performing proxy aggregation), then the BGPSEC speaker MUST NOT 632 include the BGPSEC_Path attribute. In such a case, the BGPSEC 633 speaker must remove any existing BGPSEC_Path in the received 634 advertisement(s) for this prefix and produce a standard (non-BGPSEC) 635 update message. It should be noted that BCP 172 [12] recommends 636 against the use of AS_SET and AS_CONFED_SET in AS_PATH in BGP 637 updates. 639 To generate the BGPSEC_Path attribute on the outgoing update message, 640 the BGPSEC speaker first prepends a new Secure_Path Segment (places 641 in first position) to the Secure_Path. The AS number in this 642 Secure_Path segment MUST match the AS number in the AS number 643 resource extension field of the Resource PKI router certificate(s) 644 that will be used to verify the digital signature(s) constructed by 645 this BGPSEC speaker[10]. 647 The pCount is typically set to the value 1. A BGPSEC speaker may set 648 the pCount field to a value greater than 1. (See Section 4.1 for a 649 discussion of setting pCount to a value greater than 1.) A route 650 server that participates in the BGP control path, but does not act as 651 a transit AS in the data plane, may choose to set pCount to 0. This 652 option enables the route server to participate in BGPSEC and obtain 653 the associated security guarantees without increasing the effective 654 length of the AS path. (Note that BGPSEC speakers compute the 655 effective length of the AS path by summing the pCount values in the 656 BGPSEC_Path attribute, see Section 5.) However, when a route server 657 sets the pCount value to 0, it still inserts its AS number into the 658 Secure_Path segment, as this information is needed to validate the 659 signature added by the route server. Note that the option of setting 660 pCount to 0 is intended only for use by route servers that desire not 661 to increase the effective AS-PATH length of routes they advertise. 662 The pCount field SHOULD NOT be set to 0 in other circumstances. 663 BGPSEC speakers SHOULD drop incoming update messages with pCount set 664 to zero in cases where the BGPSEC speaker does not expect its peer to 665 set pCount to zero (i.e., cases where the peer is not acting as a 666 route server). 668 If the BGPSEC speaker is not a member of an autonomous system 669 confederation [5], then the Confed_Segment bit of the Flags field of 670 the Secure_Path Segment MUST be set to zero. (Members of a 671 confederation should follow the special processing instructions for 672 confederation members in Section 4.3.) 674 If the received BGPSEC update message contains two Signature_ Blocks 675 and the BGPSEC speaker supports both of the corresponding algorithms 676 suites, then the new update message generated by the BGPSEC speaker 677 SHOULD include both of the Signature_Blocks. If the received BGPSEC 678 update message contains two Signature_Blocks and the BGPSEC speaker 679 only supports one of the two corresponding algorithm suites, then the 680 BGPSEC speaker MUST remove the Signature_Block corresponding to the 681 algorithm suite that it does not understand. If the BGPSEC speaker 682 does not support the algorithm suites in any of the Signature_Blocks 683 contained in the received update message, then the BGPSEC speaker 684 MUST NOT propagate the route advertisement with the BGPSEC_Path 685 attribute. (That is, if it chooses to propagate this route 686 advertisement at all, it must do so as an unsigned BGP update 687 message). 689 Note that in the case where there are two Signature_Blocks 690 (corresponding to different algorithm suites) that the validation 691 algorithm (see Section 5.2) deems a BGPSEC update message to be 692 'Valid' if there is at least one supported algorithm suite (and 693 corresponding Signature_Block) that is deemed 'Valid'. This means 694 that a 'Valid' BGPSEC update message may contain a Signature_Block 695 which is not deemed 'Valid' (e.g., contains signatures that the 696 BGPSEC does not successfully verify). Nonetheless, such 697 Signature_Blocks MUST NOT be removed. (See Section 7 for a 698 discussion of the security ramifications of this design choice.) 700 For each Signature_Block corresponding to an algorithm suite that the 701 BGPSEC speaker does support, the BGPSEC speaker then adds a new 702 Signature Segment to the Signature_Block. This Signature Segment is 703 prepended to the list of Signature Segments (placed in the first 704 position) so that the list of Signature Segments appears in the same 705 order as the corresponding Secure_Path segments in the Secure_Path 706 portion of the BGPSEC_Path attribute. The BGPSEC speaker populates 707 the fields of this new signature segment as follows. 709 The Subject Key Identifier field in the new segment is populated with 710 the identifier contained in the Subject Key Identifier extension of 711 the RPKI router corresponding to the BGPSEC speaker[10]. This 712 Subject Key Identifier will be used by recipients of the route 713 advertisement to identify the proper certificate to use in verifying 714 the signature. 716 The Signature field in the new segment contains a digital signature 717 that binds the NLRI and BGPSEC_Path attribute to the RPKI router 718 certificate corresponding to the BGPSEC speaker. The digital 719 signature is computed as follows: 721 o Construct a sequence of octets by concatenating the Target AS 722 number, the Secure_Path segment that is being added by the BGPSEC 723 speaker constructing the signature, and the signature field of the 724 most recent Signature Segment (the one corresponding to AS from 725 whom the BGPSEC speaker's AS received the announcement). Note 726 that the Target AS number is the AS number announced by the peer 727 in the OPEN message of the BGP session within which the BGPSEC 728 update message is sent. 730 Sequence of Octets to be Signed 731 +--------------------------------------+ 732 | Target AS Number (4 octets) | 733 +--------------------------------------+ 734 | Signer's AS Number (4 octets) | ---\ 735 +--------------------------------------+ \ 736 | pCount (1 octet) | > Secure_Path 737 +--------- ----------------------------+ / 738 | Flags (1 octet) | ---/ 739 +--------------------------------------+ 740 | Most Recent Sig Field (variable) | 741 +--------------------------------------+ 743 o Apply to this octet sequence the digest algorithm (for the 744 algorithm suite of this Signature_Block) to obtain a digest value. 746 o Apply to this digest value the signature algorithm, (for the 747 algorithm suite of this Signature_Block) to obtain the digital 748 signature. Then populate the Signature Field with this digital 749 signature. 751 The Signature Length field is populated with the length (in octets) 752 of the Signature field. 754 4.3. Processing Instructions for Confederation Members 756 Members of autonomous system confederations [5] MUST additionally 757 follow the instructions in this section for processing BGPSEC update 758 messages. 760 When a confederation member sends a BGPSEC update message to a peer 761 that is a member of the same confederation, the confederation member 762 puts its (private) Member-AS Number (as opposed to the public AS 763 Confederation Identifier) in the AS Number field of the Secure_Path 764 Segment that it adds to the BGPSEC update message. Furthermore, when 765 a confederation member sends a BGPSEC update message to a peer that 766 is a member of the same confederation, the BGPSEC speaker that 767 generates the Secure_Path Segment sets the Confed_Segment flag to 768 one. Note that this means that in a BGPSEC update message, an AS 769 number appears in a Secure_Path Segment with the Confed_Segment flag 770 set to one, in precisely those circumstances where the AS number 771 would appear in a segment of type AS_CONFED_SEQUENCE in a non-BGPSEC 772 update message. 774 Within a confederation, the verification of BGPSEC signatures added 775 by other members of the confederation is optional. If a 776 confederation chooses to have its members not verify signatures added 777 by other confederation members, then when sending a BGPSEC update 778 message to a peer that is a member of the same confederation, the 779 confederation MAY set the Signature field within the 780 Signature_Segment that it generates to be zero (in lieu of 781 calculating the correct digital signature as described in Sections 782 4.1 and 4.2). Note that if a confederation chooses not to verify 783 digital signatures within the confederation, then BGPSEC is able to 784 provide no assurances about the integrity of the (private) Member-AS 785 Numbers placed in Secure_Path segments where the Confed_Segment flag 786 is set to one. 788 When a confederation member receives a BGPSEC update message from a 789 peer within the confederation and propagates it to a peer outside the 790 confederation, it needs to remove all of the Secure_Path Segments 791 added by confederation members as well as the corresponding Signature 792 Segments. To do this, the confederation member propagating the route 793 outside the confederation does the following: 795 o First, starting with the most recently added Secure_Path segments, 796 remove all of the consecutive Secure_Path segments that have the 797 Confed_Segment flag set to one. Stop this process once a 798 Scure_Path segment is reached which has its Confed_Segment flag 799 set to zero. Keep a count of the number of segments removed in 800 this fashion. 802 o Second, starting with the most recently added Signature Segment, 803 remove a number of Signature Segments equal to the number of 804 Secure_Path Segments removed in the previous step. (That is, 805 remove the K most recently added signature segments, where K is 806 the number of Secure_Path Segments removed in the previous step.) 808 o Finally, add a Secure_Path Segment containing, in the AS field, 809 the AS Confederation Identifier (the public AS number of the 810 confederation) as well as a corresponding Signature Segment. Note 811 that all fields other that the AS field are populated as per 812 Sections 4.1 and 4.2. 814 When validating a received BGPSEC update message, confederation 815 members need to make the following adjustment to the algorithm 816 presented in Section 5.2. When a confederation member processes 817 (validates) a Signature Segment and its corresponding Secure_Path 818 Segment, the confederation member must note that for a signature 819 produced by a BGPSEC speaker outside of a confederation, the Target 820 AS will always be the AS Confederation Identifier (the public AS 821 number of the confederation) as opposed to the Member-AS Number. 823 To handle this case, when a BGPSEC speaker (that is a confederation 824 member) processes a current Secure_Path Segment that has the 825 Confed_Segment flag set to zero, if the next most recently added 826 Secure_Path segment has the Confed_Segment flag set to one then, when 827 computing the digest for the current Secure_Path segment, the BGPSEC 828 speaker takes the Target AS Number to be the AS Confederation 829 Identifier of the validating BGPSEC speaker's own confederation. 830 (Note that the algorithm in Section 5.2 processes Secure_Path 831 Segments in order from most recently added to least recently added, 832 therefore this special case will apply to the first Secure_Path 833 segment that the algorithm encounters that has the Confed_Segment 834 flag set to zero.) 836 Finally, as discussed above, an AS confederation may optionally 837 decide that its members will not verify digital signatures added by 838 members. In such a federation, when a confederation member runs the 839 algorithm in Section 5.2, when processing a Signature_Segment, the 840 confederation member first checks whether the Confed_Sequence flag in 841 the corresponding Secure_Path segment is set to one. If the 842 Confed_Sequence flag is set to one in the corresponding Secure_Path 843 segment, the confederation member does not perform any further checks 844 on the Signature_Segment and immediately moves on to the next 845 Signature_Segment (and checks its corresponding Secure_Path segment). 846 Note that as specified in Section 5.2, it is an error for a BGPSEC 847 speaker to receive a BGPSEC update messages containing a Secure_Path 848 segment with the Confed_Sequence flag set to one from a peer who is 849 not a member of the same AS confederation. (Such an error is treated 850 in exactly the same way as receipt of a non-BGPSEC update message 851 containing an AS_CONFED_SEQUENCE from a peer that is not a member of 852 the same AS confederation.) 854 4.4. Reconstructing the AS_PATH Attribute 856 BGPSEC update messages do not contain the AS_PATH attribute. Note, 857 however, that the AS_PATH attribute can be reconstructed from the 858 BGPSEC_Path attribute. This is necessary in the case where a route 859 advertisement is received via a BGPSEC update message and then 860 propagated to a peer via a non-BGPSEC update message. There may be 861 additional cases where an implementation finds it useful to perform 862 this reconstruction. 864 The AS_PATH attribute can be constructed from the BGPSEC_Path 865 attribute as follows. Starting with an empty AS_PATH attribute, 866 process the Secure_Path segments in order from least-recently added 867 (corresponding to the origin) to most-recently added. For each 868 Secure_Path segment perform the following steps: 870 1. If the Confed_Segment flag in the Secure_Path segment is set to 871 one, then look at the most-recently added segment in the AS_PATH. 873 * In the case where the AS_PATH is empty or in the case where 874 the most-recently added segment is of type AS_SEQUENCE then 875 add (prepend to the AS_PATH) a new AS_PATH segment of type 876 AS_CONFED_SEQUENCE. This segment of type AS_CONFED_SEQUENCE 877 shall contain a number of elements equal to the pCount field 878 in the current Secure_Path segment. Each of these elements 879 shall be the AS number contained in the current Secure_Path 880 segment. (That is, if the pCount field is X, then the segment 881 of type AS_CONFED_SEQUENCE contains X copies of the 882 Secure_Path segment's AS Number field.) 884 * In the case where the most-recently added segment in the 885 AS_PATH is of type AS_CONFED_SEQUENCE then add (prepend to the 886 segment) a number of elements equal to the pCount field in the 887 current Secure_Path segment. The value of each of these 888 elements shall be the AS number contained in the current 889 Secure_Path segment. (That is, if the pCount field is X, then 890 add X copies of the Secure_Path segment's AS Number field to 891 the existing AS_CONFED_SEQUENCE.) 893 2. If the Confed_Segment flag in the Secure_Path segment is set to 894 zero, then look at the most-recently added segment in the 895 AS_PATH. 897 * In the case where the AS_PATH is empty, and the pCount field 898 in the Secure_Path segment is greater than zero, add (prepend 899 to the AS_PATH) a new AS_PATH segment of type AS_SEQUENCE. 900 This segment of type AS_SEQUENCE shall contain a number of 901 elements equal to the pCount field in the current Secure_Path 902 segment. Each of these elements shall be the AS number 903 contained in the current Secure_Path segment. (That is, if 904 the pCount field is X, then the segment of type AS_SEQUENCE 905 contains X copies of the Secure_Path segment's AS Number 906 field.) 908 * In the case where the most recently added segment in the 909 AS_PATH is of type AS_SEQUENCE then add (prepend to the 910 segment) a number of elements equal to the pCount field in the 911 current Secure_Path segment. The value of each of these 912 elements shall be the AS number contained in the current 913 Secure_Path segment. (That is, if the pCount field is X, then 914 add X copies of the Secure_Path segment's AS Number field to 915 the existing AS_SEQUENCE.) 917 5. Processing a Received BGPSEC Update 919 Upon receiving a BGPSEC update message from an external (eBGP) peer, 920 a BGPSEC speaker SHOULD validate the message to determine the 921 authenticity of the path information contained in the BGPSEC_Path 922 attribute. Section 5.1 provides an overview of BGPSEC validation and 923 Section 5.2 provides a specific algorithm for performing such 924 validation. (Note that an implementation need not follow the 925 specific algorithm in Section 5.2 as long as the input/output 926 behavior of the validation is identical to that of the algorithm in 927 Section 5.2.) During exceptional conditions (e.g., the BGPSEC 928 speaker receives an incredibly large number of update messages at 929 once) a BGPSEC speaker MAY temporarily defer validation of incoming 930 BGPSEC update messages. The treatment of such BGPSEC update 931 messages, whose validation has been deferred, is a matter of local 932 policy. 934 The validity of BGPSEC update messages is a function of the current 935 RPKI state. When a BGPSEC speaker learns that RPKI state has changed 936 (e.g., from an RPKI validating cache via the RTR protocol), the 937 BGPSEC speaker MUST re-run validation on all affected update messages 938 stored in its ADJ-RIB-IN. That is, when a given RPKI certificate 939 ceases to be valid (e.g., it expires or revoked), all update messages 940 containing a signature whose SKI matches the SKI in the given 941 certificate must be re-assessed to determine if they are still valid. 942 Note that this reassessment determines that the validity state of an 943 update has changed then, depending on local policy, it may be 944 necessary to re-run best path selection. 946 BGPSEC update messages do not contain an AS_PATH attribute. 947 Therefore, a BGPSEC speaker MUST utilize the AS path information in 948 the BGPSEC_Path attribute in all cases where it would otherwise use 949 the AS path information in the AS_PATH attribute. The only exception 950 to this rule is when AS path information must be updated in order to 951 propagate a route to a peer (in which case the BGPSEC speaker follows 952 the instructions in Section 4). Section 4.4 provides an algorithm 953 for constructing an AS_PATH attribute from a BGPSEC_Path attribute. 954 Whenever the use of AS path information is called for (e.g., loop 955 detection, or use of AS path length in best path selection) the 956 externally visible behavior of the implementation shall be the same 957 as if the implementation had run the algorithm in Section 4.4 and 958 used the resulting AS_PATH attribute as it would for a non-BGPSEC 959 update message. 961 Many signature algorithms are non-deterministic. That is, many 962 signature algorithms will produce different signatures each time they 963 are run (even when they are signing the same data with the same key). 964 Therefore, if an implementation receives a BGPSEC update from a peer 965 and later receives a second BGPSEC update message from the same peer, 966 the implementation SHOULD treat the second message as a duplicate 967 update message if it differs from the first update message only in 968 the Signature fields (within the BGPSEC_Path attribute). That is, if 969 all the fields in the second update are identical to the fields in 970 the first update message, except for the Signature fields, then the 971 second update message should be treated as a duplicate of the first 972 update message. Note that if other fields (e.g., the Subject Key 973 Identifier field) within a Signature segment differ between two 974 update messages then the two updates are not duplicates. 976 With regards to the processing of duplicate update messages, if the 977 first update message is valid, then an implementation SHOULD NOT run 978 the validation procedure on the second, duplicate update message 979 (even if the bits of the signature field are different). If the 980 first update message is not valid, then an implementation SHOULD run 981 the validation procedure on the second duplicate update message (as 982 the signatures in the second update may be valid even though the 983 first contained a signature that was invalid). 985 5.1. Overview of BGPSEC Validation 987 Validation of a BGPSEC update messages makes use of data from RPKI 988 certificates and signed Route Origination Authorizations (ROA). In 989 particular, to validate update messages containing the BGPSEC_Path 990 attribute, it is necessary that the recipient have access to the 991 following data obtained from valid RPKI certificates and ROAs: 993 o For each valid RPKI router certificate containing an AS Number 994 extension, the AS Number, Public Key and Subject Key Identifier 995 are required, 997 o For each valid ROA, the AS Number and the list of IP address 998 prefixes. 1000 Note that the BGPSEC speaker could perform the validation of RPKI 1001 certificates and ROAs on its own and extract the required data, or it 1002 could receive the same data from a trusted cache that performs RPKI 1003 validation on behalf of (some set of) BGPSEC speakers. (For example, 1004 the trusted cache could deliver the necessary validity information to 1005 the BGPSEC speaker using the router key PDU [15]for the RTR protocol 1006 [14].) 1008 To validate a BGPSEC update message containing the BGPSEC_Path 1009 attribute, the recipient performs the validation steps specified in 1010 Section 5.2. The validation procedure results in one of two states: 1011 'Valid' and 'Not Valid'. 1013 It is expected that the output of the validation procedure will be 1014 used as an input to BGP route selection. However, BGP route 1015 selection and thus the handling of the two validation states is a 1016 matter of local policy, and shall be handled using local policy 1017 mechanisms. It is expected that BGP peers will generally prefer 1018 routes received via 'Valid' BGPSEC update messages over routes 1019 received via 'Not Valid' BGPSEC update messages as well as routes 1020 received via update messages that do not contain the BGPSEC_Path 1021 attribute. However, BGPSEC specifies no changes to the BGP decision 1022 process. (See [16] for related operational considerations.) 1024 BGPSEC validation needs only be performed at eBGP edge. The 1025 validation status of a BGP signed/unsigned update MAY be conveyed via 1026 iBGP from an ingress edge router to an egress edge router via some 1027 mechanism, according to local policy within an AS. As discussed in 1028 Section 4, when a BGPSEC speaker chooses to forward a (syntactically 1029 correct) BGPSEC update message, it SHOULD be forwarded with its 1030 BGPSEC_Path attribute intact (regardless of the validation state of 1031 the update message). Based entirely on local policy, an egress 1032 router receiving a BGPSEC update message from within its own AS MAY 1033 choose to perform its own validation. 1035 5.2. Validation Algorithm 1037 This section specifies an algorithm for validation of BGPSEC update 1038 messages. A conformant implementation MUST include a BGPSEC update 1039 validation algorithm that is functionally equivalent to the 1040 externally visible behavior of this algorithm. 1042 First, the recipient of a BGPSEC update message performs a check to 1043 ensure that the message is properly formed. Specifically, the 1044 recipient performs the following checks: 1046 1. Check to ensure that the entire BGPSEC_Path attribute is 1047 syntactically correct (conforms to the specification in this 1048 document). 1050 2. Check that each Signature_Block contains one Signature segment 1051 for each Secure_Path segment in the Secure_Path portion of the 1052 BGPSEC_Path attribute. (Note that the entirety of each 1053 Signature_Block must be checked to ensure that it is well formed, 1054 even though the validation process may terminate before all 1055 signatures are cryptographically verified.) 1057 3. Check that the update message does not contain an AS_PATH 1058 attribute. 1060 4. If the update message was received from a peer that is not a 1061 member of the BGPSEC speaker's AS confederation, check to ensure 1062 that none of the Secure_Path segments contain a Flags field with 1063 the Confed_Sequence flag set to one. 1065 5. If the update message was received from a peer that is not 1066 expected to set pCount equal to zero (see Section 4.2) then check 1067 to ensure that the pCount field in the most-recently added 1068 Secure_Path segment is not equal to zero. 1070 If any of these checks identify an error in the BGPSEC_Path 1071 attribute, then the implementation should notify the operator that an 1072 error has occurred and treat the update in a manner consistent with 1073 other BGP errors (i.e., following RFC 4271[2] or any future updates 1074 to that document). 1076 Next, the BGPSEC speaker verifies that the origin AS is authorized to 1077 advertise the prefix in question. To do this, consult the valid ROA 1078 data to obtain a list of AS numbers that are associated with the 1079 given IP address prefix in the update message. Then locate the last 1080 (least recently added) AS number in the Secure_Path portion of the 1081 BGPSEC_Path attribute. If the origin AS in the Secure_Path is not in 1082 the set of AS numbers associated with the given prefix, then the 1083 BGPSEC update message is 'Not Valid' and the validation algorithm 1084 terminates. 1086 Finally, the BGPSEC speaker examines the Signature_Blocks in the 1087 BGPSEC_Path attribute. A Signature_Block corresponding to an 1088 algorithm suite that the BGPSEC speaker does not support is not 1089 considered in validation. If there does not exist a Signature_Block 1090 corresponding to an algorithm suite that the BGPSEC speaker supports, 1091 then the BGPSEC speaker MUST treat the update message in the same 1092 manner that the BGPSEC speaker would treat an (unsigned) update 1093 message that arrived without a BGPSEC_Path attribute. 1095 For each remaining Signature_Block (corresponding to an algorithm 1096 suite supported by the BGPSEC speaker), the BGPSEC speaker iterates 1097 through the Signature segments in the Signature_Block, starting with 1098 the most recently added segment (and concluding with the least 1099 recently added segment). Note that there is a one-to-one 1100 correspondence between Signature segments and Secure_Path segments 1101 within the BGPSEC_Path attribute. The following steps make use of 1102 this correspondence. 1104 o (Step I): Locate the public key needed to verify the signature (in 1105 the current Signature segment). To do this, consult the valid 1106 RPKI router certificate data and look up all valid (AS, SKI, 1107 Public Key) triples in which the AS matches the AS number in the 1108 corresponding Secure_Path segment. Of these triples that match 1109 the AS number, check whether there is an SKI that matches the 1110 value in the Subject Key Identifier field of the Signature 1111 segment. If this check finds no such matching SKI value, then 1112 mark the entire Signature_Block as 'Not Valid' and proceed to the 1113 next Signature_Block. 1115 o (Step II): Compute the digest function (for the given algorithm 1116 suite) on the appropriate data. If the segment is not the (least 1117 recently added) segment corresponding to the origin AS, then the 1118 digest function should be computed on the following sequence of 1119 octets: 1121 Sequence of Octets to be Hashed 1123 +-------------------------------------------+ 1124 | AS Number of Target AS (4 octets) | 1125 +-------------------------------------------+ 1126 | AS Number (4 octets) | ---\ 1127 +-------------------------------------------+ \ 1128 | pCount (1 octet) | > Secure_Path 1129 +-------------------------------------------+ / 1130 | Flags (1 octet) | ---/ 1131 +-------------------------------------------+ 1132 | Sig Field in the Next Segment (variable) | 1133 +-------------- ----------------------------+ 1135 For the first segment to be processed (the most recently added 1136 segment), the 'AS Number of Target AS' is the AS number of the BGPSEC 1137 speaker validating the update message. Note that if a BGPSEC speaker 1138 uses multiple AS Numbers (e.g., the BGPSEC speaker is a member of a 1139 confederation), the AS number used here MUST be the AS number 1140 announced in the OPEN message for the BGP session over which the 1141 BGPSEC update was received. 1143 For each other Signature Segment, the 'AS Number of Target AS' is the 1144 AS number in the Secure_Path segment that corresponds to the 1145 Signature Segment added immediately after the one being processed. 1146 (That is, in the Secure_Path segment that corresponds to the 1147 Signature segment that the validator just finished processing.) 1149 The AS Number, pCount and Flags fields are taken from the Secure_Path 1150 segment that corresponds to the Signature segment currently being 1151 processed. The 'Signature Field in the Next Segment' is the 1152 Signature field found in the Signature segment that is next to be 1153 processed (that is, the next most recently added Signature Segment). 1155 Alternatively, if the segment being processed corresponds to the 1156 origin AS (i.e., if it is the least recently added segment), then the 1157 digest function should be computed on the following sequence of 1158 octets: 1160 Sequence of Octets to be Hashed 1161 +------------------------------------+ 1162 | AS Number of Target AS (4 octets) | 1163 +------------------------------------+ 1164 | Origin AS Number (4 octets) | ---\ 1165 +------------------------------------+ \ 1166 | pCount (1 octet) | > Secure_Path 1167 +------------------------------------+ / 1168 | Flags (1 octet) | ---/ 1169 +------------------------------------+ 1170 | Algorithm Suite Id. (1 octet) | 1171 +------------------------------------+ 1172 | NLRI Length (1 octet) | 1173 +------------------------------------+ 1174 | NLRI Prefix (variable) | 1175 +------------------------------------+ 1177 The NLRI Length, NLRI Prefix, and Algorithm Suite Identifier are all 1178 obtained in a straight forward manner from the NLRI of the update 1179 message or the BGPSEC_Path attribute being validated. The Origin AS 1180 Number, pCount, and Flags fields are taken from the Secure_Path 1181 segment corresponding to the Signature Segment currently being 1182 processed. 1184 The 'AS Number of Target AS' is the AS Number from the Secure_Path 1185 segment that was added immediately after the Secure_Path segment 1186 containing the Origin AS Number. (That is, the Secure_Path segment 1187 corresponding to the Signature segment that the receiver just 1188 finished processing prior to the current Signature segment.) 1190 o (Step III): Use the signature validation algorithm (for the given 1191 algorithm suite) to verify the signature in the current segment. 1192 That is, invoke the signature validation algorithm on the 1193 following three inputs: the value of the Signature field in the 1194 current segment; the digest value computed in Step II above; and 1195 the public key obtained from the valid RPKI data in Step I above. 1196 If the signature validation algorithm determines that the 1197 signature is invalid, then mark the entire Signature_Block as 'Not 1198 Valid' and proceed to the next Signature_Block. If the signature 1199 validation algorithm determines that the signature is valid, then 1200 continue processing Signature Segments (within the current 1201 Signature_Block). 1203 If all Signature Segments within a Signature_Block pass validation 1204 (i.e., all segments are processed and the Signature_Block has not yet 1205 been marked 'Not Valid'), then the Signature_Block is marked as 1206 'Valid'. 1208 If at least one Signature_Block is marked as 'Valid', then the 1209 validation algorithm terminates and the BGPSEC update message is 1210 deemed to be 'Valid'. (That is, if a BGPSEC update message contains 1211 two Signature_Blocks then the update message is deemed 'Valid' if the 1212 first Signature_Block is marked 'Valid' OR the second Signature_Block 1213 is marked 'Valid'.) 1215 6. Algorithms and Extensibility 1217 6.1. Algorithm Suite Considerations 1219 Note that there is currently no support for bilateral negotiation 1220 between BGPSEC peers to use of a particular (digest and signature) 1221 algorithm suite using BGP capabilities. This is because the 1222 algorithm suite used by the sender of a BGPSEC update message must be 1223 understood not only by the peer to whom he is directly sending the 1224 message, but also by all BGPSEC speakers to whom the route 1225 advertisement is eventually propagated. Therefore, selection of an 1226 algorithm suite cannot be a local matter negotiated by BGP peers, but 1227 instead must be coordinated throughout the Internet. 1229 To this end, a mandatory algorithm suites document will be created 1230 which specifies a mandatory-to-use 'current' algorithm suite for use 1231 by all BGPSEC speakers [11]. 1233 It is anticipated that in the future mandatory algorithm suites 1234 document will be updated to specify a transition from the 'current' 1235 algorithm suite to a 'new' algorithm suite. During the period of 1236 transition (likely a small number of years), all BGPSEC update 1237 messages SHOULD simultaneously use both the 'current' algorithm suite 1238 and the 'new' algorithm suite. (Note that Sections 3 and 4 specify 1239 how the BGPSEC_Path attribute can contain signatures, in parallel, 1240 for two algorithm suites.) Once the transition is complete, use of 1241 the old 'current' algorithm will be deprecated, use of the 'new' 1242 algorithm will be mandatory, and a subsequent 'even newer' algorithm 1243 suite may be specified as recommend to implement. Once the 1244 transition has successfully been completed in this manner, BGPSEC 1245 speakers SHOULD include only a single Signature_Block (corresponding 1246 to the 'new' algorithm). 1248 6.2. Extensibility Considerations 1250 This section discusses potential changes to BGPSEC that would require 1251 substantial changes to the processing of the BGPSEC_Path and thus 1252 necessitate a new version of BGPSEC. Examples of such changes 1253 include: 1255 o A new type of signature algorithm that produces signatures of 1256 variable length 1258 o A new type of signature algorithm for which the number of 1259 signatures in the Signature_Block is not equal to the number of 1260 ASes in the Secure_Path (e.g., aggregate signatures) 1262 o Changes to the data that is protected by the BGPSEC signatures 1263 (e.g., attributes other than the AS path) 1265 In the case that such a change to BGPSEC were deemed desirable, it is 1266 expected that a subsequent version of BGPSEC would be created and 1267 that this version of BGPSEC would specify a new BGP path attribute, 1268 let's call it BGPSEC_PATH_TWO, which is designed to accommodate the 1269 desired changes to BGPSEC. In such a case, the mandatory algorithm 1270 suites document would be updated to specify algorithm suites 1271 appropriate for the new version of BGPSEC. 1273 At this point a transition would begin which is analogous to the 1274 algorithm transition discussed in Section 6.1. During the transition 1275 period all BGPSEC speakers SHOULD simultaneously include both the 1276 BGPSEC_PATH attribute and the new BGPSEC_PATH_TWO attribute. Once 1277 the transition is complete, the use of BGPSEC_PATH could then be 1278 deprecated, at which point BGPSEC speakers SHOULD include only the 1279 new BGPSEC_PATH_TWO attribute. Such a process could facilitate a 1280 transition to a new BGPSEC semantics in a backwards compatible 1281 fashion. 1283 7. Security Considerations 1285 For discussion of the BGPSEC threat model and related security 1286 considerations, please see [13]. 1288 A BGPSEC speaker who receives a valid BGPSEC update message, 1289 containing a route advertisement for a given prefix, is provided with 1290 the following security guarantees: 1292 o The origin AS number corresponds to an autonomous system that has 1293 been authorized, in the RPKI, by the IP address space holder to 1294 originate route advertisements for the given prefix. 1296 o For each AS in the path, a BGPSEC speaker authorized by the holder 1297 of the AS number intentionally chose (in accordance with local 1298 policy) to propagate the route advertisement to the subsequent AS 1299 in the path. 1301 That is, the recipient of a valid BGPSEC Update message is assured 1302 that the Secure_Path portion of the BGPSEC_Path attribute corresponds 1303 to a sequence of autonomous systems who have all agreed in principle 1304 to forward packets to the given prefix along the indicated path. (It 1305 should be noted that BGPSEC does not offer any guarantee that the 1306 data packets would propagate along the indicated path; it only 1307 guarantees that the BGP update conveying the path indeed propagated 1308 along the indicated path.) Furthermore, the recipient is assured 1309 that this path terminates in an autonomous system that has been 1310 authorized by the IP address space holder as a legitimate destination 1311 for traffic to the given prefix. 1313 Note that although BGPSEC provides a mechanism for an AS to validate 1314 that a received update message has certain security properties, the 1315 use of such a mechanism to influence route selection is completely a 1316 matter of local policy. Therefore, a BGPSEC speaker can make no 1317 assumptions about the validity of a route received from an external 1318 BGPSEC peer. That is, a compliant BGPSEC peer may (depending on the 1319 local policy of the peer) send update messages that fail the validity 1320 test in Section 5. Thus, a BGPSEC speaker MUST completely validate 1321 all BGPSEC update messages received from external peers. (Validation 1322 of update messages received from internal peers is a matter of local 1323 policy, see Section 5). 1325 Note that there may be cases where a BGPSEC speaker deems 'Valid' (as 1326 per the validation algorithm in Section 5.2) a BGPSEC update message 1327 that contains both a 'Valid' and a 'Not Valid' Signature_Block. That 1328 is, the update message contains two sets of signatures corresponding 1329 to two algorithm suites, and one set of signatures verifies correctly 1330 and the other set of signatures fails to verify. In this case, the 1331 protocol specifies that if the BGPSEC speaker propagates the route 1332 advertisement received in such an update message then the BGPSEC 1333 speaker SHOULD add its signature to each of the Signature_Blocks 1334 using both the corresponding algorithm suite. Thus the BGPSEC 1335 speaker creates a signature using both algorithm suites and creates a 1336 new update message that contains both the 'Valid' and the 'Not Valid' 1337 set 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 quite likely) that some of the BGPSEC speaker's peers 1344 (or other entities further 'downstream' in the BGP topology) do not 1345 support algorithm A. Therefore, if the BGPSEC speaker were to remove 1346 the 'Not Valid' set of signatures corresponding to algorithm B, such 1347 entities would treat the message as though it were unsigned. By 1348 including the 'Not Valid' set of signatures when propagating a route 1349 advertisement, the BGPSEC speaker ensures that 'downstream' entities 1350 have as much information as possible to make an informed opinion 1351 about the validation status of a BGPSEC update. 1353 Note also that during a period of partial BGPSEC deployment, a 1354 'downstream' entity might reasonably treat unsigned messages 1355 different from BGPSEC updates that contain a single set of 'Not 1356 Valid' signatures. That is, by removing the set of 'Not Valid' 1357 signatures the BGPSEC speaker might actually cause a downstream 1358 entity to 'upgrade' the status of a route advertisement from 'Not 1359 Valid' to unsigned. Finally, note that in the above scenario, the 1360 BGPSEC speaker might have deemed algorithm A signatures 'Valid' only 1361 because of some issue with RPKI state local to his AS (for example, 1362 his AS might not yet have obtained a CRL indicating that a key used 1363 to verify an algorithm A signature belongs to a newly revoked 1364 certificate). In such a case, it is highly desirable for a 1365 downstream entity to treat the update as 'Not Valid' (due to the 1366 revocation) and not as 'unsigned' (which would happen if the 'Not 1367 Valid' Signature_Blocks were removed). 1369 A similar argument applies to the case where a BGPSEC speaker (for 1370 some reason such as lack of viable alternatives) selects as his best 1371 route to a given prefix a route obtained via a 'Not Valid' BGPSEC 1372 update message. (That is, a BGPSEC update containing only 'Not 1373 Valid' Signature_Blocks.) In such a case, the BGPSEC speaker should 1374 propagate a signed BGPSEC update message, adding his signature to the 1375 'Not Valid' signatures that already exist. Again, this is to ensure 1376 that 'downstream' entities are able to make an informed decision and 1377 not erroneously treat the route as unsigned. It may also be noted 1378 here that due to possible differences in RPKI data at different 1379 vantage points in the network, a BGPSEC update that was deemed 'Not 1380 Valid' at an upstream BGPSEC speaker may indeed be deemed 'Valid' at 1381 another BGP speaker downstream. 1383 Therefore, it is important to note that when a BGPSEC speaker signs 1384 an outgoing update message, it is not attesting to a belief that all 1385 signatures prior to its are valid. Instead it is merely asserting 1386 that: 1388 o The BGPSEC speaker received the given route advertisement with the 1389 indicated NLRI and Secure_Path; and 1391 o The BGPSEC speaker chose to propagate an advertisement for this 1392 route to the peer (implicitly) indicated by the 'Target AS' 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 The mechanism of setting the pCount field to zero is included in this 1408 specification to enable route servers in the control path to 1409 participate in BGPSEC without increasing the effective length of the 1410 AS-PATH. However, entities other than route servers could 1411 conceivably use this mechanism (set the pCount to zero) to attract 1412 traffic (by reducing the effective length of the AS-PATH) 1413 illegitimately. This risk is largely mitigated if every BGPSEC 1414 speaker drops incoming update messages that set pCount to zero but 1415 come from a peer that is not a route server. However, note that a 1416 recipient of a BGPSEC update message in which an upstream entity that 1417 is two or more hops away set pCount to zero is unable to verify for 1418 themselves whether pCount was set to zero legitimately. 1420 Finally, BGPSEC does not provide protection against attacks at the 1421 transport layer. An adversary on the path between a BGPSEC speaker 1422 and its peer is able to perform attacks such as modifying valid 1423 BGPSEC updates to cause them to fail validation, injecting (unsigned) 1424 BGP update messages without BGPSEC_Path_Signature attributes, or 1425 injecting BGPSEC update messages with BGPSEC_Path_Signature 1426 attributes that fail validation, or causing the peer to tear-down the 1427 BGP session. Therefore, BGPSEC sessions SHOULD be protected by 1428 appropriate transport security mechanisms. 1430 8. IANA Considerations 1432 TBD: Need IANA to assign numbers for the two capabilities and the 1433 BGPSEC_PATH attribute. 1435 This document does not create any new IANA registries. 1437 9. Contributors 1439 9.1. Authors 1441 Rob Austein 1442 Dragon Research Labs 1443 sra@hactrn.net 1444 Steven Bellovin 1445 Columbia University 1446 smb@cs.columbia.edu 1448 Randy Bush 1449 Internet Initiative Japan 1450 randy@psg.com 1452 Russ Housley 1453 Vigil Security 1454 housley@vigilsec.com 1456 Matt Lepinski 1457 BBN Technologies 1458 lepinski@bbn.com 1460 Stephen Kent 1461 BBN Technologies 1462 kent@bbn.com 1464 Warren Kumari 1465 Google 1466 warren@kumari.net 1468 Doug Montgomery 1469 USA National Institute of Standards and Technology 1470 dougm@nist.gov 1472 Kotikalapudi Sriram 1473 USA National Institute of Standards and Technology 1474 kotikalapudi.sriram@nist.gov 1476 Samuel Weiler 1477 Sparta 1478 weiler+ietf@watson.org 1480 9.2. Acknowledgements 1482 The authors would like to thank Luke Berndt, Sharon Goldberg, Ed 1483 Kern, Chris Morrow, Doug Maughan, Pradosh Mohapatra, Russ Mundy, 1484 Sandy Murphy, Keyur Patel, Mark Reynolds, Heather Schiller, Jason 1485 Schiller, John Scudder, Ruediger Volk and David Ward for their 1486 valuable input and review. 1488 10. Normative References 1490 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1491 Levels", BCP 14, RFC 2119, March 1997. 1493 [2] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border 1494 Gateway Protocol 4", RFC 4271, January 2006. 1496 [3] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 1497 "Multiprotocol Extensions for BGP-4", RFC 4760, January 2007. 1499 [4] Vohra, Q. and E. Chen, "BGP Support for Four-octet AS Number 1500 Space", RFC 4893, May 2007. 1502 [5] Traina, P., McPherson, D., and J. Scudder, "Autonomous System 1503 Confederations for BGP", RFC 5065, August 2007. 1505 [6] Scudder, J. and R. Chandra, "Capabilities Advertisement with 1506 BGP-4", RFC 5492, February 2009. 1508 [7] Lepinski, M. and S. Kent, "An Infrastructure to Support Secure 1509 Internet Routing", RFC 6480, February 2012. 1511 [8] Lepinski, M., Kent, S., and D. Kong, "A Profile for Route 1512 Origin Authorizations (ROAs)", RFC 6482, February 2012. 1514 [9] Patel, K., Ward, D., and R. Bush, "Extended Message support for 1515 BGP", July 2012. 1517 [10] Reynolds, M., Turner, S., and S. Kent, "A Profile for BGPSEC 1518 Router Certificates, Certificate Revocation Lists, and 1519 Certification Requests", April 2012. 1521 [11] Turner, S., "BGP Algorithms, Key Formats, & Signature Formats", 1522 March 2012. 1524 11. Informative References 1526 [12] Kumari, W. and K. Sriram, "Recommendation for Not Using AS_SET 1527 and AS_CONFED_SET in BGP", RFC 6472, December 2011. 1529 [13] Kent, S., "Threat Model for BGP Path Security", February 2012. 1531 [14] Bush, R. and R. Austein, "The RPKI/Router Protocol", 1532 February 2012. 1534 [15] Bush, R., Patel, K., and S. Turner, "Router Key PDU for RPKI- 1535 Router Protocol", October 2012. 1537 [16] Bush, R., "BGPsec Operational Considerations", May 2012. 1539 Author's Address 1541 Matthew Lepinski (editor) 1542 BBN 1543 10 Moulton St 1544 Cambridge, MA 55409 1545 US 1547 Phone: +1 617 873 5939 1548 Email: mlepinski.ietf@gmail.com