Entra Id Federated Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up entra id federated credentials by linking an external token issuer to an app registration. This setup lets outside workloads log in to Microsoft cloud resources without storing static secrets. Teams often use this flow for build jobs or cloud apps running in other platforms. When teams assign broad directory roles to that app, the outside job gains too much power. Any flaw in the outside job then puts every linked database and server at risk. How entra id federated credentials work

Microsoft Entra ID (Azure AD) + Ephemeral Credentials: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up entra id federated credentials by linking an external token issuer to an app registration. This setup lets outside workloads log in to Microsoft cloud resources without storing static secrets. Teams often use this flow for build jobs or cloud apps running in other platforms. When teams assign broad directory roles to that app, the outside job gains too much power. Any flaw in the outside job then puts every linked database and server at risk.

How entra id federated credentials work in practice

Standard cloud apps often use a client secret or a digital certificate to log in. A team member must create that secret, store it in a vault, and rotate it. If someone leaks that secret, an attacker can log in from anywhere on the internet. Federated identity removes that stored secret from your daily workflow.

Instead, you build a trust link between your Microsoft directory and an external identity provider. First, the external workload requests a signed token from its own host platform. That token holds clear facts like the issuer address, the subject name, and the audience. Next, the workload sends this signed token to Microsoft to ask for an access token.

Microsoft checks the signature against the public keys of the external identity provider. It also checks that the issuer, subject, and audience match the trust rule you saved. When every value matches, Microsoft returns a short-lived token for the target cloud resource. The workload uses this new token to log in and run tasks without any password.

Why federated trust must pair with exact subject rules

The biggest risk in this design comes from loose matching rules on the trust link. Each trust rule checks the subject field inside the incoming token before granting a session. If you set up a broad subject rule, many outside jobs might match by mistake. For example, a rule might trust any branch or pull request inside a code host.

An untrusted contributor could open a pull request that triggers the build job right away. The build host issues a valid token, and Microsoft accepts it because the rule fits. Now untrusted code runs with the full cloud role of your production app registration. You must lock the subject field to one specific branch, tag, or workload account.

You should also split separate workloads into their own distinct app registrations. Give one identity to your test pipeline and a separate identity to your production job. That way, a test job cannot use production permissions even if its token is valid. Clear separation keeps a mistake in one pipeline from spreading across your cloud account.

Microsoft Entra ID (Azure AD) + Ephemeral Credentials: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What identity federation solves and what it leaves open

Workload federation solves the hard problem of storing and rotating long-lived passwords across different clouds. You no longer need to copy static keys into build tools or outside server vaults. When a build job finishes, its temporary token expires on its own after a short time. Security teams save hours of manual key rotation and cut the risk of leaked passwords.

Still, federation only checks who is logging in at the start of a cloud session. Once the workload gets a valid token, Microsoft steps out of the data path. The directory does not see the exact queries or commands that run inside your databases. If a job holds a write role, it can drop tables or read raw rows.

Directory logs will show that the app requested a token at a certain time. Those logs will not show which database rows changed or if card numbers came back. Teams still need controls that inspect individual statements and mask sensitive fields like emails in results. Controlling the login step is vital, but safe operations require visibility into every active command.

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

What replaces client secrets when using workload identity federation?

An OpenID Connect token from an external platform replaces the static client secret. Microsoft checks this signed token against your trust rule and issues an access token.

Can one app registration hold multiple federated trust rules?

Yes, a single app registration can store several distinct federated trust rules at once. Still, creating separate app registrations per job gives you much cleaner role separation.

Does workload federation restrict which SQL queries an app can run?

No, federation only handles the initial login handshake and token exchange with the directory. Once logged in, the workload can run any command allowed by its database role.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.