Skip to content

Implement access control for Execution API (variables, connections, XComs) #60125

@Subham-KRLX

Description

@Subham-KRLX

Description

The Execution API has authentication but no authorization - tasks can access ANY variable, connection, or XCom. Three TODO placeholders need implementation to enforce team-based access control.

Use case/motivation

Security Problem: Any authenticated task can currently access resources from any team because has_variable_access(), has_connection_access(), and has_xcom_access() always return True.

What I want to achieve:

  • Tasks should only access variables/connections from their DAG's team
  • Tasks should only access XComs from their own DAG run
  • Proper authorization checks in Execution API (similar to Core API)

Affected files:

  • airflow/api_fastapi/execution_api/routes/variables.py:40
  • airflow/api_fastapi/execution_api/routes/connections.py:35
  • airflow/api_fastapi/execution_api/routes/xcoms.py:50

Proposed solution:

  1. Extract task's DAG from JWT token
  2. Verify resource's team matches DAG's team
  3. Allow global resources (no team)
  4. Backward compatible with feature flag

Benefits:

  • Security: Resource isolation
  • Multi-team: Team boundaries enforced
  • Compliance: Audit trail for access

Related issues

No

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

area:APIAirflow's REST/HTTP APIarea:authkind:featureFeature Requestsneeds-triagelabel for new issues that we didn't triage yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions