Skip to content

list_standards_control_associations

list_standards_control_associations(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    security_control_id: Optional[NonEmptyString] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListStandardsControlAssociationsResponse

Specifies whether a control is currently enabled or disabled in each enabled standard in the calling account.

This operation omits standards control associations for standard subscriptions where StandardsControlsUpdatable has value NOT_READY_FOR_UPDATES.

Parameters:

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

    The identifier of the control (identified with SecurityControlId, SecurityControlArn, or a mix of both parameters) that you want to determine the enablement status of in each enabled standard.

  • next_token (Optional[NextToken], default: None ) –

    Optional pagination parameter.

  • max_results (Optional[MaxResults], default: None ) –

    An optional parameter that limits the total results of the API response to the specified number. If this parameter isn't provided in the request, the results include the first 25 standard and control associations. The results also include a NextToken parameter that you can use in a subsequent API call to get the next 25 associations. This repeats until all associations for the specified control are returned. The number of results is limited by the number of supported Security Hub CSPM standards that you've enabled in the calling account.

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_securityhub/_services/security_hub.py
def list_standards_control_associations(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    security_control_id: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
    max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
) -> "capo_securityhub.types.list_standards_control_associations_response.ListStandardsControlAssociationsResponse":
    """<p> Specifies whether a control is currently enabled or disabled in each enabled standard in the calling account. </p> <p>This operation omits standards control associations for standard subscriptions where <code>StandardsControlsUpdatable</code> has value <code>NOT_READY_FOR_UPDATES</code>.</p>

    Args:
        security_control_id: <p> The identifier of the control (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters) that you want to determine the enablement status of in each enabled standard. </p>
        next_token: <p> Optional pagination parameter. </p>
        max_results: <p> An optional parameter that limits the total results of the API response to the specified number. If this parameter isn't provided in the request, the results include the first 25 standard and control associations. The results also include a <code>NextToken</code> parameter that you can use in a subsequent API call to get the next 25 associations. This repeats until all associations for the specified control are returned. The number of results is limited by the number of supported Security Hub CSPM standards that you've enabled in the calling account. </p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.list_standards_control_associations_request.ListStandardsControlAssociationsRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.list_standards_control_associations_response.ListStandardsControlAssociationsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.list_standards_control_associations

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.list_standards_control_associations.list_standards_control_associations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListStandardsControlAssociations")
    )
    input_: capo_securityhub.types.list_standards_control_associations_request.ListStandardsControlAssociationsRequest = {}
    if security_control_id is not None:
        input_["security_control_id"] = security_control_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output