Policy API 概念

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

弱读

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

术语

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

  • 缩减后的设置值:应用于目标(例如用户、组织部门或群组)的最终设置值

  • 缩减:将政策的设置值缩减为目标(例如用户、组织部门或群组)的单个设置值的过程

  • Reducer:一种规则,用于确定如何将政策的设置值简化为面向用户的单个设置

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

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

减少流程

如需降低给定用户的给定设置,请执行以下操作:

  1. 滤除不适用于用户的所有政策。

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

    2. 过滤掉应用于目标用户不属于的组织部门的政策。

    3. 过滤掉应用于目标用户不属于的群组的政策。

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

  2. 应用给定设置的 Reducer

    • 最大值:对于经过缩减设置的每个字段,最大值缩减器都会从政策中选择 sortOrder 值最大的值。

    • Merge:对于经过缩减设置的每个字段,Merge 缩减器都会从政策中选择具有该字段值且 sortOrder 值最大的值。如果字段是数组,则“Merge”归约器会串联所有政策中的值。

    • MaxMap:MaxMap Reducer 适用于数组条目具有用作主键的字段的设置。MaxMap Reducer 不会串联具有相同主键的数组条目。而是使用共享相同主键的数组条目中的其他字段上的 Max 归约器来更新条目。

    • MergeMap:MergeMap Reducer 适用于数组条目具有用作主键的字段的设置。MergeMap Reducer 不会串联具有相同主键的数组条目。而是使用 Merge Reducer 对共享相同主键的数组条目中的其他字段进行更新。

    • 列表:这些设置不会合并为一项设置。而是会保留整个设置序列,并将其作为列表应用。

设置的 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 在教育版 SKU 中为 true,在非教育版 SKU 中为 false。EDU 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 在教育版 SKU 中为 true,在非教育版 SKU 中为 false。EDU 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 [] 空列表
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
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

系统组

Directory API 中未显示的 Google 系统群组,可通过系统政策进行关联。

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