bodsch.fail2ban

Ansibleロール: fail2ban

Debian/Ubuntu、ArchLinux、ArtixLinuxにfail2ban 2.xをインストールして設定するAnsibleロール(他のopenrcベースのシステムでも動作するかもしれません)。


このAnsibleロールのさらなる開発は、コレクションbodsch.coreに移動しました。 このリポジトリは、今後は積極的にメンテナンスされません。


GitHubワークフローステータス GitHubの問題 最新リリース Ansible品質スコア

要件と依存関係

なし

対応オペレーティングシステム

テスト済み

  • ArchLinux
  • Debian系
    • Debian 10 / 11 / 12
    • Ubuntu 20.04 / 22.04

RedHatベースのシステムは公式にはサポートされなくなりました!動作するかもしれませんが、保証はありません。

ロール変数

使用可能な変数は以下に示されており、デフォルト値とともに記載されています(defaults/main.yamlを参照):

fail2ban_ignoreips

IPアドレス、CIDRマスク、またはDNSホストを指定できます。

fail2ban_conf

fail2ban_jail

fail2ban_path_definitions

fail2ban_jails

fail2ban_jail

例プレイブック

moleculeテスト設定を参照してください。

fail2ban_ignoreips:
  - 127.0.0.1/8
  - 192.168.0.0/24

fail2ban_conf:
  default:
    loglevel: INFO
    logtarget: "/var/log/fail2ban.log"
    syslogsocket: auto
    socket: /run/fail2ban/fail2ban.sock
    pidfile: /run/fail2ban/fail2ban.pid
    dbfile: /var/lib/fail2ban/fail2ban.sqlite3
    dbpurgeage: 1d
    dbmaxmatches: 10
  definition: {}
  thread:
    stacksize: 0

fail2ban_jail:
  default:
    ignoreips: "{{ fail2ban_ignoreips }}"
    bantime: 600
    maxretry: 3
    findtime: 3200
    backend: auto
    usedns: warn
    logencoding: auto
    jails_enabled: false
  actions:
    destemail: root@localhost
    sender: root@localhost
    mta: sendmail
    protocol: tcp
    chain: INPUT
    banaction: iptables-multiport

fail2ban_jails:
  - name: ssh
    enabled: true
    port: ssh
    filter: sshd
    logpath: /var/log/authlog.log
    findtime: 3200
    bantime: 86400
    maxretry: 2
  - name: ssh-breakin
    enabled: true
    port: ssh
    filter: sshd-break-in
    logpath: /var/log/authlog.log
    maxretry: 2
  - name: ssh-ddos
    enabled: true
    port: ssh
    filter: sshd-ddos
    logpath: /var/log/authlog.log
    maxretry: 2

貢献

貢献についてをお読みください。

開発、ブランチ(Gitタグ)

masterブランチは私の 作業用ブランチ で、「最新の、ホットなもの」が含まれており、完全に壊れている可能性があります!

安定したものを使用したい場合は、タグ付きバージョンを使用してください!

著者

  • ボド・シュルツ

ライセンス

Apache

無料ソフトウェア、最高!

プロジェクトについて

install and configure fail2ban on various systems

インストール
ansible-galaxy install bodsch.fail2ban
ライセンス
apache-2.0
ダウンロード
36.9k
所有者
ex-developer (c, c++, php), ex-system administrator / engineer, keep-it-simple, monitoring, automation, system architect