Przejdź do treści

Security hardening of the PostgreSQL database appliance

The appliances apply part of the recommendations of the advanced security hardening guide when it is built. This page gives, for each recommendation that concerns these appliances, its state and, when it is applied, the file that carries it: what remains to be done after deployment is read from the states other than Applied.

Legend — Applied: by the appliance itself; Partly: the detail gives what remains to be done; Not applied: nothing set by the appliance; 🔧 Deployment: by the administrator, a product setting or a manual check. The recommendations that do not concern these appliances are not listed.

Files of the appliance

The appliance does not modify the configuration files of the Debian packages: it writes its settings in the .d folders they read (sshd_config.d, sysctl.d, sudoers.d…) or in its own files. A setting is adjusted in that file, which a package update leaves in place.

Installation and security maintenance

N° Recommendation State Detail File
R1 Minimal Debian installation Applied Debian 13 base image without recommended packages.
R2 Debian version and security maintenance Applied Debian 13 (trixie), updated when the appliance is built; security updates automated (R7).
R3 Appropriate disk partitioning Partly Separate LVM partitions; nosuid, nodev, noexec options on /boot, /opt, /tmp, /srv, /home, /usr, /var/log, /var/tmp. Database: no option on /var. hidepid is not set on /proc. /etc/fstab
R4 Removal of unnecessary packages installed by default Applied About fifty packages removed (mail, FTP/Telnet, CUPS, Avahi, compilers…), unless a product package depends on them.
R5 Review of active services and listening ports 🔧 Deployment Services are not disabled: review them after deployment (systemctl, ss -tulpn).
R6 Integrity check of packages and APT repositories Applied Signed Debian and Systancia repositories; no recommended or suggested packages. /etc/apt/apt.conf.d/99norecommends
R7 Controlled automation of Debian security updates Applied unattended-upgrades enabled, without automatic reboot. /etc/apt/apt.conf.d/52unattended-upgrades-local

Accounts, privileges and local authentication

N° Recommendation State Detail File
R8 Management of local accounts and restriction of the root account Applied Idle shells closed after 15 minutes (TMOUT=900); root refused on the console (except the autologin of the initial wizard) and over SSH. The root account is not locked. /etc/profile.d/99-timeout.sh, /usr/share/pam-configs/systancia-noroot-console
R9 Privileged administration with sudo Applied use_pty, log file, timeouts; sudo restricted to the sudo group (mode 4750). /etc/sudoers.d/99-hardening
R10 Local authentication policy (libpam-pwquality, pam_faillock) Applied Passwords of 12 characters and 4 classes, 3 attempts; account locked for 300 s after 3 failures. No password history. /etc/security/pwquality.conf.d/50-systancia.conf, /etc/security/faillock-systancia.conf

File system and permissions

N° Recommendation State Detail File
R11 Control of permissions and sensitive files 🔧 Deployment Run the checks of the guide (permissions 777, files without owner, SUID/SGID) after installation.
R12 Hardening of configuration files and sensitive directories Applied Owner and mode of passwd, shadow, group, gshadow, sudoers, sshd_config, host keys, /root, crontab, System.map.

Kernel, network and boot

N° Recommendation State Detail File
R13 sysctl parameters for system and network hardening Not applied All the keys of the guide, except ip_forward=0 and rp_filter=1, set on the Standalone Mediation Controller only (not compatible with a cluster or an Edge Gateway publishing VPN resources). Not applied on the database. /etc/sysctl.d/99-cyberelements-bastion-hardening.conf
R14 Disabling or controlling IPv6 Applied IPv6 disabled. /etc/sysctl.d/99-cyberelements-bastion-ipv6.conf
R15 Advanced boot and kernel hardening (kernel options) Not applied Not applied.
R16 Password on the GRUB boot loader Not applied Left to the administrator: a lost GRUB password prevents recovery.

Scheduled tasks, banner and integrity

N° Recommendation State Detail File
R17 Hardening and review of scheduled tasks Partly /etc/crontab owned by root (0644), audit rules on the scheduled tasks; the review of the product tasks is manual.
R18 Customisation of the system banner Applied Console and SSH banners with a warning text, without product name or version. /etc/issue-systancia, /etc/ssh/banner-systancia
R19 Integrity check of system files with debsums Applied debsums installed; checks run on demand.
R20 Integrity baseline with AIDE Partly AIDE installed with additional rules; the baseline (aideinit) is to be created after deployment. /etc/aide/aide.conf.d/90_cyberelements_bastion

System logging and time synchronisation

N° Recommendation State Detail File
R21 Configuration of the system logging service Applied rsyslog installed, IPv4 only. /etc/rsyslog.d/00-systancia-ipv4.conf
R22 Protection and rotation of logs Partly Default Debian permissions and rotation; Mediation Controller: product logs rotated daily, 14 kept.
R23 Protection of command histories and administration traces Applied Timestamped history (5000 / 10000 lines, histappend), history files in 0600. /etc/profile.d/99-history.sh
R24 Time synchronisation with NTP Applied ntpsec installed on the Mediation Controllers and the database; to be set up on the Edge Gateways.

SSH

N° Recommendation State Detail File
R25 Protocol and cryptographic algorithms Applied Ciphers, MACs and key exchange algorithms of the guide, for the server and the client. RequiredRSASize is not set. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf, /etc/ssh/ssh_config.d/00-cyberelements-bastion-hardening.conf
R26 Authentication and user access control Applied PermitRootLogin no, MaxAuthTries 4, LoginGraceTime 30, no empty password. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf
R27 SSH key authentication and disabling of passwords Partly Password authentication remains allowed: deploy the administrators' keys, then disable it. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf
R28 Restriction of network and forwarding features Applied No forwarding (X11, agent, TCP, stream), no tunnel, no compression. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf
R29 Network listening and exposure of the SSH service 🔧 Deployment Listening address and port to set at deployment.
R30 Limitation of sessions and connection timeouts Applied ClientAliveInterval 300 (×2), MaxSessions 2, MaxStartups 10:30:60. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf
R31 Banner and logging of SSH connections Applied Banner, LogLevel VERBOSE, PrintLastLog. /etc/ssh/sshd_config.d/00-cyberelements-bastion-hardening.conf
R32 Size and robustness of host and user keys Partly Host keys regenerated with the Debian default sizes; no size policy.
R33 Entropy quality and uniqueness of host keys Applied Host keys and machine identifier regenerated at the first startup of each appliance. OVA-ResetSSHKeys.service
R34 Advanced features not retained by default Applied No advanced feature enabled.

Local firewall

N° Recommendation State Detail File
R35 Filtering principle and positive security model 🔧 Deployment No local firewall rule. Database: nftables rules written at its configuration.
R38 Persistence of rules at startup 🔧 Deployment No rule to make persistent. Database: see R35.
R40 Disabling IPv6 when it is not needed Applied IPv6 disabled (R14): no IPv6 rule needed.
R41 Verification, audit and monitoring of rules 🔧 Deployment No rule to check. Database: see R35.

fail2ban

N° Recommendation State Detail File
R57 Installation and operating principle Applied fail2ban installed. Cluster Mediation Controllers also ignore the MASTER, SLAVE and virtual addresses. /etc/fail2ban/jail.local
R58 SSH jail Applied sshd jail: 3 attempts, 600 s ban. /etc/fail2ban/jail.local
R61 Interaction with the local firewall Partly Default ban action of fail2ban; no local firewall (chapter on the local firewall).
R62 Operation and monitoring 🔧 Deployment fail2ban-client status and log review in operation.

Centralised logging

N° Recommendation State Detail File
R63 Principle of centralisation towards the logging infrastructure 🔧 Deployment Requires the logging infrastructure of the organisation.
R66 Reliable forwarding to the logging server 🔧 Deployment Requires the logging server of the organisation.

Monitoring tools

N° Recommendation State Detail File
R68 arpwatch: monitoring of local ARP activity Applied arpwatch enabled on the default interface.
R69 acct: accounting of connections and commands Applied acct installed.
R70 sysstat: system performance statistics Partly sysstat enabled, with the default collection interval.
R71 auditd: audit of the Linux kernel subsystem Applied Audit rules (accounts, sudo, SSH, banners, modules, permission changes…), locked (-e 2). /etc/audit/rules.d/99-systancia.rules
R72 Lynis: periodic configuration audit Partly Lynis installed; audits to run or schedule.
R73 ClamAV: antivirus (to be validated depending on usage) Not applied ClamAV not installed.

Session recordings

N° Recommendation State Detail File
R79 Hardening of the external database Partly Database appliance: scram-sha-256 authentication; network, nftables and certificates set at its configuration.