Skip to content

Commit 9e305d6

Browse files
authored
Change default auth for experimental backend to deny_all (#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
1 parent 65855e5 commit 9e305d6

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
@@ -1421,6 +1421,22 @@ Now the `dag_id` will not appear repeated in the payload, and the response forma
14211421
}
14221422
```
14231423

1424+
### Experimental API will deny all request by default.
1425+
1426+
The previous default setting was to allow all API requests without authentication, but this poses security
1427+
risks to users who miss this fact. This changes the default for new installs to deny all requests by default.
1428+
1429+
**Note**: This will not change the behavior for existing installs, please update check your airflow.cfg
1430+
1431+
If you wish to have the experimental API work, and aware of the risks of enabling this without authentication
1432+
(or if you have your own authentication layer in front of Airflow) you can get
1433+
the previous behaviour on a new install by setting this in your airflow.cfg:
1434+
1435+
```
1436+
[api]
1437+
auth_backend = airflow.api.auth.backend.default
1438+
```
1439+
14241440
## Airflow 1.10.10
14251441

14261442
### 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
@@ -574,11 +574,13 @@
574574
options:
575575
- name: auth_backend
576576
description: |
577-
How to authenticate users of the API
577+
How to authenticate users of the API. See
578+
https://airflow.apache.org/docs/stable/security.html for possible values.
579+
("airflow.api.auth.backend.default" allows all requests for historic reasons)
578580
version_added: ~
579581
type: string
580582
example: ~
581-
default: "airflow.api.auth.backend.default"
583+
default: "airflow.api.auth.backend.deny_all"
582584
- name: lineage
583585
description: ~
584586
options:

airflow/config_templates/default_airflow.cfg

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

313313
[api]
314-
# How to authenticate users of the API
315-
auth_backend = airflow.api.auth.backend.default
314+
# How to authenticate users of the API. See
315+
# https://airflow.apache.org/docs/stable/security.html for possible values.
316+
# ("airflow.api.auth.backend.default" allows all requests for historic reasons)
317+
auth_backend = airflow.api.auth.backend.deny_all
316318

317319
[lineage]
318320
# what lineage backend to use

0 commit comments

Comments
 (0)