fail2ban 크롤링 필터
---------------- vi /etc/fail2ban/filter.d/ㅌㅌㅌㅌㅌ-crawler.conf ------------
[Definition]
failregex = ^<HOST> .*"(GET|POST|HEAD) /(aaa/content/|aaa/list(?:\?| )|board/content/|board/list/)[^ ]* HTTP/[^"]*" (200|301|302) <-- (aaa/content/|aaa/list(?:\?| ) list/ 와 list/? 뒤에 붙는 것도 선별
ignoreregex =
----------------------------------------- 여기까지 저장
------------ vi /etc/fail2ban/jail.local ------------
[DEFAULT]
ignoreip = 127.0.0.1/8 111.222.333.444 <-- 아이피 추가
bantime = -1
findtime = 600
maxretry = 3
banaction = firewallcmd-rich-rules
[sshd]
enabled = true
port = sshd 포트
logpath = /var/log/secure
[vsftpd]
enabled = true
port = ftp 포트
logpath = /var/log/vsftpd.log
[ㅌㅌㅌㅌㅌㅌ-crawler]
enabled = true
filter = ㅌㅌㅌㅌㅌ-crawler
logpath = /var/log/nginx/access.log tail
maxretry = 20
findtime = 15
bantime = 86400
----------------------------------------
fail2ban-client -t
sudo systemctl restart fail2ban
'OS > Linux' 카테고리의 다른 글
| centos7 에 bitbucket 클론 하기 (0) | 2026.03.05 |
|---|---|
| centos7 특정 아이피/아이피 대역 접속 차단 (0) | 2025.04.21 |
| composer 전역 설치 (Globally) 및 명령어 (0) | 2024.01.07 |
| SSH 접속 구글 OTP 와 연동 (0) | 2023.12.30 |
| [linux] 부팅안되는현상(강제종료,정전등) (0) | 2023.12.11 |
