{"id":10650,"date":"2023-08-03T08:45:36","date_gmt":"2023-08-02T23:45:36","guid":{"rendered":"https:\/\/www.prime-strategy.co.jp\/column\/archives\/column_10650"},"modified":"2026-02-22T21:06:29","modified_gmt":"2026-02-22T12:06:29","slug":"__trashed","status":"publish","type":"post","link":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650","title":{"rendered":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0"},"content":{"rendered":"\n<p>KUSANAGI comes with a built-in Web Application Firewall (WAF) feature.&nbsp;<br>In this article, we\u2019ll walk you through how to use this feature, as well as how to investigate potential causes when errors occur.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Benefits_of_Introducing_a_WAF\"><\/span><strong>Benefits of Introducing a WAF<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>WAF stands for <strong>Web Application Firewall<\/strong>, and it serves as a protective layer for web applications such as WordPress.&nbsp;<br>It helps prevent malicious access attempts that exploit known vulnerabilities\u2014like SQL injection or directory traversal\u2014<strong>before<\/strong> they reach the application layer (e.g., PHP).&nbsp;<\/p>\n\n\n\n<p>By blocking suspicious requests at the web server level, WAF reduces the risk of damage from unpatched vulnerabilities.&nbsp;<\/p>\n\n\n\n<p>We\u2019ve briefly touched on this topic before in our article <em>\u201cPreparing for attacks with WAF\u201d<\/em>, but this time we\u2019ll take a deeper dive into its setup and troubleshooting.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Enable_WAF_in_KUSANAGI\"><\/span><strong>How to Enable WAF in KUSANAGI<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>KUSANAGI includes a built-in WAF feature out of the box.&nbsp;<br>It uses <strong>NAXSI<\/strong> for nginx and <strong>ModSecurity<\/strong> for Apache.&nbsp;<br>Note, however, that WAF is <strong>not enabled by default<\/strong>, so you\u2019ll need to activate it manually.&nbsp;<\/p>\n\n\n\n<p>You can enable it with a single command:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kusanagi waf on<\/code><\/pre>\n\n\n\n<p>During the first execution, KUSANAGI will automatically install any necessary packages.&nbsp;<br>If the setup is successful, you should see the following messages at the end:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>restart completed.<br>waf completed.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Analyze_Errors_with_NAXSI_on_nginx\"><\/span><strong>How to Analyze Errors with NAXSI on nginx<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once you've enabled WAF, you may occasionally encounter errors such as 403 Forbidden when accessing your site. In this section, we'll explain how to analyze and resolve such issues.&nbsp;<\/p>\n\n\n\n<p><em>Note: KUSANAGI includes NAXSI rules optimized for WordPress by default, so the example error below won\u2019t normally occur. For demonstration purposes, these default rules have been disabled.<\/em>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Check_the_nginx_Error_Log\"><\/span><strong>Step 1: Check the nginx Error Log<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-image img-border\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"330\" src=\"https:\/\/www.prime-strategy.co.jp\/column\/wp-content\/uploads\/2023\/07\/29d3bc99193cb0b837fb8cc53f050ae5.png\" alt=\"NAXSI WAF\u306b\u3088\u308b403\u753b\u9762\" class=\"wp-image-6708\" srcset=\"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/29d3bc99193cb0b837fb8cc53f050ae5.png 709w, https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/29d3bc99193cb0b837fb8cc53f050ae5-300x140.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n<\/div>\n\n\n<p>If you see a 403 Forbidden page, the first step is to check the <strong>nginx error log<\/strong> for the corresponding profile.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For regular access errors:&nbsp;<br>\/home\/kusanagi\/(profile_name)\/log\/nginx\/error.log&nbsp;<\/li>\n\n\n\n<li>For HTTPS-related errors:&nbsp;<br>\/home\/kusanagi\/(profile_name)\/log\/nginx\/ssl_error.log&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Here\u2019s an example of an actual log entry:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2023\/07\/21 08:36:23 &#91;error] 7432#7432: *1 NAXSI_FMT: ip=192.0.2.1&amp;server=example.com.internal&amp;uri=\/wp-login.php&amp;vers=1.3&amp;total_processed=1&amp;total_blocked=1&amp;config=block&amp;cscore0=$XSS&amp;score0=16&amp;zone0=HEADERS&amp;id0=1315&amp;var_name0=cookie, client: 50.5.35.41, server: example.com.internal, request: \"GET \/wp-login.php?action=logout&amp;_wpnonce=facec0ed55 HTTP\/1.1\", host: \"example.com.internal\", referrer: \"http:\/\/example.com.internal\/\" <\/code><\/pre>\n\n\n\n<p>Look for id0 in the log \u2014 in this case, it shows 1315. This indicates the rule ID that triggered the block. If multiple rules were triggered, you\u2019d see id1, id2, and so on.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Look_Up_the_Rule_ID\"><\/span><strong>Step 2: Look Up the Rule ID<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To understand what rule 1315 refers to, open the base rules file:&nbsp;<\/p>\n\n\n\n<p>\/etc\/opt\/kusanagi\/nginx\/naxsi.d\/naxsi_core.rules.conf&nbsp;<br><br>Search for rule ID 1315. You might find something like this:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MainRule \"rx:%&#91;23].\"&nbsp; \"msg:double encoding\" \"mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie\" \"s:$XSS:8\" id:1315;<\/code><\/pre>\n\n\n\n<p>This rule flags content with double encoding as a potential XSS threat and increases the risk score accordingly.&nbsp;<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-8a4bbe83 gb-headline-text\"><span class=\"ez-toc-section\" id=\"Step_3_Whitelist_the_Rule_for_the_Specific_Context\"><\/span><strong>Step 3: Whitelist the Rule for the Specific Context<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Next, let\u2019s craft an exception rule (whitelist) to prevent this from being triggered in safe cases.&nbsp;<\/p>\n\n\n\n<p>From the log entry:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>zone0=HEADERS tells us the issue occurred in the HTTP headers.&nbsp;<\/li>\n\n\n\n<li>var_name0=cookie indicates the suspicious data was in the Cookie header.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>To bypass this rule only in that context, add the following line:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>BasicRule wl:1315 \"mz:$HEADERS_VAR:cookie\";<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>wl means whitelist&nbsp;<\/li>\n\n\n\n<li>1315 is the rule ID to ignore&nbsp;<\/li>\n\n\n\n<li>mz:$HEADERS_VAR:cookie limits the exception to the Cookie field in headers&nbsp;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Apply_the_Rule_and_Restart_nginx\"><\/span><strong>Step 4: Apply the Rule and Restart nginx<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Place the whitelist rule into the following file:&nbsp;<\/p>\n\n\n\n<p>\/etc\/opt\/kusanagi\/nginx\/naxsi.d\/wordpress\/user.conf&nbsp;<\/p>\n\n\n\n<p>Then restart nginx:&nbsp;<\/p>\n\n\n\n<p>kusanagi nginx&nbsp;<\/p>\n\n\n\n<p>After restarting, confirm that the issue is resolved.&nbsp;<\/p>\n\n\n\n<p>Repeat this process whenever false positives occur.&nbsp;<br>By refining your rules over time, you can improve both <strong>security precision<\/strong> and <strong>site usability<\/strong>.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Analyze_Errors_with_ModSecurity_on_Apache\"><\/span><strong>How to Analyze Errors with ModSecurity on Apache<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>While KUSANAGI uses <strong>nginx<\/strong> as its default web server, many production environments run on <strong>Apache<\/strong>.&nbsp;<\/p>\n\n\n\n<p>In this section, we'll cover how to investigate and respond to errors when using <strong>ModSecurity<\/strong> with Apache.&nbsp;<\/p>\n\n\n\n<p>For this demonstration, we used a specially crafted test script to send requests and intentionally trigger a block screen.&nbsp;<\/p>\n\n\n\n<p>When ModSecurity detects a suspicious or malformed request, the server responds with a block page and denies access.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large img-border\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"474\" src=\"https:\/\/www.prime-strategy.co.jp\/column\/wp-content\/uploads\/2023\/07\/image-1-1024x474.png\" alt=\"ModSecurity WAF\u306b\u3088\u308b403\u753b\u9762\" class=\"wp-image-6745\" srcset=\"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/image-1-1024x474.png 1024w, https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/image-1-300x139.png 300w, https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/image-1-768x355.png 768w, https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/image-1-1536x711.png 1536w, https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/07\/image-1.png 1917w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Review_Apache_Error_Logs\"><\/span><strong>Step 1: Review Apache Error Logs<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When a request is blocked, the reason is logged in:&nbsp;<\/p>\n\n\n\n<p>\/home\/kusanagi\/(profile_name)\/log\/httpd\/error.log&nbsp;<\/p>\n\n\n\n<p>If the request was made via HTTPS, check:&nbsp;<\/p>\n\n\n\n<p>ssl_error.log&nbsp;<\/p>\n\n\n\n<p>These logs often contain a large volume of information. Start by checking the <strong>timestamp<\/strong> near the beginning of the line, such as:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Fri Jul 21 08:36:23.102987 2023] \nThis tells you exactly when the event occurred (in this case, July 21, 2023 at 08:36:23 AM). \nThen, look for lines that mention rule IDs like: \n&#91;id \"920220\"], &#91;id \"920270\"], &#91;id \"949110\"], &#91;id \"980130\"] <\/code><\/pre>\n\n\n\n<p>These indicate which ModSecurity rules were triggered.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_Error_Log\"><\/span><strong>Example Error Log<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here's a sample log entry (with some parts masked):&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Fri Jul 21 08:36:23.103004 2023] &#91;security2:error] &#91;pid *****:tid ***************] &#91;client 192.0.2.1:*****] &#91;client 192.0.2.1] ModSecurity: Access denied with code 403 (phase 2). Operator GE matched 5 at TX:anomaly_score. &#91;file \"\/etc\/opt\/kusanagi\/httpd\/modsecurity.d\/activated_rules\/REQUEST-949-BLOCKING-EVALUATION.conf\"] &#91;line \"153\"] &#91;id \"949110\"] &#91;msg \"Inbound Anomaly Score Exceeded (Total Score: 10)\"] &#91;severity \"CRITICAL\"] &#91;ver \"OWASP_CRS\/3.3.4\"] &#91;tag \"application-multi\"] &#91;tag \"language-multi\"] &#91;tag \"platform-multi\"] &#91;tag \"attack-generic\"] &#91;hostname \"example.com.internal\"] &#91;uri \"\/\"] &#91;unique_id \"***************************\"] <\/code><\/pre>\n\n\n\n<p>This warning means the request included a null character (invalid input) in the query string.&nbsp;<\/p>\n\n\n\n<p>Such errors are typically triggered by malformed or suspicious inputs. While these may not cause issues with thread-safe software, non-thread-safe software could be vulnerable. Use caution when deciding to whitelist such requests.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Creating_an_Exception_Whitelist\"><\/span><strong>Step 2: Creating an Exception (Whitelist)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this case, the requests were intentionally crafted and confirmed to be safe, so we\u2019ll create a whitelist rule.&nbsp;<\/p>\n\n\n\n<p>You may also need the request path, query string, or referrer. These appear toward the end of the log line as:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>uri \"\/path\"&nbsp;<\/li>\n\n\n\n<li>data \"...\" (contains the matched string)&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Now identify which rule IDs to exclude. Ideally, <strong>only exclude the minimal necessary rules<\/strong> to avoid weakening your WAF protection.&nbsp;<\/p>\n\n\n\n<p>For example, let\u2019s say we determined that these two IDs can be safely ignored:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>949110: Inbound anomaly score exceeded&nbsp;<\/li>\n\n\n\n<li>980130: (not shown in full here, but assumed safe based on context)&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Here's a sample log for 949110:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Fri Jul 21 08:36:23.103004 2023] &#91;security2:error] ... &#91;id \"949110\"] &#91;msg \"Inbound Anomaly Score Exceeded (Total Score: 10)\"] ... <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Add_a_Conditional_Exception_Rule\"><\/span><strong>Step 3: Add a Conditional Exception Rule<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Two more rule IDs remain (e.g., 920220, 920270). We'll add a conditional rule that disables them <strong>only when the query string or referrer matches a specific pattern<\/strong>, like test_query_string.&nbsp;<\/p>\n\n\n\n<p>Append the following block to:&nbsp;<\/p>\n\n\n\n<p>\/etc\/opt\/kusanagi\/httpd\/modsecurity.d\/kusanagi_activated_rules\/wordpress\/user.conf&nbsp;<\/p>\n\n\n\n<p>apache&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> &lt;If \"%{QUERY_STRING} =~ \/.*test_query_string=.*\/ || %{HTTP_REFERER} =~ \/.*test_query_string=.*\/\"&gt; \n\n    SecRuleRemoveById 920220 \n\n    SecRuleRemoveById 920270 \n\n&lt;\/If&gt; <\/code><\/pre>\n\n\n\n<p>This rule tells ModSecurity to <strong>remove<\/strong> the specified rules only under tightly defined conditions, reducing the risk of over-whitelisting.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Restart_and_Verify\"><\/span><strong>Step 4: Restart and Verify<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After saving the file, restart Apache using:&nbsp;<\/p>\n\n\n\n<p>kusanagi httpd&nbsp;<\/p>\n\n\n\n<p>Then verify that the site loads correctly and the design remains intact.&nbsp;<\/p>\n\n\n\n<p>By repeating this process and reviewing each blocked request, you can fine-tune your WAF configuration for both security and usability.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Disabling_WAF_as_a_last_resort\"><\/span><strong>5. Disabling WAF as a last resort<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you've investigated the error using the above methods and still cannot resolve the issue\u2014and <strong>only if absolutely necessary<\/strong>\u2014you may disable the WAF entirely using the following command:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kusanagi waf off&nbsp;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Conclusion\"><\/span><strong>6. Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By leveraging the built-in WAF in KUSANAGI, you can operate a more secure website with minimal effort.&nbsp;<\/p>\n\n\n\n<p>While false positives can occur, they are generally easy to investigate and correct once you get the hang of it.&nbsp;<\/p>\n\n\n\n<p>We recommend evaluating the trade-off between <strong>security<\/strong> and <strong>convenience<\/strong>, and considering WAF as a practical solution to harden your web application.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"References\"><\/span>References<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/code.google.com\/archive\/p\/naxsi\/wikis\/BasicRule.wiki\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.google.com\/archive\/p\/naxsi\/wikis\/BasicRule.wiki<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kusanagi.tokyo\/en\/kusanagi9\/document\/commands\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/kusanagi.tokyo\/kusanagi9\/document\/commands\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>KUSANAGI comes with a built-in Web Application Firewall (WAF) feature.&nbsp;In this article, we\u2019ll walk you through how to use this feature, as well as how to investigate potential causes when errors occur.&nbsp; Benefits of Introducing a WAF WAF stands for Web Application Firewall, and it serves as a protective layer for web applications such as WordPress.&nbsp;It helps prevent malicious access attempts that exploit known vulnerabilities\u2014like SQL injection or directory traversal\u2014before ... <a title=\"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0\" class=\"read-more\" href=\"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650\" aria-label=\"Read more about Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0\">Read more<\/a><\/p>\n","protected":false},"author":30,"featured_media":10676,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[137,138],"tags":[118],"series":[86],"journey":[123],"product":[],"class_list":["post-10650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","category-oss","tag-security","series-kusanagi-command-en","journey-build","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0 - KUSANAGI Tech Column<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0 - KUSANAGI Tech Column\" \/>\n<meta property=\"og:description\" content=\"KUSANAGI comes with a built-in Web Application Firewall (WAF) feature.&nbsp;In this article, we\u2019ll walk you through how to use this feature, as well as how to investigate potential causes when errors occur.&nbsp; Benefits of Introducing a WAF WAF stands for Web Application Firewall, and it serves as a protective layer for web applications such as WordPress.&nbsp;It helps prevent malicious access attempts that exploit known vulnerabilities\u2014like SQL injection or directory traversal\u2014before ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650\" \/>\n<meta property=\"og:site_name\" content=\"KUSANAGI Tech Column\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-02T23:45:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-22T12:06:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"520\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u798f\u7530\u62d3\u6717\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@kusanagi_saya\" \/>\n<meta name=\"twitter:site\" content=\"@kusanagi_saya\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650\"},\"author\":{\"name\":\"\u798f\u7530\u62d3\u6717\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#\\\/schema\\\/person\\\/7af5a2007e22aa5153d0e46a97b67f4f\"},\"headline\":\"Protecting Your Site with kusanagi waf (ModSecurity\\\/NAXSI)\u00a0\",\"datePublished\":\"2023-08-02T23:45:36+00:00\",\"dateModified\":\"2026-02-22T12:06:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650\"},\"wordCount\":1193,\"publisher\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png\",\"keywords\":[\"Security\"],\"articleSection\":[\"Nginx\",\"OSS\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650\",\"name\":\"Protecting Your Site with kusanagi waf (ModSecurity\\\/NAXSI)\u00a0 - KUSANAGI Tech Column\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png\",\"datePublished\":\"2023-08-02T23:45:36+00:00\",\"dateModified\":\"2026-02-22T12:06:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#primaryimage\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png\",\"contentUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png\",\"width\":1024,\"height\":520},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_10650#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Protecting Your Site with kusanagi waf (ModSecurity\\\/NAXSI)\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#website\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\",\"name\":\"KUSANAGI Tech Column\",\"description\":\"\u901f\u3055\u306e\u7406\u7531\u3092\u77e5\u308b\u3002\u5b89\u5168\u306e\u4ed5\u7d44\u307f\u3092\u77e5\u308b\u3002WordPress\u904b\u7528\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u89e3\u304f\u6280\u8853\u30b3\u30e9\u30e0\",\"publisher\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#organization\",\"name\":\"KUSANAGI Tech Column\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/logo-tc.png\",\"contentUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/logo-tc.png\",\"width\":716,\"height\":57,\"caption\":\"KUSANAGI Tech Column\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/kusanagi_saya\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en#\\\/schema\\\/person\\\/7af5a2007e22aa5153d0e46a97b67f4f\",\"name\":\"\u798f\u7530\u62d3\u6717\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g\",\"caption\":\"\u798f\u7530\u62d3\u6717\"},\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u59cb\u3081\u305f\u306e\u306f10\u6b73\u524d\u5f8c\u3002\u4e2d\u5b661\u5e74\u751f\u306e\u3053\u308d\u304b\u3089VPS\u306a\u3069\u3092\u6d3b\u7528\u3057\u3001\u30b5\u30fc\u30d0\u3092\u904b\u7528\u4e2d\u3002\u30a2\u30e1\u30ea\u30ab\u306e\u5927\u5b66\u306eIT\u5b66\u90e8\u3092\u5352\u696d\u3057\u3001\u5f53\u793e\u306b\u65b0\u5352\u3067\u5165\u793e\u3002\u73fe\u5728\u306fPrime Strategy New York, Inc.\u306b\u5728\u7c4d\u3057\u3064\u3064\u3001KUSANAGI\u306a\u3069\u306e\u958b\u767a\u306b\u643a\u308f\u308b\u3002 \u6271\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u4e00\u4f8b\u3068\u3057\u3066\u3001Ruby, PHP, Rust, Python\u306a\u3069\u3002OS\u3067\u306fUbuntu\u3084AlmaLinux\u306a\u3069\u3002\",\"sameAs\":[\"https:\\\/\\\/www.prime-strategy.co.jp\\\/services\\\/wexal-service\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ftkro\"],\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/en\\\/archives\\\/column_author\\\/fukuda-takuro\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0 - KUSANAGI Tech Column","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650","og_locale":"en_US","og_type":"article","og_title":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0 - KUSANAGI Tech Column","og_description":"KUSANAGI comes with a built-in Web Application Firewall (WAF) feature.&nbsp;In this article, we\u2019ll walk you through how to use this feature, as well as how to investigate potential causes when errors occur.&nbsp; Benefits of Introducing a WAF WAF stands for Web Application Firewall, and it serves as a protective layer for web applications such as WordPress.&nbsp;It helps prevent malicious access attempts that exploit known vulnerabilities\u2014like SQL injection or directory traversal\u2014before ... Read more","og_url":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650","og_site_name":"KUSANAGI Tech Column","article_published_time":"2023-08-02T23:45:36+00:00","article_modified_time":"2026-02-22T12:06:29+00:00","og_image":[{"width":1024,"height":520,"url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png","type":"image\/png"}],"author":"\u798f\u7530\u62d3\u6717","twitter_card":"summary_large_image","twitter_creator":"@kusanagi_saya","twitter_site":"@kusanagi_saya","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#article","isPartOf":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650"},"author":{"name":"\u798f\u7530\u62d3\u6717","@id":"https:\/\/kusanagi.tokyo\/column\/en#\/schema\/person\/7af5a2007e22aa5153d0e46a97b67f4f"},"headline":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0","datePublished":"2023-08-02T23:45:36+00:00","dateModified":"2026-02-22T12:06:29+00:00","mainEntityOfPage":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650"},"wordCount":1193,"publisher":{"@id":"https:\/\/kusanagi.tokyo\/column\/en#organization"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#primaryimage"},"thumbnailUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png","keywords":["Security"],"articleSection":["Nginx","OSS"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650","url":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650","name":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0 - KUSANAGI Tech Column","isPartOf":{"@id":"https:\/\/kusanagi.tokyo\/column\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#primaryimage"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#primaryimage"},"thumbnailUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png","datePublished":"2023-08-02T23:45:36+00:00","dateModified":"2026-02-22T12:06:29+00:00","breadcrumb":{"@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#primaryimage","url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png","contentUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2023\/08\/Protecting-Your-Site-with-kusanagi-waf-ModSecurity_NAXSI.png","width":1024,"height":520},{"@type":"BreadcrumbList","@id":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_10650#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/kusanagi.tokyo\/column\/en"},{"@type":"ListItem","position":2,"name":"Protecting Your Site with kusanagi waf (ModSecurity\/NAXSI)\u00a0"}]},{"@type":"WebSite","@id":"https:\/\/kusanagi.tokyo\/column\/en#website","url":"https:\/\/kusanagi.tokyo\/column\/en","name":"KUSANAGI Tech Column","description":"\u901f\u3055\u306e\u7406\u7531\u3092\u77e5\u308b\u3002\u5b89\u5168\u306e\u4ed5\u7d44\u307f\u3092\u77e5\u308b\u3002WordPress\u904b\u7528\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u89e3\u304f\u6280\u8853\u30b3\u30e9\u30e0","publisher":{"@id":"https:\/\/kusanagi.tokyo\/column\/en#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kusanagi.tokyo\/column\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kusanagi.tokyo\/column\/en#organization","name":"KUSANAGI Tech Column","url":"https:\/\/kusanagi.tokyo\/column\/en","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kusanagi.tokyo\/column\/en#\/schema\/logo\/image\/","url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2024\/07\/logo-tc.png","contentUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2024\/07\/logo-tc.png","width":716,"height":57,"caption":"KUSANAGI Tech Column"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/en#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/kusanagi_saya"]},{"@type":"Person","@id":"https:\/\/kusanagi.tokyo\/column\/en#\/schema\/person\/7af5a2007e22aa5153d0e46a97b67f4f","name":"\u798f\u7530\u62d3\u6717","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7de8084c7eeea979db21648524d8650cc3cf654c727331702eb2cae1651df13c?s=96&d=mm&r=g","caption":"\u798f\u7530\u62d3\u6717"},"description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u59cb\u3081\u305f\u306e\u306f10\u6b73\u524d\u5f8c\u3002\u4e2d\u5b661\u5e74\u751f\u306e\u3053\u308d\u304b\u3089VPS\u306a\u3069\u3092\u6d3b\u7528\u3057\u3001\u30b5\u30fc\u30d0\u3092\u904b\u7528\u4e2d\u3002\u30a2\u30e1\u30ea\u30ab\u306e\u5927\u5b66\u306eIT\u5b66\u90e8\u3092\u5352\u696d\u3057\u3001\u5f53\u793e\u306b\u65b0\u5352\u3067\u5165\u793e\u3002\u73fe\u5728\u306fPrime Strategy New York, Inc.\u306b\u5728\u7c4d\u3057\u3064\u3064\u3001KUSANAGI\u306a\u3069\u306e\u958b\u767a\u306b\u643a\u308f\u308b\u3002 \u6271\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u4e00\u4f8b\u3068\u3057\u3066\u3001Ruby, PHP, Rust, Python\u306a\u3069\u3002OS\u3067\u306fUbuntu\u3084AlmaLinux\u306a\u3069\u3002","sameAs":["https:\/\/www.prime-strategy.co.jp\/services\/wexal-service\/","https:\/\/www.linkedin.com\/in\/ftkro"],"url":"https:\/\/kusanagi.tokyo\/column\/en\/archives\/column_author\/fukuda-takuro"}]}},"_links":{"self":[{"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/posts\/10650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/comments?post=10650"}],"version-history":[{"count":6,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/posts\/10650\/revisions"}],"predecessor-version":[{"id":10691,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/posts\/10650\/revisions\/10691"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/media\/10676"}],"wp:attachment":[{"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/media?parent=10650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/categories?post=10650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/tags?post=10650"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/series?post=10650"},{"taxonomy":"journey","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/journey?post=10650"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/en\/wp-json\/wp\/v2\/product?post=10650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}