본문 바로가기

ModSecurity3

ModSecurity에 OWASP의 CRS(Core Rule Set) 추가하기 1. OWASP 의 CRS 다운받기 https://coreruleset.org/installation/ 에서 압축파일을 다운로드 받고 풀어서 nginx conf 하위 폴더에 넣어준다 2. modsecurity.conf 에 추가 Include coreruleset-3.3.2/crs-setup.conf Include coreruleset-3.3.2/rules/*.conf 3. crs-setup.conf의 주석 풀어주기 SecDefaultAction "phase:1,log,auditlog,pass" SecDefaultAction "phase:2,log,auditlog,pass" SecDefaultAction "phase:1,log,auditlog,deny,status:403" SecDefaultAction ".. 2022. 8. 19.
ModSecurity + Nginx 실적용 테스트 해보기 1. ModSecurity 설정파일 수정 modSecurity.conf 파일을 수정한다. modSecurity.conf 파일은 기존 폴더에서 복사해서 가져온다 현재 필자의 경로는 nginx를 컴파일하여 설치했기 때문에 /usr/local/nginx/conf 에 위치해 있다 SecRuleEngine DetectionOnly 위와 같은 문구를 SecRuleEngine On 로 변경한다. 2. 추가되는 룰 내용 SecRule ARGS:testparam "@contains test" "id:1234,deny,status:403" 위와 같은 내용을 추가해주고 Nginx 를 재시작한다. 3. 실제 적용 확인 주소창을 통해 적용된 웹서버로 다음과 같이 접근해본다 https://abc.com/index.html?tes.. 2022. 8. 19.
ModSecurity: StatusEngine call failed 문제 임시해결 2022/08/18 10:15:17 [notice] 19676#0: ModSecurity for nginx (STABLE)/2.9.1 (http://www.modsecurity.org/) configured. 2022/08/18 10:15:17 [notice] 19676#0: ModSecurity: APR compiled version="1.4.8"; loaded version="1.4.8" 2022/08/18 10:15:17 [notice] 19676#0: ModSecurity: PCRE compiled version="8.32 "; loaded version="8.32 2012-11-30" 2022/08/18 10:15:17 [notice] 19676#0: ModSecurity: LIBXML comp.. 2022. 8. 18.