Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (7 sloc) 425 Bytes
# Extension Attribute to determine the number of failed login attempts during a specified duration
# See: log help show
searchDuration="24h" # [--last <num>[m|h|d] ]
failedLoginAttempts=$( /usr/bin/log show --last "${searchDuration}" --style syslog --predicate 'eventMessage contains "Failed to authenticate user"' | /usr/bin/wc -l | /usr/bin/tr -d ' ' )
echo "<result>$failedLoginAttempts</result>"
exit 0
You can’t perform that action at this time.