有没有办法在Apache Airflow中将RBAC与LDAP结合起来?



我正在尝试对Active Directory中的用户强制执行Airflow中的精细权限。是否可以通过LDAP使用Active Directory进行身份验证,并通过RBAC实现安全性/权限(通过将RBAC角色映射到AD组/用户(?我知道LDAP集成提供了通过过滤器配置(LDAP文档(将组映射到超级用户和数据探查器的能力。但我对通过 RBAC 提供的更精细的控制感兴趣。

我已经能够将我的Active Directory连接到Airflow。但是,当我尝试添加 RBAC 时,我无法登录。RBAC 配置似乎覆盖了 LDAP 配置。有人能够做到这一点吗?

您需要在气流根文件夹中添加webserver_config.py,您应该在其中设置:

# Uncomment this line
flask_appbuilder.security.manager import AUTH_LDAP
....
AUTH_TYPE = AUTH_LDAP
AUTH_LDAP_SERVER = "ldap://localhost:389"
AUTH_LDAP_SEARCH=ou=users,dc=example,dc=org
AUTH_LDAP_BIND_USER=cn=user,ou=app,dc=example,dc=org
AUTH_LDAP_BIND_PASSWORD=pwd

在这里 https://airflow.apache.org/docs/stable/_modules/airflow/configuration.html 您可以看到启用RBAC后,Web服务器设置被覆盖

WEBSERVER_CONFIG = AIRFLOW_HOME + '/webserver_config.py'
if conf.getboolean('webserver', 'rbac'):
if not os.path.isfile(WEBSERVER_CONFIG):
log.info('Creating new FAB webserver config file in: %s', WEBSERVER_CONFIG)
DEFAULT_WEBSERVER_CONFIG, _ = _read_default_config_file('default_webserver_config.py')
with open(WEBSERVER_CONFIG, 'w') as file:
file.write(DEFAULT_WEBSERVER_CONFIG)

最新更新