I'm attempting to work out how Airflow might work in a multi-tenant environment. Specifically the requirements should look something like this:
- Two teams, TeamA and TeamB, are using a single Airflow instance.
- Team's A and B each have their own service user account: serviceUserA and ServiceUserB which they should run their jobs under.
- For security reasons, Team A should not be able to create jobs that run under ServiceUserB and vice versa.
At this point it's not clear to me whether requirement 3. can be met with Airflow, short of giving each team a separate Airflow instance. Is there any way in which this can be achieved?
Until Airflow Version 1.9.0:
The reason the user is still able to access all the dags is that it is a
superuser
by default. Unless you use LDAP for authentication, all the users created are superusers and Airflow have no other roles.However, if you use LDAP, you can have superuser and dataprofiler roles.
This should change in upcoming versions of Airflow.
As the documentation states here: You can use
webserver:filter_by_owner
only if you are using LDAP authentication. So to achieve multi-tenancy, you can use LDAP and givesuperuser
permissions to only admins and have eitheruser
ordata_profiler
role for other users.