enableSecurityHub method
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.
- CIS AWS Foundations
- AWS Foundational Security Best Practices
To not enable the 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 Setting Up AWS Security Hub in the AWS Security Hub User Guide.
May throw InternalException. May throw LimitExceededException. May throw InvalidAccessException. May throw ResourceConflictException. May throw AccessDeniedException.
Parameter enableDefaultStandards
:
Whether to enable the security standards that Security Hub has designated
as automatically enabled. If you do not provide a value for
EnableDefaultStandards
, it is set to true
. To
not enable the automatically enabled standards, set
EnableDefaultStandards
to false
.
Parameter tags
:
The tags to add to the hub resource when you enable Security Hub.
Implementation
Future<void> enableSecurityHub({
bool? enableDefaultStandards,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
if (enableDefaultStandards != null)
'EnableDefaultStandards': enableDefaultStandards,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/accounts',
exceptionFnMap: _exceptionFns,
);
}