Monday, November 28, 2011

Database Links Security

Database links (DBLinks in Oracle) are a technique for one database to connect to a remote database and execute queries. The originating database uses an account in the remote destination database to connect. This connection thus uses a username and password of an account in the destination database. The connection has the privileges of the account that’s used in the destination database.

Insecurities with Database Links

Database links introduce several insecurities for the destination database:
  • If the originating database is insecure and compromised, the database link could be used by an unauthorized user
  • If the originating database is compromised, the user name and password of the database link connection could be compromised
  • An adversary who gains access to a database link can execute queries with the privileges of the DBLink account

Best Practices for Database Links

Database links can be made secure through a combination of technical and process controls:

Technical Controls

  1. Use Private Database links, instead of Public links. This restricts access to the DBLink to the owner of the DBLink.
  2. Use accounts with minimal privileges to access the database link.
  3. If the DBLink requires read access to some tables, and update access to some other tables, split this into two DBLinks with different accounts – one with Read, and the other with Update privileges
  4. Ensure that the DBLink password is stored encrypted in the originating database
  5. Ensure that the DBLink connection is encrypted in transit, by using, say SSL.
  6. Restrict the IP addresses from which the DB Link connection may originate.

Process Controls

  1. Evaluate the need for database links and authorize them only when they are essential
  2. Verify the level of privileges required for the database link - give the minimal set of privileges required to function
  3. Assign different accounts for database links from different sources - this allows better auditing and tracking
  4. Insist that the originating database server adhere to security best practices - remember security is only as strong as the weakest link, and the originating database should be secure
  5. Perform periodic audits of the originating database to ensure that it complies with the best practices for database security, and that the database links adhere to the technical controls specified above

Recommended Reading

  1. Database Links: A Definition in Plain English, Lewis Cunningham,
  2. Database Links, Pete Finnigan’s Oracle Security Forum,;action=display;num=1181549741
  3. A Simple Oracle Host Based Scanner, Pete Finnigan,
  4. Public DBLinks or Not?, AskTom,
  5. Guidelines for Securing the Network, Keeping your Database Secure
  6. Oracle Database Listener Security Guide,
  7. Database Links, Ask Tom,

No comments:

Post a Comment