mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
Bug 6479: Storing proxy certificate in a secure location to avoid unexpected deletion. (#7811)
This prevents proxy certificate used by --insecure mode from being deleted when stored in a user-writable location.
This commit is contained in:
parent
897b750b55
commit
d5a37dfd1a
2 changed files with 9 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
|||
* Orbit lost communication with Fleet server
|
||||
when the certificate used for insecure mode gets deleted.
|
||||
|
|
@ -395,7 +395,13 @@ func main() {
|
|||
},
|
||||
)
|
||||
|
||||
certPath := filepath.Join(os.TempDir(), "fleet.crt")
|
||||
// Directory to store proxy related assets
|
||||
proxyDirectory := filepath.Join(c.String("root-dir"), "proxy")
|
||||
if err := secure.MkdirAll(proxyDirectory, constant.DefaultDirMode); err != nil {
|
||||
return fmt.Errorf("there was a problem creating the proxy directory: %w", err)
|
||||
}
|
||||
|
||||
certPath := filepath.Join(proxyDirectory, "fleet.crt")
|
||||
|
||||
// Write cert that proxy uses
|
||||
err = ioutil.WriteFile(certPath, []byte(insecure.ServerCert), os.ModePerm)
|
||||
|
|
|
|||
Loading…
Reference in a new issue