Join our Newsletter — 33% off our NHI Course
Home› Guides› If your workflow orchestrator (Airflow-class schedulers) is compromised:…
Guide Incident Response & Forensics

If your workflow orchestrator (Airflow-class schedulers) is compromised: containment, credential rotation and rebuild playbook

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 11 November 2026 12 min read
On this page

A compromised workflow orchestrator gives the attacker scheduled code execution on your workers and a ready-made bag of credentials for every database, warehouse, cloud account and API your pipelines touch. Airflow-class schedulers run Python workflow definitions (DAGs) on a timetable, store connection credentials and variables, and hand them to tasks at run time. Their own security model is explicit that workflow authors can run arbitrary code and potentially reach the credentials that code uses, so a foothold in the workflow repository, the UI or a worker is a foothold in everything downstream. The urgent questions are which code ran, which credentials it could read, what it changed in downstream data, and how to restart pipelines without re-running the attacker's tasks. This playbook is for data platform, DevOps, security operations and incident response teams. It is vendor-neutral; where a concrete example helps, it uses the open-source Apache Airflow documentation as the reference design for the class. Preventive design is in Securing the workflow orchestrator (Airflow-class schedulers) itself.

Key takeaways

  • Pause schedules, do not just block users. Scheduled and sensor-driven tasks keep running attacker code with no one logged in.
  • Every stored connection is in scope. Anyone who can author workflows can, by design, write code that reads the credentials tasks use, so rotate all of them, not only those you can see were touched.
  • Four platform secrets matter most. The metadata database password, the encryption key for stored connections, the token signing key and the secrets backend credential each unlock the rest.
  • Downstream data is evidence and victim. Malicious tasks can alter tables, files and models as easily as they exfiltrate them, so check outputs for the window.
  • Rebuild workers and redeploy workflow code from reviewed source. Workers run arbitrary code and are not safe to clean in place.

Scope: what an orchestrator compromise covers

Entry pointTypical causeWhat the attacker can doATT&CK
Workflow code repository or bundle locationCompromised developer account, weak branch protection, writable shared folderAdd or modify DAG code that runs on workers, the parser and the trigger serviceT1059.006 Python, T1195.002 Compromise Software Supply Chain
Web UI or REST APIExposed UI, weak or shared admin login, stolen API tokenEdit connections and variables, trigger and clear runs, read logsT1078 Valid Accounts
Worker host or task podMalicious task, vulnerable dependency, container escapeRead task credentials, reach the execution API, pivot to data storesT1552.001 Credentials In Files
Metadata databaseExposed database, credentials leaked in logs or environmentRead encrypted connections, alter run state, plant variablesT1565.001 Stored Data Manipulation
Platform secretsEncryption or signing key in environment variables readable by task codeDecrypt every stored connection or forge tokensT1552.001
Cloud identity of workersBroad role attached to worker nodes or podsCall cloud APIs, create new keys for persistenceT1552.005 Cloud Instance Metadata API, T1098.001 Additional Cloud Credentials

The ShadowRay campaign of 2024 against exposed AI compute clusters shows the pattern: an exposed job submission interface became a route to cloud credentials, AI API tokens and compute. If the incident began in CI, run the CI/CD Pipeline Compromise Playbook alongside this one.

Why the blast radius is wide: the trust model

The Apache Airflow security model sets out three roles that apply across this class of scheduler:

  • Deployment managers: install and configure the platform and have access to all credentials.
  • Workflow authors: can create, modify and delete workflow files. Their code is not verified, checked or sandboxed by the platform, so they can effectively execute arbitrary code on workers, the file parser and the trigger service, and can potentially access the credentials that code uses.
  • UI users: range from viewers to administrators. Users who can edit connections can, for some providers, configure options that lead to code execution on workers.

The same document states that workflow authors have access to all workflows in an installation and can change the state of any of them, and that task tokens for the internal execution API do not carry per-workflow authorisation. An experimental multi-team mode adds isolation at the UI and API level but, as the documentation says, does not yet guarantee task-level isolation. For incident scoping, that means one malicious workflow author or one compromised worker should be treated as able to reach every connection and variable in the installation.

How the compromise shows up

  • Workflow code that does not match the repository: files in the deployed bundle or DAG folder that differ from the reviewed commit, or new workflows with no pull request.
  • Connection and variable changes: edits to connection hosts, extras or login fields, or new variables, especially just before a run.
  • Odd runs: manual triggers or cleared runs by unexpected users, tasks with unusual durations, or runs outside the schedule.
  • Worker network behaviour: outbound connections from workers to destinations no connection is configured for.
  • Cloud and data store activity: worker identities creating keys, reading secrets they do not normally read, or bulk exports from warehouses.
  • Secrets in task logs: the security model warns that configuration values can leak through logs, and that values exposed by task code through environment variables are not automatically masked.

Triage: the first hour

  1. Pause all schedules: pause every workflow, or stop the scheduler, so no further attacker code runs. Record which workflows were paused by you, so restart is controlled.
  2. Freeze code delivery: stop the job that syncs workflow code from the repository, and lock the branch and bundle location to responders.
  3. Snapshot the state: back up the metadata database, export the deployed workflow files with hashes, export connections and variables metadata, users and roles, the audit log and task logs for the window.
  4. Preserve workers: snapshot or image running workers and keep pod specifications and logs before they are recycled; ephemeral task pods disappear quickly.
  5. Restrict access: limit the UI and API to responders and disable API tokens not needed for response.

Containment by priority

  1. Cut worker egress: restrict worker outbound traffic to the data stores and APIs that connections legitimately target, so exfiltration and command channels stop.
  2. Remove malicious code: replace the deployed workflow set with the last reviewed commit, and quarantine any added or modified files as evidence.
  3. Revoke access: disable unknown users, rotate admin passwords, revoke API tokens and identity provider sessions for workflow authors and admins.
  4. Contain downstream identities: for every connection, disable or restrict the target credential at the target system (database user, warehouse role, cloud key, API token) until it has been rotated.
  5. Restrict worker cloud roles: remove permissions not needed for recovery and look for keys or identities they created (T1098.001).
  6. Protect the logs: ship scheduler, API, worker and audit logs to a store that platform administrators cannot alter.

Credential rotation inventory

CredentialWhere it livesRotation actionBetter pattern afterwards
Connection credentials (databases, warehouses, cloud, APIs, SFTP)Metadata database (encrypted), environment variables, secrets backendRotate at each target system, then update the stored valueSecrets backend with per-connection scope; federated identity where targets support it
Encryption key for stored connectionsConfiguration or environmentGenerate a new key and re-encrypt (see below)Available only to components that need it
Token signing key (JWT secret or private key)Configuration of API server and schedulerReplace; invalidate tokens issued with the old keyAsymmetric keys, never present on workers
Metadata database passwordConfiguration of platform componentsRotate; review database logsKept away from workers and parsers
Secrets backend credentialPlatform configuration or workload identityRotate and review what was read in the windowWorkload identity scoped to the paths the platform needs
Worker cloud roles and keysNodes, pods, service accountsRotate keys, delete unknown keys, narrow rolesPer-workflow workload identity with minimum scope
Variables holding secretsMetadata databaseRotate the underlying secrets and move them to connections or the backendNo secrets in variables
UI admin accounts and API tokensPlatform, identity providerReset, enforce SSO and phishing-resistant MFASSO only; break-glass in a vault
  • Encryption key rotation: the Airflow documentation describes rotating the Fernet key without breaking stored values: set the key setting to the new key followed by the old one, run the rotate command to re-encrypt, then remove the old key. In an incident, re-encrypting is not enough on its own: anyone who held the old key could already decrypt every stored value, so the underlying credentials must be rotated at their targets as well.
  • Signing key: the security model notes that with a symmetric signing key, any component holding it can forge tokens with arbitrary claims, and that remote workers which sign their own requests must hold it. Treat those hosts as part of the control plane and rotate accordingly.
  • Lookup order: by default the platform checks environment variables first and then the metadata database; an alternative secrets backend is searched before both, and on duplicate keys reads return the first match. Check all three locations so a stale or planted value does not shadow the rotated one.

See the If your secrets manager is compromised playbook if the backend itself may be affected, and the Workload Identity Federation Guide for replacing static keys.

Eradication and rebuild

  1. Rebuild platform components: redeploy scheduler, API server, parser, trigger service and workers from trusted images on a supported release, with configuration from reviewed source.
  2. Separate secrets by component: follow the documented hardening: the signing key only on components that issue or validate tokens, database credentials and the signing key never on workers, and connection credentials served through the execution API rather than exposed to every component.
  3. Re-review workflow code: review every workflow changed in the window and all custom operators, hooks and plugins; pin dependencies.
  4. Check downstream data: compare tables, files and models written by affected runs with backups or source systems, and restore where integrity cannot be shown. See the If your data warehouse and lakehouse is compromised playbook.
  5. Re-gate code delivery: require reviewed, protected-branch merges for workflow code and deploy it by a pipeline identity, not by hand.

Recovery, testing and rollback

  • Staged restart: unpause a small set of low-risk workflows first, confirm they succeed with rotated credentials and that no unexpected egress occurs, then unpause by business priority.
  • Backfill with care: decide per workflow whether to backfill missed runs; never re-run runs from the compromise window without reviewing their code version.
  • Negative tests: confirm a token signed with the old key is rejected, and that a worker cannot read the database password or signing key.
  • Rollback: keep the reviewed commit hash and the post-rotation secret versions as the known-good set.

Small and large organisations

DecisionSmall team, one installationLarge estate, many teams and installations
Credential rotationRotate every connection at onceRotate by target criticality; production data stores and cloud admin first
Isolation afterwardsSingle installation, strict author listSeparate installations per trust boundary, since task-level isolation between teams is not guaranteed
Data integrity reviewCheck all outputs in the windowCheck outputs of affected workflows first, then sample the rest

Evidence and notification

  • Preserve: database backup, deployed workflow files with hashes, repository history, task and scheduler logs, worker images and pod specifications, audit logs, and target-side logs for each connection, with chain of custody (CSF 2.0 RS.AN-07).
  • Notification: orchestrators often move personal and regulated data, so assess what the attacker could read through connections. See the Cyber Incident Reporting Requirements Map and coordinate with affected parties as NIST SP 800-61 Rev. 3 describes.

Detection and measurement

  1. Deployed workflow files whose hash does not match a reviewed commit (target zero).
  2. Connections with a named owner and a rotation date inside policy (NHI Mgmt Group recommendation: 100%, rotated at least every 90 days or federated).
  3. Workers able to read the database password or signing key (target zero).
  4. Worker egress to destinations not linked to a connection (target zero; each one investigated).
  5. Manual triggers and clears by non-owner users (tracked and reviewed weekly).
  6. Secrets found in task logs (target zero).

Framework mapping

AreaNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK addressed
Workflow code integritySI-7RS.AN-03T1059.006, T1195.002
Connection and platform secretsIA-5, SC-12RS.MI-02T1552.001, T1552.005
Accounts, roles and least privilegeAC-2, AC-6RS.MI-01T1078, T1098.001
Egress restrictionSC-7RS.MI-01T1552.005
Logging and monitoringAU-9, SI-4RS.AN-07T1685 Disable or Modify Tools
Data integrity and recoveryIR-4, CP-10RC.RP-02T1565.001

Common failure patterns

  • Disabling users but leaving schedules running: planted workflows keep executing every interval.
  • Rotating only the connections that look touched: any author-level code could read all of them.
  • Re-encrypting without rotating: a new encryption key does not help if the old one was read; the credentials themselves must change.
  • Restoring the database from a backup that holds planted variables: check restored connections and variables before restarting.
  • Forgetting environment variables and the secrets backend: stale values shadow rotated ones because of the lookup order.
  • Skipping the data review: altered outputs in a warehouse or feature store outlive the incident and feed reports and models.

Practitioner checklist

  • Pause all schedules and stop workflow code sync.
  • Back up the database, export deployed code, logs, users and connection metadata, and image workers.
  • Cut worker egress to legitimate targets only.
  • Replace deployed code with the last reviewed commit and quarantine changed files.
  • Rotate every connection at its target, plus the encryption key, signing key, database password and backend credential.
  • Check environment variables, the database and the backend for shadowed values.
  • Rebuild components with secrets separated by component and review downstream data.
  • Restart in stages and track the metrics above.

Standards and references

Related NHI Mgmt Group resources: Apache Airflow Security Guide · Securing the workflow orchestrator (Airflow-class schedulers) itself · ETL and ELT Pipeline Security Guide · If your ETL and iPaaS platform is compromised · Workflow orchestrator (Airflow-class schedulers) health check

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 11 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org