fail2ban 운용법
페이지 정보

본문
fail2ban 운용법
## 기본 설정
```
[DEFAULT]
bantime = 30m # 30분 동안 차단한다
findtime = 10m # 10분 동안의 데이터를 가지고 판단한다
maxretry = 5 # 5번 이상 로그인 실패했을시 차단한다
```
* 참고 : https://hacktam.kr/etclec/195
## fail2ban-client
```
# fail2ban-client -t
# fail2ban-client realod
# fail2ban-client restart
```
* 참고 : https://blog.naver.com/forioso/221962585413
## port 여러개 지정 방법 multiple port
```
port = 80 ( single port )
port = 80,443 ( multiple ports)
port = 8080:8090 ( port range )
port = 80, 8080:8090 ( comination is also possible )
```
* 참고 : https://github.com/webmin/webmin/issues/158
## xxx.xxx.xxx.xxx already banned
ssh 의 port 번호를 변경한 경우, 해당 포트들을 모두 지정해 주어야 한다. 위 multiple port 참조.
그리고, 이 경우 reload 로는 바로 적용이 안되는 듯 하다. already banned 가 계속 나온다.
restart 를 해 주면, 기존 ip 들을 모두 Unban 시키고, 재시작 되면서 Restore Ban 시킨다.
이 과정에서 포트 번호가 적용이 되는 듯 하다.
* 참고 : https://github.com/fail2ban/fail2ban/wiki/How-fail2ban-works
## DROP instead of REJECT
jail.local
```
[DEFAULT]
banaction = iptables-multiport[blocktype=DROP]
banaction_allports = iptables-allports[blocktype=DROP]
```
* 참고 : https://unix.stackexchange.com/questions/751448/fail2ban-ssh-jail-change-action-reject-to-drop
## 기본 설정
```
[DEFAULT]
bantime = 30m # 30분 동안 차단한다
findtime = 10m # 10분 동안의 데이터를 가지고 판단한다
maxretry = 5 # 5번 이상 로그인 실패했을시 차단한다
```
* 참고 : https://hacktam.kr/etclec/195
## fail2ban-client
```
# fail2ban-client -t
# fail2ban-client realod
# fail2ban-client restart
```
* 참고 : https://blog.naver.com/forioso/221962585413
## port 여러개 지정 방법 multiple port
```
port = 80 ( single port )
port = 80,443 ( multiple ports)
port = 8080:8090 ( port range )
port = 80, 8080:8090 ( comination is also possible )
```
* 참고 : https://github.com/webmin/webmin/issues/158
## xxx.xxx.xxx.xxx already banned
ssh 의 port 번호를 변경한 경우, 해당 포트들을 모두 지정해 주어야 한다. 위 multiple port 참조.
그리고, 이 경우 reload 로는 바로 적용이 안되는 듯 하다. already banned 가 계속 나온다.
restart 를 해 주면, 기존 ip 들을 모두 Unban 시키고, 재시작 되면서 Restore Ban 시킨다.
이 과정에서 포트 번호가 적용이 되는 듯 하다.
* 참고 : https://github.com/fail2ban/fail2ban/wiki/How-fail2ban-works
## DROP instead of REJECT
jail.local
```
[DEFAULT]
banaction = iptables-multiport[blocktype=DROP]
banaction_allports = iptables-allports[blocktype=DROP]
```
* 참고 : https://unix.stackexchange.com/questions/751448/fail2ban-ssh-jail-change-action-reject-to-drop
추천0
댓글목록
등록된 댓글이 없습니다.