-
-
Notifications
You must be signed in to change notification settings - Fork 334
Open
Description
The -encrypt option introduced in #295 allows the config file to be encrypted via the BEEHIVE_CONFIG_PASSWORD environment variable:
Lines 225 to 239 in 57a4fab
| func getPassword(u *url.URL) (string, error) { | |
| p := os.Getenv(PasswordEnvVar) | |
| if p != "" { | |
| return p, nil | |
| } | |
| if u != nil && u.User != nil { | |
| p = u.User.Username() | |
| if p != "" { | |
| return p, nil | |
| } | |
| } | |
| return "", errors.New("password to encrypt or decrypt the config file not available") | |
| } |
In general, using an environment variable for a password is more secure than using a command line argument, with one caveat:
You need to unset the variable after reading it. Otherwise it will leak into any process that beehive spawns directly or indirectly and any library that is used by the bees, which is a security risk.
Metadata
Metadata
Assignees
Labels
No labels