Skip to content

Commit 0a7fd30

Browse files
ashbChris Fei
authored andcommitted
Change default auth for experimental backend to deny_all (apache#9611)
In a move that should surprise no one, a number of users do not read, and leave the API wide open by default. Safe is better than powned (cherry picked from commit 9e305d6)
1 parent 53ab001 commit 0a7fd30

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

UPDATING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ Before 1.10.11 it was possible to edit DagRun State in the `/admin/dagrun/` page
7373

7474
In Airflow 1.10.11+, the user can only choose the states from the list.
7575

76+
### Experimental API will deny all request by default.
77+
78+
The previous default setting was to allow all API requests without authentication, but this poses security
79+
risks to users who miss this fact. This changes the default for new installs to deny all requests by default.
80+
81+
**Note**: This will not change the behavior for existing installs, please update check your airflow.cfg
82+
83+
If you wish to have the experimental API work, and aware of the risks of enabling this without authentication
84+
(or if you have your own authentication layer in front of Airflow) you can get
85+
the previous behaviour on a new install by setting this in your airflow.cfg:
86+
87+
```
88+
[api]
89+
auth_backend = airflow.api.auth.backend.default
90+
```
91+
7692
## Airflow 1.10.10
7793

7894
### Setting Empty string to a Airflow Variable will return an empty string

airflow/config_templates/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,13 @@
524524
options:
525525
- name: auth_backend
526526
description: |
527-
How to authenticate users of the API
527+
How to authenticate users of the API. See
528+
https://airflow.apache.org/docs/stable/security.html for possible values.
529+
("airflow.api.auth.backend.default" allows all requests for historic reasons)
528530
version_added: ~
529531
type: string
530532
example: ~
531-
default: "airflow.api.auth.backend.default"
533+
default: "airflow.api.auth.backend.deny_all"
532534
- name: lineage
533535
description: ~
534536
options:

airflow/config_templates/default_airflow.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ endpoint_url = http://localhost:8080
274274
fail_fast = False
275275

276276
[api]
277-
# How to authenticate users of the API
278-
auth_backend = airflow.api.auth.backend.default
277+
# How to authenticate users of the API. See
278+
# https://airflow.apache.org/docs/stable/security.html for possible values.
279+
# ("airflow.api.auth.backend.default" allows all requests for historic reasons)
280+
auth_backend = airflow.api.auth.backend.deny_all
279281

280282
[lineage]
281283
# what lineage backend to use

0 commit comments

Comments
 (0)