New Secret Masking Feature - 2.22

Yes… I really haven’t got a clue which of the multiple instances of 60 in my stack of playbooks and roles is triggering secret redaction.

OK, I’ve sussed out one. /bin/bash is being treated as a secret because it’s one attribute of a map which is stored in a file managed by ansible-vault. This seems reasonable on the surface, but the value is only in that file because it’s not possible to have portions of a map vaulted while other portions are not vaulted (at least not easily), and storing the vaulted and non-vaulted portions of the map in separate places to combine together would be extra work. I’ll probably do that, so that my vault files don’t contain anything which is not actually a secret.

That’s similar to some fun I had when looking into automatically registering decrypted values as secrets in community.sops. In the end I decided to not automatically register decrypted values as secrets, but allow users to request community.sops to do that if they want.

You might also be interested in this discussion: How to register secrets - as plugin developers, and users?

If I may blow my own horn a bit, utoddl/av-filter makes that a lot easier, at least if you’re using an editor which allows you to select some lines and pass them through a filter. At least vi and ne will do this, and I’m sure other editors will, too.

It’s dead simple to use if you set some environment variables up front. Select a subset of the names and values in your yaml, pass them through av-filter, and it vaults your unvaulted values and unvaults your vaulted values.

This has made it practical for me to quit using opaque *.vault files.

2 Likes

I’m an Emacs user so I’ll make the obligatory comment that this should be written in Emacs Lisp so it can be executed directly in the editor :slight_smile:

3 Likes

Wanted to chime in and give some assurance that the current aggression of the secret masker is actively being discussed/worked on. There are a few related issues on the subject for anyone who would like to follow up/see it on github:

2 Likes

I’ve seen similar approach somewhere recently!

https://sshhole.com/

4 Likes