Debian 13 CIS Hardening
Debian 13 is an open-source Linux distribution that runs reliably and suits tasks of any complexity. The image is based on the standard Yandex Cloud Debian 13 image and is already configured along security recommendations, so a VM is hardened from its first boot.
Features
- SSH key-only login: root login, password and keyboard-interactive logins are refused; port, agent and X11 forwarding are disabled; at most 3 authentication attempts per connection.
- UFW firewall: incoming connections denied by default, only 22/tcp open; fail2ban bans an address for 10 minutes after 3 failed SSH logins within an hour.
- An account is locked for 15 minutes after 5 failed password attempts (pam_faillock).
- auditd with a ready rule set; when the log volume fills, logs are rotated and the VM keeps running.
- AIDE file integrity monitoring: the baseline is created on the VM’s first boot before SSH starts and is checked at once; apt maintenance starts only afterwards.
- Kernel hardening: sysctl settings from the Lynis profile, other users' processes hidden (
/procwithhidepid=2), unused filesystem and network protocol modules blocked, core dumps disabled. - AppArmor, rsyslog logging, process accounting (acct), a sudo command log in
/var/log/sudo.log. - Weekly package file checksum verification with debsums; rkhunter installed.
- Automatic Debian security updates without automatic reboot.
- No mail server or other unneeded network services.
How the image differs from a standard one
- Only 22/tcp is open. To open other ports, use
sudo ufw allow <port>/tcp. - The first boot takes a few minutes longer: SSH becomes available once AIDE has created and checked its baseline. AIDE uses up to 770 MB of memory while it creates the baseline; the image was verified on a VM with 2 vCPU and 4 GB RAM.
- Idle interactive sessions end after 15 minutes; the default file creation mask is
umask 027. - SSH tunnels and port forwarding are disabled; one SSH connection carries at most 2 sessions.
- cron and AIDE reports are not mailed; they are in the system journal and in
/var/log/aide. - After planned changes (package installation, updates) AIDE reports them on the next check. To accept the current state as the new baseline, run
sudo aideinit --yes --force.
-
Create an SSH key pair to connect to the virtual machine (VM).
-
Create a VM from a public image. Under Boot disk image, open the Marketplace tab and select Debian 13 CIS Hardening. Under Access:
- in Login, enter a user name, for example
yc-user(logging in asrootis refused); - in SSH key, select the key you created.
Save the VM’s public IP address.
- in Login, enter a user name, for example
-
Wait for the first boot to finish: SSH accepts connections once the AIDE baseline is created.
-
Connect to the VM over SSH with the login above and your private key.
-
Check that the first-boot integrity check succeeded:
sudo journalctl -u aide-firstboot.service.
- Application and web servers that require a hardened baseline configuration.
- Preparing infrastructure for an information security audit.
- A base image for internal services that process confidential data.
- Administering a cluster of virtual machines or databases.
- Development and testing in an environment close to hardened production.
OpenNix provides technical support for Debian 13 CIS Hardening users in Yandex Cloud. Contact support by email at support@opennix.ru. Support hours: 9:00 to 18:00 Moscow time on business days.
| Software | Version |
|---|---|
| Debian | 13 |
| OpenSSH | 10.0p1 |
| AIDE | 0.19.1 |
| auditd | 4.0.2 |
| fail2ban | 1.1.0 |
| AppArmor | 4.1.0 |
| rkhunter | 1.4.6 |
| debsums | 3.0.2.3 |