Fix permission of SSH host keys#1971
Conversation
private keys should have 0600: https://www.tenable.com/audits/items/CIS_Google_Container_Optimized_OS_v1.0.0_L1_Server.audit:6225b8224fbd4f360ebdc72c56f3eae9 public keys should have 0644: https://www.tenable.com/audits/items/CIS_Google_Container_Optimized_OS_v1.0.0_L1_Server.audit:7f016cd406100a1ee2ad94834111f005
|
I not really get the issue in the test. Anyone an idea what the issue is? Cannot see something checks the permission. |
igalic
left a comment
There was a problem hiding this comment.
thank you for this PR!
you'll need to sign the CLA, as per the Contribution guidelines
Ok. Need to do that tomorrow. The contribution link inside the readme.md is a deadlink. |
I merged a commit that broke this link recently. It should point to https://cloudinit.readthedocs.io/en/latest/development/contributing.html. |
|
@igalic I cannot as I have not contact: |
|
from https://cloudinit.readthedocs.io/en/latest/index.html
|
|
Thanks @igalic |
change to octal and use 420 for public - 384 => 0o600 - 420 => 0o644 - 384 => 0o600
|
you also need to add your name to this file tools/.lp-to-git-user |
|
I checked a bit in the network and find that the cert.pub should also has 644: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-creating_ssh_ca_certificate_signing-keys#doc-wrapper Therefore I changed this also to 644. |
aciba90
left a comment
There was a problem hiding this comment.
Marked as request changes until the ssh_keys block is reverted.


private keys should have 0600: https://www.tenable.com/audits/items/CIS_Google_Container_Optimized_OS_v1.0.0_L1_Server.audit:6225b8224fbd4f360ebdc72c56f3eae9
public keys should have 0644: https://www.tenable.com/audits/items/CIS_Google_Container_Optimized_OS_v1.0.0_L1_Server.audit:7f016cd406100a1ee2ad94834111f005
Proposed Commit Message
Additional Context
During the execution of Terraform the keys permission were not set correctly.
The application could not generate the public fingerprint as it could not read the public host key.
After changing the private key to 0600 and the public to 0644 everything works as expected.
Test Steps
Install a tool like GitLab via Omnibus that require to generate the public host key fingerprint.
Open this page after setup: https://gitlab.example.com/help/configuration .
Which the correct permission the page should be open. With the wrong permission the page should throw a 500 HTTP Code.
Checklist: