일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- html pdf 변환
- 파라미터 & 오류
- svn 충돌 해결 resolve
- apache mod rewrite
- PHP 구글 OTP 인증
- 아파치 웹 서버의 정보 숨기기
- 우분투 mysql 비밀번호 없이 로그인 될때
- mysql root 비밀번호 변경
- PHP 정규식 예제
- 비밀번호검증정규식
- sha-2 root
- usb efi 시스템 파티션 삭제
- group_concat 구분자
- wkhtmltopdf 실행 오류
- modsecurity 설치
- httpd.conf 보안 설정
- 자바스크립트비밀번호검증
- mysqldump: Got error: 1045
- apple push notification service (apns) is changing
- 구글 OTP 인증
- 비밀번호정규식
- PHP 구글 OTP 연동
- (using password: YES)" when trying to connect
- bootstrap
- libxrender1
- javascript
- php 배열제거
- svn 충돌 해결 resolved
- mariadb upgrade
- bootstrap modal
- Today
- Total
투덜이 개발자
우분투 모드시큐리트 modsecurity 설치 본문
우분투 모드시큐리트 설치 에러 발생
sudo apt install libapache2-mod-security2
이렇게 다시 설치
설치 확인
apachectl -M | grep security
ModSecurity 설정
cd /etc/modsecurity
cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
vi modsecurity.conf 파일을 열고 아래 추가
#SecRuleEngine DetectionOnly
SecRuleEngine On
[구축] Ubuntu/Apache WAF(Modsecurity) 설치
1. ModSecurity 설치 관리자 권한으로 명령어 수행했으며 관리자 로그인 불가시 sudo 사용 - ModSecurity 모듈 설치 - security2 모듈 활성화 * a2enmod 명령으로 모듈을 활성화하면 /etc/apache2/mods-enabled 디렉터
cyong.tistory.com
룰셋다운받기 + 압축 풀기
sudo wget https://github.com/coreruleset/coreruleset/archive/v3.3.0.tar.gz
sudo wget https://github.com/coreruleset/coreruleset/archive/v3.3.4.tar.gz
tar xvfzp v3.3.4.tar.gz
규칙 세트를 저장한 디렉터리를 생성하고 규칙 세트 이동 + 경로 이동
mkdir /etc/apache2/modsecurity-crs
mv coreruleset-3.3.4 /etc/apache2/modsecurity-crs/.
cd /etc/apache2/modsecurity-crs/coreruleset-3.3.4
mv crs-setup.conf.example crs-setup.conf
규칙 룰셋 적용하기
vi /etc/apache2/mods-enabled/security2.conf
<IfModule security2_module>
# Default Debian dir for modsecurity's persistent data
SecDataDir /var/cache/modsecurity
# Include all the *.conf files in /etc/modsecurity.
# Keeping your local configuration in that directory
# will allow for an easy upgrade of THIS file and
# make your life easier
IncludeOptional /etc/modsecurity/*.conf
# Include OWASP ModSecurity CRS rules if installed
#IncludeOptional /usr/share/modsecurity-crs/*.load
IncludeOptional /etc/apache2/modsecurity-crs/coreruleset-3.3.4/crs-setup.conf
IncludeOptional /etc/apache2/modsecurity-crs/coreruleset-3.3.4/rules/*.conf
</IfModule>
아파치 재시작
웹에디터에서 이미지 첨부가 안된다.
로그 확인하여 보면 블럭 당했다.
그래서 해당 파일은 삭제 함
rm -f /etc/apache2/modsecurity-crs/coreruleset-3.3.4/rules/REQUEST-949-BLOCKING-EVALUATION.conf
첨부파일 업로드가 안된다
그래서
vi /etc/modsecurity/modsecurity.conf
주석 처리 함
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
"id:'200004',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"
#SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
#"id:'200004',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"
https://liveyourit.tistory.com/171
웹방화벽(WAF) ModSecurity 설치 및 sql인젝션 룰 설정
우분투(Ubuntu)에 리눅스 무료 웹방화벽(WAF)인 ModSecurity를 설치 및 설정해본다. 그리고 sql인젝션이 되는 취약한 웹페이지에서 ModSecurity에 sql인젝션 룰설정을 통해 인젝션을 방지할 수 있음을 보인
liveyourit.tistory.com
https://blog.boxcorea.com/wp/archives/3236
ubuntu 18.04, apache2 mod-security2 설치 및 설정.
ubuntu 18.04, apache2 mod-security2 설치 및 설정. 1. 설치. $ sudo apt install libapache2-mod-security2 2. 아파치 웹서버를 다시 실행하고 security2 모듈이 작동중인지 확인한다. 재실행. $ sudo systemctl restart apache2 모듈
blog.boxcorea.com
# ModSecurity 삭제
sudo apt remove libapache2-mod-security2