Files
confdroid_fail2ban/README.md

125 lines
4.4 KiB
Markdown
Raw Normal View History

2021-09-07 15:44:51 +02:00
# Readme
2021-09-07 15:38:08 +02:00
2026-03-11 12:12:23 +01:00
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_fail2ban&style=plastic)](https://jenkins.confdroid.com/job/confdroid_fail2ban/)
2026-03-11 12:55:45 +01:00
[![Security Hotspots](https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_fail2ban&metric=security_hotspots&token=sqb_9fa4789fabfda384f78fcdeb3ade3efce6225e64)](https://sonarqube.confdroid.com/dashboard?id=confdroid_fail2ban)
2026-03-12 13:07:27 +01:00
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/grizzlycoda/puppet_collection)
2026-03-11 12:12:23 +01:00
- [Readme](#readme)
- [Synopsis](#synopsis)
- [WARNING](#warning)
- [Features](#features)
2026-03-12 12:53:35 +01:00
- [Installation](#installation)
- [Configuration](#configuration)
- [Core](#core)
- [Optional](#optional)
- [Service](#service)
2026-03-11 12:12:23 +01:00
- [Dependencies](#dependencies)
- [Deployment](#deployment)
- [Parameters](#parameters)
- [SELINUX](#selinux)
- [Known Problems](#known-problems)
- [Support](#support)
- [Tests](#tests)
- [Contact Us](#contact-us)
- [Disclaimer](#disclaimer)
2021-09-07 15:38:08 +02:00
## Synopsis
2017-08-03 12:01:32 +01:00
Fail2Ban is an intrusion prevention software framework that protects computer servers from brute-force attacks.
2026-03-11 12:12:23 +01:00
`confdroid_fail2ban` is a Puppet module to automate installation, configuration and management of fail2ban settings and rules.
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## WARNING
2026-03-14 11:27:20 +01:00
> **Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production**
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## Features
2026-03-12 12:53:35 +01:00
### Installation
2021-09-07 15:38:08 +02:00
2026-03-11 12:12:23 +01:00
- install required binaries
2017-08-03 12:01:32 +01:00
2026-03-12 12:53:35 +01:00
### Configuration
#### Core
2021-09-07 15:38:08 +02:00
2026-03-11 12:12:23 +01:00
- manage directory structure (file system permissions, selinux context)
- manage configuration files (file system permissions, selinux context, content based on parameters)
2026-03-11 12:55:45 +01:00
- fail2ban.conf
2026-03-11 13:00:03 +01:00
- fail2ban.local (overrides default settings in fail2ban.conf)
2026-03-11 12:55:45 +01:00
- jail.conf
- jail.local ( overrides default settings in jail.conf)
> Every setting in .local files has a parameter in params.pp, which can be overridden in ENC based on fqdn, hostgroup etc. (recommended) or directly in params.pp. Typical parameters to override are:
- `fn_destemail`: the email address to be notified
- `fn_bantime`: the the time an attacker IP is banned.
2026-03-12 12:53:35 +01:00
#### Optional
- enable nagios monitoring of the fail2ban service, where the number of minimum allowed processes can be configured with `fn_procs_allowed`.
### Service
2026-03-11 12:12:23 +01:00
- manage service status
2017-08-03 14:01:25 +01:00
2026-03-11 14:27:05 +01:00
Sometimes it is required to have the service on a host stopped for some reason, i.e. for troubleshooting fail2ban. In that case you can simply set `fn_enable_service`to `stopped` via ENC.
2021-09-07 15:38:08 +02:00
## Dependencies
2017-08-03 12:01:32 +01:00
All dependencies must be included in the catalogue.
2026-03-11 12:12:23 +01:00
- puppetlabs-firewall to manage firewall settings (optional)
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## Deployment
2017-08-03 12:01:32 +01:00
2026-03-11 12:12:23 +01:00
- native Puppet deployment
2017-08-03 12:01:32 +01:00
via site.pp or nodes.pp
2021-09-07 15:49:57 +02:00
```bash
2017-08-03 12:01:32 +01:00
node 'example.example.net' {
2021-09-07 15:49:57 +02:00
include cd_elasticsearch
2017-08-03 12:01:32 +01:00
}
```
2021-09-07 15:49:57 +02:00
2026-03-11 12:12:23 +01:00
- through Foreman:
2021-09-07 15:38:08 +02:00
2026-03-11 12:26:37 +01:00
In order to apply parameters through Foreman, **confdroid_fail2ban::params** must be added to the host or host group in question.
2017-08-03 12:01:32 +01:00
See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).
2021-09-07 15:38:08 +02:00
## Parameters
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
The parameters are documented via puppet strings and [listed here](/docs/index.html). Simply open in web browser.
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## SELINUX
2017-08-03 12:01:32 +01:00
All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored.
2021-09-07 15:38:08 +02:00
## Known Problems
## Support
2026-03-11 12:12:23 +01:00
- OS: Rocky 9
- Puppet 8
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## Tests
2026-03-11 12:12:23 +01:00
- Puppet Lint
- excluded tests:
- `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
- Puppet Parser
- ERB Template Parser
- Sonar Quality Gate
2021-09-07 15:38:08 +02:00
## Contact Us
2017-08-03 12:01:32 +01:00
[contact Us](https://confdroid.com/contact/)
2026-03-11 12:12:23 +01:00
[Feedback Portal](https://feedback.confdroid.com/)
2017-08-03 12:01:32 +01:00
2021-09-07 15:38:08 +02:00
## Disclaimer
2017-08-03 12:01:32 +01:00
ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments.
The modules are tested and supported only as documented, and require testing in designated environments (i.e. lab or development environments) for parameter tuning etc. before deploying into production environments.