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

Build fails when passing AWS_ACCESS_KEY_ID because it assumes that key has access to bucket #1772

Open
mebays opened this issue Apr 25, 2024 · 0 comments

Comments

@mebays
Copy link

mebays commented Apr 25, 2024

What happened: Running packer to build an image it would error on awscli commands then an access_key_id was passed in. The access_key is the key being used to create the instance with packer. I don't think it should be assumed that this key also has access to the s3 bucket.

What you expected to happen: When using an AWS_ACCESS_KEY_ID and not trying to use a private bucket the build should default to using wget to obtain the binaries.

How to reproduce it (as minimally and precisely as possible): Use an AWS_ACCESS_KEY_ID that does not have permissions to a private bucket.

Anything else we need to know?: I think the core issue would be relating to using aws s3 cp if an AWS_ACCESS_KEY_ID is set. If a user is using a session token there is not an AWS_ACCESS_KEY_ID in the environment variables and it will default to wget. I would probably argue that is the norm on role based permission. So if access to a private bucket is needed it should probably be declared on the instance profile and triggered with something like PRIVATE_BUCKET vs assuming to use aws cli just based on the presence of an access_key_id.

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

No branches or pull requests

1 participant