[apache] SecRuleEngine off

cafe24에서 가상호스팅 centos7 구매 후 그누보드 설치하여 사용하는데 아래와 같은 메세지를 출력함.

You don’t have permission to access /bbs/login_check.php on this server.

대부분의 경우 파일권한을 확인하면 되지만 이번에는 권한 이외에 다른 부분이 문제 였다.

에러 로그를 확인

#vi /etc/httpd/logs/error_log

[Fri Jul 19 22:03:31.444003 2019] [:error] [pid 3220] [client xxx.xxx.xxx.xxx] [client xxx.xxx.xxx.xxx] ModSecurity: Access denied with code 403 (phase 2). Pattern match "\\\\%((?!$|\\\\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" at ARGS:url. [file "/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_20_protocol_violations.conf"] [line "465"] [id "950109"] [rev "2"] [msg "Multiple URL Encoding Detected"] [severity "WARNING"] [ver "OWASP_CRS/2.2.9"] [maturity "6"] [accuracy "8"] [tag "OWASP_CRS/PROTOCOL_VIOLATION/EVASION"] [hostname "mysite.com"] [uri "/bbs/login_check.php"] [unique_id "XTG-o0jziQZT3ktA@GaorgAAAAA"], referer: http://mysite.com/bbs/login.php?url=http%3A%2F%2Fmysite.com%2Fadm

/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_20_protocol_violations.conf 에서 465 라인이 해당 요청이 규칙에 위반 되어서 접근을 제한 하는것 같다. httpd.conf 에서 해당 규칙을 제외시켜준다.

#vi /etc/httpd/conf/httpd.conf

<Directory>
  ...
  ...
  SecRuleEngine Off
</Directory>
service httpd restart

참고 사이트
https://www.enteroa.com/2015/02/07/195/