Rustls
{{Use mdy dates|date=August 2024}}
{{Short description|Open-source implementation of TLS in Rust}}
{{Infobox software
| name = Rustls
| logo = Rustls logo.png
| logo size =
| screenshot =
| caption =
| developer = Joe Birr-Pixton, Dirkjan Ochtman, Daniel McCarney, Josh Aas
| released = 2016
| author =
| operating_system = Cross-platform
| programming_language = Rust
| genre = Security library
| license = Apache 2.0, MIT, ISC
| website = {{URL|https://github.com/rustls}}
| latest release version =
| latest release date =
}}
Rustls (pronounced "rustles"{{Cite web |last=Edge |first=Jake |date=May 4, 2021 |title=Rustls: memory safety for TLS |url=https://lwn.net/Articles/853712/ |access-date=2024-08-20 |website=LWN.net}}) is an open-source implementation of the Transport Layer Security (TLS) cryptographic protocol written in the Rust programming language. TLS is essential to internet security, and Rustls aims to enable secure, fast TLS connections. Rustls uses Rust's enforcement of memory safety to reduce the risk of security vulnerabilities. It is part of efforts to improve internet security by replacing memory-unsafe software libraries, such as OpenSSL, with memory-safe alternatives.
Team and funding
Joe Birr-Pixton started Rustls in 2016 and remains the lead developer as of 2024.{{Cite web |date=July 30, 2024 |title=Rustls README |url=https://github.com/rustls/rustls/blob/main/README.md |access-date=2024-08-20 |website=GitHub |language=en}} The Internet Security Research Group (ISRG), a nonprofit organization based in the United States, has sponsored the project since 2021 as part of its Prossimo initiative.{{Cite web |last=Melanson |first=Mike |date=2021-04-23 |title=Rustls Looks to Provide a Memory-Safe Replacement for OpenSSL |url=https://thenewstack.io/rustls-looks-to-provide-a-memory-safe-replacement-for-openssl/ |access-date=2024-08-20 |website=The New Stack |publisher=Insight Partners |language=en-US}}{{Cite web |last=Aas |first=Josh |date=2021-04-20 |title=Preparing Rustls for Wider Adoption |url=https://www.memorysafety.org/blog/preparing-rustls-for-wider-adoption/ |access-date=2024-08-20 |website=Prossimo |publisher=Internet Safety Research Group}} ISRG aims to make Rustls a viable alternative to OpenSSL, which is widely used by internet servers but difficult to use correctly and has had security bugs, such as Heartbleed, caused by memory-unsafe code.{{Cite web |last=Vaughan-Nichols |first=Steven J. |date=2021-11-02 |title=Prossimo: Making the Internet Memory Safe |url=https://thenewstack.io/prossimo-making-the-internet-memory-safe/ |access-date=2024-08-20 |website=The New Stack |publisher=Insight Partners |language=en-US}}
ISRG has paid several programmers to work on Rustls, including Birr-Pixton, Daniel McCarney, and Dirkjan Ochtman, using money contributed by Google and other companies and organizations.{{Cite web |last= |first= |title=Rustls |url=https://www.memorysafety.org/initiative/rustls/ |access-date=2024-08-21 |website=Prossimo |publisher=Internet Safety Research Group}} In 2023, the Open Source Security Foundation's Alpha-Omega initiative gave ISRG $530,000 for development of the option to use different cryptographic backends and for the separate project Rust for Linux.{{Cite web |last=Gran |first=Sarah |date=September 18, 2023 |title=Advancing Rustls and Rust for Linux with OpenSSF Support |url=https://openssf.org/blog/2023/09/18/advancing-rustls-and-rust-for-linux-with-openssf-support/ |access-date=2024-08-20 |website=Open Source Security Foundation (OpenSSF) |publisher=Linux Foundation |language=en-US}}{{Cite web |last= |first= |date=2023-09-18 |title=OpenSSF Welcomes New Members in Support of Securing Open Source Software |url=https://itsecuritywire.com/news/openssf-welcomes-new-members-in-support-of-securing-open-source-software/ |access-date=2024-09-03 |website=ITSecurityWire |language=en-US}} That money came from Google, Amazon Web Services, and Microsoft.{{Cite web |date=2023-11-08 |title=Comment from Amazon Web Services (Re: Open-Source Software Security RFI Response, Amazon Web Services) |url=https://www.regulations.gov/comment/ONCD-2023-0002-0082 |access-date=2024-08-22 |website=Regulations.gov}} Amazon Web Services also gave ISRG $1 million in 2023 for memory-safety projects including Rustls.{{Cite web |last=Aas |first=Josh |date=2023-05-11 |title=AWS commits $1M to bring memory safety to critical parts of the Web |url=https://www.memorysafety.org/blog/aws-funding/ |access-date=2024-08-22 |website=Prossimo |publisher=Internet Safety Research Group}} The Sovereign Tech Fund, supported by the German government, gave $1.5 million to ISRG in 2023 for work on Rustls and other projects that provide memory-safe versions of open source tools critical to internet security.{{Cite web |last=Gran |first=Sarah |date=2023-07-11 |title=$1.5M from Sovereign Tech Fund to Fuel Memory Safety |url=https://www.abetterinternet.org/post/1.5m-for-memory-safety/ |access-date=2024-08-20 |website=Internet Security Research Group}}{{Cite web |last=Tarakiyee |first=Tara |date=2024-05-22 |title=On Rust, Memory Safety, and Open Source Infrastructure |url=https://www.sovereigntechfund.de/news/on-rust-memory-safety-open-source-infrastructure |access-date=2024-08-20 |website=Sovereign Tech Fund |language=en}} Craig Newmark Philanthropies granted $100,000 to ISRG for memory safety projects in 2024.{{Cite web |last=Gran |first=Sarah |date=2024-03-12 |title=White House, Craig Newmark Support Memory Safe Software |url=https://www.abetterinternet.org/post/growing-support/ |access-date=2024-09-03 |website=Internet Security Research Group}} Additional funding has come from Fly.io,{{Cite web |last=Aas |first=Josh |date=2024-05-08 |title=Rustls Gains OpenSSL and Nginx Compatibility |url=https://www.memorysafety.org/blog/rustls-nginx-compatibility-layer/ |access-date=2024-08-20 |website=Prossimo |publisher=Internet Security Research Group}} a cloud platform that uses Rustls.{{Cite web |title=Healthcare apps on Fly |url=https://fly.io/docs/about/healthcare/ |access-date=2024-08-22 |website=Fly |language=en-US}}
The United States Office of the National Cyber Director has encouraged work on memory-safe security software{{Cite web |last1=Wang |first1=Dana |last2=Arasaratnam |first2=Omkhar |date=February 26, 2024 |title=OpenSSF Supports White House's Efforts to Build More Secure and Measurable Software |url=https://openssf.org/blog/2024/02/26/openssf-supports-efforts-to-build-more-secure-and-measurable-software/ |access-date=2024-08-22 |website=Open Source Security Foundation (OpenSSF) |publisher=Linux Foundation |language=en-US}} and complimented the Rustls team. Google awarded Open Source Peer Bonuses to Birr-Pixton and Ochtman for their work on Rustls.{{Cite web |last=Tabak |first=Maria |date=March 22, 2022 |title=Rewarding Rust contributors with Peer Bonuses |url=https://opensource.googleblog.com/2022/03/Rewarding-Rust-contributors-with-Google-Open-Source-Peer-Bonuses.html |access-date=2024-08-22 |website=Google Open Source Blog}}
Architecture and features
Rustls is a low-level software library focused on TLS implementation. This means it does not support other internet protocols by itself, such as HTTPS, but software that implements other protocols may use Rustls as a component.{{Cite web |title=Crate rustls |url=https://docs.rs/rustls/latest/rustls/ |access-date=2024-08-21 |website=Docs.rs}}
By default Rustls uses cryptographic primitives from Amazon Web Services Libcrypto for Rust (aws-lc-rs), which supports Federal Information Processing Standards (FIPS). Rustls allows using alternative cryptographic libraries instead of aws-lc-rs, such as ring.{{Cite web |last=Aas |first=Josh |date=2024-02-29 |title=Rustls Now Using AWS Libcrypto for Rust, Gains FIPS Support |url=https://www.memorysafety.org/blog/rustls-with-aws-crypto-back-end-and-fips/ |access-date=2024-08-20 |website=Prossimo |publisher=Internet Security Research Group}} The project has experimental support for post-quantum cryptography: a key exchange method with a special key encapsulation mechanism (Kyber).{{Cite web |last=Aas |first=Josh |date=2024-03-26 |title=The Rustls TLS Library Adds Post-Quantum Key Exchange Support |url=https://www.memorysafety.org/blog/pq-key-exchange/ |access-date=2024-08-21 |website=Prossimo |publisher=Internet Security Research Group}}
Rustls uses its own fork of the webpki library to verify public key infrastructure certificates, a step in the TLS handshake.{{Cite web |date=2023-09-18 |title=Rustls webpki README |url=https://github.com/rustls/webpki/blob/main/README.md |access-date=2024-08-22 |website=GitHub}} Rustls supports Server Name Indication (SNI), which allows a web server to serve multiple HTTPS websites at the same IP address with different certificates.{{Cite web |title=ServerName in rustls::pki_types |url=https://docs.rs/rustls/latest/rustls/pki_types/enum.ServerName.html |access-date=2024-08-21 |website=Docs.rs}} It also supports TLS certificates that contain IP addresses instead of domain names.{{Cite web |last=Aas |first=Josh |date=2023-03-29 |title=Rustls 0.21.0 Released With Exciting New Features |url=https://www.memorysafety.org/blog/rustls-new-features/ |access-date=2024-08-22 |website=Prossimo |publisher=Internet Security Research Group}}
C programs can use Rustls through a foreign function interface API, rustls-ffi. For example, cURL is a popular tool written in C, and it allows using Rustls through rustls-ffi.{{Cite web |last=Stenberg |first=Daniel |author-link=Daniel Stenberg |date=2021-02-09 |title=curl supports rustls |url=https://daniel.haxx.se/blog/2021/02/09/curl-supports-rustls/ |access-date=2024-08-21 |website=daniel.haxx.se |language=en-US}}{{Cite web |title=TLS libraries |url=https://everything.curl.dev/build/tls.html |access-date=2024-08-22 |website=everything curl}} Rustls also has an OpenSSL compatibility layer that allows configuring the widely-used Nginx web server to use Rustls instead of OpenSSL.{{Cite web |last=Larabel |first=Michael |date=2024-05-11 |title=Rustls Can Now Work With Nginx Via New OpenSSL Compatibility Layer |url=https://www.phoronix.com/news/Rustls-With-Nginx |access-date=2024-08-21 |website=Phoronix |language=en}}
Rustls is available under multiple free software licenses: Apache 2.0, MIT, and ISC.
= Evaluations =
In 2020, the Cloud Native Computing Foundation funded a security audit of Rustls and two Rust libraries it used, ring and webpki, with positive results.{{Cite web |last=Birr-Pixton |first=Joseph |date=2010-06-14 |title=Third-party audit of rustls |url=https://jbp.io/2020/06/14/rustls-audit.html |access-date=2024-08-22 |website=jbp.io}}
In 2019, benchmarks carried out by the Rustls developer showed better performance than OpenSSL.{{Cite web |last=Cimpanu |first=Catalin |date=July 19, 2019 |title=A Rust-based TLS library outperformed OpenSSL in almost every category |url=https://www.zdnet.com/article/a-rust-based-tls-library-outperformed-openssl-in-almost-every-category/ |access-date=2024-08-20 |website=ZDNET |language=en}} In 2024 the project conducted new performance comparisons with the latest version of OpenSSL, which showed some scenarios where Rustls was faster or more efficient and some where OpenSSL performed better.{{Cite web |last=Ochagavía |first=Adolfo |date=2024-01-04 |title=Securing the Web: Rustls on track to outperform OpenSSL |url=https://www.memorysafety.org/blog/rustls-performance/ |access-date=2024-08-20 |website=Prossimo |publisher=Internet Security Research Group}}
Uses
Like other TLS implementations, a computer user may use Rustls without being aware of it, as an underlying part of an application or website. A programmer can use Rustls directly or by configuring a higher-level library or tool to use it. In particular, Rustls is used by some projects that want to ensure they have a secure software supply chain.{{Cite web |last1=Lorenc |first1=Dan |last2=Conill |first2=Ariadne |date=January 24, 2023 |title=Building the first memory safe distro |url=https://www.chainguard.dev/unchained/building-the-first-memory-safe-distro |access-date=2024-08-20 |website=Chainguard |language=en}} The US Cybersecurity and Infrastructure Security Agency has recommended using products in memory safe languages as part of its "Secure by Design" initiative.{{Cite web |last=Moore |first=Matt |date=May 8, 2024 |title=Signing CISA's Secure by Design pledge |url=https://www.chainguard.dev/unchained/signing-cisas-secure-by-design-pledge |access-date=2024-09-03 |website=Chainguard |language=en}}
Some libraries support Rustls as one of several choices for TLS implementations. The reqwest HTTP client library offers the option to use Rustls for TLS instead of the system's default TLS library (for example, on Windows the default is the Security Support Provider Interface).{{Cite book |last=Palmieri |first=Luca |url=https://books.google.com/books?id=x7C4EAAAQBAJ&pg=PA214 |title=Zero to Production In Rust: An introduction to backend development in Rust |date=2022-03-14 |publisher=Luca Palmieri |isbn=979-8-8472-1143-7 |pages=214 |language=en}}{{Cite web |title=RustLS |url=https://book.goose.rs/config/rustls.html |access-date=2024-08-21 |website=The Goose Book}} In 2020 an ISRG software engineer enabled using Rustls as a TLS backend for cURL.{{Cite web |last=Aas |first=Josh |date=2020-10-09 |title=Memory Safe 'curl' for a More Secure Internet |url=https://www.abetterinternet.org/post/memory-safe-curl/ |access-date=2024-08-20 |website=Internet Security Research Group}}{{Cite web |last=De Simone |first=Sergio |date=October 25, 2020 |title=Rust Hyper HTTP Library Will Contribute to Make Curl Safer |url=https://www.infoq.com/news/2020/10/memory-safe-curl-rust/ |access-date=2024-08-20 |website=InfoQ |language=en}} s2n-quic, an implementation of the QUIC network protocol in Rust, supports both Rustls and s2n-tls for TLS.{{Cite web |last=Kampanakis |first=Panos |date=2022-02-17 |title=Introducing s2n-quic, a new open-source QUIC protocol implementation in Rust |url=https://aws.amazon.com/blogs/security/introducing-s2n-quic-open-source-protocol-rust/ |access-date=2024-08-22 |website=AWS Security Blog |language=en-US}}
In 2021 Google funded the creation of mod_tls, a new TLS module for Apache HTTP Server using Rustls.{{Cite web |last=Cimpanu |first=Catalin |date=February 2, 2021 |title=Google funds project to secure Apache web server with new Rust component |url=https://www.zdnet.com/article/google-funds-project-to-secure-apache-web-server-project-with-new-rust-component/ |access-date=2024-08-20 |website=ZDNET |language=en}}{{Cite web |last=Eissing |first=Stefan |date=2022-03-01 |title=Bringing Memory Safe TLS to Apache httpd |url=https://www.memorysafety.org/blog/memory-safe-httpd/ |access-date=2024-08-20 |website=Prossimo |publisher=Internet Security Research Group}} The new module is intended to be a successor to the mod_ssl module that uses OpenSSL, as a more secure default.{{Cite web |last=Claburn |first=Thomas |date=2021-02-02 |title=In Rust we trust: Shoring up Apache, ISRG ditches C, turns to wunderkind lang for new TLS crypto module |url=https://www.theregister.com/2021/02/02/patching_apache_rust/ |access-date=September 2, 2024 |website=The Register}} As of August 2024, mod_tls is available in the latest version of Apache but still marked as experimental.{{Cite web |title=Apache HTTP Server Version 2.4: Apache Module mod_tls |url=https://httpd.apache.org/docs/current/mod/mod_tls.html |access-date=August 22, 2024 |website=Apache HTTP Server Project |publisher=Apache Software Foundation}} The Internet Society, a nonprofit that advocates for an open and secure internet, suggests that organizations use this module as a step toward increasing memory safety.{{Cite web |date=2023-10-10 |title=How to Talk to Your Manager About Memory Safety |url=https://www.internetsociety.org/resources/doc/2023/how-to-talk-to-your-manager-about-memory-safety/ |access-date=2024-08-22 |website=Internet Society |language=en-US}}
Rustls is the default TLS implementation in some applications. The utility program cargo_audit, which checks Rust project dependencies for security vulnerabilities, uses Rustls.{{Cite web |last=Davidoff |first=Sergey "Shnatsel" |date=September 4, 2023 |title=Keeping Rust projects secure with cargo-audit 0.18: performance, compatibility and security improvements |url=https://blog.rust-lang.org/inside-rust/2023/09/04/keeping-secure-with-cargo-audit-0.18.html |access-date=2024-08-21 |website=Inside Rust Blog |language=en}} Linkerd, which "adds security, observability, and reliability to any Kubernetes cluster", includes a proxy server built with Rustls.{{Cite web |last=Weisman |first=Eliza |date=July 23, 2020 |title=Under the hood of Linkerd's state-of-the-art Rust proxy, Linkerd2-proxy |url=https://linkerd.io/2020/07/23/under-the-hood-of-linkerds-state-of-the-art-rust-proxy-linkerd2-proxy/ |access-date=2024-08-20 |website=Linkerd |publisher=Cloud Native Computing Foundation |language=en}} Wolfi, a tool for making memory-safe Linux containers, uses Rustls.{{Cite web |last=Lewkowicz |first=Jakub |date=2023-09-29 |title=SD Times Open-Source Project of the Week: Wolfi |url=https://sdtimes.com/open-source/sd-times-open-source-project-of-the-week-wolfi/ |access-date=2024-08-20 |website=SD Times |language=en-US}}{{Cite news |last=Claburn |first=Thomas |date=2023-01-26 |title=Memory safety is the new black, fashionable and fit for any occasion: Calls to avoid C/C++ and embrace Rust grow louder |url=https://www.theregister.com/2023/01/26/memory_safety_mainstream/ |access-date=2024-08-20 |work=The Register}} In 2024, ISRG announced plans to start replacing OpenSSL with Rustls in Let's Encrypt, their free certificate authority used by hundreds of millions of websites.{{Cite web |last=Aas |first=Josh |date=June 24, 2024 |title=More Memory Safety for Let's Encrypt: Deploying ntpd-rs |url=https://letsencrypt.org/2024/06/24/ntpd-rs-deployment.html |access-date=2024-08-21 |website=Let's Encrypt |publisher=Internet Security Research Group |language=en-US}}
See also
{{Portal|Free and open-source software}}
External links
- [https://www.memorysafety.org/initiative/rustls/ Rustls Initiative - Prossimo]