security: Use drop-in config component for /etc files

Tests:

- Config files are all symlinks in /etc/
- 'fail2ban-client get logtarget' shows sysout
- fail2ban logs to journald
- fail2ban identifies failures logged by apache in journald

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-05-16 12:12:17 -07:00 committed by James Valleroy
parent 500cfca6d4
commit 31cfb8f643
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
4 changed files with 10 additions and 1 deletions

View File

@ -129,3 +129,5 @@ rm_conffile /etc/fail2ban/jail.d/roundcube-auth-freedombox.conf 23.10~
rm_conffile /etc/apache2/conf-available/rss-bridge.conf 23.10~ rm_conffile /etc/apache2/conf-available/rss-bridge.conf 23.10~
rm_conffile /etc/apache2/conf-available/searx-freedombox-auth.conf 23.10~ rm_conffile /etc/apache2/conf-available/searx-freedombox-auth.conf 23.10~
rm_conffile /etc/apache2/conf-available/searx-freedombox.conf 23.10~ rm_conffile /etc/apache2/conf-available/searx-freedombox.conf 23.10~
rm_conffile /etc/fail2ban/fail2ban.d/freedombox.conf 23.10~
rm_conffile /etc/fail2ban/jail.d/freedombox.conf 23.10~

View File

@ -9,6 +9,7 @@ from django.utils.translation import gettext_lazy as _
from plinth import app as app_module from plinth import app as app_module
from plinth import menu from plinth import menu
from plinth.config import DropinConfigs
from plinth.daemon import Daemon, RelatedDaemon from plinth.daemon import Daemon, RelatedDaemon
from plinth.modules.backups.components import BackupRestore from plinth.modules.backups.components import BackupRestore
from plinth.package import Packages from plinth.package import Packages
@ -22,7 +23,7 @@ class SecurityApp(app_module.App):
app_id = 'security' app_id = 'security'
_version = 8 _version = 9
can_be_disabled = False can_be_disabled = False
@ -42,6 +43,12 @@ class SecurityApp(app_module.App):
packages = Packages('packages-security', ['fail2ban', 'debsecan']) packages = Packages('packages-security', ['fail2ban', 'debsecan'])
self.add(packages) self.add(packages)
dropin_configs = DropinConfigs('dropin-configs-security', [
'/etc/fail2ban/fail2ban.d/freedombox.conf',
'/etc/fail2ban/jail.d/freedombox.conf',
])
self.add(dropin_configs)
daemon = RelatedDaemon('related-daemon-fail2ban', 'fail2ban') daemon = RelatedDaemon('related-daemon-fail2ban', 'fail2ban')
self.add(daemon) self.add(daemon)