security: hardening по результатам аудита безопасности
This commit is contained in:
@@ -108,6 +108,12 @@ func newKeygenCmdWithDeps(reg crypto.Registry) *cobra.Command {
|
||||
if err := privFile.Close(); err != nil {
|
||||
return fmt.Errorf("close private key file %s: %w", privPath, err)
|
||||
}
|
||||
if err := os.Chmod(pubPath, 0o644); err != nil {
|
||||
return fmt.Errorf("chmod public key file %s: %w", pubPath, err)
|
||||
}
|
||||
if err := os.Chmod(privPath, 0o600); err != nil {
|
||||
return fmt.Errorf("chmod private key file %s: %w", privPath, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user