檢視次數:

確保您已建立資源資料的查詢以用於您的自訂規則。

查詢資源資料:
  1. 檢索現有規則的檢查資料。
    • 從您的雲端環境中選擇一個已被Cloud Risk Management支援的現有規則、服務或資源類型。
    • 使用適當的篩選器查詢檢查端點 - 列出帳戶檢查
    • 從檢查回應中,請注意您選擇資源的providerservicedescriptorTyperesource
  2. 使用自訂規則的執行端點查詢資料。
  3. 對於請求主體,請使用以下範本。將從檢查 API 回應中獲得的 providerservicedescriptorTyperesource 的值分別插入到 providerserviceresourceTyperesourceId 的值中。其餘的值為佔位符。
  4. 回應應包含一個results陣列。陣列項目的物件應具有以下屬性:a) 檢查回應("status": "SUCCESS"),以及 b) extraData
    {
        "accountId": "dfc5c4f0-b480-4bf5-9668-20ef9a79a8eb",
        "configuration": {
            "name": "S3 bucket has any Encryption",
            "description": "We want to demonstrate Custom Rules V1",
            "categories": [
                "security"
            ],
            "riskLevel": "MEDIUM",
            "provider": "aws",
            "enabled": true,
            "service": "S3",
            "resourceType": "s3-bucket",
            "remediationNote": "To remediate, follow these steps:\n1. Step one \n2. Step two\n",
            "attributes": [
                {
                    "name": "bucketEncryption",
                    "path": "data.Encryption",
                    "required": true
                }
            ],
            "eventRules": [
                {
                    "conditions": {
                        "all": [
                            {
                                "fact": "bucketEncryption",
                                "operator": "notEqual",
                                "value": null
                            }
                        ]
                    },
                    "description": "Bucket has encryption enabled"
                }
            ]
        }
    }