Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19907

Secret macro value overwritten on import when value is absent

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.4.4
    • Frontend (F), Templates (T)
    • None

      When importing a template like this:

      zabbix_export:
        version: '5.4'
        date: '2021-09-02T06:34:30Z'
        groups:
          -
            uuid: 9becbe655a1448489e2539ed9f60686e
            name: Templates
        templates:
          -
            uuid: 0990793d930d46aa905fbba7ce3d0be7
            template: 'TemplateWithSecretMacro'
            name: 'TemplateWithSecretMacro'
            groups:
              -
                name: Templates
            macros:
              -
                macro: '{$SECRET}'
                type: SECRET_TEXT
      

      The {$SECRET} macro is overwritten (made blank), even though no value is provided (the key is absent). This makes it more difficult to manage templates as code, as we need to make sure the secret is provided in template when exporting it, while making sure the secret does not end up in the repository.

      Would it be possible to note overwrite the macro value when the 'value' key is absent in the macro?

            zabbix.dev Zabbix Development Team
            kdaudt Kevin Daudt
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: