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

pullRemote clone dir permissions are extraneous #673

Open
coopernetes opened this issue Aug 2, 2024 · 0 comments
Open

pullRemote clone dir permissions are extraneous #673

coopernetes opened this issue Aug 2, 2024 · 0 comments
Labels
fix good first issue Good for newcomers security Security improvements or tooling

Comments

@coopernetes
Copy link
Contributor

When Git Proxy is running in a secure environment, the node process is likely running under some sort of user. This user should have local file permissions to create directories for the file-based DB (if used) as well as cloning repositories that are in-flight via Git Proxy. The pullRemote step expects to create a directory under .remote/{timestamp}. Currently, that directory is expected to have full rwx permissions across user, group and everyone/world.

This is generally not best practice. In certain deployment environments such as Openshift, it's explicitly disallowed.

A simple fix is to create a directory with only user permissions which is typically rwxr-xr-x (0755) for directories.

See: https://betterstack.com/community/questions/what-permissions-should-my-website-directory-have-on-linux/

Affected line:

fs.mkdirSync(action.proxyGitPath, '0777', true);

@coopernetes coopernetes added fix good first issue Good for newcomers security Security improvements or tooling labels Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix good first issue Good for newcomers security Security improvements or tooling
Projects
None yet
Development

No branches or pull requests

1 participant