Policy API 概念

本文档介绍了 Cloud Identity Policy API 的概念和策略。

弱读

如需列出和获取政策,请参阅设置 Policy API列出和获取政策

术语

  • 设置值:政策中提供的设置值

  • Reduced Setting value:应用于目标对象(例如用户、组织部门或群组)的最终设置值

  • 缩减:将政策中的设置值缩减为单个设置值的过程,适用于用户、组织部门或群组等目标

  • 简化器:用于确定如何将政策中的设置值简化为用户的单个设置的规则类型

  • 管理员政策:管理员在管理控制台中创建的政策

  • 系统政策:Google Workspace 提供的政策

缩减流程

如需为指定用户减少指定设置,请执行以下操作:

  1. 过滤掉不适用于相应用户的所有政策。

    1. 过滤掉不包含相应设置的政策。

    2. 过滤掉适用于目标用户所在组织部门以外的组织部门的政策。

    3. 过滤掉不适用于目标用户所在群组的政策。

    4. 过滤掉适用于目标用户没有的许可的政策。如需详细了解许可,请参阅许可部分。

  2. 应用给定设置的 Reducer

    • 最大值:对于精简设置中的每个字段,Max 缩减器会从具有最大 sortOrder 的政策中选择值。

    • 合并:对于精简设置中的每个字段,“合并”缩减器会从具有相应字段值的政策中选择 sortOrder 最大的值。如果相应字段是数组,则 Merge reducer 会连接所有政策中的值。

    • MaxMap:MaxMap 缩减器用于数组条目具有充当主键的字段的设置。MaxMap 减速器不会连接具有相同主键的数组条目。而是使用 Max 归约器更新共享相同主键的数组条目中的其他字段。

    • MergeMap:MergeMap 归约器用于数组条目具有充当主键的字段的设置。MergeMap 缩减器不会连接具有相同主键的数组条目。而是使用 Merge reducer 更新数组条目中共享相同主键的其他字段。

    • 列表:这些设置不会减少为一项设置。相反,系统会保留整个设置序列,并将其作为列表应用。

设置的精简器

设置名称 Reducer
drive_and_docs.external_sharing Max
drive_and_docs.general_access_default Max
drive_and_docs.shared_drive_creation Max
drive_and_docs.file_security_update Max
drive_and_docs.drive_sdk 合并
drive_and_docs.drive_for_desktop Max
gmail.confidential_mode Max
gmail.enhanced_smime_encryption Max
gmail.enhanced_pre_delivery_message_scanning Max
gmail.email_spam_filter_ip_allowlist Max
gmail.spoofing_and_authentication Max
gmail.links_and_external_images Max
gmail.email_attachment_safety Max
gmail.email_address_lists MaxMap
gmail.blocked_sender_lists MaxMap
gmail.spam_override_lists MaxMap
gmail.content_compliance MaxMap
gmail.objectionable_content MaxMap
gmail.attachment_compliance MaxMap
gmail.comprehensive_mail_storage Max
gmail.rule_states MaxMap
gmail.user_email_uploads Max
gmail.pop_access Max
gmail.imap_access 合并
gmail.workspace_sync_for_outlook Max
gmail.auto_forwarding Max
gmail.name_format 合并
gmail.per_user_outbound_gateway Max
gmail.email_image_proxy_bypass 合并
gmail.mail_delegation 合并
chat.chat_history 合并
chat.chat_file_sharing Max
chat.space_history Max
chat.external_chat_restriction 合并
chat.chat_apps_access Max
sites.sites_creation_and_modification Max
groups_for_business.groups_sharing 合并
cloud_sharing_options.cloud_data_sharing Max
classroom.teacher_permissions Max
classroom.guardian_access Max
classroom.class_membership Max
classroom.api_data_access Max
classroom.originality_reports Max
classroom.roster_import Max
classroom.student_unenrollment Max
calendar.appointment_schedules Max
calendar.external_invitations Max
calendar.interoperability 合并
calendar.primary_calendar_max_allowed_external_sharing 合并
calendar.secondary_calendar_max_allowed_external_sharing 合并
meet.safety_domain Max
meet.safety_access Max
meet.safety_host_management Max
meet.video_recording Max
meet.safety_external_participants Max
security.super_admin_account_recovery 合并
security.user_account_recovery 合并
security.password Max
security.session_controls Max
security.less_secure_apps 合并
security.login_challenges Max
security.advanced_protection_program Max
security.two_step_verification_enrollment Max
security.two_step_verification_enforcement Max
security.two_step_verification_grace_period Max
security.two_step_verification_device_trust Max
security.two_step_verification_enforcement_factor Max
security.two_step_verification_sign_in_code Max
user_takeout Max
workspace_marketplace.apps_access_options 合并
workspace_marketplace.apps_allowlist MergeMap(主键为:application_id)
SERVICE_STATUS_APP_NAME.service_status Max
rule.dlp 列表
rule.system_defined_alerts 列表
detector.regular_expression 列表
detector.word_list 列表

许可

政策会根据用户的 Workspace 许可应用于用户。许可条件在 PolicyQuery 中提供。

如需查看所有 Workspace 产品和 SKU ID 的完整列表,请参阅 Google 产品 ID 和 SKU ID

以下示例展示了如何根据用户的许可向特定用户群组应用政策。

示例 1:仅包含常规条款

entity.licenses.exists(license, license in ['/product/Google-Apps/sku/1010020027'])

如果用户拥有列表中至少一个 SKU 的许可,则该政策适用于该用户。

示例 2:正常子句和反转子句

entity.licenses.exists(license, license in ['/product/Google-Apps/sku/1010020027']) && !entity.licenses.exists(license, license in ['/product/Google-Apps/sku/1010060005'])

如果用户拥有第一条子句中至少一个 SKU 的许可,则该政策适用于该用户。不过,如果用户拥有第二条子句中任何 SKU 的许可,则相应政策完全不适用于该用户。

示例 3:仅包含反向子句

!entity.licenses.exists(license, license in ['/product/Google-Apps/sku/1010060005'])

如果用户没有列表中任何 SKU 的许可,则此政策适用于该用户。

默认字段值

如果某个字段在精简设置中不存在,则其默认值如下所示:

设置名称 字段 默认字段值
chat.chat_history enable_chat_history false
history_on_by_default false
allow_user_modification true
chat.external_chat_restriction allow_external_chat false
external_chat_restriction NO_RESTRICTION
chat.chat_apps_access enable_apps true(教育版 SKU)、false(非教育版 SKU)。教育版 SKU:
  • /product/Google-Apps/sku/Google-Apps-For-Education
  • /product/Google-Apps/sku/1010310002
  • /product/Google-Apps/sku/1010310003
  • /product/Google-Apps/sku/1010310005
  • /product/Google-Apps/sku/1010310006
  • /product/Google-Apps/sku/1010310007
  • /product/Google-Apps/sku/1010310008
  • /product/Google-Apps/sku/1010310009
  • /product/Google-Apps/sku/1010310010
  • /product/Google-Apps/sku/1010460001
  • /product/Google-Apps/sku/1010460002
enable_webhooks true(教育版 SKU)、false(非教育版 SKU)。教育版 SKU:
  • /product/Google-Apps/sku/Google-Apps-For-Education
  • /product/Google-Apps/sku/1010310002
  • /product/Google-Apps/sku/1010310003
  • /product/Google-Apps/sku/1010310005
  • /product/Google-Apps/sku/1010310006
  • /product/Google-Apps/sku/1010310007
  • /product/Google-Apps/sku/1010310008
  • /product/Google-Apps/sku/1010310009
  • /product/Google-Apps/sku/1010310010
  • /product/Google-Apps/sku/1010460001
  • /product/Google-Apps/sku/1010460002
gmail.user_email_uploads enable_mail_and_contacts_import false
gmail.email_image_proxy_bypass image_proxy_bypass_pattern [] 空列表
enable_image_proxy true
gmail.workspace_sync_for_outlook enable_google_workspace_sync_for_microsoft_outlook true
gmail.email_spam_filter_ip_allowlist allowed_ip_addresses [] 空列表
gmail.links_and_external_images apply_future_settings_automatically true
enable_aggressive_warnings_on_untrusted_links false
gmail.spoofing_and_authentication apply_future_settings_automatically true
gmail.auto_forwarding enable_auto_forwarding true
drive_and_docs.external_sharing external_sharing_mode ALLOWED
allow_receiving_external_files true
warn_for_sharing_outside_allowlisted_domains true
allow_non_google_invites_in_allowlisted_domains false
allow_receiving_files_outside_allowlisted_domains true
warn_for_external_sharing true
allow_non_google_invites true
allow_publishing_files true
access_checker_suggestions RECIPIENTS_OR_AUDIENCE_OR_PUBLIC
allowed_parties_for_distributing_content ALL_ELIGIBLE_USERS
drive_and_docs.drive_sdk enable_drive_sdk_api_access true
drive_and_docs.general_access_default default_file_access LINK_SHARING_PRIVATE
security.user_account_recovery enable_account_recovery false
security.super_admin_account_recovery enable_account_recovery false
security.less_secure_apps allow_less_secure_apps false
security.two_sv_enrollment allow_enrollment true
security.two_sv_device_trust allow_trusting_device true
security.two_sv_enforcement_factor allowed_sign_in_factor_set ALL
workspace_marketplace.apps_access_options access_level 对于 K12 客户:ALLOW_NONE 其他客户:ALLOW_ALL
allow_all_internal_apps false
workspace_marketplace.apps_allowlist 应用 [] 空列表
groups_for_business.groups_sharing collaboration_capability DOMAIN_USERS_ONLY
create_groups_access_level USERS_IN_DOMAIN
view_topics_default_access_level DOMAIN_USERS
owners_can_allow_external_members false
owners_can_allow_incoming_mail_from_public true
owners_can_hide_groups false
new_groups_are_hidden false
calendar.external_invitations warn_on_invite true
calendar.primary_calendar_max_allowed_external_sharing max_allowed_external_sharing EXTERNAL_FREE_BUSY_ONLY
calendar.secondary_calendar_max_allowed_external_sharing max_allowed_external_sharing EXTERNAL_ALL_INFO_READ_ONLY

系统组

未在 Directory API 中公开的 Google 系统群组,可从系统政策中链接。

GroupId 说明
WORKSPACE_ALL_ADMIN_GROUP Google 系统政策的群组,用于强制要求所有管理员进行两步验证。