AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Enables Security Hub for your account in the current Region or the Region you specify in the request.
When you enable Security Hub, you grant to Security Hub the permissions necessary to gather findings from other services that are integrated with Security Hub.
When you use the EnableSecurityHub
operation to enable Security Hub, 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, 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 User Guide.
For .NET Core this operation is only available in asynchronous form. Please refer to EnableSecurityHubAsync.
Namespace: Amazon.SecurityHub
Assembly: AWSSDK.SecurityHub.dll
Version: 3.x.y.z
public virtual EnableSecurityHubResponse EnableSecurityHub( EnableSecurityHubRequest request )
Container for the necessary parameters to execute the EnableSecurityHub service method.
Exception | Condition |
---|---|
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. |
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.
var client = new AmazonSecurityHubClient(); var response = client.EnableSecurityHub(new EnableSecurityHubRequest { EnableDefaultStandards = true, Tags = new Dictionary<string, string> { { "Department", "Security" } } });
.NET Framework:
Supported in: 4.5 and newer, 3.5