Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1833

SSH host key without comment adds trailing newline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 3.6.9, FACT 3.10.0
    • Fix Version/s: FACT 3.11.12, FACT 3.14.9
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Night's Watch
    • Story Points:
      2
    • Sprint:
      NW - 2020-03-04
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      35920
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      correctly displays ssh host key fact in the case the host key file does no contain a comment
    • QA Risk Assessment:
      Needs Assessment

      Description

      If the SSH host public key file does not contain a comment, the public key will contain a trailing newline.

      For example:

      $ echo 'ssh-rsa public-key' >/etc/ssh/ssh_host_rsa_key.pub
      $ facter ssh
      {
        rsa => {
          key => "public-key
      "
        }
      }

      If the key contains a comment, we do not get the trailing newline:

      $ echo 'ssh-rsa public-key comment' >/etc/ssh/ssh_host_rsa_key.pub
      $ facter ssh
      {
        rsa => {
          key => "public-key"
        }
      }

      The trailing newline causes issues when using the resulting fact directly in a sshkey resource, where the trailing newline makes Puppet think the resource is changed on every run.

        Attachments

          Activity

            People

            Assignee:
            ciprian.badescu Ciprian Badescu
            Reporter:
            olavmo Olav Morken
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support