项目作者: ojullien

项目描述 :
Ban an ip using fail2ban
高级语言: Shell
项目地址: git://github.com/ojullien/bash-banip.git
创建时间: 2020-04-16T14:13:37Z
项目社区:https://github.com/ojullien/bash-banip

开源协议:MIT License

下载


Bash-BanIP

Simple tool for banning ip using fail2ban.

Note: I use this script for my own projects, it contains only the features I need.

Table of Contents

Installation | Features | Test | Contributing | License

Installation

Requires: a Debian/Ubuntu version of linux and a Bash version ^4.4. fail2ban, bash-sys are installed.

  1. Download a release or clone this repository.
  2. Use scripts/install.sh to automatically install the application in the /opt/oju/bash project folder.
  3. If needed, add PATH="$PATH:/opt/oju/bash/bin" to the .profile files.
  4. Update the config.sh configuration file.

Features

This tool allows you to use fail2ban to ban an ip adding this ip to an existing jail. The jail is defined in the config.sh file.

  1. Usage: banip.sh [options] <ip> [ip ...]
  2. options
  3. -16 | --16 /16 CIDR prefix. Apply this equivalent mask 255.255.0.0 to the ips.
  4. -24 | --24 /24 CIDR prefix. Apply this equivalent mask 255.255.255.0 to the ips.
  5. -h | --help Show this help.

Test

I didn’t write any line of ‘unit test’ code. Sorry.

Contributing

Thanks you for taking the time to contribute. Please fork the repository and make changes as you’d like.

As I use these scripts for my own projects, they contain only the features I need. But If you have any ideas, just open an issue and tell me what you think. Pull requests are also warmly welcome.

If you encounter any bugs, please open an issue.

Be sure to include a title and clear description,as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

License

This project is open-source and is licensed under the MIT License.