abhilash1in opened a new issue #10855:
URL: https://github.com/apache/airflow/issues/10855


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the 
following questions.
   Don't worry if they're not all applicable; just try to include what you can 
:-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   This questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**: 1.10.12
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl 
version`): N/A
   
   **Environment**: 
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release): `Ubuntu 18.04.4 LTS`
   - **Kernel** (e.g. `uname -a`): `Linux upcairflow01 4.15.0-115-generic 
#116-Ubuntu SMP Wed Aug 26 14:04:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux`
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   I have some credentials stored on Airflow which I'm passing to a 
PythonOperator via `op_kwargs` as follows:
   ```
   from airflow.hooks.base_hook import BaseHook
   from airflow.operators.python_operator import PythonOperator
   from sample_module import sample_python_callable
   
   CONN_ID = 'sample_conn_id'
   conn = BaseHook.get_connection(CONN_ID)
   
   sample_task = PythonOperator(
       task_id='sample_task',
       python_callable=sample_python_callable,
       op_kwargs={
           'credentials': {
               'host': conn.host,
               'username': conn.login,
               'password': conn.password
           },
           'other': 'stuff'
       }
   )
   ```
   The actual plaintext credentials are exposed in the `Rendered Template` tab 
of the task instance details page.
   ![Screen Shot 2020-09-09 at 11 23 27 
PM](https://user-images.githubusercontent.com/9111980/92689210-7b6df580-f2f3-11ea-9993-29d67df16b74.png)
   
   **What you expected to happen**:
   
   Expected all credentials/passwords stored as Airflow Connections to be 
**masked** in the UI.
   
   There should be a way for Airflow to identify credentials/passwords and mask 
them everywhere (UI and logs) automatically. 
   
   **How to reproduce it**:
   Create a task using `PythonOperator` similar to the example above and pass 
some credentials stored as Airflow Connections. They are visible in plaintext 
on the UI.
   
   
   **Anything else we need to know**:
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to