{"id":2165,"date":"2021-06-25T10:38:01","date_gmt":"2021-06-25T07:38:01","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=2165"},"modified":"2021-06-29T09:35:48","modified_gmt":"2021-06-29T06:35:48","slug":"what-is-mod_security-and-should-i-use-it","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/what-is-mod_security-and-should-i-use-it\/","title":{"rendered":"What is mod_security and Should I Use It?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Organizations need every help they can get to <\/span><b>protect their systems and online assets<\/b><span style=\"font-weight: 400;\">.\u00a0 The rate of malicious attacks and requests against web apps has made securing online assets increasingly necessary.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The latest Annual Bad Bot Report shows that automated attack bots generated a quarter of all web traffic in 2019, rising 18.1 percent from the previous year. Humans account for only about 62 percent of all internet traffic.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The report shows that financial services (47.7 percent), education (45.7 percent), IT and services (45.1 percent), marketplace (39.8 percent), and government (37.5 percent) received the most hits.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Most of the bad bots impersonated Chrome browsers to by-pass scrutiny<\/span><i><span style=\"font-weight: 400;\">. How do you protect your systems from these attacks? <\/span><\/i><span style=\"font-weight: 400;\">L<\/span><b>et\u2019s take a look at mod_security and what it does.<\/b><\/p>\n<h2><b>What\u2019s Mod_Security?<\/b><\/h2>\n<p><b>Mod_security is an open-source web application firewall (WAF)<\/b><span style=\"font-weight: 400;\"> that safeguards websites and web applications against many threats and automated bots attacks.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It establishes external security layers that <\/span><b>offer protection to web-based software programs<\/b><span style=\"font-weight: 400;\">, detecting and preventing attacks, like cross-site scripting and code injection attacks before they reach them.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The module is invaluable for protecting websites running on content management systems (CMS), for example, <\/span><b>WordPress or <\/b><a href=\"https:\/\/www.scalahosting.com\/magento-hosting.html\"><b>eCommerce applications like Magento<\/b><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Though most servers have <\/span><b>in-built firewalls, mod_security<\/b><span style=\"font-weight: 400;\"> plays a complementary role to offer complete security to web applications.<\/span><\/p>\n<h2><b>How Does Mod_Security Work?<\/b><\/h2>\n<p><b>Network firewalls safeguard servers from malicious traffic<\/b><span style=\"font-weight: 400;\"> at the network level but cannot filter malicious requests against web applications because they often mimic legitimate web traffic.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Mod_security works best at <\/span><b>handling malicious requests<\/b><span style=\"font-weight: 400;\"> at application layers. It\u2019s a rule-based web application firewall that works in the background.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The firewall monitors incoming web requests in<\/span><b> real-time to identify malicious traffic<\/b><span style=\"font-weight: 400;\"> by comparing the requests to a list of rules.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It searches for patterns that match attacks such as <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/cyber-attack-guide-sql-injections\/\"><b>SQL injections<\/b><\/a><span style=\"font-weight: 400;\">, cross-site scripting, session hijacking, and more, blocking the connections before they reach the application.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The<\/span><b> Open Web Application Security Project (OWASP) <\/b><span style=\"font-weight: 400;\">curates the most popular free ruleset in common use today. The <\/span><b>Core Rule Set<\/b><span style=\"font-weight: 400;\"> includes rules that protect web applications against a wide range of threats.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The ruleset can also protect against the OWASP Top Ten\u2014a frequently <\/span><b>updated list of the most common threats.<\/b><\/p>\n<h2><b>Why You Should Use It<\/b><\/h2>\n<p><b>Mod_security helps protect your system against common web-based threats.<\/b><span style=\"font-weight: 400;\"> It works in real-time to filter malicious activities. The module complements your network firewall to keep your application safer.<\/span><\/p>\n<p><b>The module support rule engine that helps protects against:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Cross-site scripting (XSS)<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Session hijacking<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">SQL injection<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Bad user agents<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Trojans, and others<\/span><\/i><\/li>\n<\/ul>\n<h2><b>Wrapping It Up<\/b><\/h2>\n<p><b>Mod_security is a toolkit for real-time intrusion detection and prevention.<\/b><span style=\"font-weight: 400;\"> It works in the background, comparing every page request against various rules to filter out seemingly malicious traffic. Users can adapt and extend the rule language to fit their needs.\u00a0<\/span><\/p>\n<p><b>This flexibility makes mod_security capable of:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Real-time application security monitoring<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Virtual patching because of its reliable blocking capabilities<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">\u00a0Full HTTP traffic logging, including raw transactional data<\/span><\/i><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Web application hardening by selectively narrowing down the HTTP requests you accept<\/span><\/i><\/li>\n<\/ul>\n<p><i><\/i><span style=\"font-weight: 400;\">Scala Hosting regularly updates its<\/span> <a href=\"https:\/\/www.scalahosting.com\/blog\/scala-hosting-security-made-better\/\"><b>mod_security rule<\/b><\/a><span style=\"font-weight: 400;\"> to deal with threats as they arise.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Organizations need every help they can get to protect their systems and online assets.\u00a0 The rate of malicious attacks and requests against web apps has made securing online assets increasingly necessary.\u00a0 The latest Annual Bad Bot Report shows that automated attack bots generated a quarter of all web traffic in 2019, rising 18.1 percent from [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_analysis_target_kw":"","footnotes":""},"categories":[40],"tags":[],"class_list":["post-2165","post","type-post","status-publish","format-standard","hentry","category-security"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=2165"}],"version-history":[{"count":2,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2165\/revisions"}],"predecessor-version":[{"id":2167,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2165\/revisions\/2167"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=2165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=2165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=2165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}