Regla de alerta de error de autenticación de SSH

Microsoft.Linux.SLES.15.LogFile.Syslog.SSHAuth.PAM.Root.Failure.Alert (Rule)

Regla de alerta para la detección de errores de autenticación de SSH.

Knowledge Base article:

Resumen

Se ha detectado un error de autenticación de SSH para la cuenta raíz en los archivos de registro del sistema.

Causas

Se puede producir un error al introducir incorrectamente una contraseña o al intentar utilizar un nombre de usuario no válido. No obstante, un error continuo puede indicar que alguien está intentado acceder sin autorización.

Soluciones

La descripción de la alerta y/o el elemento de datos de salida contiene información sobre el problema detectado. Si se produce un error, compruebe los detalles de los eventos asociados, así como cualquier otro evento ocurrido aproximadamente a la hora de este error para diagnosticar el problema.

Element properties:

TargetMicrosoft.Linux.SLES.15.Computer
CategoryEventCollection
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
Se detectó un error de autenticación SSH
{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.SLES.15.LogFile.Syslog.SSHAuth.PAM.Root.Failure.Alert" Target="Microsoft.Linux.SLES.15.Computer" Enabled="true" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<!-- [TYPE] SUSE SSH False -->
<!-- [INPUT] 2014-11-05T18:04:46.417291-05:00 linux-sb1s sshd[14503]: error: PAM: Authentication failure for root from josefigvm12s.ntdev.corp.microsoft.com -->
<!-- [INPUT] Oct 7 17:17:09 sles11-cjc sshd[28526]: error: PAM: Authentication failure for illegal user root from 192.168.233.132 -->
<!-- [INPUT-MISS] Oct 8 09:50:11 sles11-cjc sshd[22952]: error: PAM: Authentication failure for illegal user newguy from localhost -->
<DataSource ID="EventDS" TypeID="Unix!Microsoft.Unix.SCXLog.Privileged.Datasource">
<Host>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Host>
<LogFile>/var/log/messages</LogFile>
<RegExpFilter>\s+sshd\[[[:digit:]]+\]: error: PAM: Authentication failure for (illegal user )?root from \S+</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.Linux.SLES.15.LogFile.Syslog.SSHAuth.PAM.Root.Failure.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>