CentOS2 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. CentOS7 / nginx / mod_security / 컴파일 설치 mod_security 파일을 다운로드 받는다 $ wget https://www.modsecurity.org/tarball/2.9.1/modsecurity-2.9.1.tar.gz 압축을 해제한다 $ tar -zxvf modsecurity-2.9.1.tar.gz 해당 경로로 이동한다 $ cd modsecurity-2.9.1 $ ./configure --enable-standalone-module $ make nginx 다운로드 받기 (22-08-18일 기준으로 이것보다 바로 위버전은 컴파일시 에러 발생 - stable 버전 나와야 할듯) ㄴ https://nginx.org/en/download.html $ wget https://nginx.org/download/nginx-1.22.0.tar.gz $ ta.. 2022. 8. 18. 이전 1 다음