What's new in managing Apple devices
System & Services 进阶 27m

Apple 设备管理新特性

What's new in managing Apple devices

2021年6月10日

在 Apple 官方观看视频

一句话判断

今年 Apple 设备管理的主题是”从命令式到声明式”——Declarative Device Management 不只是一个新 API,而是管理哲学的转向,IT 管理员的工作流会因此发生根本变化。

这场 Session 讲了什么

这个 Session 是 Apple 设备管理领域的年度总览,覆盖了 macOS Monterey、iOS 15 和 iPadOS 15 中 MDM 相关的所有新能力。重点包括 Declarative Device Management(声明式设备管理)的引入、User Enrollment 的改进、新的 payload 类型,以及软件更新管理能力的增强。

Apple 在设备管理上一直在做一件事:让 MDM 从”远程控制工具”变成”状态同步工具”。过去你发一个命令,设备执行,你等结果。现在你可以声明一个目标状态,设备自己去对齐。这个转变对于管理成千上万台设备的团队来说意义重大——减少了轮询、降低了服务器负载、提高了可靠性。Session 还提到了一个新的 enrollment 方式:account-driven User Enrollment,用户用自己的工作账号就能完成设备注册,不再需要下载描述文件。

值得深挖的点

Declarative Device Management 的架构设计

DDM 的核心是三个概念:Declarations(声明)、Status(状态)和 Errors(错误)。MDM 服务器推送一个或多个 Declaration,设备收到后自己去解析和执行,然后通过 Status channel 上报结果。这意味着网络断连不再是灾难——设备重新上线后自动同步到最新声明状态。对于 IT 团队来说,最直接的好处是:你不再需要写复杂的”先发命令 A,等结果,再发命令 B”的流程了。

Account-driven User Enrollment 的实际影响

之前的 User Enrollment 需要用户先下载一个 enrollment profile,整个过程至少 5-6 步操作。新的 account-driven 流程只需要用户在设置中输入工作邮箱和密码(通过 OAuth 或 SAML 验证),系统自动完成所有后续步骤。这让 BYOD(Bring Your Own Device)场景的门槛降低了一个数量级。对企业来说,这意味着员工自助注册的比例会大幅提升。

代码片段

<!-- 声明式管理中推送一个配置声明的示例 -->
<!-- 这会通过 MDM 的 Declarative Management 通道下发 -->
<dict>
    <key>Type</key>
    <string>com.apple.configuration.passcode</string>
    <key>Identifier</key>
    <string>com.example.passcode-policy</string>
    <key>ServerToken</key>
    <string>20210607-v1</string>
    <key>Payload</key>
    <dict>
        <key>MinimumLength</key>
        <integer>8</integer>
        <key>RequireAlphanumeric</key>
        <true/>
        <key>MaxGracePeriod</key>
        <integer>5</integer>
    </dict>
</dict>
// 设备状态上报示例(Status Item)
// 设备主动上报当前 passcode 合规状态
{
    "Items": [
        {
            "Type": "com.apple.status.passcode",
            "Identifier": "com.example.passcode-compliance",
            "Status": {
                "Compliant": true,
                "LastChecked": "2021-06-10T14:30:00Z"
            }
        }
    ]
}
# 通过 profile 安装触发 account-driven enrollment
# 用户在设置中输入工作邮箱后,系统自动发现 MDM 服务器
# MDM 服务器需要在 Apple Business Manager 中配置 enrollment URL
# discovery 过程基于用户邮箱域名匹配

最佳实践

  • 开始评估现有 MDM 工作流哪些可以迁移到 DDM:优先迁移”设置某个配置”类的操作(passcode、VPN、WiFi),暂缓迁移”执行某个动作”类的操作(远程锁定、擦除)。DDM 不是万能替代,而是补充。
  • 为 account-driven User Enrollment 提前准备身份认证基础设施:确保你的 IdP(Identity Provider)支持 OAuth 2.0 或 SAML,并在 Apple Business Manager 中完成域名验证。
  • 软件更新策略尽早采用 declaration 方式,配合 deadline 机制,比轮询 InstallCommand 可靠得多。

还有什么值得关注

  • macOS Monterey 的 SystemExtensions 管理现在支持通过 MDM 批量批准,不再需要用户手动确认。
  • 新的 PrivacyPreferencesProfileControl payload 可以管理更多系统隐私权限,包括屏幕录制和输入监听。
  • iPadOS 15 支持了更多 macOS 级别的 MDM payload,两者在管理能力上进一步趋同。
WWDC 2021