Hi Christoph!

On Fri, 26 Apr 2019 10:49:20 +0200 Christoph Biedl <[email protected]> wrote:
Source: ansible
Version: 2.7.7+dfsg-1
Severity: normal
Tags: upstream

Dear Maintainer,

like probably every other module, data processed by ansible's "debconf"
module to manipulate the debconf database is logged to syslog unless
explicitly told otherwise (no_log). This becomes a problem when setting
a value of vtype "passwort" like in

  ansible -i root@<host>, root@<host> \
    -m debconf -a 'name=foo  question=foo/bar value=topsecret vtype=password'

Then the target host's syslog contains a like

| ansible-debconf: Invoked with unseen=None vtype=password question=foo/bar 
name=foo value=topsecret
                                                                                
           ^^^^^^^^^

For a fix: Probably there is a way to mark value as "no_log" only if
vtype has the "password" value. I failed to get this done, I did not
try very hard, though.

There is a new register_secret() function in ansible v2.22, building on top of the v2.19 data tagging feature, that allows obfuscating secrets when they're displayed. Ironically, this hasn't been wired into the syslog logger yet.

The debconf module hasn't been updated yet to use register_secret(), so I'll propose a patch that'll obfuscate values when vtype=password is set.

Regarding the actual issue, upstream has closed the bug and handled it as a documentation issue (meaning, you should set `no_log: true` on the task). An alternative solution would be using the register_secret filter, e.g. `value: "{{ 'my_password' | register_secret }}"` and setting `no_target_syslog = True` in your ansible.cfg.


    Christoph

Best regards,
Lee

Reply via email to