Skip to content

list_security_control_definitions async

list_security_control_definitions(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_arn: Optional[NonEmptyString] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    providers: Optional[SecurityControlsProviders] = None,
) -> ListSecurityControlDefinitionsResponse

Lists all of the security controls that apply to a specified standard.

Parameters:

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

    The Amazon Resource Name (ARN) of the standard that you want to view controls for.

  • 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 security controls that apply to the specified standard. The results also include a NextToken parameter that you can use in a subsequent API call to get the next 25 controls. This repeats until all controls for the standard are returned.

  • providers (Optional[SecurityControlsProviders], default: None ) –

    A list of cloud providers to filter the security control definitions by. For example, specify Azure to return only controls that evaluate Azure resources.

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.

Examples:

To list Azure security control definitions The following example lists security control definitions for a specified provider.

>>> await client.list_security_control_definitions(providers=['Azure'], max_results=3)
To list security controls that apply to a standard
The following example lists security controls that apply to a specified Security Hub standard.
>>> await client.list_security_control_definitions(standards_arn='arn:aws:securityhub:::standards/aws-foundational-security-best-practices/v/1.0.0', next_token='NULL', max_results=3)
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def list_security_control_definitions(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_arn: 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,
    providers: Optional[
        "capo_securityhub.types.security_controls_providers.SecurityControlsProviders"
    ] = None,
) -> "capo_securityhub.types.list_security_control_definitions_response.ListSecurityControlDefinitionsResponse":
    """<p> Lists all of the security controls that apply to a specified standard. </p>

    Args:
        standards_arn: <p> The Amazon Resource Name (ARN) of the standard that you want to view controls for. </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 security controls that apply to the specified standard. The results also include a <code>NextToken</code> parameter that you can use in a subsequent API call to get the next 25 controls. This repeats until all controls for the standard are returned. </p>
        providers: <p>A list of cloud providers to filter the security control definitions by. For example, specify <code>Azure</code> to return only controls that evaluate Azure resources.</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.

    Examples:
        To list Azure security control definitions
        The following example lists security control definitions for a specified provider.

        >>> await client.list_security_control_definitions(providers=['Azure'], max_results=3)
        To list security controls that apply to a standard
        The following example lists security controls that apply to a specified Security Hub standard.

        >>> await client.list_security_control_definitions(standards_arn='arn:aws:securityhub:::standards/aws-foundational-security-best-practices/v/1.0.0', next_token='NULL', max_results=3)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.list_security_control_definitions_request.ListSecurityControlDefinitionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.list_security_control_definitions_response.ListSecurityControlDefinitionsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.list_security_control_definitions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSecurityControlDefinitions")
    )
    input_: capo_securityhub.types.list_security_control_definitions_request.ListSecurityControlDefinitionsRequest = {}
    if standards_arn is not None:
        input_["standards_arn"] = standards_arn
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if providers is not None:
        input_["providers"] = providers

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