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

Add authentication to lineage endpoint for experimental API #13870

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

iangcarroll
Copy link
Contributor

I couldn't find a good reason why this endpoint was missing the authentication decorator. This would likely break any clients calling this endpoint in an unauthenticated manner, but given it's not documented that it should be unauthenticated, I would imagine this is fine.

This might deserve a low-impact CVE. It looks like it went wrong in fbd994a, during a refactor of the stable API which seems unrelated to this endpoint.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:webserver Webserver related Issues labels Jan 24, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 24, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@XD-DENG
Copy link
Member

XD-DENG commented Jan 24, 2021

Thanks @iangcarroll for this PR.

However please note this experimental API is already deprecated (https://github.com/apache/airflow/blob/master/airflow/config_templates/default_airflow.cfg#L374), and we favour the stable REST API.

Currently experimental API is disabled by default (https://github.com/apache/airflow/blob/master/UPDATING.md#the-experimental-rest-api-is-disabled-by-default), and I would suggest migrating away from it, instead of making any further change on it.

@iangcarroll
Copy link
Contributor Author

iangcarroll commented Jan 24, 2021

Hi @XD-DENG, sure, I agree with that. However, it still exists, and if anyone has it enabled, they would be vulnerable to a security issue, as I do not see any other authorization check on this endpoint. This would be unexpected by anyone who has authentication configured for the experimental API.

And, if anyone has set the auth_backend to airflow.api.auth.backend.deny_all, expecting it to disable the API, it would not apply to this endpoint.

@potiuk
Copy link
Member

potiuk commented Jan 24, 2021

Hi @XD-DENG, sure, I agree with that. However, it still exists, and if anyone has it enabled, they would be vulnerable to a security issue, as I do not see any other authorization check on this endpoint. This would be unexpected by anyone who has authentication configured for the experimental API.

And, if anyone has set the auth_backend to airflow.api.auth.backend.deny_all, expecting it to disable the API, it would not apply to this endpoint.

Yep. Agree - if that is a regression, we should fix it - while the stable API is deprecated, we still support it in 2.0 and regressions should be fixed.

@potiuk
Copy link
Member

potiuk commented Jan 24, 2021

@bolkedebruin -> I think that API was added by you, is there any reason why it should be kept unauthenticated? Can you please confirm this was an accidental removal of "require_authentication" ?

@potiuk potiuk added this to the Airflow 2.0.1 milestone Jan 24, 2021
@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Jan 24, 2021
@kaxil kaxil changed the title Add authentication to experimental API endpoint. Add authentication to lineage endpoint for experimental API Jan 27, 2021
@kaxil kaxil merged commit 24a5424 into apache:master Jan 27, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 27, 2021

Awesome work, congrats on your first merged pull request!

@iangcarroll iangcarroll deleted the experimental_auth branch January 27, 2021 22:01
kaxil pushed a commit that referenced this pull request Jan 27, 2021
kaxil pushed a commit that referenced this pull request Feb 4, 2021
kaxil pushed a commit to astronomer/airflow that referenced this pull request Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:webserver Webserver related Issues okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants