macOS
TMA-MACOS-5.4
Ensure the Sudo Timeout Period Is Set to Zero
高レベル 1自動macos
説明
The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system. This control, along with the control to use a separate timestamp for each tty, limits the window where an unauthorized user, process, or attacker could utilize legitimate credentials that are valid for longer than required. Audit: Requires a 0.0 minute sudo timestamp timeout and /etc/sudoers.d owned by root:wheel. Run as root.
チェック方法
監査方法: シェルコマンド
shell
v=$(/usr/bin/sudo -V 2>/dev/null) || exit 1
c=$(printf '%s\n' "$v" | /usr/bin/grep -c "Authentication timestamp timeout: 0.0 minutes")
o=$(/usr/bin/stat -f '%Su:%Sg' /etc/sudoers.d 2>/dev/null)
if [ "$c" -ge 1 ] && [ "$o" = root:wheel ]; then echo compliant; else echo "timeout-zero=$c owner=$o"; fi- 期待される出力
compliant
修正方法
修正方法: ガイダンスまたは IaC パッチ
Terminal: sudo /usr/sbin/visudo -f /etc/sudoers.d/<configuration file name> ; sudo /usr/sbin/chown -R root:wheel /etc/sudoers.d/.
プロパティ
- オペレーティングシステム
- macos-26
- タグ
- macossystem-access
- 参照
- CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 5.4 Ensure the Sudo Timeout Period Is Set to Zero
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
shell
tmaegis scan --target macos