Daniel
Daniel

Reputation: 544

How to block access to the .svn/entries on my webserver?

I setup an NGINX webserver and use svn to manage project folder. Nessus found the weakness:

Configure permissions for the affected
web server to deny access to the
'.svn' directory.

How do I block access to the .svn directory? It seems that svn export is the more preferable way to checkout on the webserver, but it easier to me to use svn up.

Upvotes: 5

Views: 5552

Answers (4)

Mikaciù
Mikaciù

Reputation: 29

Quite frankly, I prefer

RedirectMatch permanent .*\.(svn|git|hg|bzr|cvs)/.* /

To the 404 or 403 errors. That way, the user sees your site root page.

Upvotes: 0

Daniel
Daniel

Reputation: 544

finally I found the right way to make it in nginx. Add to nginx.conf this lines in server {} definition:

    location ~ /.svn/ {
      deny all;
    }

That's all!

Upvotes: 8

Moo-Juice
Moo-Juice

Reputation: 38825

If you're under IIS, you can use the method outlined here:

https://serverfault.com/questions/23340/ignoring-svn-directories-under-iis

Upvotes: 0

goreSplatter
goreSplatter

Reputation: 11

Put the following in a file called ".htaccess" (if you're running Apache):

<FilesMatch "^\.svn">
  Deny from all
</FilesMatch>

Upvotes: 1

Related Questions