Skip to content

update_security_hub_configuration

update_security_hub_configuration(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    auto_enable_controls: Optional[Boolean] = None,
    control_finding_generator: Optional[ControlFindingGenerator] = None,
) -> UpdateSecurityHubConfigurationResponse

Updates configuration options for Security Hub CSPM.

Parameters:

  • auto_enable_controls (Optional[Boolean], default: None ) –

    Whether to automatically enable new controls when they are added to standards that are enabled.

    By default, this is set to true, and new controls are enabled automatically. To not automatically enable new controls, set this to false.

    When you automatically enable new controls, you can interact with the controls in the console and programmatically immediately after release. However, automatically enabled controls have a temporary default status of DISABLED. It can take up to several days for Security Hub CSPM to process the control release and designate the control as ENABLED in your account. During the processing period, you can manually enable or disable a control, and Security Hub CSPM will maintain that designation regardless of whether you have AutoEnableControls set to true.

  • control_finding_generator (Optional[ControlFindingGenerator], default: None ) –

    Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to SECURITY_CONTROL, Security Hub CSPM generates a single finding for a control check even when the check applies to multiple enabled standards.

    If the value for this field is set to STANDARD_CONTROL, Security Hub CSPM generates separate findings for a control check when the check applies to multiple enabled standards.

    For accounts that are part of an organization, this value can only be updated in the administrator account.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action specified in the request.

  • 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.

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

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

Examples:

To update Security Hub settings The following example updates Security Hub settings to turn on consolidated control findings, and to automatically enable new controls in enabled standards.

>>> client.update_security_hub_configuration(auto_enable_controls=True, control_finding_generator='SECURITY_CONTROL')
Source code in docs_src/capo_securityhub/_services/security_hub.py
def update_security_hub_configuration(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    auto_enable_controls: Optional["capo_securityhub.types.boolean.Boolean"] = None,
    control_finding_generator: Optional[
        "capo_securityhub.types.control_finding_generator.ControlFindingGenerator"
    ] = None,
) -> "capo_securityhub.types.update_security_hub_configuration_response.UpdateSecurityHubConfigurationResponse":
    """<p>Updates configuration options for Security Hub CSPM.</p>

    Args:
        auto_enable_controls: <p>Whether to automatically enable new controls when they are added to standards that are enabled.</p> <p>By default, this is set to <code>true</code>, and new controls are enabled automatically. To not automatically enable new controls, set this to <code>false</code>. </p> <p>When you automatically enable new controls, you can interact with the controls in the console and programmatically immediately after release. However, automatically enabled controls have a temporary default status of <code>DISABLED</code>. It can take up to several days for Security Hub CSPM to process the control release and designate the control as <code>ENABLED</code> in your account. During the processing period, you can manually enable or disable a control, and Security Hub CSPM will maintain that designation regardless of whether you have <code>AutoEnableControls</code> set to <code>true</code>.</p>
        control_finding_generator: <p>Updates whether the calling account has consolidated control findings turned on. If the value for this field is set to <code>SECURITY_CONTROL</code>, Security Hub CSPM generates a single finding for a control check even when the check applies to multiple enabled standards.</p> <p>If the value for this field is set to <code>STANDARD_CONTROL</code>, Security Hub CSPM generates separate findings for a control check when the check applies to multiple enabled standards.</p> <p>For accounts that are part of an organization, this value can only be updated in the administrator account.</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.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.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update Security Hub settings
        The following example updates Security Hub settings to turn on consolidated control findings, and to automatically enable new controls in enabled standards.

        >>> client.update_security_hub_configuration(auto_enable_controls=True, control_finding_generator='SECURITY_CONTROL')
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.update_security_hub_configuration_request.UpdateSecurityHubConfigurationRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.update_security_hub_configuration_response.UpdateSecurityHubConfigurationResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_security_hub_configuration

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSecurityHubConfiguration")
    )
    input_: capo_securityhub.types.update_security_hub_configuration_request.UpdateSecurityHubConfigurationRequest = {}
    if auto_enable_controls is not None:
        input_["auto_enable_controls"] = auto_enable_controls
    if control_finding_generator is not None:
        input_["control_finding_generator"] = control_finding_generator

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