Steven
Steven

Reputation: 15273

connect to Oracle with cx_Oracle with secured password

Currently, I am connecting to Oracle using a string like this:

OracleURL = "{USER}/{PWD}@{SERVER}:{PORT}/{SERVICE}".format(USER=O_USER,
                                                            PWD=O_PWD,
                                                            SERVER=O_SERVER,
                                                            PORT=O_PORT,
                                                            SERVICE=O_SERVICE
                                                           )

try:
    con = cx_Oracle.connect(OracleURL)
except Exception as MSG:
    exit(33)

The problem is, from a security point of view, I do not know how to securely store my password. As test version, I put the password in a parameter file, encoded in 64bit (which is incredibly low security level). Do you have any good method to store and use the password efficiently ?

Upvotes: 1

Views: 3041

Answers (1)

Christopher Jones
Christopher Jones

Reputation: 10586

I've seen users pass the password in environment variables.

But you might want to look at using an Oracle "Secure External Password Store". In summary, you make a 'wallet', add some credentials to it, set up Oracle sqlnet.ora and tnsname.ora files so the wallet is used and then connect to the db service - the SQL*Plus syntax would be sqlplus -l /@db_connect_string. This is described in the Oracle documentation.

Upvotes: 1

Related Questions