Skip to content

Commit faade1a

Browse files
ashraffoudaclaude
andcommitted
security(qsfs): read owner mnemonic from MNEMONIC env, not a hard-coded const
The qsfs dev script embedded a real sr25519 mnemonic as a package const. Replace it with `os.Getenv("MNEMONIC")` and fail fast if unset, so no key ships in the source tree. Rotate the previously-committed key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 48be89a commit faade1a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎scripts/qsfs/main.go‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ const (
4747
QSFSCacheSize = 1 // GB
4848

4949
SSHKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTwULSsUubOq3VPWL6cdrDvexDmjfznGydFPyaNcn7gAL9lRxwFbCDPMj7MbhNSpxxHV2+/iJPQOTVJu4oc1N7bPP3gBCnF51rPrhTpGCt5pBbTzeyNweanhedkKDsCO2mIEh/92Od5Hg512dX4j7Zw6ipRWYSaepapfyoRnNSriW/s3DH/uewezVtL5EuypMdfNngV/u2KZYWoeiwhrY/yEUykQVUwDysW/xUJNP5o+KSTAvNSJatr3FbuCFuCjBSvageOLHePTeUwu6qjqe+Xs4piF1ByO/6cOJ8bt5Vcx0bAtI8/MPApplUU/JWevsPNApvnA/ntffI+u8DCwgP ashraf@thinkpad"
50-
51-
Mnemonic = "junior sock chunk accident pilot under ask green endless remove coast wood"
5250
)
5351

52+
// Mnemonic is the owner twin mnemonic — read from the MNEMONIC env var, never hard-coded.
53+
var Mnemonic = os.Getenv("MNEMONIC")
54+
5455
// generateWGPrivateKey generates a WireGuard (Curve25519) private key
5556
func generateWGPrivateKey() string {
5657
var key [32]byte
@@ -343,6 +344,10 @@ func main() {
343344
enc := json.NewEncoder(os.Stdout)
344345
enc.SetIndent("", " ")
345346

347+
if Mnemonic == "" {
348+
panic("set the MNEMONIC env var (owner twin mnemonic)")
349+
}
350+
346351
identity, err := substrate.NewIdentityFromSr25519Phrase(Mnemonic)
347352
if err != nil {
348353
panic(err)

0 commit comments

Comments
 (0)