
Windows Server 2012 VM에 ModSecurity IIS 모듈을 설치했습니다. 자체 앱 풀에서 실행되는 간단한 테스트 애플리케이션이 있습니다.
default.aspx-- 날짜/시간을 출력하는 간단한 페이지입니다.
웹.구성
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<ModSecurity enabled="true" configFile="C:\inetpub\wwwroot\modsecurity.conf" />
</system.webServer>
</configuration>
modsecurity.conf
SecRuleEngine On
SecRule ARGS:testparam "test" "id:1234,deny,status:403,msg:'Our test rule has triggered'"
사이트를 탐색할 때(예:http://localhost?testparam=test), 403 대신 테스트 페이지가 표시됩니다. 이벤트 뷰어에는 아무것도 기록되지 않습니다.
답변1
귀하가 이 문제의 피해자일 가능성이 높습니다.https://github.com/SpiderLabs/ModSecurity/issues/787
Broco의 답변은 비슷하지만 가장 중요한 부분인 overrideModeDefault="Allow"
. C:\Windows\System32\inetsrv\Config\applicationHost.config 파일을 확인하면 아마도
<section name="ModSecurity" overrideModeDefault="Deny" allowDefinition="Everywhere" /></sectionGroup>
이를 "허용"으로 변경해야 합니다. 그렇지 않으면 <ModSecurity ...>
웹 사이트의 구성 파일에 추가하면 본질적으로 ModSecurity가 비활성화됩니다.
답변2
C:\Windows\System32\inetsrv\config를 편집하셨나요? 거기에 modsecurity를 추가하여 활성화해야 합니다.
<section name="ModSecurity" overrideModeDefault="Allow" allowDefinition="Everywhere" /></sectionGroup>
또한 구성 파일은 절대로,항상당신의 wwwroot에 있어야합니다. 안전한 곳에 보관하세요. 예:
configFile="C:\Program Files\ModSecurity IIS\modsecurity_iis.conf"
또한 문서에 따르면 파일은 Windows에서 modsecurity_iis.conf라고 해야 합니다.