

 支援結束通知：2026 年 5 月 20 日， AWS 將結束對 Amazon Inspector Classic 的支援。2026 年 5 月 20 日之後，您將無法再存取 Amazon Inspector Classic 主控台或 Amazon Inspector Classic 資源。Amazon Inspector Classic 不再提供給過去 6 個月內未完成評估的新帳戶和帳戶。對於所有其他帳戶，存取將持續有效至 2026 年 5 月 20 日，之後您將無法再存取 Amazon Inspector Classic 主控台或 Amazon Inspector Classic 資源。如需詳細資訊，請參閱 [Amazon Inspector Classic 終止支援](https://docs.aws.amazon.com/inspector/v1/userguide/inspector-migration.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon Inspector Classic 規則套件和規則
<a name="inspector_rule-packages"></a>

您可以使用 Amazon Inspector Classic 來評估您的評估目標 (AWS 資源集合） 是否有潛在的安全問題和漏洞。Amazon Inspector Classic 會將評估目標的行為和安全組態與選取的安全*規則套件*進行比較。在 Amazon Inspector Classic 的內容中，*規則*是 Amazon Inspector Classic 在評估執行期間執行的安全性檢查。

在 Amazon Inspector Classic 中，規則會依類別、嚴重性或定價分組為不同的*規則套件*。如此即可選擇您要執行的分析類型。例如，Amazon Inspector Classic 提供大量的規則，可用來評估您的應用程式。但您可能只想使用所有可用規則的其中一小部分，以鎖定關注的特定區域，或用於找出特定的安全問題。擁有大型 IT 部門的公司，可能需要判斷其應用程式是否遭受任何安全性威脅。其他公司可能只想要專注於嚴重性等級**高**的問題上。
+ [Amazon Inspector Classic 中規則的嚴重性等級](#SeverityLevels)
+ [Amazon Inspector Classic 中的規則套件](#InspectorRulePackages)

## Amazon Inspector Classic 中規則的嚴重性等級
<a name="SeverityLevels"></a>

每個 Amazon Inspector Classic 規則都有指派的嚴重性等級。這可減少分析中某個規則優先於另一個規則的需求。當某條規則突顯出某個潛在問題時，就有助於判斷該如何回應。

**High** (高)、**Medium** (中)、**Low** (低) 三種等級代表了可能導致評估目標中資訊的機密性、完整度、可用性受損的安全問題。這些層級的區別在於問題造成入侵的可能性，以及修正問題的緊急程度。

**Informational** (參考) 等級則只是用於指出評估目標安全組態的某項詳細資訊。

以下是根據問題嚴重性來回應問題的建議方法：
+ **高** – 高嚴重性問題非常緊急。Amazon Inspector Classic 建議您將此安全問題視為緊急狀況，並實作立即修復。
+ **中** – 中嚴重性問題有點緊急。Amazon Inspector Classic 建議您在下一個可能的機會修正此問題，例如在下一次服務更新期間。
+ **低** – 低嚴重性問題較不緊急。Amazon Inspector Classic 建議您修正此問題，做為未來服務更新的一部分。
+ **資訊性** – 這些問題純屬資訊性。根據業務和組識目標，您可以只記下此資訊，或是利用此資訊提升評估目標的安全性。

## Amazon Inspector Classic 中的規則套件
<a name="InspectorRulePackages"></a>

Amazon Inspector 評估可以使用以下規則套件的任意組合：

**網路評估：**
+ [網路連線能力](inspector_network-reachability.md)

**主機評估：**
+ [常見的漏洞和風險](inspector_cves.md)
+ [Center for Internet Security (CIS) 基準參考指標](inspector_cis.md)
+ [Amazon Inspector Classic 的安全最佳實務](inspector_security-best-practices.md)

# 網路連線能力
<a name="inspector_network-reachability"></a>

Network Reachability 套件中的規則會分析您的網路組態，以尋找 EC2 執行個體的安全漏洞。Amazon Inspector 產生的調查結果也可指導您如何限制不安全的存取。

Network Reachability 規則套件使用 AWS [來自 Provable Security](https://aws.amazon.com/security/provable-security/) 計畫的最新技術。

這些規則產生的調查結果可顯示，您的連接埠是否可從網際網路透過網際網路閘道 (包括 Application Load Balancer 或 Classic Load Balancer 後面的執行個體)、VPC 互連連線或經由虛擬閘道的 VPN 加以連線。這些調查結果也特別指出放任可能惡意存取的網路組態，例如管理不善的安全群組、ACL、IGW 等等。

這些規則有助於自動化 AWS 網路的監控，並識別 EC2 執行個體的網路存取可能設定錯誤的位置。您可以將此套件納入評估執行中，以實作詳細的網路安全性檢查，而無需安裝掃描器和傳送封包，這維護起來很複雜又昂貴，尤其是透過 VPC 對等連線和 VPN。

**重要**  
使用此規則套件評估 EC2 執行個體時，不需要 Amazon Inspector Classic 代理程式。不過，安裝代理程式可提供是否有任何程序在接聽連接埠的相關資訊。請勿在 Amazon Inspector Classic 不支援的作業系統上安裝 代理程式。如果代理程式存在於執行不支援作業系統的執行個體上，網路連線能力規則套件將無法在該執行個體上運作。

如需詳細資訊，請參閱[支援作業系統的 Amazon Inspector Classic 規則套件](inspector_rule-packages_across_os.md)。

## 分析的組態
<a name="inspector_network-reachability-configurations"></a>

網路連線能力規則會分析以下實體的組態是否有漏洞：
+ [Amazon EC2 執行個體](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html)
+ [Application Load Balancer](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#alb)
+ [Direct Connect](https://docs.aws.amazon.com/directconnect/latest/UserGuide/Welcome.html)
+ [Elastic Load Balancer](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html)
+ [彈性網路界面](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html)
+ [網際網路閘道 (IGW)](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html)
+ [網路存取控制清單 (ACL)](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html)
+ [路由表](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
+ [安全群組 (SG)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html)
+ [子網路](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)
+ [虛擬私有雲端 (VPC)](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)
+ [虛擬私有閘道 (VGW)](https://docs.aws.amazon.com/vpc/latest/userguide/SetUpVPNConnections.html#vpn-create-vpg)
+ [VPC 對等連接](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html)

## 連線能力路由
<a name="inspector_network-reachability-Types"></a>

網路連線能力規則會檢查以下連線能力路由，這對應於從 VPC 外部可存取連接埠的方式：
+ **`Internet`** - 網際網路閘道 (包括 Application Load Balancer 和 Classic Load Balancer)
+ **`PeeredVPC`** - VPC 對等連線
+ **`VGW`** - 虛擬私有閘道

## 問題清單類型
<a name="inspector_network-reachability-types"></a>

含有網路連線能力規則套件的評估可針對每個連線能力路由，傳回以下類型的調查結果：
+ [`RecognizedPort`](#inspector_network-reachability-types-1)
+ [`UnrecognizedPortWithListener`](#inspector_network-reachability-types-2)
+ [`NetworkExposure`](#inspector_network-reachability-types-3)

### `RecognizedPort`
<a name="inspector_network-reachability-types-1"></a>

通常用於知名服務的連接埠都可連線。如果目標 EC2 執行個體上有代理程式，產生的調查結果也會指出連接埠上是否有作用中的接聽程序。根據知名服務的安全影響，此類型的調查結果會獲得一個嚴重等級：
+ **`RecognizedPortWithListener`** – 已辨識的連接埠可透過特定聯網元件從公有網際網路外部連線，而程序正在接聽連接埠。
+ **`RecognizedPortNoListener`** – 連接埠可透過特定聯網元件從公有網際網路外部連線，而且沒有監聽連接埠的程序。
+ **`RecognizedPortNoAgent`** – 連接埠可透過特定聯網元件從公有網際網路外部連線。如果沒有在目標執行個體上安裝代理程式，則無法判斷是否有程序在連接埠上接聽。

下表為認可的連接埠清單：


|  服務  |  TCP 連接埠  |  UDP 連接埠  | 
| --- | --- | --- | 
|  SMB  |  445  |  445  | 
|  NetBIOS  |  137、139  |  137、138  | 
|  LDAP  |  389  |  389  | 
|  透過 TLS 的 LDAP  |  636  |  | 
|  通用類別目錄 LDAP  |  3268  |  | 
|  透過 TLS 的通用類別目錄 LDAP  |  3269  |  | 
|  NFS  |  111、2049、4045、1110  |  111、2049、4045、1110  | 
|  Kerberos  |  88、464、543、544、749、751  |  88、464、749、750、751、752  | 
|  RPC  |  111、135、530  |  111、135、530  | 
|  WINS  |  1512、42  |  1512、42  | 
|  DHCP  |  67、68、546、547  |  67、68、546、547  | 
|  Syslog  |  601  |  514  | 
|  列印服務  |  515  |  | 
|  Telnet  |  23  |  23  | 
|  FTP  |  21  |  21  | 
|  SSH  |  22  |  22  | 
|  RDP  |  3389  |  3389  | 
|  MongoDB  |  27017、27018、27019、28017  |  | 
|  SQL Server  |  1433  |  1434  | 
|  MySQL  |  3306  |  | 
|  PostgreSQL  |  5432  |  | 
|  Oracle  |  1521、1630  |  | 
|  Elasticsearch  |  9300、9200  |  | 
|  HTTP  | 80 | 80 | 
|  HTTPS  | 443 | 443 | 

### `UnrecogizedPortWithListener`
<a name="inspector_network-reachability-types-2"></a>

可連線至上表未列出的連接埠，且其擁有作用中的接聽程序。由於此類型的調查結果顯示監聽程序的相關資訊，因此只有在目標 EC2 執行個體上安裝 Amazon Inspector 代理程式時，才能產生這些程序。此類型的調查結果會獲得 **Low (低)** 嚴重等級。

### `NetworkExposure`
<a name="inspector_network-reachability-types-3"></a>

此類型的調查結果會顯示 EC2 執行個體上可存取之連接埠的彙總資訊。對於 EC2 執行個體上的每個彈性網路介面和安全群組組合，這些調查結果會顯示一組可連線的 TCP 和 UDP 連接埠範圍。此類型的調查結果具有 **Informational (參考)** 嚴重等級。

# 常見的漏洞和風險
<a name="inspector_cves"></a>

此套件中的規則有助於驗證評估目標中的 EC2 執行個體是否暴露於常見漏洞和暴露 (CVEs)。攻擊可以利用未修補的漏洞危害服務或資料的機密性、完整性和可用性。CVE 系統為公開已知的資安漏洞與暴露提供了參考方法。如需詳細資訊，請參閱 [https://cve.mitre.org/](https://cve.mitre.org/)。

如果特定 CVE 出現在由 Amazon Inspector Classic 評估產生的*調查結果*中，您可以搜尋 [https://cve.mitre.org/](https://cve.mitre.org/) 以取得 CVE 的 ID （例如 **CVE-2009-0021**)。搜尋結果可提供此 CVE、嚴重性，以及減輕嚴重性方式的詳細資訊。

對於常見漏洞和漏洞 (CVE) 規則套件，Amazon Inspector 已映射提供的 CVSS 基本評分和 ALAS 嚴重性等級：


| 
| 
| **Amazon Inspector 嚴重性 ** | **CVSS 基本分數 ** | **ALAS 嚴重性 （如果 CVSS 未評分）** | 
| --- |--- |--- |
| High | >= 5  | Critical or Important | 
| Medium | < 5 and >= 2.1  | Medium | 
| Low | < 2.1 and >= 0.8  | Low | 
| Informational | < 0.8 | N/A | 

此套件中包含的規則可協助您評估 EC2 執行個體是否公開給下列區域清單中CVEs：
+ [美國東部 (維吉尼亞北部)](https://s3.us-east-1.amazonaws.com/rules-engine.us-east-1/CVEList.txt)
+ [美國東部 (俄亥俄)](https://s3.us-east-2.amazonaws.com/rules-engine.us-east-2/CVEList.txt)
+ [美國西部 (加州北部)](https://s3.us-west-1.amazonaws.com/rules-engine.us-west-1/CVEList.txt)
+ [美國西部 (奧勒岡)](https://s3.us-west-2.amazonaws.com/rules-engine.us-west-2/CVEList.txt)
+ [歐洲 (愛爾蘭)](https://s3.eu-west-1.amazonaws.com/rules-engine.eu-west-1/CVEList.txt)
+ [歐洲 (法蘭克福)](https://s3.eu-central-1.amazonaws.com/rules-engine.eu-central-1/CVEList.txt)
+ [歐洲 (倫敦)](https://s3.eu-west-2.amazonaws.com/rules-engine.eu-west-2/CVEList.txt)
+ [歐洲 (斯德哥爾摩)](https://s3.eu-north-1.amazonaws.com/rules-engine.eu-north-1/CVEList.txt)
+ [亞太區域 (東京)](https://s3.ap-northeast-1.amazonaws.com/rules-engine.ap-northeast-1/CVEList.txt)
+ [亞太區域 (首爾)](https://s3.ap-northeast-2.amazonaws.com/rules-engine.ap-northeast-2/CVEList.txt)
+ [亞太區域 (孟買)](https://s3.ap-south-1.amazonaws.com/rules-engine.ap-south-1/CVEList.txt)
+ [亞太區域 (雪梨)](https://s3.ap-southeast-2.amazonaws.com/rules-engine.ap-southeast-2/CVEList.txt)
+ [AWS GovCloud 西部 (美國)](https://s3.us-gov-west-1.amazonaws.com/rules-engine.us-gov-west-1/CVEList.txt)
+ [AWS GovCloud 東部 (美國)](https://s3.us-gov-east-1.amazonaws.com/rules-engine.us-gov-east-1/CVEList.txt)

CVE 規則套件會定期更新；在擷取此清單時發生之評估執行所包含的 CVE，也包含在此清單中。

如需詳細資訊，請參閱[支援作業系統的 Amazon Inspector Classic 規則套件](inspector_rule-packages_across_os.md)。

# Center for Internet Security (CIS) 基準參考指標
<a name="inspector_cis"></a>

CIS Security Benchmarks 計畫提供定義明確、無偏差、以共識為基礎的產業最佳實務，以協助組織評估並改善其安全性。 AWS 是 CIS Security Benchmarks 成員公司。如需 Amazon Inspector Classic 認證清單，請參閱 [CIS 網站上的 Amazon Web Services 頁面](https://benchmarks.cisecurity.org/membership/certified/amazon/)。

Amazon Inspector Classic 目前提供下列 CIS 認證規則套件，以協助建立下列作業系統的安全組態狀態：

**Amazon Linux**
+ `CIS Benchmark for Amazon Linux 2 Benchmark v1.0.0 Level 1`
+ `CIS Benchmark for Amazon Linux 2 Benchmark v1.0.0 Level 2`
+ `CIS Benchmark for Amazon Linux Benchmark v2.1.0 Level 1`
+ `CIS Benchmark for Amazon Linux Benchmark v2.1.0 Level 2`
+ `CIS Benchmark for Amazon Linux 2014.09-2015.03 v1.1.0 Level 1`

**CentOS Linux**
+ `CIS Benchmark for CentOS Linux 7 Benchmark v2.2.0 Level 1 Server`
+ `CIS Benchmark for CentOS Linux 7 Benchmark v2.2.0 Level 2 Server`
+ `CIS Benchmark for CentOS Linux 7 Benchmark v2.2.0 Level 1 Workstation`
+ `CIS Benchmark for CentOS Linux 7 Benchmark v2.2.0 Level 2 Workstation`
+ `CIS Benchmark for CentOS Linux 6 Benchmark v2.0.2 Level 1 Server`
+ `CIS Benchmark for CentOS Linux 6 Benchmark v2.0.2 Level 2 Server`
+ `CIS Benchmark for CentOS Linux 6 Benchmark v2.0.2 Level 1 Workstation`
+ `CIS Benchmark for CentOS Linux 6 Benchmark v2.0.2 Level 2 Workstation`

**Red Hat Enterprise Linux**
+ `CIS Benchmark for Red Hat Enterprise Linux 7 Benchmark v2.1.1 Level 1 Server`
+ `CIS Benchmark for Red Hat Enterprise Linux 7 Benchmark v2.1.1 Level 2 Server`
+ `CIS Benchmark for Red Hat Enterprise Linux 7 Benchmark v2.1.1 Level 1 Workstation`
+ `CIS Benchmark for Red Hat Enterprise Linux 7 Benchmark v2.1.1 Level 2 Workstation`
+ `CIS Benchmark for Red Hat Enterprise Linux 6 Benchmark v2.0.2 Level 1 Server`
+ `CIS Benchmark for Red Hat Enterprise Linux 6 Benchmark v2.0.2 Level 2 Server`
+ `CIS Benchmark for Red Hat Enterprise Linux 6 Benchmark v2.0.2. Level 1 Workstation`
+ `CIS Benchmark for Red Hat Enterprise Linux 6 Benchmark v2.0.2 Level 2 Workstation`

**Ubuntu**
+ `CIS Benchmark for Ubuntu Linux 18.04 LTS Benchmark v1.0.0 Level 1 Server`
+ `CIS Benchmark for Ubuntu Linux 18.04 LTS Benchmark v1.0.0 Level 2 Server`
+ `CIS Benchmark for Ubuntu Linux 18.04 LTS Benchmark v1.0.0 Level 1 Workstation`
+ `CIS Benchmark for Ubuntu Linux 18.04 LTS Benchmark v1.0.0 Level 2 Workstation`
+ `CIS Benchmark for Ubuntu Linux 16.04 LTS Benchmark v1.1.0 Level 1 Server`
+ `CIS Benchmark for Ubuntu Linux 16.04 LTS Benchmark v1.1.0 Level 2 Server`
+ `CIS Benchmark for Ubuntu Linux 16.04 LTS Benchmark v1.1.0 Level 1 Workstation`
+ `CIS Benchmark for Ubuntu Linux 16.04 LTS Benchmark v1.1.0 Level 2 Workstation`
+ `CIS Benchmark for Ubuntu Linux 14.04 LTS Benchmark v2.0.0 Level 1 Server`
+ `CIS Benchmark for Ubuntu Linux 14.04 LTS Benchmark v2.0.0 Level 2 Server`
+ `CIS Benchmark for Ubuntu Linux 14.04 LTS Benchmark v2.0.0 Level 1 Workstation`
+ `CIS Benchmark for Ubuntu Linux 14.04 LTS Benchmark v2.0.0 Level 2 Workstation`

**Windows**
+ `Windows Server 2016 (CIS Benchmark for Microsoft Windows 2016 RTM (Release 1607), v1.1.0, Level 1 Member Server Profile)`
+ `Windows Server 2016 (CIS Benchmark for Microsoft Windows 2016 RTM (Release 1607), v1.1.0, Level 2 Member Server Profile)`
+ `Windows Server 2016 (CIS Benchmark for Microsoft Windows 2016 RTM (Release 1607), v1.1.0, Level 1 Domain Controller Profile)`
+ `Windows Server 2016 (CIS Benchmark for Microsoft Windows 2016 RTM (Release 1607), v1.1.0, Level 2 Domain Controller Profile)`
+ `Windows Server 2016 (CIS Benchmark for Microsoft Windows 2016 RTM (Release 1607), v1.1.0, Next Generation Windows Security Profile)`
+ `Windows Server 2012 R2 (CIS Benchmark for Microsoft Windows 2012 R2, v2.2.0, Level 1 Domain Controller Profile)`
+ `Windows Server 2012 R2 (CIS Benchmark for Microsoft Windows 2012 R2, v2.2.0, Level 2 Domain Controller Profile)`
+ `Windows Server 2012 R2 (CIS Benchmark for Microsoft Windows 2012 R2, v2.2.0, Level 1 Member Server Profile)`
+ `Windows Server 2012 R2 (CIS Benchmark for Microsoft Windows 2012 R2, v2.2.0, Level 2 Member Server Profile)`
+ `Windows Server 2012 (CIS Benchmark for Microsoft Windows 2012 non-R2, v2.0.0, Level 1 Member Server Profile)`
+ `Windows Server 2012 (CIS Benchmark for Microsoft Windows 2012 non-R2, v2.0.0, Level 2 Member Server Profile)`
+ `Windows Server 2012 (CIS Benchmark for Microsoft Windows 2012 non-R2, v2.0.0, Level 1 Domain Controller Profile)`
+ `Windows Server 2012 (CIS Benchmark for Microsoft Windows 2012 non-R2, v2.0.0, Level 2 Domain Controller Profile)`
+ `Windows Server 2008 R2 (CIS Benchmark for Microsoft Windows 2008 R2, v3.0.0, Level 1 Domain Controller Profile)`
+ `Windows Server 2008 R2 (CIS Benchmark for Microsoft Windows 2008 R2, v3.0.0, Level 1 Member Server Profile)`

如果特定 CIS 基準測試出現在 Amazon Inspector Classic 評估執行所產生的調查結果中，您可以從 [https://benchmarks.cisecurity.org/](https://benchmarks.cisecurity.org/)：// 下載基準測試的詳細 PDF 說明 （需要免費註冊）。基準參考指標文件提供此 CIS 基準參考指標基準、嚴重性，以及減輕嚴重性方式的詳細資訊。

如需詳細資訊，請參閱[支援作業系統的 Amazon Inspector Classic 規則套件](inspector_rule-packages_across_os.md)。

# Amazon Inspector Classic 的安全最佳實務
<a name="inspector_security-best-practices"></a>

使用 Amazon Inspector Classic 規則來協助判斷系統是否已安全設定。

**重要**  
目前，您可以在執行 Linux 型或 Windows 作業系統的評估目標 EC2 執行個體中包含 。  
在評估執行期間，本節所述的規則**只會**針對執行 Linux 作業系統的 EC2 執行個體產生調查結果。這些規則不會為執行 Windows 作業系統的 EC2 執行個體產生問題清單。  
如需詳細資訊，請參閱[支援作業系統的 Amazon Inspector Classic 規則套件](inspector_rule-packages_across_os.md)。

**Topics**
+ [停用 SSH 根登入](#disable-root-login-over-SSH)
+ [僅支援 SSH 版本 2](#support-ssh-v2-only)
+ [停用 SSH 密碼驗證](#disable-password-authentication-over-ssh)
+ [設定密碼最長期限](#password-maximum-age)
+ [設定密碼長度下限](#password-minimum-length)
+ [設定密碼複雜性](#password-complexity)
+ [啟用 ASLR](#ASLR)
+ [啟用 DEP](#DEP-OS)
+ [設定系統目錄許可](#permissions-for-system-directories)

## 停用 SSH 根登入
<a name="disable-root-login-over-SSH"></a>

此規則有助於判斷 SSH 協助程式是否已設定允許做為[根](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html)來登入您的 EC2 執行個體。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
您的評估目標中有一個 EC2 執行個體，其設定為允許使用者透過 SSH 使用根憑證登入。這會增加暴力破解攻擊成功的可能性。

**解決方案**  
我們建議您設定 EC2 執行個體，以防止根帳戶透過 SSH 登入。反之，以非根使用者登入，且必要時使用 `sudo` 以提升權限。若要停用 SSH 根帳戶登入，請在 `/etc/ssh/sshd_config` 檔案中將 `PermitRootLogin` 設為 `no`，然後重新啟動 `sshd`。

## 僅支援 SSH 版本 2
<a name="support-ssh-v2-only"></a>

此規則有助於判斷 EC2 執行個體是否設定為支援 SSH 通訊協定第 1 版。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體設定為支援 SSH-1，其中包含可大幅降低其安全性的固有設計瑕疵。

**解決方案**  
建議您將評估目標中的 EC2 執行個體設定為僅支援 SSH-2 和更新版本。若是 OpenSSH，您可在 `/etc/ssh/sshd_config` 檔案中設定 `Protocol 2` 來達到目標。如需詳細資訊，請參閱`man sshd_config`。

## 停用 SSH 密碼驗證
<a name="disable-password-authentication-over-ssh"></a>

此規則有助於判斷您的 EC2 執行個體是否設定為支援透過 SSH 通訊協定進行密碼身分驗證。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體已設定為支援透過 SSH 進行密碼身分驗證。密碼驗證易受暴力破解攻擊，應盡可能停用以金鑰為基礎的身分驗證。

**解決方案**  
我們建議您停用在 EC2 執行個體上透過 SSH 進行密碼驗證，並啟用支援以金鑰為基礎的身分驗證。這會大幅減少暴力破解攻擊成功的可能性。如需詳細資訊，請造訪[ https://aws.amazon.com/articles/1233/](https://aws.amazon.com/articles/1233/)。如果已支援密碼驗證，請務必限制存取 SSH 伺服器的為信任的 IP 位址。

## 設定密碼最長期限
<a name="password-maximum-age"></a>

此規則有助於判斷是否已在 EC2 執行個體上設定密碼的最長存留期。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體未設定密碼的最長存留期。

**解決方案**  
如果您使用密碼，建議您為評估目標中的所有 EC2 執行個體設定密碼的最長存留期。這需要使用者定期變更密碼，以降低密碼臆測攻擊成功的機率。若要為現有使用者修正此問題，請使用 **chage** 命令。若要為所有未來使用者設定密碼最大期限，請編輯 `/etc/login.defs` 檔案中的 `PASS_MAX_DAYS` 欄位。

## 設定密碼長度下限
<a name="password-minimum-length"></a>

此規則有助於判斷是否已在 EC2 執行個體上設定密碼的最小長度。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體未設定為密碼的長度下限。

**解決方案**  
如果您使用密碼，我們建議您為評估目標中所有 EC2 執行個體的密碼設定長度下限。強制執行最低密碼長度可減少密碼臆測攻擊成功的風險。您可以使用 `pwquality.conf` 檔案中的下列選項來執行此操作：`minlen`。如需詳細資訊，請參閱 https：//[https://linux.die.net/man/5/pwquality.conf](https://linux.die.net/man/5/pwquality.conf)。  
如果您的執行個體`pwquality.conf`無法使用 ，您可以使用 `pam_cracklib.so`模組設定 `minlen`選項。如需詳細資訊，請參閱[https://linux.die.net/man/8/pam_cracklib](https://linux.die.net/man/8/pam_cracklib)。  
`minlen` 選項應設定為 14 或更高。

## 設定密碼複雜性
<a name="password-complexity"></a>

此規則有助於判斷是否已在 EC2 執行個體上設定密碼複雜性機制。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體未設定密碼複雜性機制或限制。這將讓使用者能夠設定簡單的密碼，從而讓未經授權的使用者更有機會取得存取權並濫用帳戶。

**解決方案**  
如果您使用密碼，建議您將評估目標中的所有 EC2 執行個體設定為需要一定程度的密碼複雜性。方法是，在 `pwquality.conf` 檔案中使用下列選項：`lcredit`、`ucredit`、`dcredit` 和 `ocredit`。如需詳細資訊，請參閱 [https://linux.die.net/man/5/pwquality.conf](https://linux.die.net/man/5/pwquality.conf)。  
如果您的執行個體上沒有可用的 `pwquality.conf`，則可使用 `pam_cracklib.so` 模組來設定 `lcredit`、`ucredit`、`dcredit` 和 `ocredit` 選項。如需詳細資訊，請參閱[https://linux.die.net/man/8/pam_cracklib](https://linux.die.net/man/8/pam_cracklib)。  
每個選項的預期值小於或等於 -1，如下所示：  
`lcredit <= -1, ucredit <= -1, dcredit<= -1, ocredit <= -1`  
此外，`remember` 選項必須設定為 12 或更大。如需詳細資訊，請參閱[https://linux.die.net/man/8/pam_unix](https://linux.die.net/man/8/pam_unix)。

## 啟用 ASLR
<a name="ASLR"></a>

此規則有助於判斷評估目標中 EC2 執行個體的作業系統是否已啟用位址空間配置隨機化 (ASLR)。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體未啟用 ASLR。

**解決方案**  
為了改善評估目標的安全性，建議您透過執行 ，在目標中所有 EC2 執行個體的作業系統上啟用 ASLR**echo 2 \$1 sudo tee /proc/sys/kernel/randomize\$1va\$1space**。

## 啟用 DEP
<a name="DEP-OS"></a>

此規則有助於判斷是否已啟用評估目標中 EC2 執行個體的作業系統上的資料執行預防 (DEP)。

**注意**  
具有 ARM 處理器的 EC2 執行個體不支援此規則。

**嚴重性**  
[中性](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
評估目標中的 EC2 執行個體未啟用 DEP。

**解決方案**  
我們建議您在評估目標中所有 EC2 執行個體的作業系統上啟用 DEP。使用緩衝區溢位技巧啟用 DEP 以保護您的執行個體免受安全威脅。

## 設定系統目錄許可
<a name="permissions-for-system-directories"></a>

此規則會在包含二進位檔和系統組態資訊的系統目錄上檢查許可，確認只有根使用者 (使用根帳戶登入資料登入的使用者) 才具有這些目錄的寫入許可。

**嚴重性**  
[高](inspector_rule-packages.md#SeverityLevels)

**問題清單**  
在您評估目標的一個 EC2 執行個體包含非根使用者可寫入的系統目錄。

**解決方案**  
為了改善評估目標的安全性並防止惡意本機使用者提升權限，請將目標中所有 EC2 執行個體上的所有系統目錄設定為只能由使用根帳戶登入資料登入的使用者撰寫。