申请 Azure 服务器
当你的云团队在你的 Azure 订阅中创建服务器时,请向他们发送一份简短的申请。他们会创建一台 Linux 虚拟机,其托管标识只能读取;之后你通过 SSH 在这台机器上安装 Excubius,不再需要云团队参与。本指南列出需要申请的内容,并提供可复制的申请文本。
开始之前
收集以下值。申请文本用尖括号中的占位符表示这些值。
| 占位符 | 含义 | 示例 |
|---|---|---|
<subscription> | 承载服务器的订阅,通常也是你要监视的资源所在的订阅 | 生产 |
<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 市场中的 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 机器需要先接受一次 Azure 市场条款:
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 | Internet,或贵公司的地址范围 | Web 控制台、登录和 Webhook |
| 入站 | 80 | Internet | 重定向到 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,都由你自己完成,不需要他们参与。