Install ASL-Lite in Linux servers
For more info: http://www.atomicorp.com/wiki/index.php/ASL_Lite
1. wget -q -O – http://www.atomicorp.com/installers/asl–lite | sh
2. Compare the dates to make sure the security module is the latest.
date
ls -l /usr/local/apache/modules/mod_security2.so
3. Make all the required folders and put them in the right permission
mkdir -v /usr/local/apache/conf/modsec_rules/
cp -pv
/home/cpeasyapache/src/modsecurity-apache_2.5.13/rules/util/modsec-clamscan.pl
/usr/local/apache/conf/modsec_rules/modsec-clamscan.pl
chmod -v /var/asl
chmod -v 705 /var/asl/data
chown nobody.nobody /var/asl/data/msa
chown nobody.nobody /var/asl/data/audit
chown nobody.nobody /var/asl/data/suspicious
chmod o-rx -R /var/asl/data/
=========
SecAuditLogType Concurrent
SecResponseBodyAccess On
SecResponseBodyMimeType (null) text/html text/plain text/xml
SecResponseBodyLimit 2621440
SecAuditLogRelevantStatus “^(?:5|4(?!04))”
SecServerSignature Apache
SecRule FILES_TMPNAMES “@inspectFile /usr/local/apache/conf/modsec_rules/modsec-clamscan.pl” “log,auditlog,deny,status:403,severity:2,phase:2,t:none,id:’1010101′”
SecUploadDir /var/asl/data/suspicious
SecUploadKeepFiles Off
SecAuditLogParts ABIFHZ
SecArgumentSeparator “&”
SecCookieFormat 0
SecRequestBodyInMemoryLimit 131072
SecDataDir /var/asl/data/msa
SecTmpDir /tmp
SecAuditLogStorageDir /var/asl/data/audit
SecResponseBodyLimitAction ProcessPartial
SecPcreMatchLimit 50000
SecPcreMatchLimitRecursion 50000
Include /usr/local/apache/conf/modsec_rules/10_asl_antimalware.conf
Include /usr/local/apache/conf/modsec_rules/10_asl_rules.conf
Include /usr/local/apache/conf/modsec_rules/20_asl_useragents.conf
Include /usr/local/apache/conf/modsec_rules/30_asl_antispam.conf
Include /usr/local/apache/conf/modsec_rules/50_asl_rootkits.conf
Include /usr/local/apache/conf/modsec_rules/60_asl_recons.conf
Include /usr/local/apache/conf/modsec_rules/99_asl_jitp.conf
Include /usr/local/apache/conf/modsec_rules/whitelist.conf
=========
LoadFile /opt/lua/lib/liblua.so
LoadModule security2_module modules/mod_security2.so
SecRuleEngine On
# See http://www.modsecurity.org/documentation/ModSecurity-Migration-Matrix.pdf
# “Add the rules that will do exactly the same as the directives”
# SecFilterCheckURLEncoding On
# SecFilterForceByteRange 0 255
SecAuditEngine RelevantOnly
SecAuditLog logs/modsec_audit.log
SecDebugLog logs/modsec_debug_log
SecDebugLogLevel 0
SecDefaultAction “phase:2,deny,log,status:406”
SecRule REMOTE_ADDR “^127.0.0.1$” nolog,allow
Include “/usr/local/apache/conf/modsec2.user.conf”
Monitor logs for 30 mins to see if there are any errors
www.atomicorp.com/channels/rules/subscription
Download the latest rule using
/usr/bin/wget—no-cache -q -P /usr/local/src/
Replace clamav-201107071712.tar.gz with whatever the latest rule is
Untar the file, change ownership and place it in ClamAV rules folder
cd /usr/local/src/
tar xzvf clamav-201107071712.tar.gz
cd /usr/local/src/clamav
mv -v ASL /usr/share/clamav
cd /usr/share/clamav
chown -v clamav.clamav ASL*
and ASL lite installation is completed successfully!
Extremely useful commands for installing linux server.