Files
nuclei-templates/code/linux/audit/ssh-hostbasedauth-disabled.yaml

46 lines
1.7 KiB
YAML
Raw Normal View History

id: ssh-hostbasedauth-disabled
2025-06-12 17:43:35 +05:30
info:
2025-06-12 17:43:35 +05:30
name: Ensure SSH HostbasedAuthentication - Disabled
author: Th3l0newolf
2025-05-15 19:08:01 +05:30
severity: high
description: |
2025-06-12 17:43:35 +05:30
The HostbasedAuthentication parameter determines whether SSH authentication is permitted using trusted hosts, based on entries in .rhosts or /etc/hosts.equiv, in combination with successful public key authentication from the client host.
remediation: |
Edit /etc/ssh/sshd_config to set 'HostbasedAuthentication no' and restart SSH service with 'sudo systemctl restart sshd'.
2025-05-15 19:08:01 +05:30
reference:
- https://www.cisecurity.org/benchmark/ubuntu_linux
2025-06-12 17:43:35 +05:30
- https://docs.datadoghq.com/security/default_rules/def-000-fqw/
metadata:
verified: true
2025-08-28 23:41:32 +05:30
tags: cis,local,ssh,linux,audit,ubuntu,benchmark
self-contained: true
code:
- engine:
- bash
2025-06-12 17:43:35 +05:30
args:
- "-c"
- |
SSHD_CONFIG="/etc/ssh/sshd_config"
# Check if the parameter is set to yes (bad)
if grep -i '^\s*HostbasedAuthentication\s\+yes' "$SSHD_CONFIG" >/dev/null; then
current_value=$(grep -i '^\s*HostbasedAuthentication' "$SSHD_CONFIG" | head -1 | tr -d '\n')
echo "[cis-ssh-hostbasedauth-disabled:Policy-Fail] [$current_value] [CIS_FAIL] [medium]"
else
echo "[cis-ssh-hostbasedauth-disabled:Policy-Pass] [HostbasedAuthentication no or not set] [CIS_PASS] [medium]"
fi
matchers:
- type: word
2025-05-15 19:08:01 +05:30
name: policy-pass
words:
- "Policy-Pass"
2025-05-15 19:08:01 +05:30
- type: word
2025-06-11 23:43:25 +05:30
name: policy-fail
words:
- "Policy-Fail"
2025-08-29 10:06:03 +00:00
# digest: 490a004630440220143cf5a634bf8bfdd48a2dd1285e72edce7ba02474d4c4eb3e848c2f1790093102207c2cf4247a5fe9536dde6756ef936b79aeb786b9c7311dd0461daf36f54ea233:922c64590222798bb761d5b6d8e72950