The Simplest Way to Make Azure Active Directory and Harness Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair azure active directory and harness to control who runs code pipelines. Azure AD checks user logins while Harness runs builds and ships apps. This setup stops teams from making separate passwords for every new builder. When a person joins or leaves a team, one directory change updates their rights. Security leads can check one central log to see who entered the system. Builders also save time because they log in once per workday. This guide explains how identity data moves between bot

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.

Teams pair azure active directory and harness to control who runs code pipelines. Azure AD checks user logins while Harness runs builds and ships apps.

This setup stops teams from making separate passwords for every new builder. When a person joins or leaves a team, one directory change updates their rights. Security leads can check one central log to see who entered the system. Builders also save time because they log in once per workday. This guide explains how identity data moves between both tools and how to avoid risk.

How azure active directory and harness share user logins and roles

The link between both tools relies on standard single sign-on rules and user sync. First, an admin registers Harness as a trusted enterprise app inside Azure AD. Next, both systems trade trust files and certificates so they can check login messages. When an engineer opens Harness, the platform sends them over to Microsoft to log in.

Azure AD checks the password and runs multi-factor checks for that specific person. After a good check, Microsoft sends a signed message back to the deployment tool. That message lists the user email and the security groups they belong to. Harness reads those group names and maps them to internal project roles.

Teams also turn on automated user sync to handle daily staff changes. With sync active, Azure AD pushes new users and group updates straight to Harness. If HR disables a user in the main directory, Harness blocks their account right away. This flow keeps project permissions clean without manual ticket work from the platform team.

Common failure modes and how to scope roles

Many teams set up single sign-on well but leave dangerous gaps in daily operations. One common mistake is mapping broad directory groups to full admin roles in Harness. If every developer gets admin rights, anyone can edit production pipelines or view secret keys. Another big risk comes from shared service accounts used for automation tasks.

Teams often create long-lived API tokens in Harness so external scripts can start builds. These static tokens rarely expire and often sit in plain text inside old scripts. When a token leaks, an attacker can run code without passing an Azure AD check. Also, when pipelines talk to databases or cloud hosts, they often share one master key. Shared keys make it impossible to see which person ran a specific query or command.

Active Directory + Azure RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, admins should create tight groups in Azure AD for each project. Give developers rights to build and test in dev spaces only. Require a separate group and an approval step for any production run. Replace static user tokens with short-lived workload identities wherever the platform allows it. Rotate any remaining service keys on a strict monthly timer and remove unused accounts.

Managing direct database and host tasks beyond pipelines

Pipelines handle most code pushes, but engineers still need direct access to fix live bugs. A builder might need to read a production table or check a broken container. Harness does not manage interactive database queries or direct shell commands for staff. Teams often fall back to shared passwords or static keys for these manual tasks.

Instead, link those direct data sessions to the same Azure AD groups you already use. Every query or shell command should tie back to one verified user identity. You can also add data masking to rewrite sensitive fields like emails or card numbers in results. This keeps live data safe while engineers fix problems fast.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How do we stop ex-employees from running Harness pipelines?

Turn on automated user sync between Azure AD and your Harness account. When you disable the user in Azure AD, the sync removes their Harness access right away.

Should we map our main engineering group to the Harness admin role?

No, you should keep the admin role for a small platform team only. Create smaller Azure AD groups for each project and give them limited builder rights.

How can we secure manual database checks during a failed deployment?

Do not share the pipeline database password with your developers during an outage. Require engineers to log in with their Azure AD identity and apply data masking on results.

The query runs. The emails stay hidden.