LDAP 인증 예제

본 섹션에서는 Driverless AI에서 Lightweight Directory Access Protocol 의 활성화 방법에 관해 설명합니다. 이용 가능한 매개변수는 Driverless AI Docker 이미지 시작 시, 환경 변수로 지정하거나 Native 설치를 위해 config.toml 파일을 통한 설정이 가능합니다. 완료 시 구성된 LDAP의 모든 사용자가 Driverless AI에 로그인하여 실험 실행, 데이터 세트의 시각화 및 모델 해석을 할 수 있어야 합니다.

Note: Driverless AI는 LDAP 클라이언트 인증을 지원하지 않습니다. LDAP 클라이언트 인증 활성화 시, Driverless AI LDAP 커넥터는 작동하지 않습니다.

구성 속성에 관한 설명

LDAP 인증 활성화 시, 다음 옵션을 지정할 수 있습니다.

  • ldap_server: LDAP 서버 도메인 또는 IP.

  • ldap_port: LDAP 서버 포트.

  • ldap_bind_dn: LDAP bind 사용자의 완전한 고유 이름(DN).

  • ldap_bind_password: LDAP 바인드 비밀번호.

  • ldap_tls_file: 전송 계층 보안(TLS) 인증서 파일 위치.

  • ldap_use_ssl: SSL 활성화(TRUE) 또는 비활성화(FALSE) 여부.

  • ldap_search_base: 검색이 시작되는 디렉터리 정보 트리(DIT) 위치.

  • ldap_search_filter: 검색 중인 내용을 설명하는 문자열. 이를 동적으로 구성하려면 Python 대체를 사용할 수 있습니다({{DAI_USERNAME}}만 지원됩니다. 예, 《(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))》).

  • ldap_search_attributes: 검색으로부터 반환할 LDAP 속성.

  • ldap_user_name_attribute="uid": 사용자 이름을 찾기 위한 키를 지정합니다.

SSL이 없는 LDAP

다음 예제에서는 Docker 이미지에서 또는 Native 설치를 통해 Driverless AI 실행 시, SSL 없이 LDAP를 활성화하는 방법에 관해 설명합니다. 구성 및 인증이 성공하면 사용자는 Driverless AI에 액세스하여 실험 실행, 데이터 세트 시각화 및 모델 해석을 할 수 있습니다.

다음 예제에서는 Driverless AI Docker 이미지 시작 시, SSL없이 LDAP를 구성하는 방법에 관해 설명합니다.

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  -p 12345:12345 \
  -u `id -u`:`id -g` \
  -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,s3,hdfs" \
  -e DRIVERLESS_AI_AUTHENTICATION_METHOD="ldap" \
  -e DRIVERLESS_AI_LDAP_USE_SSL="false" \
  -e DRIVERLESS_AI_LDAP_SERVER="ldap.forumsys.com" \
  -e DRIVERLESS_AI_LDAP_PORT="389" \
  -e DRIVERLESS_AI_LDAP_SEARCH_BASE="dc=example,dc=com" \
  -e DRIVERLESS_AI_LDAP_BIND_DN="cn=read-only-admin,dc=example,dc=com" \
  -e DRIVERLESS_AI_LDAP_BIND_PASSWORD=password \
  -e DRIVERLESS_AI_LDAP_SEARCH_FILTER="(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))" \
  -e DRIVERLESS_AI_LDAP_USER_NAME_ATTRIBUTE="uid" \
  -v `pwd`/data:/data \
  -v `pwd`/log:/log \
  -v `pwd`/license:/license \
  -v `pwd`/tmp:/tmp \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

다음 예제에서는 Native 설치에서 Driverless AI 시작 시, SSL 없이 LDAP를 구성하는 방법에 관해 설명합니다. Native 설치에는 DEB, RPM 및 TAR SH 설치가 포함됩니다.

  1. Driverless AI config.toml 파일을 내보내거나 ~/.bashrc에 추가합니다. 아래 예를 참조하십시오.

# DEB and RPM
export DRIVERLESS_AI_CONFIG_FILE="/etc/dai/config.toml"

# TAR SH
export DRIVERLESS_AI_CONFIG_FILE="/path/to/your/unpacked/dai/directory/config.toml"
  1. SSL 없이 LDAP 인증을 활성화.

# Enable LDAP authentication
authentication_method = "ldap"

# Specify the LDAP server domain or IP to connect to
ldap_server = "ldap.forumsys.com"

# Specify the LDAP port to connect to
ldap_port = "389"

# Disable SSL
ldap_use_ssl="false"

# Specify the location in the DIT where the search will start
ldap_search_base = "dc=example,dc=com"

# Specify the LDAP search filter
# This is A string that describes what you are searching for. You
# can use Python substitution to have this constructed dynamically.
# (Only {{DAI_USERNAME}} is supported. For example, "(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))".)
ldap_search_filter = "(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))"

# Specify the complete DN of the LDAP bind user
ldap_bind_dn = "cn=read-only-admin,dc=example,dc=com"

# Specify the LDAP password for the above user
ldap_bind_password = "password"

# Specify a key to find the user name
ldap_user_name_attribute = "uid"
  1. Driverless AI를 시작(또는 재시작)하십시오. Driverless AI를 시작하는 데 사용되는 명령은 설치 유형에 따라 다릅니다.

# Linux RPM or DEB with systemd
sudo systemctl start dai

# Linux RPM or DEB without systemd
sudo -H -u dai /opt/h2oai/dai/run-dai.sh

# Linux TAR SH
./run-dai.sh

인증 성공 시, 사용자는 Driverless AI에 액세스하여 실험 실행, 데이터 세트 시각화 및 모델 해석을 할 수 있습니다.

SSL이 있는 LDAP

이러한 예제에서는 Driverless AI Docker 이미지 시작 시, 환경 변수로 지정될 수 있는 SSL 및 추가 매개변수를 사용하여 LDAP 인증을 활성화하는 방법에 관해 설명합니다. 또는 Native 설치를 위해 config.toml 파일을 통해 설정할 수도 있습니다. 완료 시 구성된 LDAP의 모든 사용자가 Driverless AI에 로그인하여 실험 실행, 데이터 세트의 시각화 및 모델 해석을 할 수 있어야 합니다.

Driverless AI Docker 이미지 시작 시, 다음 LDAP 환경 변수를 지정합니다. 해당 예에서는 LDAP 인증 활성화 및 SSL 활성화 추가 옵션의 지정 방법에 관해 설명합니다.

nvidia-docker run \
 --pid=host \
 --init \
 --rm \
 --shm-size=256m \
 -p 12345:12345 \
 -u `id -u`:`id -g` \
 -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,s3,hdfs" \
 -e DRIVERLESS_AI_AUTHENTICATION_METHOD="ldap" \
 -e DRIVERLESS_AI_LDAP_SERVER="ldap.forumsys.com" \
 -e DRIVERLESS_AI_LDAP_PORT="389" \
 -e DRIVERLESS_AI_LDAP_SEARCH_BASE="dc=example,dc=com" \
 -e DRIVERLESS_AI_LDAP_SEARCH_FILTER="(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))" \
 -e DRIVERLESS_AI_LDAP_USE_SSL="true" \
 -e DRIVERLESS_AI_LDAP_TLS_FILE="/tmp/abc-def-root.cer" \
 -e DRIVERLESS_AI_LDAP_LDAP_BIND_DN="cn=read-only-admin,dc=example,dc=com" \
 -e DRIVERLESS_AI_LDAP_LDAP_BIND_PASSWORD="password" \
 -e DRIVERLESS_AI_LDAP_USER_NAME_ATTRIBUTE="uid" \
 -v `pwd`/data:/data \
 -v `pwd`/log:/log \
 -v `pwd`/license:/license \
 -v `pwd`/tmp:/tmp \
 h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

Native 설치는 DEB, RPM 및 TAR SH 설치를 포함합니다.

  1. Driverless AI config.toml 파일을 내보내거나 ~/.bashrc에 추가합니다. 아래 예를 참조하십시오.

# DEB and RPM
export DRIVERLESS_AI_CONFIG_FILE="/etc/dai/config.toml"

# TAR SH
export DRIVERLESS_AI_CONFIG_FILE="/path/to/your/unpacked/dai/directory/config.toml"
  1. SSL를 사용한 LDAP 인증 활성화.

# Enable LDAP authentication
authentication_method = "ldap"

# Specify the LDAP server domain or IP to connect to
ldap_server = "ldap.forumsys.com"

# Specify the LDAP port to connect to
ldap_port = "389"

# Specify the location in the DIT where the search will start
ldap_search_base = "dc=example,dc=com"

# Specify the LDAP search filter
# This is a string that describes what you are searching for. You
# can use Python substitution to have this constructed dynamically.
# (Only {{DAI_USERNAME}} is supported.)
ldap_search_filter = "(&(objectClass=person)(cn:dn:={{DAI_USERNAME}}))"

# If the LDAP connection to the LDAP server needs an SSL certificate,
# then this needs to be specified
ldap_use_ssl = "True"

# Specify the LDAP TLS file location if SSL is set to True
ldap_tls_file = "/tmp/abc-def-root.cer"

# Complete DN of the LDAP bind user
ldap_bind_dn = "cn=read-only-admin,dc=example,dc=com"

# Specify the LDAP password for the above user
ldap_bind_password = "password"

# Specify a key to find the user name
ldap_user_name_attribute = "uid"
  1. Driverless AI를 시작(또는 다시 시작)하십시오. 이제 사용자는 LDAP 자격 증명을 사용하여 Driverless AI를 시작할 수 있습니다. Driverless AI 시작에 사용되는 명령은 설치 유형에 따라 달라집니다.

# Linux RPM or DEB with systemd
sudo systemctl start dai

# Linux RPM or DEB without systemd
sudo -H -u dai /opt/h2oai/dai/run-dai.sh

# Linux TAR SH
./run-dai.sh

인증 성공 시, 사용자는 Driverless AI에 액세스하여 실험 실행, 데이터 세트 시각화 및 모델 해석을 할 수 있습니다.