Hub rules-ubuntu

rules-ubuntu

v3 public Verified

Ubuntu

Ubuntu is a popular Linux distribution based on Debian. These rules govern system security, administrative safety, and configuration best practices for AI agents.

@sigmashakeinc 6 pulls 24 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-ubuntu →
Severity
22 error 2 warn 0 info
demo.cast
Ubuntu is a popular Linux distribution based on Debian. These rules govern system security, administrative safety, and configuration best practices for AI agents.

Rules index

24 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

ubuntu

no-apt-key-add error ask

RISK: 'apt-key' is deprecated in Ubuntu 22.04 and removed in 24.04; keys placed in the global trusted keyring can sign packages from ANY repo, breaking the per-repo trust boundary. FIX: write the dearmored key to /etc/apt/keyrings/<name>.gpg and reference it with 'signed-by=/etc/apt/keyrings/<name>.gpg' in the .sources / .list entry.

Rule source requires an active Pro or Enterprise subscription.
no-apt-source-without-signed-by error log

RISK: An apt source without 'signed-by=' falls back to the global /etc/apt/trusted.gpg* keyrings, so any key on the system can authenticate this repo's packages — defeating per-repo trust. FIX: write 'deb [signed-by=/etc/apt/keyrings/<vendor>.gpg] https://… suite component'.

Rule source requires an active Pro or Enterprise subscription.
no-chmod-world-writable error ask

RISK: World-writable system paths let any local user replace binaries, configs, or scripts that root later executes — a classic local privilege-escalation vector. FIX: grant the minimum needed mode (typically 644 for files, 755 for dirs) and use group ownership instead of world-write.

Rule source requires an active Pro or Enterprise subscription.
no-curl-pipe-bash error ask

RISK: Piping a remote script straight into a shell runs unverified, unsigned code as your user (or root) — partial downloads or a compromised host can execute destructive commands. FIX: Download to a file, inspect/checksum it, then run: 'curl -fsSL URL -o setup.sh; less setup.sh; bash setup.sh'.

Rule source requires an active Pro or Enterprise subscription.
no-disable-apparmor error block

Disabling AppArmor removes mandatory access control protections that confine processes to their expected behavior. Keep AppArmor enforcing in production.

Rule source requires an active Pro or Enterprise subscription.
no-disable-ufw error ask

Disabling the firewall (UFW/iptables) exposes all ports to the network. Ensure firewall rules are preserved and only temporarily bypassed if absolutely necessary.

Rule source requires an active Pro or Enterprise subscription.
no-disable-unattended-upgrades error log

RISK: Disabling unattended-upgrades stops automatic delivery of Ubuntu security (USN) patches — historically the only reason kernel/openssl/xz CVEs were closed before exploitation in fleet machines. FIX: keep 'APT::Periodic::Unattended-Upgrade "1"' and scope which origins auto-install via 'Unattended-Upgrade::Allowed-Origins' instead of disabling.

Rule source requires an active Pro or Enterprise subscription.
no-enable-unprivileged-userns error ask

RISK: Re-enabling unprivileged user namespaces (or disabling AppArmor's userns restriction added in Ubuntu 23.10/24.04) exposes the kernel to bugs like CVE-2024-1086 (nf_tables LPE, actively exploited in ransomware). FIX: leave the restriction in place; grant only the specific binary that needs it via 'aa-genprof'/profile, or use 'unshare' under a confined profile.

Rule source requires an active Pro or Enterprise subscription.
no-fstab-nosuid-removed warning log

RISK: Mounting /tmp, /home, /var, or /dev/shm without 'nosuid' (and ideally 'noexec','nodev') lets an attacker drop a SUID binary in a writable mount and gain root — a CIS Ubuntu Benchmark hardening control. FIX: add 'nosuid,nodev' (and 'noexec' where feasible) to the mount options.

Rule source requires an active Pro or Enterprise subscription.
no-nopasswd-sudo error ask

NOPASSWD in sudoers removes the password requirement for sudo, allowing privilege escalation without authentication. Require passwords for all sudo calls.

Rule source requires an active Pro or Enterprise subscription.
no-pam-nullok error block

RISK: 'nullok' on pam_unix lets accounts with an empty password hash log in with no password — any account whose hash field is blanked becomes a passwordless backdoor. FIX: remove the 'nullok' option; require a password (or key) for every account.

Rule source requires an active Pro or Enterprise subscription.
no-pam-permissive error log

pam_permit.so grants authentication to all users without verification — it bypasses all password checks. Use this only in explicitly isolated environments.

Rule source requires an active Pro or Enterprise subscription.
no-passwd-root-direct error ask

Directly setting or changing the root password is a high-impact operation that can lock out other administrators. Use sudo and document the change.

Rule source requires an active Pro or Enterprise subscription.
no-read-etc-shadow error block

/etc/shadow contains hashed passwords for all system accounts. Reading this file enables offline password cracking. Access via PAM or getspent() for legitimate use.

Rule source requires an active Pro or Enterprise subscription.
no-rm-rf-root error block

RISK: 'rm -rf /' (or with --no-preserve-root) wipes the entire filesystem; an unset variable in a script (e.g. 'rm -rf $UNSET/') turns this into 'rm -rf /'. FIX: target a specific absolute path, quote variables, and use 'set -u' so unset vars abort the script.

Rule source requires an active Pro or Enterprise subscription.
no-selinux-disable error block

Disabling SELinux removes mandatory access control that prevents privilege escalation and confines processes. Set to permissive mode for debugging, not disabled.

Rule source requires an active Pro or Enterprise subscription.
no-ssh-passwordauth error log

SSH password authentication is vulnerable to brute-force attacks. Use key-based authentication: set 'PasswordAuthentication no' and deploy SSH keys.

Rule source requires an active Pro or Enterprise subscription.
no-ssh-permitrootlogin error block

PermitRootLogin yes allows direct root SSH logins — brute-forceable and leaves no audit trail. Set 'PermitRootLogin no' and use a regular account with sudo.

Rule source requires an active Pro or Enterprise subscription.
no-sudoers-nopasswd error log

NOPASSWD in sudoers grants passwordless privilege escalation. Restrict it to specific commands only: 'user ALL=(ALL) NOPASSWD: /usr/bin/specific-cmd'

Rule source requires an active Pro or Enterprise subscription.
no-suid-setgid error ask

Setting the SUID/SGID bit allows a program to run with the owner's (often root's) privileges regardless of who executes it — a common privilege escalation vector. Avoid SUID/SGID on custom binaries.

Rule source requires an active Pro or Enterprise subscription.
no-systemd-no-newprivileges-false warning log

RISK: Setting NoNewPrivileges=false lets the unit (and its children) gain privileges via SUID/file capabilities — needed only for legitimate setuid helpers, otherwise it widens the blast radius of any RCE in the service. FIX: remove the line (default is false but you should explicitly set 'NoNewPrivileges=true' on hardened units).

Rule source requires an active Pro or Enterprise subscription.
no-systemd-world-writable-service error log

Systemd service units that run as root and execute scripts from /tmp or download-and-execute patterns are common persistence and privilege escalation vectors.

Rule source requires an active Pro or Enterprise subscription.
no-visudo-bypass error block

Editing /etc/sudoers directly can corrupt the file and lock you out. Always use 'visudo' which validates syntax before saving.

Rule source requires an active Pro or Enterprise subscription.
no-world-writable-cron error block

World-writable cron files allow any user to modify scheduled jobs, enabling privilege escalation. Cron files should be owned by root with mode 600 or 644.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
8f6ee8c94f31b4cc2aa415a4d29a8be9bc7c93777d2a97f3764d3b1c337fd1ac
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-ubuntu/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-ubuntu. The published version only bumps when a maintainer resyncs.

No commit history available.