Skip to main content

daedalus (template)

Starter repository for daedalus: one CLI, many small scripts, each with tests.

daedalus <name> [args...]        # run a script
daedalus <category> [category...]  # list scripts in the categories (AND)
daedalus --list                  # list everything

Install, usage, and development · SPEC (how the repo is maintained) · CHANGELOG

Available scripts

Script Type Categories What it does
dir-status Python git-tools Git repository status table over a directory, recursive and read-only: branch, upstream sync, staged/modified/untracked counts; default target ~/repositories, falls back to the current directory, prints no repo found when neither holds a repository; --fetch syncs every repo first; ported from repos.sh
gpgtools Python gpg YubiKey GPG/SSH helpers: initialize (gnupg readiness check + install), initialize_yubikey (fresh machine, steps 1-4), send_pubkey (resolve key, verify possession, append to a server), store_publickey (install the key from the machine being granted access), configure_ssh (marker-managed per-host ssh block)
hello Python test Prints a hello line and the daedalus version
hello_bash Bash test Sample bash script through the shared help() interface
init Python setup Enable tab completion for daedalus: register argcomplete in bash (appends the managed hook block to ~/.bashrc), idempotent
linux-security-audit Python sec Read-only local Linux security audits, one uniform template per check (evidence plus a probes section listing every command issued, copy-paste ready; a permanent needs-sudo line and column per check - no nothing reached for privileges, yes the check used sudo and got it, yes (failed) in red when the run lacked privileges it needed; needs_sudo JSON string), --json for scripts; thirty-three checks (ssh, accounts,
networking, filesystem, system):
deployed-fail2ban (service states, sshd jail,
maxretry), deployed-fail2ban-coverage (jail list vs listening
auth-log ports: ftp/smtp/pop3/imap/web, networking), removed-cleartext-services (telnet 23/rlogin 513/rsh 514 listeners, ftp 21, networking), no-empty-passwords (shadow password fields, accounts), scoped-sudo-permissions (sudoers user specs, ALL grants
get WARNING, accounts), nologin-service-accounts (system-UID
accounts' shells vs /etc/shells, accounts),
enabled-host-firewall (ufw active, default deny incoming,
scoped allow rules, boot persistence, networking),
disabled-ipv6 (v6 disable flag + use signals,
networking), enabled-syn-cookies (kernel SYN cookie flag,
no skill refs, networking), disabled-source-routing
(accept_source_route v4+v6 all/default knobs, no skill
refs, networking), disabled-icmp-redirects
(accept_redirects v4+v6 all/default knobs, no skill refs,
networking),
sudo-activity-logging (sudoers logging Defaults + journal/auth.log sink, accounts), locked-root-account (root shadow field locked, no hash printed, accounts), strong-password-policy (PAM pwquality minlen 32 + pwhistory reuse, accounts), disabled-password-auth, disabled-root-login (sshd -T effective values, on-disk directives, root authorized_keys counts only), protocol-2-only (OpenSSH version, Protocol directives), session-timeout (ClientAliveInterval/CountMax, LoginGraceTime), disabled-x11-forwarding, disabled-tcp-forwarding, restricted-crypto (ciphers/MACs/KEX deprecations + pinning), enabled-ssh-2fa (Google Authenticator PAM + AuthenticationMethods), reviewed-suid-sgids (SUID/SGID inventory, root-owner/world-writable FAILs, outside-/usr review, filesystem), no-world-writable-files (find -perm -0002 inventory, names up to 10, chmod o-w remediation, filesystem), secure-sensitive-file-perms (stat caps: passwd 644, shadow 640 root:shadow, sshd_config 600, filesystem), sticky-world-writable-dirs (find -perm -0002 directories missing the sticky bit, chmod +t or o-w remediation, filesystem), restricted-shared-mounts (/proc/mounts direct read, nosuid/nodev FAIL, noexec WARNING as owner decision, filesystem), enabled-mandatory-access-controls (AppArmor aa-status enforce/complain counts, SELinux getenforce fallback, system), enabled-unattended-upgrades (apt timers + Periodic config + security origin, system), no-pending-security-updates (apt list --upgradable, security lines FAIL, none WARNING, system), restricted-kernel-knobs (suid_dumpable/kptr/dmesg/ASLR proc/sys reads, system), tightened-firewall-rules (ufw Anywhere allow rules need comments, networking), enabled-timesync (timedatectl synchronized + NTP service, system)
publish Python release Release daedalus to PyPI: guarded chained build (clean tree, exact v<version> tag, PyPI-free version, tooling), twine check, --upload (credentials stay with twine)

Run the sample script:

daedalus hello          # hello from daedalus 0.4.0
daedalus hello_bash me  # hello, me (from daedalus bash)
daedalus hello_bash -h  # usage from hello_bash's help()
daedalus test hello     # same, through the category prefix
daedalus test           # list the scripts in the 'test' category

daedalus --list prints the version, a script / type / categories table, and each description wrapped under each row.

dir-status

One row per git repository found under a directory — recursive, but a found repository is not descended into — with the branch, the upstream sync (N ahead, N behind, up to date, no upstream), and the working-tree counts (N staged, N modified, N untracked, or clean). Every probe reads local refs; nothing touches the network or changes the repositories.

daedalus git-tools dir-status            # scan ~/repositories by default
daedalus git-tools dir-status ~/src       # scan that directory instead
daedalus git-tools dir-status --fetch     # git fetch in every repo first
daedalus dir-status                       # the flat form works too
daedalus git-tools                        # list the scripts in 'git-tools'

With no DIRECTORY, the default target is ~/repositories; when that folder is missing or holds no repository, the current working directory is checked (a notice line goes to stderr); when neither holds one, the script prints no repo found and exits 1. A given DIRECTORY that does not exist is a usage error (exit 2). --fetch runs git fetch in every discovered repository before the probes — sync counts then include this run's fetch (this is the only flag that touches the network); a repo with no remote or a failed fetch is silently probed as without it.

When color is enabled (NO_COLOR unset/empty and FORCE_COLOR or a terminal — the same gate as daedalus --list), yellow highlights what wants attention: a branch other than main/master, a sync other than up to date, and a working tree other than clean. Repo names and headers stay plain; padding is applied before coloring, so a redirected run is byte-identical to the no-color output.

Argument Default Meaning
DIRECTORY ~/repositories, else the current directory Directory to scan recursively for git repositories
--fetch off git fetch in every repository before the status probes

gpgtools

initialize checks that gnupg is ready on this machine and installs what is missing — the gnupg-only half of initialize_yubikey, with no card expectations. Its use is on-site: on a bare server where you are about to run store_publickey --fingerprint, this is the command that makes the gpg-dependent sources work.

daedalus gpgtools initialize             # check gnupg, install when missing
daedalus gpgtools initialize --dry-run   # already ready, or the install command
Argument Default Meaning
--dry-run off Print what would happen (already ready or the install command); change nothing

Exit codes: 0 gnupg ready (installed or already present), 2 package install failed or gpg still unusable after it, 3 gpg missing and no known package manager.

initialize_yubikey runs the fresh-machine flow for YubiKey-backed GPG and SSH (steps 1-4 of the wiki guide): install gnupg when missing, check the card, fetch the public key from the card's URL field, and write the gpg-agent SSH config. Steps 5-7 are per-server and covered by the subcommands below.

daedalus gpgtools                         # overview of the subcommands
daedalus gpgtools initialize_yubikey      # prepare this machine
daedalus gpgtools initialize_yubikey --dry-run   # print the plan only
Argument Default Meaning
--dry-run off Print the plan, write nothing
--gnupg-home DIR GNUPGHOME or ~/.gnupg Which GnuPG home to configure

Exit codes: 0 ready, 2 package install failed, 3 gpg missing and no known package manager, 4 no card found, 5 public-key fetch did not pair the keyring, 6 keyring unpaired and the card carries no URL.

send_pubkey covers guide steps 5-6 for one server: resolve the SSH public key from one of five sources, prove possession of the private half with a challenge signature (the YubiKey itself signs; PIN prompts go to the user), then append the line to the target's authorized_keys — idempotent, fingerprint-checked against stores, and nothing is sent when verification fails.

daedalus gpgtools send_pubkey --yubikey you@server
daedalus gpgtools send_pubkey --fingerprint <FP> you@server
daedalus gpgtools send_pubkey --url https://keys.openpgp.org/vks/v1/by-fingerprint/<FP> you@server
daedalus gpgtools send_pubkey --pubkey "ssh-ed25519 AAAA... comment" you@server
daedalus gpgtools send_pubkey --file /media/usb/yubikey_auth.pub you@server
daedalus gpgtools send_pubkey --yubikey --dry-run you@server   # resolve only
Argument Default Meaning
--yubikey — Key from the plugged YubiKey via gpg-agent (must be the only agent key)
--url URL — Armored OpenPGP public key at a URL ([A] subkey is exported)
--fingerprint FP — Searched: local keyring → keys.openpgp.org → keyserver.ubuntu.com
--pubkey LINE — The literal SSH public key line
--file PATH — File holding the key line, e.g. a .pub from a USB stick (no network, no gpg)
--no-verify verification on Skip the proof-of-possession signature (explicit risk acceptance)
--dry-run off Resolve and print the key; verify and send nothing

Additional exit codes: 7 ssh to the target failed, 8 no source resolved a key, 10 proof-of-possession verification failed (nothing was sent).

store_publickey is the mirror for the on-site bootstrap: run it on the machine that access is being granted to — a server with ssh password authentication disabled that no key authorizes yet, where you are logged in at the console. It resolves the same five sources and appends the key into this machine's authorized_keys, so the machine holding the YubiKey can ssh in afterwards. There is no proof-of-possession (the private half is, by design, elsewhere); instead both resolve-and-store subcommands print an identity block — line, source, and the key material's SHA-256 — to compare across machines. Existing entries are preserved, nothing is duplicated, and directory/file modes are forced to 700/600.

daedalus gpgtools store_publickey --file /media/usb/yubikey_auth.pub
daedalus gpgtools store_publickey --fingerprint <FP>
daedalus gpgtools store_publickey --pubkey "ssh-ed25519 AAAA... comment"
daedalus gpgtools store_publickey --file /media/usb/yubikey_auth.pub --dry-run  # print only
Argument Default Meaning
sources — Same five sources as send_pubkey (exactly one required)
--authorized-keys FILE ~/.ssh/authorized_keys Where to install the key
--dry-run off Resolve and print the key; write nothing

Additional exit codes: 8 no source resolved a key.

configure_ssh covers guide step 7 for one host: it writes a marker-managed Host <alias> block into the ssh client config. Outside the markers your config is preserved byte-for-byte; re-runs replace the block (idempotent), and an unmanaged Host with the same alias is refused rather than shadowed. It never connects anywhere.

daedalus gpgtools configure_ssh --alias vault1 --hostname 203.0.113.10 --user admin
daedalus gpgtools configure_ssh --alias vault1 --dry-run   # print only
daedalus gpgtools configure_ssh --alias vault1 --no-fallback  # YubiKey only
Argument Default Meaning
--alias NAME required The ssh Host alias to configure
--hostname HOST the alias HostName value
--user USER ssh's default User value
--pubkey FILE ~/.ssh/yubikey_auth.pub Primary IdentityFile (must exist)
--fallback FILE ~/.ssh/id_ed25519 Fallback IdentityFile, included only when it exists
--no-fallback off Never add a fallback IdentityFile
--config PATH ~/.ssh/config Which ssh client config to edit

Additional exit code: 11 an unmanaged Host with the same alias exists in the config (move it into the managed markers or rename the alias).

ssh-config-summary prints what is enabled where, read-only: one row per managed block — alias, hostname, user, the key id (first 8 chars of the identity's SHA256 fingerprint, material-digest fallback), and the fallback identity. Same id on two rows means the same gpg key guards both hosts.

daedalus gpgtools ssh-config-summary
daedalus gpgtools ssh-config-summary --config FILE
Argument Default Meaning
--config FILE ~/.ssh/config Which ssh client config to read

Shell completion

Bash (and other shells argcomplete supports) completes script names and category labels: daedalus hel + TAB completes hello, daedalus test h + TAB completes hello inside the category, and options complete after -. Run daedalus init once to register the hook in ~/.bashrc (below); see also INSTALL.

init

init is the one-time shell-side setup: it finds the register-python-argcomplete that belongs to this exact daedalus interpreter (so a pipx install wires its own venv, not some other python), appends the hook to ~/.bashrc between managed markers, and tells you how to activate it now. Installing daedalus never touches your shell — this command does. It is idempotent: re-running on an already registered ~/.bashrc writes nothing.

daedalus init                 # register completion in ~/.bashrc
daedalus init --dry-run       # print the block and the target, change nothing
daedalus init --bashrc FILE   # a different bashrc
Argument Default Meaning
--bashrc FILE ~/.bashrc Target file for the managed hook block
--dry-run off Print the block and the target, change nothing

Exit code: 3 when register-python-argcomplete is nowhere to be found (reinstall daedalus — argcomplete is a declared dependency).

publish

publish releases the package itself. Guards first — clean working tree, HEAD exactly tagged v<version> (the version from pyproject.toml), the version not yet on PyPI, and build + twine available in the running interpreter — then a chained build (the sdist must rebuild the wheel, SPEC item 9.2.1) and twine check. Without --upload it stops there and prints the artifacts; with --upload it uploads exactly this version's sdist and wheel. Credentials never touch the script: twine prompts or reads ~/.pypirc (username __token__, your PyPI API token).

daedalus publish             # build + check, print next step
daedalus publish --upload    # ... and upload to PyPI

Exit codes: 2 not run from a checkout, 3 dirty tree, 4 not exactly tagged v<version>, 5 build/twine missing, 6 version already on PyPI (or PyPI unreachable), 7 build failed, 8 twine check failed, 9 upload failed.

linux-security-audit

linux-security-audit runs read-only security audits of the local Linux host (one hardening decision each, from the linux-server-hardening checklist) and prints every check through one uniform template: verdict banner, check, category, title, host, status, summary (wrapped to its own column within the terminal width; the values a probe parsed - counts, paths, states - render light blue under the color gate, so they read apart from the hardcoded prose), probes (every command the audit issued, one per line, dollar-prefixed - the tldr convention - cyan when the color gate allows, plain and copy-paste under NO_COLOR, never wrapped; the JSON form carries the same shell-joined strings in a probes array), evidence and remediation (items wrapped so the enumeration numbers stay a clean left column), skill reference. Every block carries a permanent needs-sudo: line after host: and the all/ category tables a needs-sudo column - the tri-state: no (no probe needed privileges), yes (the check needed privileges and got them - a denied probe the sudo -n twin answered, or a sudo leg that replied), yes (failed) in red (the run lacked privileges the check needed; an INFO hint follows to re-run scoped with sudo daedalus). A denied probe whose sudo -n twin exists is dropped from the probes list (the twin line carries the command - the marked duplicate was noise); a twin-less denial keeps its # needs sudo marker, and sudo -n lines print as issued, never marked; the JSON carries the same list plus the exact display string in a "needs_sudo" field. Every check carries a one-word category tag for its area (ssh, accounts, networking, filesystem) and a severity (info, low, medium, high, critical; disabled-password-auth, protocol-2-only, deployed-fail2ban, deployed-fail2ban-coverage, enabled-host-firewall (networking), no-world-writable-files, secure-sensitive-file-perms, and locked-root-account are critical, disabled-root-login, restricted-crypto, enabled-ssh-2fa, no-empty-passwords, strong-password-policy, sudo-activity-logging, scoped-sudo-permissions, nologin-service-accounts, enabled-syn-cookies, disabled-source-routing, disabled-icmp-redirects, removed-cleartext-services, reviewed-suid-sgids, sticky-world-writable-dirs, and restricted-shared-mounts, enabled-mandatory-access-controls, enabled-unattended-upgrades, no-pending-security-updates, and restricted-kernel-knobs high, session-timeout, disabled-x11-forwarding, disabled-tcp-forwarding, disabled-ipv6, enabled-timesync, and tightened-firewall-rules medium), shown on the template's category: and severity: lines, and in the all table and the JSON forms. The banner header states the verdict at a glance (== daedalus linux-security-audit: FAIL ==) and is colored by status — green PASS, red FAIL, yellow WARN, yellow WARNING, cyan SKIP; NO_COLOR disables colors, FORCE_COLOR forces them, else they show on a terminal (the status word is always printed). It changes nothing — sudo is only ever used non-interactively (sudo -n) for the read-out, and file contents of authorized_keys are never printed, only counts. --json prints the same result as an object for scripts, always uncolored.

daedalus linux-security-audit                  # overview of the checks
daedalus linux-security-audit --json           # checks list as JSON
daedalus linux-security-audit disabled-password-auth  # audit password auth
daedalus linux-security-audit disabled-root-login       # audit root SSH login
daedalus linux-security-audit disabled-root-login --json
daedalus linux-security-audit protocol-2-only     # audit ssh protocol 2
daedalus linux-security-audit protocol-2-only --json
daedalus linux-security-audit session-timeout      # audit idle/grace limits
daedalus linux-security-audit session-timeout --json
daedalus linux-security-audit disabled-x11-forwarding   # audit X11 fwd
daedalus linux-security-audit disabled-x11-forwarding --json
daedalus linux-security-audit disabled-tcp-forwarding   # audit TCP fwd
daedalus linux-security-audit disabled-tcp-forwarding --json
daedalus linux-security-audit restricted-crypto    # audit ciphers/MACs/KEX
daedalus linux-security-audit restricted-crypto --json
daedalus linux-security-audit enabled-ssh-2fa   # audit SSH 2FA/TOTP
daedalus linux-security-audit enabled-ssh-2fa --json
daedalus linux-security-audit deployed-fail2ban  # audit fail2ban for ssh
daedalus linux-security-audit deployed-fail2ban --json
daedalus linux-security-audit no-empty-passwords # audit empty passwords
daedalus linux-security-audit no-empty-passwords --json
daedalus linux-security-audit scoped-sudo-permissions # audit sudo scope
daedalus linux-security-audit scoped-sudo-permissions --json
daedalus linux-security-audit nologin-service-accounts # audit service shells
daedalus linux-security-audit nologin-service-accounts --json
daedalus linux-security-audit enabled-host-firewall  # audit the host firewall
daedalus linux-security-audit enabled-host-firewall --json
daedalus linux-security-audit disabled-ipv6         # audit the v6 stack
daedalus linux-security-audit disabled-ipv6 --json
daedalus linux-security-audit enabled-syn-cookies   # audit SYN cookies
daedalus linux-security-audit enabled-syn-cookies --json
daedalus linux-security-audit disabled-source-routing  # audit source routing
daedalus linux-security-audit disabled-source-routing --json
daedalus linux-security-audit disabled-icmp-redirects  # audit redirect uptake
daedalus linux-security-audit disabled-icmp-redirects --json
daedalus linux-security-audit deployed-fail2ban-coverage  # audit jail coverage
daedalus linux-security-audit deployed-fail2ban-coverage --json
daedalus linux-security-audit removed-cleartext-services  # audit legacy cleartext services
daedalus linux-security-audit removed-cleartext-services --json
daedalus linux-security-audit reviewed-suid-sgids  # audit SUID/SGID review state
daedalus linux-security-audit reviewed-suid-sgids --json
daedalus linux-security-audit no-world-writable-files  # audit world-writable files
daedalus linux-security-audit no-world-writable-files --json
daedalus linux-security-audit secure-sensitive-file-perms  # audit sensitive file perms
daedalus linux-security-audit secure-sensitive-file-perms --json
daedalus linux-security-audit sticky-world-writable-dirs  # audit sticky bits on shared dirs
daedalus linux-security-audit sticky-world-writable-dirs --json
daedalus linux-security-audit restricted-shared-mounts  # audit noexec/nosuid/nodev partitions
daedalus linux-security-audit restricted-shared-mounts --json
daedalus linux-security-audit enabled-mandatory-access-controls  # audit MAC state
daedalus linux-security-audit enabled-mandatory-access-controls --json
daedalus linux-security-audit enabled-unattended-upgrades  # audit apt auto-updates
daedalus linux-security-audit enabled-unattended-upgrades --json
daedalus linux-security-audit no-pending-security-updates  # audit pending updates
daedalus linux-security-audit no-pending-security-updates --json
daedalus linux-security-audit restricted-kernel-knobs  # audit kernel hardening knobs
daedalus linux-security-audit restricted-kernel-knobs --json
daedalus linux-security-audit tightened-firewall-rules  # audit ufw rule scope
daedalus linux-security-audit tightened-firewall-rules --json
daedalus linux-security-audit enabled-timesync  # audit NTP clock sync
daedalus linux-security-audit enabled-timesync --json
daedalus linux-security-audit sudo-activity-logging # audit sudo logs
daedalus linux-security-audit sudo-activity-logging --json
daedalus linux-security-audit locked-root-account   # audit root lock
daedalus linux-security-audit locked-root-account --json
daedalus linux-security-audit strong-password-policy  # audit PAM pwquality
daedalus linux-security-audit strong-password-policy --json
daedalus linux-security-audit all               # run every check
daedalus linux-security-audit all --json        #   array of full results
daedalus linux-security-audit ssh               # run every check tagged ssh
daedalus linux-security-audit accounts          # run every check tagged accounts
daedalus linux-security-audit ssh --json        #   (any category tag works)
daedalus linux-security-audit all --no-summary  # compact: five-column table

all runs every check and prints a six-column verdict table - name, category, severity, verdict (status-colored like the banner), needs-sudo (tri-state no/yes/yes (failed) in red - whether the check needed privileges and whether the run had them), summary - with long summaries wrapped into the summary column (terminal width, at least 80; parsed values colored light blue there too), one blank line between the rows so each check's wrapped summary reads as its own block; --no-summary drops the summary column for a compact one-line-per-check table. A whole run is timed: took: <n> sec[s] prints after the table, the single-check block ends with the same line, and the JSON forms carry took_seconds (per result, and per all run). The console logs only warnings and above - the logging module's INFO lines (progress, hints) stay out of the way. daedalus linux-security-audit <category> (for example ssh) does the same over that category's checks only - a category run is exactly a filtered all, same table, JSON, and exit code. Every category tag in use is a subcommand, so shell completion offers it. all --json prints every full result object plus the aggregate exit_code, which is the worst result: a FAIL makes all exit 1, a WARN 2, a SKIP 3, and only all-pass runs exit 0.

Checks: disabled-password-auth (critical) — "Disable password authentication entirely", disabled-root-login (high) — "Disable direct root login over SSH", protocol-2-only (critical) — "Enforce SSH protocol 2 only", session-timeout (medium) — "Set session idle timeout and login grace time", disabled-x11-forwarding (medium) — "Disable X11 forwarding", disabled-tcp-forwarding (medium) — "Disable TCP forwarding", restricted-crypto (high) — "Restrict allowed cryptographic ciphers and algorithms", enabled-ssh-2fa (high) — "Enable two-factor authentication for SSH logins", deployed-fail2ban (critical) — "Deploy fail2ban to automatically block brute-force attempts", no-empty-passwords (high, accounts) — "Empty passwords should not be allowed", strong-password-policy (high, accounts) — "Enforce strong password policy via PAM", scoped-sudo-permissions (high, accounts) — "Scope sudo permissions to specific commands only", nologin-service-accounts (high, accounts) — "Assign no-login shells to service accounts", enabled-host-firewall (critical, networking) — "Enable and configure a host-based firewall", disabled-ipv6 (medium, networking) — "Disable IPv6 if your environment does not use it", enabled-syn-cookies (high, networking) — "Enable TCP SYN cookie protection against flood attacks", disabled-source-routing (high, networking) — "Disable IP source routing", disabled-icmp-redirects (high, networking) — "Disable ICMP redirect acceptance", deployed-fail2ban-coverage (critical, networking) — "Deploy fail2ban across all relevant services", removed-cleartext-services (high, networking) — "Remove all legacy cleartext network services", reviewed-suid-sgids (high, filesystem) — "Locate and review all SUID and SGID binaries", no-world-writable-files (critical, filesystem) — "Identify and remediate all world-writable files", secure-sensitive-file-perms (critical, filesystem) — "Verify permissions on all sensitive system files", sticky-world-writable-dirs (high, filesystem) — "Apply sticky bit to all world-writable directories", restricted-shared-mounts (high, filesystem) — "Mount shared partitions with execution and SUID restrictions", enabled-mandatory-access-controls (high, system) — "Enable Mandatory Access Controls via SELinux or AppArmor", enabled-unattended-upgrades (high, system) — "Enable automatic security updates", no-pending-security-updates (high, system) — "Apply pending security updates", restricted-kernel-knobs (high, system) — "Restrict kernel exposure via sysctl knobs", tightened-firewall-rules (medium, networking) — "Scope every firewall allow rule to a documented source", enabled-timesync (medium, system) — "Enable and use network time synchronization", locked-root-account (critical, accounts) — "Lock the root account from direct login", sudo-activity-logging (high, accounts) — "Enable full sudo activity logging".

  • disabled-password-auth — "Disable password authentication entirely": probes the effective sshd -T values for passwordauthentication and kbdinteractiveauthentication (with a sudo -n retry, never prompting) and their on-disk directives.
  • disabled-root-login — "Disable direct root login over SSH": probes the effective sshd -T value for permitrootlogin (with a sudo -n retry, never prompting), every PermitRootLogin directive on disk (sshd_config + sshd_config.d/*.conf), and whether root has authorized_keys (key count only).
  • protocol-2-only — "Enforce SSH protocol 2 only": probes the OpenSSH version (ssh -V; 7.6 removed protocol 1 from the code, so a modern host is protocol 2 only by software and a missing Protocol directive is the correct state) and the effective/on-disk Protocol directives when the version is pre-7.6 or unknown. A legacy Protocol line on a modern host is a WARN: sshd rejects it and sudo sshd -t fails.
  • session-timeout — "Set session idle timeout and login grace time": probes the effective sshd -T values of clientaliveinterval, clientalivecountmax, and logingracetime (with a sudo -n retry, never prompting) and their on-disk directives when the probe fails. Fails when ClientAliveInterval is 0 or above 300 (never disconnecting idle sessions), ClientAliveCountMax above 3, or LoginGraceTime above 60 (the OpenSSH defaults 0/3/120 fail); non-integer values WARN.
  • disabled-x11-forwarding — "Disable X11 forwarding": probes the effective sshd -T value of x11forwarding (with a sudo -n retry, never prompting) and the on-disk X11Forwarding directives when the probe fails. no passes; any other value (the OpenSSH default yes included) is the WARNING verdict (yellow, exit 4): the script runs on unknown servers and cannot know a documented X11 need - the summary says to disable unless one exists. Unset-and-unprobeable warns that the default yes applies.
  • disabled-tcp-forwarding — "Disable TCP forwarding": probes the effective sshd -T value of allowtcpforwarding and the on-disk directives. no passes; any other value (yes, local, remote, local,remote - each leaves one direction open) is the WARNING verdict (yellow, exit 4): the script cannot know whether this server needs tunnels, so it recommends instead of failing; the remediation leads with the tunnel gotcha: AllowTcpForwarding no silently kills ssh -L/ssh -R tunnels (VNC and the like), so confirm nothing tunnels over SSH first (skill item 3.7) and keep yes only with a documented need.
  • restricted-crypto — "Restrict allowed cryptographic ciphers and algorithms" (high): probes the effective sshd -T ciphers, macs, and kexalgorithms (on-disk directives when the probe fails). FAIL names every deprecated item: arcfour/RC4 and *-cbc ciphers; MD5-based, sha1-96-truncated, and ripemd160 MACs; sha1 key exchange (hmac-sha1 and hmac-sha1-etm@openssh.com stay allowed - stock Debian MACs for legacy clients). Clean lists that are not explicitly pinned on disk get the WARNING verdict: pin the three lists so future defaults cannot reintroduce weak algorithms.
  • enabled-ssh-2fa — "Enable two-factor authentication for SSH logins" (high): probes all four layers of Google Authenticator enforcement - the pam_google_authenticator.so module file, its auth required line in /etc/pam.d/sshd, the effective KbdInteractiveAuthentication yes, and AuthenticationMethods publickey,keyboard-interactive:pam (the decision that every login carries a key AND a TOTP). Every missing layer is named in a FAIL; probe failure falls back to the on-disk directives. Known interplay: enabling 2FA requires kbd-interactive yes, which the disabled-password-auth check currently flags - its rule widens only when 2FA is actually enforced.
  • deployed-fail2ban — "Deploy fail2ban to automatically block brute-force attempts" (critical): probes the fail2ban-client binary (the which fallback), the systemctl is-active and is-enabled states of the fail2ban service (not installed, not running, or not surviving a reboot each FAIL; both probes unprobeable WARN), and the sshd jail (fail2ban-client status sshd with a sudo -n retry, never prompting): a server that answers Sorry but the jail 'sshd' does not exist FAILs - fail2ban that does not monitor SSH authentication does not make the decision - while a probe that cannot reach the answer (permission denied, contact refused, with the service already proven active and enabled) WARNs "cannot be judged" instead of a false FAIL. PASS states the jail's maxretry (the defined number of consecutive failures, itself read with a sudo -n retry) and the Total failed counter as live evidence. The remediation carries the skill's topology gotchas: when public access arrives through a proxy, bans can only hit the proxy's IP - add it to ignoreip and do per-client banning on the proxy host against its own logs.
  • no-empty-passwords — "Empty passwords should not be allowed" (accounts; high): reads the shadow database through the runner (cat, sudo -n retry, never prompting), parses every account's password field, and FAILs naming each account whose field is empty - those log in without any password on every path that permits it. Locked or unusable fields (*, !-prefixed) pass; a missing or unobtainable database WARNs ("cannot be judged"); malformed lines are counted in evidence and never fail the run alone. Remediation: usermod -p '*', no nullok in the PAM chains, PermitEmptyPasswords no.
  • strong-password-policy — "Enforce strong password policy via PAM" (accounts; high): reads the password stack and the policy configs directly (they are world-readable; no sudo) — the active pam_pwquality.so line with its options, pwquality.conf plus its pwquality.conf.d drop-ins, pwhistory.conf. Enforces the owner's rule: minimum length 32 (character-class rules deliberately not required), enforcing not 0, and reuse prevention via pam_pwhistory.so (or a legacy pam_unix remember=) with remember at least 5; a conf remember without the module wired does nothing and FAILs as "reuse not prevented". Every missing layer is named in one FAIL; PAM-line options beat conf values; existing passwords stay until their next change.
  • locked-root-account — "Lock the root account from direct login" (accounts; critical): the account half of the root decision (the SSH half is disabled-root-login). Reads the root line of the shadow database through the runner (cat, sudo -n retry) and reports only the field's state - locked (!-prefixed or *) passes; a usable password hash or an empty field FAILs (empty is named as the worse state); the hash value is never printed. Unobtainable, rootless, or unrecognized states WARN. Remediation leads with the lockout guard: prove a named sudo account works before sudo passwd -l root; a * field has no stored hash to restore, so the undo discipline records which form was set.
  • sudo-activity-logging — "Enable full sudo activity logging" (accounts; high): two layers. Policy — the sudoers text (main file plus /etc/sudoers.d/*, one sudo -n read; no sudo binary is a SKIP) must not carry !syslog or !log_allowed in any Defaults line (comma lists included); those flags with no usable logfile= directive FAIL as "logged nowhere". Flow — the sink must show entries: a logfile= directive is tailed, else journalctl -t sudo with an auth.log COMMAND= fallback; zero entries everywhere WARNs (rotated, broken, or unused). Entry bodies are never printed — only counts.
  • scoped-sudo-permissions — "Scope sudo permissions to specific commands only" (accounts; high): parses the sudoers user specs (the same sudo -n read as the logging check): tag prefixes are stripped and a spec is unrestricted when any command token is exactly ALL (alias references count as scoped). Which grants are unrestricted is a fact; whether a scope WOULD SUFFICE for a grantee's work is not — so unrestricted grants never FAIL: they get the WARNING verdict naming each (%group specs expanded with getent members), and a fully scoped policy passes. The visudo rule lives in the remediation: edit only through sudo visudo, then verify with sudo -l <user>.
  • nologin-service-accounts — "Assign no-login shells to service accounts" (accounts; high): a service account is the system-UID class (UID 1 up to UID_MIN from login.defs, default 1000); an interactive shell is one listed in /etc/shells — the host's own definition, not a blacklist (a missing shells file falls back to a named builtin set). All three files are world-readable direct reads: no sudo, no runner. Account-plus-shell is named in the FAIL, every clean account in the PASS count; unreadable or empty account data WARNs. Regular-UID accounts actually used as services are out of scope (documented limitation).
  • enabled-host-firewall — "Enable and configure a host-based firewall" (networking; critical): the ufw probe (ufw status verbose, plain then sudo -n) — OpenSnitch is an application firewall (egress), a different control that never affects this verdict. Status inactive FAILs; active but the unit not enabled at boot FAILs (no rules after a reboot); a default incoming policy other than deny FAILs naming it; allow rules from Anywhere get the WARNING verdict naming each (owner-decides: a public service legitimately allows it; skill item 5.2 demands the documented reason); active, persistent, deny incoming, scoped rules PASS. No ufw binary or an unobtainable status WARNs (a nftables or firewalld ruleset may front the host — unjudgeable).
  • disabled-ipv6 — "Disable IPv6 if your environment does not use it" (networking; medium): the system-wide flag /proc/sys/net/ipv6/conf/all/disable_ipv6 read directly (no sudo); 1 or an absent IPv6 stack PASS. Enabled, the WARNING verdict — owner-decides like the forwarding checks, never FAIL, because only the owner knows whether the environment uses IPv6: use signals named (global scope addresses via ip -6 address, a v6 default route via ip -6 route show default) say "in use, firewall both stacks or disable", their absence says "appears unused — disable it or record the documented need". Both probes failing WARNs; the remediation carries the lockout guard: never disable v6 from a session that arrives over it.
  • enabled-syn-cookies — "Enable TCP SYN cookie protection against flood attacks" (networking; high): a binary kernel fact read directly from /proc/sys/net/ipv4/tcp_syncookies (no sudo, no runner). 1 PASSes; 0 FAILs — Debian-family kernels ship it enabled, so a disabled flag is a deliberate deviation (a documented exception belongs in the summary's owner notes); absent knob SKIPs; unreadable or unparseable WARNs. This control has no skill section yet: the check carries no skill refs and the text block omits the skill ref: line entirely (JSON keeps the empty array). Remediation: /etc/sysctl.d/99-syncookies.conf with net.ipv4.tcp_syncookies=1, then sudo sysctl --system.
  • disabled-source-routing — "Disable IP source routing" (networking; high) and disabled-icmp-redirects — "Disable ICMP redirect acceptance" (networking; high): two checks of the same shape (spec items 27/28, a shared four-knob worker, both without skill refs): all four knobs per check — all and default, v4 and v6 — are direct /proc/sys reads. Any knob 1 FAILs naming its full path (Debian ships these disabled; an enable is a deliberate deviation). All present knobs 0 PASS; an absent v6 pair means no v6 stack and is noted in evidence, never a gap; an absent v4 all-knob SKIPs as nothing to audit; garbage or unreadable values WARN. Remediation: a /etc/sysctl.d/99-*.conf drop-in with all four assignments, then sudo sysctl --system.
  • deployed-fail2ban-coverage — "Deploy fail2ban across all relevant services" (networking; critical): the breadth item the ssh-category deployed-fail2ban check does not carry. The running jail list (fail2ban-client status, plain then sudo -n) is crossed with the listening TCP ports (ss -tln) over a fixed port map — ftp 21, sshd 22, postfix 25/465/587, dovecot/courier pop3/imap 110/995/143/993, web 80/443. Any clear auth-log service listening without a matching jail FAILs naming service and port (sshd included - the overlap with the ssh check is deliberate redundancy); web ports without a nginx/apache jail get the WARNING verdict — which application login logs a jail must read is unknowable from ports, and skill item 6.4's reverse- proxy gotcha rides in the remediation; all covered (or nothing else listening) PASSes. No fail2ban-client FAILs; failed probes WARN.
  • removed-cleartext-services — "Remove all legacy cleartext network services" (networking; high): telnet, rlogin, rsh, and plain FTP have no legitimate reason on a modern server; ssh and SFTP/scp are the replacements (skill items 8.1-8.3: disable the service and its socket, verify the port is gone, prefer not running a service over filtering it). The probe is port-based — the live exposure is the listener, and an inetd/xinetd-hosted service shows as the superserver's port. ss -tln decides; telnet (23) and rlogin (513) FAIL on presence alone (nothing legitimate shares them). TCP 514 is both rsh's shell service and a common remote-syslog port, so an owner probe (ss -tlnp, sudo -n retry) decides: an rsh-family process FAILs naming it, an identified remote syslog (rsyslogd) is noted in evidence and is never a gap, anything else or an unidentifiable owner gets the WARNING verdict — the audit cannot tell rshd from syslog, the owner identifies it. An ftp daemon on 21 gets the WARNING verdict too — the port cannot prove whether explicit FTPS is enforced, so a listening FTP never FAILs; FAIL outranks WARNING when both apply.
  • reviewed-suid-sgids — "Locate and review all SUID and SGID binaries" (filesystem; high): every set-id executable is a potential privilege-escalation path and must be justified; the category's first check, no skill refs (the skill has no filesystem chapter - the template omits the skill-ref line). The probe: find / -xdev -perm -4000/-2000 -printf 'path|mode|uid|gid', plain then sudo -n retry (-xdev scopes it to the root filesystem - other mounts are out of scope and the evidence says so). Non-root-owned set-id files FAIL naming path and uid; world-writable ones FAIL (any user could replace the elevated binary). A path outside the distro-managed prefixes (/usr/bin/, /usr/sbin/, /usr/lib/ - dpkg's integrity domain, presumed stock) gets the WARNING verdict naming it: the owner justifies or strips the bit (chmod u-s / chmod g-s). FAIL outranks WARNING. An empty inventory PASSes: no set-id executable exists.
  • no-world-writable-files — "Identify and remediate all world-writable files" (critical; filesystem; no skill refs as above): every world-writable regular file lets any local user (and any compromised service account) modify it, so none may exist without a documented, approved reason. The probe: find / -xdev -type f -perm -0002 (plain then sudo -n retry, -xdev scope as above; regular files only - sticky-bit directories like /tmp are a different pattern and not this check). Any hit FAILs: the summary and evidence name at most 10 files (mode and uid each) and carry the full count - remediating means chmod o-w (or recording the approved reason), not reading a wall. The remediation warns that a program recreating the file world-writable needs the program fixed, not just the bit. An empty inventory PASSes: no world-writable regular file exists on the root filesystem.
  • secure-sensitive-file-perms — "Verify permissions on all sensitive system files" (critical; filesystem; no skill refs as above): the account file must not exceed 0644, the shadow credentials file must not exceed 0640 with root ownership and the shadow group, the main SSH config must not exceed 0600 - each expected mode is the maximum allowed, every granted bit beyond the cap or a wrong owner/group FAILs named with the actual state, a stricter mode never FAILs. One stat probe covers all three (stat -c '%a|%U|%G|%n', plain then sudo -n retry; the leg with more parseable lines decides; a missing file records "not present" - nothing to mispermission
    • and no tracked file at all SKIPs). The remediation gives the exact chown/chmod fix per file.
  • sticky-world-writable-dirs — "Apply sticky bit to all world-writable directories" (high; filesystem; no skill refs as above): once a directory is world-writable for sharing, the sticky bit is what stops one user deleting or renaming files another user created there - every world-writable directory on the root filesystem must carry it. The probe: find / -xdev -type d -perm -0002 (plain then sudo -n retry; -xdev scope as above - a world-writable tmpfs mount like /tmp is a stated blind spot, not a hidden PASS). Any world-writable directory without the bit (mode & 01000 == 0) FAILs: the summary and evidence name at most 10 directories (path, mode, uid each) and carry the full count, the item 32.3.3 cap convention. All sticky (or an empty inventory) PASSes with the count. The remediation asks the sharing need first: a directory that needs no world-write at all should lose it (chmod o-w), a real share gets chmod +t - and each new world-writable directory needs the bit applied again, children inherit nothing.
  • restricted-shared-mounts — "Mount shared partitions with execution and SUID restrictions" (high; filesystem; no skill refs as above): the user-writable areas - temporary data, variable data, homes - should be mounted noexec, nosuid, nodev so nothing executes, escalates, or mounts devices from them; the candidate list is closed and ordered: /tmp, /var/tmp, /var, /home, /dev/shm. The probe is none - the kernel mount table /proc/mounts is world-readable metadata, read directly (the syn-cookies precedent), so the check runs fully unprivileged (needs-sudo always 'no'); a line with fewer than four fields is skipped, octal escapes are not decoded, and for a mountpoint spanning several lines the LAST line wins (the kernel reports the active mount last). A candidate counts only as an EXACT mountpoint: a path living on another mount (typically the root filesystem, which cannot take these flags wholesale) is out of scope - evidence records it "not a separate mount". A separately mounted candidate missing nosuid or nodev FAILs naming the mount and the missing options (at most 5, no cap convention); missing only noexec is the WARNING verdict - blocking execution from a shared partition is an owner decision (users may legitimately run their own binaries from /home, some distro layouts execute from /var); FAIL outranks WARNING. No candidate being a separate mount PASSes: no separate shared partition exists to restrict. The remediation points at the fstab (or systemd mount unit) options column, then remount or reboot.
  • enabled-mandatory-access-controls — "Enable Mandatory Access Controls via SELinux or AppArmor" (high; system - the first check in a new category for host-wide access policy; no skill refs as above): a MAC system must hold policy beyond standard Unix permissions; on Debian-family AppArmor is the default, SELinux the accepted alternative. Probes: aa-status run with no arguments (binary via the fail2ban override precedent - a which fallback, a nonexistent override means not installed), plain then sudo -n twin when the summary lines do not parse; the parse reads only the summary lines (module loaded, N profiles loaded / in enforce / in complain mode). AppArmor module loaded: 0 profiles loaded -> WARNING (a MAC kernel without policy enforces nothing); enforce > 0 and complain > 0 -> PASS with both counts (mixed modes are the package default); enforce > 0 -> PASS; enforce = 0 but complain > 0 -> WARNING (learning mode, policy learned never enforced). AppArmor absent or its module not loaded -> the SELinux leg decides: getenforce answers Enforcing -> PASS, Permissive -> WARNING (logged, never enforced), Disabled -> FAIL; neither executable -> FAIL (nothing holds policy); unparseable after both legs -> WARN cannot be judged. Remediation: install apparmor + apparmor-profiles, enable apparmor.service, aa-enforce to move complain profiles to enforcement; SELinux instead: selinux-basics + selinux-activate + reboot.
  • enabled-unattended-upgrades — "Enable automatic security updates" (high; system; skill refs items 7.1-7.4 - the first checks with skill refs since the networking batch): unattended-upgrades must carry the apt timers (systemctl is-enabled apt-daily.timer and apt-daily-upgrade.timer), the periodic config (/etc/apt/apt.conf.d/20auto-upgrades, read directly: APT::Periodic::Update-Package-Lists and APT::Periodic::Unattended-Upgrade both "1"), and a security-labeled origin in apt-config dump's Allowed-Origins. A broken piece (timer off, periodic value absent or not 1) FAILs naming it; origins configured without a security label is the WARNING verdict (a custom allow list may be deliberate, item 7.4 wants the security origin); everything holding PASSes.
  • no-pending-security-updates — "Apply pending security updates" (high; system; skill refs items 2.7, 7.5): apt list --upgradable decides (plain, sudo -n twin on failure); a package line whose name/suite token carries a security marker (e.g. stable-security) FAILs - the first 10 named with the full count; updates pending but none security-flagged is the WARNING verdict (the host is behind but no known CVE fix waits); an empty list PASSes.
  • restricted-kernel-knobs — "Restrict kernel exposure via sysctl knobs" (high; system): the closed knob list fs.suid_dumpable (0), kernel.kptr_restrict (>= 1), kernel.dmesg_restrict (1), kernel.randomize_va_space (2) read directly from /proc/sys (the syn-cookies precedent, fully unprivileged, needs-sudo always 'no'); any present knob missing its marker FAILs naming knob, value, and expectation; an absent knob is excluded (an old kernel is a fact, not a violation), all four absent SKIPs; everything compliant PASSes with the values.
  • tightened-firewall-rules — "Scope every firewall allow rule to a documented source" (medium; networking; skill refs items 5.2, 5.5): ufw status verbose (the enabled-host-firewall probe) parsed for rule rows - an allow rule accepting from Anywhere (v4 or the v6 twin) without a trailing comment is the WARNING verdict naming at most 10 with the full count: a broad rule may be the owner's deliberate choice, an unexplained one is a hole worth a second look; no unexplained broad rule PASSes with the rule count; the unobtainable table WARNs (the state question belongs to enabled-host-firewall).
  • enabled-timesync — "Enable and use network time synchronization" (medium; system): timedatectl parse (System clock synchronized + NTP service); active and synchronized PASSes; active but unsynchronized is the WARNING verdict (no server reached yet); inactive or n/a FAILs - TLS validation, TOTP windows, and log ordering all degrade on a free-running clock.
Argument Default Meaning
--json off Print the result as a JSON object instead of the text block

Exit codes are the statuses: 0 pass, 1 fail, 2 warn, 4 warning (a recommendation the owner must decide, e.g. enabled forwarding on an unknown server), 3 skip (nothing to audit — e.g. no sshd, or not Linux); usage errors exit 2 from argparse; all exits with the worst status of the run (FAIL > WARN > WARNING > SKIP > PASS).

Getting started

  1. Clone or copy this template and name the Git remote for your team.
  2. Add a script under python/src/, bash/, powershell/, or batch/ (see SPEC layout); bash scripts implement the shared help() interface (SPEC item 6.10).
  3. Register it in daedalus/registry.py, add a row to the table above, write tests, bump version in pyproject.toml, and run python autotest.py.

hello is the sample script: copy its file, registry entry, README row, and tests to add your own. Unknown names exit with code 2 and suggest close matches.

Metadata

Release files for daedalus-tools 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for daedalus-tools 0.18.0
File Size Uploaded Provenance Actions
daedalus_tools-0.18.0.tar.gz 195.9 kB Without provenance Details for daedalus_tools-0.18.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for daedalus-tools 0.18.0
File Interpreter ABI Platform Actions
daedalus_tools-0.18.0-py3-none-any.whl Python 3 none any Details for daedalus_tools-0.18.0-py3-none-any.whl

Total release size: 501.4 kB

Release files / daedalus_tools-0.18.0.tar.gz

Download URL daedalus_tools-0.18.0.tar.gz
Size 195.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d516337804df660fca9fce3b0758abaa8018ecf3088e5f24e89aaa0b82d2a16e
BLAKE2b-256 checksum
How to use checksums
f08c63619b559a30ee8928f1fb491f5c89314ad433432a195dba7906a08417c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / daedalus_tools-0.18.0-py3-none-any.whl

Download URL daedalus_tools-0.18.0-py3-none-any.whl
Size 305.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d369c6a257bed3e5ff4947f6d5f35708de7799d381467373282887896bdddca5
BLAKE2b-256 checksum
How to use checksums
6f0f7fd27a0ec2a1d772f7fceb256ddb2ae880efbe45cc49073f17dbfabc97dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for daedalus-tools 0.18.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page