SSH Failure Alert Rule

Microsoft.HPUX.11iv2.LogFile.Syslog.SSHAuth.PAM.Root.Failure.Alert (Rule)

Alert rule for failed SSH as root messages.

Knowledge Base article:

Summary

An SSH authentication failure for the root account has been detected in the system log files.

Causes

A failure may be caused by a mistyped password or an attempt to use an invalid username. However, a persistent failure could be an indication that someone is attempting to gain unauthorized access.

Resolutions

The description of the alert and/or the output data item contains information on the problem encountered. If a failure occurs, check the associated event details and any other events that happened around the time of this failure to diagnose the problem.

Element properties:

TargetMicrosoft.HPUX.11iv2.Computer
CategoryEventCollection
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
Failed SSH as Root detected
{0}

Member Modules:

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

Source Code:

<Rule ID="Microsoft.HPUX.11iv2.LogFile.Syslog.SSHAuth.PAM.Root.Failure.Alert" Target="Microsoft.HPUX.11iv2.Computer" Enabled="true" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<!-- [TYPE] HP SSH False -->
<!-- [INPUT] Dec 17 16:40:39 scxhpi10 sshd[29681]: error: PAM: Authentication failed for root from scxcrd-sle10-03.scx.com -->
<!-- [INPUT-MISS] Dec 17 16:40:45 scxhpi10 sshd[29681]: Failed keyboard-interactive/pam for root from 10.195.175.142 port 36815 ssh2 -->
<!-- [INPUT-MISS] Dec 17 16:40:53 scxhpi10 sshd[29681]: Failed password for root from 10.195.175.142 port 36815 ssh2 -->
<DataSource ID="EventDS" TypeID="Unix!Microsoft.Unix.SCXLog.Datasource">
<Host>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Host>
<LogFile>/var/adm/syslog/syslog.log</LogFile>
<RegExpFilter>[[:space:]]sshd\[[[:digit:]]+\]: error: PAM: Authentication failed for root from [^[:space:]]+</RegExpFilter>
<IndividualAlerts>false</IndividualAlerts>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.HPUX.11iv2.LogFile.Syslog.SSHAuth.PAM.Root.Failure.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>