Access the credentials and hostname in python script node

Hi,
I want to access the credentials(username & password) and the host name specified in the DB connector node in my python script node.
Is there any way to do that?
I tried using credential configuration node too but its not accessible in the python script.

Hi @SnigdhaBiswas,
This is not possible for security reasons. If an attacker had access to your workflow, they could simply add a Python Snippet node and print the credentials if they were accessible in there. You may notice that no node shows the credentials in plain text, and if you look at the settings.xml of your nodes, you can see that the credentials are encrypted. Making credentials accessible in Python would compromise these security measures, which is why this is not possible.
Kind regards,
Alexander

5 Likes

Hi @AlexanderFillbrunn ,
Thank you for the information. I came across a reference to passing data to Python in an encrypted format on the KNIME forum. It seems like this feature was planned. I’m curious if there have been any updates regarding its implementation.

Hi,
I will follow up internally, as I do not think this is feasible. Even if the variables are encrypted, if you want to make use of them in Python, it must be possible to decrypt them there, which makes it unsafe again.
Kind regards,
Alexander

1 Like

Hi,
I got confirmation from our Python developers that this is not something we are going to support in the near future, for the reasons I outlined above.
Kind regards,
Alexander

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.