Skip to content

Commit 86047cd

Browse files
Igor Smolyarigorscs
authored andcommitted
[fips] use aws-lc-fips-sys crypto lib for rustls
Add FIPS build support wire fips feature into pipeline-manager/adapters, enable FIPS builds in CI (skip on musl as fips are dynamic only), and include Go in build images/docs so aws-lc-fips-sys can compile. When rustls’s fips feature enabled , it pulls in aws-lc-rs with the fips feature, which links against aws-lc-fips-sys (FIPS crypto module).
1 parent aa8091e commit 86047cd

File tree

7 files changed

+36
-3
lines changed

7 files changed

+36
-3
lines changed

.github/workflows/build-rust.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
workflow_call:
55

66
env:
7-
CARGO_FLAGS: "--release --locked --all-targets --features pubsub-emulator-test,iceberg-tests-fs,iceberg-tests-glue"
7+
CARGO_FLAGS: "--release --locked --all-targets"
8+
CARGO_FEATURES_BASE: "pubsub-emulator-test,iceberg-tests-fs,iceberg-tests-glue"
89
FELDERA_PLATFORM_VERSION_SUFFIX: ${{ github.sha }}
910
RUSTC_WRAPPER: sccache
1011
SCCACHE_CACHE_SIZE: ${{ vars.SCCACHE_CACHE_SIZE }}
@@ -67,7 +68,12 @@ jobs:
6768
6869
- name: Build Rust binaries
6970
run: |
70-
cargo build ${{ env.CARGO_FLAGS }} --target=${{ matrix.target }}
71+
FEATURES="${{ env.CARGO_FEATURES_BASE }}"
72+
case "${{ matrix.target }}" in
73+
*musl*) ;; # OpenSSL’s FIPS mode is implemented as a dynamically loaded provider (fips.so)
74+
*) FEATURES="$FEATURES,fips" ;;
75+
esac
76+
cargo build ${{ env.CARGO_FLAGS }} --features "$FEATURES" --target=${{ matrix.target }}
7177
7278
- name: Print sccache stats
7379
run: |
@@ -77,10 +83,15 @@ jobs:
7783
- name: Collect executables
7884
id: collect
7985
run: |
86+
FEATURES="${{ env.CARGO_FEATURES_BASE }}"
87+
case "${{ matrix.target }}" in
88+
*musl*) ;; # OpenSSL’s FIPS mode is implemented as a dynamically loaded provider (fips.so)
89+
*) FEATURES="$FEATURES,fips" ;;
90+
esac
8091
# Run again with --message-format=json to list out executables
8192
# (No real recompile since nothing has changed).
8293
# Then transform newlines to spaces for the artifact step.
83-
EXES=$(cargo build ${{ env.CARGO_FLAGS }} --target=${{ matrix.target }} --message-format=json \
94+
EXES=$(cargo build ${{ env.CARGO_FLAGS }} --features "$FEATURES" --target=${{ matrix.target }} --message-format=json \
8495
| jq -r '.executable | select(. != null)' | tr '\n' ' ')
8596
echo "Found executables: $EXES"
8697
# Save it as an output variable for subsequent steps

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ To run Feldera from sources, ensure at least 6 GB of free space in the sources d
113113
- cmake
114114
- libssl-dev
115115
- libsasl2-dev
116+
- golang-go (required to build aws-lc-fips-sys when using rustls FIPS)
116117
- pkg-config
117118
- libzstd-dev
118119
- clang

crates/adapters/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ default = [
2525
"with-redis",
2626
"with-nats",
2727
]
28+
fips = ["rustls/fips"]
2829
with-kafka = ["rdkafka"]
2930
with-deltalake = ["deltalake", "deltalake-catalog-unity"]
3031
with-iceberg = ["feldera-iceberg"]

crates/pipeline-manager/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ tikv-jemallocator = { workspace = true, features = ["profiling", "unprefixed_mal
117117
default = ["postgresql_embedded"]
118118
feldera-enterprise = []
119119
runtime-version = []
120+
fips = ["rustls/fips"]
120121

121122
[build-dependencies]
122123
change-detection = { workspace = true }

deploy/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ RUN apt update --fix-missing && apt install \
1313
# pkg-config is required for cargo to find libssl
1414
libssl-dev pkg-config \
1515
cmake \
16+
# Go is required to build aws-lc-fips-sys when rustls is built with FIPS
17+
golang-go \
1618
# rdkafka dependency needs libsasl2-dev zlib and a CXX compiler
1719
libsasl2-dev zlib1g-dev build-essential \
1820
# To install rust

deploy/build.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN apt-get update --fix-missing && apt-get install -y \
1919
# pkg-config is required for cargo to find libssl
2020
libssl-dev pkg-config \
2121
cmake \
22+
# Go is required to build aws-lc-fips-sys when rustls is built with FIPS
23+
golang-go \
2224
# rdkafka dependency needs libsasl2-dev and a CXX compiler
2325
libsasl2-dev libzstd-dev zlib1g-dev build-essential \
2426
# bindgen needs this (at least the dec crate uses bindgen)

0 commit comments

Comments
 (0)