pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel PaJaSoft Janousek <janousek@fonet.cz>
To: PqSQL Sql <pgsql-sql@postgresql.org>
Subject: Minimal rights
Date: Thu, 4 Mar 1999 19:06:20 +0100
Message-ID: <006801be6669$fa5f4760$2685d4c2@server.fonet2.cz> (raw)

    Hi,

    I'm begin use the PostgreSQL with aplications, which are connecting to databases from Web. I know many issues about security, so I want grant only the minimal rights that is needed for operations. I use ECPG for writing my C++ program together with ESQL. So...

In C++ program - in binary format - is many good informations - for example DatabaseName, User account and his password etc... - yes, binary format isn't more good, but this information are there...

    I know this, that is the way I create 2 PostgreSQL users. One - which create database, tables, sequences etc.. - this has full privileges and second - this user can have only Insert privilege. 
    From the Web I need only write some information about accessing the HTML pages to database.
    So, I've one table and 2 sequences... I see rights by '\z' command from psql and see this:
log    - {"-", "pajasoft=arwR", "webwriter=a"}
log_pkey   -
log_seq    - 

'log' is the table, 'log_pkey' is index, because table 'log' contains primary key and 'log_seq' is my own sequence... 'pajasoft' is user with full rights and 'webwriter' is user which has only Insert right.

    And now I have one question - I think, that both users (pajasoft, webwriter) have the same privileges to both sequences - both have full rights to this... This is bad, because, somebody, who hacked the machine, where the SQL server run can connect as 'webwriter' (information about password read from binary file - CGI script) and now he can modify sequences - table 'log' don't because users 'webwriter' has only Insert privilege.

    So I can give minimal privileges to user 'webwriter', but script must run next too.... My question is:

Which privileges must have any user which can only Insert to table, but the primary index in this table is filled as default value nextval ('log_seq')?

    Thanx for your answer....

Pavel PaJaSoft Janousek
FoNet, spol. s r.o.



Message-ID: <006801be6669$fa5f4760$2685d4c2@server.fonet2.cz>
Permalink:  ../006801be6669$fa5f4760$2685d4c2@server.fonet2.cz/
Also on:    postgresql.org/message-id/006801be6669$fa5f4760$2685d4c2@server.fonet2.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: janousek@fonet.cz
  Subject: Re: Minimal rights
  In-Reply-To: <006801be6669$fa5f4760$2685d4c2@server.fonet2.cz>
  References: <006801be6669$fa5f4760$2685d4c2@server.fonet2.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox