Skip to content

Commit

Permalink
Set 600 file permissons to mounted SSH keys (#14791)
Browse files Browse the repository at this point in the history
In order to avoid UNPROTECTED PRIVATE KEY FILE Error while ssh operations, set 600 file permissions level to all mounted SSH keys.
  • Loading branch information
vinokurig authored Oct 9, 2019
1 parent 9370bbb commit fa762ff
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ private void mountSshKeySecret(String secretName, String sshKeyName, PodSpec pod
.add(
new VolumeBuilder()
.withName(secretName)
.withSecret(new SecretVolumeSourceBuilder().withSecretName(secretName).build())
.withSecret(
new SecretVolumeSourceBuilder()
.withSecretName(secretName)
.withDefaultMode(0600)
.build())
.build());
List<Container> containers = podSpec.getContainers();
containers.forEach(
Expand Down

0 comments on commit fa762ff

Please sign in to comment.