carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.66k forks source link

Support S3 FIPS endpoints, disable S3 Transfer Acceleration in GovCloud or FIPS mode #2762

Open matt-domsch-sp opened 4 days ago

matt-domsch-sp commented 4 days ago

The Fog::AWS::Utils region_to_host method returns the standard S3 endpoints even when ENV['AWS_USE_FIPS_ENDPOINT']=='true'. When FIPS is called for, and we are in a region where FIPS endpoints are available, this method should return the FIPS endpoint.

Furthermore, when S3 Transfer Acceleration (S3TA) is requested by configuration, the above endpoint gets overridden to select the S3TA endpoint. However, S3TA is not avaialble in GovCloud, and has no FIPS endpoint equivalents. In this instance, if the region is a GovCloud region, or if FIPS mode is called for, do not override the endpoint to use S3TA.

I have a first pass at adding this functionality here for consideration. https://github.com/carrierwaveuploader/carrierwave/pull/2763

This is functionally equivalent to an issue submitted to the fog-aws project. https://github.com/fog/fog-aws/issues/729

matt-domsch-sp commented 17 hours ago

The equivalent patch has been merged into fog-aws upstream. https://github.com/fog/fog-aws/pull/730