-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role is automatically populated with permissions ? #9245
Comments
Happens to me on 1.10.11 with |
This happened to me on these three versions on which i tested RBAC: 1.10.5 & 1.10.8 & 1.10.11. Any clues could this be an external thing, such as javascript or something that populates the role window? Other people have had this issue on version 1.10.6: This is a serious issue, RBAC is not RBAC with this bug. |
I believe it's happening here https://github.com/apache/airflow/blob/1.10.11/airflow/www_rbac/security.py#L373 . I didn't really have time to study the method properly (it's a bit too complex), to provide a fix. But esentially, this method is called periodically and if a role is in the If a role is not in the list, its permission gets generated by the method and synced. I believe its during this process when permissions are added to the role automatically. My hot fix is that I created a custom role, I defined it the same way as default roles are (as shown in the 2nd link) and I added the role the |
@dakov, your workaround worked for me. Currently in the process of testing all sorts of cases to see if it will repopulate with unwanted permissions. |
@dakov I've been experiencing similar issues creating roles and getting them to work using the Airflow UI (version 1.10.11). I want to test your method. I tried the following:
Does not seem to be working for me. Please let me know if I'm missing something here. |
Can any of the devs comment on a workaround that doesn't involve modifying the Airflow source code? Preventing users from deleting Airflow DAGs, DAGRuns, etc should be easy to do. |
@jhtimmins Can you please replicate it on 1.10.14 and 2.0.0 and take a deeper look at this -- hopefully we can fix it for 1.10.15 and 2.0.1 |
@kaxil The bug seems related to the method https://github.com/apache/airflow/blame/master/airflow/www/security.py#L449 |
I think it just means creating a new role with Dag-level permissions as explained in https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html#dag-level-role We could also do define access control for that DAG in the DAG itself: airflow/tests/serialization/test_dag_serialization.py Lines 155 to 164 in 39d9057
|
@kaxil Ok, thanks for clarifying. I think the original model is confusing, because "Dag roles" aren't any different than other roles. You can create custom roles with any permissions you want. And yikes, I didn't realize you could handle access control on the actual DAG. That majorly bums me out. |
Apache Airflow version: 1.10.10
Environment:
What happened: Created a new role, added "can_index" and "menu_access on DAGs". After webserver restart, new roles appeared:
[can delete on Airflow, can tree on Airflow, can index on Airflow, can task stats on Airflow, can gantt on Airflow, can task instances on Airflow, can landing times on Airflow, can log on Airflow, can dag stats on Airflow, can paused on Airflow, can run on Airflow, can trigger on Airflow, can xcom on Airflow, can rendered on Airflow, can dag details on Airflow, can refresh on Airflow, can tries on Airflow, can code on Airflow, can get logs with metadata on Airflow, can dagrun clear on Airflow, can duration on Airflow, can graph on Airflow, can blocked on Airflow, can pickle info on Airflow, can clear on Airflow, can task on Airflow, can success on Airflow, can list on DagModelView, can show on DagModelView, can list on DagRunModelView, can add on DagRunModelView, muldelete on DagRunModelView, set failed on DagRunModelView, set running on DagRunModelView, set success on DagRunModelView, menu access on DAG Runs, menu access on Browse, can list on JobModelView, menu access on Jobs, can list on LogModelView, menu access on Logs, can list on SlaMissModelView, menu access on SLA Misses, can list on TaskInstanceModelView, clear on TaskInstanceModelView, set failed on TaskInstanceModelView, set running on TaskInstanceModelView, set success on TaskInstanceModelView, menu access on Task Instances, menu access on Documentation, menu access on Docs, can version on VersionView, menu access on Version, menu access on About]
What you expected to happen: Role is persistent unless changed by a user
How to reproduce it: Add new role with "can_index" and "menu access on DAG Runs". Restart webserver. The new role now has extra permissions.
Anything else we need to know: 100 % Reproducable.
I've found people with similar issue on stack overflow: https://stackoverflow.com/questions/60100536/apache-airflow-some-permissions-on-new-role-are-reset
And on Slack a similar issue:
The text was updated successfully, but these errors were encountered: