Skip to content

batch_update_findings_v2 async

batch_update_findings_v2(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    metadata_uids: Optional[MetadataUidList] = None,
    finding_identifiers: Optional[OcsfFindingIdentifierList] = None,
    comment: Optional[NonEmptyString] = None,
    severity_id: Optional[Integer] = None,
    status_id: Optional[Integer] = None,
) -> BatchUpdateFindingsV2Response

Updates information about a customer's investigation into a finding. Delegated administrator accounts can update findings for their account and their member accounts. Member accounts can update findings for their own account.

BatchUpdateFindings and BatchUpdateFindingsV2 both use securityhub:BatchUpdateFindings in the Action element of an IAM policy statement. You must have permission to perform the securityhub:BatchUpdateFindings action. You can configure IAM policies to restrict access to specific finding fields or field values by using the securityhub:OCSFSyntaxPath/ condition key, where is one of the following supported fields: SeverityId, StatusId, or Comment.

To prevent a user from updating a specific field, use a Null condition with securityhub:OCSFSyntaxPath/ set to "false". To prevent a user from setting a field to a specific value, use a StringEquals condition with securityhub:OCSFSyntaxPath/ set to the disallowed value or list of values.

Updates from BatchUpdateFindingsV2 don't affect the value of finding_info.modified_time, finding_info.modified_time_dt, time, or time_dt for a finding.

Parameters:

  • metadata_uids (Optional[MetadataUidList], default: None ) –

    The list of finding metadata.uid to indicate findings to update. Finding metadata.uid is a globally unique identifier associated with the finding. Customers cannot use MetadataUids together with FindingIdentifiers.

  • finding_identifiers (Optional[OcsfFindingIdentifierList], default: None ) –

    Provides information to identify a specific V2 finding.

  • comment (Optional[NonEmptyString], default: None ) –

    The updated value for a user provided comment about the finding. Minimum character length 1. Maximum character length 512.

  • severity_id (Optional[Integer], default: None ) –

    The updated value for the normalized severity identifier. The severity ID is an integer with the allowed enum values [0, 1, 2, 3, 4, 5, 6, 99]. When customer provides the updated severity ID, the string sibling severity will automatically be updated in the finding.

  • status_id (Optional[Integer], default: None ) –

    The updated value for the normalized status identifier. The status ID is an integer with the allowed enum values [0, 1, 2, 3, 4, 5, 99]. When customer provides the updated status ID, the string sibling status will automatically be updated in the finding.

Raises:

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def batch_update_findings_v2(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    metadata_uids: Optional[
        "capo_securityhub.types.metadata_uid_list.MetadataUidList"
    ] = None,
    finding_identifiers: Optional[
        "capo_securityhub.types.ocsf_finding_identifier_list.OcsfFindingIdentifierList"
    ] = None,
    comment: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    severity_id: Optional["capo_securityhub.types.integer.Integer"] = None,
    status_id: Optional["capo_securityhub.types.integer.Integer"] = None,
) -> "capo_securityhub.types.batch_update_findings_v2_response.BatchUpdateFindingsV2Response":
    """<p>Updates information about a customer's investigation into a finding. Delegated administrator accounts can update findings for their account and their member accounts. Member accounts can update findings for their own account.</p> <p> <code>BatchUpdateFindings</code> and <code>BatchUpdateFindingsV2</code> both use <code>securityhub:BatchUpdateFindings</code> in the <code>Action</code> element of an IAM policy statement. You must have permission to perform the <code>securityhub:BatchUpdateFindings</code> action. You can configure IAM policies to restrict access to specific finding fields or field values by using the <code>securityhub:OCSFSyntaxPath/<fieldName></code> condition key, where <code><fieldName></code> is one of the following supported fields: <code>SeverityId</code>, <code>StatusId</code>, or <code>Comment</code>.</p> <p>To prevent a user from updating a specific field, use a <code>Null</code> condition with <code>securityhub:OCSFSyntaxPath/<fieldName></code> set to <code>"false"</code>. To prevent a user from setting a field to a specific value, use a <code>StringEquals</code> condition with <code>securityhub:OCSFSyntaxPath/<fieldName></code> set to the disallowed value or list of values.</p> <p>Updates from <code>BatchUpdateFindingsV2</code> don't affect the value of <code>finding_info.modified_time</code>, <code>finding_info.modified_time_dt</code>, <code>time</code>, or <code>time_dt</code> for a finding.</p>

    Args:
        metadata_uids: <p>The list of finding <code>metadata.uid</code> to indicate findings to update. Finding <code>metadata.uid</code> is a globally unique identifier associated with the finding. Customers cannot use <code>MetadataUids</code> together with <code>FindingIdentifiers</code>.</p>
        finding_identifiers: <p>Provides information to identify a specific V2 finding.</p>
        comment: <p>The updated value for a user provided comment about the finding. Minimum character length 1. Maximum character length 512.</p>
        severity_id: <p>The updated value for the normalized severity identifier. The severity ID is an integer with the allowed enum values [0, 1, 2, 3, 4, 5, 6, 99]. When customer provides the updated severity ID, the string sibling severity will automatically be updated in the finding.</p>
        status_id: <p>The updated value for the normalized status identifier. The status ID is an integer with the allowed enum values [0, 1, 2, 3, 4, 5, 99]. When customer provides the updated status ID, the string sibling status will automatically be updated in the finding.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.conflict_exception.ConflictException: <p>The request causes conflict with the current state of the service resource.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.batch_update_findings_v2_request.BatchUpdateFindingsV2Request]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.batch_update_findings_v2_response.BatchUpdateFindingsV2Response"
    ]:
        import capo_securityhub._operations.security_hub_api_service.batch_update_findings_v2

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.batch_update_findings_v2.async_batch_update_findings_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchUpdateFindingsV2")
    )
    input_: capo_securityhub.types.batch_update_findings_v2_request.BatchUpdateFindingsV2Request = {}
    if metadata_uids is not None:
        input_["metadata_uids"] = metadata_uids
    if finding_identifiers is not None:
        input_["finding_identifiers"] = finding_identifiers
    if comment is not None:
        input_["comment"] = comment
    if severity_id is not None:
        input_["severity_id"] = severity_id
    if status_id is not None:
        input_["status_id"] = status_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output