Skip to content

Commit 00db34e

Browse files
szachovyCopilot
andcommitted
Strengthen MySQL superset password generation
Replace random.choice with secrets.choice for CSPRNG, expand charset from lowercase-only to ascii_letters+digits+punctuation, and increase length from 12 to 24 characters. The previous password had ~56 bits of entropy; the new one has ~157 bits. Closes #89 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ab8ce7 commit 00db34e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Dependabot updates for `github-actions` and `terraform` ecosystems. (#29)
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
18+
* Strengthen MySQL superset password: secrets module, expanded charset, 24 chars. (#89)
1819

1920
### Changed
2021

src/crypto.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import base64
4949
import datetime
5050
import os
51-
import random
51+
import secrets
5252
import string
5353

5454
import cryptography
@@ -65,7 +65,8 @@ def generate_mysql_root_password() -> str:
6565

6666
@staticmethod
6767
def generate_mysql_superset_password() -> str:
68-
return "".join(random.choice(string.ascii_lowercase) for _ in range(12))
68+
charset = string.ascii_letters + string.digits + string.punctuation
69+
return "".join(secrets.choice(charset) for _ in range(24))
6970

7071
@staticmethod
7172
def generate_superset_secret_key() -> str:

0 commit comments

Comments
 (0)