管理 Fargate 的自动安全代理(仅限亚马ECS逊) - Amazon GuardDuty

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

管理 Fargate 的自动安全代理(仅限亚马ECS逊)

运行时监控仅支持通过管理您的 Amazon ECS 集群 (AWS Fargate) 的安全代理 GuardDuty。不支持在 Amazon ECS 集群上手动管理安全代理。

在继续完成本节中的步骤之前,务必要满足AWS Fargate (ECS仅限 Amazon)支持的先决条件部分的要求。

根据选择首选方法为您的资源启用 GuardDuty 自动代理。 在 Amazon ECS-Fargate 资源中管理 GuardDuty 安全代理的方法

内容

    在多账户环境中,只有委派的 GuardDuty 管理员账户才能启用或禁用成员账户的自动代理配置,以及管理属于其组织中成员账户的 Amazon ECS 集群的自动代理配置。 GuardDuty 成员账户无法修改此配置。委托 GuardDuty 管理员账户使用管理其成员账户 AWS Organizations。有关多账户环境的更多信息,请参阅中的管理多个账户。 GuardDuty

    为委派的 GuardDuty 管理员账户启用自动代理配置

    Manage for all Amazon ECS clusters (account level)

    如果对于“运行时监控”您选择了为所有账户启用,您将有以下选项:

    • 在 “自动代理配置” 部分为所有账户选择 “启用”。 GuardDuty 将为所有已启动的 Amazon ECS 任务部署和管理安全代理。

    • 选择手动配置账户

    如果您在“运行时监控”部分选择了手动配置账户,请执行以下操作:

    1. 在“自动代理配置”部分下选择手动配置账户

    2. 在 “委派 GuardDuty 管理员账户(此账户)” 部分选择 “启用”。

    选择保存

    如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

    有关更新服务的步骤,请参阅以下资源:

    Manage for all Amazon ECS clusters but exclude some of the clusters (cluster level)
    1. 向此 Amazon ECS 集群添加一个标签,键值对为 GuardDutyManaged-。false

    2. 阻止修改标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    3. 打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    4. 在导航窗格中,选择运行时监控

    5. 注意

      在为您的账户启用自动代理配置之前,请务必将排除标签添加到您的亚马逊ECS集群;否则,s GuardDuty idecar 容器将附加到已启动的 Amazon ECS 任务中的所有容器上。

      配置选项卡下,选择自动代理配置中的启用

      对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

    6. 选择保存

    7. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for selective (inclusion only) Amazon ECS clusters (cluster level)
    1. 向要包含其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-true

    2. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
      注意

      在 Amazon ECS 集群中使用包含标签时,您无需通过自动 GuardDuty 代理配置明确启用代理。

    3. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    为所有成员账户自动启用

    Manage for all Amazon ECS clusters (account level)

    以下步骤假设您在“运行时监控”部分选择了为所有账户启用

    1. 在 “自动代理配置” 部分为所有账户选择 “启用”。 GuardDuty 将为所有已启动的 Amazon ECS 任务部署和管理安全代理。

    2. 选择保存

    3. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for all Amazon ECS clusters but exclude some of the clusters (cluster level)
    1. 向此 Amazon ECS 集群添加一个标签,键值对为 GuardDutyManaged-。false

    2. 阻止修改标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    3. 打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    4. 在导航窗格中,选择运行时监控

    5. 注意

      在为您的账户启用自动代理配置之前,请务必将排除标签添加到您的亚马逊ECS集群;否则,s GuardDuty idecar 容器将附加到已启动的 Amazon ECS 任务中的所有容器上。

      配置选项卡下,选择编辑

    6. 自动代理配置部分选择为所有账户启用

      对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

    7. 选择保存

    8. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for selective (inclusion-only) Amazon ECS clusters (cluster level)

    无论您选择如何启用运行时监控,以下步骤都将帮助您监控组织中所有成员账户的精选 Amazon ECS Fargate 任务。

    1. 请勿启用“自动代理配置”部分中的任何配置。确保运行时监控配置与上一步中选择的配置相同。

    2. 选择保存

    3. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
      注意

      在 Amazon ECS 集群中使用包含标签时,您无需明确启用GuardDuty 代理自动管理

    4. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    为现有活动成员账户启用自动代理配置

    Manage for all Amazon ECS clusters (account level)
    1. 在“运行时监控”页面的配置选项卡下,您可以查看自动代理配置的当前状态。

    2. 在“自动代理配置”窗格中的活动成员账户部分下,选择操作

    3. 操作中,选择为所有现有活跃成员账户启用

    4. 选择确认

    5. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for all Amazon ECS clusters but exclude some of the clusters (cluster level)
    1. 向此 Amazon ECS 集群添加一个标签,键值对为 GuardDutyManaged-。false

    2. 阻止修改标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    3. 打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    4. 在导航窗格中,选择运行时监控

    5. 注意

      在为您的账户启用自动代理配置之前,请务必将排除标签添加到您的亚马逊ECS集群;否则,s GuardDuty idecar 容器将附加到已启动的 Amazon ECS 任务中的所有容器上。

      在“自动代理配置”部分的配置选项卡下,选择活动成员账户下的操作

    6. 操作中,选择为所有活跃成员账户启用

      对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

    7. 选择确认

    8. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for selective (inclusion only) Amazon ECS clusters (cluster level)
    1. 向要包含其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-true

    2. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
      注意

      在 Amazon ECS 集群中使用包含标签时,您无需明确启用自动代理配置

    3. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    为新成员自动启用自动代理配置

    Manage for all Amazon ECS clusters (account level)
    1. 在“运行时监控”页面上,选择编辑以更新现有配置。

    2. 在“自动代理配置”部分中选择为新成员账户自动启用

    3. 选择保存

    4. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for all Amazon ECS clusters but exclude some of the clusters (cluster level)
    1. 向此 Amazon ECS 集群添加一个标签,键值对为 GuardDutyManaged-。false

    2. 阻止修改标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    3. 打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    4. 在导航窗格中,选择运行时监控

    5. 注意

      在为您的账户启用自动代理配置之前,请务必将排除标签添加到您的亚马逊ECS集群;否则,s GuardDuty idecar 容器将附加到已启动的 Amazon ECS 任务中的所有容器上。

      配置选项卡下,选择自动代理配置部分中的为新成员账户自动启用

      对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

    6. 选择保存

    7. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for selective (inclusion only) Amazon ECS clusters (cluster level)
    1. 向要包含其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-true

    2. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
      注意

      在 Amazon ECS 集群中使用包含标签时,您无需明确启用自动代理配置

    3. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    有选择地为活动成员账户启用自动代理配置

    Manage for all Amazon ECS (account level)
    1. 在 “帐户” 页面上,选择要为其启用运行时监控-自动代理配置 (ECS-Fargate) 的帐户。您可以选择多个账户。确保您在此步骤中选择的账户已启用运行时监控。

    2. 编辑保护计划中,选择相应的选项以启用运行时监控-自动代理配置 (ECS-F argate)。

    3. 选择确认

    4. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for all Amazon ECS clusters but exclude some of the clusters (cluster level)
    1. 向此 Amazon ECS 集群添加一个标签,键值对为 GuardDutyManaged-。false

    2. 阻止修改标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    3. 打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    4. 在导航窗格中,选择运行时监控

    5. 注意

      在为您的账户启用 GuardDuty 代理自动管理之前,请务必将排除标签添加到您的 Amazon ECS 集群;否则,s GuardDuty idecar 容器将附加到已启动的 Amazon ECS 任务中的所有容器上。

      在 “帐户” 页面上,选择要为其启用运行时监控-自动代理配置 (ECS-Fargate) 的帐户。您可以选择多个账户。确保您在此步骤中选择的账户已启用运行时监控。

      对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

    6. 编辑保护计划中,选择相应的选项以启用运行时监控-自动代理配置 (ECS-F argate)。

    7. 选择保存

    8. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    Manage for selective (inclusion only) Amazon ECS clusters (cluster level)
    1. 确保不要为拥有要监控的 Amazon ECS 集群的选定账户启用自动代理配置(或运行时监控 ECS-自动代理配置 (-Fargate))。

    2. 向要包含其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-true

    3. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

      { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
      注意

      在 Amazon ECS 集群中使用包含标签时,您无需明确启用自动代理配置

    4. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源:

    1. 登录 AWS Management Console 并打开 GuardDuty 控制台,网址为https://console.aws.amazon.com/guardduty/

    2. 在导航窗格中,选择运行时监控

    3. 配置选项卡下:

      1. 管理所有 Amazon ECS 集群的自动代理配置(账户级别)

        在 “自动代理配置” 部分中选择 “启用AWS Fargate (ECS仅限)。当新的 Fargate Amazon ECS 任务启动时, GuardDuty 将管理安全代理的部署。

        1. 选择保存

      2. 通过排除某些 Amazon ECS 集群来管理自动代理配置(集群级别)
        1. 向要排除其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-false

        2. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

          { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
        3. 配置选项卡下,选择自动代理配置部分中的启用

          注意

          在为您的账户启用 GuardDuty 代理自动管理之前,请务必将排除标签添加到您的 Amazon ECS 集群;否则,将在相应的 Amazon ECS 集群内启动的所有任务中部署安全代理。

          对于尚未排除的 Amazon ECS 集群, GuardDuty将管理安全代理在 sidecar 容器中的部署。

        4. 选择保存

      3. 通过包含一些 Amazon ECS 集群来管理自动代理配置(集群级别)
        1. 向要包含其所有任务的 Amazon ECS 集群添加标签。键值对必须是 GuardDutyManaged-true

        2. 阻止修改这些标签,可信实体除外。《AWS Organizations 用户指南》中 Prevent tags from being modified except by authorized principles 部分提供的策略已经修改,以便在此处适用。

          { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyModifyTagsIfResAuthzTagAndPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "ecs:ResourceTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "ecs:ResourceTag/GuardDutyManaged": false } } }, { "Sid": "DenyModifyResAuthzTagIfPrinTagDontMatch", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:RequestTag/GuardDutyManaged": "${aws:PrincipalTag/GuardDutyManaged}", "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "ForAnyValue:StringEquals": { "aws:TagKeys": [ "GuardDutyManaged" ] } } }, { "Sid": "DenyModifyTagsIfPrinTagNotExists", "Effect": "Deny", "Action": [ "ecs:TagResource", "ecs:UntagResource" ], "Resource": [ "*" ], "Condition": { "StringNotEquals": { "aws:PrincipalArn": "arn:aws:iam::123456789012:role/org-admins/iam-admin" }, "Null": { "aws:PrincipalTag/GuardDutyManaged": true } } } ] }
    4. 如果 GuardDuty 要监控属于服务一部分的任务,则需要在启用运行时监控后部署新的服务。如果特定ECS服务的上次部署是在启用运行时监控之前启动的,则可以重新启动该服务,也可以使用更新服务forceNewDeployment

      有关更新服务的步骤,请参阅以下资源: