RFC 4025
A Method for Storing IPsec Keying Material in DNS
RFC 4025: A Method for Storing IPsec Keying Material in DNS ๐
- Stream: Network Working Group, so this is a group-made spec ๐ง
- Author: M. Richardson, from SSW โจ
- Category: Standards Track, which means it's a real protocol spec people are meant to implement ๐ฅ
- Date: February 2005 ๐
- Obsoletes / Updates: The title block doesn't list anything here. It does say in the Abstract that this record takes over the functionality of KEY RR sub-type #4, which RFC 3445 obsoleted. ๐ฆ
Status of This Memo ๐
Okay so this doc is an Internet standards track protocol for the Internet community, and it's openly asking for discussion and suggestions for improvements ๐ซถ. If you want to know where this protocol actually stands, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited, so share it with everyone you know ๐ .
Copyright Notice ยฉ๏ธ
Copyright (C) The Internet Society (2005).
Abstract ๐ธ
This doc introduces a brand-new resource record for the Domain Name System (DNS) ๐. The record can store public keys for IP security (IPsec) systems, and it also has spots for saying which system you should contact when an IPsec tunnel gets set up with the entity in question ๐. Main character energy for DNS, honestly ๐.
This record takes over the functionality of sub-type #4 of the KEY Resource Record, which RFC 3445 has obsoleted ๐.
Table of Contents ๐
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2. Use of DNS Address-to-Name Maps (IN-ADDR.ARPA and
IP6.ARPA) . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Usage Criteria . . . . . . . . . . . . . . . . . . . . . 3
2. Storage Formats . . . . . . . . . . . . . . . . . . . . . . . 3
2.1. IPSECKEY RDATA Format . . . . . . . . . . . . . . . . . 3
2.2. RDATA Format - Precedence . . . . . . . . . . . . . . . 4
2.3. RDATA Format - Gateway Type . . . . . . . . . . . . . . 4
2.4. RDATA Format - Algorithm Type . . . . . . . . . . . . . 4
2.5. RDATA Format - Gateway . . . . . . . . . . . . . . . . . 5
2.6. RDATA Format - Public Keys . . . . . . . . . . . . . . . 5
3. Presentation Formats . . . . . . . . . . . . . . . . . . . . . 6
3.1. Representation of IPSECKEY RRs . . . . . . . . . . . . . 6
3.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 6
4. Security Considerations . . . . . . . . . . . . . . . . . . . 7
4.1. Active Attacks Against Unsecured IPSECKEY Resource
Records . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.1. Active Attacks Against IPSECKEY Keying
Materials. . . . . . . . . . . . . . . . . . . . 8
4.1.2. Active Attacks Against IPSECKEY Gateway
Material. . . . . . . . . . . . . . . . . . . . 8
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 10
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10
7.1. Normative References . . . . . . . . . . . . . . . . . . 10
7.2. Informative References . . . . . . . . . . . . . . . . . 10
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 11
Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 12
1. Introduction ๐ง
Picture this: a host wants to set up an IPsec tunnel with some remote entity on the network before any normal communication happens. Sometimes it's a must because of policy ๐. In a lot of cases, the end system can figure out the DNS name for that remote entity. It might get the name handed over explicitly, do a DNS PTR query for an IP address, or pull it some other way, like grabbing the DNS part out of a "user@FQDN" name ๐ฆ. When that happens, the host needs to grab a public key so it can authenticate the remote entity. It might also need some guidance on whether to contact the entity directly or go through another node as a gateway to reach the target ๐ . That's exactly what the IPSECKEY RR is for: it gives you a place to store all of that info โจ.
The type number for the IPSECKEY RR is 45 ๐ข.
This record takes over the functionality of sub-type #4 of the KEY Resource Record, which RFC 3445 [11] has obsoleted ๐.
1.1. Overview ๐
The IPSECKEY resource record (RR) is how you publish a public key that goes with a Domain Name System (DNS) [1] name for use with the IPsec protocol suite ๐. That key can belong to a host, a network, or an application (like per-port keying) ๐.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [3] ๐ซถ.
1.2. Use of DNS Address-to-Name Maps (IN-ADDR.ARPA and IP6.ARPA) ๐บ๏ธ
Honestly, a security gateway often only knows the IP address of the node it wants to talk to, and it won't know any other name for that node ๐. Because of that, the best way to look up IPSECKEY RRs is frequently to use the IP address as an index into one of the reverse mapping trees (IN-ADDR.ARPA for IPv4 or IP6.ARPA for IPv6) ๐.
The lookup works the same way it does for PTR records. You reverse the IP address's octets (IPv4) or nibbles (IPv6), then look it up with the right suffix ๐. Any CNAMEs or DNAMEs you find MUST be followed ๐ฆ.
Note: even when the IPsec function lives in the end-host, the application is often the only thing that knows the forward name it used ๐. Lots of the time the app does know the forward name, but the user could just as easily have typed in a literal IP address ๐. This storage mechanism doesn't stop you from using the forward name when you have it, but it doesn't require it either โจ.
1.3. Usage Criteria ๐
An IPSECKEY resource record SHOULD be used together with DNSSEC [8], unless you have some other way to authenticate the IPSECKEY resource record ๐.
You can expect to see multiple IPSECKEY resource records at the same name, usually because there are several gateways and keys need to roll over ๐.
This resource record is class independent ๐ .
2. Storage Formats ๐
2.1. IPSECKEY RDATA Format ๐งฉ
The RDATA for an IPSECKEY RR is made up of a precedence value, a gateway type, a public key, an algorithm type, and an optional gateway address ๐. Here's the layout:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| precedence | gateway type | algorithm | gateway |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------+ +
~ gateway ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| /
/ public key /
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
2.2. RDATA Format - Precedence โญ
This is an 8-bit precedence for the record. It gets read the same way as the PREFERENCE field in section 3.3.9 of RFC 1035 [2] ๐ธ.
Gateways listed in IPSECKEY records with a lower precedence should be attempted first ๐โโ๏ธ. If two gateways have the same precedence, the order should be non-deterministic ๐ฒ.
2.3. RDATA Format - Gateway Type ๐ช
The gateway type field tells you what format the info in the gateway field is in ๐ง .
These values are defined:
0No gateway is present. ๐ โโ๏ธ1A 4-byte IPv4 address is present. ๐2A 16-byte IPv6 address is present. ๐3A wire-encoded domain name is present. The wire-encoded format describes itself, so the length is implicit โจ. The domain name MUST NOT be compressed ๐ซ. (See Section 3.3 of RFC 1035 [2].)
2.4. RDATA Format - Algorithm Type ๐
The algorithm type field tells you which cryptographic algorithm the public key uses, and that also decides the format of the public key field ๐๏ธ.
A value of 0 means no key is present ๐ซฅ.
These values are defined:
1A DSA key is present, in the format defined in RFC 2536 [9] ๐ซ.2A RSA key is present, in the format defined in RFC 3110 [10] ๐.
2.5. RDATA Format - Gateway ๐
The gateway field points at a gateway that an IPsec tunnel can be created with, so you can reach the entity named by this resource record ๐.
There are three formats for it:
A 32-bit IPv4 address can be present in the gateway field ๐. The data is an IPv4 address, like section 3.4.1 of RFC 1035 [2] describes. It's a 32-bit number in network byte order ๐ข.
A 128-bit IPv6 address can be present in the gateway field ๐. The data is an IPv6 address, like section 2.2 of RFC 3596 [12] describes. It's a 128-bit number in network byte order ๐ฏ.
The gateway field can also be a normal wire-encoded domain name, as section 3.3 of RFC 1035 [2] describes. Compression MUST NOT be used ๐ โโ๏ธ.
2.6. RDATA Format - Public Keys ๐๏ธ
Both public key types in this document (RSA and DSA) take their public key formats from the matching KEY RR formats ๐. To be specific, the public key field holds the algorithm-specific part of the KEY RR RDATA, which is everything in the KEY RR DATA after the first four octets ๐ง. That's the same portion of the KEY RR that documents defining a DNSSEC algorithm have to specify ๐. Those docs also name a message digest for generating SIG RRs, but that part doesn't matter for IPSECKEY RRs ๐.
Future algorithms that both DNSSEC (in the KEY RR) and IPSECKEY want to use will probably share the same public key encodings in both records ๐ฎ. Unless something says otherwise, the IPSECKEY public key field will hold the algorithm-specific part of the KEY RR RDATA for that algorithm ๐งฉ. The algorithm still has to be designated for IPSECKEY use, and it must get an IPSECKEY algorithm type number, which might differ from its DNSSEC algorithm number ๐ข.
The DSA key format is defined in RFC 2536 [9] ๐ซ.
The RSA key format is defined in RFC 3110 [10], with the following changes ๐:
The earlier definition of RSA/MD5 in RFC 2065 [4] capped the exponent and modulus at 2552 bits in length ๐. RFC 3110 bumped that limit up to 4096 bits for RSA/SHA1 keys ๐. The IPSECKEY RR puts no length limit on RSA public keys, other than the 65535 octet limit that comes from the two-octet length encoding ๐. This length extension only applies to IPSECKEY, not to KEY RRs ๐ซ.
3. Presentation Formats ๐จ๏ธ
3.1. Representation of IPSECKEY RRs ๐จ
IPSECKEY RRs can show up in a zone data master file ๐. The precedence, gateway type, algorithm, and gateway fields are REQUIRED ๐ช. The base64 encoded public key block is OPTIONAL ๐ซถ. If it's not there, the public key field of the resource record MUST be construed to be zero octets in length 0๏ธโฃ.
The algorithm field is an unsigned integer. No mnemonics are defined ๐ข.
If no gateway is being indicated, the gateway type field MUST be zero, and the gateway field MUST be "." ๐
โโ๏ธ.
The Public Key field is represented as a Base64 encoding of the Public Key ๐ค. Whitespace is allowed within the Base64 text โจ. For the definition of Base64 encoding, check RFC 3548 [6], Section 5.2 ๐.
The general presentation for the record looks like this ๐:
IN IPSECKEY ( precedence gateway-type algorithm
gateway base64-encoded-public-key )
3.2. Examples
okay so the examples are where it all clicks ๐ง Each one is a little IPSECKEY record, and they show who's allowed to be your IPsec buddy ๐
An example of a node, 192.0.2.38, that will accept IPsec tunnels on its own behalf ๐
38.2.0.192.in-addr.arpa. 7200 IN IPSECKEY ( 10 1 2
192.0.2.38
AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== )
An example of a node, 192.0.2.38, that has published its key only ๐
38.2.0.192.in-addr.arpa. 7200 IN IPSECKEY ( 10 0 2
.
AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== )
An example of a node, 192.0.2.38, that has delegated authority to the node 192.0.2.3 ๐ซถ
38.2.0.192.in-addr.arpa. 7200 IN IPSECKEY ( 10 1 2
192.0.2.3
AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== )
An example of a node, 192.0.1.38, that has delegated authority to the node with the identity "mygateway.example.com" ๐ธ
38.1.0.192.in-addr.arpa. 7200 IN IPSECKEY ( 10 3 2
mygateway.example.com.
AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== )
An example of a node, 2001:0DB8:0200:1:210:f3ff:fe03:4d0, that has delegated authority to the node 2001:0DB8:c000:0200:2::1 ๐
$ORIGIN 1.0.0.0.0.0.2.8.B.D.0.1.0.0.2.ip6.arpa.
0.d.4.0.3.0.e.f.f.f.3.f.0.1.2.0 7200 IN IPSECKEY ( 10 2 2
2001:0DB8:0:8002::2000:1
AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== )
4. Security Considerations โจ
okay this part is seriously important, bestie ๐ So this whole memo is about handing out public keying material for key management protocols like ISAKMP/IKE (RFC 2407) [7].
The IPSECKEY resource record has info that SHOULD be communicated to the end client in an integral fashion, meaning it stays free from modification ๐ How that channel works is up to whoever consumes the data. There must be a trust relationship between the end consumer of this record and the server. That trust could come from end-to-end DNSSEC validation, a TSIG or SIG(0) channel to another secure source, a secure local channel on the host, or some combo of those ๐
The keying material in an IPSECKEY record is not sensitive to passive attacks ๐ It can be freely disclosed to anyone with no impact on the security properties of the resulting IPsec session. IPsec and IKE defend against both active and passive attacks, so we're covered ๐ฆ
Any derivative specification that makes use of this resource record MUST carefully document its trust model and why the trust model of DNSSEC is appropriate, if that is the secure channel used. Don't skip this, bestie ๐
An active attack on the DNS that caused the wrong IP address to be retrieved (via a forged address), and therefore the wrong QNAME to be queried, would also result in a man-in-the-middle attack ๐ญ This situation happens whether or not the IPSECKEY RR is used.
4.1. Active Attacks Against Unsecured IPSECKEY Resource Records
this section is about active attacks against the DNS ๐ต๏ธโโ๏ธ These attacks need DNS requests and responses to be intercepted and changed. DNSSEC is designed to defend against attacks like this. This section covers the situation where DNSSEC isn't available, which is not the recommended deployment scenario ๐
4.1.1. Active Attacks Against IPSECKEY Keying Materials
the first kind of active attack is when the attacker swaps out the keying material for a key under its control or for garbage ๐๏ธ
The gateway field is either untouched or null. So the IKE negotiation will happen with the original end-system. For this attack to work, the attacker has to pull off a man-in-the-middle attack on the IKE negotiation, which means it needs to be able to intercept and modify packets on the forwarding path for the IKE and data packets ๐โโ๏ธ
If the attacker can't pull off that man-in-the-middle attack on the IKE negotiation, then you get a denial of service, because the IKE negotiation fails ๐ โโ๏ธ
If the attacker can do active DNS attacks AND sit in a position to man-in-the-middle the IKE and IPsec negotiations, then it can compromise the resulting IPsec channel ๐ฑ Note that the attacker has to be able to do active DNS attacks on both sides of the IKE negotiation for this to work.
4.1.2. Active Attacks Against IPSECKEY Gateway Material
the second kind of active attack is when the attacker changes the gateway address to point at a node it controls ๐ญ Then it either replaces the public key or removes it. If the public key were removed, the attacker could provide its own accurate public key in a second record.
This second form makes a simple man-in-the-middle attack, since the attacker can then create a second tunnel to the real destination. Remember, as before, this also requires the attacker to mount an active attack against the responder ๐ฅบ
The man-in-the-middle can't just forward cleartext packets to the original destination. Sure, the destination might be willing to speak in the clear and reply to the original sender, but the sender has already created a policy expecting ciphertext. So the attacker needs to intercept traffic in both directions. In some cases, the attacker might pull off the full intercept using Network Address/Port Translation (NAT/NAPT) technology ๐ง
This attack is easier than the first one because the attacker does not need to be on the end-to-end forwarding path. It only needs to modify DNS replies. It can do that with packet modification, various kinds of race attacks, or methods that pollute DNS caches ๐ซ
If the end-to-end integrity of the IPSECKEY RR is suspect, the end client MUST restrict its use of the IPSECKEY RR to cases where the RR owner name matches the content of the gateway field. Since the RR owner name is assumed when the gateway field is null, a null gateway field counts as a match โ
So, any records obtained under unverified conditions (e.g., no DNSSEC or trusted path to source) that have a non-null gateway field MUST be ignored. Bye bye, sketchy records ๐๏ธ
This restriction shuts down attacks against the gateway field, which are considered much easier since the attack doesn't need to be on the forwarding path ๐
In the case of an IPSECKEY RR with a value of three in its gateway type field, the gateway field contains a domain name. The subsequent query required to translate that name into an IP address or IPSECKEY RR is also subject to man-in-the-middle attacks. If the end-to-end integrity of this second query is suspect, then the provisions above also apply. The IPSECKEY RR MUST be ignored whenever the resulting gateway does not match the QNAME of the original IPSECKEY RR query. Periodt ๐
5. IANA Considerations ๐
this document updates the IANA Registry for DNS Resource Record Types by assigning type 45 to the IPSECKEY record ๐
It also creates two new IANA registries, both specific to the IPSECKEY Resource Record ๐
This document creates an IANA registry for the algorithm type field.
Values 0, 1, and 2 are defined in Section 2.4. Algorithm numbers 3 through 255 can be assigned by IETF Consensus (see RFC 2434 [5]).
This document creates an IANA registry for the gateway type field.
Values 0, 1, 2, and 3 are defined in Section 2.3. Gateway type numbers 4 through 255 can be assigned by Standards Action (see RFC 2434 [5]).
6. Acknowledgements ๐ซถ
big thanks to Paul Hoffman, Sam Weiler, Jean-Jacques Puig, Rob Austein, and Olafur Gudmundsson, who reviewed this document carefully ๐ฅฐ Extra thanks to Olafur Gurmundsson for a reference implementation โจ
7. References ๐
7.1. Normative References
- [1] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, November 1987.
- [2] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, November 1987.
- [3] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [4] Eastlake 3rd, D. and C. Kaufman, "Domain Name System Security Extensions", RFC 2065, January 1997.
- [5] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
- [6] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 3548, July 2003.
7.2. Informative References
- [7] Piper, D., "The Internet IP Security Domain of Interpretation for ISAKMP", RFC 2407, November 1998.
- [8] Eastlake 3rd, D., "Domain Name System Security Extensions", RFC 2535, March 1999.
- [9] Eastlake 3rd, D., "DSA KEYs and SIGs in the Domain Name System (DNS)", RFC 2536, March 1999.
- [10] Eastlake 3rd, D., "RSA/SHA-1 SIGs and RSA KEYs in the Domain Name System (DNS)", RFC 3110, May 2001.
- [11] Massey, D. and S. Rose, "Limiting the Scope of the KEY Resource Record (RR)", RFC 3445, December 2002.
- [12] Thomson, S., Huitema, C., Ksinant, V., and M. Souissi, "DNS Extensions to Support IP Version 6", RFC 3596, October 2003.
Author's Address ๐ฆ
Michael C. Richardson
Sandelman Software Works
470 Dawson Avenue
Ottawa, ON K1Z 5V7
CA
EMail: mcr@sandelman.ottawa.on.ca
URI: http://www.sandelman.ottawa.on.ca/
Full Copyright Statement ๐ธ
Copyright (C) The Internet Society (2005).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property ๐
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the IETF's procedures with respect to rights in IETF Documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
Acknowledgement ๐ง
Funding for the RFC Editor function is currently provided by the Internet Society. โจ
๐ฆ where this page comes from
- ietf: rfc4025 2005-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms