使用安全元素进行密钥轮换
Key rotation with a secure element
我有一个关于物联网设备密钥轮换的基本问题。
我们计划使用安全元素 (example) 生成密钥对。因此,密钥对是在物联网设备的芯片上生成的。
public密钥初始上传到Google物联网后,如何进行密钥轮换?
使用现有的私钥,设备可以签署 JWT 并向 Google IoT 验证自身。在设备中生成新的密钥对后,是否也可以使用 JWT 来验证将新的 public 密钥上传到注册表?
请分享此类平台的密钥轮换示例。谢谢!
来自 Google Cloud IoT Core + ATECC608 documentation:
For example, the private key is generated by the secure element
itself, not an external party (CA). The chip uses a random number
generator to create the key, making it virtually impossible to derive.
The private key never leaves the chip, ever. Using the private key,
the chip will be able to generate a public key that can be signed by
the chosen CA of the company.
Microchip performs this signature in a dedicated secure facility in
the US, where an isolated plant will store the customer’s intermediate
CA keys in a highly secure server plugged into the manufacturing line.
The key pairs and certificates are all generated in this line in a
regulatory environment which allows auditing and a high level of
encryption.
Once the secure elements have each generated their key pairs, the
corresponding public keys are sent to the customer’s Google Cloud
account and stored securely in the Cloud IoT Core device manager.
因此,对于给定的安全元件芯片,密钥对是固定的。虽然 GCP IoT Core 允许每个物联网设备最多 3 个 public 密钥,但您必须物理更换安全元件芯片才能获得新的密钥对 轮换密钥 。
安全元素的想法是私钥不能被泄露所以不需要轮换(阅读:不能轮换)。虽然通常建议轮换密钥,但轮换密钥的能力本身会引入一个漏洞——坏人理论上可以轮换他们选择的新密钥来获得对系统的控制权,因为存在替换密钥的机制。如果不存在任何机制,那么这就不是黑客攻击的载体。有一个 review of this behavior,您可以阅读它以获取更多信息。
根据我的经验,最常见的用例是您在现场拥有一个设备,然后替换包含安全元素的 "main board"。您可以将作为替代品运送的新安全元素的 public 密钥添加到 IoT Core 中,这样当 "main board" 被替换时,新的密钥对已经注册并且设备可以自动拉取状态和来自 IoT Core 的配置信息。只要设备与 IoT Core 同步配置和状态信息,新的 "main board" 就可以 成为 相同的 设备,但是使用新的 "brain" 和新的密钥对。
JWT 是根据密钥生成的,但根据设计,JWT 的生命周期很短(default 1 hour 最长为 24 小时)。因此,将基于相同的密钥生成新的 JWT。
我有一个关于物联网设备密钥轮换的基本问题。
我们计划使用安全元素 (example) 生成密钥对。因此,密钥对是在物联网设备的芯片上生成的。
public密钥初始上传到Google物联网后,如何进行密钥轮换?
使用现有的私钥,设备可以签署 JWT 并向 Google IoT 验证自身。在设备中生成新的密钥对后,是否也可以使用 JWT 来验证将新的 public 密钥上传到注册表?
请分享此类平台的密钥轮换示例。谢谢!
来自 Google Cloud IoT Core + ATECC608 documentation:
For example, the private key is generated by the secure element itself, not an external party (CA). The chip uses a random number generator to create the key, making it virtually impossible to derive. The private key never leaves the chip, ever. Using the private key, the chip will be able to generate a public key that can be signed by the chosen CA of the company.
Microchip performs this signature in a dedicated secure facility in the US, where an isolated plant will store the customer’s intermediate CA keys in a highly secure server plugged into the manufacturing line. The key pairs and certificates are all generated in this line in a regulatory environment which allows auditing and a high level of encryption.
Once the secure elements have each generated their key pairs, the corresponding public keys are sent to the customer’s Google Cloud account and stored securely in the Cloud IoT Core device manager.
因此,对于给定的安全元件芯片,密钥对是固定的。虽然 GCP IoT Core 允许每个物联网设备最多 3 个 public 密钥,但您必须物理更换安全元件芯片才能获得新的密钥对 轮换密钥 。
安全元素的想法是私钥不能被泄露所以不需要轮换(阅读:不能轮换)。虽然通常建议轮换密钥,但轮换密钥的能力本身会引入一个漏洞——坏人理论上可以轮换他们选择的新密钥来获得对系统的控制权,因为存在替换密钥的机制。如果不存在任何机制,那么这就不是黑客攻击的载体。有一个 review of this behavior,您可以阅读它以获取更多信息。
根据我的经验,最常见的用例是您在现场拥有一个设备,然后替换包含安全元素的 "main board"。您可以将作为替代品运送的新安全元素的 public 密钥添加到 IoT Core 中,这样当 "main board" 被替换时,新的密钥对已经注册并且设备可以自动拉取状态和来自 IoT Core 的配置信息。只要设备与 IoT Core 同步配置和状态信息,新的 "main board" 就可以 成为 相同的 设备,但是使用新的 "brain" 和新的密钥对。
JWT 是根据密钥生成的,但根据设计,JWT 的生命周期很短(default 1 hour 最长为 24 小时)。因此,将基于相同的密钥生成新的 JWT。