

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

# 在 Security Lake AWS 服務 中從 收集資料
<a name="internal-sources"></a>

Amazon Security Lake 可以從下列原生支援的 收集日誌和事件 AWS 服務：
+ AWS CloudTrail 管理和資料事件 (S3、Lambda)
+ Amazon Elastic Kubernetes Service (Amazon EKS) 稽核日誌
+ Amazon Route 53 Resolver 查詢日誌
+ AWS Security Hub CSPM 問題清單
+ Amazon Virtual Private Cloud (Amazon VPC) 流程日誌
+ AWS WAF v2 日誌

Security Lake 會自動將此資料轉換為 [Security Lake 中的開放式網路安全結構描述架構 (OCSF)](open-cybersecurity-schema-framework.md)和 Apache Parquet 格式。

**提示**  
 若要在 Security Lake 中將上述一或多個服務新增為日誌來源，*您不需要*單獨設定這些服務的記錄，CloudTrail 管理事件除外。如果您在這些服務中已設定記錄，則*不需要*變更記錄組態，即可在 Security Lake 中將其新增為記錄來源。Security Lake 透過獨立且重複的事件串流，直接從這些服務提取資料。



## 先決條件：驗證許可
<a name="add-internal-sources-permissions"></a>

若要在 Security Lake 中將 新增 AWS 服務 為來源，您必須擁有必要的許可。確認連接至您用來新增來源之角色的 AWS Identity and Access Management (IAM) 政策具有執行下列動作的許可：
+ `glue:CreateDatabase`
+ `glue:CreateTable`
+ `glue:GetDatabase`
+ `glue:GetTable`
+ `glue:UpdateTable`
+ `iam:CreateServiceLinkedRole`
+ `s3:GetObject`
+ `s3:PutObject`

建議角色具有 和 `S3:getObject``s3:PutObject`許可的下列條件和資源範圍。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowUpdatingSecurityLakeS3Buckets",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::aws-security-data-lake*",
              "Condition": {
                "StringEquals": {
                    "aws:ResourceAccount": "${aws:PrincipalAccount}"
                }
            }
    }
    ]
}
```

------

這些動作可讓您從 收集日誌和事件 AWS 服務 ，並將其傳送至正確的 AWS Glue 資料庫和資料表。

如果您使用 AWS KMS 金鑰進行資料湖的伺服器端加密，您也需要 的許可`kms:DescribeKey`。

## 新增 AWS 服務 做為來源
<a name="add-internal-sources"></a>

新增 AWS 服務 做為來源後，Security Lake 會自動開始從中收集安全日誌和事件。這些指示說明如何在 Security Lake 中新增原生支援的 AWS 服務 作為來源。如需新增自訂來源的說明，請參閱 [從 Security Lake 中的自訂來源收集資料](custom-sources.md)。

------
#### [ Console ]

**新增 AWS 日誌來源 （主控台）**

1. 開啟位於 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 的 Security Lake 主控台。

1. 從導覽窗格中選擇**來源**。

1. 選取您要從中收集資料 AWS 服務 的 ，然後選擇**設定**。

1. 在**來源設定**區段中，啟用來源，然後選取您要用於資料擷取的資料來源**版本**。根據預設，Security Lake 會擷取最新版本的資料來源。
**重要**  
如果您沒有在指定區域中啟用新版本 AWS 日誌來源所需的角色許可，請聯絡您的 Security Lake 管理員。如需詳細資訊，請參閱[更新角色許可](https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html#update-role-permissions)。

   若要讓訂閱者擷取選取的資料來源版本，您也必須更新訂閱者設定。如需如何編輯訂閱者的詳細資訊，請參閱 [Amazon Security Lake 中的訂閱者管理](https://docs.aws.amazon.com//security-lake/latest/userguide/subscriber-management.html)。

   或者，您可以選擇僅擷取最新版本，並停用用於資料擷取的所有先前來源版本。

1. 在**區域**區段中，選取您要收集來源資料的區域。Security Lake 會從來源收集所選區域中*所有*帳戶的資料。

1. 選擇**啟用**。

------
#### [ API ]

**新增 AWS 日誌來源 (API)**

若要以程式設計方式新增 AWS 服務 做為來源，請使用 Security Lake API 的 [CreateAwsLogSource](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_CreateAwsLogSource.html) 操作。如果您使用的是 AWS Command Line Interface (AWS CLI)，請執行 [create-aws-log-source](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-aws-log-source.html) 命令。`sourceName` 和 `regions` 是必要參數。或者，您可以將來源的範圍限制為特定 `accounts`或特定 `sourceVersion`。

**重要**  
當您未在命令中提供參數時，Security Lake 會假設缺少的參數參照整個集合。例如，如果您不提供 `accounts` 參數 ，則 命令會套用至組織中的整組帳戶。

下列範例會將 VPC 流程日誌新增為指定帳戶和區域中的來源。此範例已針對 Linux、macOS 或 Unix 格式化，並使用反斜線 (\$1) 行接續字元來改善可讀性。

**注意**  
如果您將此請求套用至您尚未啟用 Security Lake 的區域，您將會收到錯誤。您可以在該區域中啟用 Security Lake，或使用 `regions` 參數僅指定已啟用 Security Lake 的區域，以解決錯誤。

```
$ aws securitylake create-aws-log-source \
--sources sourceName=VPC_FLOW,accounts='["123456789012", "111122223333"]',regions=["us-east-2"],sourceVersion="2.0"
```

------

## 取得來源集合的狀態
<a name="get-status-internal-sources"></a>

選擇您的存取方法，並依照步驟取得在目前區域中啟用日誌收集的帳戶和來源快照。

------
#### [ Console ]

**取得目前區域中日誌集合的狀態**

1. 開啟位於 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 的 Security Lake 主控台。

1. 在導覽窗格中，選擇**帳戶**。

1. 將游標暫留在**來源欄中的**數字上，以查看為所選帳戶啟用了哪些日誌。

------
#### [ API ]

若要取得目前區域中日誌收集的狀態，請使用 Security Lake API 的 [GetDataLakeSources](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_GetDataLakeSources.html) 操作。如果您使用的是 AWS CLI，請執行 [get-data-lake-sources](https://docs.aws.amazon.com/cli/latest/reference/securitylake/get-data-lake-sources.html) 命令。對於 `accounts` 參數，您可以將一或多個 AWS 帳戶 IDs 指定為清單。如果您的請求成功，Security Lake 會傳回目前區域中這些帳戶的快照，包括 Security Lake 正在從哪個 AWS 來源收集資料，以及每個來源的狀態。如果您未包含 `accounts` 參數，回應會包含目前區域中設定 Security Lake 之所有帳戶的日誌收集狀態。

例如，下列 AWS CLI 命令會擷取目前區域中指定帳戶的日誌收集狀態。此範例已針對 Linux、macOS 或 Unix 格式化，並使用反斜線 (\$1) 行接續字元來改善可讀性。

```
$ aws securitylake get-data-lake-sources \
--accounts "123456789012" "111122223333"
```

------

# 在 Security Lake 中更新角色許可
<a name="update-role-permissions"></a>

如果您沒有從新版本的資料來源擷取資料所需的角色許可或資源 - 新 AWS Lambda 函數和 Amazon Simple Queue Service (Amazon SQS) 佇列，您必須更新`AmazonSecurityLakeMetaStoreManagerV2`角色許可，並建立新的資源集來處理來自來源的資料。

選擇您偏好的方法，並依照指示更新您的角色許可，並建立新的資源來處理指定區域中新版本的 AWS 日誌來源的資料。這是一次性動作，因為許可和資源會自動套用至未來的資料來源版本。

------
#### [ Console ]

**更新角色許可 （主控台）**

1. 開啟位於 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 的 Security Lake 主控台。

   使用委派 Security Lake 管理員的登入資料登入。

1. 在導覽窗格中，於 **Settings (設定)** 下選擇 **General (一般)**。

1. 選擇**更新角色許可**。

1. 在**服務存取**區段中，執行下列其中一項操作：
   + **建立和使用新的服務角色** — 您可以使用 Security Lake 建立的 **AmazonSecurityLakeMetaStoreManagerV2** 角色。
   + **使用現有的服務角色** — 您可以從服務角色**名稱清單中選擇現有的服務角色**。

1. 選擇**套用**。

------
#### [ API ]

**更新角色許可 (API)**

若要以程式設計方式更新許可，請使用 Security Lake API [https://docs.aws.amazon.com/security-lake/latest/APIReference/API_UpdateDataLake.html](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_UpdateDataLake.html)的操作。若要使用 更新許可 AWS CLI，請執行 [https://docs.aws.amazon.com/cli/latest/reference/securitylake/update-data-lake.html](https://docs.aws.amazon.com/cli/latest/reference/securitylake/update-data-lake.html)命令。

若要更新您的角色許可，您必須將[AmazonSecurityLakeMetastoreManager](security-iam-awsmanpol.md#security-iam-awsmanpol-AmazonSecurityLakeMetastoreManager)政策連接至角色。

------

## 刪除 AmazonSecurityLakeMetaStoreManager 角色
<a name="remove-sl-metastoremanager-role"></a>

**重要**  
將角色許可更新為 之後`AmazonSecurityLakeMetaStoreManagerV2`，請先確認資料湖正常運作，再移除舊`AmazonSecurityLakeMetaStoreManager`角色。建議在移除角色之前等待至少 4 小時。

 如果您決定移除角色，您必須先從中刪除`AmazonSecurityLakeMetaStoreManager`角色 AWS Lake Formation。

請依照下列步驟，從 Lake Formation 主控台移除`AmazonSecurityLakeMetaStoreManager`角色。

1. 登入 AWS 管理主控台，並在 https：//[https://console.aws.amazon.com/lakeformation/](https://console.aws.amazon.com/lakeformation/) 開啟 Lake Formation 主控台。

1. 在 Lake Formation 主控台的導覽窗格中，選擇**管理角色和任務**。

1. `AmazonSecurityLakeMetaStoreManager` 從每個區域移除 。

# 從 Security Lake 移除 AWS 服務 做為來源
<a name="remove-internal-sources"></a>

選擇您的存取方法，並依照下列步驟移除原生支援的 AWS 服務 Security Lake 來源。您可以移除一或多個區域的來源。當您移除來源時，Security Lake 會停止從指定區域和帳戶中的來源收集資料，而且訂閱者無法再從來源取用新資料。不過，訂閱者仍然可以使用 Security Lake 在移除之前從來源收集的資料。您只能使用這些指示來移除原生支援的 AWS 服務 來源。如需移除自訂來源的相關資訊，請參閱 [從 Security Lake 中的自訂來源收集資料](custom-sources.md)。

------
#### [ Console ]

1. 開啟位於 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 的 Security Lake 主控台。

1. 從導覽窗格中選擇**來源**。

1. 選取來源，然後選擇**停用**。

1. 選取您要停止從此來源收集資料的 區域。Security Lake 將停止從來源收集所選區域中*所有*帳戶的資料。

------
#### [ API ]

若要以程式設計方式移除 AWS 服務 做為來源，請使用 Security Lake API 的 [DeleteAwsLogSource](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_DeleteAwsLogSource.html) 操作。如果您使用的是 AWS Command Line Interface (AWS CLI)，請執行 [delete-aws-log-source](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-aws-log-source.html) 命令。`sourceName` 和 `regions` 是必要參數。或者，您可以將移除的範圍限制為特定 `accounts`或特定 `sourceVersion`。

**重要**  
當您未在命令中提供參數時，Security Lake 會假設缺少的參數參照整個集合。例如，如果您不提供 `accounts` 參數 ，則 命令會套用至組織中的整組帳戶。

下列範例會移除 VPC 流程日誌，做為指定帳戶和區域中的來源。

```
$ aws securitylake delete-aws-log-source \
--sources sourceName=VPC_FLOW,accounts='["123456789012", "111122223333"]',regions='["us-east-1", "us-east-2"]',sourceVersion="2.0"
```

下列範例會移除 Route 53 做為指定帳戶和區域中的來源。

```
$ aws securitylake delete-aws-log-source \
--sources sourceName=ROUTE53,accounts='["123456789012"]',regions='["us-east-1", "us-east-2"]',sourceVersion="2.0"
```

上述範例已針對 Linux、macOS 或 Unix 進行格式化，並使用反斜線 (\$1) 換行字元來改善可讀性。

------

# Security Lake 中的 CloudTrail 事件日誌
<a name="cloudtrail-event-logs"></a>

AWS CloudTrail 提供您帳戶的 AWS API 呼叫歷史記錄，包括使用 AWS 管理主控台、 AWS SDKs、命令列工具和特定 AWS 服務的 API 呼叫。CloudTrail 也可讓您識別哪些使用者和帳戶針對支援 CloudTrail 的服務呼叫 AWS APIs、呼叫的來源 IP 地址，以及呼叫的發生時間。如需詳細資訊，請參閱[「AWS CloudTrail 使用者指南」](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)。

Security Lake 可以收集與 S3 和 Lambda 的 CloudTrail 管理事件和 CloudTrail 資料事件相關聯的日誌。 S3 CloudTrail 管理事件、S3 資料事件和 Lambda 資料事件是 Security Lake 中的三個不同來源。因此，當您將其中一個值新增為擷取的日誌來源[https://docs.aws.amazon.com/security-lake/latest/APIReference/API_AwsLogSourceConfiguration.html#securitylake-Type-AwsLogSourceConfiguration-sourceName](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_AwsLogSourceConfiguration.html#securitylake-Type-AwsLogSourceConfiguration-sourceName)時，它們具有不同的值。管理事件也稱為控制平面事件，可讓您深入了解在 資源上執行的管理操作 AWS 帳戶。CloudTrail 資料事件也稱為資料平面操作，顯示在您 中的資源上執行的資源操作 AWS 帳戶。這些操作通常是大量活動。

若要在 Security Lake 中收集 CloudTrail 管理事件，您必須至少有一個收集讀取和寫入 CloudTrail 管理事件的 CloudTrail 多區域組織追蹤。必須針對追蹤啟用記錄。如果您在其他服務中設定了日誌記錄，則不需要變更日誌記錄組態，即可在 Security Lake 中將其新增為日誌來源。Security Lake 透過獨立且重複的事件串流，直接從這些服務提取資料。

多區域追蹤會將日誌檔案從多個區域交付至單一 Amazon Simple Storage Service (Amazon S3) 儲存貯體 AWS 帳戶。如果您已透過 CloudTrail 主控台或 管理多區域追蹤 AWS Control Tower，則不需要進一步的動作。
+ 如需有關透過 CloudTrail 建立和管理追蹤的資訊，請參閱*AWS CloudTrail 《 使用者指南*》中的[為組織建立追蹤](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html)。
+ 如需有關透過 建立和管理追蹤的資訊 AWS Control Tower，請參閱*AWS Control Tower 《 使用者指南*》中的[使用 記錄 AWS Control Tower 動作 AWS CloudTrail](https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html)。

當您新增 CloudTrail 事件做為來源時，Security Lake 會立即開始收集您的 CloudTrail 事件日誌。它透過獨立且重複的事件串流，直接從 CloudTrail 取用 CloudTrail CloudTrail 管理和資料事件。

Security Lake 不會管理您的 CloudTrail 事件或影響現有的 CloudTrail 組態。若要直接管理 CloudTrail 事件的存取和保留，您必須使用 CloudTrail 服務主控台或 API。如需詳細資訊，請參閱 *AWS CloudTrail 使用者指南*中的 [使用 CloudTrail 事件歷史記錄檢視事件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

以下清單提供 GitHub 儲存庫連結至對應參考，了解 Security Lake 如何將 CloudTrail 事件標準化為 OCSF。

****適用於 CloudTrail 事件的 GitHub OCSF 儲存庫****
+ 來源版本 1 [(v1.0.0-rc.2)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.0.0-rc.2/CloudTrail)
+ 來源版本 2 [(v1.1.0)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/CloudTrail)

# Security Lake 中的 Amazon EKS 稽核日誌
<a name="eks-audit-logs"></a>

當您新增 Amazon EKS 稽核日誌做為來源時，Security Lake 會開始收集在 Elastic Kubernetes Service (EKS) 叢集中執行的 Kubernetes 資源上執行之活動的深入資訊。EKS 稽核日誌可協助您偵測 Amazon Elastic Kubernetes Service 內 EKS 叢集中的潛在可疑活動。

Security Lake 透過獨立且重複的稽核日誌串流，直接從 Amazon EKS 控制平面記錄功能取用 EKS 稽核日誌事件。此程序的設計不需要額外設定，也不會影響現有的 Amazon EKS 控制平面日誌記錄組態。如需詳細資訊，請參閱《[Amazon EKS 使用者指南》中的 Amazon EKS 控制平面記錄](https://docs.aws.amazon.com//eks/latest/userguide/control-plane-logs.html)。 ****

僅在 OCSF v1.1.0 中支援 Amazon EKS 稽核日誌。如需 Security Lake 如何將 EKS 稽核日誌事件標準化為 OCSF 的資訊，請參閱 [GitHub OCSF 儲存庫中 Amazon EKS 稽核日誌事件的映射參考 (1.1.0 版）。](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/EKS Audit Logs)

# Security Lake 中的 Route 53 解析程式查詢日誌
<a name="route-53-logs"></a>

Route 53 解析程式查詢日誌會追蹤 Amazon Virtual Private Cloud (Amazon VPC) 內資源所做的 DNS 查詢。這可協助您了解應用程式的運作方式，並找出安全威脅。

當您在 Security Lake 中將 Route 53 解析程式查詢日誌新增為來源時，Security Lake 會立即開始透過獨立且重複的事件串流，直接從 Route 53 收集您的解析程式查詢日誌。

Security Lake 不會管理您的 Route 53 日誌，也不會影響現有的解析程式查詢記錄組態。若要管理解析程式查詢日誌，您必須使用 Route 53 服務主控台。如需詳細資訊，請參閱《*Amazon Route 53 開發人員指南*》中的[管理解析程式查詢記錄組態](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-query-logging-configurations-managing.html)。

以下清單提供 GitHub 儲存庫連結至映射參考，了解 Security Lake 如何將 Route 53 日誌標準化為 OCSF。

****Route 53 日誌的 GitHub OCSF 儲存庫****
+ 來源版本 1 [(v1.0.0-rc.2)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.0.0-rc.2/Route53)
+ 來源版本 2 [(v1.1.0)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/Route53)

# Security Lake 中的 Security Hub CSPM 調查結果
<a name="security-hub-findings"></a>

Security Hub CSPM 調查結果可協助您了解 中的安全狀態， AWS 並可讓您根據安全產業標準和最佳實務檢查環境。Security Hub CSPM 會從各種來源收集問題清單，包括與其他 AWS 服務第三方產品整合的整合，以及針對 Security Hub CSPM 控制項的檢查。Security Hub CSPM 會以稱為 AWS Security Finding Format (ASFF) 的標準格式處理問題清單。

當您在 Security Lake 中將 Security Hub CSPM 調查結果新增為來源時，Security Lake 會立即開始透過獨立且重複的事件串流，直接從 Security Hub CSPM 收集您的調查結果。Security Lake 也會將調查結果從 ASFF 轉換為 [Security Lake 中的開放式網路安全結構描述架構 (OCSF)](open-cybersecurity-schema-framework.md)(OCSF)。

Security Lake 不會管理您的 Security Hub CSPM 調查結果，也不會影響 Security Hub CSPM 設定。若要管理 Security Hub CSPM 調查結果，您必須使用 Security Hub CSPM 服務主控台、API 或 AWS CLI。如需詳細資訊，請參閱*AWS Security Hub 《 使用者指南*》[中的 中的問題清單 AWS Security Hub CSPM](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings.html)。

下列清單提供 GitHub 儲存庫連結至映射參考，了解 Security Lake 如何將 Security Hub CSPM 調查結果標準化為 OCSF。

****Security Hub CSPM 調查結果的 GitHub OCSF 儲存庫****
+ 來源版本 1 [(v1.0.0-rc.2)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.0.0-rc.2/Security%20Hub)
+ 來源版本 2 [(v1.1.0)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/Security%20Hub)

# Security Lake 中的 VPC 流程日誌
<a name="vpc-flow-logs"></a>

Amazon VPC 的 VPC 流程日誌功能會擷取您環境中進出網路介面之 IP 流量的相關資訊。

當您在 Security Lake 中將 VPC 流程日誌新增為來源時，Security Lake 會立即開始收集您的 VPC 流程日誌。它透過獨立且重複的流程日誌串流，直接從 Amazon VPC 使用 VPC 流程日誌。

Security Lake 不會管理您的 VPC 流程日誌或影響您的 Amazon VPC 組態。若要管理您的流程日誌，您必須使用 Amazon VPC 服務主控台。如需詳細資訊，請參閱《*Amazon VPC 開發人員指南*[》中的使用流程日誌](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-flow-logs.html)。

下列清單提供 GitHub 儲存庫連結至映射參考，了解 Security Lake 如何將 VPC 流程日誌標準化為 OCSF。

****VPC 流程日誌的 GitHub OCSF 儲存庫****
+ 來源版本 1 [(v1.0.0-rc.2)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.0.0-rc.2/VPC%20Flowlogs)
+ 來源版本 2 [(v1.1.0)](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/VPC%20Flowlogs)

# AWS WAF Security Lake 中的日誌
<a name="aws-waf"></a>

當您在 Security Lake 中新增 AWS WAF 做為日誌來源時，Security Lake 會立即開始收集日誌。 AWS WAF 是一種 Web 應用程式防火牆，可用來監控最終使用者傳送到您應用程式的 Web 請求，以及控制對內容的存取。記錄的資訊包括從您的 AWS 資源 AWS WAF 接收 Web 請求的時間、請求的詳細資訊，以及請求相符規則的詳細資訊。

Security Lake AWS WAF 透過獨立且重複的 AWS WAF 日誌串流，直接從 取用日誌。此程序的設計不需要額外的設定或影響現有的 AWS WAF 組態。Security Lake 日誌只會擷取 [Web 存取控制清單 (Web ACL)](https://docs.aws.amazon.com/waf/latest/developerguide/web-acl.html) 組態允許 AWS WAF 的資料。如果 Security Lake 帳戶中的 Web ACL 已啟用[資料保護](https://docs.aws.amazon.com/waf/latest/developerguide/waf-data-protection-and-logging.html)，產生的資料將根據您的 Web ACL 設定進行修訂或雜湊處理。如需有關使用 AWS WAF 來保護應用程式資源的資訊，請參閱《 *AWS WAF 開發人員指南*》中的 [如何 AWS WAF 運作](https://docs.aws.amazon.com/waf/latest/developerguide/how-aws-waf-works.html)。

**重要**  
如果您使用 Amazon CloudFront 分佈做為 中的資源類型 AWS WAF，則必須選取美國東部 （維吉尼亞北部） 以擷取 Security Lake 中的全域日誌。

AWS WAF 日誌僅在 OCSF v1.1.0 中受支援。如需 Security Lake 如何將 AWS WAF 日誌事件標準化為 OCSF 的資訊，請參閱 [GitHub OCSF AWS WAF 日誌儲存庫中的映射參考 (1.1.0 版）。](https://github.com/ocsf/examples/tree/main/mappings/markdown/AWS/v1.1.0/WAF)

## 移除 AWS 服務 做為來源
<a name="remove-internal-sources"></a>

選擇您的存取方法，並依照下列步驟移除原生支援的 AWS 服務 Security Lake 來源。您可以移除一或多個區域的來源。當您移除來源時，Security Lake 會停止從指定區域和帳戶中的來源收集資料，而且訂閱者無法再從來源取用新資料。不過，訂閱者仍然可以使用 Security Lake 在移除之前從來源收集的資料。您只能使用這些指示來移除原生支援的 AWS 服務 來源。如需移除自訂來源的詳細資訊，請參閱 [從 Security Lake 中的自訂來源收集資料](custom-sources.md)。

------
#### [ Console ]

1. 開啟位於 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 的 Security Lake 主控台。

1. 從導覽窗格中選擇**來源**。

1. 選取來源，然後選擇**停用**。

1. 選取您要停止從此來源收集資料的 區域。Security Lake 將停止從來源收集所選區域中*所有*帳戶的資料。

------
#### [ API ]

若要以程式設計方式移除 AWS 服務 做為來源，請使用 Security Lake API 的 [DeleteAwsLogSource](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_DeleteAwsLogSource.html) 操作。如果您使用的是 AWS Command Line Interface (AWS CLI)，請執行 [delete-aws-log-source](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-aws-log-source.html) 命令。`sourceName` 和 `regions` 是必要參數。或者，您可以將移除的範圍限制為特定 `accounts`或特定 `sourceVersion`。

**重要**  
當您未在命令中提供參數時，Security Lake 會假設缺少的參數參照整個集合。例如，如果您不提供 `accounts` 參數 ，則 命令會套用至組織中的整組帳戶。

下列範例會移除 VPC 流程日誌，做為指定帳戶和區域中的來源。

```
$ aws securitylake delete-aws-log-source \
--sources sourceName=VPC_FLOW,accounts='["123456789012", "111122223333"]',regions='["us-east-1", "us-east-2"]',sourceVersion="2.0"
```

下列範例會移除 Route 53 做為指定帳戶和區域中的來源。

```
$ aws securitylake delete-aws-log-source \
--sources sourceName=ROUTE53,accounts='["123456789012"]',regions='["us-east-1", "us-east-2"]',sourceVersion="2.0"
```

上述範例已針對 Linux、macOS 或 Unix 進行格式化，並使用反斜線 (\$1) 換行字元來改善可讀性。

------