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

fix: Update pullRemote.js to set appropriate directory permissions #782

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update pullRemote.js to set appropriate directory permissions
This commit modifies the directory creation permissions in the pullRemote function of pullRemote.js. 

Previously, the function was setting directory permissions to 0777 (full read, write, and execute permissions for user, group, and others). This approach is not aligned with best practices for security, particularly in secure environments such as OpenShift, where overly permissive settings can lead to vulnerabilities.

The updated code now sets the permissions to 0755 (read, write, and execute for the user; read and execute for group and others). This change enhances security by restricting write access to the owner only while still allowing necessary read and execute permissions.
  • Loading branch information
yadnyeshkolte authored Nov 6, 2024
commit dac735ea46960b2b14972778398a48d4604bfc5f
2 changes: 1 addition & 1 deletion src/proxy/processors/push-action/pullRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const exec = async (req, action) => {
}

if (!fs.existsSync(action.proxyGitPath)) {
fs.mkdirSync(action.proxyGitPath, '0777', true);
fs.mkdirSync(action.proxyGitPath, '0755', true);
}

const cmd = `git clone ${action.url} --bare`;
Expand Down
Loading