Failed sudo (Red Hat Enterprise Linux Server 4)

Microsoft.ACS.Linux.RHEL.4.Sudo.Failed (Rule)

Rule to collect events for failed call to sudo

Element properties:

TargetMicrosoft.ACS.Linux.RHEL.4.ACSEndPoint
CategoryEventCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
EventDS DataSource Microsoft.Unix.SCXLog.Privileged.Datasource Default
WA WriteAction Microsoft.ACS.Unix.SecureEventLogWriter Default

Source Code:

<Rule ID="Microsoft.ACS.Linux.RHEL.4.Sudo.Failed" Enabled="true" Target="Microsoft.ACS.Linux.RHEL.4.ACSEndPoint" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="EventDS" TypeID="Unix!Microsoft.Unix.SCXLog.Privileged.Datasource">
<Host>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</Host>
<LogFile>/var/log/secure</LogFile>
<!-- [TYPE] Redhat4 SUDO False -->
<!-- [INPUT] Nov 16 09:59:30 scxrhel4-01 sudo: tst2 : 1 incorrect password attempt ; TTY=pts/0 ; PWD=/home/tst2 ; USER=root ; COMMAND=/bin/cat /etc/sudoers -->
<!-- [INPUT] Nov 16 09:59:42 scxrhel4-01 sudo: tst2 : 2 incorrect password attempts ; TTY=pts/0 ; PWD=/home/tst2 ; USER=root ; COMMAND=/bin/cat /etc/sudoers -->
<!-- [INPUT] Nov 16 09:59:53 scxrhel4-01 sudo: tst2 : 3 incorrect password attempts ; TTY=pts/0 ; PWD=/home/tst2 ; USER=root ; COMMAND=/bin/cat /etc/sudoers -->
<!-- [EXPECTED] date="Nov 16 09:59:30"; hostname="scxrhel4-01"; user="tst2"; clientUser="root"; sessionName="/bin/cat /etc/sudoers" -->
<!-- [EXPECTED] date="Nov 16 09:59:42"; hostname="scxrhel4-01"; user="tst2"; clientUser="root"; sessionName="/bin/cat /etc/sudoers" -->
<!-- [EXPECTED] date="Nov 16 09:59:53"; hostname="scxrhel4-01"; user="tst2"; clientUser="root"; sessionName="/bin/cat /etc/sudoers" -->
<RegExpFilter>: \s*\S+ : [[:digit:]]+ incorrect password attempt(s?) ; TTY=\S+ ; PWD=.* ; USER=\S+ ; COMMAND=.*</RegExpFilter>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="ACS.Unix!Microsoft.ACS.Unix.SecureEventLogWriter">
<RegExp>(?'date'\S+\s+\d+\s+\d+:\d+:\d+)\s+(?:\S+:)?(?'hostname'\S+)\s+.*: \s*(?'user'\S+) : \d+ incorrect password attempt(?:s?) ; TTY=\S+ ; PWD=.* ; USER=(?'clientUser'\S+) ; COMMAND=(?'sessionName'.*)</RegExp>
<EventType>0</EventType>
<EventId>27003</EventId>
<BackrefDefaults>process="sudo"</BackrefDefaults>
</WriteAction>
</WriteActions>
</Rule>