all bits considered data to information to knowledge


Securing SVN external access

If you are going to allow external access to your SVN installation there are few basic things that you might want to ponder that are security related, all revolving around authorization and authentication.

1. Apply "least privilege" rule to selecting accounts, and disable unused features

If setting your SVN on Windows pay closer attention to the accounts under which processes will run.
If you do not plan implement any hooks, you can run subversion on Local System Account. Same type of account could be used with Apache server.

Additionally, secure Apache server by following all the standard procedures: disabling all unnecessary modules, turning off multiple options etc.

2. Choose your access protocols wisely
There are several protocols that can be used to access SVN:
[irrelevant, by and large]
file:// - Through this protocol you get direct repository access. Works only on the same system (local disk), not over the network.

[not secure]
http:// - It is possible to use WebDAV on a Subversion-aware Apache2 server to access a repository. Works over the network (port 80).
svn:// - Access to a repository is done through an svnserve server. Works over the network (port 3690).

[the only ones that should be considered for external access]
svn+ssh:// - Same as svn://, but through an SSH tunnel (port 22).
https:// - Same as http://, but over a secure SSL connection (port 443).

Using reverse proxy/gateway to fine-tune the access is highly recommended
The communications must encrypted either with SSL (get a real Verisign/Thawte certificate, or generate your own), or using SSH keys (instead of passwords set in open text! It does add to maintenance but is worth it ).

3. Restrict directory browsing.

You can limit the user to the one and only one directory by disabling directory browsing altogether on Apache HTTP Server level. This comes in handy when using "blanket" LDAP authentication as it might be possible to traverse directory structure by doctoring URL

Here's an example:
# Disallow browsing
<DirectoryMatch "^/.*/\.svn/">
Order deny,allow
Deny from all

4. Test your installation for vulnerabilities: what you don't know will hurt you

To test SVN security we could use any of network security tools such as Nessus or free OpenVAS
P.S.   SVN (also: TortoiseSVN client) supports SASL (Simple Authentication and Security Layer). It adds generic authentication and encryption capabilities to any network protocol. More information can be found here