공개형 웹 방화벽 (Mod_security)
(1) apache 웹서비스에 Mod_security 모듈 적용
ㄴ 현재 로깅 모드로 적용되어 있으며, 충분한 로그 분석 후 차단모드로 변경 필요
ㄴ 정책파일 : /opt/apache/conf/mod_security2.conf
ㄴ 로그파일 : /opt/apache/logs/modsec_audit.log
(2) 차단모드 변경 방법
① vi 편집기로 정책파일 열기
vim /opt/apache/conf/mod_security2.conf
② 39번째 라인 주석 처리 및 38번째 라인 주석 해제 후, 저장
38 SecDefaultAction "deny,log,phase:2,status:406,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"
39 #SecDefaultAction "pass,log,auditlog,phase:2,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"
③ apache 재시작
/opt/apache/bin/apachectl restart
호스트 기반 탑재형 방화벽 설정
(1) iptables 방화벽 정책 확인
iptables -nvL
(2) IP 추가/삭제 방법
전체허용 : iptables -I WHITELIST -s 허용할IP -j ACCEPT
SSH만 허용 : iptables -I SSH -s 허용할IP -j ACCEPT
'Security > OS 관련' 카테고리의 다른 글
| mod_security 탐지 걸린 룰 해제시 방법 (0) | 2023.11.07 |
|---|---|
| apache 2.4 mod 시큐리티 (0) | 2023.11.07 |
| OS 변조파일 검사 (rkhunter) (0) | 2023.11.07 |
| 백도어 검사 (chrootkit) (0) | 2023.11.07 |
| 휘슬 설치 프로세스 (0) | 2023.11.07 |