SSH 失敗警示規則

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

以根 (root) 身分進行 SSH 失敗的訊息警示規則。

Knowledge Base article:

摘要

在系統記錄檔中偵測到根帳號的 SSH 驗證失敗。

設定

此規則預設為停用。若要啟用此規則以進行監視,請使用覆寫來設定記錄檔路徑及啟用規則。記錄檔路徑是使用名為 LogFile 的可覆寫內容進行設定,而其值必須設定為將接收這些事件之記錄檔的完整路徑,如同 Syslog 設定中所定義。您可以使用覆寫,針對所有執行個體或特定執行個體或群組來變更參數值。

原因

造成失敗的原因可能是密碼輸入錯誤或嘗試使用的使用者名稱無效。不過,持續失敗的狀況可能表示有人正嘗試取得未經授權的存取權。

解決方式

警示及/或輸出資料項目的描述包含所發生問題的資訊。如果發生失敗,請檢查相關聯的事件詳細資訊,以及與此失敗同時間發生的其他任何事件,以診斷問題。

Element properties:

TargetMicrosoft.Solaris.11.Computer
CategoryEventCollection
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
偵測到以根 (Root) 身分進行 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.Solaris.11.LogFile.Syslog.SSHAuth.PAM.Root.Failure.Alert" Target="Microsoft.Solaris.11.Computer" Enabled="false" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<!-- [TYPE] Solaris SSH False -->
<!-- [INPUT] Nov 30 16:43:58 jeffcof-sol11-x86 sshd[1381]: [ID 800047 auth.notice] Failed keyboard-interactive for root from ::1 port 33798 ssh2 -->
<!-- [INPUT-MISS] Nov 30 16:43:58 jeffcof-sol11-x86 sshd[1381]: [ID 800047 auth.notice] Failed keyboard-interactive for jeffcof from ::1 port 33798 ssh2 -->
<DataSource ID="EventDS" TypeID="Unix!Microsoft.Unix.SCXLog.Privileged.Datasource">
<Host>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Host>
<LogFile>/var/log/authlog</LogFile>
<RegExpFilter>sshd\[[[:digit:]]+\]: \[.*\] Failed (keyboard-interactive|publickey) 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.Solaris.11.LogFile.Syslog.SSHAuth.PAM.Root.Failure.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>