Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Treat (+) specially in storage url query. #603

Closed
3pointer opened this issue Nov 19, 2020 · 2 comments
Closed

Treat (+) specially in storage url query. #603

3pointer opened this issue Nov 19, 2020 · 2 comments
Labels
difficulty/1-easy Easy issue good first issue Good for newcomers help wanted Extra attention is needed Priority/P1 High priority issue. Must have an associated milestone type/feature-request New feature or request
Milestone

Comments

@3pointer
Copy link
Collaborator

Feature Request

Describe your feature request related problem:

we use url query to pass some parameters to storage config. but in s3 storage, secret_access_key may contains + usually.
the + character has a special meaning in a url, If we want to use the + sign we need to URL encode it by change + to %2B.

Describe the feature you'd like:

we should do the transform internally.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@3pointer 3pointer added the type/feature-request New feature or request label Nov 19, 2020
@overvenus
Copy link
Member

Regex for AWS S3 access key and private key

Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after.
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after.

See https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/#:~:text=Finding%20hard-coded%20credentials%20in%20your%20code

@kennytm
Copy link
Collaborator

kennytm commented Nov 20, 2020

Performing ReplaceAll(_, "+", "%2B") before url.Parse should be sufficient.

@kennytm kennytm added difficulty/1-easy Easy issue good first issue Good for newcomers Priority/P1 High priority issue. Must have an associated milestone help wanted Extra attention is needed labels Nov 20, 2020
@kennytm kennytm added this to the v4.0.9 milestone Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty/1-easy Easy issue good first issue Good for newcomers help wanted Extra attention is needed Priority/P1 High priority issue. Must have an associated milestone type/feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants