enableSecurityHub

abstract suspend fun enableSecurityHub(input: EnableSecurityHubRequest = EnableSecurityHubRequest { }): EnableSecurityHubResponse

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.

Samples


fun main() { 
   //sampleStart 
   // 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.
securityHubClient.enableSecurityHub {
    tags = mapOf<String, String>(
        "Department" to "Security"
    )
    enableDefaultStandards = true
} 
   //sampleEnd
}