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

[Enhancement] Remove AWS API key handling from Uli API Server config #621

Open
eternaltyro opened this issue Sep 17, 2024 · 1 comment
Open
Labels
enhancement New feature or request stale

Comments

@eternaltyro
Copy link

eternaltyro commented Sep 17, 2024

Is your feature request related to a problem? Please describe.

Currently AWS API keys are used directly in order to authenticate the Uli API server to AWS and authorise S3 access. We can secure this by removing these keys and using identity based Authz/AuthN.

accessKeyId: process.env.SERVICE_AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.SERVICE_AWS_SECRET_ACCESS_KEY,

Describe the solution you would like

@aws-sdk/client-s3 uses AWS credentials env module that automatically takes API keys from environment variables. We don't need to explicitly pass them. So instead of doing:

const s3client = new S3Client({
credentials,
});

We can do something simpler like:

const s3client = new S3Client();

The SDK would handle AWS AuthN automatically.

Describe alternatives you've considered

This makes the config more forgiving and secure. We can rely on the same environment variables for local developement but at the same time, we can take advantage of EKS Pod Identity - which provides a way of attaching an IAM role to a pod (just like EC2 instance profiles) to allow access to S3. Developers can use temporary credentials received via aws sso login --profile tattle or manually copying credentials from the login page.

We can effectively eliminate the need to handle or process AWS API keys in code.

Addtional Context

Of course, some keys have additional utility like SES access which we will need to consider while switching over.

References:

@eternaltyro eternaltyro added the enhancement New feature or request label Sep 17, 2024
@eternaltyro eternaltyro changed the title [Enhancement] Remove explicitly passing AWS API keys [Enhancement] Remove AWS API key handling from API Server config Sep 17, 2024
@eternaltyro eternaltyro changed the title [Enhancement] Remove AWS API key handling from API Server config [Enhancement] Remove AWS API key handling from Uli API Server config Sep 17, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

1 participant