Commit Graph
258 Commits
Author SHA1 Message Date
chrisandClaude Opus 5.5 67c1086e2c Role common: add task sftpd.yml for chrooted SFTP access.
- group 'sftpusers' (GID 200 or next free), sshd drop-in
  /etc/ssh/sshd_config.d/90-sshd-SFTP.conf (Match Group, ChrootDirectory %h,
  ForceCommand internal-sftp), PasswordAuthentication via
  'sftp_password_authentication'
- new sftp users (UID 201 or next free) with root owned chroot home,
  upload dir and root owned authorized_keys (always created)
- existing users (e.g. www-data, suexec users) can be added to the group;
  chroot requirements of their home are checked, not changed
- passwords: update_password defaults to 'always', password of users with
  shell access is never changed
- controlled by 'chrooted_sftpd_present' (default: false), tag 'sftpd'
- add empty sftpd section to all host_vars *-common.yml

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 10:42:42 +01:00
chrisandClaude Opus 5.5 eb229a01b1 Retire old server firewall management (roles firewall/ipt-server part, modify-ipt-server).
All ipt servers are now managed by the role ipt-server (playbook ipt-server.yml):
- roles/firewall: only handles gateways now.
- Remove playbook modify-ipt-server.yml and role modify-ipt-server.
- Remove git_firewall_repository (ipt-server) and the ipt-server entries of
  git_{oopen,warenform}_server_repositories, so role common no longer
  clones /usr/local/src/ipt-server. Gateways keep ipt-gateway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:28:09 +01:00
chrisandClaude Opus 5.5 a0e573f1ae Role ipt-server: detect ulogd2 via systemd instead of ps (logging_ipv{4,6}.conf).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:17:05 +01:00
chrisandClaude Opus 5.5 02990faf70 Role ipt-server: configurable rate for the new-TCP-connection limit; new defaults.
- Sync ipt-firewall-server, ip6t-firewall-server and default_settings.conf
  with firewall/ipt-server affa35d: new limit_new_tcp_connections_per_seconds_rate
  (default 30, burst twice the rate); the rule now only drops SYNs above the
  limit instead of accepting those below it; several IPv6 fixes.
- defaults: fw_limit_new_tcp_connections_per_seconds_per_source_IP: false,
  fw_limit_new_tcp_connections_per_seconds_ports: "80,110,143,443,465,995",
  new fw_limit_new_tcp_connections_per_seconds_rate (overridable with _v6).
- templates, extract-fw-host-vars.py, README: new variable and defaults.
- oolm-shop: drop fw_limit_new_tcp_connections_per_seconds_per_source_IP_v6
  (it would have enabled the limit for IPv6 with the new default ports).
- piwik: fw_manage_config: true, per_IP_connection_limit 501, no
  new-connection limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:51:16 +01:00
chris 534ad28be9 install_update_dovecot.conf.j2: support of dynamic setting dovecots xmpp_listener. 2026-11-11 02:01:58 +01:00
chris dd0f4990e1 mainly postfwd konfigurations. 2026-11-09 00:07:38 +01:00
chrisandClaude Opus 5.5 ecc2ae2fbe Role ipt-server: restart docker after a firewall restart; roll out to 18 hosts.
- handlers: a firewall restart flushes the DOCKER* chains and docker's NAT
  rules; restart docker afterwards if it is running (like fail2ban).
- host_vars: add values missing from host_vars generated by an older
  extract-fw-host-vars.py:
  - mm-irights, mm-nd, mm-rav: fw_mm_server_ips
  - test.mx: fw_mail_client_ips_v6, fw_dovecot_auth_service_v6,
    fw_mumble_server_ips_v6
  - mm: fw_allow_local_service_v6 uses "<port>,<proto>" (the IPv6 script
    splits on ',', the IPv4 script on ':').

Rolled out to a.mx, a.ns, b.mx, b.ns, backup.warenform, cl-01, cl-02,
cl-dissens, cl-flr, cl-irights, cl-nd-test, cl-ndm, mm, mm-irights, mm-nd,
mm-rav, o45, test.mx; second run changed=0 on all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 00:30:08 +01:00
chrisandClaude Opus 5.5 0499706703 extract-fw-host-vars.py: write host_vars/<host>/<short>-ipt-server.yml by default.
Without -o the script now writes the standard host_vars file (relative to
the script, independent of the cwd). An existing file is only overwritten
with --force; this is checked before connecting to the host. -o - prints
to stdout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:28:00 +01:00
chrisandClaude Opus 5.5 3e6486c5b5 extract-fw-host-vars.py: abort if a conf file cannot be read; add --from-dir. Migrate cl-test.
Previously an unreadable file (e.g. /etc/ipt-firewall is 0750 after the
role ran) silently produced almost empty host_vars. The script now exits
with an error and writes nothing. --from-dir reads the conf files from a
local directory, e.g. fetched with ansible using the vaulted become
password.

Add host_vars for cl-test.oopen.de (fw_manage_config: true).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:00:55 +01:00
chrisandClaude Opus 5.5 ec62f54ab4 Role ipt-server: restart fail2ban after a firewall restart if it is running.
A firewall restart flushes the fail2ban chains. The new handler restarts
fail2ban only if it is active; it does nothing if fail2ban is stopped or
not installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:52:08 +01:00
chrisandClaude Opus 5.5 3d6840ef3a Role ipt-server: allow IPv6-only overrides of shared variables; migrate nd, oolm-shop, web-01, web0.
Shared variables (and fw_ext_interfaces / fw_local_interfaces) can now be
overridden for IPv6 via <name>_v6. extract-fw-host-vars.py emits these
overrides when the IPv4 and IPv6 configs differ, instead of a warning.

Add host_vars for nd.warenform.de, oolm-shop.oopen.de, web-01.oopen.de
and web0.warenform.de (fw_manage_config: true).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:50:03 +01:00
chrisandClaude Opus 5.5 402a6c9e89 Role ipt-server: sync with ipt-server repo (93d9af8); adapt extract-fw-host-vars.py.
- Update firewall scripts and shared conf files from firewall/ipt-server
  (HTTP connection limits, IPv6 TCP MSS clamping, ban_ipv6_mask,
  mattermost TCP fallback, rename 'stansard_*' -> 'standard_*').
- New role variables: fw_set_max_new_http_conn_per_ip_per_second,
  fw_max_http_new_conn_per_ip_per_second, fw_set_max_concurrent_http_conn_per_ip,
  fw_max_concurrent_http_conn_per_ip, fw_set_max_new_http_conn_per_second,
  fw_max_new_http_conn_per_second, fw_throttle_tcp6_mss_for_https,
  fw_tcp6_mss_for_https_val, fw_mm_tcp_ports_in, fw_ban_ipv6_mask.
- Split fw_blocked_ips into fw_blocked_ips_v4 / fw_blocked_ips_v6 and
  rename it in host_vars accordingly.
- Restart firewall when scripts or shared conf files change.
- extract-fw-host-vars.py: map new variables, normalize '${var}' and renamed
  bash variables, fall back to IPv6 for shared variables and warn if IPv4
  and IPv6 values differ.
- README.md / MIGRATION.md: document host_vars naming
  (<short-hostname>-ipt-server.yml) and new variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:01:28 +01:00
chris a0c99ae1ba Fix recursion configuration check in named.conf.options.gateway.j2 2026-10-30 21:23:57 +01:00
chris 056038c780 update.. 2026-10-12 18:51:07 +02:00
chris 11eee62a3c add extrepo.yml: Workaround für einen ifupdown-Paketbug. 2026-08-28 17:21:44 +02:00
chris 33e8368d76 Rnaem SSH keys. 2026-08-09 23:13:48 +02:00
chris c6205045c5 feat(o45): add configuration files for o45 host and update apt tasks for compatibility 2026-08-09 00:33:51 +02:00
chris 05cb840e6d feat(redis): replace apt update task with command to ensure compatibility 2026-08-09 00:33:03 +02:00
chris c4acc32add feat: update apt upgrade tasks to conditionally refresh cache based on apt_update variable 2026-08-07 11:43:28 +02:00
chris 6ba7c61cb7 fix(common): avoid localhost become prompts, stabilize redis apt upgrade, and lint handlers 2026-08-06 17:09:17 +02:00
chris 79a38027df set become false for localhost checks in users-systemfiles to prevent sudo timeout 2026-08-06 14:48:15 +02:00
chris 5af310e55a fix: set changed_when to false for apt update command. 2026-07-31 13:09:11 +02:00
chris 965ad5cde2 fix: specify ansible.builtin.template for service file and configuration deployments 2026-07-30 23:48:29 +02:00
chris ca02faf748 fix(sshd_config.j2): update condition for SFTP subsystem configuration to use common variable 2026-07-30 01:38:49 +02:00
chris 1c1ae9464c fix(yum.yml): change package state to 'present' for consistency and improve comment clarity 2026-07-29 23:40:23 +02:00
chris 451baa5f9a fix(sudoers.yml): improve formatting of comments for clarity in sudoers configuration tasks 2026-07-29 23:34:58 +02:00
chris b87c60c41e fix(samba-remove-user.yml): enhance command structure and error handling for samba user removal tasks 2026-07-29 23:32:24 +02:00
chris e125f9952f fix(samba-user.yml): improve command structure and enhance error handling for samba user management 2026-07-29 23:30:04 +02:00
chris 71e9cf6551 fix(show.yml): improve formatting of hostname display message for clarity 2026-07-29 23:21:15 +02:00
chris fc9c1548c3 fix(sshd.yml): standardize variable names for SSHD configuration facts and improve clarity 2026-07-29 18:08:17 +02:00
chris b5a4edc181 fix(webadmin-user.yml): standardize variable names for local template directory references 2026-07-29 18:03:07 +02:00
chris fea739f0e6 fix(webadmin-user.yml): update inventory checks and standardize variable names for clarity 2026-07-29 17:53:55 +02:00
chris e72d9aac70 fix(users.yml): replace deprecated 'authorized_key' with 'ansible.posix.authorized_key' for improved compatibility 2026-07-29 17:46:31 +02:00
chris eece49f53b fix(users-systemfiles.yml): standardize variable names and improve clarity in user file checks and backups 2026-07-29 17:44:18 +02:00
chris b14e82c6c2 fix(git.yml): improve error handling and register results for backup and samba repositories 2026-07-29 17:31:36 +02:00
chris 56ba319f2f fix(redis-server.yml): standardize variable names and improve configuration clarity 2026-07-28 22:47:20 +02:00
chris 81e1f3fb3e fix(ntp.yml): standardize variable naming and replace command with copy module for backup 2026-07-28 22:03:46 +02:00
chris 4d92340f9b chore(ansible): clean up host_vars YAML and normalize mail text blocks 2026-07-28 21:24:03 +02:00
chris ae60fa01a5 refactor(mx-common.yml): update paths for SSH keypair and file configurations
delete: remove obsolete postfix configuration files for rate limiting and user info
2026-07-28 02:16:07 +02:00
chris 9181734c51 fix(systemd-services): add condition to prevent service management for specific lxc_guest items 2026-07-28 01:52:41 +02:00
chris 1849c6d72d refactor(systemd-services): streamline service checks for Debian and RedHat OS 2026-07-28 01:24:58 +02:00
chris 5525fa3e73 refactor(systemd-resolved): rename facts to common_resolved variables for consistency 2026-07-28 01:10:41 +02:00
chris 4310ae08b0 fix(copy_files.yml): correct formatting of template files task 2026-07-28 00:48:36 +02:00
chris 385b4a6802 refactor(copy_files.yml): simplify template file handling by removing redundant tasks 2026-07-28 00:46:19 +02:00
chris c30543280b feat(git.yml): enhance error handling for backup and samba server repository installations 2026-07-28 00:36:36 +02:00
chris 7e5fe673cf feat(postfwd.cf): add final=yes to rate limiting rules for enhanced message handling 2026-07-28 00:32:28 +02:00
chris 00457b2ac7 chore(first-run.yml): remove obsolete first-run tasks for package installation 2026-07-28 00:11:19 +02:00
chris 095f5de034 feat(git.yml): enhance version handling for git repositories to prioritize 'master' if available 2026-07-28 00:02:49 +02:00
chris e60c1b81d1 feat(git.yml): add version handling for git repository installations 2026-07-27 22:16:45 +02:00
chris f39babaf5d feat(common): add host-tree file/template overrides and skip global items when host overrides exist 2026-07-27 21:55:27 +02:00