Preskočiť na obsah

Security hardening guide

This guide gathers the hardening measures that apply to the components you deploy yourself with CyberElements SaaS, the Edge Gateways installed on Debian: hardening of the Debian operating system, of the SSH service and of the local firewall, protection of the Edge Gateway certificates, along with fail2ban, centralised logging, monitoring tools and the protection of session recordings.

In CyberElements SaaS, the platform (Mediation Controller, system console, HTML5 Gateway, database) is operated by CyberElements: the recommendations that concern it alone are not part of this guide. The Windows Edge Gateway is not covered either, the measures of this guide being specific to Debian.

It does not describe how to install the Edge Gateways (that is covered by the hybrid deployment section, starting with Edge Gateway formats) but what should be done in addition, once they are in place, to reduce their attack surface.

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-012 v2.0 Recommandations de sécurité pour l'architecture d'un système de journalisation collection, protection and centralisation of logs

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, identical to the one used in the security hardening guide of CyberElements Bastion, which numbers its recommendations from R1 to R79. 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. This guide keeps only the recommendations that apply to the components you deploy: the numbering therefore has gaps, the missing numbers being those of the recommendations that concern the platform alone.

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 60 recommendations

# Recommendation Chapter 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
R37 Simplified profile for the Edge Gateway Local firewall
R38 Persistence of rules at startup Local firewall
R40 Disabling IPv6 when it is not needed Local firewall
R41 Verification, audit and monitoring of rules Local firewall
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
R57 Installation and operating principle fail2ban
R58 SSH jail fail2ban
R61 Interaction with the local firewall fail2ban
R62 Operation and monitoring fail2ban
R63 Principle of centralisation towards the logging infrastructure 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 by the Edge Gateways are described with their installation prerequisites: Prerequisites, section Network.