enable_security_hub
¶
enable_security_hub(
*,
config_overrides: Optional[SecurityHubClientConfig] = 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.
Source code in docs_src/capo_securityhub/_services/security_hub.py
3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 | |