如何在Airflow中设置LDAP(RBAC)? [英] How to setup LDAP (RBAC) in Airflow?
问题描述
我当前遇到的问题是LDAP设置似乎不适用于Airflow.我当前的代码不会产生登录屏幕,docker容器中也没有日志,表明它正在尝试连接到LDAP服务器.我试图按照这些教程进行操作,但它们似乎无能为力(即未使用 webserver_config.py
)教程二
The current issues I am having is that LDAP settings do not seem to work with Airflow. My current code does not produce a login screen nor are there logs in the docker container that shows it is attempting to connect to the LDAP server. I have attempted to follow these tutorials but they appear to do nothing (i.e. the webserver_config.py
is not being used) TutorialOne TutorialTwo
任何有关连接如何工作的信息将不胜感激!
Any information regarding how the connection works would be greatly appreciated!
webserver_config.py
:
import os
from airflow import configuration as conf
from flask_appbuilder.security.manager import AUTH_LDAP
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')
CSRF_ENABLED = True
AUTH_TYPE = AUTH_LDAP
AUTH_ROLE_ADMIN = 'Admin'
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Admin"
#AUTH_USER_REGISTRATION_ROLE = "Viewer"
AUTH_LDAP_SERVER = 'ldapserveraddressherebutIwon'tshowyousorry'
AUTH_LDAP_SEARCH = "DC=ms,DC=ds,DC=uhc,DC=com"
AUTH_LDAP_BIND_USER = 'CN=Users,DC=ms,DC=ds,DC=uhc,DC=com'
AUTH_LDAP_BIND_PASSWORD ="*******************"
AUTH_LDAP_UID_FIELD = 'sAMAccountName'
AUTH_LDAP_USE_TLS = False
AUTH_LDAP_ALLOW_SELF_SIGNED = False
# Get relative path for CA certificate file
script_dir = os.path.dirname(__file__)
AUTH_LDAP_TLS_CACERTFILE = script_dir + "ca.cer"
我已经从 airflow.cfg
中删除了 authenticate = True
和 auth_backend = airflow.contrib.auth.backends.ldap_auth
和我的 webserver_config.py
在同一文件夹中供使用.
I have deleted the authenticate = True
and auth_backend = airflow.contrib.auth.backends.ldap_auth
from airflow.cfg
and my webserver_config.py
is in the same folder for use.
推荐答案
这可以通过 airflow.cfg
实现.
请阅读下面的LDAP部分,并告诉我.
Please read the LDAP section below and let me know.
https://airflow.apache.org/docs/stable/security.html
这篇关于如何在Airflow中设置LDAP(RBAC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!