LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-22-2006, 08:23 AM   #1
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Rep: Reputation: 15
mod_security and Subversion (WebDAV?)


I can get Subversion to work ONLY if I disable mod_security. I believe this is because Subversion (using Apache) uses WebDAV, which uses methods besides GET, POST, etc.

Anyone know how to setup mod_secuity to allow Subversion? I'm guessing the most secure way would be to allow it only for the location to Subversion.

Thanks
 
Old 03-22-2006, 08:40 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Last time I checked DAV uses methods like LOCK, UNLOCK, PROPFIND, PROPPATCH, COPY, MOVE and MKCOL.
So AFAIK for each method you'd need some rule something like: "SecFilter "LOCK " pass". Maybe a <location> container works, just try it. FWIW, it's easier/faster/more efficient to post actual error messages.
 
Old 03-22-2006, 09:04 AM   #3
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Original Poster
Rep: Reputation: 15
Sorry, I made a conclusion on what the issue was, and forgot to mention the symptoms. This is what the SVN client (TortoiseSVN for Windows)is reporting:

Quote:
MKCOL of/svn/proj/!svn/wrk/3619e3f3-83b2-874a-815b-7f80fe548963/proj_web/trunk':
405 Method Not Allowed (http://www.<domain>.com)
I'll try the suggestions you made above.

Thanks for the response
 
Old 03-22-2006, 10:08 AM   #4
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Original Poster
Rep: Reputation: 15
Reenabled mod_security, and I'm getting a "403 Forbidden" error when its trying to do a PUT.

Here is my mod_security configuration:

Code:
LoadModule security_module    /usr/lib/httpd/modules/mod_security.so

# Enable mod_security
SecFilterEngine On

# Retrieve request payload
SecFilterScanPOST On

# Reasonable automatic validation defaults
SecFilterCheckURLEncoding On
SecFilterCheckCookieFormat Off
SecFilterNormalizeCookies Off
SecFilterCheckUnicodeEncoding Off

# Accept almost all byte values
SecFilterForceByteRange 0 255

# Reject invalid requests with status 403
SecFilterDefaultAction deny,log,status:403

# Only record the relevant information
SecAuditEngine RelevantOnly
SecAuditLog /var/log/httpd/audit_log

# Where to store temporary and intercepted files
SecUploadDir /var/log/httpd/files
# Do not store intercepted files for the time being
SecUploadKeepFiles Off

# Use 0 for the debug level in production
# and 4 for testing
SecFilterDebugLog /var/log/httpd/modsec_debug_log
SecFilterDebugLevel 0

SecServerSignature "Microsoft-IIS/5.0"

SecFilter PUT "allow"
 
Old 03-22-2006, 03:48 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Reenabled mod_security, and I'm getting a "403 Forbidden" error when its trying to do a PUT.
Maybe a <location> container works, just try it.
 
Old 03-23-2006, 10:23 AM   #6
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Original Poster
Rep: Reputation: 15
To answer my own question in case anyone else comes across this issue, unSpawn had the right idea.

The following worked great for me:

Code:
<Location /svn/proj>
  SecFilterEngine Off
</Location>
Where /svn/proj is the location of the subversion repository.
 
Old 03-23-2006, 02:18 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Code:
SecFilterEngine Off
So now it' doesn't filter anything AFAIK wrt /svnproj.
Shouldn't it be followed by what you want to filter for (like in the main portion of your config) leaving out only the WebDAV specific stuff?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_security kingtas Linux - Security 4 01-20-2008 04:53 PM
mod_security and fedora linchat Fedora 0 09-30-2005 09:34 PM
mod_security running? kingtas Linux - Newbie 0 01-23-2005 10:56 AM
mod_security ridertech Linux - Security 1 09-01-2004 05:16 PM
How to install Subversion(Version Control with Subversion) under RedHat Linux. netkiller Linux - Networking 1 07-01-2004 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration