Hyppää sisältöön

Security hardening guide

This guide gathers the hardening measures that apply to a CyberElements Bastion platform: hardening of the Debian operating system, of the SSH service, of the local firewall, of Apache, of TLS and of the Content Security Policy, along with centralised logging, monitoring and the protection of session recordings.

It does not describe how to install the product (that is covered by the Installation section) but what should be done in addition, once the platform is in place, to reduce its attack surface. The virtual appliances already apply part of these measures: see Mediation Controller appliances, Edge Gateway appliances and PostgreSQL database appliance.

Who it is for

Audience Role
Partners and integrators applying the hardening measures during deployment
Administrators maintaining the security posture in operation

It assumes familiarity with GNU/Linux system administration and access to the privileged accounts of the servers.

The standards it builds on

The recommendations come from a cross-reading of the publications of the ANSSI, the French national cybersecurity agency:

Reference Title What it contributes here
ANSSI-BP-028 v2.0 Recommandations de sécurité relatives à un système GNU/Linux the main standard for operating system hardening
DAT-NT-007/ANSSI/SDE/NP v1.2 Recommandations pour un usage sécurisé d'(Open)SSH hardening of the SSH service, of authentication and of keys
ANSSI-PA-009 v2.1 Recommandations pour la mise en œuvre d'un site Web : maîtriser les standards de sécurité côté navigateur HTTP headers and Content Security Policy
ANSSI-PA-012 v2.0 Recommandations de sécurité pour l'architecture d'un système de journalisation collection, protection and centralisation of logs
ANSSI-PA-035 v1.2 Recommandations de sécurité relatives à TLS protocol versions, cipher suites and TLS parameters

Information

DAT-NT-007 dates from 17 August 2015. Unlike ANSSI-BP-028 (2022), it has not been revised since: the chapter devoted to SSH takes this into account and points out the directives that have become obsolete in current versions of OpenSSH.

How to read the recommendations

Every measure carries a stable number, from R1 to R79, identical to the one used in the security hardening guide shipped with the product. That number does not change from one version of the documentation to the next: it allows a measure to be named unambiguously in an exchange with support or in an audit report.

Not all recommendations apply in the same way:

  • most are directly applicable, subject to the warnings given in their own section;
  • some are reserved for a support or project intervention;
  • others are to be validated against the architecture, the administration workstations or the security policy.

Before applying a measure in production

The recommendations reserved for a support or project intervention and those to be validated are gathered in the Classification of recommendations appendix: read it, along with the section of the recommendation, before applying the measure.

The 79 recommendations

# Recommendation Chapter Mediation Controller Edge Gateway
R1 Minimal Debian installation System hardening
R2 Debian version and security maintenance System hardening
R3 Appropriate disk partitioning System hardening
R4 Removal of unnecessary packages installed by default System hardening
R5 Review of active services and listening ports System hardening
R6 Integrity check of packages and APT repositories System hardening
R7 Controlled automation of Debian security updates System hardening
R8 Management of local accounts and restriction of the root account System hardening
R9 Privileged administration with sudo System hardening
R10 Local authentication policy (libpam-pwquality, pam_faillock) System hardening
R11 Control of permissions and sensitive files System hardening
R12 Hardening of configuration files and sensitive directories System hardening
R13 sysctl parameters for system and network hardening System hardening
R14 Disabling or controlling IPv6 System hardening
R15 Advanced boot and kernel hardening (kernel options) System hardening
R16 Password on the GRUB boot loader System hardening
R17 Hardening and review of scheduled tasks System hardening
R18 Customisation of the system banner System hardening
R19 Integrity check of system files with debsums System hardening
R20 Integrity baseline with AIDE System hardening
R21 Configuration of the system logging service System hardening
R22 Protection and rotation of logs System hardening
R23 Protection of command histories and administration traces System hardening
R24 Time synchronisation with NTP System hardening
R25 Protocol and cryptographic algorithms SSH
R26 Authentication and user access control SSH
R27 SSH key authentication and disabling of passwords SSH
R28 Restriction of network and forwarding features SSH
R29 Network listening and exposure of the SSH service SSH
R30 Limitation of sessions and connection timeouts SSH
R31 Banner and logging of SSH connections SSH
R32 Size and robustness of host and user keys SSH
R33 Entropy quality and uniqueness of host keys SSH
R34 Advanced features not retained by default SSH
R35 Filtering principle and positive security model Local firewall
R36 Base rules in Standalone mode (Mediation Controller) Local firewall
R37 Simplified profile for the Edge Gateway Local firewall
R38 Persistence of rules at startup Local firewall
R39 Cluster mode: filtering script managed by the product Local firewall
R40 Disabling IPv6 when it is not needed Local firewall
R41 Verification, audit and monitoring of rules Local firewall
R42 Reducing the attack surface and exposed information Apache
R43 Management of persistent connections Apache
R44 HTTP security headers Apache
R45 Restriction of HTTP methods and directory browsing Apache
R46 Compression of Reverse Proxy virtual hosts and the BREACH vulnerability Apache
R47 Permissions of configuration files Apache
R48 Protection of p12 files and their associated configuration Edge Gateway certificates
R49 Continuity of protection after a certificate update or renewal Edge Gateway certificates
R50 General TLS policy TLS
R51 Configuration of the Mediation Controller Apache portal TLS
R52 Verification of the effective TLS configuration TLS
R53 Deployment of the CSP on Web VPN hosts Content Security Policy
R54 Known product limitation: unsafe-inline and unsafe-eval Content Security Policy
R55 Consistency with the headers protecting against clickjacking Content Security Policy
R56 Collection of CSP violation reports (optional) Content Security Policy
R57 Installation and operating principle fail2ban
R58 SSH jail fail2ban
R59 Apache jails fail2ban
R60 Jail specific to CyberElements Bastion authentication fail2ban
R61 Interaction with the local firewall fail2ban
R62 Operation and monitoring fail2ban
R63 Principle of centralisation towards the logging infrastructure Centralised logging
R64 Redirection of Apache logs to syslog Centralised logging
R65 Redirection of organisation logs to syslog Centralised logging
R66 Reliable forwarding to the logging server Centralised logging
R67 Good practices on the destination logging server Centralised logging
R68 arpwatch: monitoring of local ARP activity Monitoring tools
R69 acct: accounting of connections and commands Monitoring tools
R70 sysstat: system performance statistics Monitoring tools
R71 auditd: audit of the Linux kernel subsystem Monitoring tools
R72 Lynis: periodic configuration audit Monitoring tools
R73 ClamAV: antivirus (to be validated depending on usage) Monitoring tools
R74 Dedicated storage and monitoring of recording space Session recordings
R75 Restriction of access to recordings Session recordings
R76 Retention and purging of recordings Session recordings
R77 Logging of video events Session recordings
R78 Password rotation after a recorded session Session recordings
R79 Hardening of the external database Session recordings

Before you start

Warning!

Several measures can cut off administrative access if they are applied without care: SSH hardening, the local firewall, locking the root account, a password on the boot loader. Before any change of that kind:

  • keep an administration session open throughout the operation;
  • have emergency console access to the virtual machine;
  • check the configuration before reloading a service, then open a second session to validate it before closing the first one.

The network flows required between the components and towards the outside are described with the installation prerequisites: Mediation Controller and Edge Gateways, section Network.