Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIPS is not supported for S3 Accesspoint #3959

Closed
4 tasks done
trivikr opened this issue Nov 12, 2021 · 2 comments · Fixed by #3964
Closed
4 tasks done

FIPS is not supported for S3 Accesspoint #3959

trivikr opened this issue Nov 12, 2021 · 2 comments · Fixed by #3964
Assignees
Labels
bug This issue is a bug.

Comments

@trivikr
Copy link
Member

trivikr commented Nov 12, 2021

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
FIPS is not supported for S3 Accesspoint

Is the issue in the browser/Node.js?
All

If on Node.js, are you running this on AWS Lambda?
No

Details of the browser/Node.js version
All

SDK version number
aws-sdk@2.1027.0

To Reproduce (observed behavior)

  • Create an access point for a test bucket.
  • Run the below example code.
  • Note that following error is thrown: InvalidConfiguration: ARN endpoint is not compatible with FIPS region
Code
import AWS from "aws-sdk";

// ARN for the accesspoint
const Bucket =
  "arn:aws:s3:us-west-2:123456789012:accesspoint/trivikr-accesspoint-testing";

const client = new AWS.S3({ region: "fips-us-west-2" });
await client.listObjects({ Bucket }).promise();

Expected behavior
The SDK should attempt calling {accesspoint-name}-{account-id}.s3-accesspoint[-fips][.dualstack].{region}.{partition}

The accesspoint provided in test case: arn:aws:s3:us-west-2:123456789012:accesspoint/trivikr-accesspoint-testing
The resulting endpoint should be: trivikr-accesspoint-testing-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 12, 2021
@trivikr
Copy link
Member Author

trivikr commented Nov 12, 2021

Equivalent AWS CLI code:

$ aws --version
aws-cli/2.3.6 Python/3.8.8 Darwin/20.6.0 exe/x86_64 prompt/off

$ aws s3api list-objects --bucket arn:aws:s3:us-west-2:123456789012:accesspoint/trivikr-accesspoint-testing --region fips-us-west-2 --debug 2>&1 | grep "urllib3.connectionpool"
2021-11-12 08:51:55,908 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): trivikr-accesspoint-testing-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com:443
2021-11-12 08:51:56,025 - MainThread - urllib3.connectionpool - DEBUG - https://trivikr-accesspoint-testing-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com:443 "GET /?encoding-type=url HTTP/1.1" 403 None

@trivikr trivikr removed the needs-triage This issue or PR still needs to be triaged. label Nov 12, 2021
@trivikr
Copy link
Member Author

trivikr commented Nov 12, 2021

Verified that FIPS is supported for S3 Accesspoint in v3:

Code
import { S3 } from "@aws-sdk/client-s3";

const logHostnameMiddleware = (next) => async (args) => {
  console.log({ hostname: args.request.hostname });
  return next(args);
};
const logHostnameMiddlewareOptions = { step: "deserialize" };

// ARN for the accesspoint
const Bucket =
  "arn:aws:s3:us-west-2:123456789012:accesspoint/trivikr-accesspoint-testing";

const client = new S3({ region: "fips-us-west-2", logger: console });
client.middlewareStack.add(logHostnameMiddleware, logHostnameMiddlewareOptions);
await client.listObjects({ Bucket });
Output
{
  hostname: 'trivikr-accesspoint-testing-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant