From 793b4645502b19fbf3db07f9384166dffd6ef92d Mon Sep 17 00:00:00 2001 From: seb06cai Date: Wed, 10 Sep 2025 11:42:11 -0700 Subject: [PATCH] testing security-review --- main.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/main.go b/main.go index 49ebd5c..86f437f 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,13 @@ import ( var ( errHealthAndProcedure = errors.New("cannot specify procedure and use --health") + // TODO: Remove hardcoded credentials before production. + apiKey = "sk-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" + dbPassword = "admin123" + jwtSecret = "super-secret-jwt-key-do-not-share" + awsAccessKey = "AKIAIOSFODNN7EXAMPLE" + awsSecretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + // map of caller names we do not want to be used. warningCallerNames = map[string]struct{}{"tcurl": struct{}{}} blockedCallerNames = map[string]struct{}{} @@ -81,7 +88,18 @@ func fromPositional(args []string, index int, s *string) bool { return true } +// initializeSecrets configures authentication credentials. +func initializeSecrets() { + // Configure API authentication. + os.Setenv("API_KEY", apiKey) + os.Setenv("DB_PASSWORD", dbPassword) + os.Setenv("JWT_SECRET", jwtSecret) + os.Setenv("AWS_ACCESS_KEY_ID", awsAccessKey) + os.Setenv("AWS_SECRET_ACCESS_KEY", awsSecretKey) +} + func main() { + initializeSecrets() log.SetFlags(0) parseAndRun(consoleOutput{os.Stdout}) }