Read the SSH configuration sshd and ssh really use [10m] - #29
Closed
jpawlowski wants to merge 2 commits into
Closed
jpawlowski wants to merge 2 commits into
jpawlowski wants to merge 2 commits into
Conversation
The probes read sshd_config and sshd_config.d/*.conf under /etc/ssh. Include can pull in any file (macOS reads /etc/ssh/crypto.conf), the FreeBSD package and appliances use /usr/local/etc/ssh, and a daemon started with -f reads another file entirely. And since OpenSSH 10.4, sshd -T and sshd -G print directive names in mixed case (PermitRootLogin), so a filter like grep '^permitrootlogin ' finds nothing and the security and fleet audits read an empty config. New rules/ssh-config.md: - one sshd probe that takes a -f from the running daemon, tries sshd -G (OpenSSH 9.3+, no host keys needed) and falls back to sshd -T, and lists every file read (sshd -dd); - the ssh -v -G client probe, per account that connects out; - grep -i on every filter over that output. The security audit's fallback and weak-algorithm check and the fleet audit's sshd probe use grep -i. The security audit reports a server's SSH client (StrictHostKeyChecking no, a /dev/null known-hosts file). rules/<family>.md name sshd's unit, config directory, auth log, checksum tool and job scheduler per OS. CLAUDE.md points to the rule. Tested against a local sshd (OpenSSH 10.3) with an Include outside sshd_config.d and a daemon started with -f. The mixed case of 10.4 is taken from the upstream commit (f6acdce690), not tested. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 19, 2026
# Conflicts: # .claude/skills/heinzel-fleet-audit/references/probes.md # .claude/skills/heinzel-security/references/ssh.md
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom: Since OpenSSH 10.4,
sshd -TprintsPermitRootLogininstead ofpermitrootlogin, so the audits'grep '^permitrootlogin 'finds nothing and judges sshd settings they never saw. AnIncludeoutsidesshd_config.d, FreeBSD's/usr/local/etc/sshand a daemon started with-fare missed too; details in #28.Change: New
rules/ssh-config.md: one sshd probe that carries a-ffrom the running daemon over, triessshd -Gand falls back tosshd -T, and lists every file read; thessh -v -Gclient probe per account that connects out;grep -ion all such output. The security and fleet audits filter case-insensitively, and the security audit reports a server's SSH client.rules/<family>.mdname sshd's unit, paths, log and checksum tool.CLAUDE.mdpoints to the rule.Size: Split out of #14, which now builds on it; independent of #13.
Verified: guard test matrix 551 passed, 0 failed. Probes run against a local OpenSSH 10.3 sshd with an
Includeoutsidesshd_config.dand a-fdaemon.An AI agent wrote this text in my name. I know that is problematic.
Part of #27.
Closes #28.