Disables Security Hub CSPM in your account only in the current Amazon Web Services Region. To disable Security Hub CSPM in all Regions, you must submit one request per Region where you have enabled Security Hub CSPM.
You can't disable Security Hub CSPM in an account that is currently the Security Hub CSPM administrator.
When you disable Security Hub CSPM, your existing findings and insights and any Security Hub CSPM configuration settings are deleted after 90 days and cannot be recovered. Any standards that were enabled are disabled, and your administrator and member account associations are removed.
If you want to save your existing findings, you must export them before you disable Security Hub CSPM.
Raises:
Examples:
To deactivate Security Hub
The following example deactivates Security Hub for the current account and Region.
>>> await client.disable_security_hub()
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
| async def disable_security_hub(
self, *, config_overrides: Optional[AsyncSecurityHubClientConfig] = None
) -> "capo_securityhub.types.disable_security_hub_response.DisableSecurityHubResponse":
"""<p>Disables Security Hub CSPM in your account only in the current Amazon Web Services Region. To disable Security Hub CSPM in all Regions, you must submit one request per Region where you have enabled Security Hub CSPM.</p> <p>You can't disable Security Hub CSPM in an account that is currently the Security Hub CSPM administrator.</p> <p>When you disable Security Hub CSPM, your existing findings and insights and any Security Hub CSPM configuration settings are deleted after 90 days and cannot be recovered. Any standards that were enabled are disabled, and your administrator and member account associations are removed.</p> <p>If you want to save your existing findings, you must export them before you disable Security Hub CSPM.</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.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 deactivate Security Hub
The following example deactivates Security Hub for the current account and Region.
>>> await client.disable_security_hub()
"""
async def _handler(
req: "AsyncOperationRequest[capo_securityhub.types.disable_security_hub_request.DisableSecurityHubRequest]",
) -> AsyncOperationResponse[
"capo_securityhub.types.disable_security_hub_response.DisableSecurityHubResponse"
]:
import capo_securityhub._operations.security_hub_api_service.disable_security_hub
(
output,
http_response,
) = await capo_securityhub._operations.security_hub_api_service.disable_security_hub.async_disable_security_hub(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DisableSecurityHub")
)
input_: capo_securityhub.types.disable_security_hub_request.DisableSecurityHubRequest = {}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|