使用 BatchUpdateFindings 更新结果 - AWS Security Hub

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

使用 BatchUpdateFindings 更新结果

BatchUpdateFindings 操作用于更新与客户处理调查发现提供商的调查发现相关的信息。它可以由客户使用,也可以由工单SIEM、事件管理或代表客户使用的SOAR工具使用。您可以使用BatchUpdateFindings更新 AWS 安全调查结果格式中的特定字段 (ASFF)。

您不能使用 BatchUpdateFindings 来创建新调查发现。您可以用它来一次更新多达 100 个结果。

每当 Security Hub 收到更新调查结果的BatchUpdateFindings请求时,它都会自动在亚马逊中生成一个Security Hub Findings - Imported事件 EventBridge。请参阅 自动响应和补救

BatchUpdateFindings不会更改查找结果的UpdatedAt字段。 UpdatedAt仅反映搜索结果提供者的最新更新。

BatchUpdateFindings 可用字段

管理员账户可以使用 >BatchUpdateFindings 更新其账户或其成员账户的调查发现。成员账户可以使用 >BatchUpdateFindings 更新其账户的调查发现。

客户只能使用 >BatchUpdateFindings 来更新以下字段和对象。

  • Confidence

  • Criticality

  • Note

  • RelatedFindings

  • Severity

  • Types

  • UserDefinedFields

  • VerificationState

  • Workflow

默认情况下,管理员和成员账户有权访问上述所有字段和字段值。Security Hub 还提供上下文键,允许您限制对字段和字段值的访问。

例如,您可能只允许将成员账户从 Workflow.Status 设置为 RESOLVED。或者,您可能不允许成员账户更改 Severity.Label

配置对 BatchUpdateFindings 的访问权限

您可以将IAM策略配置为限制访问权限,BatchUpdateFindings用于更新字段和字段值。

在限制访问 BatchUpdateFindings 的语句中,使用以下值:

  • Actionsecurityhub:BatchUpdateFindings

  • EffectDeny

  • 对于 Condition,您可以根据以下条件拒绝 BatchUpdateFindings 请求:

    • 调查发现包括一个特定的字段。

    • 调查发现包括一个特定的字段值。

条件键

这些是限制访问 BatchUpdateFindings 的条件键。

ASFF 字段

ASFF字段的条件键如下所示:

securityhub:ASFFSyntaxPath/<fieldName>

<fieldName>替换为ASFF字段。配置访问权限时BatchUpdateFindings,请在IAM策略中包含一个或多个特定ASFF字段,而不是父级字段。例如,要限制对 Workflow.Status 字段的访问权限,您必须在策略中包含 securityhub:ASFFSyntaxPath/Workflow.Status 而不是 Workflow 父级字段。

禁止对某个字段进行所有更新

要防止用户对特定字段进行任何更新,请使用如下条件:

"Condition": { "Null": { "securityhub:ASFFSyntaxPath/<fieldName>": "false" } }

例如,以下语句表示 BatchUpdateFindings 不能用于更新工作流程状态。

{ "Sid": "VisualEditor0", "Effect": "Deny", "Action": "securityhub:BatchUpdateFindings", "Resource": "*", "Condition": { "Null": { "securityhub:ASFFSyntaxPath/Workflow.Status": "false" } } }

禁用特定的字段值

要防止用户将字段设置为特定值,请使用如下条件:

"Condition": { "StringEquals": { "securityhub:ASFFSyntaxPath/<fieldName>": "<fieldValue>" } }

例如,以下语句表示 BatchUpdateFindings 不能用于把 Workflow.Status 设置为 SUPPRESSED

{ "Sid": "VisualEditor0", "Effect": "Deny", "Action": "securityhub:BatchUpdateFindings", "Resource": "*", "Condition": { "StringEquals": { "securityhub:ASFFSyntaxPath/Workflow.Status": "SUPPRESSED" } }

您还可以提供不允许的值的列表。

"Condition": { "StringEquals": { "securityhub:ASFFSyntaxPath/<fieldName>": [ "<fieldValue1>", "<fieldValue2>", "<fieldValuen>" ] } }

例如,以下语句表示BatchUpdateFindings 不能用于把 Workflow.Status 设置为 RESOLVEDSUPPRESSED

{ "Sid": "VisualEditor0", "Effect": "Deny", "Action": "securityhub:BatchUpdateFindings", "Resource": "*", "Condition": { "StringEquals": { "securityhub:ASFFSyntaxPath/Workflow.Status": [ "RESOLVED", "NOTIFIED" ] } }

使用来自的 batch-update-findings命令 AWS CLI

在中 AWS Command Line Interface,您可以使用batch-update-findings命令更新调查结果。

对于每个要更新的搜索结果,您都需要提供查找结果ID和生成查找结果的产品。ARN

--finding-identifiers ID="<findingID1>",ProductArn="<productARN>" ID="<findingID2>",ProductArn="<productARN2>"

在提供要更新的属性时,可以使用JSON格式或快捷方式格式。

以下是使用以下JSON格式更新Note对象的示例:

--note '{"Text": "Known issue that is not a risk.", "UpdatedBy": "user1"}'

以下是使用快捷方式格式的相同更新:

--note Text="Known issue that is not a risk.",UpdatedBy="user1"

《 AWS CLI 命令参考》提供了每个字段的JSON和快捷语法。

以下 >batch-update-findings 示例更新了两个结果,以添加注释、更改严重性标签并解决这些问题。

aws securityhub batch-update-findings --finding-identifiers Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",ProductArn="arn:aws:securityhub:us-west-2::product/aws/securityhub" Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",ProductArn="arn:aws:securityhub:us-west-1::product/aws/securityhub" --note '{"Text": "Known issue that is not a risk.", "UpdatedBy": "user1"}' --severity '{"Label": "LOW"}' --workflow '{"Status": "RESOLVED"}'

这是同样的示例,但使用的是快捷方式而不是JSON。

aws securityhub batch-update-findings --finding-identifiers Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",ProductArn="arn:aws:securityhub:us-west-1::product/aws/securityhub" Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",ProductArn="arn:aws:securityhub:us-west-1::product/aws/securityhub" --note Text="Known issue that is not a risk.",UpdatedBy="user1" --severity Label="LOW" --workflow Status="RESOLVED"