申請 Azure 伺服器
當你的雲端團隊在你的 Azure 訂閱中建立伺服器時,請向他們發送一份簡短的申請。他們會建立一部 Linux 虛擬機器,其受控識別只能讀取;之後你透過 SSH 在上面安裝 Excubius,不需要再找雲端團隊。本指南列出要申請的項目,並提供可以複製的申請內容。
開始之前
請收集以下的值。申請內容以角括號中的預留位置表示這些值。
| 預留位置 | 說明 | 範例 |
|---|---|---|
<subscription> | 存放伺服器的訂閱,通常也是你要監控的系統所在的訂閱 | Production |
<resource-group> | 伺服器使用的資源群組;使用專用的資源群組最容易管理 | rg-monitoring |
<monitoring-vm> | 虛擬機器的名稱 | vm-monitoring-01 |
<subnet> | 可通往 SQL Server 虛擬機器、可用性群組接聽程式,以及你要監控的任何私人端點的子網絡 | snet-management |
<monitoring.example.com> | 用戶將開啟的名稱 | monitoring.example.com |
<my-user> 和 SSH 金鑰 | 你在伺服器上的管理員帳戶,以及你的 SSH 公開金鑰 | opsadmin、ssh-ed25519 AAAA… |
<my-ip> | 你透過 SSH 連線時使用的位址 | 203.0.113.10 |
<ninjaone-region> | 僅在你使用 NinjaOne 作為數據源時需要:你的 NinjaOne 實例所在的區域 | app |
還要決定一件事:用戶是直接透過伺服器的公開位址存取 Excubius,還是透過閘道(例如在前端終止 TLS 的 Azure Application Gateway 或 Front Door)存取。
申請的項目
虛擬機器
| 項目 | 值 |
|---|---|
| 映像 | 來自 Azure Marketplace 的 Rocky Linux 9:發佈者 resf、供應項目 rockylinux-x86_64、方案 9-base |
| 大小 | 起初使用 Standard_B2ms(2 vCPU、8 GiB)。日後可以調整大小 |
| 作業系統磁碟 | 64 GiB,Premium SSD |
| 身分識別 | 具備下列唯讀角色的系統指派受控識別 |
| 管理員 | 具備 sudo 權限的 <my-user>,使用你的 SSH 公開金鑰登入;關閉密碼登入 |
訂閱中的第一部 Rocky Linux 機器需要接受一次 Marketplace 條款:
az vm image terms accept --publisher resf --offer rockylinux-x86_64 --plan 9-base
受控識別的唯讀角色
每個角色都指派在訂閱層級。這些角色都不能變更任何內容;Excubius 從不寫入它所監控的系統。
| 角色 | 角色定義 ID | 用途 |
|---|---|---|
| Reader | acdd72a7-3385-48ef-bd42-f606fba81ae7 | 透過 Azure Resource Graph 取得 Azure 資源的清單和設定 |
| Monitoring Reader | 43d0d8ad-25c7-4714-9337-8ba259a9fe05 | Azure Monitor 指標和警報 |
| Security Reader | 39bc4728-0917-49c7-9d2c-d95423bc2eb4 | Microsoft Defender for Cloud 評估,供安全模組使用。如果你不使用這些模組,請省略此角色 |
日後若要監控更多訂閱,請把相同的角色指派給同一個身分識別,在每個訂閱中各指派一次。請向雲端團隊索取該身分識別的物件(主體)ID,這樣日後提出申請時就不必再查詢。
網絡安全群組
| 方向 | 連接埠 | 來源或目的地 | 用途 |
|---|---|---|---|
| 入站 | 443 | 互聯網,或你公司的位址範圍 | 網頁控制台、登入和 Webhook |
| 入站 | 80 | 互聯網 | 重新導向到 HTTPS,以及透過 HTTP 進行 Let's Encrypt 驗證 |
| 入站 | 22 | <my-ip>/32 | 透過 SSH 管理 |
| 出站 | 443 | *.azure.com、*.microsoft.com | Azure API 和 Microsoft 登入 |
| 出站 | 443 | ghcr.io、docker.io | 容器映像,除非你使用離線套件安裝 |
| 出站 | 443 | slack.com | Slack 通知 |
| 出站 | 443 | api.newrelic.com、<ninjaone-region>.ninjarmm.com | 使用 New Relic 和 NinjaOne 作為數據源時 |
| 出站 | 443 | endoflife.date、api.msrc.microsoft.com、dataplat.github.io、raw.githubusercontent.com | 更新及公告模組的公開數據饋送 |
| 出站 | 443 | Let's Encrypt API | 證書,使用 Let's Encrypt 時 |
在虛擬網絡內,伺服器會連線到它所監控的系統:SQL Server 使用 1433(沒有固定連接埠的具名實例還需要 UDP 1434),PostgreSQL 使用 5432,透過 HTTPS 的 WinRM 使用 5986,SSH 使用 22。不會有任何連線連入伺服器的採集器。
公開位址、名稱及備份
- 一個靜態公用 IP 位址,並讓名稱
<monitoring.example.com>指向它。如果前端有閘道,則由閘道終止 TLS,伺服器只需要接受來自閘道的連接埠 80。 - 把虛擬機器納入你現有的 Azure Backup 原則。每日備份已經足夠;Excubius 也會在磁碟上保存自己的數據庫備份。
發送申請
- 把下面申請內容中的預留位置替換為你的值。如果你不使用安全模組,請移除 Security Reader 那一行;如果你不使用 New Relic 或 NinjaOne 數據源,請移除相應的位址。
- 複製申請內容,並透過你慣用的管道發送,例如向雲端團隊提交工單。
- 伺服器建立好後,確認你可以使用
ssh <my-user>@<monitoring.example.com>連線,並執行sudo -v。
Subject: Resources for the monitoring server
Hello,
To install our monitoring platform we need one Linux virtual machine in the
<subscription> subscription. Nothing has to be installed on it; we install
the platform ourselves over SSH.
1. Virtual machine
- Image: Rocky Linux 9, Marketplace publisher resf, offer rockylinux-x86_64,
plan 9-base (accept the terms once: az vm image terms accept
--publisher resf --offer rockylinux-x86_64 --plan 9-base)
- Size: Standard_B2ms (2 vCPU, 8 GiB); we may ask to resize it later
- OS disk: 64 GiB Premium SSD
- Name and resource group: <monitoring-vm> in <resource-group>
- Network: subnet <subnet>, with a route to the SQL Server VMs, the
availability group listeners and the private endpoints to monitor
- Administrator: <my-user> with sudo, SSH public key below,
password sign-in disabled
2. Managed identity (read-only)
System-assigned managed identity with these roles on the subscription:
- Reader acdd72a7-3385-48ef-bd42-f606fba81ae7
- Monitoring Reader 43d0d8ad-25c7-4714-9337-8ba259a9fe05
- Security Reader 39bc4728-0917-49c7-9d2c-d95423bc2eb4
Please send us the identity's object (principal) ID.
3. Network security group
Inbound 443 from the internet (or our ranges) web console and sign-in
Inbound 80 from the internet HTTPS redirect, certificates
Inbound 22 from <my-ip>/32 administration over SSH
Outbound 443 to *.azure.com, *.microsoft.com, ghcr.io, docker.io,
slack.com, api.newrelic.com, <ninjaone-region>.ninjarmm.com,
endoflife.date, api.msrc.microsoft.com, dataplat.github.io,
raw.githubusercontent.com, Let's Encrypt
Inside the VNet: outbound 1433 (SQL Server), UDP 1434 (named instances),
5432 (PostgreSQL), 5986 (WinRM over HTTPS), 22 (SSH).
4. Public IP and DNS
A static public IP and the name <monitoring.example.com> pointing at it.
5. Backup
Please include the VM in the existing Azure Backup policy (daily).
SSH public key:
<ssh-ed25519 AAAA... my-user@workstation>
Thank you.
雲端團隊的工作到此為止。其餘所有事項,包括監控登入、登入用的應用程式註冊和 Slack,都由你自己完成,不需要他們參與。