herlambang commented on issue #30089:
URL: https://github.com/apache/airflow/issues/30089#issuecomment-1550550751

   > Problem still not fully fixed - bash_command attribute in bash operator is 
not masked secrets as expected already put comment in another issue <img 
alt="image" width="415" 
src="https://user-images.githubusercontent.com/60968600/238767723-eda9326b-9b39-4926-aeb5-46017627e125.png";>
   
   Are you using something like this?
   
   ```python
   bash_command=f'export MY_VAR={ Variable.get("THE_SECRET_VALUE") }'
   ```
   
   I confirm this is still exposing unmasked sensitive value on that way, 
however it's better to use template variable
   
   ```python
   bash_command='export MY_VAR={{ var.value.THE_SECRET_VALUE }}'
   ```
   
   or even better
   ```python
   BashOperator(
       bash_command='echo $MY_VAR',
       env={'MY_VAR': '{{ var.value.THE_SECRET_VALUE }}'
   )
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to