The Simplest Way to Make Longhorn and Microsoft Entra ID Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair longhorn and microsoft entra id to protect your Kubernetes block storage. This setup lets your team log in with work accounts to manage volumes. Longhorn runs inside your cluster and gives pods persistent block storage. Microsoft Entra ID holds your user accounts, group memberships, and sign-in rules. By itself, the Longhorn web board has no user login screen. Anyone who can reach the storage port can delete or change volumes. Tying your directory to your cluster fixes this huge securi

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You pair longhorn and microsoft entra id to protect your Kubernetes block storage. This setup lets your team log in with work accounts to manage volumes.

Longhorn runs inside your cluster and gives pods persistent block storage. Microsoft Entra ID holds your user accounts, group memberships, and sign-in rules. By itself, the Longhorn web board has no user login screen. Anyone who can reach the storage port can delete or change volumes. Tying your directory to your cluster fixes this huge security gap. Engineers log in once and get the exact storage rights they need.

How longhorn and microsoft entra id share login data

Longhorn does not talk to Microsoft Entra ID on its own. Instead, your cluster ingress or auth tool sits in front of Longhorn. When an engineer opens the Longhorn screen, the auth tool steps in. It sends the user to the Microsoft sign-in page right away. Microsoft checks the password and runs multi-factor checks on the user.

After a good login, Microsoft sends a signed token back to the cluster. This token lists the user email and group IDs from the directory. The cluster reads those group IDs and maps them to local roles. If the group matches, the cluster lets the request reach the Longhorn board. For command line work, Kubernetes uses the same group claims for role rules. Every storage read or write checks the user identity first.

Common failure modes and how to scope roles

Many teams make mistakes when they link these two tools in production. The biggest mistake is using one shared admin account for the whole team. When someone deletes a volume by mistake, the logs show the shared name. You cannot tell which person ran the bad command on the cluster. Another common flaw is leaving the Longhorn port open on the internal network. Attackers on the network can bypass your login rules and wipe disks.

Some teams also grant broad group rights to every developer in the company. A user who only needs to read disk status gets full write rights. To fix this, split your directory groups by job need right away. Make one group for viewing disks and another group for making backups. Use strict network rules so only your auth tool can reach Longhorn. Set short life spans on your identity tokens so old sessions expire fast. Always log every storage action with the real user email from Microsoft.

Microsoft Entra ID (Azure AD) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Keeping storage actions safe across clusters

Large teams often run many Kubernetes clusters across test and prod setups. Setting up login rules on each cluster by hand takes a lot of time. One tiny mistake in a cluster role file can expose your prod disks. You need a simple way to enforce the same identity rules everywhere.

Good security also means protecting sensitive data stored inside your cluster volumes. When engineers check volume data or run database checks, you must track commands. Data masking can rewrite emails, phone numbers, card numbers, and national IDs in results. This keeps private records safe while your team fixes broken storage nodes. Tying every single action to a Microsoft account makes security audits fast and clear.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Does Longhorn support Microsoft Entra ID logins out of the box?

No, Longhorn does not have a built-in login screen for directory accounts. You must place an auth tool or Kubernetes ingress in front of it.

How do we restrict who can delete Longhorn volumes?

Put your senior engineers in a dedicated Microsoft Entra ID security group. Map that specific group to write rules while giving others read-only rights.

What happens when an engineer leaves the company?

You disable the user account inside Microsoft Entra ID right away. Their active tokens expire soon, and they lose all Longhorn storage rights.

The query runs. The emails stay hidden.