Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 오라클 캐릭터셋 변경
- ORA-12899
- Oracle 초기 사용자
- 비전공자를 위한 데이터베이스 입문
- oracle 18c
- Oracle 윈도우 설치
- Orace 18c
- 오라클 캐릭터셋 확인
- Oracle 사용자명
- oracle
- 무료 오라클 데이터베이스
- Oracle Express Edition
- Oracle 사용자명 입력
- 무료 오라클 설치
- 윈도우 Oracle
- 서평단
- 오라클 캐릭터셋 조회
- Oracle 18c HR schema
- Oracle 18c HR
- Oracle 테이블 띄어쓰기
- Oracle 테이블 대소문자
- ora-01722
- Oracle 18c 설치
- ORA-00922
Archives
- Today
- Total
Nirsa's Learning Lab
[ModSecurity 2.9] Apache + ModSecurity OWASP 룰셋 적용 (IDS, ModSecurity SQL Injection, modsecurity detection mode) 본문
Security/ModSecurity
[ModSecurity 2.9] Apache + ModSecurity OWASP 룰셋 적용 (IDS, ModSecurity SQL Injection, modsecurity detection mode)
Nirsa 2020. 5. 29. 16:27반응형
-
APache + ModSeucirty OWASP 룰셋 적용 (IDS, ModSecurity SQL Injection, modsecurity detection mode)
룰셋 적용 후 차단하는 방식(IPS)가 아니라, 탐지된 내용을 로깅만 하는 방식(IDS)으로 구성 합니다.
룰셋 적용 자체에 큰 어려움은 없기에 하나하나 자세히 설명하기보다는 코드블럭에 주석처리로 간단히 설명만 해두었습니다. 적용 이후에 공격을 시도하면 /var/log/httpd/modsec.log 파일에서 공격이 탐지되는것을 확인할 수 있습니다.
## OWASP 룰셋 설치
cd /etc/http
git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
mkdir /etc/http/modsecurity.d
mkdir /etc/http/modsecurity.d/activated_rules
cd owasp-modsecurity-crs
mv crs-setup.conf.example /etc/http/modsecurity.d/crs-setup.conf
cd rules
mv ./* /etc/http/modsecurity.d/activated_rules/
cd /etc/http/modsecurity.d/activated_rules/
mv REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
mv RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
## OWASP 룰셋 적용
vim /etc/http/conf.d/mod_security.conf
<IfModule mod_security2.c>
Include /etc/httpd/modsecurity.d/crs-setup.conf # 반드시 아래 *.conf보다 위로 올라와야 합니다.
Include /etc/httpd/modsecurity.d/activated_rules/*.conf
SecRuleEngine DetectionOnly # On으로 설정할 경우 차단까지 되며, DetectionOnly로 해주어야 탐지만 합니다.
SecAuditEngine On
SecAuditLog /var/log/httpd/modsec.log
SecAuditLogType Serial
SecRequestBodyAccess on
SecAuditLogParts ABIJDFHZ
SecDataDir /tmp/mod_data
</IfModule>
:wq
vim /etc/http/conf/httpd.conf
LoadModule security2_module modules/mod_security2.so ## 전 57라인에 넣었습니다.
:wq
systemctl restart httpd
반응형