RFC 4255

Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints

πŸ“… published January 2006, from ietf

RFC 4255: Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints πŸ¦‹

Part 1 of 2 πŸ’–

okay bestie, let's start with the basics πŸŽ€ This doc is RFC 4255 from January 2006, and it's on the Standards Track πŸ‘‘ It was written by:

  • J. Schlyter (OpenSSH) ✨
  • W. Griffin (SPARTA) πŸ’œ

The title block doesn't list any Obsoletes or Updates, so this RFC doesn't say it replaces or changes anything else. Iconic, right? 🌸

Status of This Memo πŸ“œ

ok so this document is an Internet standards track protocol for the Internet community 🌈 It also asks everyone to chat about it and send suggestions for making it better 🫢 For the current standardization state and status, you check the current edition of "Internet Official Protocol Standards" (STD 1) ✨ And the memo can be distributed with no limits, so share away πŸ’…

Copyright (C) The Internet Society (2006). πŸ¦‹

Abstract 🧚

so this doc is all about checking SSH host keys using Domain Name System Security (DNSSEC) πŸ” It defines a brand new DNS resource record that holds a standard SSH key fingerprint. Main character energy πŸ‘‘

Table of Contents πŸ“

1. Introduction ....................................................2
2. SSH Host Key Verification .......................................2
   2.1. Method .....................................................2
   2.2. Implementation Notes .......................................2
   2.3. Fingerprint Matching .......................................3
   2.4. Authentication .............................................3
3. The SSHFP Resource Record .......................................3
   3.1. The SSHFP RDATA Format .....................................4
        3.1.1. Algorithm Number Specification ......................4
        3.1.2. Fingerprint Type Specification ......................4
        3.1.3. Fingerprint .........................................5
   3.2. Presentation Format of the SSHFP RR ........................5
4. Security Considerations .........................................5
5. IANA Considerations .............................................6
6. Normative References ............................................7
7. Informational References ........................................7
8. Acknowledgements ................................................8

1. Introduction ✨

okay so SSH [6] is the protocol that gives you secure remote login and other secure network services πŸ”, even when the network underneath is totally insecure 😭 The security of the connection depends on the server authenticating itself to the client, and the user authenticating itself to the server. Two-way trust, iconic πŸ’–

Here's the tea πŸ«– If a connection goes to a server whose public key the client doesn't already know, the client shows the user a fingerprint of that key to verify. If the user thinks the fingerprint looks right and accepts it, the key gets saved locally and gets used to verify every connection after that. Some security-minded users check the fingerprint out-of-band before accepting, but a lot of people just blindly accept whatever shows up πŸ™ˆ

This method can do that out-of-band check for you πŸ¦‹ It looks up a fingerprint of the server's public key in the DNS [1][2] and uses DNSSEC [5] to verify the lookup. Slay πŸ’…

To get the fingerprint through DNS, this document defines a new DNS resource record called "SSHFP" to carry it πŸŽ€

It's assumed you already get the basics of the DNS system [1][2] and the DNS security extensions [5] 🧚

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] πŸ“œ

2. SSH Host Key Verification πŸ”₯

2.1. Method πŸ’œ

okay, so when the SSH client connects to an SSH server, it MAY look up the SSHFP resource record(s) for the host it's connecting to πŸ‘€ If the algorithm and fingerprint of the key the server sent match the algorithm and fingerprint of one of the SSHFP resource record(s) that came back from DNS, the client MAY accept the identity of the server ✨

2.2. Implementation Notes 🌸

Client implementors SHOULD provide a configurable policy that picks the order of methods used to verify a host key πŸŽ€ This document defines one method, which is fingerprint storage in DNS. Another method, from the SSH Architecture [6], uses local files to store keys for comparison. Future methods might include storing fingerprints in LDAP or other databases 🧚 The configurable policy lets admins decide which methods they want to use and what order to prioritize them in. That way they can decide how much trust to put in each method 🫢

One specific scenario where a configurable policy matters is when clients don't use fully qualified host names to connect to servers πŸ‘€ In that case, the implementation SHOULD verify the host key against a local database before verifying the key with the fingerprint from DNS. This helps stop an attacker from injecting a DNS search path into the local resolver and forcing the client to connect to a different host. Not on my watch 😀

2.3. Fingerprint Matching πŸ¦‹

The public key and the SSHFP resource record get matched together by comparing the algorithm number and the fingerprint πŸ’–

  • The public key algorithm and the SSHFP algorithm number MUST match.
  • A message digest of the public key, using the message digest algorithm specified in the SSHFP fingerprint type, MUST match the SSHFP fingerprint.

2.4. Authentication πŸ”

A public key verified with this method MUST NOT be trusted if the SSHFP resource record (RR) used to verify it wasn't authenticated by a trusted SIG RR πŸ’€ Say it with me: no trusted signature, no trust πŸ™…β€β™€οΈ

Clients that DO validate the DNSSEC signatures themselves SHOULD use standard DNSSEC validation procedures πŸ’…

Clients that do NOT validate the DNSSEC signatures themselves MUST use a secure transport (e.g., TSIG [9], SIG(0) [10], or IPsec [8]) between themselves and the entity doing the signature validation. Protect that connection, bestie 🫢πŸ”₯

4. Security Considerations πŸ”₯

Okay bestie, this is the serious part, so read it with your whole brain 🧠🫢 Right now, how much you can actually trust a server key depends on how carefully you check that the public key you got really matches the server's private key. If a user accepts a key without checking its fingerprint against something they learned over a secured channel, the connection is open to a man-in-the-middle attack 😭🚨

The overall security of using SSHFP for SSH host key verification depends on three things: the security policies of the SSH host administrator and the DNS zone administrator (for transferring the fingerprint), the detailed bits of how verification happens inside the SSH implementation, and the client being diligent about accessing DNS securely πŸ’…

One of those bits is the order in which fingerprints get looked up (for example, checking a local file first and then SSHFP) πŸ—‚οΈ We also want to point out that, beyond protecting the first-time transfer of host keys, SSHFP can optionally be used for stronger host key protection ✨

  • If SSHFP is checked first, new SSH host keys may be distributed by replacing the corresponding SSHFP in DNS.
  • If SSH host key verification can be configured to require SSHFP, SSH host key revocation can be implemented by removing the corresponding SSHFP from DNS.

As we said in Section 2.2, we recommend that SSH implementors provide a policy mechanism to control the order of methods used for host key verification πŸŽ€ One specific scenario where a configurable policy really matters is when clients connect using unqualified host names. In that case, we recommend that SSH implementations check the host key against a local database before verifying the key via the fingerprint returned from DNS. This helps stop an attacker from injecting a DNS search path into the local resolver and forcing the client to connect to a different host. Not okay, attacker πŸ™…β€β™€οΈ

A different way to solve the DNS search path issue is for clients to use a trusted DNS search path, meaning one that wasn't acquired through DHCP or other autoconfiguration mechanisms 🌸 Since current DNS lookup APIs have no way to tell whether a search path comes from a trusted source, the entire client system would need to be configured with that trusted DNS search path.

Another dependency is on the implementation of DNSSEC itself πŸ” As we said in Section 2.4, we're making it mandatory to use secure methods for lookup, and SSHFP RRs must be authenticated by trusted SIG RRs. This is especially important if SSHFP is going to be used as a basis for host key rollover and/or revocation, as described above.

Since DNSSEC only protects the integrity of the host key fingerprint after it's signed by the DNS zone administrator, the fingerprint must be transferred securely from the SSH host administrator to the DNS zone administrator 🫢 This could be done manually between the administrators, or automatically using secure DNS dynamic update [11] between the SSH server and the nameserver. Honestly, this is no different from other key enrollment situations, like a client sending a certificate request to a certificate authority for signing 🧾


5. IANA Considerations πŸ¦‹

IANA has allocated the RR type code 44 for SSHFP from the standard RR type space πŸŽ€

IANA has opened a new registry for the SSHFP RR type for public key algorithms. The defined types are:

0 is reserved
1 is RSA
2 is DSA

Adding new reservations requires IETF consensus [4].

IANA has opened a new registry for the SSHFP RR type for fingerprint types. The defined types are:

0 is reserved
1 is SHA-1

Adding new reservations requires IETF consensus [4].


6. 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] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.

[5] Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "DNS Security Introduction and Requirements", RFC 4033, March 2005.

Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "Resource Records for the DNS Security Extensions", RFC 4034, March 2005.

Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "Protocol Modifications for the DNS Security Extensions", RFC 4035, March 2005.

[6] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Protocol Architecture", RFC 4251, January 2006.

[7] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Transport Layer Protocol", RFC 4253, January 2006.


7. Informational References 🧚

[8] Thayer, R., Doraswamy, N., and R. Glenn, "IP Security Document Roadmap", RFC 2411, November 1998.

[9] Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B. Wellington, "Secret Key Transaction Authentication for DNS (TSIG)", RFC 2845, May 2000.

[10] Eastlake 3rd, D., "DNS Request and Transaction Signatures ( SIG(0)s )", RFC 2931, September 2000.

[11] Wellington, B., "Secure Domain Name System (DNS) Dynamic Update", RFC 3007, November 2000.


8. Acknowledgements πŸ’œ

The authors gratefully acknowledge, in no particular order, the contributions of the following people, who are literally the MVPs πŸ‘‘

  • Martin Fredriksson
  • Olafur Gudmundsson
  • Edward Lewis
  • Bill Sommerfeld

Authors' Addresses ✈️

Jakob Schlyter
OpenSSH
812 23rd Avenue SE
Calgary, Alberta  T2G 1N8
Canada

EMail: jakob@openssh.com
URI:   http://www.openssh.com/


Wesley Griffin
SPARTA
7075 Samuel Morse Drive
Columbia, MD  21046
USA

EMail: wgriffin@sparta.com
URI:   http://www.sparta.com/

Copyright (C) The Internet Society (2006).

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 procedures with respect to rights in RFC 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 provided by the IETF Administrative Support Activity (IASA). That's the end of RFC 4255, bestie! πŸ¦‹βœ¨

πŸ“¦ where this page comes from