⭐ Please star this project if you find it useful!
PyPass is a very simple 1-page web application written in Python, using Flask , Angular Material, Ldap3, and Microsoft Directory Services (Default provider).
It allows users to change their Active Directory password on their own, provided the user is not disabled.
PyPass does not require any configuration, as it obtains the principal context from the current domain. There really is no free alternative out there (that I know of) so hopefully this saves someone else some time and money.
PyPass has the following features:
- Easily localizable
- Supports reCAPTCHA
- Responsive design that works on mobiles, tablets, and desktops.
- Works with Windows/Linux servers.
-
Just clone the repo and Modify the config.json file with the correct entries.
-
After run the follow docker command:
>>>docker build -t pypass:latest .
-
Run the Docker command to run the image:
>>>docker run --dns <IP DNS or AD> --name pypaxs -d -p 80:5000 --rm pypass:latest
By default the container will be run in the port:5000 and localhost. With this command you can route the port to the 80 or any you prefer.
All server-side settings and client-side settings are stored in the src/config.json
file inside the APP folder.
The most relevant configuration entries are shown below. Make sure you make your changes to the config.json
file using a regular text editor like Visual Studio Code or sublime Text.
This is the Format of the config file:
{
"SECRET_KEY_FLASK": "werewtrwetewrwer53535353",
"SLACK_BOT_TOKEN" : "xoxb-",
"domain": "domain.com",
"BASEDN": "OU=Users,dc=domain,dc=com",
"user_admin" : "admin-user",
"passwd_admin" : "password_admin",
"slack_db" : "slack_db.json",
"Slack_Activation" : "False",
"debug": "True",
"company": "DIGITALEBRAIN",
"RECAPTCHA_PUBLIC_KEY": "GOOGLE CODE",
"RECAPTCHA_PRIVATE_KEY": "GOOGLE CODE"
}
-
To enable The Secret Key in the App: Find the
SECRET_KEY_FLASK
entry and enter your private key: To create your personal SECRET_KEY_FLASK In a command promt do the following:>>>python3 Python 3.7.2 [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import secrets >>> stk = secrets.token_hex(16) >>> print(stk)
Copy the code in the entrie.
-
Find the
SLACK_BOT_TOKEN
entry and enter your Slack Token To get your slack Token follow this steps and your Token need to start with xoxb- -
For the AD Credentials need to have admin priviligies or the user be able to change passwords.
"domain": "domain.com", "BASEDN": "OU=Users,dc=domain,dc=com", "user_admin" : "admin-user", "passwd_admin" : "password_admin",
-
To enable and use the slack notification, you need to download the slack DB in a file and put in the same folder SRC FOLDER of the config file.
- To Download the Slack DB do the follow.
- Create a Python file and put this code:
import json from slackclient import SlackClient SLACK_BOT_TOKEN = "xoxb-YOUR-TOKEN" data = json.dumps(sc.api_call("users.list"), indent=4, sort_keys=True) print(data)
Once in the command promt line export the results in a JSON file:
>>>python3 slack_file.py >> slack_db.json
The File have to be in the src folder and put the complete name of the file in the entrie
"slack_db" : "slack_db.json",
Once you have that change the"Slack_Activation" : "False"
toTrue
. -
Put the Recaptcha Codes in the entries:
"RECAPTCHA_PUBLIC_KEY": "GOOGLE CODE", "RECAPTCHA_PRIVATE_KEY": "GOOGLE CODE"
To get this codes click in this link
-
The rest of the configuration entries are all pretty much all UI strings. Change them to localize, or to brand this utility, to meet your needs.
- None Reported
- None reported
If you need to modify the source code (either backend or frontend). You require Python3 and Flask.
Note -
PyPass is open source software and MIT licensed. Please star this project if you like it.