You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* First parts of airflow OIDC
* Add integration test for OIDC
* Document OIDC support
* Update wip
* Adapt module tests in operator-binary/src/config.rs
* Adding unit tests
* WIP before merge
* WIP compiling operator
* Fixng auth tests
* Update the OIDC integration test
* Env vars oidc
* Cleaning up
* Adding changelog
* Remove reference
* Regenerate charts and Nix files
* making pre-commit happy
* fixing typo
* again pre-commit
* pre-commit nr3
* pre-commit nr4
* pre-commit nr5
* Env var set by operator rather then envoverrides
* Removing TODO, sort toml alphabetically
* Andrew comments
Co-authored-by: Andrew Kenworthy <1712947+adwk67@users.noreply.github.com>
* Specify every arm rather then just matching all
---------
Co-authored-by: Siegfried Weber <mail@siegfriedweber.net>
Co-authored-by: Andrew Kenworthy <1712947+adwk67@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
Use the env var `KUBERNETES_CLUSTER_DOMAIN` or the operator Helm chart property `kubernetesClusterDomain` to set a non-default cluster domain ([#518]).
Copy file name to clipboardExpand all lines: deploy/helm/airflow-operator/crds/crds.yaml
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -452,13 +452,27 @@ spec:
452
452
properties:
453
453
authentication:
454
454
default: []
455
-
description: The Airflow [authentication](https://docs.stackable.tech/home/nightly/airflow/usage-guide/security.html) settings. Currently the underlying Flask App Builder only supports one authentication mechanism at a time. This means the operator will error out if multiple references to an AuthenticationClass are provided.
456
455
items:
457
456
properties:
458
457
authenticationClass:
459
-
description: Name of the [AuthenticationClass](https://docs.stackable.tech/home/nightly/concepts/authentication.html#authenticationclass) used to authenticate the users. At the moment only LDAP is supported. If not specified the default authentication (AUTH_DB) will be used.
460
-
nullable: true
458
+
description: Name of the [AuthenticationClass](https://docs.stackable.tech/home/nightly/concepts/authentication) used to authenticate users.
461
459
type: string
460
+
oidc:
461
+
description: This field contains OIDC-specific configuration. It is only required in case OIDC is used.
462
+
nullable: true
463
+
properties:
464
+
clientCredentialsSecret:
465
+
description: A reference to the OIDC client credentials secret. The secret contains the client id and secret.
466
+
type: string
467
+
extraScopes:
468
+
default: []
469
+
description: An optional list of extra scopes which get merged with the scopes defined in the [`AuthenticationClass`].
470
+
items:
471
+
type: string
472
+
type: array
473
+
required:
474
+
- clientCredentialsSecret
475
+
type: object
462
476
syncRolesAt:
463
477
default: Registration
464
478
description: If we should replace ALL the user's roles each login, or only on registration. Gets mapped to `AUTH_ROLES_SYNC_AT_LOGIN`
@@ -474,6 +488,8 @@ spec:
474
488
default: Public
475
489
description: This role will be given in addition to any AUTH_ROLES_MAPPING. Gets mapped to `AUTH_USER_REGISTRATION_ROLE`
Secure Apache Airflow by configuring user authentication and authorization.
6
-
Airflow provides built-in user and role management, but can also connect to a LDAP server to manage users centrally instead.
7
+
Airflow provides built-in user and role management, but can also connect to an LDAP server or an OIDC provider to manage users centrally instead.
7
8
8
9
== Authentication
9
10
10
-
Users need to authenticate themselves before using Airflow, and there are two ways to configure users:
11
-
The built-in user management or LDAP.
11
+
Users need to authenticate themselves before using Airflow, and there are several ways in which this can be set up.
12
+

13
+
[IMPORTANT]
14
+
.Multiple authentication methods
15
+
====
16
+
Only one authentication method is supported at a time, and in case of LDAP, only one authentication class is allowed.
17
+
This means, it is not possible to configure both LDAP and OIDC authentication methods at the same time, but *it is* possible to configure multiple OIDC classes *or* one LDAP authentication class.
<1> The reference to an AuthenticationClass called `keycloak`
84
+
<2> The reference to the Secret containing the Airflow client credentials
85
+
<3> The default role to which all users are assigned
86
+
87
+
Users that log in with OpenID Connect are assigned to a default {airflow-access-control-docs}[role] which is specified with the `userRegistrationRole` property.
88
+
89
+
The Secret containing the Airflow client credentials:
90
+
91
+
[source,yaml]
92
+
----
93
+
apiVersion: v1
94
+
kind: Secret
95
+
metadata:
96
+
name: airflow-keycloak-client
97
+
stringData:
98
+
clientId: airflow # <1>
99
+
clientSecret: airflow_client_secret # <2>
100
+
----
101
+
102
+
<1> The client ID of Airflow as defined in Keycloak
103
+
<2> The client secret as defined in Keycloak
104
+
105
+
A minimum client configuration in Keycloak for this example looks like this:
106
+
107
+
[source,json]
108
+
----
109
+
{
110
+
"clientId": "airflow",
111
+
"enabled": true,
112
+
"clientAuthenticatorType": "client-secret", # <1>
113
+
"secret": "airflow_client_secret",
114
+
"redirectUris": [
115
+
"*"
116
+
],
117
+
"webOrigins": [
118
+
"*"
119
+
],
120
+
"standardFlowEnabled": true, # <2>
121
+
"protocol": "openid-connect" # <3>
122
+
}
123
+
----
124
+
125
+
<1> Sets the OIDC type to confidential access type.
126
+
<2> Enables the OAuth2 "Authorization Code Flow".
127
+
<3> Enables OpenID Connect and OAuth2 support.
128
+
129
+
Further information for specifying an AuthenticationClass for an OIDC provider can be found at the xref:concepts:authentication.adoc#_oidc[concepts page].
130
+
51
131
== Authorization
52
132
The Airflow Webserver delegates the {airflow-access-control-docs}[handling of user access control] to https://flask-appbuilder.readthedocs.io/en/latest/security.html[Flask AppBuilder].
53
133
@@ -74,3 +154,26 @@ spec:
74
154
75
155
<1> The reference to an AuthenticationClass called `ldap`
76
156
<2> All users are assigned to the `Admin` role
157
+
158
+
=== OpenID Connect
159
+
160
+
The mechanism for assigning roles to users described in the LDAP section also applies to OpenID Connect.
161
+
Airflow supports assigning {airflow-access-control-docs}[Roles] to users based on their OpenID Connect scopes, though this is not yet supported by the Stackable operator.
162
+
All the users logging in via OpenID Connect get assigned to the same role which you can configure via the attribute `authentication[*].userRegistrationRole` on the `AirflowCluster` object:
0 commit comments