I am using the teradatasql 17.20.0.32 Python package to connect to Teradata via Python.
The documentation shows a lot of connection parameters and with my limited knowledge of security concepts I am not sure if how I am using the Python package is a secure way.
From my perspective a secure way to connect to the daatabase is if we are using a secure protocol like https or tls or if the data is encrypted. (Feel free to add your viewpoint on this)
My code looks like this:
conn = teradatasql.connect(host=host, user=user_name, password=password)
cursor = conn.cursor()
cursor.autocommit = True
try:
[... execute some queries here..]
finally:
cursor.close()
conn.close()
I have read about the encryptdata parameter that can be given to the to the connect function:
conn = teradatasql.connect(host=host, user=user_name, password=password, encryptdata=True)
But I am not sure if this really does the trick.
So in short I have two questions:
- What is considered a secure connection
- How can I establish such a secure connection while using password and username authentication.
I would just replace
orwithandin your question stringsecure protocol like https or tls or if the data is encryptedBoth the login and the data transmission should be encrypted at transit.
Unencrypted client connection call with leave the password vulnerable to sniffing kind of attacks.
If only login is encrypted, it leaves the data call venerable to sniffing or man in the middle type of attacks
I have not used the python driver but in the documentation they do state
Short answer is setting the
encryptdata=Trueparameter should be enough, because as per the Java DocumentationThough I would highly recommend Trust but Verify and use a packet sniffer like Wireshark to test the communication. For it there is a similar thread on SO that should help