-
Notifications
You must be signed in to change notification settings - Fork 0
Password Policy Analyzer
This tool will:
- Evaluate password strength
- Compare an organization’s password policy against standards
- Generate findings + remediation guidance
- Produce a security report
Open Terminal
Run:
mkdir password-policy-analyzer
cd password-policy-analyzer
To verify, run:
pwd
Open Terminal, Folder created, Current directory shown
Install venv:
sudo apt update
sudo apt install python3-venv -y
Create environment:
python3 -m venv venv
Activate:
source venv/bin/activate
Install packages:
pip install pandas tabulate zxcvbn
Verify, run:
pip list
The List of Expected packages: pandas tabulate zxcvbn
Run:
touch analyzer.py
touch password_policy.json
touch report.txt
Open VS Code:
code .
The Folder should look like:
password-policy-analyzer │ ├── analyzer.py ├── password_policy.json ├── report.txt └── venv
Open:
password_policy.json
Type:
{ "minimum_length": 8, "require_uppercase": true, "require_numbers": true, "require_symbols": true, "expiration_days": 90, "allow_common_passwords": false }
Save
Open: analyzer.py Type:
import json
from zxcvbn import zxcvbn
from tabulate import tabulate
with open("password_policy.json") as f:
policy = json.load(f)
audit=[]
if policy["minimum_length"] < 12:
audit.append(
["Minimum Length",
"FAIL",
"Use 12+ characters"]
)
else:
audit.append(
["Minimum Length",
"PASS",
"Good"]
)
if policy["expiration_days"] <= 90:
audit.append(
[
"Rotation",
"WARN",
"Avoid forced resets"
]
)
sample="Summer2026!"
score=zxcvbn(sample)
audit.append([
"Password Strength",
score["score"],
score["feedback"]["warning"]
])
print(tabulate(
audit,
headers=[
"Category",
"Status",
"Recommendation"
]
))