Files
atap/ATAPAuditor/Helpers/ShellScripts/common/5.2.6.sh
T
2026-05-11 09:15:08 +02:00

24 lines
446 B
Bash

#!/usr/bin/env bash
timeout=$(grep -roP "timestamp_timeout=\K[0-9]*" /etc/sudoers* | grep -v "/etc/sudoers.bak")
if [ -n "$timeout" ]; then
timeout=$(echo "$timeout" | grep -oP "[0-9]+$")
fi
if [ -z "$timeout" ]; then
timeout=$(sudo -V | grep -oP "(?<=Authentication timestamp timeout: )\d+")
fi
if [ -z "$timeout" ]; then
timeout=0
fi
timeout=${timeout:-0}
if [ "$timeout" -le 15 ] && [ "$timeout" -gt 0 ]; then
exit 0
else
exit 1
fi