File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -375,10 +375,25 @@ jenkins_builds ALL=NOPASSWD: /usr/bin/podman
375375 !have_sys_user.(suse|sles|opensuse)::
376376 "useradd -u 3 sys" contain => in_shell;
377377
378+ linux::
379+ "sshd -T 2>/dev/null | grep -qiE '^PermitRootLogin no'"
380+ depends_on => { "sshd_restarted" },
381+ contain => in_shell,
382+ comment => "Verify PermitRootLogin is disabled";
383+ "sshd -T 2>/dev/null | grep -qiE '^PasswordAuthentication no'"
384+ depends_on => { "sshd_restarted" },
385+ contain => in_shell,
386+ comment => "Verify PasswordAuthentication is disabled";
387+ "sshd -T 2>/dev/null | grep -qiE '^(KbdInteractive|ChallengeResponse)Authentication no'"
388+ depends_on => { "sshd_restarted" },
389+ contain => in_shell,
390+ comment => "Verify KbdInteractiveAuthentication (OpenSSH 8.7+) or ChallengeResponseAuthentication (older) is disabled";
391+
378392 services:
379393 sshd_hardened::
380394 "sshd"
381395 service_policy => "restart",
396+ handle => "sshd_restarted",
382397 comment => "Restart sshd to apply hardened configuration";
383398 any::
384399 "fail2ban"
You can’t perform that action at this time.
0 commit comments