Re: viewing source code

Lists: pgsql-performance
From: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>
To: 'Bill Moran' <wmoran(at)collaborativefusion(dot)com>
Cc: "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 15:35:47
Message-ID: 1A6E6D554222284AB25ABE3229A927621129EC@nrtexcus702.int.asurion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

> > In an ideal world, if a user can't modify a function, he/she shouldn't
> be
> > able to see the source code. If the user can execute the function, then
> the
> > user should be able to see the signature of the function but not the
> body.
>
> I doubt that's going to happen. Mainly because I disagree completely
> with your ideal world description (any user who can execute a function
> should have the right to examine it to see what it actually does).
>

That is like saying anyone that has rights to call a web service should be
able to see the source code for it. There should be the ability to create
some level of abstraction when appropriate.

However, in the current configuration, all users with permission to log in
can see all source code. They don't have rights to execute the functions
but they can see the source code for them. Shouldn't I be able to revoke
both the ability to execute and the ability to see functions?

Jon


From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>
Cc: "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 16:18:49
Message-ID: 20071214111849.b8788ce4.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

In response to "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>:

> > > In an ideal world, if a user can't modify a function, he/she shouldn't
> > be
> > > able to see the source code. If the user can execute the function, then
> > the
> > > user should be able to see the signature of the function but not the
> > body.
> >
> > I doubt that's going to happen. Mainly because I disagree completely
> > with your ideal world description (any user who can execute a function
> > should have the right to examine it to see what it actually does).
>
> That is like saying anyone that has rights to call a web service should be
> able to see the source code for it.

I think that's a good idea. If vendors were forced publish their code,
we'd have less boneheaded security breaches.

> There should be the ability to create
> some level of abstraction when appropriate.

I agree. If vendors want to have boneheaded security breaches, they should
be allowed.

> However, in the current configuration, all users with permission to log in
> can see all source code. They don't have rights to execute the functions
> but they can see the source code for them. Shouldn't I be able to revoke
> both the ability to execute and the ability to see functions?

Um ... why did you snip my second paragraph where I said exactly this?

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran(at)collaborativefusion(dot)com
Phone: 412-422-3463x4023


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Bill Moran <wmoran(at)collaborativefusion(dot)com>
Cc: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 17:04:33
Message-ID: 20071214090433.08f241c1@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 14 Dec 2007 11:18:49 -0500
Bill Moran <wmoran(at)collaborativefusion(dot)com> wrote:

> > That is like saying anyone that has rights to call a web service
> > should be able to see the source code for it.
>
> I think that's a good idea. If vendors were forced publish their
> code, we'd have less boneheaded security breaches.

Not all closed source code is subject to boneheaded security breaches.
I believe that this individuals request is a valid one from a business
requirements perspective.

>
> > There should be the ability to create
> > some level of abstraction when appropriate.
>
> I agree. If vendors want to have boneheaded security breaches, they
> should be allowed.

It is not up to your or me to make the determination of what people are
able to do with their code.

>
> > However, in the current configuration, all users with permission to
> > log in can see all source code. They don't have rights to execute
> > the functions but they can see the source code for them. Shouldn't
> > I be able to revoke both the ability to execute and the ability to
> > see functions?

Yes and know. If your functions are interpreted then no, I don't see
any reason for this feature, e.g; python,perl,plpgsql,sql,ruby. I can
read them on disk anyway.

If you want to obfuscate your code I suggest you use a compilable form
or a code obfuscation module for your functions (which can be had for
at least python, I am sure others as well).

Sincerely,

Joshua D. Drake

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHYrejATb/zqfZUUQRAjd7AJ9iCqsvsB/7FfvUeLkpCUZ4/14/+wCcCD+w
Z4kjQ44yOgfR4ph0SKkUuUI=
=v3Fz
-----END PGP SIGNATURE-----


From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Bill Moran <wmoran(at)collaborativefusion(dot)com>, "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 17:11:27
Message-ID: 20071214171127.GE6269@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Joshua D. Drake wrote:

> > > However, in the current configuration, all users with permission to
> > > log in can see all source code. They don't have rights to execute
> > > the functions but they can see the source code for them. Shouldn't
> > > I be able to revoke both the ability to execute and the ability to
> > > see functions?
>
> Yes and know. If your functions are interpreted then no, I don't see
> any reason for this feature, e.g; python,perl,plpgsql,sql,ruby. I can
> read them on disk anyway.

If you have access to the files, which is not necessarily the case.
Random users, in particular, won't.

Maybe this can be done by revoking privileges to pg_proc. I am sure it
can be made to work. It does work for pg_auth_id, and nobody says that
"they can read the passwords from disk anyway."

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
"We're here to devour each other alive" (Hobbes)


From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 19:03:30
Message-ID: 20071214140330.ebc4e5dc.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

In response to "Joshua D. Drake" <jd(at)commandprompt(dot)com>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, 14 Dec 2007 11:18:49 -0500
> Bill Moran <wmoran(at)collaborativefusion(dot)com> wrote:
>
> > > That is like saying anyone that has rights to call a web service
> > > should be able to see the source code for it.
> >
> > I think that's a good idea. If vendors were forced publish their
> > code, we'd have less boneheaded security breaches.
>
> Not all closed source code is subject to boneheaded security breaches.
> I believe that this individuals request is a valid one from a business
> requirements perspective.

I could go into all sorts of philosophical debates on this ... for example,
"not all drivers are stupid enough to ram their cars into other things,
yet we still have seatbelt laws in the US."

> > > There should be the ability to create
> > > some level of abstraction when appropriate.
> >
> > I agree. If vendors want to have boneheaded security breaches, they
> > should be allowed.
>
> It is not up to your or me to make the determination of what people are
> able to do with their code.

That's what I said. Despite my cynical nature, I _do_ believe in
allowing people to shoot their own foot. Sometimes it's funny to
watch.

Any, yes, there are some folks who have very good QA and documentation
teams and can avoid pitfalls of security breaches and poorly documented
functions with unexpected side-effects. Even if they're not that
brilliant, they deserve the right to make their own choices.

> > > However, in the current configuration, all users with permission to
> > > log in can see all source code. They don't have rights to execute
> > > the functions but they can see the source code for them. Shouldn't
> > > I be able to revoke both the ability to execute and the ability to
> > > see functions?
>
> Yes and know. If your functions are interpreted then no, I don't see
> any reason for this feature, e.g; python,perl,plpgsql,sql,ruby. I can
> read them on disk anyway.

I disagree here. If they're connecting remotely to PG, they have no
direct access to the disk.

> If you want to obfuscate your code I suggest you use a compilable form
> or a code obfuscation module for your functions (which can be had for
> at least python, I am sure others as well).

Although this is an excellent suggestion as well.

But I still think the feature is potentially useful.

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran(at)collaborativefusion(dot)com
Phone: 412-422-3463x4023


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Bill Moran" <wmoran(at)collaborativefusion(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: viewing source code
Date: 2007-12-14 21:03:33
Message-ID: 36e682920712141303q9ff8306pfc2728cbd1011b0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

On Dec 14, 2007 2:03 PM, Bill Moran <wmoran(at)collaborativefusion(dot)com> wrote:
> I disagree here. If they're connecting remotely to PG, they have no
> direct access to the disk.

pg_read_file?

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/