AWS SDK Version 3 for .NET
API Reference

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:

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.

Note:

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

Syntax

C#
public virtual EnableSecurityHubResponse EnableSecurityHub(
         EnableSecurityHubRequest request
)

Parameters

request
Type: Amazon.SecurityHub.Model.EnableSecurityHubRequest

Container for the necessary parameters to execute the EnableSecurityHub service method.

Return Value


The response from the EnableSecurityHub service method, as returned by SecurityHub.

Exceptions

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

Examples

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.

To activate Security Hub


var client = new AmazonSecurityHubClient();
var response = client.EnableSecurityHub(new EnableSecurityHubRequest 
{
    EnableDefaultStandards = true,
    Tags = new Dictionary<string, string> {
        { "Department", "Security" }
    }
});


            

Version Information

.NET Framework:
Supported in: 4.5 and newer, 3.5

See Also