security: hardening по результатам аудита безопасности

This commit is contained in:
2026-08-08 22:48:16 +03:00
parent 8c8631ac9c
commit bf2bceb520
18 changed files with 400 additions and 20 deletions
+6
View File
@@ -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