Pulse/scripts/change-password.sh
Pulse Monitor 958cacf042 feat: enhance security and improve login UI
Security Improvements:
- Implement bcrypt password hashing (cost factor 12)
- Add SHA3-256 API token hashing
- Fix authentication enforcement after security setup
- Improve restart mechanism to properly reload systemd environment
- Add CSRF protection for all state-changing operations
- Implement comprehensive rate limiting (10/min auth, 500/min API)
- Remove sensitive data from logs
- Add security audit test suite

UI Enhancements:
- Add Pulse logo to login screen with animations
- Implement glassmorphism design for login form
- Add gradient backgrounds and smooth animations
- Enhance input fields with icons
- Add loading spinner for authentication
- Improve overall login page aesthetics

Bug Fixes:
- Fix security setup restart mechanism
- Fix systemd environment variable inheritance
- Fix CSRF validation for security endpoints
- Fix password change and removal functionality

Testing:
- Add automated security test suite
- Verify all authentication flows
- Test rate limiting effectiveness
- Validate CSRF protection
2025-08-13 23:07:57 +00:00

27 lines
No EOL
661 B
Bash
Executable file

#!/bin/bash
# Script to change password in Pulse systemd configuration
# This needs to be run with sudo
OVERRIDE_FILE="/etc/systemd/system/pulse-backend.service.d/override.conf"
NEW_PASSWORD="$1"
if [ -z "$NEW_PASSWORD" ]; then
echo "Usage: $0 <new_password_hash>"
exit 1
fi
if [ ! -f "$OVERRIDE_FILE" ]; then
echo "No override file found"
exit 1
fi
# Create a backup
cp "$OVERRIDE_FILE" "$OVERRIDE_FILE.bak"
# Replace the password line
sed -i "s|Environment=\"PULSE_AUTH_PASS=.*\"|Environment=\"PULSE_AUTH_PASS=$NEW_PASSWORD\"|" "$OVERRIDE_FILE"
# Reload systemd configuration
systemctl daemon-reload
echo "Password changed successfully"