Skip to content

Support HTTP Credential URL for AWS/S3 in Cyberduck #17612

@sannies

Description

@sannies

Is your feature request related to a problem? Please describe.
In many AWS workflows today, credentials are not static. Instead, a temporary credential issuance service runs behind a custom HTTP endpoint. The official AWS SDKs (e.g., JavaScript v3’s fromHttp() provider) support this pattern.
Cyberduck currently lacks the ability to fetch AWS credentials via an arbitrary HTTP endpoint and refresh them automatically.
Existing issues such as #8610, #10989, #14862 revolve around limitations in metadata or profile-based credential retrieval—but none address a generic HTTP credential endpoint.

Describe the solution you'd like
I implemented a solution that adds a new bookmark property in the Custom dict:


    <key>Custom</key>
    <dict>
        <key>aws.credentials.http.url</key>
       <string>https://up.content.example.com/api_v1/upload/VMHGTtd0BDYpcZgWU2arm6SwElXsiOCK</string>
    </dict>

When present:

  • S3CredentialsConfigurator detects the property and returns placeholder credentials so that validation doesn’t block connection.
  • S3Session.configureCredentialsStrategy skips other auth methods and creates an AWSSessionCredentialsRetriever with this URL.
  • AWSSessionCredentialsRetriever has been modified to:
    • Use the provided URL literally (preserving path and encoding)
    • Perform HTTP GET and parse AWS STS-style JSON:
{ "AccessKeyId": "...", "SecretAccessKey": "...", "Token": "...", "Expiration": "..." }

If the property is not set, Cyberduck behaves exactly as before (profiles, metadata, etc.).

Describe alternatives you've considered

  • Using EC2 Instance Metadata (169.254.169.254) as a proxy
    It is technically possible to run a local service (or SSH tunnel) that mimics the AWS metadata endpoint and returns credentials. However, this requires routing tricks, hosts file changes, root privileges, or VPN manipulation — fragile and environment-specific.
  • Manually pasting temporary AWS credentials into Cyberduck
    This works only for short periods until credentials expire. It is error-prone, breaks automation, and is not feasible for non-technical users or expiring STS credentials in CI / upload pipelines.
  • Writing credentials into ~/.aws/credentials using AWS CLI or scripts
    This requires storing STS tokens in plaintext on disk and still risks expiration. It also makes Cyberduck pick them up only if profile names and hostnames are aligned, which is not always the case.

Additional context
The implementation is already underway in branch http-credential-provider of the fork:
https://github.com/castlabs/cyberduck-sannies/tree/http-credential-provider
This demonstrates the added classes, modifications to S3CredentialsConfigurator, S3Session, and AWSSessionCredentialsRetriever, along with unit tests covering the new aws.credentials.http.url bookmark property.

Metadata

Metadata

Assignees

Labels

s3AWS S3 Protocol Implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions