• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Deny access to .git/config (and other existing Files)

futureweb

Regular Pleskian
Hey there,

lately there was an Articel labeled "Massive security problems due to open Git repositories" (Google Translate)
I tried to open some .git/ExistingFile Files on Plesk Hostings on our Servers ... and guess what - all are openly accessible ... (i.e.: https://www.domain.tld/.git/config)

Can we Server-Wide disable accessing Files within .git Directory?
On our non-Plesk Servers I normally got

Code:
<DirectoryMatch "^/.*/\.git/">
  Require all denied
</DirectoryMatch>

in Apache Config ... but what's the "Best Practice approach" on Plesk Servers on this?

thx
Andreas
 
Last edited:
I wonder why do you have a .git folder in your domain public folder ?

Best practice for the past 10 years or so [for PHP apps at least] is to keep /vendor folder and other important folders and files outside public folder
 
I wonder why do you have a .git folder in your domain public folder ?

Not quite an answer to the question, but well ... we are a Hosting Provider with several Plesk Servers hosting thousands of Customers, we can't control what and where our Customers store their Data on their Hostings (or force them using Plesk GIT Features ...) - but always trying to minimize potential targets on our Servers / trying to keep our customers as safe as possible ...
 
Last edited:
Well, ok then

This remind me of the same situation related to .svn folders years ago
and the solution was the same:
in global Apache config deny all for any .svn folders
 
Back
Top