Академический Документы
Профессиональный Документы
Культура Документы
DB2 Security
Information Management
Information Management
Agenda
Authentication
Trusted Context
Authorization
Authorities
Privileges
Roles
Information Management
Authentication
Authorization
Authorities
Privileges
CONNECT TO SAMPLE
USER John USING
password;
sampleTable
SAMPLE DB
Authentication
3
Authorization
2010 IBM Corporation
Information Management
Authentication
Server
Server
Client
CONNECT TO SAMPLE
CONNECT TO SAMPLE
AUTHENTICATION
= SERVER
password;
4
AUTHENTICATION
= CLIENT
password;
2010 IBM Corporation
Information Management
Information Management
Trusted Context
Information Management
Trusted Context
Implementation Considerations
Users need to be identified individually but do not want
expensive new connections
How do we identify a trusted source?
Information Management
Authorization
Privileges
Allow a certain action to be taken on a database object
(SELECT, UPDATE, DELETE, etc)
LBAC provides a more granular approach, granting
read/write access to individual rows/columns
Information Management
Information Management
Authorities
Instance-level Authorities
SYSADM, SYSCTRL, SYSMAINT, SYSMON
Eg: SYSADM - control over all resources created and
maintained by the Database Manager (instance)
Database-level Authorities
DBADM, SECADM, SQLADM, WLMADM, EXPLAIN,
ACCESSCTRL, DATAACCESS, etc
SECADM
SYSADM
LOAD
SYSCTRL
DBADM
SYSMAINT
Instance
10
IB M D B 2 9
Information Management
S y s te m A d m in is tr a to r (S Y S A D M ) a u th o r ity
H ig h e s t le v e l o f a d m in is t r a tiv e a u th o r it y a v a ila b le .
O n ly S Y S A D M is a llo w e d t o p e r f o r m t h e s e ta s k s :
- M ig r a t e a d a t a b a s e fro m a p r e v io u s v e r s io n to D B 2 V e r 9 .
- M o d if y t h e p a r a m e t e r v a lu e s o f t h e D B M C F G file
a s s o c ia te d w ith a n in s ta n c e - in c lu d in g s p e c ify in g w h ic h
g ro u p s h a v e S Y S D B A , S Y S C T R L , S Y S M A IN T , a n d
S Y S M O N a u th o r it y .
- G iv e ( g r a n t) / R e v o k e D B A D M a n d S E C A D M a u th o r ity to
in d iv id u a l u s e r s a n d /o r g r o u p s .
E x . G r a n tin g S Y S A D M a u t h o r it y t o t h e g r o u p g r p 1 :
- db2 "UPDATE DBM CFG USING SYSADM_GROUP grp1"
10
11
Information Management
12
IB M D B 2 9
Information Management
D a ta b a s e A d m in is tr a to r (D B A D M ) a u th o r ity
D B A D M is a d a t a b a s e - le v e l a u th o r it y a n d c a n b e
a s s ig n e d b y S Y S A D M to b o t h u s e r s a n d g r o u p s .
- grant dbadm on database to user user1
- grant dbadm on database to group group1
D B A D M u s e r s h a v e a lm o s t c o m p le te c o n t r o l o v e r th e
d a t a b a s e b u t c a n n o t p e r fo r m m a in te n a n c e o r
a d m in is tr a tiv e t a s k s
- d ro p d a ta b a s e
- b a c k u p /r e s to r e d a ta b a s e
-- d r o p /c r e a te ta b le s p a c e
-- u p d a te d b c fg fo r d a ta b a s e
C a n p e rfo rm :
- c r e a te /d r o p ta b le
13
13
-- g r a n t/r e v o k e (a n y p r iv ile g e )
2010 IBM Corporation
Information Management
14
Information Management
15
IB M D B 2 9
Information Management
21
16
Information Management
Privileges
Schema Privilege
CREATEIN allows the user to create objects within the schema
ALTERIN allows the user to alter objects within the schema
DROPIN allows the user to drop objects from within the schema
Tablespace Privilege
USE allows the user to create tables within the tablespace
Information Management
Privileges
Package Privilege
CONTROL provides the user with the ability to rebind, drop, or
execute a package
BIND allows the user to rebind or bind that package and to add new
package versions of the same package name and creator
EXECUTE allows the user to execute or run a package
18
Index Privileges
CONTROL allows the user to drop the index
Sequence Privilege
USAGE allows the user to use NEXT VALUE and PREVIOUS
VALUE expressions for the sequence
ALTER allows the user to perform tasks such as restarting the
sequence or changing the increment for future sequence values
Routine Privilege
EXECUTE allows the users to invoke a routine, create a function
that is sourced from that routine, and reference the routine in any
DDL statement such as CREATE VIEW or CREATE TRIGGER
2010 IBM Corporation
Information Management
Granting Privileges
Explicit
Privileges can be explicitly given to users or groups via the GRANT and REVOKE
commands
db2 grant select on table db2inst1.person to user employee
Implicit
DB2 may grant privileges automatically when certain commands are issued
Indirect
Packages contain SQL statements in an executable format. The user only requires
EXECUTE privilege to run them
Example: package1 contains the following static SQL statements
select * from test
insert into test values (1,2,3)
Information Management
Granular Privileges
How to implement?
Views
1)Simulate a new table
2)Create a view (subset of the data from the base table)
3)Authorize the user to access the view
4)Revoke access from the user to the base table
Information Management
EMPLOYEE TABLE
LASTNAME
WORKDIV
OFFICE
SALARY
BONUS
Smith
A0
Toronto
60000
2500
Crnic
A0
Vancouver
65000
1500
Johnson
B1
Calgary
55000
1000
Carlson
C2
Ottawa
70000
2200
Pogue
B1
Toronto
50000
2800
Ring
B1
Victoria
52000
3000
Barisic
A0
Ottawa
67000
1200
EMPLOYEE_INFO VIEW
21
LASTNAME
WORKDIV
OFFICE
Smith
A0
Toronto
Crnic
A0
Vancouver
Johnson
B1
Calgary
Carlson
C2
Ottawa
Pogue
B1
Toronto
Ring
B1
Victoria
Barisic
A0
Ottawa
Information Management
DEPT_1
DEPT_2
Employee
22
HR
Manager
2010 IBM Corporation
Information Management
Roles
Benefits
SECADMs control access at a level of abstraction that is close to
the structure of the organization. (Eg. Manager, HR, Employee)
The assignment and maintenance of privileges is simplified.
User roles change Revoke old role and grant new role not
specific privileges
Role has more responsibility All users inherit the new privileges
23
Information Management
Roles Implementation
The Basics
Extra Features
24
Role Hierarchies
A role hierarchy is formed
when one role is granted
membership in another
role.
Information Management
Summary
25
Authentication
Verifies the user are who they say they are using the
underlying operating system or other security protocols
Trusted Context
Solves the problems associated with loss of user identity in a
3-tiered environment
Authorization
Controls the access to database objects
Granular Privileges
Access to specific portion of data in a table can be restricted
using views and LBAC
Roles
Allows easy management of privileges
2010 IBM Corporation
Questions?
Summer/Fall 2010
E-mail: imschool@us.ibm.com
Subject: DB2 Academic Workshop
Information Management