Skip to content

update_organization_configuration

update_organization_configuration(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    auto_enable: Optional[Boolean] = None,
    auto_enable_standards: Optional[AutoEnableStandards] = None,
    organization_configuration: Optional[OrganizationConfiguration] = None,
) -> UpdateOrganizationConfigurationResponse

Updates the configuration of your organization in Security Hub CSPM. Only the Security Hub CSPM administrator account can invoke this operation.

Parameters:

  • auto_enable (Optional[Boolean], default: None ) –

    Whether to automatically enable Security Hub CSPM in new member accounts when they join the organization.

    If set to true, then Security Hub CSPM is automatically enabled in new accounts. If set to false, then Security Hub CSPM isn't enabled in new accounts automatically. The default value is false.

    If the ConfigurationType of your organization is set to CENTRAL, then this field is set to false and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which Security Hub CSPM is enabled and associate the policy with new organization accounts.

  • auto_enable_standards (Optional[AutoEnableStandards], default: None ) –

    Whether to automatically enable Security Hub CSPM default standards in new member accounts when they join the organization.

    The default value of this parameter is equal to DEFAULT.

    If equal to DEFAULT, then Security Hub CSPM default standards are automatically enabled for new member accounts. If equal to NONE, then default standards are not automatically enabled for new member accounts.

    If the ConfigurationType of your organization is set to CENTRAL, then this field is set to NONE and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which specific security standards are enabled and associate the policy with new organization accounts.

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.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

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

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To update organization configuration This operation updates the way your organization is configured in Security Hub. Only a Security Hub administrator account can invoke this operation.

>>> client.update_organization_configuration(auto_enable=False, auto_enable_standards='NONE', organization_configuration={'ConfigurationType': 'CENTRAL'})
Source code in docs_src/capo_securityhub/_services/security_hub.py
def update_organization_configuration(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    auto_enable: Optional["capo_securityhub.types.boolean.Boolean"] = None,
    auto_enable_standards: Optional[
        "capo_securityhub.types.auto_enable_standards.AutoEnableStandards"
    ] = None,
    organization_configuration: Optional[
        "capo_securityhub.types.organization_configuration.OrganizationConfiguration"
    ] = None,
) -> "capo_securityhub.types.update_organization_configuration_response.UpdateOrganizationConfigurationResponse":
    """<p>Updates the configuration of your organization in Security Hub CSPM. Only the Security Hub CSPM administrator account can invoke this operation.</p>

    Args:
        auto_enable: <p>Whether to automatically enable Security Hub CSPM in new member accounts when they join the organization.</p> <p>If set to <code>true</code>, then Security Hub CSPM is automatically enabled in new accounts. If set to <code>false</code>, then Security Hub CSPM isn't enabled in new accounts automatically. The default value is <code>false</code>.</p> <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>false</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which Security Hub CSPM is enabled and associate the policy with new organization accounts.</p>
        auto_enable_standards: <p>Whether to automatically enable Security Hub CSPM <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html">default standards</a> in new member accounts when they join the organization.</p> <p>The default value of this parameter is equal to <code>DEFAULT</code>.</p> <p>If equal to <code>DEFAULT</code>, then Security Hub CSPM default standards are automatically enabled for new member accounts. If equal to <code>NONE</code>, then default standards are not automatically enabled for new member accounts.</p> <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>NONE</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which specific security standards are enabled and associate the policy with new organization accounts.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>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.</p>
        capo_securityhub.errors.resource_conflict_exception.ResourceConflictException: <p>The resource specified in the request conflicts with an existing resource.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update organization configuration
        This operation updates the way your organization is configured in Security Hub. Only a Security Hub administrator account can invoke this operation.

        >>> client.update_organization_configuration(auto_enable=False, auto_enable_standards='NONE', organization_configuration={'ConfigurationType': 'CENTRAL'})
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.update_organization_configuration_request.UpdateOrganizationConfigurationRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.update_organization_configuration_response.UpdateOrganizationConfigurationResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_organization_configuration

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.update_organization_configuration.update_organization_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateOrganizationConfiguration")
    )
    input_: capo_securityhub.types.update_organization_configuration_request.UpdateOrganizationConfigurationRequest = {}
    if auto_enable is not None:
        input_["auto_enable"] = auto_enable
    if auto_enable_standards is not None:
        input_["auto_enable_standards"] = auto_enable_standards
    if organization_configuration is not None:
        input_["organization_configuration"] = organization_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output