Skip to content
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

[AIRFLOW-XXX] Add a doc about fab security #4595

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

feng-tao
Copy link
Member

Add a doc about fab security.

@feng-tao
Copy link
Member Author

PTAL @jgao54 @kaxil @ashb

@feng-tao
Copy link
Member Author

PTAL @XD-DENG

Copy link
Member

@XD-DENG XD-DENG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nits.

docs/fab_security.rst Outdated Show resolved Hide resolved
docs/fab_security.rst Outdated Show resolved Hide resolved
@feng-tao
Copy link
Member Author

[ci skip]

@feng-tao
Copy link
Member Author

@XD-DENG , PR updated. PTAL

@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #4595 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4595      +/-   ##
==========================================
+ Coverage   74.29%   74.29%   +<.01%     
==========================================
  Files         424      424              
  Lines       27860    27860              
==========================================
+ Hits        20698    20699       +1     
+ Misses       7162     7161       -1
Impacted Files Coverage Δ
airflow/utils/dag_processing.py 59.92% <0%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e6bca1...ae76b3a. Read the comment docs.

Airflow ships with a set of roles by default: Admin, User, Op, Viewer, and Public.
Only ``Admin`` users could configure/alter the permissions for other roles. But it is not recommended
that ``Admin`` users alter these default roles in any way by removing
or adding permissions to them as these roles will be re-synchronized to their original values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feng-tao , I'm not sure about this line. I remember #4118 fixed it and now permission change (adding/removing) will be persisted.

Please correct me if I'm wrong or have misunderstood something.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XD-DENG ah, the fix is for roles in ROLE_CONFIGS, which does not include admin, so @feng-tao is correct in this statement. update_admin_perm_view() will add all permissions for admin.

It's a bit restricting, but I think this is a fair restriction to make given it's admin/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jgao54 for clarification. But it's still not clear to me (please bear with me if I'm misunderstanding anything).

The impression I get from this paragraph was: 1. Admin can configure/alter permission for other roles (including User, Op, Viewer, and Public); 2. But doing this is not recommended given these roles (User, Op, Viewer, and Public) will be re-synchronized to original values, all changes will be gone after a short while.

Let's say I add can_dagrun_clear permission to Viewer (which was not granted to Viewer in original values). And this change will persist since #4118 merged. But the impression I get from this documentation is this change will not persist.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XD-DENG My bad, I re-read the lines and I agree with you it is confusing. In my mind I'm making up words on the fly as I read it:
"it's not recommended for admin to change its own permissions" is what I thought it suggested.

But yes, since #4118, permission change will be persisted for other roles.


Public
""""""
``Public`` users (anonymous) don't have any rights.
Copy link

@jgao54 jgao54 Jan 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my oversight, but public behaves kinda funny currently, i recall it goes into an infinite loop until it hits a stack overflow. This should probably get fixed, but out side of the scope of this PR.


Viewer
""""""
``Viewer`` users have limited `viewer permissions <https://github.com/apache/airflow/blob/v1-10-stable/airflow/www_rbac/security.py#L77-L100>`_
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer not using line ranges because as we make changes to security.py it may potentially invalidate this comment pretty soon. some other ideas are
(1) hard-code the permissions in this file
(2) refer to the global variables in security.py
(3) move the default security configs out of security.py into a separate module, and refer to the entire module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or make this a doc comment and then include the code/fn doc via autoclass or similar?

@ashb
Copy link
Member

ashb commented Jan 29, 2019

General thoughts: Keep this in docs/security.rst -- there's already enough "items" in the menu of the docs

@jgao54
Copy link

jgao54 commented Jan 29, 2019

Agree with @ashb, putting it in security.rst is fitting as the entire security module is created for RBAC.

@feng-tao
Copy link
Member Author

will update the pr. thanks for review @jgao54 @ashb @XD-DENG

@feng-tao feng-tao force-pushed the tfeng_create_doc_for_fab branch 4 times, most recently from 886d3b3 to cfef568 Compare January 31, 2019 05:48
@feng-tao
Copy link
Member Author

The doc has been moved to security.rst and modified per feedback.
PTAL @XD-DENG @jgao54 @ashb

@XD-DENG
Copy link
Member

XD-DENG commented Jan 31, 2019

LGTM. Thanks @feng-tao

@feng-tao
Copy link
Member Author

thanks @XD-DENG

@feng-tao feng-tao merged commit 0fef65a into apache:master Jan 31, 2019
@feng-tao feng-tao deleted the tfeng_create_doc_for_fab branch January 31, 2019 06:50
ashb pushed a commit that referenced this pull request Mar 7, 2019
wmorris75 pushed a commit to modmed/incubator-airflow that referenced this pull request Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants