security - Db2: How to grant privileges only to app, not a user? -


i have cloud app needs access db2 database. requires both read , write access tables. how can restrict access specific app , usage pattern? don't want userid have database access outside context.

db2 has security feature of trusted contexts. trusted context describes attributes of database connection. consists of userid , can include application's ip address or hostname , required level of connection security, e.g., whether ssl mandatory.

  1. within cloud app use userid (authorization id) not have db2 privileges. revoke them if exist.
  2. create new database role. grant connect privilege , required table privileges role.
  3. create trusted context userid 1). provide app's hostname and, if want enforce ssl, set encryption attribute value of high. assign role 2) default role.

the userid can access data if connected in way defined in trusted context object. see example on trusted contexts sql code snippets , more links.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -