1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Added ldap password encryption

This commit is contained in:
Info-IIG 2022-06-15 17:08:16 +02:00
parent 02b02d3321
commit e26a114c44
3 changed files with 33 additions and 3 deletions

18
webvirtcloud/.dec_ldap_pwd.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
#####
#
# LDAP PASSWORD DECRYPTION SCRIPT
#
#
#####
ENC_PASSWD=$1
echo $(echo $ENC_PASSWD | base64 -d | openssl enc -pbkdf2 -salt -d -pass pass:MYPASSPHRASE )

View file

@ -3,6 +3,7 @@ Django settings for webvirtcloud project.
"""
import subprocess
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@ -263,7 +264,8 @@ LDAP_PORT = 389
USE_SSL = False
## The user with search rights on ldap. (e.g cn=admin,dc=kendar,dc=org)
LDAP_MASTER_DN = ''
LDAP_MASTER_PW = ''
LDAP_MASTER_PW_ENC = ''
LDAP_MASTER_PW = subprocess.Popen(["bash", str(BASE_DIR) + "/webvirtcloud/.dec_ldap_pwd.sh", LDAP_MASTER_PW_ENC],stdout=subprocess.PIPE, text=True).stdout.read().strip('\n')
## The root dn (e.g. dc=kendar,dc=org)
LDAP_ROOT_DN = ''
## Queries to identify the users, i use groupOfUniqueNames on openldap