5

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.

Nanne
  • 64,065
  • 16
  • 119
  • 163
Daniel
  • 534
  • 4
  • 16

4 Answers4

8

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!

Daniel
  • 534
  • 4
  • 16
1

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

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

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.

Mikaciù
  • 29
  • 4
0

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

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

Community
  • 1
  • 1
Moo-Juice
  • 38,257
  • 10
  • 78
  • 128