The Simplest Way to Make Active Directory and Step Functions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair active directory and step functions to run cloud tasks with clear user roles. Your directory holds user groups while the state machine runs tasks in order. This setup lets your team start cloud workflows using their normal login credentials. It also helps you track who started each task across your cloud accounts. How active directory and step functions share login data Your directory acts as the single source of truth for user identities and groups. When a user logs in, the direc

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 active directory and step functions to run cloud tasks with clear user roles. Your directory holds user groups while the state machine runs tasks in order.

This setup lets your team start cloud workflows using their normal login credentials. It also helps you track who started each task across your cloud accounts.

How active directory and step functions share login data

Your directory acts as the single source of truth for user identities and groups. When a user logs in, the directory checks their name and group rules.

Next, the directory sends a signed identity token to your cloud account. The cloud account reads this token and maps the user to a specific role.

That cloud role holds the exact rules needed to start or view a workflow. The state machine then runs its steps using its own separate execution role.

This split keeps user login rights separate from the tasks the workflow runs. A user can start a job without holding direct rights to the underlying databases.

Each step in the workflow passes small data payloads to the next step. You should keep private details like emails or phone numbers out of these payloads.

Common failure modes and how to scope roles

Many teams make the mistake of using one shared service account for all workflows. When everyone uses the same account, your logs cannot show who started a run.

Broad tokens cause another big risk for production systems. If a role allows every action, a small mistake can wipe out key data.

Unlogged queries also hurt your security posture during an audit. When a workflow reads a database, you need a clear record of that event.

Active Directory + Cloud Functions IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these issues by scoping roles down to single tasks. Map each directory group to a narrow cloud role with strict limits.

Give developers rights to test workflows in sandboxes, not in live production systems. Give each state machine its own execution role with access to only required resources.

Lock down your network paths so workflows only talk to approved internal services. Use private network links between your cloud steps and your domain controllers.

Check your state machine logs often to spot failed login attempts or odd runs. Good logs show the caller identity, the start time, and the final state.

Safe ways to handle secrets and user data

Workflows often need to talk to external apps or internal databases during a run. Never hardcode passwords or static keys inside your state machine definitions.

Instead, let the workflow fetch short-lived keys from a secure secret store at runtime. Rotate those keys on a regular schedule to limit the blast radius of leaks.

Sometimes a workflow must process sensitive records like card numbers or national IDs. Masking rewrites matched fields in results so raw values do not land in logs.

Keep your state payloads small and pass record pointers instead of full user files. This habit protects user privacy and keeps your workflow history clean and safe.

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

Can users start a state machine with their directory login?

Yes, users can log in through identity federation to assume an approved cloud role. That role grants them the right to start specific state machines.

Should a state machine use a shared directory service account?

No, shared accounts hide who ran a task and make audits very hard. Use individual roles for users and dedicated execution roles for each state machine.

How do we protect sensitive fields like phone numbers in workflow logs?

Do not pass raw emails, phone numbers, or card numbers in state payloads. Apply data masking to rewrite matched fields in results before writing any logs.

The query runs. The emails stay hidden.