git-client-plugin icon indicating copy to clipboard operation
git-client-plugin copied to clipboard

[JENKINS-73305] Create .ssh directory with owner only permissions

Open MarkEWaite opened this issue 2 months ago • 0 comments

JENKINS-73305 Create .ssh directory with owner only permissions

When the JGit implementation needs to create a .ssh directory, create it with permissions only allowing access to the directory owner. That is the common pattern used by the OpenSSH project and by POSIX systems to reduce access to the sensitive information stored in the directory.

Testing done

Ran the CredentialsTest in a debugger with a configured 'auth-data` directory and confirmed that the modified lines are executed on my RHEL 8 development computer. Confirmed that the resulting directory permissions were read, write, and execute for only the owner, with no other permissions.

The coverage report on the ci.jenkins.io job also shows that the newly added statements are executed by automated tests.

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] I have referenced the Jira issue related to my changes in one or more commit messages
  • [x] I have added tests that verify my changes
  • [x] Unit tests pass locally with my changes
  • [x] I have added documentation as necessary
  • [x] No Javadoc warnings were introduced with my changes
  • [x] No spotbugs warnings were introduced with my changes
  • [x] I have interactively tested my changes

Types of changes

What types of changes does your code introduce?

  • [x] Bug fix (non-breaking change which fixes an issue)

MarkEWaite avatar Jun 15 '24 14:06 MarkEWaite