只允許 oracle db 登錄到特定的應用程序? (Allowing oracle db login only to specific application?)


問題描述

只允許 oracle db 登錄到特定的應用程序? (Allowing oracle db login only to specific application?)

We want to allow DB access (Oracle) to our users only through our own application - let's call it "ourTool.exe", installed locally on the users computers. Currently, the users must provide username/password whenever they start "ourTool". The provided password password gets decrypted and we use username/decrypted-password to finally log in to the Oracle DB. This approach prevents the users from directly accessing our DB using third party tools (SQLplus, Excel, Access, ...) and everything in the DB is guaranteed to have been entered/edited using "ourTool". 

Now, one of our clients wants to allow its users "single sign-on" (with SmartCards/Oracle PKI). With this, the user will be able connect to our DB without providing any password every time they start "ourTool". But the same will be true for the potentially dangerous tools like SQLplus, Excel, Access, etc. 

Is there a way to prevent this? How can we make sure that every record in our DB is only created/edited/deleted using "ourTool" in this scenario?


參考解法

方法 1:

By default, OCI transmits the calling application EXE name and you can access it by querying v$session:

SELECT  program
FROM    V$SESSION

, which you can do in an AFTER LOGON trigger.

But this can be easily overriden and should not be relied upon.

方法 2:

Since it's your application and you have control of the source, you can use either password protected database roles or Secure Application Roles that are enabled from ourTool.exe.  (see http://www.oracle.com/technology/obe/obe10gdb/security/approles/approles.htm ).

For example, with a password-protected database role, the initial connection would be with only the CREATE SESSION privilege, and then ourTool.exe would issue the SET ROLE with password known only to you.  Any other application doesn't  have the information to set the role.  Obviously, the privileges are granted only to the role and not directly to the user in this configuration.

方法 3:

I renamed my sqlplus.exe to myTool.exe and after making a connection with myTool.exe

SELECT  program
FROM    V$SESSION
where username = 'SYSTEM';

Returns:  myTool.exe

So be aware, as Quassnoi said: although usable in some circumstances it's certainly not bullit proof.

(by ToastedSoulQuassnoidpbradleyRob van Laarhoven)

參考文件

  1. Allowing oracle db login only to specific application? (CC BY-SA 3.0/4.0)

#login #Security #oracle #single-sign-on






相關問題

只允許 oracle db 登錄到特定的應用程序? (Allowing oracle db login only to specific application?)

使用 FB.login 的註冊流程 (Registration flow using FB.login)

asp.net c# sistem login (asp.net c# login system)

Rails 設計登錄不工作 (Rails devise sign in not working)

我在 cakephp 2.4 中遇到了登錄頁面 (I'm getting stuck with login page in cakephp 2.4)

如何刪除特定用戶的會話登錄 (How to remove session login for specific user)

有沒有標準的asp.net認證授權登錄系統? (Is there a standard asp.net authentication authorization login system?)

所有這些網絡平台如何實現不需要用戶反复登錄的長時間登錄會話? (How do all these web platforms achieve a long-time login session that does not require the user to login over and over again?)

Util-Linux 登錄不使用影子密碼 (Util-Linux Login not working with shadow password)

Android Webview Facebook 登錄 (Android Webview Facebook Login)

重置 Bookstack 憑據 (Reset Bookstack Credentials)

輸入正確的詳細信息且未顯示錯誤後,登錄頁面未重定向到 index.php (Login in page not redirecting to index.php after entering correct details with no error displayed)







留言討論