Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Keep getting 403 Error after access keys rotation #87

@shikunwei

Description

@shikunwei
  • Describe the bug
    Changing access keys on a regular schedule is a well-known security best practice. But the S3 replication plugin can't work properly and would keep throwing 403 errors for days each time I rotate my access keys.

To Reproduce

  1. Follow the DEPLOYMENT_EN.md to install the S3 replication plugin and verify that it works fine.
  2. Create new access keys and delete the old access keys.
  3. Update the latest AK/SK values to the secret from step 1.
  4. Make some changes to the source bucket, and you will notice that the replication stops working.
  5. Go to the log of the instance, and you will see an error log like this:
2022/08/01 03:16:17 S3> Got an error uploading file - operation error S3: PutObject, https response error StatusCode: 403, RequestID: xxxxxxxx, HostID: xxxxxxxx, api error InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.

2022/08/01 03:16:17 ----->Transferred 1 object xxxxxxxx/xxxxxxxx.json with status ERROR
  1. Terminate the active instance in ASG, and wait for the new instance to be ready. Then you will see the replication works fine again.

So the cache of outdated credentials in the instance caused this problem.

Expected behavior
After a few failed attempts, the instance should try to pull the latest credentials from the secret manager instead of keep trying with outdated credentials in the cache.

Please complete the following information about the solution:

  • Version:
    (SO8002) - Data Transfer Hub - S3 Plugin - Template version v1.0.0
  • Region: Any
  • Was the solution modified from the version published on this repository?
    No
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the services this solution uses?
    Yes, it's not relevant
  • Were there any errors in the CloudWatch Logs?
    Yes. Please see above in the Reproduce section.

Screenshots
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions