Skip to content

Commit 5bbf824

Browse files
authored
Merge pull request #353 from rmcnew/mir-rust-tls-requirements
Update MIR Rust documentation with TLS requirements
2 parents a256d0d + e86b1ed commit 5bbf824

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/MIR/mir-rust.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ rather than rely on the individual package versions.
88
See [`cpaelzer/ubuntu-mir#3`](https://github.com/cpaelzer/ubuntu-mir/pull/3) for
99
some background on the issue.
1010

11+
Additionally, Rust code that needs Transport Layer Security (TLS) {ref}`must use OpenSSL <rust-tls-requirements>`
12+
to ensure that system cryptography policies are followed. This requirement will
13+
change as the Rust TLS ecosystem matures.
14+
1115
## Vendoring Rust dependencies
1216

1317
It's a simple matter of running `cargo vendor debian/rust-vendor/` where you're
@@ -273,3 +277,23 @@ git add debian/control
273277
git commit -m "Update XS-Vendored-Sources-Rust field"
274278
git reset --hard # restore Cargo.toml
275279
```
280+
281+
(rust-tls-requirements)=
282+
## Rust TLS Requirements
283+
284+
[`rustls`](https://github.com/rustls/rustls) is a popular Rust TLS implementation,
285+
but currently it [does not support system-wide policies](https://github.com/rustls/rustls/issues/2402).
286+
Ubuntu [announced a partnership with rustls](https://discourse.ubuntu.com/t/addressing-linuxs-missing-pki-infrastructure/73314) to build a centralized PKI system written in Rust.
287+
288+
Until the needed cryptographic infrastructure and system-wide policies are operational,
289+
Rust code in `main` that uses TLS must use OpenSSL with the system-wide OpenSSL configuration.
290+
291+
This may require significant changes to some Rust code, but it is required for now to
292+
ensure that system-wide cryptographic policies are followed as described by the MIR
293+
reporter's rule {ref}`"Check for security relevant binaries, services and behavior" <mir-reporter-s-template>`.
294+
295+
### OpenSSL crate configuration
296+
The [`openssl` crate](https://docs.rs/openssl/latest/openssl/) provides a safe Rust
297+
interface for the system OpenSSL package. The `vendored` Cargo feature MUST NOT
298+
be used to ensure that the system OpenSSL package and corresponding policy are used.
299+

0 commit comments

Comments
 (0)