dbTalk Databases Forums  

Relation of OS user to Informix database user

comp.databases.informix comp.databases.informix


Discuss Relation of OS user to Informix database user in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
anupam.mukherjee@gmail.com
 
Posts: n/a

Default Relation of OS user to Informix database user - 08-24-2005 , 10:31 AM






Hi,
I had just installed Informix Advanced Server version 10.0 for
Windows and was checking out the security features. I created two
operating system users, say A and B, gave both GRANT CONNECT and GRANT
RESOURCE permissions from the informix DBA user. Now, I could access
the entire database, including both A and B's tables by logging in as
either of the users. I tried connecting as A from dbaccess and doing a
REVOKE SELECT ON TABLE T FROM B. This gave an error saying no record in
ISAM and Unable to revoke permissions. It however allowed me to do a
GRANT SELECT ON TABLE T TO B. This did not change a thing since B could
already access A's tables. So I did a REVOKE SELECT ON TABLE T FROM B.
Next, I actually logged out and logged back in as B and still,
inexplicably enough, I was able to see A's tables easily enough. Any
explanations would be most welcome as I have been struggling to get
this working for sometime now.
Also any pointers to the relation of Informix's users to the
operating system level users would be welcome.
Regards,
Anupam


Reply With Quote
  #2  
Old   
scottishpoet
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-24-2005 , 11:46 AM






have you revoked from "public"?




anupam.mukherjee (AT) gmail (DOT) com wrote:
Quote:
Hi,
I had just installed Informix Advanced Server version 10.0 for
Windows and was checking out the security features. I created two
operating system users, say A and B, gave both GRANT CONNECT and GRANT
RESOURCE permissions from the informix DBA user. Now, I could access
the entire database, including both A and B's tables by logging in as
either of the users.
this would be expected as you have probably not revoke select from
public

I tried connecting as A from dbaccess and doing a
Quote:
REVOKE SELECT ON TABLE T FROM B. This gave an error saying no record in
ISAM and Unable to revoke permissions.
Correct B probably didn't have a specific select priviledge on table B
that could be revoked

It however allowed me to do a
Quote:
GRANT SELECT ON TABLE T TO B.
OK was this on the database that A created? I bet after you did this
you could then do the revoke you tried above as there would now be


This did not change a thing since B could
Quote:
already access A's tables. So I did a REVOKE SELECT ON TABLE T FROM B.
Next, I actually logged out and logged back in as B and still,
inexplicably enough, I was able to see A's tables easily enough.
Yip you still haven't revoked from public so you can still get access



Any
Quote:
explanations would be most welcome as I have been struggling to get
this working for sometime now.
Also any pointers to the relation of Informix's users to the
operating system level users would be welcome.
i am pretty sure there is some stuff on GRANT and REVOKE in the manuals
might be worth a quick look!

Quote:
Regards,
Anupam


Reply With Quote
  #3  
Old   
david@smooth1.co.uk
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-24-2005 , 04:06 PM




Run

dbschema -d <database> | more

Is one of the users a dba for the database?


Run
dbschema -d <database> -t <tablename> | more

and that will show you the grants and revokes on that table.

You probably need to revoke select fro public.


Reply With Quote
  #4  
Old   
Jonathan Leffler
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-24-2005 , 11:24 PM



anupam.mukherjee (AT) gmail (DOT) com wrote:
Quote:
I had just installed Informix Advanced Server version 10.0 for
Windows and was checking out the security features. I created two
operating system users, say A and B, gave both GRANT CONNECT and GRANT
RESOURCE permissions from the informix DBA user.
First suggestion - don't make user 'informix' the DBA; the user already
has an incredible amount of power (it's God w.r.t IDS). However, this
wasn't a factor in your observations.

When you created the database, was a MODE ANSI database, or a logged or
an unlogged database. I am 95% sure it wasn't MODE ANSI...

Quote:
Now, I could access
the entire database, including both A and B's tables by logging in as
either of the users.
Yes. By default, in a non-ANSI database, public is given access
permission on all tables automatically, unless you have NODEFDAC set
correctly in the environment when the tables are created. So,
regardless of which user (A, B, or any other user C), what you saw is
expected behaviour. In a MODE ANSI database, no public access is given
by default - one of the reasons I'm fairly sure you're not using such a
database.

Quote:
I tried connecting as A from dbaccess and doing a
REVOKE SELECT ON TABLE T FROM B. This gave an error saying no record in
ISAM and Unable to revoke permissions.
Only DBAs can revoke permissions on behalf of other users. Since A is
only resource-level user, A can only revoke permission that they've
granted. The permission should not have been removed.

Quote:
It however allowed me to do a
GRANT SELECT ON TABLE T TO B.
Possibly - but did it actually add anything to the systabauth table? If
you read the GRANT manual pages carefully, there appears to be a
loophole such that a GRANT statement might execute 'OK' without granting
the permissions.

Quote:
This did not change a thing since B could
already access A's tables. So I did a REVOKE SELECT ON TABLE T FROM B.
Since A doesn't own the table, and A is not a DBA (just resource), this
should not achieve anything.

Quote:
Next, I actually logged out and logged back in as B and still,
inexplicably enough, I was able to see A's tables easily enough.
Since the table owner didn't do the revoking, and the DBA didn't do the
revoking, nothing was revoked.

Quote:
Any
explanations would be most welcome as I have been struggling to get
this working for sometime now.
You can't revoke permissions you don't have permission to revoke.

Quote:
Also any pointers to the relation of Informix's users to the
operating system level users would be welcome.
There's a one-to-one correspondence between Informix users and O/S users.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler (AT) earthlink (DOT) net, jleffler (AT) us (DOT) ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/


Reply With Quote
  #5  
Old   
Jean Sagi
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 12:18 AM




I think so...


J.


anupam.mukherjee (AT) gmail (DOT) com escribis:
Quote:
Thanks for the great pointers. Sorry I'm a bit of a newbie and
hopefully my questions were not too basic. I did try reading up and
googling but could not find much. I have one more question . Is it at
all possible to create two different tables with the same name in the
same database but under two different users?
sending to informix-list


Reply With Quote
  #6  
Old   
anupam.mukherjee@gmail.com
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 01:22 AM



Thanks for the great pointers. Sorry I'm a bit of a newbie and
hopefully my questions were not too basic. I did try reading up and
googling but could not find much. I have one more question . Is it at
all possible to create two different tables with the same name in the
same database but under two different users?


Reply With Quote
  #7  
Old   
anupam.mukherjee@gmail.com
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 02:54 AM




scottishpoet wrote:
Quote:
have you revoked from "public"?




anupam.mukherjee (AT) gmail (DOT) com wrote:
Hi,
I had just installed Informix Advanced Server version 10.0 for
Windows and was checking out the security features. I created two
operating system users, say A and B, gave both GRANT CONNECT and GRANT
RESOURCE permissions from the informix DBA user. Now, I could access
the entire database, including both A and B's tables by logging in as
either of the users.

this would be expected as you have probably not revoke select from
public

I tried connecting as A from dbaccess and doing a
REVOKE SELECT ON TABLE T FROM B. This gave an error saying no record in
ISAM and Unable to revoke permissions.
Correct B probably didn't have a specific select priviledge on table B
that could be revoked

It however allowed me to do a
GRANT SELECT ON TABLE T TO B.

OK was this on the database that A created? I bet after you did this
you could then do the revoke you tried above as there would now be
Absolutely true. I did try that. All of this activity was in a database
which the informix user had created and which I wanted A and B to
share.
Quote:

This did not change a thing since B could
already access A's tables. So I did a REVOKE SELECT ON TABLE T FROM B.
Next, I actually logged out and logged back in as B and still,
inexplicably enough, I was able to see A's tables easily enough.

Yip you still haven't revoked from public so you can still get access



Any
explanations would be most welcome as I have been struggling to get
this working for sometime now.
Also any pointers to the relation of Informix's users to the
operating system level users would be welcome.

i am pretty sure there is some stuff on GRANT and REVOKE in the manuals
might be worth a quick look!

I downloaded their pdfs which were really good about the database level
and table level privileges etc., but I understood more about the
practical aspects as such from this thread of conversation
Quote:
Regards,
Anupam


Reply With Quote
  #8  
Old   
Colin Dawson
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 05:14 AM




This is from the -310 SQL errror code.

Only one table with a given name can exist in a single database. (In an
ANSI-compliant database, the name of the user that created a table name
qualifies it, so one table of a
given name per user can exist.)



Regards

Colin

There are 10 types of people in the world, those that understand binary and
those that don't





Quote:
From: anupam.mukherjee (AT) gmail (DOT) com
Reply-To: anupam.mukherjee (AT) gmail (DOT) com
To: informix-list (AT) iiug (DOT) org
Subject: Re: Relation of OS user to Informix database user
Date: 24 Aug 2005 23:22:39 -0700

Thanks for the great pointers. Sorry I'm a bit of a newbie and
hopefully my questions were not too basic. I did try reading up and
googling but could not find much. I have one more question . Is it at
all possible to create two different tables with the same name in the
same database but under two different users?
sending to informix-list


Reply With Quote
  #9  
Old   
Colin Dawson
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 05:22 AM




Just to add to the discussion



<SNIP>
Quote:
It however allowed me to do a
GRANT SELECT ON TABLE T TO B.

Possibly - but did it actually add anything to the systabauth table? If
you read the GRANT manual pages carefully, there appears to be a
loophole such that a GRANT statement might execute 'OK' without granting
the permissions.
<SNIP>

Is this a loophole or a security measure? I had been led to believe it works
this way deliberately.

By telling a user(hacker) that his command has failed is giving him
information/knowledge about your systems you may not want



Regards

Colin

There are 10 types of people in the world, those that understand binary and
those that don't
sending to informix-list


Reply With Quote
  #10  
Old   
Richard Spitz
 
Posts: n/a

Default Re: Relation of OS user to Informix database user - 08-25-2005 , 06:13 AM



anupam.mukherjee (AT) gmail (DOT) com schrieb:

Quote:
Is it at
all possible to create two different tables with the same name in the
same database but under two different users?
If the database has "log mode ANSI", then you can do this. Otherwise,
you cannot. However, this means that you always have to specify
"owner.tablename" instead of just "tablename" when accessing tables.

Read up on logging modes, "log mode ANSI" comes with several other
gotchas that you need to know beforehand.

Regards, Richard


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.