idnits 2.17.1 draft-ietf-v6ops-icmpv6-filtering-recs-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 16. -- Found old boilerplate from RFC 3978, Section 5.5 on line 1534. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 1511. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 1518. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 1524. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 12, 2006) is 6586 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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: 'I-D.ietf-ipngwg-icmp-name-lookups' is defined on line 795, but no explicit reference was found in the text == Unused Reference: 'I-D.gont-tcpm-icmp-attacks' is defined on line 858, but no explicit reference was found in the text ** Downref: Normative reference to an Experimental draft: draft-ietf-ipngwg-icmp-name-lookups (ref. 'I-D.ietf-ipngwg-icmp-name-lookups') -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-ipngwg-icmp-v3' ** Obsolete normative reference: RFC 1981 (Obsoleted by RFC 8201) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 2462 (Obsoleted by RFC 4862) ** Obsolete normative reference: RFC 3775 (Obsoleted by RFC 6275) ** Downref: Normative reference to an Experimental RFC: RFC 4065 -- Obsolete informational reference (is this intentional?): RFC 3041 (Obsoleted by RFC 4941) Summary: 9 errors (**), 0 flaws (~~), 4 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPv6 Operations E. Davies 3 Internet-Draft Consultant 4 Expires: October 14, 2006 J. Mohacsi 5 NIIF/HUNGARNET 6 April 12, 2006 8 Recommendations for Filtering ICMPv6 Messages in Firewalls 9 draft-ietf-v6ops-icmpv6-filtering-recs-00.txt 11 Status of this Memo 13 By submitting this Internet-Draft, each author represents that any 14 applicable patent or other IPR claims of which he or she is aware 15 have been or will be disclosed, and any of which he or she becomes 16 aware will be disclosed, in accordance with Section 6 of BCP 79. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress." 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt. 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 This Internet-Draft will expire on October 14, 2006. 36 Copyright Notice 38 Copyright (C) The Internet Society (2006). 40 Abstract 42 In networks supporting IPv6 the Internet Control Message Protocol 43 version 6 (ICMPv6) plays a fundamental role with a large number of 44 functions, and a correspondingly large number of message types and 45 options. A number of security risks are associated with uncontrolled 46 forwarding of ICMPv6 messages. On the other hand, compared with IPv4 47 and the corresponding protocol ICMP, ICMPv6 is essential to the 48 functioning of IPv6 rather than a useful auxiliary. 50 This document provides some recommendations for ICMPv6 firewall 51 filter configuration that will allow propagation of ICMPv6 messages 52 that are needed to maintain the functioning of the network but drop 53 messages which are potential security risks. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 2. Classifying ICMPv6 Messages . . . . . . . . . . . . . . . . . 6 59 2.1. Error and Informational ICMPv6 Messages . . . . . . . . . 6 60 2.2. Addressing of ICMPv6 . . . . . . . . . . . . . . . . . . . 6 61 2.3. Network Topology and Address Scopes . . . . . . . . . . . 7 62 2.4. Role in Establishing Communication . . . . . . . . . . . . 7 63 3. Security Considerations . . . . . . . . . . . . . . . . . . . 8 64 3.1. Denial of Service Attacks . . . . . . . . . . . . . . . . 8 65 3.2. Probing . . . . . . . . . . . . . . . . . . . . . . . . . 9 66 3.3. Redirection Attacks . . . . . . . . . . . . . . . . . . . 9 67 3.4. Renumbering Attacks . . . . . . . . . . . . . . . . . . . 9 68 3.5. Problems Resulting from ICMPv6 Transparency . . . . . . . 9 69 4. Filtering Recommendations . . . . . . . . . . . . . . . . . . 10 70 4.1. Common Considerations . . . . . . . . . . . . . . . . . . 10 71 4.2. Recommendations for ICMPv6 Transit Traffic . . . . . . . . 12 72 4.2.1. Traffic that Must NOT be Dropped . . . . . . . . . . . 12 73 4.2.2. Traffic that Normally Should Not be Dropped . . . . . 12 74 4.2.3. Traffic that May be Dropped but will be Caught 75 Anyway . . . . . . . . . . . . . . . . . . . . . . . . 13 76 4.2.4. Traffic for which a Dropping Policy Should be 77 Defined . . . . . . . . . . . . . . . . . . . . . . . 14 78 4.2.5. Traffic which Should be Dropped Unless a Good Case 79 can be Made . . . . . . . . . . . . . . . . . . . . . 14 80 4.3. Recommendations for ICMPv6 Local Configuration Traffic . . 15 81 4.3.1. Traffic that Must NOT be Dropped . . . . . . . . . . . 15 82 4.3.2. Traffic that Normally Should Not be Dropped . . . . . 16 83 4.3.3. Traffic that May be Dropped but will be Caught 84 Anyway . . . . . . . . . . . . . . . . . . . . . . . . 16 85 4.3.4. Traffic for which a Dropping Policy Should be 86 Defined . . . . . . . . . . . . . . . . . . . . . . . 16 87 4.3.5. Traffic which Should be Dropped Unless a Good Case 88 can be Made . . . . . . . . . . . . . . . . . . . . . 17 89 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 90 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 18 91 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 92 7.1. Normative References . . . . . . . . . . . . . . . . . . . 18 93 7.2. Informative References . . . . . . . . . . . . . . . . . . 19 94 Appendix A. Notes on Individual ICMPv6 Messages . . . . . . . . . 20 95 A.1. Destination Unreachable Error Message . . . . . . . . . . 20 96 A.2. Packet Too Big Error Message . . . . . . . . . . . . . . . 20 97 A.3. Time Exceeded Error Message . . . . . . . . . . . . . . . 21 98 A.4. Parameter Problem Error Message . . . . . . . . . . . . . 21 99 A.5. ICMPv6 Echo Request and Echo Response . . . . . . . . . . 22 100 A.6. Neighbor Solicitation and Neighbor Advertisement 101 Messages . . . . . . . . . . . . . . . . . . . . . . . . . 22 102 A.7. Router Solicitation and Router Advertisement Messages . . 23 103 A.8. Redirect Messages . . . . . . . . . . . . . . . . . . . . 23 104 A.9. SEND Certificate Path Messages . . . . . . . . . . . . . . 23 105 A.10. Multicast Listener Discovery Messages . . . . . . . . . . 23 106 A.11. Multicast Router Discovery Messages . . . . . . . . . . . 23 107 A.12. Router Renumbering Messages . . . . . . . . . . . . . . . 24 108 A.13. Node Information Query and Reply . . . . . . . . . . . . . 24 109 A.14. Mobile IPv6 Messages . . . . . . . . . . . . . . . . . . . 24 110 A.15. Unused and Experimental Messages . . . . . . . . . . . . . 25 111 Appendix B. Example Script to Configure ICMPv6 Firewall Rules . . 25 112 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 33 113 Intellectual Property and Copyright Statements . . . . . . . . . . 34 115 1. Introduction 117 When a network supports IPv6 [RFC2460], the Internet Control Message 118 Protocol version 6 (ICMPv6) [RFC4443], [I-D.ietf-ipngwg-icmp-v3] 119 plays a fundamental role including being an essential component in 120 establishing communications both at the interface level and for 121 sessions to remote nodes. This means that overly aggressive 122 filtering of ICMPv6 may have a detrimental effect on the 123 establishment of IPv6 communications. On the other hand, allowing 124 indiscriminate passage of all ICMPv6 messages can be a major security 125 risk. This document recommends a set of rules which seek to balance 126 effective IPv6 communication against the needs of site security. 128 ICMPv6 has a large number of functions defined in a number of sub- 129 protocols, and there are a correspondingly large number of messages 130 and options within these messages. The functions currently defined 131 are: 132 o Returning error messages to the source if a packet could not be 133 delivered. Four different error messages, each with a number of 134 sub-types are specified in [RFC4443]. 135 o Simple monitoring of connectivity through echo requests and 136 responses used by the ping and traceroute utilities. The Echo 137 Request and Echo Response messages are specified in [RFC4443]. 138 o Finding neighbors (both routers and hosts) connected to the same 139 link and determining their IP and link layer addresses. These 140 messages are also used to check the uniqueness of any addresses 141 that an interface proposes to use (Duplicate Address Detection - 142 DAD)). Four messages - Neighbor Solicitation (NS), Neighbor 143 Advertisement (NA), Router Solicitation (RS) and Router 144 Advertisement (RA) - are specified in [RFC4311]. 145 o Ensuring that neighbors remain reachable using the same IP and 146 link layer addresses after initial discovery (Neighbor 147 Unreachability Discovery - NUD) and notifying neighbors of changes 148 to link layer addresses. Uses NS and NA [RFC4311]. 149 o Finding routers and determining how to obtain IP addresses to join 150 the subnets supported by the routers. Uses RS and RA [RFC4311]. 151 o If stateless auto-configuration of hosts is enabled, communicating 152 prefixes and other configuration information (including the link 153 MTU and suggested hop count default) from routers to hosts. Uses 154 RS and RA [RFC2462]. [[anchor2: [RFC Editor: Please update 155 references to RFC2462 when the new version of RFC2462 is 156 published.] --Authors]] 157 o Using SEcure Neighbor Discovery (SEND) to authenticate a router 158 attached to a link, the Certificate Path Solicitation and 159 Advertisement messages specified in [RFC3971] are used by hosts to 160 retrieve the trust chain between a trust anchor and the router 161 certificate from the router. 163 o Redirecting packets to a more appropriate router on the local link 164 for the destination address or pointing out that a destination is 165 actually on the local link even if it is not obvious from the IP 166 address (where a link supports multiple subnets). The Redirect 167 message is specified in [RFC4311]. 168 o Supporting renumbering of networks by allowing the prefixes 169 advertised by routers to be altered. Uses NS, NA, RS and RA 170 together with the Router Renumbering message specified in 171 [RFC2894]. 172 o Determining the Maximum Transmission Unit (MTU) along a path. The 173 Packet Too Big error message is essential to this function 174 [RFC1981]. 175 o Providing a means to discover the IPv6 addresses associated with 176 the link layer address of an interface (the inverse of Neighbor 177 Discovery, where the link layer address is discovered given an 178 IPv6 address). Two messages, Inverse Neighbor Discovery 179 Solicitation and Advertisement messages are specified in 180 [RFC3122]. 181 o Communicating which multicast groups have listeners on a link to 182 the multicast capable routers connected to the link. Uses 183 messages Multicast Listener Query, Multicast Listener Report (two 184 versions) and Multicast Listener Done (version 1 only) as 185 specified in Multicast Listener Discovery MLDv1 [RFC2710] and 186 MLDv2[RFC3810]. 187 o Discovering multicast routers attached to the local link. Uses 188 messages Multicast Router Advertisement, Multicast Router 189 Solicitation and Multicast Router Termination as specified in 190 Multicast Router Discovery [RFC4286]. 191 o Providing support for some aspects of Mobile IPv6 especially 192 dealing with the IPv6 Mobile Home Agent functionality provided in 193 routers and needed to support a Mobile node homed on the link. 194 The Home Agent Address Discovery Request and Reply; and Mobile 195 Prefix Solicitation and Advertisement messages are specified in 196 [RFC3775] 197 o An experimental extension to ICMPv6 specifies the ICMP Node 198 Information Query and Response messages which can be used to 199 retrieve some basic information about nodes [I-D.ietf-ipngwg-icmp- 200 name-lookups]. 201 o The SEAmless IP MOBility (seamoby) working group specified a pair 202 of experimental protocols which use an ICMPv6 message specified in 203 [RFC4065] to help in locating an access router and moving the 204 attachment point of a mobile node from one access router to 205 another. 207 Many of these messages should only be used in a link-local context 208 rather than end-to-end, and filters need to be concerned with the 209 type of addresses in ICMPv6 packets as well as the specific source 210 and destination addresses. 212 Compared with the corresponding IPv4 protocol, ICMP, ICMPv6 cannot be 213 treated as an auxiliary function with packets that can be dropped in 214 most cases without damaging the functionality of the network. This 215 means that firewall filters for ICMPv6 have to be more carefully 216 configured than was the case for ICMP, where typically a small set of 217 blanket rules could be applied. 219 2. Classifying ICMPv6 Messages 221 2.1. Error and Informational ICMPv6 Messages 223 ICMPv6 messages contain an eight bit Type field interpreted as an 224 integer between 0 and 255. Messages with Type values less than or 225 equal to 127 are Error Messages. The remainder are Informational 226 Messages. In general terms, Error Messages with well-known 227 (standardized) Type values would normally be expected to be allowed 228 to be sent to or pass through firewalls, and may be essential to the 229 establishment of communications (see Section 2.4) whereas 230 Informational Messages will generally be the subject of policy rules, 231 and those passing through firewalls can, in many but by no means all 232 cases, be dropped without damaging IPv6 communications. 234 2.2. Addressing of ICMPv6 236 ICMPv6 messages are sent using various kinds of source and 237 destination address types. The source address is usually a unicast 238 address, but during address autoconfiguration message exchanges, the 239 unspecified address :: is also used as a source address [RFC2462]. 241 Multicast Listener Discovery (MLD) Report and Done messages are sent 242 with a link-local address as the IPv6 source address, if a valid 243 address is available on the interface. If a valid link-local address 244 is not available (e.g., one has not been configured), the message is 245 sent with the unspecified address (::) as the IPv6 source address. 246 Subsequently the node will generate new MLD Report messages with 247 proper link-local source address once it has been configured 248 [RFC3590]. 250 The destination address can be either a well-known multicast address, 251 a generated multicast address such as the solicited-node multicast 252 address, an anycast address or a unicast address. While many ICMPv6 253 messages use multicast addresses most of the time, some also use 254 unicast addresses. For instance, the Router Advertisement messages 255 are sent to the all-nodes multicast address when unsolicited, but can 256 also be sent to a unicast address in response to a specific Router 257 Solicitation. 259 2.3. Network Topology and Address Scopes 261 ICMPv6 messages can be classified according to whether they are meant 262 for end-to-end communications or communications within a link. There 263 are also messages that we can classify as 'any-to-end', which can be 264 sent from any point within a path back to the source; typically these 265 are used to announce an error in processing the original packet. For 266 instance, the address resolution messages are solely for local 267 communications [RFC4311], whereas the Destination Unreachable 268 messages are any-to-end in nature. Generally end-to-end and any-to- 269 end messages might be expected to pass through firewalls depending on 270 policies but local communications must not. 272 Local communications will use link-local addresses in many cases but 273 may also use global unicast addresses for example when configuring 274 global addresses. Also some ICMPv6 messages in local communications 275 may contravene the usual rules requiring compatible scopes for source 276 and destination addresses. 278 2.4. Role in Establishing Communication 280 Many ICMPv6 messages have a role in establishing communications to 281 and from the firewall and such messages have to be accepted by 282 firewalls for local delivery. Generally a firewall will also by 283 acting as a router so that all the messages that might be used in 284 configuring a router interface need to be accepted and generated. 285 This type of communication establishment messages should not be 286 passed through a firewall as they are normally intended for use 287 within a link. 289 On the other hand, most ICMPv6 error messages traveling end-to-end or 290 any-to-end are essential to the establishment of communications. 291 These messages must be passed through firewalls and might also be 292 sent to and from firewalls to assist with establishment of 293 communications. For example the Packet Too Big error message is 294 needed to establish the MTU along a path. 296 The remaining ICMPv6 messages which are not associated with 297 communication establishment will normally be legitimately attempting 298 to pass through a firewall from inside to out or vice versa, but in 299 most cases decisions as to whether to allow them to pass or not can 300 be made on the basis of local policy without interfering with the 301 establishment of IPv6 communications. 303 The filtering rules for the various message roles will generally be 304 different. 306 3. Security Considerations 308 This memo recommends filtering configurations for firewalls designed 309 to minimize the security vulnerabilities that can arise in using the 310 many different sub-protocols of ICMPv6 in support of IPv6 311 communication. 313 A major concern is that it is generally not possible to use IPsec or 314 other means to authenticate the sender and validate the contents of 315 many ICMPv6 messages. To a large extent this is because a site can 316 legitimately expect to receive certain error and other messages from 317 almost any location in the wider Internet, and these messages may 318 occur as a result of the first message sent to a destination. 319 Establishing security associations with all possible sources of 320 ICMPv6 messages is therefore impossible. 322 The inability to establish security associations to protect some 323 messages that are needed to establish communications means that 324 alternative means have to used to reduce the vulnerability of sites 325 to ICMPv6 based attacks. The most common way of doing this is to 326 establish strict filtering policies in site firewalls to limit the 327 unauthenticated ICMPv6 messages that can pass between the site and 328 the wider Internet. This makes control of ICMPv6 filtering a 329 delicate balance between protecting the site by dropping some of the 330 ICMPv6 traffic passing through the firewall and allowing enough of 331 the traffic through to make sure that efficient communication can be 332 established. 334 SEND [RFC3971] has been specified as a means to improve the security 335 of local ICMPv6 communications. SEND sidesteps security association 336 bootstrapping problems that would result if IPsec was used. SEND 337 affects only link local messages and does not limit the filtering 338 which firewalls can apply and its role in security is therefore not 339 discussed further in this document. 341 Firewalls will normally be concerned to monitor ICMPv6 to control the 342 following security concerns: 344 3.1. Denial of Service Attacks 346 ICMPv6 can be used to cause a Denial of Service(DoS) in a number of 347 ways, including simply sending excessive numbers of ICMPv6 packets to 348 destinations in the site and sending error messages which disrupt 349 established communications by causing sessions to be dropped. Also 350 if spurious communication establishment messages can be passed on to 351 link it might be possible to invalidate legitimate addresses or 352 disable interfaces. 354 3.2. Probing 356 A major security consideration is preventing attackers probing the 357 site to determine the topology and identify hosts that might be 358 vulnerable to attack. Carefully crafted but, often, malformed 359 messages can be used to provoke ICMPv6 responses from hosts thereby 360 informing attackers of potential targets for future attacks. However 361 the very large address space of IPv6 makes probing a less effective 362 weapon as compared with IPv4 provided that addresses are not 363 allocated in an easily guessable fashion. This subject is explored 364 in more depth in [I-D.chown-v6ops-port-scanning-implications]. 366 3.3. Redirection Attacks 368 A redirection attack could be used by a malicious sender to perform 369 man-in-the-middle attacks or divert packets either to a malicious 370 monitor or to cause DoS by blackholing the packets. These attacks 371 would normally have to be carried out locally on a link using the 372 Redirect message. Administrators need to decide if the improvement 373 in efficiency from using Redirect messages is worth the risk of 374 malicious use. Factors to consider include the physical security of 375 the link and the complexity of addressing on the link. For example, 376 on a wireless link, redirection would be a serious hazard due to the 377 lack of physical security. On the other hand, with a wired link in a 378 secure building with complex addressing and redundant routers, the 379 efficiency gains might well outweigh the small risk of a rogue node 380 being connected. 382 3.4. Renumbering Attacks 384 Spurious Renumbering messages could lead to the disruption of a site 385 and should not be allowed through a firewall in general. Renumbering 386 messages are required to be authenticated with IPsec so that it is 387 difficult to carry out such attacks in practice. 389 3.5. Problems Resulting from ICMPv6 Transparency 391 Because some ICMPv6 error packets need to be passed through a 392 firewall in both directions. This means that the ICMPv6 error 393 packets can be exchanged between inside and outside without any 394 filtering. 396 Using this feature, malicious users can communicate between the 397 inside and outside of a firewall bypassing the administrator's 398 inspection (proxy, firewall etc.). For example it might be possible 399 to carry out a covert conversation through the payload of ICMPv6 400 error messages or tunnel inappropriate encapsulated IP packets in 401 ICMPv6 error messages. This problem can be alleviated by filtering 402 ICMPv6 errors using a deep packet inspection mechanism to ensure that 403 the packet carried as a payload is associated with legitimate traffic 404 to or from the protected network. 406 4. Filtering Recommendations 408 When designing firewall filtering rules for ICMPv6, the rules can be 409 divided into two classes: 410 o Rules for ICMPv6 traffic transiting the firewall 411 o Rules for ICMPv6 directed to interfaces on the firewall 413 This section suggests some common considerations which should be 414 borne in mind when designing filtering rules and then categorizes the 415 rules for each class. The categories are: 416 o Messages that must not be dropped: usually because establishment 417 of communications will be prevented or severely impacted. 418 o Messages that should not be dropped: administrators need to have a 419 very good reason for dropping this category 420 o Messages that may be dropped but it is not essential because they 421 would normally be dropped for other reasons (e.g., because they 422 would be using link-local addresses) or the protocol specification 423 would cause them to be rejected if they had passed through a 424 router. 425 o Messages that administrators may or may not want to drop depending 426 on local policy. 427 o Messages that administrators should consider dropping (e.g., ICMP 428 node information name lookup queries) 430 More detailed analysis of each of the message types can be found in 431 Appendix A. 433 4.1. Common Considerations 435 Depending on the classification of the message to be filtered (see 436 Section 2), ICMPv6 messages should be filtered based on the ICMPv6 437 type of the message and the type (unicast, multicast, etc.) and scope 438 (link-local, global unicast, etc) of source and destination 439 addresses. In some cases it may be desirable to filter on the Code 440 field of ICMPv6 error messages. 442 Messages that are authenticated by means of an IPsec AH or ESP header 443 may be subject to less strict policies than unauthenticated messages. 444 In the remainder of this section, we are generally considering what 445 should be configured for unauthenticated messages. In many cases it 446 is not realistic to expect more than a tiny fraction of the messages 447 to be authenticated. 449 Where messages are not essential to the establishment of 450 communications, local policy can be used to determine whether a 451 message should be allowed or dropped. 453 Many of the messages used for establishment of communications on the 454 local link will be sent with link-local addresses for at least one of 455 their source and destination. Routers (and firewalls) conforming to 456 the IPv6 standards will not forward these packets; there is no need 457 to configure additional rules to prevent these packets traversing the 458 firewall/router. Also the specifications of ICMPv6 messages intended 459 for use only on the local link specify various measures which would 460 allow receivers to detect if the message had passed through a 461 firewall/router, including: 462 o Requiring that the hop count in the IPv6 header is set to 255 on 463 transmission. On reception the hop count is required to be still 464 255 which would not be the case if the packet had passed through a 465 firewall/router. 466 o Checking that the source address is a link-local unicast address. 467 Accordingly it is not essential to configure firewall rules to drop 468 illegal packets of these types. If they have non-link-local source 469 and destination addresses, allowing them to traverse the firewall, 470 they would be rejected because of the checks performed at the 471 destination. However, firewall administrators may still wish to log 472 or drop such illegal packets. 474 Depending on the capabilities of the firewall being configured, it 475 may be possible for the firewall to maintain state about packets that 476 may result in error messages being returned or about ICMPv6 packets 477 (e.g., Echo Requests) that are expected to receive a specific 478 response. This state may allow the firewall to perform more precise 479 checks based on this state, and to apply limits on the number of 480 ICMPv6 packets accepted incoming or outgoing as a result of a packet 481 traveling in the opposite direction. The capabilities of firewalls 482 to perform such stateful packet inspection vary from model to model, 483 and it is not assumed that firewalls are uniformly capable in this 484 respect. 486 Firewalls which are able to perform deep packet inspection may be 487 able to check the header fields in the start of the errored packet 488 which is carried by ICMPv6 error messages. If the embedded packet 489 has a source address which does not match the destination of the 490 error message the packet can be dropped. This provides a partial 491 defense against some possible attacks on TCP that use spoofed ICMPv6 492 error messages, but the checks can also be carried out at the 493 destination. For further information on these attacks see [I-D.gont- 494 tcpm-icmp-attacks]. 496 In general, the scopes of source and destination addresses of ICMPv6 497 messages should be matched, and packets with mismatched addresses 498 should be dropped if they attempt to transit a router. However some 499 of the address configuration messages carried locally on a link may 500 legitimately have mismatched addresses. Node implementations need to 501 avoid over-zealous filtering of these messages delivered locally on a 502 link. 504 4.2. Recommendations for ICMPv6 Transit Traffic 506 This section recommends rules that should be applied to ICMPv6 507 traffic attempting to transit a firewall. 509 4.2.1. Traffic that Must NOT be Dropped 511 Error messages that are essential to the establishment of 512 communications: 513 o Destination Unreachable (Type 1) - All codes 514 o Packet Too Big (Type 2) 515 o Time Exceeded (Type 3) - Code 0 only 516 o Parameter Problem (Type 4) - Codes 1 and 2 only 517 Appendix A.4 suggests some more specific checks that could be 518 performed on Parameter Problem messages if a firewall has the 519 necessary packet inspection capabilities. 521 Connectivity checking messages: 522 o Echo Request (Type 128) 523 o Echo Response (Type 129) 524 For Teredo tunneling [RFC4380] to IPv6 nodes on the site to be 525 possible, it is essential that the connectivity checking messages are 526 allowed through the firewall. It has been common practice in IPv4 527 networks to drop Echo Request messages in firewalls to minimize the 528 risk of scanning attacks on the protected network. As discussed in 529 Section 3.2, the risks from port scanning in an IPv6 network are much 530 less severe and it is not necessary to filter IPv6 Echo Request 531 messages. 533 4.2.2. Traffic that Normally Should Not be Dropped 535 Error messages other than those listed in Section 4.2.1 536 o Time Exceeded (Type 3) - Code 1 537 o Parameter Problem (Type 4) - Code 0 539 Mobile IPv6 messages that are needed to assist mobility: 540 o Home Agent Address Discovery Request (Type 144) 541 o Home Agent Address Discovery Reply (Type 145) 542 o Mobile Prefix Solicitation (Type 146) 543 o Mobile Prefix Advertisement(Type 147) 544 Administrators may wish to apply more selective rules as described in 545 Appendix A.14 depending on whether the site is catering for mobile 546 nodes which would normally be at home on the site and/or foreign 547 mobile nodes roaming onto the site. 549 4.2.3. Traffic that May be Dropped but will be Caught Anyway 551 The messages listed in this section are all involved with local 552 management of nodes connected to the link on which they were 553 initially transmitted. All these messages should never be propagated 554 beyond the link on which they were initially transmitted. During 555 normal operations these messages will have destination addresses, 556 mostly link local but in some cases global unicast addresses, of 557 interfaces on the local link. No special action is needed to filter 558 messages with link-local addresses. As discussed in Section 4.1 559 these messages are specified so that either the receiver is able to 560 check that the message has not passed through a firewall/router or it 561 will be dropped at the first router it encounters. Administrators 562 may wish to consider providing rules to catch illegal packets sent 563 with Hop Count = 1 to avoid ICMPv6 Time Exceeded messages being 564 generated for these packets. 566 Address Configuration and Router Selection messages (must be received 567 with Hop Count = 255): 568 o Router Solicitation (Type 133) 569 o Router Advertisement (Type 134) 570 o Neighbor Solicitation (Type 135) 571 o Neighbor Advertisement (Type 136) 572 o Redirect (Type 137) 573 o Inverse Neighbor Discovery Solicitation (Type 141) 574 o Inverse Neighbor Discovery Advertisement (Type 142) 576 Link-local multicast receiver notification messages (must have link- 577 local source address): 578 o Listener Query (Type 130) 579 o Listener Report (Type 131) 580 o Listener Done (Type 132) 581 o Listener Report v2 (Type 143) 583 SEND Certificate Path notification messages (must be received with 584 Hop Count = 255): 585 o Certificate Path Solicitation (Type 148) 586 o Certificate Path Advertisement (type 149) 588 Multicast Router Discovery messages (must have link-local source 589 address and Hop Count = 1): 591 o Multicast Router Advertisement (Type 151) 592 o Multicast Router Solicitation (Type 152) 593 o Multicast Router Termination (Type 153) 595 4.2.4. Traffic for which a Dropping Policy Should be Defined 597 The message which the experimental Seamoby protocols are using will 598 be expected to have to cross site boundaries. Administrators should 599 determine if they need to support these experiments and otherwise 600 messages of this type should be dropped: 601 o Seamoby Experimental (Type 150) 603 Error messages not currently defined by IANA: 604 o Unallocated Error messages (Types 5-99 and 102-126, inclusive) 606 The base ICMPv6 specification suggests that error messages which are 607 not explicitly known to a node should be forwarded and passed to any 608 higher level protocol that might be able to interpret them. There is 609 a small risk that such messages could be used to provide a covert 610 channel or form part of a DoS attack. Administrators should be aware 611 of this and determine whether they wish to allow these messages 612 through the firewall. 614 4.2.5. Traffic which Should be Dropped Unless a Good Case can be Made 616 Node Information enquiry messages should generally not be forwarded 617 across site boundaries. Some of these messages will be using non- 618 link-local unicast addresses so that they will not necessarily be 619 dropped by address scope limiting rules: 620 o Node Information Query (Type 139) 621 o Node Information Response (Type 140) 623 Router Renumbering messages should not be forwarded across site 624 boundaries. As originally specified, these messages may use a site 625 scope multicast address or a site local unicast address. They should 626 be caught by standard rules that are intended to stop any packet with 627 a multicast site scope or site local destination being forwarded 628 across a site boundary provided these are correctly configured. 629 Since site local addresses have now been deprecated it seems likely 630 that changes may be made to allow the use of unique local addresses 631 or global unicast addresses. Should this happen, it will be 632 essential to explicitly filter these messages: 633 o Router Renumbering (Type 139) 635 Messages with types in the experimental allocations: 636 o Types 100, 101, 200 and 201. 638 Messages using the extension type numbers until such time as ICMPv6 639 needs to use such extensions: 640 o Types 127 and 255. 642 All informational messages with types not explicitly assigned by 643 IANA, currently: 644 o Types 154 - 199 inclusive and 202 - 254 inclusive. 646 4.3. Recommendations for ICMPv6 Local Configuration Traffic 648 This section recommends filtering rules for ICMPv6 traffic addressed 649 to an interface on a firewall. For a small number of messages, the 650 desired behavior may differ between interfaces on the site or private 651 side of the firewall and the those on the public Internet side of the 652 firewall. 654 4.3.1. Traffic that Must NOT be Dropped 656 Error messages that are essential to the establishment of 657 communications: 658 o Destination Unreachable (Type 1) - All codes 659 o Packet Too Big (Type 2) 660 o Time Exceeded (Type 3) - Code 0 only 661 o Parameter Problem (Type 4) - Codes 1 and 2 only 663 Connectivity checking messages: 664 o Echo Request (Type 128) 665 o Echo Response (Type 129) 666 As discussed in Section 4.2.1, dropping connectivity checking 667 messages will prevent the firewall being the destination of a Teredo 668 tunnel and it is not considered necessary to disable connectivity 669 checking in IPv6 networks because port scanning is less of a security 670 risk. 672 There are a number of other sets of messages which play a role in 673 configuring the node and maintaining unicast and multicast 674 communications through the interfaces of a node. These messages must 675 not be dropped if the node is to successfully participate in an IPv6 676 network. The exception to this is the Redirect message for which an 677 explicit policy decision should be taken (see Section 4.3.4). 679 Address Configuration and Router Selection messages: 680 o Router Solicitation (Type 133) 681 o Router Advertisement (Type 134) 682 o Neighbor Solicitation (Type 135) 683 o Neighbor Advertisement (Type 136) 684 o Inverse Neighbor Discovery Solicitation (Type 141) 685 o Inverse Neighbor Discovery Advertisement (Type 142) 687 Link-local multicast receiver notification messages: 688 o Listener Query (Type 130) 689 o Listener Report (Type 131) 690 o Listener Done (Type 132) 691 o Listener Report v2 (Type 143) 693 SEND Certificate Path notification messages: 694 o Certificate Path Solicitation (Type 148) 695 o Certificate Path Advertisement (type 149) 697 Multicast Router Discovery messages : 698 o Multicast Router Advertisement (Type 151) 699 o Multicast Router Solicitation (Type 152) 700 o Multicast Router Termination (Type 153) 702 4.3.2. Traffic that Normally Should Not be Dropped 704 Error messages other than those listed in Section 4.3.1: 705 o Time Exceeded (Type 3) - Code 1 706 o Parameter Problem (Type 4) - Code 0 708 4.3.3. Traffic that May be Dropped but will be Caught Anyway 710 Router Renumbering messages must be authenticated using IPsec, so it 711 is not essential to filter these messages even if they are not 712 allowed at the firewall: 713 o Router Renumbering (Type 139) 715 Mobile IPv6 messages that are needed to assist mobility: 716 o Home Agent Address Discovery Request (Type 144) 717 o Home Agent Address Discovery Reply (Type 145) 718 o Mobile Prefix Solicitation (Type 146) 719 o Mobile Prefix Advertisement(Type 147) 720 It may be desirable to drop these messages, especially on public 721 interfaces, if the firewall is not also providing mobile Home Agent 722 services, but they will be ignored otherwise. 724 The message used by the experimental Seamoby protocols may be dropped 725 but will be ignored if the service is not implemented: 726 o Seamoby Experimental (Type 150) 728 4.3.4. Traffic for which a Dropping Policy Should be Defined 730 Redirect messages provide a significant security risk and 731 administrators should take a case-by-case view of whether firewalls, 732 routers in general and other nodes should accept these messages: 734 o Redirect (Type 137) 735 Conformant nodes must provide configuration controls which allow 736 nodes to control their behavior with respect to Redirect messages so 737 that it should only be necessary to install specific filtering rules 738 under special circumstances, such as if Redirect messages are 739 accepted on private interfaces but not public ones. 741 If a node implements the experimental Node Information service, the 742 administrator needs to make an explicit decision as to whether the 743 node should respond to or accept Node Information messages on each 744 interface: 745 o Node Information Query (Type 139) 746 o Node Information Response (Type 140) 747 It may be possible to disable the service on the node if it is not 748 wanted in which case these messages will ignored and no filtering is 749 necessary. 751 Error messages not currently defined by IANA: 752 o Unallocated Error messages (Types 5-99 and 102-126, inclusive) 754 The base ICMPv6 specification suggests that error messages which are 755 not explicitly known to a node should be forwarded and passed to any 756 higher level protocol that might be able to interpret them. There is 757 a small risk that such messages could be used to provide a covert 758 channel or form part of a DoS attack. Administrators should be aware 759 of this and determine whether they wish to allow these messages to be 760 sent to the firewall. 762 4.3.5. Traffic which Should be Dropped Unless a Good Case can be Made 764 Messages with types in the experimental allocations: 765 o Types 100, 101, 200 and 201. 767 Messages using the extension type numbers until such time as ICMPv6 768 needs to use such extensions: 769 o Types 127 and 255. 771 All informational messages with types not explicitly assigned by 772 IANA, currently: 773 o Types 154 - 199 inclusive and 202 - 254 inclusive. 775 5. IANA Considerations 777 There are no IANA considerations defined in this document. 779 6. Acknowledgements 781 Pekka Savola created the original IPv6 Security Overview document 782 which contained suggestions for ICMPv6 filter setups. This 783 information has been incorporated into this document. He has also 784 provided important comments. Some analysis of the classification of 785 ICMPv6 messages and the term 'any-to-end' were used by Jari Arkko in 786 a draft relating to ICMPv6 and IKE. 788 The Netfilter configuration script in Appendix C was contributed by 789 Suresh Krishnan. 791 7. References 793 7.1. Normative References 795 [I-D.ietf-ipngwg-icmp-name-lookups] 796 Crawford, M. and B. Haberman, "IPv6 Node Information 797 Queries", draft-ietf-ipngwg-icmp-name-lookups-15 (work in 798 progress), February 2006. 800 [I-D.ietf-ipngwg-icmp-v3] 801 Conta, A., "Internet Control Message Protocol (ICMPv6) for 802 the Internet Protocol Version 6 (IPv6) Specification", 803 draft-ietf-ipngwg-icmp-v3-07 (work in progress), 804 July 2005. 806 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 807 for IP version 6", RFC 1981, August 1996. 809 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 810 (IPv6) Specification", RFC 2460, December 1998. 812 [RFC2462] Thomson, S. and T. Narten, "IPv6 Stateless Address 813 Autoconfiguration", RFC 2462, December 1998. 815 [RFC2710] Deering, S., Fenner, W., and B. Haberman, "Multicast 816 Listener Discovery (MLD) for IPv6", RFC 2710, 817 October 1999. 819 [RFC2894] Crawford, M., "Router Renumbering for IPv6", RFC 2894, 820 August 2000. 822 [RFC3122] Conta, A., "Extensions to IPv6 Neighbor Discovery for 823 Inverse Discovery Specification", RFC 3122, June 2001. 825 [RFC3590] Haberman, B., "Source Address Selection for the Multicast 826 Listener Discovery (MLD) Protocol", RFC 3590, 827 September 2003. 829 [RFC3775] Johnson, D., Perkins, C., and J. Arkko, "Mobility Support 830 in IPv6", RFC 3775, June 2004. 832 [RFC3810] Vida, R. and L. Costa, "Multicast Listener Discovery 833 Version 2 (MLDv2) for IPv6", RFC 3810, June 2004. 835 [RFC3971] Arkko, J., Kempf, J., Zill, B., and P. Nikander, "SEcure 836 Neighbor Discovery (SEND)", RFC 3971, March 2005. 838 [RFC4065] Kempf, J., "Instructions for Seamoby and Experimental 839 Mobility Protocol IANA Allocations", RFC 4065, July 2005. 841 [RFC4286] Haberman, B. and J. Martin, "Multicast Router Discovery", 842 RFC 4286, December 2005. 844 [RFC4311] Hinden, R. and D. Thaler, "IPv6 Host-to-Router Load 845 Sharing", RFC 4311, November 2005. 847 [RFC4443] Conta, A., Deering, S., and M. Gupta, "Internet Control 848 Message Protocol (ICMPv6) for the Internet Protocol 849 Version 6 (IPv6) Specification", RFC 4443, March 2006. 851 7.2. Informative References 853 [I-D.chown-v6ops-port-scanning-implications] 854 Chown, T., "IPv6 Implications for TCP/UDP Port Scanning", 855 draft-chown-v6ops-port-scanning-implications-02 (work in 856 progress), October 2005. 858 [I-D.gont-tcpm-icmp-attacks] 859 Gont, F., "ICMP attacks against TCP", 860 draft-gont-tcpm-icmp-attacks-05 (work in progress), 861 October 2005. 863 [RFC3041] Narten, T. and R. Draves, "Privacy Extensions for 864 Stateless Address Autoconfiguration in IPv6", RFC 3041, 865 January 2001. 867 [RFC4380] Huitema, C., "Teredo: Tunneling IPv6 over UDP through 868 Network Address Translations (NATs)", RFC 4380, 869 February 2006. 871 [netfilter] 872 netfilter.org, "The netfilter.org project", Firewalling, 873 NAT and Packet Mangling for Linux , 2006, 874 . 876 Appendix A. Notes on Individual ICMPv6 Messages 878 A.1. Destination Unreachable Error Message 880 Destination Unreachable (Type 1) error messages [RFC4443] are sent 881 any-to-end between unicast addresses. The message can be generated 882 from any node which a packet traverses when the node is unable to 883 forward the packet for any reason except congestion. 885 Destination Unreachable messages are useful for debugging but are 886 also important to speed up cycling through possible addresses, as 887 they can avoid the need to wait through timeouts and hence can be 888 part of the process of establishing communications. It is a common 889 practice in IPv4 to refrain from generating ICMP Destination 890 Unreachable messages in an attempt to hide the networking topology 891 and/or service structure. The same idea could be applied to IPv6 but 892 this can slow down connection if a host has multiple addresses, some 893 of which are deprecated, as they may be when using privacy addresses 894 [RFC3041]. If policy allows the generation of ICMPv6 Destination 895 Unreachable messages, it is important that nodes provide the correct 896 reason code, one of: no route to destination, administratively 897 prohibited, beyond scope of source address, address unreachable, port 898 unreachable, source address failed ingress/egress policy, reject 899 route to destination. 901 A.2. Packet Too Big Error Message 903 Packet Too Big (Type 2) error messages [RFC4443] are sent any-to-end 904 between unicast addresses. The message can be generated from any 905 node which a packet traverses on the path when the node is unable to 906 forward the packet because the packet is too large for the MTU of the 907 next link. This message is vital to the correct functioning of Path 908 MTU Discovery and hence is part of the establishment of 909 communications. Since routers are not allowed to fragment packets, 910 informing sources of the need to fragment large packets is more 911 important than for IPv4. If these messages are not generated when 912 appropriate, hosts will continue to send packets which are too large 913 or may assume that the route is congested. Effectively parts of the 914 Internet will become inaccessible. 916 If a network chooses to generate packets that are no larger than the 917 Guaranteed Minimum MTU (1280 octets) and the site's links to the 918 wider internet have corresponding MTUs, Packet Too Big messages 919 should not be expected at the firewall and could be dropped if they 920 arrive. 922 A.3. Time Exceeded Error Message 924 Time Exceeded (Type 3) error messages [RFC4443] can occur in two 925 contexts: 926 o Code 0 are generated at any node on the path being taken by the 927 packet and sent, any-to-end between unicast addresses, if the Hop 928 Limit value is decremented to zero at that node. 929 o Code 1 messages are generated at the destination node and sent 930 end-to-end between unicast addresses if all the segments of a 931 fragmented message are not received within the reassembly time 932 limit 934 Code 0 messages can be needed as part of the establishment of 935 communications if the path to a particular destination requires an 936 unusually large number of hops. 938 Code 1 messages will generally only result from congestion in the 939 network and it is less essential to propagate these messages. 941 A.4. Parameter Problem Error Message 943 The great majority of Parameter Problem (Type 4) error messages will 944 be generated by the destination node when processing destination 945 options and other extension headers, and hence are sent end-to-end 946 between unicast addresses. Exceptionally, these messages might be 947 generated by any node on the path if a faulty or unrecognized hop-by- 948 hop option is included or from any routing waypoint if there are 949 faulty or unrecognized destination options associated with a Type 0 950 routing header. In these cases the message will be sent any-to-end 951 using unicast source and destination addresses. 953 Parameter Problem Code 1 (Unrecognized Next Header) and Code 2 954 (Unrecognized IPv6 Option) messages may result if a node on the path 955 (usually the destination) is unable to process a correctly formed 956 extension header or option. If these messages are not returned to 957 the source communication cannot be established, as the source would 958 need to adapt its choice of options probably because the destination 959 does not implement these capabilities. Hence these messages need to 960 be generated and allowed for effective IPv6 communications. 962 Code 0 (Erroneous Header) messages indicate a malformed extension 963 header generally as a result of incorrectly generated packets. Hence 964 these messages are useful for debugging purposes but it is unlikely 965 that a node generating such packets could establish communications 966 without human intervention to correct the problem. 968 Code 2 messages, only, can be generated for packets with multicast 969 destination addresses. 971 It is possible that attackers may seek to probe or scan a network by 972 deliberately generating packets with unknown extension headers or 973 options, or faulty headers. If nodes generate Parameter Problem 974 error messages in all cases and these outgoing messages are allowed 975 through firewalls, the attacker may be able to identify active 976 addresses that can be probed further or learn about the network 977 topology. The vulnerability could be mitigated whilst helping to 978 establish communications if the firewall was able to examine such 979 error messages in depth and was configured to only allow Parameter 980 Problem messages for headers which had been standardized but were not 981 supported in the protected network. If the network administrator 982 believes that all nodes in the network support all legitimate 983 extension headers then it would be reasonable to drop all outgoing 984 Parameter Problem messages. Note that this is not a major 985 vulnerability in a well-designed IPv6 network because of the 986 difficulties of performing scanning attacks (see Section 3.2). 988 A.5. ICMPv6 Echo Request and Echo Response 990 Echo Request (Type 128) uses unicast addresses as source addresses, 991 but may be sent to any legal IPv6 address, including multicast and 992 anycast addresses [RFC4443]. Echo Requests travel end-to-end. 993 Similarly Echo Responses (Type 129) travel end-to-end and would have 994 a unicast address as destination and either a unicast or anycast 995 address as source. They are mainly used in combination for 996 monitoring and debugging connectivity. Their only role in 997 establishing communication is that they are required when verifying 998 connectivity through Teredo tunnels[RFC4380]: Teredo tunneling to 999 IPv6 nodes on the site will not be possible if these messages are 1000 blocked. It is not thought that there is a significant risk from 1001 scanning attacks on a well-designed IPv6 network (see Section 3.2) 1002 and so connectivity checks should be allowed by default. 1004 A.6. Neighbor Solicitation and Neighbor Advertisement Messages 1006 ICMPv6 Neighbor Solicitation and Neighbor Advertisement (Type 135 and 1007 136) messages are essential to the establishment of communications on 1008 the local link. Firewalls need to generate and accept these messages 1009 to allow them to establish interfaces onto their connected links. 1011 Note that the address scopes of the source and destination addresses 1012 on Neighbor Solicitations and Neighbor Advertisements may not match. 1013 The exact functions which these messages will be carrying out depends 1014 on the mechanism being used to configure IPv6 addresses on the link 1015 (Stateless, Stateful or Static configuration). 1017 A.7. Router Solicitation and Router Advertisement Messages 1019 ICMPv6 Router Solicitation and Router Advertisement(Type 133 and 134) 1020 messages are essential to the establishment of communications on the 1021 local link. Firewalls need to generate (since the firewall will 1022 generally be behaving as a router) and accept these messages to allow 1023 them to establish interfaces onto their connected links. 1025 A.8. Redirect Messages 1027 ICMPv6 Redirect Messages(Type 137) are used on the local link to 1028 indicate that nodes are actually link-local and communications need 1029 not go via a router, or to indicate a more appropriate first hop 1030 router. Although they can be used to make communications more 1031 efficient, they are not essential to the establishment of 1032 communications and may be a security vulnerability, particularly if a 1033 link is not physically secured. Conformant nodes are required to 1034 provide configuration controls which suppress the generation of 1035 Redirect messages and allow them to be ignored on reception. Using 1036 Redirect messages on a wireless link is particularly hazardous 1037 because of the lack of physical security. 1039 A.9. SEND Certificate Path Messages 1041 SEND [RFC3971] uses two messages (Certificate Path Solicitation and 1042 Advertisement - Types 148 and 149) sent from nodes to supposed 1043 routers on the same local link to obtain a certificate path which 1044 will allow the node to authenticate the router's claim to provide 1045 routing services for certain prefixes. If a link connected to a 1046 firewall/router is using SEND, the firewall must be able to exchange 1047 these messages with nodes on the link that will use its routing 1048 services. 1050 A.10. Multicast Listener Discovery Messages 1052 Multicast Listener Discovery (MLD) version 1 [RFC2710] (Listener 1053 Query, Listener Report and Listener Done - Types 130, 131 and 132) 1054 and version 2 [RFC3810] (Listener Query and Listener Report Version 2 1055 - Types 130 and 143) messages are sent on the local link to 1056 communicate between multicast capable routers and nodes which wish to 1057 join or leave specific multicast groups. Firewalls need to be able 1058 to generate Listener messages in order to establish communications 1059 and may generate all the messages if they also provide multicast 1060 routing services. 1062 A.11. Multicast Router Discovery Messages 1064 Multicast Router Discovery [RFC4286] (Router Advertisement, Router 1065 Solicitation and Router Termination - Types 151, 152 and 153) 1066 messages are sent by nodes on the local link to discover multicast 1067 capable routers on the link, and by multicast capable routers to 1068 notify other nodes of their existence or change of state. Firewalls 1069 which also act as multicast routers need to process these messages on 1070 their interfaces. 1072 A.12. Router Renumbering Messages 1074 ICMPv6 Router Renumbering (Type 138) command messages can be received 1075 and results messages sent by routers to change the prefixes which 1076 they advertise as part of Stateless Address Configuration [RFC4311], 1077 [RFC2462]. These messages are sent end-to-end to either the all- 1078 routers multicast address (site or local scope) or specific unicast 1079 addresses from a unicast address. 1081 Router Renumbering messages are required to be protected by IPsec 1082 authentication since they could be readily misused by attackers to 1083 disrupt or divert site communications. Renumbering messages should 1084 generally be confined to sites for this reason. 1086 A.13. Node Information Query and Reply 1088 ICMPv6 Node Information Query and Reply (Type 139 and 140) messages 1089 are sent end-to-end between unicast addresses, and can also be sent 1090 to link-local multicast addresses. They can, in theory, be sent from 1091 any node to any other but it would generally not be desirable for 1092 nodes outside the local site to be able to send queries to nodes 1093 within the site. Also these messages are not required to be 1094 authenticated. 1096 A.14. Mobile IPv6 Messages 1098 Mobile IPv6 [RFC3775] defines four ICMPv6 messages which are used to 1099 support mobile operations: Home Agent Address Discovery Request, Home 1100 Agent Address Discovery Reply, Mobile Prefix Solicitation and ICMP 1101 Mobile Prefix Advertisement(Type 144, 145, 146 and 147) messages. 1102 These messages are sent end-to-end between unicast addresses of a 1103 mobile node and its home agent. They must be expected to be sent 1104 from outside a site. The two Mobile prefix messages should be 1105 protected by the use of IPsec authentication. 1106 o If the site provides home agents for mobile nodes, the firewall 1107 must allow incoming Home Agent Address Discovery Request and 1108 Mobile Prefix Solicitation messages, and outgoing Home Agent 1109 Address Discovery Reply and ICMP Mobile Prefix Advertisement 1110 messages. It may be desirable to limit the destination addresses 1111 for the incoming messages to links that are known to support home 1112 agents. 1114 o If the site is prepared to host roaming mobile nodes, the firewall 1115 must allow outgoing Home Agent Address Discovery Request and 1116 Mobile Prefix Solicitation messages, and incoming Home Agent 1117 Address Discovery Reply and ICMP Mobile Prefix Advertisement 1118 messages. 1119 o Administrators may find it desirable to prevent static nodes which 1120 are normally resident on the site from behaving as mobile nodes by 1121 dropping Mobile IPv6 messages from these nodes. 1123 A.15. Unused and Experimental Messages 1125 A large number of ICMPv6 Type values are currently unused. These 1126 values have not had a specific function registered with IANA. This 1127 section describes how to treat messages which attempt to use these 1128 Type values in a way of which the network administrator (and hence 1129 the firewall) is not aware. 1131 [I-D.ietf-ipngwg-icmp-v3] defines a number of experimental Type 1132 values for ICMPv6 Error and Informational messages, which could be 1133 used in site specific ways. These values should be treated in the 1134 same way as values which are not registered by IANA unless the 1135 network administrator is explicitly made aware of usage. 1137 The codes reserved for future extension of the ICMPv6 Type space 1138 should currently be dropped as this functionality is as yet 1139 undefined. 1141 Any ICMPv6 Informational messages of which the firewall is not aware 1142 should not be allowed to pass through the firewall or be accepted for 1143 local delivery on any of its interfaces. 1145 Any incoming ICMPv6 Error messages of which the firewall is not aware 1146 may be allowed through the firewall in line with the specification in 1147 [RFC4443], which requests delivery of unknown error messages to 1148 higher layer protocol processes. However, administrators may wish to 1149 disallow forwarding of these incoming messages as a potential 1150 security risk. Unknown outgoing Error messages should be dropped as 1151 the administrator should be aware of all messages that could be 1152 generated on the site. 1154 Also the Seamoby working group has had an ICMPv6 message (Type 150) 1155 allocated for experimental use in two protocols. This message is 1156 sent end-to-end and may need to pass through firewalls on sites that 1157 are supporting the experimental protocols. 1159 Appendix B. Example Script to Configure ICMPv6 Firewall Rules 1160 This appendix contains an example script to implement most of the 1161 rules suggested in this document when using the Netfilter packet 1162 filtering system for Linux [netfilter]. When used with IPv6, the 1163 'ip6tables' command is used to configure packet filtering rules for 1164 the Netfilter system. The script is targeted at a simple enterprise 1165 site that may or may not support Mobile IPv6. 1167 #!/bin/bash 1168 # Set of prefixes on the trusted ("inner") side of the firewall 1169 export INNER_PREFIXES="2001:DB8:85::/60" 1170 # Set of hosts providing services so that they can be made pingable 1171 export PINGABLE_HOSTS="2001:DB8:85::/64" 1172 # Configuration option: Change this to 1 if errors allowed only for 1173 # existing sessions 1174 export STATE_ENABLED=0 1175 # Configuration option: Change this to 0 if the site does not support 1176 # Mobile IPv6 Home Agents - see Appendix A.14 1177 export HOME_AGENTS_PRESENT=1 1178 # Configuration option: Change this to 0 if the site does not support 1179 # Mobile IPv6 mobile nodes being present on the site - 1180 # see Appendix A.14 1181 export MOBILE_NODES_PRESENT=1 1183 ip6tables -N icmpv6-filter 1184 ip6tables -A FORWARD -p icmpv6 -j icmpv6-filter 1186 # Match scope of src and dest else deny 1187 # This capability is not provided for in base ip6tables functionality 1188 # An extension (agr) exists which may support it. 1189 #@TODO@ 1191 # ECHO REQUESTS AND RESPONSES 1192 # =========================== 1194 # Allow outbound echo requests from prefixes which belong to the site 1195 # for inner_prefix in $INNER_PREFIXES 1196 do 1197 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1198 --icmpv6-type echo-request -j ACCEPT 1199 done 1201 # Allow inbound echo requests towards only predetermined hosts 1202 # for pingable_host in $PINGABLE_HOSTS 1203 do 1204 ip6tables -A icmpv6-filter -p icmpv6 -d $pingable_host \ 1205 --icmpv6-type echo-request -j ACCEPT 1206 done 1207 if [ "$STATE_ENABLED" -eq "1" ] 1208 then 1209 # Allow incoming and outgoing echo reply messages 1210 # only for existing sessions 1211 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1212 --state ESTABLISHED,RELATED --icmpv6-type \ 1213 echo-reply -j ACCEPT 1214 else 1215 # Allow both incoming and outgoing echo replies 1216 for pingable_host in $PINGABLE_HOSTS 1217 do 1218 # Outgoing echo replies from pingable hosts 1219 ip6tables -A icmpv6-filter -p icmpv6 -s $pingable_host \ 1220 --icmpv6-type echo-reply -j ACCEPT 1221 done 1222 # Incoming echo replies to prefixes which belong to the site 1223 for inner_prefix in $INNER_PREFIXES 1224 do 1225 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1226 --icmpv6-type echo-reply -j ACCEPT 1227 done 1228 fi 1230 # Deny icmps to/from link local addresses 1231 ip6tables -A icmpv6-filter -p icmpv6 -d fe80::/10 -j DROP 1232 ip6tables -A icmpv6-filter -p icmpv6 -s fe80::/10 -j DROP 1234 # Drop echo replies which have a multicast address as a 1235 # destination 1236 ip6tables -A icmpv6-filter -p icmpv6 -d ff00::/8 \ 1237 --icmpv6-type echo-reply -j DROP 1239 # DESTINATION UNREACHABLE ERROR MESSAGES 1240 # ====================================== 1242 if [ "$STATE_ENABLED" -eq "1" ] 1243 then 1244 # Allow incoming destination unreachable messages 1245 # only for existing sessions 1246 for inner_prefix in $INNER_PREFIXES 1247 do 1248 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1249 -d $inner_prefix \ 1250 --state ESTABLISHED,RELATED --icmpv6-type \ 1251 destination-unreachable -j ACCEPT 1252 done 1253 else 1254 # Allow incoming destination unreachable messages 1255 for inner_prefix in $INNER_PREFIXES 1256 do 1257 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1258 --icmpv6-type destination-unreachable -j ACCEPT 1259 done 1260 fi 1262 # Allow outgoing destination unreachable messages 1263 for inner_prefix in $INNER_PREFIXES 1264 do 1265 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1266 --icmpv6-type destination-unreachable -j ACCEPT 1267 done 1269 # PACKET TOO BIG ERROR MESSAGES 1270 # ============================= 1272 if [ "$STATE_ENABLED" -eq "1" ] 1273 then 1274 # Allow incoming Packet Too Big messages 1275 # only for existing sessions 1276 for inner_prefix in $INNER_PREFIXES 1277 do 1278 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1279 -d $inner_prefix \ 1280 --state ESTABLISHED,RELATED \ 1281 --icmpv6-type packet-too-big \ 1282 -j ACCEPT 1283 done 1284 else 1285 # Allow incoming Packet Too Big messages 1286 for inner_prefix in $INNER_PREFIXES 1287 do 1288 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1289 --icmpv6-type packet-too-big -j ACCEPT 1290 done 1291 fi 1293 # Allow outgoing Packet Too Big messages 1294 for inner_prefix in $INNER_PREFIXES 1295 do 1296 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1297 --icmpv6-type packet-too-big -j ACCEPT 1298 done 1300 # TIME EXCEEDED ERROR MESSAGES 1301 # ============================ 1302 if [ "$STATE_ENABLED" -eq "1" ] 1303 then 1304 # Allow incoming time exceeded code 0 messages 1305 # only for existing sessions 1306 for inner_prefix in $INNER_PREFIXES 1307 do 1308 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1309 -d $inner_prefix \ 1310 --state ESTABLISHED,RELATED --icmpv6-type packet-too-big \ 1311 -j ACCEPT 1312 done 1313 else 1314 # Allow incoming time exceeded code 0 messages 1315 for inner_prefix in $INNER_PREFIXES 1316 do 1317 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1318 --icmpv6-type ttl-zero-during-transit -j ACCEPT 1319 done 1320 fi 1322 #@POLICY@ 1323 # Allow incoming time exceeded code 1 messages 1324 for inner_prefix in $INNER_PREFIXES 1325 do 1326 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1327 --icmpv6-type ttl-zero-during-reassembly -j ACCEPT 1328 done 1330 # Allow outgoing time exceeded code 0 messages 1331 for inner_prefix in $INNER_PREFIXES 1332 do 1333 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1334 --icmpv6-type ttl-zero-during-transit -j ACCEPT 1335 done 1337 #@POLICY@ 1338 # Allow outgoing time exceeded code 1 messages 1339 for inner_prefix in $INNER_PREFIXES 1340 do 1341 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1342 --icmpv6-type ttl-zero-during-reassembly -j ACCEPT 1343 done 1345 # PARAMETER PROBLEM ERROR MESSAGES 1346 # ================================ 1348 if [ "$STATE_ENABLED" -eq "1" ] 1349 then 1350 # Allow incoming parameter problem code 1 and 2 messages 1351 # for an existing session 1352 for inner_prefix in $INNER_PREFIXES 1353 do 1354 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1355 -d $inner_prefix \ 1356 --state ESTABLISHED,RELATED --icmpv6-type \ 1357 unknown-header-type \ 1358 -j ACCEPT 1359 ip6tables -A icmpv6-filter -m state -p icmpv6 \ 1360 -d $inner_prefix \ 1361 --state ESTABLISHED,RELATED \ 1362 --icmpv6-type unknown-option \ 1363 -j ACCEPT 1364 done 1365 fi 1367 # Allow outgoing parameter problem code 1 and code 2 messages 1368 for inner_prefix in $INNER_PREFIXES 1369 do 1370 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1371 --icmpv6-type unknown-header-type -j ACCEPT 1372 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1373 --icmpv6-type unknown-option -j ACCEPT 1374 done 1376 #@POLICY@ 1377 # Allow incoming and outgoing parameter 1378 # problem code 0 messages 1379 for inner_prefix in $INNER_PREFIXES 1380 do 1381 ip6tables -A icmpv6-filter -p icmpv6 \ 1382 --icmpv6-type bad-header \ 1383 -j ACCEPT 1384 done 1386 # NEIGHBOR DISCOVERY MESSAGES 1387 # =========================== 1389 # Drop NS/NA messages both incoming and outgoing 1390 ip6tables -A icmpv6-filter -p icmpv6 \ 1391 --icmpv6-type neighbor-solicitation -j DROP 1392 ip6tables -A icmpv6-filter -p icmpv6 \ 1393 --icmpv6-type neighbor-advertisement -j DROP 1395 # Drop RS/RA messages both incoming and outgoing 1396 ip6tables -A icmpv6-filter -p icmpv6 \ 1397 --icmpv6-type router-solicitation -j DROP 1398 ip6tables -A icmpv6-filter -p icmpv6 \ 1399 --icmpv6-type router-advertisement -j DROP 1401 # Drop Redirect messages both incoming and outgoing 1402 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type redirect -j DROP 1404 # MLD MESSAGES 1405 # ============ 1407 # Drop incoming and outgoing 1408 # Multicast Listener queries (MLDv1 and MLDv2) 1409 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 130 -j DROP 1411 # Drop incoming and outgoing Multicast Listener reports (MLDv1) 1412 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 131 -j DROP 1414 # Drop incoming and outgoing Multicast Listener Done messages (MLDv1) 1415 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 132 -j DROP 1417 # Drop incoming and outgoing Multicast Listener reports (MLDv2) 1418 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 143 -j DROP 1420 # ROUTER RENUMBERING MESSAGES 1421 # =========================== 1423 # Drop router renumbering messages 1424 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 138 -j DROP 1426 # NODE INFORMATION QUERIES 1427 # ======================== 1429 # Drop node information queries (139) and replies (140) 1430 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 139 -j DROP 1431 ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 140 -j DROP 1433 # MOBILE IPv6 MESSAGES 1434 # ==================== 1436 # If there are mobile ipv6 home agents present on the 1437 # trusted side allow 1438 if [ "$HOME_AGENTS_PRESENT" -eq "1" ] 1439 then 1440 for inner_prefix in $INNER_PREFIXES 1441 do 1442 #incoming Home Agent address discovery request 1443 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1444 --icmpv6-type 144 -j ACCEPT 1445 #outgoing Home Agent address discovery reply 1446 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1447 --icmpv6-type 145 -j ACCEPT 1448 #incoming Mobile prefix solicitation 1449 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1450 --icmpv6-type 146 -j ACCEPT 1451 #outgoing Mobile prefix advertisement 1452 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1453 --icmpv6-type 147 -j ACCEPT 1454 done 1455 fi 1457 # If there are roaming mobile nodes present on the 1458 # trusted side allow 1459 if [ "$MOBILE_NODES_PRESENT" -eq "1" ] 1460 then 1461 for inner_prefix in $INNER_PREFIXES 1462 do 1463 #outgoing Home Agent address discovery request 1464 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1465 --icmpv6-type 144 -j ACCEPT 1466 #incoming Home Agent address discovery reply 1467 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1468 --icmpv6-type 145 -j ACCEPT 1469 #outgoing Mobile prefix solicitation 1470 ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \ 1471 --icmpv6-type 146 -j ACCEPT 1472 #incoming Mobile prefix advertisement 1473 ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \ 1474 --icmpv6-type 147 -j ACCEPT 1475 done 1476 fi 1478 # DROP EVERYTHING ELSE 1479 # ==================== 1481 ip6tables -A icmpv6-filter -p icmpv6 -j DROP 1483 Authors' Addresses 1485 Elwyn B. Davies 1486 Consultant 1487 Soham, Cambs 1488 UK 1490 Phone: +44 7889 488 335 1491 Email: elwynd@dial.pipex.com 1493 Janos Mohacsi 1494 NIIF/HUNGARNET 1495 Victor Hugo u. 18-22 1496 Budapest, H-1132 1497 Hungary 1499 Phone: +36 1 4503070 1500 Email: mohacsi@niif.hu 1502 Intellectual Property Statement 1504 The IETF takes no position regarding the validity or scope of any 1505 Intellectual Property Rights or other rights that might be claimed to 1506 pertain to the implementation or use of the technology described in 1507 this document or the extent to which any license under such rights 1508 might or might not be available; nor does it represent that it has 1509 made any independent effort to identify any such rights. Information 1510 on the procedures with respect to rights in RFC documents can be 1511 found in BCP 78 and BCP 79. 1513 Copies of IPR disclosures made to the IETF Secretariat and any 1514 assurances of licenses to be made available, or the result of an 1515 attempt made to obtain a general license or permission for the use of 1516 such proprietary rights by implementers or users of this 1517 specification can be obtained from the IETF on-line IPR repository at 1518 http://www.ietf.org/ipr. 1520 The IETF invites any interested party to bring to its attention any 1521 copyrights, patents or patent applications, or other proprietary 1522 rights that may cover technology that may be required to implement 1523 this standard. Please address the information to the IETF at 1524 ietf-ipr@ietf.org. 1526 Disclaimer of Validity 1528 This document and the information contained herein are provided on an 1529 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1530 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 1531 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 1532 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 1533 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1534 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1536 Copyright Statement 1538 Copyright (C) The Internet Society (2006). This document is subject 1539 to the rights, licenses and restrictions contained in BCP 78, and 1540 except as set forth therein, the authors retain all their rights. 1542 Acknowledgment 1544 Funding for the RFC Editor function is currently provided by the 1545 Internet Society.