apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.12k stars 14.31k forks source link

Airflow local settings no longer importable from dags folder #42156

Closed pdebelak closed 1 month ago

pdebelak commented 2 months ago

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.10.1

What happened?

As of 2.10.1 Airflow no longer imports local settings from the dags folder because of changes in #41672.

What you think should happen instead?

Either Airflow should continue to import local settings from the dags folder or this breaking change should be documented. For example the docs for local settings don't make it clear that $AIRFLOW_HOME/dags is not in sys.path when this is loaded even though it is later.

How to reproduce

Put your airflow_local_settings.py file in dags/ and see that it is loaded in 2.10.0 and not in 2.10.1.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

Code of Conduct

potiuk commented 2 months ago

Feel free to add documentation to explain it @pdebelak in the place that you feel is best (click 'suggest a change on this page') and PR will be opened for you.

This was a security fix and the fact that you could add locL_settings.py to DAG folder was an accidental behaviour (it should never be possible because of our security model).

I think since you are the user who used this accidental behaviour you might be the best to describe it for people like you so that they can understand it

potiuk commented 2 months ago

See the CVE advisory published on users@ mailing list for details

jishangarg commented 2 months ago

I am trying to get this done.

jishangarg commented 2 months ago

@potiuk can you please review it.