Globally set transitive features (especially for FIPS), or block certain features #14984
Labels
A-features
Area: features — conditional compilation
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
I want to compile application with FIPS approved cryptography only (for example by using boringssl rustls provider in fips mode; or by using rustls with the aws-lc-fips-sys provider).
My package/workspace has many dependencies, and they in turn have multiple declarations to rustls.
Despite setting my toplevel rustls features to use aws-lc-fips-sys, transitive dependencies that have repeated rustls dependencies may activate default features and pull in rustls again but with non-fips provider.
Ideally when compiling application and choosing rustls with aws-lc-fips-sys, I want to prevent non-fips feature being pull in; or able to inspect this.
Building binaries with cargo-auditable appears to indicate that it often is trivially possible to link two rustls implementations aws-lc-sys & aws-lc-fips-sys.
Is there a way to globally enforce cargo dependencies and features? to only pull in one rustls with desired features and no other ?
Proposed Solution
File bug reports against all rustls dependants asking them to add a feature that pulls in rustls with FIPS feature; rather than with default feature. (Currently 945 https://crates.io/crates/rustls/reverse_dependencies )
Somehow make rustls by default have no features activated, and allow dependency resolution to always happen without any features for the packages; yet allow each one of them to choose desired feature set for the compiled binaries - such that packages/library dependencies do not impose a feature selection; yet all individual binaries can make a choice.
Ask rustls to default to a FIPS implementation by default..... Or somehow locally override default rustls features to be FIPS.
Notes
Related:
The text was updated successfully, but these errors were encountered: