Video Tutorial: |
Installing ModSecurity2 On Debian Etch
|
Submitted by falko (Contact Author) (Forums) on Thu, 2007-07-05 17:08. :: Debian | Apache | Security
Installing ModSecurity2 On Debian EtchVersion 1.0 This article shows how to install and configure ModSecurity (version 2) for use with Apache2 on a Debian Etch system. ModSecurity is an Apache module that provides intrusion detection and prevention for web applications. It aims at shielding web applications from known and unknown attacks, such as SQL injection attacks, cross-site scripting, path traversal attacks, etc. I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm assuming that Apache2 is already installed and fully functional on your Debian Etch system.
2 InstallationIn Debian Sarge, ModSecurity was available as a .deb package in the official Debian repositories, but in Debian Etch it was removed due to some license issues. Fortunately, the original maintainer provides packages for Debian Etch in his own repository. To install these, we need to add his repository to /etc/apt/sources.list: vi /etc/apt/sources.list
Afterwards, we update our packages database like this: apt-get update Now we can install ModSecurity2 with this simple command: apt-get install libapache2-mod-security2 That's it. The ModSecurity2 module gets enabled by default, and Apache2 is restarted automatically.
3 ConfigurationNow it's time to configure ModSecurity2. The easiest way to do this is download the ModSecurity2 source package from http://www.modsecurity.org/download/index.html (e.g. http://www.modsecurity.org/download/modsecurity-apache_2.1.1.tar.gz) and unpack it. It contains a file modsecurity.conf-minimal with a basic configuration for ModSecurity2 which I will use here (but I have adjusted the lines SecDebugLog and SecAuditLog so that ModSecurity2 logs to the /var/log/apache2 directory, Debian's default Apache2 log directory). We open Apache's main configuration file /etc/apache2/apache2.conf and put the following configuration into it, right before the end where the virtual hosts are included: vi /etc/apache2/apache2.conf
Afterwards we restart Apache (it should restart without errors): /etc/init.d/apache2 restart If you haven't got any errors, ModSecurity2 is now working with a basic configuration. You can now modify/extend this basic configuration so that it fits your needs. A good starting point is the ModSecurity2 documentation. Also, there are more advanced rulesets in the ModSecurity2 sources that we've downloaded before (in the rules directory), and you can even download core rulesets from http://www.modsecurity.org/download/index.html (e.g. http://www.modsecurity.org/download/modsecurity-core-rules_2.1-1.4.tar.gz). Christian Folini has provided a tutorial about Remo, a GUI for creating ModSecurity rulesets. This is another great way to create your own ModSecurity2 rulesets.
4 Links
|






Recent comments
9 hours 55 min ago
12 hours 57 min ago
16 hours 43 min ago
18 hours 57 min ago
20 hours 7 sec ago
23 hours 6 min ago
2 days 1 hour ago
2 days 6 hours ago
2 days 7 hours ago
2 days 12 hours ago