If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > fenced user and the .fenced file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-20-10, 05:05
vshasha vshasha is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
fenced user and the .fenced file

Hi,

Can anyone help me out of the following issue regarding fenced user permissions and routines that run under fenced user.

Platform - linux
db2 version - db2v95

I have created an instance using the following.

./db2icrt -u db2fenc1 db2inst1

Consider the following scenario.
db2fenc1 - fenced user
db2inst1 - instance owner.
db2inst1@beta5>id db2fenc1
uid=44048(db2fenc1) gid=100(users), groups=100(users),16(dialout),33(video)

db2inst1@beta5>id db2inst1
uid=44049(db2inst1) gid=204(search) groups=204(search),16(dialout),33(video)
db2inst1@beta5>ls -l /home/db2inst1/sqllib/adm/.fenced
-r--r--r-- 1 db2fenc1 users 0 2010-08-11 15:55

Suppose if I change only the group ownership of the /home/db2inst1/sqllib/adm/.fenced to "search".
ie.

root@beta5> chgrp search /home/db2inst1/sqllib/adm/.fenced

db2inst1@beta5>ls -l /home/db2inst1/sqllib/adm/.fenced
-r--r--r-- 1 db2fenc1 search 0 2010-08-11 15:55

Please note - I have only changed the group permission of the .fenced file and not the group of the fenced user(ie db2fenc1).


What is the would be impact of the routines running as fenced before and after the above change.
Reply With Quote
  #2 (permalink)  
Old 09-20-10, 13:09
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Based on the information I received from someone who knows fenced stuff well, db2 reads this file in order to find who the owner of db2fmp process is. So, there should not be any impact to routines running as fenced.

However, I found the following mentioned here:
Backup and restore SQL schemas for DB2 Universal Database

"The procedures use the SYSPROC.ADMIN_CMD() stored procedure to export and the SYSPROC.DB2LOAD() stored procedure to load. (SYSPROC.ADMIN_CMD() has been introduced in DB2 V8.2.2 (FP 9). Therefore, V8.2.2 is the minimum version requirement.) SYSPROC.ADMIN_CMD() executes under the fenced user id and group specified by the owner of the sqllib\adm\.fenced file. As a result the exported files have the same owner and group as sqllib\adm\.fenced. Therefore it is important to ensure that the user or group has privileges to write to the specified directories, while the user id expected to access the files also has access. The simple solution is to change ownership of sqllib\adm\.fenced to the instance owner. The safer solution is to have both IDs as members of a shared group and change only the group ownership of sqllib\adm\.fenced to that shared group. This way it is ensured that you can access the produced files through the group membership."
Reply With Quote
  #3 (permalink)  
Old 09-21-10, 01:14
vshasha vshasha is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
Thanks for your reply, can the fenced routines access the sqllib directory or change any sensitive data which the fenced user is not suppose to change by doing this (ie changing the group of the .fenced file) ?
Reply With Quote
  #4 (permalink)  
Old 09-21-10, 09:20
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Sorry, I don't know enough about (fenced) routines to answer your question.
Reply With Quote
  #5 (permalink)  
Old 09-22-10, 13:27
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Yes, if not configured properly, that can happen. The user/group membership of the .fenced file defines the authorizations with which the db2fmp (fenced mode process) is running. All operations done inside that process will be checked by the operating system kernel, including file operations. So if the db2fmp is running with an authorization that can change some files under sqllib/, a UDF running in the db2fmp can perform such changes.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #6 (permalink)  
Old 11-16-10, 13:33
vshasha vshasha is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
Thanks a lot for the reply.

I have another question related to this.

db2inst1@beta5>id db2fenc1
uid=44048(db2fenc1) gid=100(users), groups=100(users),16(search),33(video)


db2inst1@beta5>id db2inst1
uid=44049(db2inst1) gid=204(search) groups=204(search),16(dialout),33(video)

If the fenced user (ie db2fenc1) has a secondary group "search" which is the primary group of the instance owner and has SYSADM authority, will the fenced user also get the SYSADM authority ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On