enable_security_hub
async
¶
enable_security_hub(
*,
config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
tags: Optional[TagMap] = None,
enable_default_standards: Optional[Boolean] = None,
control_finding_generator: Optional[ControlFindingGenerator] = None,
) -> EnableSecurityHubResponse
Enables Security Hub CSPM for your account in the current Region or the Region you specify in the request.
When you enable Security Hub CSPM, you grant to Security Hub CSPM the permissions necessary to gather findings from other services that are integrated with Security Hub CSPM.
When you use the EnableSecurityHub operation to enable Security Hub CSPM, you also automatically enable the following standards:
-
Center for Internet Security (CIS) Amazon Web Services Foundations Benchmark v1.2.0
-
Amazon Web Services Foundational Security Best Practices
Other standards are not automatically enabled.
To opt out of automatically enabled standards, set EnableDefaultStandards to false.
After you enable Security Hub CSPM, to enable a standard, use the BatchEnableStandards operation. To disable a standard, use the BatchDisableStandards operation.
To learn more, see the setup information in the Security Hub CSPM User Guide.
Parameters:
-
tags(Optional[TagMap], default:None) –The tags to add to the hub resource when you enable Security Hub CSPM.
-
enable_default_standards(Optional[Boolean], default:None) –Whether to enable the security standards that Security Hub CSPM has designated as automatically enabled. If you don't provide a value for
EnableDefaultStandards, it is set totrue. To not enable the automatically enabled standards, setEnableDefaultStandardstofalse. -
control_finding_generator(Optional[ControlFindingGenerator], default:None) –This field, used when enabling Security Hub CSPM, specifies 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.The value for this field in a member account matches the value in the administrator account. For accounts that aren't part of an organization, the default value of this field is
SECURITY_CONTROLif you enabled Security Hub CSPM on or after February 23, 2023.
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.
-
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.
-
ResourceConflictException–The resource specified in the request conflicts with an existing resource.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To activate Security Hub The following example activates the Security Hub service in the requesting AWS account. The service is activated in the current AWS Region or the Region that you specify in the request. Some standards are automatically turned on in your account unless you opt out. To determine which standards are automatically turned on, see the Security Hub documentation.
>>> await client.enable_security_hub(tags={'Department': 'Security'}, enable_default_standards=True)
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 | |