Skip to content

Commit

Permalink
Adjust default kubeconfig file permissions (k3s-io#7978)
Browse files Browse the repository at this point in the history
* Adjust default kubeconfig permissions

Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Jul 14, 2023
1 parent 0b18a65 commit be44243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/daemons/control/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func KubeConfig(dest, url, caCert, clientCert, clientKey string) error {
ClientKey: clientKey,
}

output, err := os.Create(dest)
// cis-1.24 and newer require kubeconfigs to be 0600
output, err := os.OpenFile(dest, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
Expand Down

0 comments on commit be44243

Please sign in to comment.