mirror of
https://github.com/Azure/k8s-set-context.git
synced 2026-07-30 08:29:27 +08:00
fix: set kubeconfig file permissions to 600 after creation (#252)
Kubeconfig created by az connectedk8s proxy inherits default permissions, leaving cluster credentials readable by other processes on the runner.
This commit is contained in:
@@ -36,6 +36,7 @@ export async function runAzKubeconfigCommandBlocking(
|
||||
proc.unref()
|
||||
|
||||
await sleep(AZ_TIMEOUT_SECONDS)
|
||||
fs.chmodSync(kubeconfigPath, 0o600)
|
||||
return fs.readFileSync(kubeconfigPath).toString()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user