Skip to content

Configuration posture

Configuration posture is the second half of a server’s Security tab. Where the vulnerability results say which installed packages are known to be vulnerable, posture says how the host is configured: whether SSH accepts passwords, whether an account has no password, whether a system file is writable by everyone, whether the kernel’s hardening settings are on. It is modelled on ComplianceAsCode, cites its rule ids and is WatchTower15’s own catalogue: it makes no claim to match any published benchmark.

The agent reads a short list of configuration facts, sends them when they change, and WatchTower15 evaluates 59 checks against them. Nothing is changed on the server, and WatchTower15 never connects to it: the agent sends the facts out over HTTPS, and every check’s page below gives the step to take yourself.

The Security tab shows the catalogue’s version beside the score.

What the agent reads, and what it never sends

Section titled “What the agent reads, and what it never sends”

The agent reads these files and settings with the access its service already has: no extra privilege, no sudo, nothing installed. It sends derived facts, not the files.

Reads Sends
SSH: the effective sshd configuration, including each Match block’s settings the values of 14 settings (for example PermitRootLogin, PasswordAuthentication, the cipher, MAC and key exchange lists), never keys, banners, ports, allowed users or a Match block’s criteria
Kernel and network: 13 settings in /proc/sys each setting’s number
Files: the mode, owner and size of the system files the checks name, and a walk of /etc the numbers, never a file’s content or a hash
Accounts: /etc/passwd, /etc/shadow, /etc/group, /etc/login.defs counts (accounts with an empty password, hashes by algorithm, system accounts with a shell) and the names of accounts with UID 0 other than root
sudo: /etc/sudoers and /etc/sudoers.d the names of users and groups that have NOPASSWD, and a count of !authenticate; never a rule, a command or an alias
PAM: the login stacks and their password settings which modules are present, whether nullok is set, and three numbers (minlen, the lockout deny, PASS_MIN_LEN)
Access control: SELinux and AppArmor state whether each is present and enforcing, and SELinux’s configured mode and policy name (such as targeted); never a profile or a policy’s rules
Mounts: /tmp, /var/tmp and /dev/shm whether each is a separate mount and its nosuid, nodev and noexec options
Modules: modprobe’s configuration and the loaded modules for dccp, sctp, rds and tipc, whether disabled and whether loaded
Updates: the package manager’s configuration whether signature checking is on, the count of repositories or sources that turn it off, and whether automatic updates apply; never a repository id or address
Firewall: ufw’s setting whether ufw is enabled
Logging: journald’s configuration its storage mode and whether the journal is on disk

The agent never sends a password hash, a command line, an environment value, the contents of a file, a key, or any file outside the lists above. The checks that look at services read the service and port lists the agent already sends.

File paths do leave the host in a few cases, because the finding must name the file to fix: the files in /etc/sudoers.d and /etc/ssh/sshd_config.d, and the world-writable files found under /etc. A drop-in can be named after a person (/etc/sudoers.d/alice), so treat those paths as you would the account names above.

On a host where the agent runs in a container, no configuration facts are read at all: the agent would see the container, not the host.

The agent sends its facts a few minutes after it starts, whenever they change, and at least once every 24 hours. The results appear when they arrive: there is no daily run to wait for. The checks of the Services family read the service and port lists the agent sends on its 300-second system-information cadence, at the moment of the evaluation. So a service started on a host whose configuration facts do not change shows at the next 24-hour report, or at once on Re-check posture, not within five minutes.

WatchTower15 also evaluates every server again at least once a day, and when the catalogue changes, so a new or corrected check reaches every server within hours.

A check is evaluated for these releases only:

  • Ubuntu 18.04, 20.04, 22.04, 24.04 and 26.04 LTS. The interim releases (24.10, 25.04, 25.10) are not checked.
  • Debian 11 to 13.
  • RHEL, AlmaLinux and Rocky Linux 8 to 10.
  • CentOS Linux 7 and CentOS Stream 8 to 10.
  • Amazon Linux 2 and 2023. A release that is not generally available is not checked.

Ubuntu 18.04, CentOS Linux 7 and Amazon Linux 2 are past their vendor’s support and are flagged by the operating system end of life finding; their configuration is still checked.

On any other release (Ubuntu 16.04, CentOS Linux 8, Fedora and the like), every check reads Not applicable, reason distro, and the section says the operating system is not covered. A server that has not yet reported its system information has no known release yet and is not evaluated until it has.

Each check has one of four statuses on a server.

Status Meaning
Pass The configuration is as expected.
Fail The configuration is not as expected. The observed value is shown beside what was expected.
Not applicable The check does not apply to this server, with the reason below. It is not scored.
Not measured The agent could not read what the check needs, with the reason below. It is not scored, and it is never shown as a pass.

Not applicable reasons:

  • Distro: the operating system is outside the list above, or this check belongs to another distribution (SELinux on Ubuntu, AppArmor on RHEL).
  • Container host: the server runs Docker, containerd, CRI-O, Podman, k3s or kubelet, which forward packets on purpose (the two forwarding checks).
  • Key-only SSH: SSH accepts public keys only, so the password checks do not apply.
  • No sshd and no sudo: the host has no SSH server, or no /etc/sudoers.
  • No Yama: the kernel has no Yama module.

Not measured reasons:

  • Agent update: the agent is older than the check’s facts.
  • Denied: the agent may not read the file. For shadow and sudoers, reinstalling the agent grants the read.
  • Timeout: a read took too long (each family has a 2-second budget, the pass 10 seconds).
  • Oversize: the family’s facts were larger than the agent sends.
  • Parse error: the file could not be understood.
  • Absent: a value this host does not have, such as a sysctl its kernel lacks.
  • Walk capped: the /etc walk stopped at 10,000 entries or one second without finding a world-writable file, so it cannot say there is none.
  • No fact: a service or port list the check needs is missing, stale or incomplete.

Each check has a default severity: Critical (15 checks), Warning (26) or Info (18). Info checks are advice: they are listed, never alarm, and weigh nothing in the score. Four checks change severity with context, and each says so in its section: Address space layout randomisation (Critical when off, Warning when partial), SELinux (Info on Amazon Linux 2023 and 2, whose default is permissive), Host firewall (Info on a cloud host, where security groups do the job) and SSH accepts passwords (Info when a public key is required as well).

The score is a number from 0 to 100: the share of the checks that count that pass, weighted Critical 10, Warning 3, Info 0, rounded to a whole number. Checks that are not applicable, not measured, or dismissed are left out. The score shows beside the catalogue version and the counts by severity, never alone, and reads — until at least one scored check has been measured. It is a way to compare a server with its own past, not a certification.

WatchTower15 decides a server’s context itself, from what it already knows:

  • Cloud host: an AWS or DigitalOcean server. Its host firewall check is advisory.
  • Container host: a server where Docker, containerd, CRI-O, Podman, k3s or kubelet is active.
  • Key-only SSH: no password or keyboard-interactive login, globally or in any Match block.
  • Expected NOPASSWD users: on a cloud host, the cloud image’s own user for the distribution (ubuntu, admin, ec2-user, cloud-user, rocky, almalinux or centos) and ssm-user, which the AWS Systems Manager agent creates. Any other user with NOPASSWD fails A user can use sudo without a password.

The Security tab’s Posture section shows the score, the counts by severity, and the checks by family, worst first. Filter by status (Fail by default), severity (Critical and Warning by default), family or search. The count of checks the filters hide is shown under the list. Opening a check shows what to do, the observed value against the expected one, the context note, the ComplianceAsCode rule ids, and the check’s own history: when it began failing, passed, was measured or not, and was dismissed or restored.

The tab’s Posture score card shows the score and the failing Critical and Warning checks, and its Actions required list includes the failing Critical and Warning checks, after the critical vulnerabilities. Under Monitoring › Security, the By check tab lists every check worst first, with how many servers fail it and, on opening, those servers with the observed value, and Export CSV saves the list as a file.

The Changes card lists vulnerability changes only. A check’s changes are in its own drawer.

Re-check posture asks the agent to read the facts again now, with the same bounded pass as the periodic one, and evaluates them when they arrive. The Posture section then reads again every 30 seconds, for up to 15 minutes, until the new results are in. It is available once every 10 minutes for each server, needs security.edit, and is unavailable while the server or its agent is inactive.

When results are not current, the section says why, in one notice. Only one shows at a time.

State What it means Results shown
Container install The agent runs in a container, so it sees the container, not the host. Configuration checks are not run for container installs. None
Agent update needed The agent does not send configuration facts. Update the agent. None
Operating system not covered Configuration checks do not cover the server’s operating system. WatchTower15 checks Ubuntu 18.04, 20.04, 22.04, 24.04 and 26.04, Debian 11 to 13, RHEL, AlmaLinux and Rocky Linux 8 to 10, CentOS Linux 7, CentOS Stream 8 to 10, and Amazon Linux 2 and 2023; a release that is not generally available is not checked. None
No facts yet No configuration facts have arrived yet. The agent sends them within a few minutes of starting. None
Stale No facts for 48 hours: the agent may be stopped or offline. The last ones
Without read capabilities The agent was installed without read capabilities (its Agent security card says None for its privileges), so the checks that read protected files (shadow, sudoers) are not measured. Reinstall the agent to measure them. Current, those checks not measured
Partly read Some facts could not be read in time or at all, so their checks are not measured this time. Current, those checks not measured

A check you have judged acceptable can be dismissed, with a reason (required, up to 500 characters) and an optional review date. A dismissed check raises no alarm, is left out of the score, and is listed under the Dismissed filter with who dismissed it, when and why.

  • On this server: the dismissal reopens by itself when the observed value changes, and on its review date.
  • For every server in the organisation: one dismissal covers the check on every server of the organisation, present and future, for example when you run Avahi everywhere on purpose. It does not reopen when a value changes, since the organisation accepted the check, not a value. It ends when restored or on its review date.

A check that is dismissed and then passes has its dismissal cleared. Dismissing and restoring need security.edit and are recorded on the server’s Audit tab; a dismissal for the organisation, and its restore, are recorded against the organisation, not a server. The organisation’s dismissals are listed in By check, where Restore for the organisation removes one.

Two alarms watch posture, in the Alarms tab’s Security section: Posture regressed and Posture facts stopped. Neither changes the server’s Operational Health: both move Security Health. When alarms are enabled on existing servers, they start quietly: Posture regressed never fires on a server’s first evaluation.

  • The score and the counts need servers.view, as the server’s page does.
  • The checks, observed values, the drawer and the fleet’s By check need security.view.
  • Dismiss, Restore, the organisation’s dismissals and Re-check posture need security.edit.

The Regular Users role holds neither: it sees the score, and a message asking an administrator for access. See Roles & permissions.

  • A link-protection check. fs.protected_symlinks and fs.protected_hardlinks can be read by root only, whatever the agent’s capabilities, and systemd distributions set both to 1 by default, so there is no check for them.
  • Compromise indicators, scheduled-job contents and set-uid walks.
  • Firewall rules: reading them needs a capability the agent does not hold.
  • Users’ home directories (.rhosts, authorized_keys).
  • Windows hosts and container installs.

The ComplianceAsCode content is licensed under BSD-3-Clause; see Data attributions.

The catalogue has 14 families. Each check below has its own anchor, and a check’s drawer links to it. In each family the checks are listed worst first. Modelled on names the ComplianceAsCode rule ids; where a check is narrower or stricter than the rule, its Context says how.

Read from the effective configuration of sshd (sshd -T, or sshd_config and its includes when the binary is absent), including every Match block. Not applicable, reason no sshd, when the host has no sshd.

ssh.empty_passwords · Critical

What fails it. PermitEmptyPasswords yes.

Why it matters. An account with an empty password can log in with nothing.

How to fix it. Set PermitEmptyPasswords no. Set PermitEmptyPasswords no in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Modelled on ComplianceAsCode rule sshd_disable_empty_passwords.

ssh.root_password_login · Critical

What fails it. PermitRootLogin yes in the effective sshd configuration, or in any Match block. The default, prohibit-password (since OpenSSH 7.0), passes, as do no and forced-commands-only.

Why it matters. Anyone who guesses root’s password logs in as root, with nothing in between.

How to fix it. Set PermitRootLogin to prohibit-password or no. Set PermitRootLogin prohibit-password (or no) in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Modelled on ComplianceAsCode rule sshd_disable_root_password_login.

ssh.host_based_auth · Warning

What fails it. HostbasedAuthentication yes, or IgnoreRhosts no.

Why it matters. A trusted host can log in as any user without a password or key.

How to fix it. Set HostbasedAuthentication no and IgnoreRhosts yes. Set HostbasedAuthentication no and IgnoreRhosts yes in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Modelled on ComplianceAsCode rule sshd_disable_rhosts.

ssh.password_authentication · Warning

What fails it. PasswordAuthentication yes, or keyboard-interactive on (KbdInteractiveAuthentication yes with UsePAM yes, so PAM asks for a password), globally or in any Match block. The shipped defaults of Ubuntu, Debian and the RHEL family pass. When AuthenticationMethods requires a public key as well as the password, the severity is Info.

Why it matters. Passwords can be guessed and sprayed; keys cannot.

How to fix it. Allow public keys only: PasswordAuthentication no, and keyboard-interactive off. Set PasswordAuthentication no and KbdInteractiveAuthentication no in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Context. Severity drops to Info when AuthenticationMethods requires publickey together with the password.

Modelled on no upstream rule: this check is WatchTower15’s own.

ssh.user_environment · Warning

What fails it. PermitUserEnvironment yes.

Why it matters. Users can set environment variables for their own session, which can bypass restrictions such as a forced command.

How to fix it. Set PermitUserEnvironment no. Set PermitUserEnvironment no in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Modelled on ComplianceAsCode rule sshd_do_not_permit_user_env.

ssh.weak_ciphers · Warning

What fails it. The server offers 3des-cbc, blowfish-cbc, cast128-cbc, arcfour*, aes*-cbc or rijndael-cbc*. OpenSSH’s default list passes.

Why it matters. These ciphers have known weaknesses, and the CBC modes have attacks against SSH.

How to fix it. Remove the CBC, 3DES, Blowfish, CAST and RC4 ciphers from Ciphers. Set Ciphers to a list without the CBC ciphers in a file under /etc/ssh/sshd_config.d/, or remove the line to use the defaults, and reload sshd.

Modelled on ComplianceAsCode rule sshd_use_strong_ciphers.

ssh.weak_kex · Warning

What fails it. The server offers diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1 or a gss-*-sha1-* key exchange.

Why it matters. SHA-1 based key exchanges are deprecated and the 1024-bit group is within reach of well-funded attackers.

How to fix it. Remove the SHA-1 Diffie-Hellman groups from KexAlgorithms. Set KexAlgorithms to a list without the SHA-1 groups in a file under /etc/ssh/sshd_config.d/, or remove the line to use the defaults, and reload sshd.

Modelled on ComplianceAsCode rule sshd_use_strong_kex.

ssh.weak_macs · Warning

What fails it. The server offers hmac-md5*, hmac-md5-96*, hmac-sha1-96* or hmac-ripemd160*. OpenSSH’s default list passes.

Why it matters. These message authentication codes are weak or deprecated.

How to fix it. Remove the MD5, SHA-1-96 and RIPEMD-160 MACs from MACs. Set MACs to a list without the weak MACs in a file under /etc/ssh/sshd_config.d/, or remove the line to use the defaults, and reload sshd.

Context. ComplianceAsCode’s rule is stricter: it also rejects hmac-sha1 and umac-64, which OpenSSH offers by default. WatchTower15 does not.

Modelled on ComplianceAsCode rule sshd_use_strong_macs.

ssh.max_auth_tries · Info

What fails it. MaxAuthTries above the default of 6.

Why it matters. More attempts per connection make guessing cheaper.

How to fix it. Set MaxAuthTries to 6 or less. Set MaxAuthTries 4 in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Context. ComplianceAsCode wants 4 or fewer. WatchTower15 flags only a value above OpenSSH’s default.

Modelled on ComplianceAsCode rule sshd_set_max_auth_tries.

ssh.x11_forwarding · Info

What fails it. X11Forwarding yes, which is Ubuntu’s shipped default.

Why it matters. A server rarely needs to forward a graphical session, and a forwarded session exposes the client’s display.

How to fix it. Set X11Forwarding no on a server. Set X11Forwarding no in a file under /etc/ssh/sshd_config.d/ and reload sshd.

Modelled on ComplianceAsCode rule sshd_disable_x11_forwarding.

Read from /etc/passwd, /etc/shadow, /etc/group and /etc/login.defs. The agent sends counts, and the names of accounts only for the UID 0 list.

accounts.empty_password · Critical

What fails it. An account has an empty password field in /etc/shadow. The count is shown.

Why it matters. The account can log in without a password wherever the service accepts empty passwords.

How to fix it. Lock or set a password for every account. Find them with awk -F: '$2 == ""' /etc/shadow and lock each with passwd -l <account>.

Modelled on ComplianceAsCode rule no_empty_passwords_etc_shadow.

accounts.extra_uid0 · Critical

What fails it. An account other than root has UID 0. The names are shown.

Why it matters. Every UID 0 account is root, whatever its name.

How to fix it. Remove the extra UID 0 accounts or give them another UID. List the accounts with awk -F: '$3 == 0' /etc/passwd, then remove them or change their UID.

Modelled on ComplianceAsCode rule accounts_no_uid_except_zero.

accounts.hosts_equiv · Critical

What fails it. /etc/hosts.equiv or /etc/shosts.equiv exists and is not empty.

Why it matters. These files make the host trust other hosts for rsh and rlogin without a password.

How to fix it. Remove /etc/hosts.equiv and /etc/shosts.equiv. Remove the file, or empty it, and stop rsh and rlogin.

Context. ComplianceAsCode’s rule also covers users’ .rhosts files. WatchTower15 never reads a user’s home directory.

Modelled on ComplianceAsCode rule no_rsh_trust_files.

accounts.unshadowed · Critical

What fails it. A password hash sits in /etc/passwd, which every user can read. The count is shown.

Why it matters. Anyone on the host can read the hash and try to crack it.

How to fix it. Move the hashes to /etc/shadow with pwconv. Run pwconv to move the hashes into /etc/shadow.

Modelled on ComplianceAsCode rule accounts_password_all_shadowed.

accounts.extra_gid0 · Warning

What fails it. A group other than root has GID 0, or an account other than root, sync, shutdown, halt and operator has GID 0 as its primary group. The count is shown.

Why it matters. Members of a GID 0 group have the root group’s file access.

How to fix it. Give the extra group a GID other than 0. Find them with awk -F: '$3 == 0' /etc/group and change the GID.

Modelled on ComplianceAsCode rule groups_no_zero_gid_except_root.

accounts.hash_default · Warning

What fails it. ENCRYPT_METHOD in /etc/login.defs is not SHA512 or YESCRYPT.

Why it matters. New passwords would be hashed with a weak algorithm.

How to fix it. Set ENCRYPT_METHOD to SHA512 or YESCRYPT in /etc/login.defs. Set ENCRYPT_METHOD YESCRYPT (or SHA512) in /etc/login.defs.

Modelled on ComplianceAsCode rule set_password_hashing_algorithm_logindefs.

accounts.legacy_hash · Warning

What fails it. An account’s password is hashed with MD5 or DES. The count is shown, never the hash.

Why it matters. These hashes are fast to crack.

How to fix it. Make every account change its password so it is stored with SHA-512 or yescrypt. Set ENCRYPT_METHOD to SHA512 or YESCRYPT in /etc/login.defs, then have the accounts change their passwords.

Context. ComplianceAsCode’s rule checks the default for new passwords, not hashes that already exist. This check reads the existing ones.

Modelled on ComplianceAsCode rule set_password_hashing_algorithm_logindefs.

accounts.system_shell · Info

What fails it. A system account (UID below the host’s UID_MIN, not root, sync, shutdown or halt) has a login shell. The count is shown.

Why it matters. A service account that can log in widens what a compromised service can do.

How to fix it. Give system accounts /usr/sbin/nologin. Change the shell with usermod -s /usr/sbin/nologin <account> for each system account.

Modelled on ComplianceAsCode rule no_shelllogin_for_systemaccounts.

Read from /etc/sudoers and /etc/sudoers.d, parsed for NOPASSWD and !authenticate only. Not applicable, reason no sudo, when the host has no sudoers.

sudo.no_authenticate · Warning

What fails it. !authenticate appears in /etc/sudoers or a file in /etc/sudoers.d.

Why it matters. sudo then never asks for a password for those rules.

How to fix it. Remove !authenticate from the sudoers rules. Remove !authenticate from the rules in /etc/sudoers and /etc/sudoers.d/ with visudo.

Context. Not applicable, reason no sudo, when the host has no /etc/sudoers.

Modelled on ComplianceAsCode rule sudo_require_authentication.

sudo.unexpected_nopasswd · Warning

What fails it. A user or %group can use sudo with NOPASSWD, other than the expected ones. Expected: the cloud image’s own user for the distribution (Ubuntu ubuntu, Debian admin, Amazon Linux ec2-user, RHEL ec2-user and cloud-user, Rocky Linux rocky, AlmaLinux almalinux and ec2-user, CentOS centos and ec2-user) and, on a cloud host, ssm-user, which the AWS Systems Manager agent creates. Off a cloud host no one is expected. The names are shown.

Why it matters. Anyone who gets that account becomes root without a second factor.

How to fix it. Remove NOPASSWD from the sudoers rules except for the cloud image’s own user. Remove NOPASSWD: from the rules in /etc/sudoers and /etc/sudoers.d/ with visudo.

Context. Not applicable, reason no sudo, when the host has no /etc/sudoers. ComplianceAsCode’s rule flags every NOPASSWD, the cloud users included.

Modelled on ComplianceAsCode rule sudo_remove_nopasswd.

Read with lstat only: mode, owner and size, never a file’s content.

files.etc_world_writable · Critical

What fails it. A regular file under /etc is world-writable. Up to 20 paths are shown. WatchTower15 walks /etc only, with lstat, and stops at 10,000 entries or after one second; a walk that stopped early without finding one reads Not measured, reason walk capped.

Why it matters. Any user can change the configuration the file holds.

How to fix it. Remove the world-write bit from the files. Run chmod o-w on each file, then find others with find /etc -xdev -type f -perm -0002.

Context. ComplianceAsCode’s rule walks the whole filesystem. WatchTower15 walks /etc only.

Modelled on ComplianceAsCode rule file_permissions_unauthorized_world_writable.

files.passwd_mode · Critical

What fails it. /etc/passwd or /etc/group is writable by its group or by others.

Why it matters. Whoever can write them can add a UID 0 account.

How to fix it. Make them writable by root only. Run chmod 0644 on /etc/passwd and /etc/group.

Modelled on ComplianceAsCode rules file_permissions_etc_passwd, file_permissions_etc_group.

files.shadow_mode · Critical

What fails it. /etc/shadow or /etc/gshadow is readable by others, writable by its group, or not owned by root.

Why it matters. These files hold the password hashes.

How to fix it. Make them owned by root, not readable by others and not writable by the group. Run chown root and chmod 0640 (or stricter) on /etc/shadow and /etc/gshadow.

Modelled on ComplianceAsCode rules file_permissions_etc_shadow, file_permissions_etc_gshadow, file_owner_etc_shadow.

files.ssh_host_keys · Critical

What fails it. A host private key (/etc/ssh/ssh_host_*_key) is readable by others or writable by its group.

Why it matters. A copied host key lets someone impersonate the server.

How to fix it. Make the private keys readable by root only. Run chmod 0600 on /etc/ssh/ssh_host_*_key.

Modelled on ComplianceAsCode rule file_permissions_sshd_private_key.

files.sudoers_mode · Critical

What fails it. /etc/sudoers, the /etc/sudoers.d directory or a file in it is writable by anyone but root, or not owned by root. The path is shown; a file in /etc/sudoers.d can be named after a person, and its name leaves the host for this reason.

Why it matters. Whoever can write sudo’s rules can give themselves root.

How to fix it. Make /etc/sudoers, /etc/sudoers.d and its files owned by root and writable by root only. Run chown root and chmod 0440 on the sudoers files and chmod 0750 on /etc/sudoers.d.

Modelled on ComplianceAsCode rules file_permissions_etc_sudoers, file_owner_etc_sudoers, directory_permissions_etc_sudoersd.

files.cron_mode · Warning

What fails it. /etc/crontab or an /etc/cron.* directory is writable by group or others, or not owned by root.

Why it matters. Whoever can write a cron file runs commands as root.

How to fix it. Make /etc/crontab and the cron directories owned by root and writable by root only. Run chown root:root and chmod go-w on /etc/crontab and the /etc/cron.* directories.

Modelled on ComplianceAsCode rules file_permissions_crontab, file_permissions_cron_d.

files.sshd_config_mode · Warning

What fails it. /etc/ssh/sshd_config, the /etc/ssh/sshd_config.d directory or a drop-in in it is writable by its group or others. The path is shown.

Why it matters. Whoever can write sshd’s configuration can open the server to themselves.

How to fix it. Make sshd_config, its drop-in directory and its drop-ins writable by root only. Run chmod go-w on /etc/ssh/sshd_config, /etc/ssh/sshd_config.d and the files in it.

Modelled on ComplianceAsCode rule file_permissions_sshd_config.

/tmp or /var/tmp is world-writable without the sticky bit

Section titled “/tmp or /var/tmp is world-writable without the sticky bit”

files.tmp_sticky · Warning

What fails it. /tmp or /var/tmp is world-writable without the sticky bit. The agent reads the host’s own directories through /proc/1/root, since its service has private ones; when it cannot read them the check reads Not measured.

Why it matters. Without the sticky bit any user can delete or replace another user’s files there.

How to fix it. Set the sticky bit on /tmp and /var/tmp. Run chmod +t /tmp /var/tmp.

Context. ComplianceAsCode’s rule covers every world-writable directory. WatchTower15 checks these two.

Modelled on ComplianceAsCode rule dir_perms_world_writable_sticky_bits.

files.grub_cfg · Info

What fails it. grub.cfg is readable by others.

Why it matters. The file can hold boot parameters and, on some systems, the boot loader’s password hash.

How to fix it. Make grub.cfg readable by root only. Run chmod 0600 on the grub.cfg file.

Modelled on ComplianceAsCode rule file_permissions_grub2_cfg.

Read from /proc/sys.

Address space layout randomisation is not full

Section titled “Address space layout randomisation is not full”

kernel.aslr · Critical

What fails it. kernel.randomize_va_space is not 2. Critical at 0, Warning at 1.

Why it matters. Without full address space randomisation, exploits find their targets at known addresses.

How to fix it. Set kernel.randomize_va_space to 2. Add kernel.randomize_va_space = 2 to a file under /etc/sysctl.d/ and run sysctl --system.

Context. Critical at 0 (off); Warning at 1 (partial).

Modelled on ComplianceAsCode rule sysctl_kernel_randomize_va_space.

kernel.kptr_restrict · Warning

What fails it. kernel.kptr_restrict is 0.

Why it matters. Kernel addresses are visible to every user, which helps exploits.

How to fix it. Set kernel.kptr_restrict to 1 or 2. Add kernel.kptr_restrict = 1 to a file under /etc/sysctl.d/ and run sysctl --system.

Context. ComplianceAsCode’s rule wants 2 for some products. WatchTower15 flags only 0.

Modelled on ComplianceAsCode rule sysctl_kernel_kptr_restrict.

Set-uid programs can dump core readable by users

Section titled “Set-uid programs can dump core readable by users”

kernel.suid_dumpable · Warning

What fails it. fs.suid_dumpable is 1.

Why it matters. A set-uid program that crashes can write a core dump any user can read.

How to fix it. Set fs.suid_dumpable to 0 or 2. Add fs.suid_dumpable = 0 to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rule sysctl_fs_suid_dumpable.

kernel.unprivileged_bpf · Warning

What fails it. kernel.unprivileged_bpf_disabled is 0.

Why it matters. Unprivileged users can load BPF programs, a regular source of kernel exploits.

How to fix it. Set kernel.unprivileged_bpf_disabled to 1 or 2. Add kernel.unprivileged_bpf_disabled = 1 to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rule sysctl_kernel_unprivileged_bpf_disabled.

kernel.dmesg_restrict · Info

What fails it. kernel.dmesg_restrict is 0.

Why it matters. Any user can read the kernel log, which can show addresses and hardware details.

How to fix it. Set kernel.dmesg_restrict to 1. Add kernel.dmesg_restrict = 1 to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rule sysctl_kernel_dmesg_restrict.

Any process can trace its user’s other processes

Section titled “Any process can trace its user’s other processes”

kernel.ptrace_scope · Info

What fails it. kernel.yama.ptrace_scope is 0. 1 to 3 pass; at 3 the note says that the process checks of the compromise indicators stop.

Why it matters. Any process can read the memory of its user’s other processes.

How to fix it. Set kernel.yama.ptrace_scope to 1 or higher. Add kernel.yama.ptrace_scope = 1 to a file under /etc/sysctl.d/ and run sysctl --system.

Context. Not applicable, reason no Yama, on a kernel without the Yama module.

Modelled on ComplianceAsCode rule sysctl_kernel_yama_ptrace_scope.

Read from /proc/sys/net.

network.source_route · Warning

What fails it. net.ipv4.conf.all.accept_source_route is 1.

Why it matters. A sender can choose the route its packets take, which helps spoofing.

How to fix it. Set net.ipv4.conf.all.accept_source_route to 0. Add net.ipv4.conf.all.accept_source_route = 0 to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rule sysctl_net_ipv4_conf_all_accept_source_route.

network.syncookies · Warning

What fails it. net.ipv4.tcp_syncookies is 0.

Why it matters. The host has no defence against a SYN flood once its queue is full.

How to fix it. Set net.ipv4.tcp_syncookies to 1. Add net.ipv4.tcp_syncookies = 1 to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rule sysctl_net_ipv4_tcp_syncookies.

network.accept_redirects · Info

What fails it. accept_redirects is 1 for IPv4 (all or default) or IPv6 (all). When the host has no IPv6 (it was booted with IPv6 disabled), IPv4 alone is checked and the note says so.

Why it matters. A neighbour on the network can change the host’s routes with a forged ICMP redirect.

How to fix it. Set accept_redirects to 0 for IPv4 (all and default) and IPv6. Add the three accept_redirects = 0 settings to a file under /etc/sysctl.d/ and run sysctl --system.

Modelled on ComplianceAsCode rules sysctl_net_ipv4_conf_all_accept_redirects, sysctl_net_ipv6_conf_all_accept_redirects.

network.ip_forward · Info

What fails it. net.ipv4.ip_forward is 1.

Why it matters. A host that forwards packets acts as a router.

How to fix it. Set net.ipv4.ip_forward to 0 unless the host is a router. Add net.ipv4.ip_forward = 0 to a file under /etc/sysctl.d/ and run sysctl --system.

Context. Not applicable on a container host, which forwards on purpose: a host where Docker, containerd, CRI-O, Podman, k3s or kubelet is active.

Modelled on ComplianceAsCode rule sysctl_net_ipv4_ip_forward.

network.send_redirects · Info

What fails it. net.ipv4.conf.all.send_redirects is 1.

Why it matters. The host tells neighbours about better routes, which only a router should do.

How to fix it. Set net.ipv4.conf.all.send_redirects to 0 unless the host is a router. Add net.ipv4.conf.all.send_redirects = 0 to a file under /etc/sysctl.d/ and run sysctl --system.

Context. Not applicable on a container host.

Modelled on ComplianceAsCode rule sysctl_net_ipv4_conf_all_send_redirects.

Read from the host’s mount table.

mounts.dev_shm_options · Info

What fails it. /dev/shm lacks nosuid, nodev or noexec.

Why it matters. Shared memory is writable by every user, and without these options programs can run from it.

How to fix it. Mount /dev/shm with nosuid, nodev and noexec. Add nosuid,nodev,noexec to the /dev/shm entry in /etc/fstab and remount it.

Modelled on ComplianceAsCode rules mount_option_dev_shm_nosuid, mount_option_dev_shm_nodev, mount_option_dev_shm_noexec.

mounts.tmp_options · Info

What fails it. /tmp or /var/tmp lacks nosuid, nodev or noexec. Advisory: most cloud images fail it.

Why it matters. Programs cannot then be run or set-uid files used from the world-writable directories.

How to fix it. Mount /tmp and /var/tmp with nosuid, nodev and noexec. Mount a tmpfs on /tmp and /var/tmp with nosuid,nodev,noexec in /etc/fstab (most cloud images do not, so this is advice).

Context. Always Info: most cloud images fail it, and a noexec /tmp breaks some installers.

Modelled on ComplianceAsCode rules mount_option_tmp_nosuid, mount_option_tmp_nodev, mount_option_tmp_noexec, mount_option_var_tmp_noexec.

SELinux or AppArmor, by distribution.

mac.apparmor · Warning

What fails it. AppArmor is not enabled.

Why it matters. AppArmor confines what a compromised service can reach.

How to fix it. Enable AppArmor. Install and enable apparmor, then reboot.

Context. Not applicable, reason distro, on every distribution but Debian and Ubuntu.

Modelled on ComplianceAsCode rule apparmor_configured.

mac.selinux · Warning

What fails it. SELinux is disabled or permissive.

Why it matters. SELinux confines what a compromised service can reach.

How to fix it. Set SELinux to enforcing. Set SELINUX=enforcing in /etc/selinux/config, relabel if needed and reboot.

Context. Warning on RHEL, AlmaLinux, Rocky Linux and CentOS, which enforce by default, and on Amazon Linux 2027 and later. Info on Amazon Linux 2023 and 2, whose default is permissive. Not applicable, reason distro, on Debian and Ubuntu.

Modelled on ComplianceAsCode rules selinux_state, selinux_not_disabled.

Read from the service and port inventories the agent already sends, not from new reads on the host.

services.rsh · Critical

What fails it. TCP 512, 513 or 514 is listening, at any bind scope, except a TCP 514 held by rsyslogd or syslog-ng (syslog over TCP uses 514 too). When 514 is the only port listening and the agent could not name its process, the check reads Not measured instead of failing.

Why it matters. rsh, rlogin and rexec authenticate by host and send data in clear text.

How to fix it. Stop and remove the rsh server. Remove the rsh server package and its sockets.

Modelled on ComplianceAsCode rules service_rsh_disabled, package_rsh-server_removed.

services.telnet · Critical

What fails it. TCP 23 is listening, at any bind scope. Telnet is started by a socket, so no service unit shows it: the check reads the ports.

Why it matters. Telnet sends everything, passwords included, in clear text.

How to fix it. Stop and remove the telnet server. Remove the telnet server package and its socket (telnet.socket).

Modelled on ComplianceAsCode rules service_telnet_disabled, package_telnet-server_removed.

services.ftp · Warning

What fails it. vsftpd.service, proftpd.service or pure-ftpd.service is active with TCP 21 open on every interface.

Why it matters. FTP sends passwords in clear text.

How to fix it. Use SFTP and stop the FTP server. Stop and disable the FTP service, or move to SFTP.

Modelled on ComplianceAsCode rule service_vsftpd_disabled.

services.snmp · Warning

What fails it. snmpd.service is active with UDP 161 open on every interface.

Why it matters. SNMP v1 and v2c send community strings in clear text and expose host details.

How to fix it. Bind snmpd to localhost or restrict it with a firewall, or disable it. Set agentaddress 127.0.0.1 in snmpd.conf, or stop and disable snmpd.

Modelled on ComplianceAsCode rule service_snmpd_disabled.

services.tftp · Warning

What fails it. UDP 69 is listening at any bind scope (RHEL’s tftp.socket holds it while the service is inactive), or tftpd-hpa.service is active.

Why it matters. TFTP has no authentication.

How to fix it. Stop and disable the TFTP server. Stop and disable tftp.socket or tftpd-hpa.service.

Modelled on ComplianceAsCode rule service_tftp_disabled.

A discovery service is listening on every interface

Section titled “A discovery service is listening on every interface”

services.discovery · Info

What fails it. avahi-daemon.service is active with UDP 5353 open on every interface, or cups.service is active with TCP 631 open on every interface.

Why it matters. A server has no use for service discovery or print sharing, and both widen what it exposes.

How to fix it. Stop and disable avahi and cups on a server. Stop and disable avahi-daemon and cups.

Modelled on ComplianceAsCode rules service_avahi-daemon_disabled, service_cups_disabled.

Read from journald’s configuration and the service inventory.

logging.persistent_journal · Warning

What fails it. journald keeps logs only in memory (Storage=volatile or none, or auto or unset without /var/log/journal) and neither rsyslog.service nor syslog-ng.service is active. Amazon Linux 2023’s journald-only default passes.

Why it matters. Logs vanish at reboot, when they are most needed.

How to fix it. Keep the journal on disk (Storage=persistent) or forward it to rsyslog or syslog-ng. Create /var/log/journal (or set Storage=persistent in /etc/systemd/journald.conf) and restart journald.

Modelled on ComplianceAsCode rule journald_storage.

logging.auditd · Info

What fails it. auditd.service is not active.

Why it matters. Without the audit daemon the kernel’s audit records are not kept.

How to fix it. Install and start auditd. Install auditd (or audit) and enable it.

Modelled on ComplianceAsCode rule service_auditd_enabled.

Read from the package manager’s configuration.

updates.signature_check · Critical

What fails it. Package signature checking is off: gpgcheck=0 in the main configuration or in an enabled repository, apt AllowUnauthenticated true, or a [trusted=yes] source. Repository ids and URLs are never sent, only counts.

Why it matters. Anyone who can alter a mirror or a connection can install their own packages.

How to fix it. Turn signature checking on. Set gpgcheck=1 in the repository files (dnf, yum) or remove AllowUnauthenticated and [trusted=yes] (apt).

Modelled on ComplianceAsCode rules ensure_gpgcheck_globally_activated, ensure_gpgcheck_never_disabled, apt_conf_disallow_unauthenticated.

Automatic security updates are not installed

Section titled “Automatic security updates are not installed”

updates.automatic_security · Info

What fails it. No automatic updates are installed: unattended-upgrades with apt-daily-upgrade.timer enabled on Debian and Ubuntu, dnf-automatic applying updates (or its install timer) on the RHEL family and Amazon Linux 2023.

Why it matters. Fixes wait for someone to apply them.

How to fix it. Install and enable automatic security updates. Install unattended-upgrades and enable apt-daily-upgrade.timer (Debian, Ubuntu), or install dnf-automatic and enable its timer with apply_updates = yes.

Context. Not applicable, reason distro, on Amazon Linux 2 and CentOS Linux 7, which have no dnf: both are past their vendor’s support, and the operating system end of life finding is the action there.

Modelled on ComplianceAsCode rules timer_dnf-automatic_enabled, dnf-automatic_security_updates_only.

Read from modprobe’s configuration and the loaded modules.

Uncommon network protocols are not disabled

Section titled “Uncommon network protocols are not disabled”

modules.uncommon_protocols · Info

What fails it. dccp, sctp, rds or tipc is not disabled (install … /bin/true, /bin/false or a blacklist). The ones loaded are named.

Why it matters. Rarely used protocols have a history of kernel flaws, and a server that does not use them can refuse to load them.

How to fix it. Disable dccp, sctp, rds and tipc. Add install <module> /bin/false lines for them to a file under /etc/modprobe.d/.

Modelled on ComplianceAsCode rules kernel_module_dccp_disabled, kernel_module_sctp_disabled, kernel_module_rds_disabled, kernel_module_tipc_disabled.

Read from the service inventory and ufw’s configuration.

firewall.host_firewall · Warning

What fails it. None of firewalld.service, nftables.service, iptables.service or netfilter-persistent.service is active, and ufw is not enabled.

Why it matters. A host firewall limits what a mistake in a service’s binding exposes.

How to fix it. Enable a host firewall (firewalld, nftables, ufw or iptables). Enable ufw (Debian, Ubuntu) or firewalld (RHEL family) with a default-deny inbound policy.

Context. Info on a cloud host, where security groups do the job; Warning elsewhere. The agent reads no firewall rules.

Modelled on ComplianceAsCode rules service_firewalld_enabled, service_nftables_enabled, check_ufw_active.

Read from the PAM stacks and their configuration.

pam.lockout · Info

What fails it. No PAM stack uses pam_faillock (or pam_tally2 with a deny), or a stack that uses one allows more than 10 failed logins before it locks. A stack’s deny is the one on its module line, else /etc/security/faillock.conf’s, else pam_faillock’s default of 3.

Why it matters. Without lockout, passwords can be guessed at the login prompt.

How to fix it. Configure pam_faillock with deny 10 or less. Configure pam_faillock in the auth stack and set deny = 5 in /etc/security/faillock.conf.

Context. Not applicable, reason key-only SSH, when SSH accepts keys only; or no sshd, without sshd. Not measured while the SSH settings it depends on are missing.

Modelled on ComplianceAsCode rule accounts_passwords_pam_faillock_deny.

pam.min_length · Info

What fails it. The smallest minlen among the PAM stacks that use pam_pwquality (each from its module line, else /etc/security/pwquality.conf.d/ then pwquality.conf), or PASS_MIN_LEN when none is set, is below 12.

Why it matters. Short passwords are quick to guess.

How to fix it. Require at least 12 characters (pam_pwquality minlen). Set minlen = 12 in /etc/security/pwquality.conf.

Context. Not applicable on key-only SSH, as Failed logins do not lock the account.

Modelled on ComplianceAsCode rule accounts_password_pam_minlen.

pam.nullok · Info

What fails it. nullok is in the PAM auth stack, which is Ubuntu’s shipped default.

Why it matters. PAM then accepts an empty password for an account that has one. Empty password is the Critical check.

How to fix it. Remove nullok from the PAM auth stack. Remove nullok from the pam_unix line in the auth stack.

Modelled on ComplianceAsCode rule no_empty_passwords.