<commit_before>salt-fail2ban-formula
=====================

``fail2ban`` scans log files for malicious activity and executes actions based on what it finds.

Configuration
-------------
First, ``fail2ban`` uses settings defined in ``/etc/fail2ban/jail.conf``. ``jail.conf`` is provided by the package, and should not be changed.

Next, it uses ``/etc/fail2ban/jail.local`` to override settings from ``jail.conf``. The ``fail2ban.config`` state populates the ``jail.local`` file using data from pillar. The ``jail.local`` file is only created if you use the ``fail2ban.config`` state.

States
------

``fail2ban``
    Install the ``fail2ban`` package and enable the service.
``fail2ban.config``
    Creates a ``jail.local`` config file based on pillar data to override config in the default ``jail.conf`` file.

Gotchas
-------
In the ``pillar.example``, note that the iptable action uses ``port=ssh``, not ``port=SSH`` (uppercase).<commit_msg>removed whitespace from readme<commit_after>salt-fail2ban-formula
=====================
``fail2ban`` scans log files for malicious activity and executes actions based on what it finds.

Configuration
-------------
First, ``fail2ban`` uses settings defined in ``/etc/fail2ban/jail.conf``. ``jail.conf`` is provided by the package, and should not be changed.

Next, it uses ``/etc/fail2ban/jail.local`` to override settings from ``jail.conf``. The ``fail2ban.config`` state populates the ``jail.local`` file using data from pillar. The ``jail.local`` file is only created if you use the ``fail2ban.config`` state.

States
------
``fail2ban``
    Install the ``fail2ban`` package and enable the service.
``fail2ban.config``
    Creates a ``jail.local`` config file based on pillar data to override config in the default ``jail.conf`` file.

Gotchas
-------
In the ``pillar.example``, note that the iptable action uses ``port=ssh``, not ``port=SSH`` (uppercase).
{'fraction_non_alphanumeric': 0.16833245660178853, 'fraction_numerical': 0.010520778537611783, 'mean_word_length': 4.225274725274725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3766105', 'n_tokens_mistral': 574, 'n_tokens_neox': 552, 'n_words': 220}