Rule to collect events for adding a user to a group
A successful usermod command has been detected in the system log files.
A user was added to an existing group. This monitor allows system administrators to track account/group creation and deletion.
The description of the alert and/or the output data item contains information on the event encountered. If the activity appears suspicious, please check the associated event details and any other events that happened around the time of this event.
Target | Microsoft.ACS.Linux.RHEL.5.ACSEndPoint |
Category | EventCollection |
Enabled | True |
Alert Generate | False |
Remotable | True |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
EventDS | DataSource | Microsoft.Unix.SCXLog.Privileged.Datasource | Default |
WA | WriteAction | Microsoft.ACS.Unix.SecureEventLogWriter | Default |
<Rule ID="Microsoft.ACS.Linux.RHEL.5.Adding.User.To.Group" Enabled="true" Target="Microsoft.ACS.Linux.RHEL.5.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] Redhat5 UserAddToGroup True -->
<!-- [INPUT] Oct 14 20:04:39 scxom64-rhel52-03 usermod[13123]: add `tempuser' to group `tempgroup' -->
<!-- [EXPECTED] date="Oct 14 20:04:39"; hostname="scxom64-rhel52-03"; process="usermod"; processId="13123"; clientUser="tempuser"; groupName="tempgroup" -->
<RegExpFilter>\s+usermod\[[[:digit:]]+\]: add `\S+' to group `\S+'</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+(?'process'usermod)\[(?'processId'\d+)\]: add `(?'clientUser'\S+)' to group `(?'groupName'\S+)'</RegExp>
<EventType>1</EventType>
<EventId>27004</EventId>
<BackrefOverrides>sessionName="User added to group"</BackrefOverrides>
</WriteAction>
</WriteActions>
</Rule>