是否可以在Apache Airflow中将RBAC与LDAP结合使用?

问题描述 投票:3回答:1

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

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

python ldap airflow rbac
1个回答
0
投票

您需要在气流根文件夹中添加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后,网络服务器设置被覆盖了

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)
© www.soinside.com 2019 - 2024. All rights reserved.