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

Requiring ~/.s3cfg to be non-readable by non-owner #1405

Open
ccotter opened this issue Nov 19, 2024 · 2 comments
Open

Requiring ~/.s3cfg to be non-readable by non-owner #1405

ccotter opened this issue Nov 19, 2024 · 2 comments

Comments

@ccotter
Copy link

ccotter commented Nov 19, 2024

Bug

s3cmd seems to permit the ~/.s3cfg file to have any permissions for reading by other users. Since the config file may contain the secret_key, it's important for this file to be readable only by the owner of the file to prevent unauthorized users from reading it.

Suggested solution

sshd supports a StrictModes flag (default enabled) which refuses to work with a given ssh private key if the key file has wide open permissions.

Can s3cmd similarly default to refuse to load the ~/.s3cfg file if its permissions are too wide open?

@snosratiershad
Copy link
Contributor

@ccotter, I think we should warn users about it not require them to change permissions. something like helm:

WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /root/.kube/config

I'll try to send a PR.

@fviard
Copy link
Contributor

fviard commented Jan 27, 2025

Sorry, I took a long time to come back on this subject, but i'm not sure that I would agree to this change.

I think that the same subject was raised with AWS cli, and that my opinion is the same as for them.
I don't really want to create new scare or confusion for users, that might even have a valid case if they purposely do that.

What is important is that we create the configuration file with the right permission when you do the configure.
But otherwise, the world is not the same as it used to be for that to be a big risk.
Most personal computers will be single user, and for servers, the biggest chances are that s3cmd will be run inside a VM, a container, or a dedicated server nowadays.

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

Successfully merging a pull request may close this issue.

3 participants