SU 命令成功警报规则

Microsoft.Linux.Universal.LogFile.Syslog.SU.Command.Root.Success.Alert (Rule)

成功“根命令 SU”消息警报规则。

Knowledge Base article:

摘要

在系统日志文件中检测到成功的 “su” 命令。

配置

此规则默认禁用。它可通过针对特定通用 Linux 实例或一组通用 Linux 实例的替代进行启用。如果此规则已启用,则应使用适用于目标 Linux 操作系统和版本的正则表达式模式来替代 RegExpFilter 参数。特定条件的系统日志消息可能因操作系统和版本而异。

原因

可能会通过“su”提升授权用户访问特权帐户。该警报规则允许系统管理员跟踪“su”使用率。

解决方法

警报和/或输出数据项的描述包含有关遇到的事件的信息。如果“su”使用率显得可疑,请检查关联的事件详细信息以及此事件时间附近发生的任何其他事件。

Element properties:

TargetMicrosoft.Linux.Universal.Computer
CategoryEventCollection
EnabledFalse
Alert GenerateTrue
Alert SeverityInformation
Alert PriorityNormal
RemotableTrue
Alert Message
检测到成功根 SU
{0}

Member Modules:

ID Module Type TypeId RunAs 
EventDS DataSource Microsoft.Unix.SCXLog.Privileged.Datasource Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.Linux.Universal.LogFile.Syslog.SU.Command.Root.Success.Alert" Target="Universal!Microsoft.Linux.Universal.Computer" Enabled="false" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<!-- [TYPE] Redhat6 SU True -->
<!-- [INPUT] Dec 6 01:24:06 scxcrd64-rhel6-01 su: pam_unix(su-l:session): session opened for user root by zoyang(uid=504) -->
<!-- [TYPE] Redhat8 SU True -->
<!-- Dec 25 05:36:46 ost64-rh8-01 su[77788]: pam_unix(su:session): session opened for user root by root(uid=1000) -->
<DataSource ID="EventDS" TypeID="Unix!Microsoft.Unix.SCXLog.Privileged.Datasource">
<Host>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Host>
<LogFile>/var/log/secure</LogFile>
<RegExpFilter>\s+su\[*[[:digit:]]*\]*: \S+\(\S+\): session opened for user root by \S+\(uid=[[:digit:]]+\)</RegExpFilter>
<IndividualAlerts>false</IndividualAlerts>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>0</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Linux.Universal.LogFile.Syslog.SU.Command.Root.Success.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>