Skip to content
Snippets Groups Projects
Commit edc2f92a authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

fix security issues

parent c926f8a4
Branches
Tags
1 merge request!143Investigate Security Issues
Pipeline #68246 passed
...@@ -117,7 +117,9 @@ func DialContext(ctx context.Context, cfg *Config) (pb.GNMIClient, error) { ...@@ -117,7 +117,9 @@ func DialContext(ctx context.Context, cfg *Config) (pb.GNMIClient, error) {
} }
if cfg.TLS || cfg.CAFile != "" || cfg.CertFile != "" || cfg.Token != "" { if cfg.TLS || cfg.CAFile != "" || cfg.CertFile != "" || cfg.Token != "" {
tlsConfig := &tls.Config{} tlsConfig := &tls.Config{
MinVersion: tls.VersionTLS12,
}
if cfg.CAFile != "" { if cfg.CAFile != "" {
b, err := ioutil.ReadFile(cfg.CAFile) b, err := ioutil.ReadFile(cfg.CAFile)
if err != nil { if err != nil {
......
...@@ -17,7 +17,7 @@ func Write(message proto.Message, filename string) error { ...@@ -17,7 +17,7 @@ func Write(message proto.Message, filename string) error {
return fmt.Errorf("cannot marshal proto message to binary: %w", err) return fmt.Errorf("cannot marshal proto message to binary: %w", err)
} }
err = ioutil.WriteFile(filename, data, 0644) err = ioutil.WriteFile(filename, data, 0600)
if err != nil { if err != nil {
return fmt.Errorf("cannot write binary data to file: %w", err) return fmt.Errorf("cannot write binary data to file: %w", err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment