LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-07-2014, 07:08 AM   #1
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Rep: Reputation: 2
Mod_security installed, no config files


Just installed mod_security in a RedHat 5.5. As this system doesn't have internet connection, I had to download mod_security and install it by configure, make and make install.

At first attempt, the configure failed due to the version of libxml2 (it needs 2.6.29 but RedHat 5 has 2.6.26). Due to this, I had to download an older version of mod_security, 2.6.x (2.7.x requires libxml2 2.6.29), and successfully ran the configure, make and make install.

However, I don't see any of the config files listed here http://www.cyberciti.biz/faq/rhel-fe...configuration/
 
Old 04-07-2014, 12:16 PM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
You have to download the config files separately. I think this changed some year(s) ago, I do believe when I started with modsec everything came in one package - but not really sure though.
Anyway, you need to download the ruleset, here's a link: https://github.com/SpiderLabs/owasp-modsecurity-crs
Pick the rules you want, base-rules at least.
 
Old 04-08-2014, 06:03 AM   #3
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Original Poster
Rep: Reputation: 2
what do you mean by separately? From where do I get them? Because at modsecurity's site there is anything related to it.
 
Old 04-08-2014, 08:02 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Here's what I did on CentOS 5.10
This is a general guide and not a recipe
Code:
wget https://codeload.github.com/SpiderLabs/owasp-modsecurity-crs/legacy.tar.gz/master
move master modsecurity-crs_2.2.5.tar.gz
mv master modsecurity-crs_2.2.5.tar.gz
tar ztf modsecurity
tar ztf modsecurity-crs_2.2.5.tar.gz 
tar zxf modsecurity-crs_2.2.5.tar.gz 
mv SpiderLabs-owasp-modsecurity-crs-4ed6347/ modsecurity-crs
rm modsecurity-crs_2.2.5.tar.gz 
cd modsecurity-crs
cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_config.conf
...
for f in `ls base_rules/` ; do sudo ln -s /etc/httpd/modsecurity-crs/base_rules/$f /etc/httpd/modsecurity.d/acttivated_rules/$f ; done
for f in `ls base_rules/` ; do sudo ln -s /etc/httpd/modsecurity-crs/base_rules/$f /etc/httpd/modsecurity.d/activated_rules/$f ; done
for f in `ls /etc/httpd/modsecurity-crs/base_rules/base_rules/` ; do echo $f; dohe
for f in `ls /etc/httpd/modsecurity-crs/base_rules/base_rules/` ; do echo $f; done
for f in `ls /etc/httpd/modsecurity-crs/base_rules/` ; do echo $f; done
References:
https://www.linuxquestions.org/quest.../#post2122954/

Thanks to unSpawn for his tireless efforts.
 
Old 04-09-2014, 07:08 AM   #5
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Original Poster
Rep: Reputation: 2
I ended up following this tutorial http://www.servermom.org/how-to-inst...he-server/844/

I'm facing a problem right now. After installation, when I try to run Apache I'm getting the following error

Code:
Starting httpd: Syntax error on line 52 of /etc/httpd/modsecurity-crs/base_rules/modsecurity_crs_20_protocol_violations.conf:
Error parsing actions: Unknown action: ver

The line 52 of that file is
Code:
setvar:'tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/INVALID_REQ-%{matched_var_name}=%{matched_var}'"
Any idea?


edit: never mind, it turned out to be that the recent version of the OWASP rules needs at least version 2.7 of ModSecurity. Got the version 2.2.5 of the rules and the problem is gone.

Last edited by yzT!; 04-09-2014 at 07:54 AM.
 
Old 04-09-2014, 12:27 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it worked out!
 
Old 04-09-2014, 12:38 PM   #7
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by yzT! View Post
what do you mean by separately? From where do I get them? Because at modsecurity's site there is anything related to it.
Well, try the link I posted...
 
Old 04-09-2014, 10:17 PM   #8
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
glad to see its working for you.
about ~2yrs ago i did some build docs for a customer, part of it was the modesec2 install & config for apache
attached is pic of that, just as a reference for others, etc.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	79
Size:	45.2 KB
ID:	15203  
 
Old 04-11-2014, 04:28 AM   #9
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Original Poster
Rep: Reputation: 2
never mind

Last edited by yzT!; 04-11-2014 at 07:19 AM.
 
  


Reply



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
[SOLVED] Mod_security config anwar-it0 Linux - Security 3 09-19-2012 08:07 AM
confiuration files config-2.6.20.4-1/config-2.6.18 mythathchr Linux - Kernel 3 10-28-2007 03:21 AM
Doom 3: Using native installer and can't locate saved game files or config files JBailey742 Linux - Games 11 08-14-2006 06:09 PM
Webmin cannot handle Samba config files that use the config or include directives allelopath Linux - Networking 3 01-18-2005 09:36 AM
PKG-CONFIG, Installed Yet Not? inescapeableus Linux - Software 2 07-25-2004 08:48 AM

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

All times are GMT -5. The time now is 02:40 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