Hide sensitive data in UI
See original GitHub issueDescription
I’m using Airflow for 2 years now and I have a plugin that get password for a specific account in a Vault and then push it through a XCOM to reuse it on another tasks.
The fact is that if the value is sensitive like a password, I can’t hide it in the UI except for XCOM if I add an underscore in the prefix name of the key value.
Eg: kwargs[‘ti’].xcom_push(‘key’:‘_password’, ‘value’:‘my_value’)
But for rendered template UI page, I didn’t find anything similar, so if I try to pull a XCOM, it will show the value in the UI and I want to avoid it.
Maybe is it possible to add a condition in https://github.com/apache/airflow/blob/master/airflow/www/views.py after line 635
elif template_field.startswith('_'):
html_dict[template_field] = ("<pre><code>sensitive data will not be exposed here</pre></code>")
Use case / motivation
I know that I can use connections but in my case, and due to security politic in my company, we have to store it in a dedicated Vault.
Related Issues
N/A
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:24 (18 by maintainers)
Top GitHub Comments
I have a similar use case, but passing the password from a connection object I created in the UI to the environment variable in the KubernetesPodOperator and it is appearing in plain text in the Rendered Template part of the UI for the task. There should be a way to avoid this being printed and visible.
aah I see, apologies @n4rk0o I should have read your description more carefully. Yes the Rendered UI Field currently exposes everything. We should have a way of hiding this.
I see two options here:
airflow.cfg
to hide renderedtemplated_fields
globally. Sometime though users would love to check if the field was rendered correctly and hence it acts as a good debugging tool.