本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定 Microsoft Azure 以與 Security Hub CSPM 整合
完成先決條件任務後,您可以將 Microsoft Azure 環境設定為支援與 AWS Security Hub CSPM 整合。為了協助您執行此操作,Security Hub CSPM 主控台會產生為您的組態自訂的設定指令碼。
若要產生指令碼,請執行下列動作:
-
開啟 Security Hub CSPM 主控台。
-
在導覽窗格中選擇整合。
-
選擇建立 Azure 連接器。
-
完成連接器組態 (租戶 ID、範圍和名稱),然後複製產生的設定指令碼。
若要執行指令碼,請使用 Azure CLI 並使用全域管理員帳戶進行驗證 (az login)。
當您執行指令碼時,它會執行一系列任務。下列各節說明指令碼執行的每個任務。如果您的組織限制指令碼執行,您可以使用此主題做為指南,手動執行這些任務。設定 Azure 環境之後,您可以將 Security Hub CSPM 設定為與 Azure 整合。
注意
單一 Azure 應用程式註冊會跨 AWS 安全服務共用。如果您也使用 Security Hub 或 Amazon Inspector for Azure,它們會使用相同的應用程式註冊。您不需要為每個 AWS 服務建立個別的註冊。
步驟 1:註冊 Azure 應用程式
在 Microsoft Entra ID 中註冊新的應用程式。此應用程式做為 AWS 使用聯合登入資料對您的 Azure 環境進行身分驗證的身分。不需要用戶端秘密。
$az ad app create --display-name "AWSSecurityHubIntegration"
請注意來自輸出的應用程式 (用戶端) ID appId ( 屬性)。在 Security Hub CSPM 主控台中建立連接器時,您會提供此值。
步驟 2:建立服務主體
為已註冊的應用程式建立服務主體。您可以使用 Azure 角色指派將許可授予服務委託人。服務主體會在您的 Azure 環境中執行動作。
$az ad sp create --idapplication-client-id
其中 application-client-id 是上一個步驟的應用程式 (用戶端) ID。
步驟 3:設定聯合身分憑證
在應用程式上設定聯合身分憑證,讓 在沒有用戶端秘密的情況下 AWS 進行身分驗證。這會在 AWS 和 Azure 之間建立 OIDC 信任。不會儲存任何長期秘密或登入資料。
$az ad app federated-credential create \ --idapplication-client-id\ --parameters '{ "name": "AWSConfigFederation", "issuer": "token-issuer-url", "subject": "arn:aws:iam::account-id:role/aws-service-role/thirdparty.config.amazonaws.com/AWSServiceRoleForConfigThirdParty", "audiences": ["api://AzureADTokenExchange"], "description": "Federation for AWS Config third-party cloud resource discovery" }'
索引鍵值:
-
發行者 – 來自 IAM Outbound Identity Federation 的字符發行者 URL。這遵循格式
https://。uuid.tokens.sts.global.api.aws -
主旨 – 您 中
AWSServiceRoleForConfigThirdParty服務連結角色的 ARN AWS 帳戶。 會在連接器設定期間自動 AWS 建立此服務連結角色。 -
對象 –
api://AzureADTokenExchange(工作負載聯合身分的標準值)。
步驟 4:指派讀取器角色
將 Reader 角色指派給租用戶根管理群組範圍內的服務主體。這會授予租用戶中所有訂閱的所有 Azure 資源的唯讀存取權。
$az role assignment create \ --assigneeapplication-client-id\ --role "Reader" \ --scope "/providers/Microsoft.Management/managementGroups/tenant-id"
注意
如果此步驟失敗,請確認 Microsoft Entra ID > 屬性中 Azure 資源的存取管理設定為是。然後登出並重新登入以重新整理您的字符。
步驟 5:設定 Microsoft Graph API 許可
將下列 Microsoft Graph API 許可 (應用程式類型) 授予應用程式,然後授予管理員同意:
-
Directory.Read.All -
AuditLog.Read.All -
Policy.Read.All
$az ad app permission admin-consent --idapplication-client-id
步驟 6:設定 Azure Event Hub
AWS Config 使用 Azure Event Hub 接收 Azure 環境中資源組態變更的近乎即時通知。設定指令碼會建立 Event Hub 基礎設施並將其標記為探索。
$az group create \ --name "aws-securityhub-integration" \ --locationevent-hub-region$ az eventhubs namespace create \ --resource-group "aws-securityhub-integration" \ --name "aws-securityhub-account-id" \ --locationevent-hub-region\ --sku Standard $ az eventhubs eventhub create \ --resource-group "aws-securityhub-integration" \ --namespace-name "aws-securityhub-account-id" \ --name "activitylog" \ --message-retention 1 \ --partition-count 4 $ az eventhubs eventhub consumer-group create \ --resource-group "aws-securityhub-integration" \ --namespace-name "aws-securityhub-account-id" \ --eventhub-name "activitylog" \ --name "AWSConfig"
建立 Event Hub 之後,標記要探索的命名空間,並指派資料接收者角色:
$az tag create \ --resource-idnamespace-resource-id\ --tags "AWSConfig-account-id-region=activitylog" $ az role assignment create \ --assigneeapplication-client-id\ --role "Azure Event Hubs Data Receiver" \ --scopenamespace-resource-id
注意
在標籤格式 中AWSConfig-,account-id-regionaccount-id 是您的 12 位數 AWS 帳戶 ID,而 region 是您要建立連接器 AWS 區域 的 (例如 us-east-1)。這些值會識別擁有此 Event Hub 整合的 AWS 帳戶 和 區域。
金鑰組態:
-
命名空間 SKU – 標準 (取用者群組需要)。
-
Event Hub 名稱 –
activitylog。 -
取用者群組 –
AWSConfig。 -
標籤 –
AWSConfig-值為account-id-regionactivitylog。此標籤可讓 自動 AWS Config 探索 Event Hub。 -
角色指派 – 命名空間上的 Azure Event Hubs Data Receiver。
步驟 7:設定活動日誌和 Entra ID 稽核日誌匯出
設定 Azure 將活動日誌和 Entra ID 稽核日誌匯出至 Event Hub。
活動日誌匯出:
在每個訂閱上設定診斷設定,將活動日誌匯出至 Event Hub。設定指令碼會自動為所有受監控的訂閱設定此項目。活動日誌會擷取訂閱層級的活動,包括角色指派和資源變更。
Entra ID 稽核日誌匯出:
在 Microsoft Entra ID 上設定診斷設定,將稽核日誌匯出至相同的 Event Hub。導覽至 Microsoft Entra ID > 監控 > 診斷設定 > 新增診斷設定。啟用 AuditLogs 並將其路由到您的 Event Hub。
Microsoft Defender for Cloud 持續匯出 (選用):
若要將 Defender for Cloud 安全提醒轉送至 Security Hub CSPM,請設定連續匯出至 Event Hub。在 Azure 入口網站中,導覽至 Microsoft Defender for Cloud > Environment settings > select subscription > Continuous export。選取 Event Hub 做為匯出目標,然後選擇您的 Event Hub 命名空間。啟用安全提醒做為匯出資料類型。
Amazon Inspector 資料事件組態 (選用):
如果您計劃使用 Amazon Inspector for Azure VM scanning,則需要額外的資料事件組態。如需設定 Inspector 特定資料事件的詳細資訊,請參閱 Azure 整合的 Amazon Inspector 文件。