fix: remove hardcoded passwords and enhance security in production setup
Security Enhancements: - Update .gitignore header timestamp to 2026-03-18 for security fixes - Add CRITICAL SECURITY markers to sensitive sections in .gitignore - Add comprehensive password file patterns (*.password, *.pass, .password.*) - Add private key file patterns (*_private_key.txt, *.private, private_key.*) - Add guardian contract database patterns (*.guardian.db, guardian_contracts/) - Add multi-chain wallet data patterns (.
This commit is contained in:
@@ -40,9 +40,19 @@ def main():
|
||||
# 1. Keystore directory and password
|
||||
run(f"mkdir -p {KEYS_DIR}")
|
||||
run(f"chown -R aitbc:aitbc {KEYS_DIR}")
|
||||
|
||||
# SECURITY FIX: Use environment variable instead of hardcoded password
|
||||
if not PASSWORD_FILE.exists():
|
||||
run(f"openssl rand -hex 32 > {PASSWORD_FILE}")
|
||||
run(f"chmod 600 {PASSWORD_FILE}")
|
||||
password = os.environ.get("AITBC_KEYSTORE_PASSWORD")
|
||||
if not password:
|
||||
# Generate secure random password if not provided
|
||||
run(f"openssl rand -hex 32 > {PASSWORD_FILE}")
|
||||
run(f"chmod 600 {PASSWORD_FILE}")
|
||||
else:
|
||||
# Use provided password from environment
|
||||
PASSWORD_FILE.write_text(password)
|
||||
run(f"chmod 600 {PASSWORD_FILE}")
|
||||
|
||||
os.environ["KEYSTORE_PASSWORD"] = PASSWORD_FILE.read_text().strip()
|
||||
|
||||
# 2. Generate keystores
|
||||
|
||||
Reference in New Issue
Block a user