Tutorial Tutorial Application Services Application Services ~37 phút ~37 min Đồng bộ 2026-06-10 Synced 2026-06-10

Azure Dedicated HSM Azure Dedicated HSM

Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page.

← Danh mục ← Catalog

Giải thích nhanh Quick context

Thuộc nhóm Application Services — tập trung bảo vệ, tăng tốc và vận hành ứng dụng/web phía trước origin. Tutorial «Azure Dedicated HSM» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 4 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.

Learn how to use Keyless SSL with Azure Dedicated HSM.

Lưu ý trước khi làm Notes before you start

  • Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức. This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
  • Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ. Open the Official docs link below for CLI commands, code snippets, and full screenshots.
  • Yêu cầu trước (từ docs): Followed Microsoft's tutorial ↗ for deploying HSMs into Một virtual network using PowerShell · Cài đặted the SafeNet client software ↗ Prerequisites (from docs): Followed Microsoft's tutorial ↗ for deploying HSMs into a virtual network using PowerShell · Installed the SafeNet client software ↗
  • Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production. Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.

Tổng quan Overview

Phần «Tổng quan» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

This tutorial uses Azure Dedicated HSM ↗ — a FIPS 140-2 Level 3 certified implementation based on the Gemalto SafeNet Luna a790.

---

Trước khi bắt đầu Before you start

Phần «Trước khi bắt đầu» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Before you start" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

Make sure you have:

---

1. Create, assign, và initialize mới partition 1. Create, assign, and initialize a new partition

Phần «Create, assign, và initialize mới partition» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "1. Create, assign, and initialize a new partition" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

The first step is creating an HSM partition, which can be thought of as an independent logical HSM within your Azure Dedicated HSM device.

text
vm$ ssh tenantadmin@hsm


[local_host] lunash:>hsm login

  Please enter the HSM Administrators' password:

  > ********


'hsm login' successful.


Command Result : 0 (Success)


[local_host] lunash:>partition create -partition KeylessSSL


          Type 'proceed' to create the partition, or

          'quit' to quit now.

          > proceed

'partition create' successful.


Command Result : 0 (Success)

Next, the partition needs to be assigned to the client, in this case your key server.

Terminal window

text
[local_host] lunash:>client assignpartition -client azure-keyless -partition KeylessSSL


'client assignPartition' successful.


Command Result : 0 (Success)

After the partition has been assigned, run lunacm from your virtual server and initialize the partition.

text
vm$ lunacm

lunacm (64-bit) v7.2.0-220. Copyright (c) 2018 SafeNet. All rights reserved.


  Available HSMs:


  Slot Id ->              0

  Label ->

  Serial Number ->        XXXXXXXXXXXXX

  Model ->                LunaSA 7.2.0

  Firmware Version ->     7.0.3

  Configuration ->        Luna User Partition With SO (PW) Signing With Cloning Mode

  Slot Description ->     Net Token Slot


  Current Slot Id: 0


lunacm:>partition init -label KeylessSSL -domain cloudflare


  Enter password for Partition SO: ********


  Re-enter password for Partition SO: ********


  You are about to initialize the partition.

  All contents of the partition will be destroyed.


  Are you sure you wish to continue?


  Type 'proceed' to continue, or 'quit' to quit now ->proceed


Command Result : No Error

---

2. Tạo RSA key pair và certificate signing request (CSR) 2. Generate a RSA key pair and certificate signing request (CSR)

Phần «Tạo RSA key pair và certificate signing request (CSR)» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "2. Generate a RSA key pair and certificate signing request (CSR)" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

Before running the commands below, check with your information security and/or cryptography team to confirm the approved key creation procedures for your organization.

text
# cmu generatekeypair -keyType=RSA -modulusBits=2048 -publicExponent=65537 -sign=1 -verify=1 -labelpublic=myrsakey -labelprivate=myrsakey -keygenmech=1


Please enter password for token in slot 0 : ********


# cmu list


Please enter password for token in slot 0 : ********

handle=51 label=myrsakey

handle=48 label=myrsakey

Using the key created in the previous step, generate a CSR that can be sent to a publicly trusted Certificate Authority (CA) for signing.

text
# cmu requestCertificate -c="US" -o="Example, Inc." -cn="azure-dedicatedhsm.example.com" -s="California" -l="San Francisco" -publichandle=48 -privatehandle=51 -outputfile="rsa.csr" -sha256withrsa


Please enter password for token in slot 0 : ********

Using "CKM_SHA256_RSA_PKCS" Mechanism

---

3. Obtain và upload signed certificate từ your Certificate Authority (CA) 3. Obtain and upload a signed certificate from your Certificate Authority (CA)

Phần «Obtain và upload signed certificate từ your Certificate Authority (CA)» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "3. Obtain and upload a signed certificate from your Certificate Authority (CA)" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

Provide the CSR created in the previous step to your organization's preferred CA, demonstrate control of your domain as requested, and then download the signed SSL certificates. Follow the instructions provided in Upload Keyless SSL Certificates.

---

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)

4. Modify your gokeyless config file và restart service 4. Modify your gokeyless config file and restart the service

Phần «Modify your gokeyless config file và restart service» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "4. Modify your gokeyless config file and restart the service" section below — open the official docs link for full screenshots and configuration tabs.

Mở section docs gốc ↗ Open source section ↗

Lastly, we need to modify the configuration file that the key server will read on startup. Be sure to change the object=mykey and pin-value=username:password values to match the key label you provided and CU user you created.

Open /etc/keyless/gokeyless.yaml and immediately after:

YAML

text
private_key_stores:

  - dir: /etc/keyless/keys

add:

YAML

text
- uri: pkcs11:token=KeylessSSL;object=myrsakey?module-path=/usr/safenet/lunaclient/lib/libCryptoki2_64.so&pin-value=password&max-sessions=1

With the config file saved, restart gokeyless and verify it started successfully.

Terminal window

text
sudo systemctl restart gokeyless.service

sudo systemctl status gokeyless.service -l
json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/ssl/","name":"SSL/TLS"}},{"@type":"ListItem","position":3,"item":{"@id":"/ssl/keyless-ssl/","name":"Keyless SSL"}},{"@type":"ListItem","position":4,"item":{"@id":"/ssl/keyless-ssl/hardware-security-modules/","name":"Hardware security modules"}},{"@type":"ListItem","position":5,"item":{"@id":"/ssl/keyless-ssl/hardware-security-modules/azure-dedicated-hsm/","name":"Azure Dedicated HSM"}}]}

Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs).

Tài liệu gốc ↗ Official docs ↗