NRI Inc on Azure
NRI’s Azure subscription holds one workload: the virtual machine that serves
cms.nri-inc.org, with the storage, key vaults and backup account around it.
This page is the inventory of what is provisioned and how each piece is
configured. How the application itself is put together on that VM is on
www application architecture.
Posture at a glance
Section titled “Posture at a glance”| Control | Status | Note |
|---|---|---|
| Inbound network | ✅ | NSG allows 443 from Cloudflare’s published ranges only and 22 from one /32; Azure’s default deny covers the rest — Network |
| Application secrets | ✅ | Key Vault with RBAC, read by the VM’s system-assigned managed identity under a read-only role — Key vaults |
| Encryption at rest | ✅ | Platform-managed key on the OS disk; Azure Storage encryption on both storage accounts — The virtual machine |
| Tags | ✅ | Every deliberately provisioned resource carries the four standard tags — Resource groups and tags |
| VM health alerts | ✅ | Azure Monitor alerts one operator address on VM availability, low memory, high CPU, network volume and disk IOPS — Monitoring |
| Database backups | ⚠️ | Daily to a dedicated RA-GRS account with versioning and 30-day soft delete; a restore has not been proven — Storage accounts |
| Azure control-plane access | ⚠️ | Contributor on the resource group is in practice full access to the VM, the vault secrets and both storage accounts — Identity and access |
| Deletion protection | ⚠️ | Blob soft delete cannot be bypassed, but neither resource group carries a resource lock and vault purge protection is off — Storage accounts |
| Key vault network | ⚠️ | Both vaults accept traffic from any network — Key vaults |
| Media storage account | ⚠️ | Open to all networks, LRS only, shared-key access enabled — Storage accounts |
| Boot integrity | ⚠️ | Secure Boot on; vTPM off and encryption at host off, both need a deallocate — The virtual machine |
| Audit logs | ❌ | No diagnostic settings on the key vaults or the storage accounts, so secret reads and blob access are not recorded anywhere — Monitoring |
| VM and disk backup | ❌ | No snapshot schedule and no Azure Backup; rebuilding the VM means re-provisioning it — The virtual machine |
| Application-level alerting | ❌ | Nothing alerts on the service crashing, a failed backup or a full disk — Monitoring |
What is provisioned
Section titled “What is provisioned”flowchart TB subgraph www[rg-nri-www · East US 2] VM[vm-nri-www<br/>Standard_D2als_v7 · Ubuntu 26.04] DISK[(OS disk 28 GB<br/>StandardSSD_LRS)] NIC[NIC] --- NSG[NSG<br/>22 /32 · 443 Cloudflare] PIP[Public IP<br/>Standard · static] VNET[Virtual network<br/>Microsoft.Storage endpoint] SA1[(Media storage account<br/>LRS · open network)] KV1[(kv-nri-www<br/>production)] KV2[(kv-nri-www-staging<br/>reserved)] AL[Metric alerts + action group] end subgraph backup[rg-nri-backup · East US 2] SA2[(Backup storage account<br/>RA-GRS · default deny + vnet rule)] end VM --- DISK VM --- NIC --- PIP NIC --- VNET VM -->|managed identity| KV1 VM -->|account key| SA1 VM -->|account key, vnet rule| SA2 AL -.-> VMResource groups and tags
Section titled “Resource groups and tags”Two resource groups, both in East US 2:
| Group | Holds |
|---|---|
rg-nri-www |
the VM and its disk, NIC, NSG, public IP and alert rules; the virtual network; the media storage account; the two key vaults |
rg-nri-backup |
the backup storage account |
The backup account sits in its own group deliberately: it is the one resource that must survive losing everything else, and it is meant to serve more than this website.
Every resource carries the same four tags, and new ones should match:
| Tag | Value |
|---|---|
environment |
prod, or staging for a resource that serves a staging environment |
managed-by |
next-player-up |
owner |
the operator’s address |
project |
nri-www, or nri-backup for the backup group |
Hyphens, not underscores. Blob container metadata is the exception —
metadata keys allow only letters, numbers and underscores, so the backup
container carries managed_by instead, and rejects the hyphenated form
outright.
az resource list -g rg-nri-www --query '[?!tags || length(tags)==`0`].name' -o tsvaz tag create --resource-id <resource id> \ --tags environment=prod managed-by=next-player-up \ owner=<operator address> project=nri-wwwResources Azure creates on its own — the SSH public key object, the virtual network, the recommended alert rules — may be untagged; nothing depends on their tags. Anything provisioned deliberately is tagged.
The virtual machine
Section titled “The virtual machine”| Name | vm-nri-www, zone 1 |
| Size | Standard_D2als_v7 — 2 vCPU, 4 GiB RAM, AMD, x86-64, no temporary disk |
| OS | Ubuntu 26.04 LTS |
| OS disk | 28 GB StandardSSD_LRS, encrypted at rest with a platform-managed key (EncryptionAtRestWithPlatformKey) |
| Boot integrity | Trusted Launch; Secure Boot enabled; vTPM disabled; encryption at host not enabled |
| Public IP | Standard SKU, static |
| Identity | System-assigned managed identity, holding Key Vault Secrets User on the production vault |
| Login | azureuser, key only; sudo without a password |
Encryption at rest with a platform-managed key protects against loss of the physical media. It does not protect against anyone who can snapshot or export the disk through Azure, which a Contributor can. The swap file lives on the OS disk, since this size has no temporary disk, and is covered by the same encryption.
vTPM is off, so there is no measured boot and no guest attestation. Encryption at host is not enabled either; it is independent of vTPM and encrypts the host caches on top of the disk encryption already in place. Each requires a stop and deallocate to turn on.
There is no VM-level backup. No snapshot schedule exists for the OS disk and no Recovery Services vault is provisioned. The SQLite databases are backed up (below); the machine is not, so rebuilding it means re-running the provisioning steps.
Network
Section titled “Network”The VM’s network security group allows two inbound flows. Azure’s default deny covers everything else.
| Port | Source allowed | Rule | Why open | Why not wider |
|---|---|---|---|---|
| 22 | one operator address, /32 |
allow-ssh-mark, 300 |
Deploys and secret rotation | Restricted to a single address; key-only auth is the inner wall |
| 443 | Cloudflare’s published IPv4 ranges | allow-https, 320 |
The website, through Cloudflare | Only Cloudflare reaches the origin; direct requests to its address are dropped |
| — | VirtualNetwork |
Azure default, 65000 | Platform | Default rule, left in place |
| — | AzureLoadBalancer |
Azure default, 65001 | Health probes | Default rule, left in place |
| all else | denied | DenyAllInBound, 65500 |
— | Azure’s default deny is the backstop |
Not open, deliberately: 80 (see below), 5019 (Kestrel binds loopback only), 2019 (Caddy’s
admin API, also loopback only), and no database port at all, because SQLite is
a file. There is no host firewall: ufw is inactive and the NSG is the single
place filtering happens. That is a trade-off, not a rule. A host firewall
would backstop an NSG mistake, at the cost of a second place a rule can drift.
Nothing needs port 80. Cloudflare redirects http:// to https:// at the
edge (Always Use HTTPS), so plain HTTP never reaches the origin, and the origin
certificate is a Cloudflare origin certificate that does not renew, so no
certificate authority has to reach the VM. Caddy still listens on 80; the NSG
drops it.
Because 443 accepts only Cloudflare’s ranges, the edge controls cannot be bypassed by connecting to the origin address directly. The rule holds a copy of the list at cloudflare.com/ips. When Cloudflare adds a range, update the rule, or visitors routed through the new range fail to reach the site.
Audit the live state rather than trusting the table:
az network nsg rule list -g rg-nri-www --nsg-name vm-nri-www-nsg -o tablessh vm-nri-www 'sudo ss -tlnp'NSG rule changes take up to a minute to take effect. A rule that looks correct
but still times out is usually propagation, not a mistake. az network watcher test-ip-flow reports Azure’s own verdict for a given flow and settles the
question.
The virtual network has the Microsoft.Storage service endpoint enabled on
the VM’s subnet, which is what the backup account’s network rule relies on.
Identity and access
Section titled “Identity and access”Three paths lead to the machine:
- From the Internet: port 443 only, from Cloudflare’s ranges, terminating at Caddy.
- Over SSH: port 22 from a single operator address, by public key only. The
NSG is the outer wall;
sshdis the inner one. - Through Azure: anyone holding the
runCommandaction on the VM — Contributor, Virtual Machine Contributor, or a custom role that includes it — can run commands as root through the Azure agent, without SSH and without the NSG. This is the widest path to the machine and the one worth governing most carefully. It is also the recovery path when SSH is unreachable:az vm run-command invokeruns over the Azure control plane rather than the network.
Contributor on the resource group is therefore full access in practice, even though the data-plane roles are separate on paper: it can list the storage account keys, and it can run a command on the VM that reads the managed identity’s token and with it every secret in the vault. Keep the list short and review it:
az role assignment list -g rg-nri-www -o tableData-plane roles are separate from management-plane roles. The key vaults
use RBAC and the storage accounts are reached through RBAC or keys, so
subscription Contributor does not by itself read a secret or list a blob:
| To | Role needed |
|---|---|
| Read secrets | Key Vault Secrets User |
| Write secrets | Key Vault Secrets Officer |
| Browse blobs as a signed-in user | Storage Blob Data Reader or Storage Blob Data Contributor on the account |
Assigning any of these requires Owner, User Access Administrator, or Role Based Access Control Administrator — the last of which grants role assignments
and nothing else, and is blocked from assigning the privileged roles. Without a
data-plane role, az keyvault secret list returns “Caller is not authorized to
perform action on resource”, and blobs are browsed with the account key or a
SAS instead of the signed-in identity.
Key vaults
Section titled “Key vaults”Two vaults exist, both Standard, both in rg-nri-www, with RBAC
authorization rather than access policies and soft delete at 90 days — one
for production, one reserved for a staging environment: kv-nri-www and
kv-nri-www-staging. One vault per application per
environment is deliberate: the vault is the access boundary and the throttling
unit, so a shared vault would mean one application can rate-limit an unrelated
one, and one role grant exposes every secret in it.
| Authorization | RBAC |
| Soft delete | 90 days |
| Purge protection | off — a soft-deleted secret can be purged before its 90 days elapse. Enabling it cannot be undone, which is why it is a decision rather than a default |
| Network | any network |
| Diagnostic settings | none — secret reads are not logged anywhere |
| Application grant | the VM’s managed identity holds Key Vault Secrets User: get and list on secret values and nothing else |
| Operator grant | Key Vault Secrets Officer |
The application reads its secrets through the managed identity, so no vault credential exists on the machine; Azure issues a token through the instance metadata endpoint that only this VM can obtain. A compromised application can read every secret in the vault but cannot create, change or delete one. How the application consumes the vault is on the architecture page.
Setting a secret. az keyvault secret set echoes the value back in its
JSON response, so pass -o none every time, and read the value into a shell
variable with read -rs rather than typing it on the command line where it
would land in shell history. A multi-line secret goes in through --file from
a mode-600 temporary file that is removed afterwards. Verify by listing
names — --query "[].name" — never with az keyvault secret show. Secrets
are versioned, so the previous version of any secret is its rollback.
Give the VM its identity and the vault its grant before the first deploy, since the application will not start without vault access:
az vm identity assign -g rg-nri-www -n vm-nri-wwwVAULT=$(az keyvault show -g rg-nri-www -n <vault> --query id -o tsv)az role assignment create \ --assignee-object-id <principal-id> --assignee-principal-type ServicePrincipal \ --role "Key Vault Secrets User" --scope "$VAULT"Storage accounts
Section titled “Storage accounts”| Media account | Backup account | |
|---|---|---|
| Resource group | rg-nri-www |
rg-nri-backup |
| Redundancy | Standard LRS | Standard RA-GRS — read-access geo-redundant |
| Network | all networks | default deny; virtual-network rule for the VM’s subnet; IP rule for one operator address, /32 |
| Shared-key access | enabled; the application uses the account key in a connection string | enabled; the backup job uses the account key |
| Blob versioning | off, deliberately — it would retain a copy of every overwritten image | on |
| Soft delete | 30 days, blobs and containers, allowPermanentDelete false |
30 days, blobs and containers, allowPermanentDelete false |
| Lifecycle policy | none | three rules, one per backup path |
| Diagnostic settings | none | none |
| Resource lock | none | none |
Media account
Section titled “Media account”One container holds all of the application’s media, image cache, DataProtection keys and AI search uploads; the layout is on the architecture page. Development uses a separate staging container in the same account.
Three things are weaker here than on the backup account. The account is open to
all networks; it should get the same default-deny plus virtual-network rule,
and the service endpoint is already on the subnet. It is LRS, so media has no
geo-redundancy. And the credential is a storage account key; a managed
identity with Storage Blob Data Contributor on the container would remove
the key entirely, after which shared-key access could be disabled.
Backup account
Section titled “Backup account”The backup job on the VM uploads a snapshot of each SQLite database daily under
three paths in the www container, and a lifecycle policy expires them:
| Path | Kept |
|---|---|
www/daily/umbraco/ |
14 days |
www/daily/automate/ |
30 days |
www/monthly/umbraco/ |
185 days |
A restore has not been proven. The job itself, its verification and its limits are on the architecture page.
With default-deny plus a vnet rule, a laptop cannot list these containers.
Administration happens from the VM, or through the ARM control plane —
az storage account keys list works because it is not the data plane. One
operator address is allowed as an exception so the containers can be browsed
from a laptop. It is a /32 IP rule, which works only because that address is
outside Azure. It is a standing opening that nothing expires, and the address
is dynamic, so the rule needs removing when it is no longer wanted and
re-adding under a new address when it changes:
az storage account network-rule list -n <backup account> -g rg-nri-backupaz storage account network-rule remove -n <backup account> -g rg-nri-backup --ip-address <operator address>Retention of deleted files
Section titled “Retention of deleted files”Both accounts hold a deleted blob or container for 30 days before it is
purged, with allowPermanentDelete false, so a delete cannot bypass the
retention.
Soft delete does not protect the account itself. Neither resource group carries
a resource lock, so anyone with Contributor rights can delete a storage account
or turn soft delete off. A CanNotDelete lock on rg-nri-backup is the
missing control.
Soft delete is not expiry: it holds what was deleted. What expires a backup for being old is the lifecycle policy, and the two stack — a blob the policy deletes at 14 days stays recoverable for a further 30, so about 44 days in all. Microsoft documents this: a lifecycle delete on an account with soft delete enabled puts the blob into the soft-deleted state for its full retention.
Lifecycle policy
Section titled “Lifecycle policy”deploy/backup/backup-lifecycle-policy.json in the repository is the policy,
applied with:
az storage account management-policy create \ --account-name <backup account> --resource-group rg-nri-backup \ --policy @deploy/backup/backup-lifecycle-policy.jsonaz storage account management-policy show \ --account-name <backup account> --resource-group rg-nri-backupThree rules, one per path, each deleting the current version, previous versions
and snapshots at the same age. The version action is not optional: versioning
is on, so deleting a current version turns it into a previous version, and
without a matching version rule that previous version would be kept forever.
Four things to know before touching it:
- The policy is account-wide and is replaced in full. The service does not support partial updates. This account is meant to hold more than the website, so any future rule must be merged into this one JSON file — creating a policy separately wipes these rules.
- A prefix must start with the container name, hence
www/daily/umbraco/rather thandaily/umbraco/. Prefixes are case-sensitive and support no wildcards. - Changes take up to 24 hours to take effect, and the policy then runs once a day. Deletion is never prompt.
- Anything outside those three prefixes is kept forever, lifecycle included.
The prefixes also hardcode the container name
www: point the backup job at a different container and nothing expires until the policy is updated to match.
Creating the policy is a management-plane action, so subscription Contributor
is enough — no data-plane role needed.
Monitoring
Section titled “Monitoring”Azure Monitor carries the recommended metric alert rules for the VM, all enabled, each routed to an action group with one email recipient:
| Alert | Fires when |
|---|---|
| VM availability | the availability metric drops below 1 |
| Available memory | below 1 GB |
| CPU | above 80 % |
| Network in / out | above 500 GB / 200 GB |
| OS and data disk IOPS | above 95 % of the disk’s limit |
That covers the machine, not the application. Nothing alerts on
nri-inc.service crashing (the VM stays available), a failed backup, or the
disk filling. All application, proxy, SSH and
backup logs stay in the journal on the box, and nothing ships them elsewhere.
No diagnostic settings exist on the key vaults or either storage account, so
vault secret reads and blob data-plane access are not recorded anywhere.
Sending AuditEvent from the vaults and the blob service logs to a Log
Analytics workspace is what would make them auditable.