private keys still showing up in log despite indicating sensitive_var_conn_names and custom masking doesn't support wildcards #32884
Unanswered
dasphillipbrau
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You misunderstood it. You should use "mask_secret(SECRET_VALUE)". You have to explicitly add the SECRET you want to msl as masked value. Taking your example. you should call |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm experiencing this very annoying issue where airflow is configured to mask sensitive info from key names such as
private_key
(there is both a list of names to mask and hide_sensitive_var_conn_fields is set totrue
and yet task logs are printing'private_key': 'foo'
I tried using the
mask_secret
method in the docs linked above. with the following results.If I just pass the name of the key, only the key gets masked, not the value, so
mask_secret("private_key")
only results in'***':'foo'
which of course doesn't do much if we assume foo is actually a private key.If I use
mask_secret({'private_key':'.+'})
then unfortunately nothing happens, because the implementation of the method escapes the value before converting it into a regex pattern, so instead of getting a wildcard pattern.+
I get a string that's literally\\.\\+
Is there any reason why the provided value is ALWAYS escaped? I don't see much utility in needing to explicitly pass the exact value that you want to mask instead of just giving it a key name and masking whatever its value is.
Beta Was this translation helpful? Give feedback.
All reactions