Skip to content

Commit

Permalink
initializer: remove write permission from cert files
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Aug 12, 2024
1 parent 4f0d759 commit e7cb052
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions initializer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ func run() (retErr error) {
}

// write files to disk
err = os.WriteFile("/contrast/tls-config/mesh-ca.pem", resp.MeshCACert, 0o644)
err = os.WriteFile("/contrast/tls-config/mesh-ca.pem", resp.MeshCACert, 0o400)
if err != nil {
return fmt.Errorf("writing mesh-ca.pem: %w", err)
}
err = os.WriteFile("/contrast/tls-config/certChain.pem", resp.CertChain, 0o644)
err = os.WriteFile("/contrast/tls-config/certChain.pem", resp.CertChain, 0o400)
if err != nil {
return fmt.Errorf("writing certChain.pem: %w", err)
}
err = os.WriteFile("/contrast/tls-config/key.pem", pemEncodedPrivKey, 0o600)
err = os.WriteFile("/contrast/tls-config/key.pem", pemEncodedPrivKey, 0o400)
if err != nil {
return fmt.Errorf("writing key.pem: %w", err)
}
err = os.WriteFile("/contrast/tls-config/coordinator-root-ca.pem", resp.RootCACert, 0o644)
err = os.WriteFile("/contrast/tls-config/coordinator-root-ca.pem", resp.RootCACert, 0o400)
if err != nil {
return fmt.Errorf("writing coordinator-root-ca.pem: %w", err)
}
Expand Down

0 comments on commit e7cb052

Please sign in to comment.