Open alex-rowe opened 1 year ago
Thanks for reporting this @alex-rowe ! I was able to confirm it.
I opened https://github.com/vectordotdev/vector/pull/18390 to have Vector honor the FIPS configuration for service access (AWS Kinesis Streams in your case).
I actually can't figure out how to have the SDK use the FIPS endpoints for fetching credentials via STS though. I opened a discussion upstream to get thoughts: https://github.com/awslabs/aws-sdk-rust/discussions/880 . This might be a missing feature from the Rust SDK.
Thanks @jszwedko for taking a look at this.
In the Rust SDK, for the sts
endpoints configs, they have this for setting use_fips
from a param
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/sts/src/config/endpoint/internals.rs#L19
And from here to use regional endpoints for STS and FIPS if enabled and the region supports is
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/sts/src/config/endpoint/internals.rs#L315
And here for the STS builder config
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/sts/src/config.rs#L604
Is the issue that the main AWS SDK setting for use_fips
isn't being automatically passed through to the STS builder, but is automatically for Kinesis Streams?
Hi @alex-rowe !
Thanks for taking a look. In this case, we aren't accessing the STS service directly and so aren't building an STS SDK config. Instead it is accessed through the AssumeRoleProvider
(https://docs.rs/aws-config/latest/aws_config/sts/struct.AssumeRoleProvider.html).
I'm not seeing a way to have that provider use the FIPS endpoints. The Rust SDK maintainers have historically been pretty responsive so I'm hoping they chime in on the GitHub Discussion I opened soon.
It looks like this was indeed a bug in the Rust SDK. They opened https://github.com/awslabs/aws-sdk-rust/issues/882 to track it.
@jszwedko we've worked with AWS to get the patch resolved in the Rust SDK and it's in the next
branch waiting for the 0.57
release I believe.
Once that release comes out, what is the process/timeline for it to be included in Vector?
It's available now https://github.com/awslabs/aws-sdk-rust/releases/tag/release-2023-11-02
πβ οΈπ (https://github.com/awslabs/aws-sdk-rust/issues/882, https://github.com/awslabs/smithy-rs/issues/3007) STS and SSO-based credential providers will now respect both use_fips and use_dual_stack when those settings are configured in a user's environment or profile.
Would it be best to create a new issue to track the SDK update, or would that be included in this to make it fully use the FIPS endpoints?
@jszwedko I can see the next version of Vector was released and it's on aws-config
0.54.1
, can we get it bumped to 0.57.1
for the next release?
I also saw this comment on a previous dependabot pr https://github.com/vectordotdev/vector/pull/17510#issuecomment-1564711988 and that referenced SDK issue is also now closed.
Upgrading the AWS SDK or supporting crates is blocked until the following issue is resolved https://github.com/awslabs/aws-sdk-rust/issues/749
Hey! Yes, we plan to try to update the AWS SDK by the end of this year now that the upstream issue we had forked to address has been fixed. This means it probably won't make it into the next release, but probably v0.36.0 in January unless we run into many issues upgrading (we anticipate some non-trivial efforts to be involved to manage breaking changes in the SDK). We'd also be happy to see a PR for this if someone wants to take a crack at this sooner.
Immediately upon trying to do this myself (using aws-config 0.57.1
), I noticed that native TLS was removed in 0.56.0. The migration path recommends using rustls
instead, and I can't tell if it's FIPS compliant or not
Immediately upon trying to do this myself (using
aws-config 0.57.1
), I noticed that native TLS was removed in 0.56.0. The migration path recommends usingrustls
instead, and I can't tell if it's FIPS compliant or not
I don't believe rustls
is FIPS compliant since it depends on ring
for the cryptography, which is not FIPS certified as far as I know. https://github.com/rustls/rustls/issues/521 is tracking the ability to plug in other cryptographic back-ends for rustls
.
However, it looks like, with native-tls
's removal, the AWS crates added the ability to plug in a custom connector the HTTP client which would allow plugging in one that uses native-tls
instead. See https://awslabs.github.io/smithy-rs/design/transport/connector.html
Note that Vector statically compiles in OpenSSL so linking with a local OpenSSL installation, including the FIPS module, currently requires building Vector yourself. https://github.com/vectordotdev/vector/issues/16535 is tracking having a generally available "FIPS Compliant" build.
For our use case, we don't need the crypto in Vector to be running on FIPS validated modules, only able to talk to FIPS endpoints like the -fips
ones provided by AWS.
Separately, if it's going to be difficult to move to 0.57.1
due to the SSL changes, can an additional config parameter for Kinesis Streams be made available for auth.endpoint
where we can configure the STS endpoint ourselves?
I see there is an endpoint
parameter to use, but I would expect that to just be for the Kinesis endpoint
I gave the AWS smithy migration guide a second read and noticed that it speaks of a custom connector https://awslabs.github.io/smithy-rs/design/transport/connector.html
Here's the example repository https://github.com/smithy-lang/smithy-rs/blob/main/examples/pokemon-service-tls/tests/common/mod.rs#L75
Maybe we can do something like this...
This would be easy if we could override the endpoint using environment variables provided by AWS such as AWS_ENDPOINT_URL_STS
but that's not supported either https://github.com/awslabs/aws-sdk-rust/issues/932
Could adding https://docs.rs/aws-config/latest/aws_config/endpoint/index.html to the AssumeRoleProviderBuilder
using https://docs.rs/aws-config/latest/aws_config/sts/struct.AssumeRoleProviderBuilder.html#method.configure be an option.
Similar to how auth.region
and auth.external_id
are used now?
Unfortunately, it looks like the AssumeRoleProvider
option won't work either.
https://github.com/awslabs/aws-sdk-rust/issues/921 and https://github.com/smithy-lang/smithy-rs/pull/3014
They were both part of the same 0.57.1
release that fixed FIPS for STS, so moving to that would be a requirement for those methods, unsure about the separate custom connector approach.
Cross posting this PR https://github.com/vectordotdev/vector/pull/19312 which is also doing the AWS crate updates to the new GA release of the SDK it looks like
A note for the community
Problem
The AWS Rust SDK can the ability to use the AWS FIPS service endpoints if you supply a config file with
use_fips_endpoint=true
or an environment variable ofAWS_USE_FIPS_ENDPOINT=true
. For example: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-config/src/default_provider/use_fips.rs#L26By providing these options to Vector either through the
AWS_CONFIG_FILE
environment variable, directly in a config file, systemd unit file overrides and via running it on the command line, I can't get Vector to read this file and use these options.Our use case is for the AWS Kinesis Stream sink using an Assumed Role. The calls to AWS STS to assume the role, and the calls to Kinesis must use the FIPS endpoints as shown here https://aws.amazon.com/compliance/fips/
Configuration
Version
vector 0.32.1 (x86_64-unknown-linux-gnu 9965884 2023-08-21 14:52:38.330227446)
Debug Output
Example Data
CloudTrail event logs for the AssumeRole event, showing connection to the non-FIPS endpoint
Additional Context
This isn't related to making all the encryption in Vector FIPS compliant, like in this PR https://github.com/vectordotdev/vector/pull/18261 but only for using the FIPS endpoints as provided by the AWS SDK.
References
No response