Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9505

Fact yaml should quote mac addresses.

    XMLWordPrintable

    Details

    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Night's Watch
    • Story Points:
      1
    • Sprint:
      ghost-16.09, ghost-23.09, ghost-30.09, ghost-7.10, ghost-14.10
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Previously when puppet facts were called with `--render-as yaml` option, `macaddress` fact was unquoted which can result in some bad data if other tools will parse the resulted yaml and will interpret the value as a sexagesimal (base 60) integer if the address address doesn't contain any chars A-F.

      The fix consists in quoting all yaml strings that contain the `:` character (macaddress, ipv6 ip addresses and date/time facts)
      Show
      Previously when puppet facts were called with `--render-as yaml` option, `macaddress` fact was unquoted which can result in some bad data if other tools will parse the resulted yaml and will interpret the value as a sexagesimal (base 60) integer if the address address doesn't contain any chars A-F. The fix consists in quoting all yaml strings that contain the `:` character (macaddress, ipv6 ip addresses and date/time facts)
    • QA Risk Assessment:
      Needs Assessment

      Description

      In puppet 6 (and not in 5), `puppet facts --render-as yaml` outputs mac addresses unquoted.
      If your mac address doesn't contain any chars A-F this is a problem as other tools parsing this yaml will interpret the value as a sexagesimal (base 60) integer.
      https://yaml.org/type/int.html

      Cached fact data in /opt/puppetlabs/server/data/puppetserver/yaml/facts is also broken.
      One tool affected by this problem is the enc script that ships with Foreman. It loads data from /opt/puppetlabs/server/data/puppetserver/yaml/facts/some_node.yaml and uploads the facts to foreman as json. Foreman understandably doesn't like the mac address it receives in the payload.

        Attachments

          Activity

            People

            Assignee:
            oana.tanasoiu Oana Tanasoiu
            Reporter:
            alexjfisher Alexander Fisher
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support