Policy API 概念

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

弱读

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

术语

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

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

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

  • Reducer:此类规则决定了如何将政策中的设置值简化为用户的单一设置

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

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

缩减流程

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

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

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

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

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

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

  2. 应用给定设置的 Reducer。

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

    • 合并:对于缩减设置中的每个字段,合并缩减器会从具有该字段值的政策中选择 sortOrder 最大的值。如果该字段是数组,则合并缩减器会改为串联所有政策中的值。

    • MaxMap:MaxMap 缩减器用于数组条目具有用作主键的字段的设置。MaxMap 缩减器不会串联具有相同主键的数组条目。而是使用 Max 缩减器更新数组条目中具有相同主键的其他字段。

    • MergeMap:MergeMap 缩减器用于数组条目具有充当主键的字段的设置。MergeMap 缩减器不会串联具有相同主键的数组条目。而是使用合并归约器更新数组条目中具有相同主键的其他字段。

    • 列表:这些设置不会缩减为单个设置。而是保留整个设置序列并将其作为列表应用。

设置的 Reducer

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

许可

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

如需查看所有 Workspace 产品和 SKU ID 的完整列表,请参阅 Google 产品和 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 的许可,则该政策适用于该用户。

默认字段值

如果某个字段未出现在“精简设置”中,其默认值如下:

设置名称 字段 默认字段值
api_controls.google_services 服务 [](空列表)
calendar.external_invitations warn_on_invite true
calendar.interoperability enable_interoperability false
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
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 true 个教育版 SKU,false 个非教育版 SKU。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
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_and_space_restrictions restriction_level UNRESTRICTED
devices.android_available_apps playstore_installable_apps ALL
devices.android_verify_apps turnoff_google_play_protect_allowed false
devices.android_developer_options 允许 false
devices.android_work_data_sync 允许 true
devices.android_work_profile_sharing 允许 false
devices.ios_apple_watch no_wrist_detection_usage_allowed true
devices.ios_backup_encryption 必需 false
devices.ios_data_actions external_data_sharing_allowed true
work_data_operation_type.non_workspace_apps_copy_paste_allowed true
work_data_operation_type.non_workspace_apps_sharing_allowed true
work_data_operation_type.personal_accounts_sharing_allowed true
work_data_operation_type.airdrop_sharing_allowed true
work_data_operation_type.files_printing_allowed true
work_data_operation_type.files_access_allowed true
work_data_operation_type.images_videos_saving_allowed true
work_data_operation_type.contacts_items_assignment_allowed true
devices.ios_handoff 允许 true
devices.ios_icloud_backup 允许 true
devices.ios_lock_screen_control_center 允许 true
devices.ios_lock_screen_notifications_view 允许 true
devices.ios_safari_secure_browsing fraudulent_website_warning_enforced true
devices.android_google_play_private_apps access_allowed false
publish_and_update_allowed false
devices.android_screen_capture 允许 true
devices.compromised_devices compromised_android_devices_blocked false
jailbroken_ios_devices_blocked false
devices.encryption device_encryption_option NOT_REQUIRED
devices.ios_icloud_storage managed_apps_sync_allowed true
devices.ios_screen_capture 允许 true
devices.ios_keychain_sync icloud_sync_allowed true
devices.ios_document_sync icloud_data_sync_allowed true
devices.android_location_sharing 允许 true
devices.android_apps_settings modification_allowed true
devices.android_trust_agents smart_lock_allowed true
devices.android_lock_screen_notifications 允许 true
devices.android_lock_screen_notification_details 允许 true
devices.android_unknown_source_apps work_profile_installation_allowed false
personal_profile_installation_allowed true
directory.external_directory_sharing sharing_option ORGANIZATION_DIRECTORY_DATA
drive_and_docs.drive_sdk enable_drive_sdk_api_access 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.general_access_default default_file_access LINK_SHARING_PRIVATE
gmail.auto_forwarding enable_auto_forwarding true
gmail.email_image_proxy_bypass image_proxy_bypass_pattern [](空列表)
enable_image_proxy 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.mail_delegation enable_mail_delegation false
gmail.smime_encryption enable_smime_encryption STATUS_DISABLED
allow_sha1_globally_in_smime_signature false
gmail.spoofing_and_authentication apply_future_settings_automatically true
gmail.user_email_uploads enable_mail_and_contacts_import false
gmail.workspace_sync_for_outlook enable_google_workspace_sync_for_microsoft_outlook true
gmail.external_recipient_warning enabled true
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
security.less_secure_apps allow_less_secure_apps false
security.password allowed_strength STRONG
minimum_length 8
maximum_length 100
enforce_requirements_at_login false
allow_reuse false
expiration_duration 0
security.super_admin_account_recovery enable_account_recovery false
security.two_step_verification_device_trust allow_trusting_device true
security.two_step_verification_enforcement enforced_from 未设置
security.two_step_verification_enforcement_factor allowed_sign_in_factor_set ALL
security.two_step_verification_enrollment allow_enrollment true
security.two_step_verification_grace_period enrollment_grace_period 0s
security.user_account_recovery enable_account_recovery false
workspace_marketplace.apps_access_options access_level 对于 K12 客户:ALLOW_NONE 其他客户:ALLOW_ALL
allow_all_internal_apps false
workspace_marketplace.apps_allowlist 应用 [](空列表)

系统群组

Google 系统群组是指未在 Groups API 中显示且与系统政策关联的群组。与其他群组 ID 不同,这些群组 ID 没有 groups/ 前缀。下表列出了这些群组以及属于这些群组的用户。

GroupId 此群组中的用户
WORKSPACE_ALL_ADMIN_GROUP 所有管理员。
UNCONSENTED_CHILD_GROUP EDU 用户被指定为未满 18 周岁,且缺少一项或多项附加服务的家长同意确认。

不受支持的 SKU 许可

License Manager API 不支持的 SKU 不会以标准格式显示:

entity.licenses.exists(license, license in ['/product/{productId}/sku/{skuId}'])

而是使用查询字符串中的占位符表示:

entity.licenses.exists(license, license in ['{placeholder}'])

例如:

entity.licenses.exists(license, license in ['CHROMEBOOK-SOFTWARE'])

下表列出了这些 SKU 及其对应的占位符。

商品名称 产品 ID SKU ID 占位符
Chromebook 软件 Google-Chrome-Device-Management Google-Chrome-Device-Management-Perpetual CHROMEBOOK-SOFTWARE
Google-Chrome-Device-Management
Chrome-Active-Directory
Cloud Identity 101001 1010010001 GOOGLE-IDENTITY