You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Gianugo Rabellino <gi...@apache.org> on 2003/01/03 18:41:04 UTC

New security code in scratchpad

As you might have noticed, I commited some new code in scratchpad. It's 
nothing special, and it's far from being finished, but I felt that it 
was much better to put it in CVS so that interested parties might 
discuss it and participate in the development.

Just to make things clear, I'm strongly against working on this code (or 
any other one) for the upcoming release. This might go in a 1.2 or 
(better) act as a possible foundation for a new version.

Now, a short description of what has been committed, so that you might 
want to take a look at it. :-) First of all, I decided to try out the 
JAAS way (I was already thinking about it, and Murray's hint was a good 
help in that direction): I'm still not that sure that it's the perfect 
solution for our needs, and I don't think that we might buy the whole 
JAAS object model, but for basic needs it might be OK.

The good news would be that, once in place, security would be pluggable 
in a PAM way, so it will be possible to authenticate the Xindice access 
against an NT domain or against a JDBC datasource. And the other way 
around: since I scratched out also a JAAS LoginModule, once finished 
other JAAS compliant applications might be able to authenticate their 
users against the Xindice userbase.

This is how I layered out my ideas and code: there is be in 
SystemCollection a collection called SysUsers (it already exists but 
it's unused) holding an XML document with the user data (very basic ATM: 
just user, passwords and roles). This is actually an XMLSerializable 
object, so it's possible to use it in a programmatic way: it might 
become a singleton instance in Database.java, with an accessor method 
(here there are some security issues: on top of the TODO list is 
password encryption). This object will be used for managing the user 
base (possibly extending the XMLTools?) and, most of all, by the 
XindiceLoginModule that will be the default LoginModule in the JAAS 
configuration. Database.getCollection(col, user, password) will 
instantiate a JAAS LoginContext and serve the requested collection only 
to authenticated users.

This is of course only the first step, and there are already many 
problems to solve here. At a very least I see:

1. a chicken and egg problem: we need to ensure that Xindice is able to 
operate (internally) without authentication, or it won't be able to 
retrieve and modify even the user data.

2. authorization. this is an hard issue: with this setup we only have 
the benefit of restricting the full access, as a whole, to 
unauthenticated users. But is all or nothing: when you are 
authenticated, you can do everything. To move forward and have at least 
a readonly mode, we have to seriously tweak the internals. I'm thinking 
about a Proxy classe for the real Collection (ReadOnlyCollection): do 
you think it makes sense?

OK, thanks if you have read this far, please feel free to fire at will.

As a final note, I hope that Vladimir will appreciate the TDD. :-)

Ciao,

-- 
Gianugo


Re: New security code in scratchpad

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Sounds fair to me.   I am sure you will see the light some day ;-).

Ciao,

Mark

Gianugo Rabellino wrote:

> Mark J. Stang wrote:
>
> > I think the bottom-line is that the embedded version of Xindice is available
> > to build stand-alone applications or other servers.   As such, it is
> > valuable
> > to many members of the Xindice community.   I am very disturbed that
> > you see a future where it doesn't exist.   Like it is a bug you plan to
> > remove
> > in the future.   IF THAT IS THE CASE SPEAK UP NOW AND I
> > WILL FIND ANOTHER DB.   SO PLAN ON LIVING WITH IT
> > FOR 1.X, 2.X, ETC.   And no, my caps lock key is not stuck
> > in upper case.
>
> Well, my unlimited ego is very happy to see that you consider me so
> powerful in this project to remove this feature. :-) But definitely this
> is not the case. I am only a voice in the Xindice community (and a
> minority one on this side), and I'm not going to ask to deprecate or
> remove anything: I always had mixed feelings about this driver, but I
> didn't -1 it in the past, and I won't in the future: my opinion is that
> software is an evolving matter, so only a community driven evolution
> will be able to tell where we'll stand in the future. And more code (and
> more choices) are always better than less.
>
> Nevertheless, I'll continue to criticize this "feature", since I still
> have to be given a convincing example of this driver being really useful
> (it's not really worth discussing, but my point is that the embedded
> Xindice can be easily used with plain Xindice "native" API, and that
> what you are trying to do is use a DBMS as a plain DB: stretching a bit
> the parallel, is like using MySQL when you only need Berkeley DB. If
> I'll ever have such a need, I'll probably go with Sleepycat dbxml), but
> if you are using it, it's just OK to me.
>
> This said, I'm also going to support this driver, trying to keep it in
> sync with the other ones for what will be possible to me. Just don't
> expect me to be proactive on that particular side.
>
> Fair enough?
>
> Ciao,
>
> --
> Gianugo Rabellino

--
Mark J Stang
System Architect
Cybershop Systems


Re: New security code in scratchpad

Posted by Gianugo Rabellino <gi...@apache.org>.
Mark J. Stang wrote:

> I think the bottom-line is that the embedded version of Xindice is available 
> to build stand-alone applications or other servers.   As such, it is
> valuable
> to many members of the Xindice community.   I am very disturbed that
> you see a future where it doesn't exist.   Like it is a bug you plan to
> remove
> in the future.   IF THAT IS THE CASE SPEAK UP NOW AND I
> WILL FIND ANOTHER DB.   SO PLAN ON LIVING WITH IT
> FOR 1.X, 2.X, ETC.   And no, my caps lock key is not stuck
> in upper case.

Well, my unlimited ego is very happy to see that you consider me so 
powerful in this project to remove this feature. :-) But definitely this 
is not the case. I am only a voice in the Xindice community (and a 
minority one on this side), and I'm not going to ask to deprecate or 
remove anything: I always had mixed feelings about this driver, but I 
didn't -1 it in the past, and I won't in the future: my opinion is that 
software is an evolving matter, so only a community driven evolution 
will be able to tell where we'll stand in the future. And more code (and 
more choices) are always better than less.

Nevertheless, I'll continue to criticize this "feature", since I still 
have to be given a convincing example of this driver being really useful 
(it's not really worth discussing, but my point is that the embedded 
Xindice can be easily used with plain Xindice "native" API, and that 
what you are trying to do is use a DBMS as a plain DB: stretching a bit 
the parallel, is like using MySQL when you only need Berkeley DB. If 
I'll ever have such a need, I'll probably go with Sleepycat dbxml), but 
if you are using it, it's just OK to me.

This said, I'm also going to support this driver, trying to keep it in 
sync with the other ones for what will be possible to me. Just don't 
expect me to be proactive on that particular side.

Fair enough?

Ciao,

-- 
Gianugo Rabellino


Re: New security code in scratchpad

Posted by "Mark J. Stang" <ma...@earthlink.net>.

Gianugo Rabellino wrote:

> Mark J. Stang wrote:
> > There are several people who are using the embedded driver
> > on this list.   I wrote an XML Server.   I can send it requests
> > like "select customer from customers where lastname = 'Stang'".
> > It is a stand-alone process.   It communicates via JMS.
> > So, my Clients "publish" requests for data and my server
> > "subscribes" to those types of requests.   When a request
> > comes in, it processes it and "publishes" the response back
> > to the clients.
>
> I have never heard of such a kind of inversion of control... client
> publishing and server subscribing: quite funny, but if it works for you,
> it's OK.

Actually, they both Publish and Subscribe.   The Server subscribes to
requests for
data.  The Clients Subscribe to changes to their data.   They communicate
via
Publish/Subscribe.

>
> > I decided to have a single process non-server version
> > of my application.  By using the embedded version in
> > my client, I can remove all the other server processes.
> > This is great for demo programs and for Customers
> > who might want to try before they buy.   I can send
> > them the embedded version/single user and they can
> > key in real data and see the application in action.
> > If they decide to buy, I ship them the server jars,
> > start the server processes using the data from
> > the embedded version and they don't loose anything.
> >
> > With the single user version, I can "upgrade" my
> > customers to a multi-user version without having
> > to re-install the entire application.   I change one
> > jar on the client, install the server, move the
> > db directory and I am done.
>
> OK, until now you are making a technical point from a convenience
> functionality. Which is fair, but IMHO doesn't really pay off from what
> we are losing from an architectural and developer POV: we have to
> maintain two drivers, keeping them in sync and evolving them at the same
> pace, which requires a lot of effort. Way too much, for having just the
> commercial convenience of being able to switch drivers and version
> between a demo and an uncrippled version (true, this convenience would
> apply to other scenarios as well). But the embed driver is here and this
> is not really a choice anymore, at least for 1.x, so enough ranting.
>

I think the bottom-line is that the embedded version of Xindice is available

to build stand-alone applications or other servers.   As such, it is
valuable
to many members of the Xindice community.   I am very disturbed that
you see a future where it doesn't exist.   Like it is a bug you plan to
remove
in the future.   IF THAT IS THE CASE SPEAK UP NOW AND I
WILL FIND ANOTHER DB.   SO PLAN ON LIVING WITH IT
FOR 1.X, 2.X, ETC.   And no, my caps lock key is not stuck
in upper case.

>
> > My only concern is that Xindice gets an
> > extra layer on top of what is already there
> > that I won't have any use for.   I would like
> > to see the embedded driver be able to bypass
> > the security.   I think it should either be an
> > API on top of the embedded driver.
>
> There are no API to invent, actually. We already have the only API we
> need (well, not really, let's say it's the only one we can use) at the
> XML:DB level, which is Database.getCollection(collection, user,
> password). Other than that, I'm not that much willing to go with the
> official distribution: of course there will be some possibility to hack
> your way through the AAA code (which, if will be JAAS based, will be for
> sure flexible enough), but I don't see this as an option for the
> mainstream development.
>
> Ciao,
>
> --
> Gianugo Rabellino

Ciao,
Mark

--
Mark J Stang
System Architect
Cybershop Systems


Re: New security code in scratchpad

Posted by "Vladimir R. Bossicard" <vl...@apache.org>.
> Personally, I for one would have no current use for Xindice
> were it not for the embedded version. Nor do I have any
> current visions of future uses for anything but the embedded version.
> I certainly hope this is not evidence of a movement to do away with the
> embedded version...

I also support the embed driver, 100%.

I would be even more radical: move every client into a separate 
subproject and ship xindice-core with fewer external jars
- each driver would document its external dependencies
- each driver would provide its own releases (for the client and/or 
server sides).  Currently you need to install the entire Xindice on both 
the server and the client if you use xml-rpc...
- this would be a great example for the development of other drivers 
(WebDAV, JMS...)

But of course we will loose in useability because the 
users/administrators will have to add several jars into their classpaths...

-Vladimir

-- 
Vladimir R. Bossicard
Apache Xindice - http://xml.apache.org/xindice


Re: New security code in scratchpad

Posted by Terry Rosenbaum <Te...@amicas.com>.
Gianugo Rabellino wrote:

> OK, until now you are making a technical point from a convenience 
> functionality. Which is fair, but IMHO doesn't really pay off from 
> what we are losing from an architectural and developer POV: we have to 
> maintain two drivers, keeping them in sync and evolving them at the 
> same pace, which requires a lot of effort. Way too much, for having 
> just the commercial convenience of being able to switch drivers and 
> version between a demo and an uncrippled version (true, this 
> convenience would apply to other scenarios as well). But the embed 
> driver is here and this is not really a choice anymore, at least for 
> 1.x, so enough ranting.

Personally, I for one would have no current use for Xindice
were it not for the embedded version. Nor do I have any
current visions of future uses for anything but the embedded version.
I certainly hope this is not evidence of a movement to do away with the
embedded version...

Should not the embedded version be the real core of Xindice
around which other access methods are wrapped (e.g. XMLRPC,
whatever)?

-Terry


Re: New security code in scratchpad

Posted by Gianugo Rabellino <gi...@apache.org>.
Mark J. Stang wrote:
> There are several people who are using the embedded driver
> on this list.   I wrote an XML Server.   I can send it requests
> like "select customer from customers where lastname = 'Stang'".
> It is a stand-alone process.   It communicates via JMS.
> So, my Clients "publish" requests for data and my server
> "subscribes" to those types of requests.   When a request
> comes in, it processes it and "publishes" the response back
> to the clients.

I have never heard of such a kind of inversion of control... client 
publishing and server subscribing: quite funny, but if it works for you, 
it's OK.

> I decided to have a single process non-server version
> of my application.  By using the embedded version in
> my client, I can remove all the other server processes.
> This is great for demo programs and for Customers
> who might want to try before they buy.   I can send
> them the embedded version/single user and they can
> key in real data and see the application in action.
> If they decide to buy, I ship them the server jars,
> start the server processes using the data from
> the embedded version and they don't loose anything.
> 
> With the single user version, I can "upgrade" my
> customers to a multi-user version without having
> to re-install the entire application.   I change one
> jar on the client, install the server, move the
> db directory and I am done.

OK, until now you are making a technical point from a convenience 
functionality. Which is fair, but IMHO doesn't really pay off from what 
we are losing from an architectural and developer POV: we have to 
maintain two drivers, keeping them in sync and evolving them at the same 
pace, which requires a lot of effort. Way too much, for having just the 
commercial convenience of being able to switch drivers and version 
between a demo and an uncrippled version (true, this convenience would 
apply to other scenarios as well). But the embed driver is here and this 
is not really a choice anymore, at least for 1.x, so enough ranting.

> My only concern is that Xindice gets an
> extra layer on top of what is already there
> that I won't have any use for.   I would like
> to see the embedded driver be able to bypass
> the security.   I think it should either be an
> API on top of the embedded driver.

There are no API to invent, actually. We already have the only API we 
need (well, not really, let's say it's the only one we can use) at the 
XML:DB level, which is Database.getCollection(collection, user, 
password). Other than that, I'm not that much willing to go with the 
official distribution: of course there will be some possibility to hack 
your way through the AAA code (which, if will be JAAS based, will be for 
sure flexible enough), but I don't see this as an option for the 
mainstream development.

Ciao,

-- 
Gianugo Rabellino


Re: New security code in scratchpad (no CORBA needed from Xindiceto xmlBlaster)

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Heinrich,
With the embedded version of the server, Xindice is no
longer an issue.  My issue now is that I have everything
designed to work with JMS.   However, I am in the
process of abstracting my Publish/Subscribe Interface to
make it transport independent.   At that time, I should be
able to "drop in" any version of JMS, XmlBlaster or
None.   The "None" version uses an internal
Publish/Subscribe without having to go over the wire.

Once, I can swap out my transport layer, then I will
be interested in seeing how fast/reliable XmlBlaster
is compared to some of the JMS implementations.
I have high hopes for XmlBlaster :-).

regards,

Mark

Heinrich Götzger wrote:

> On Sun, 5 Jan 2003, Mark J. Stang wrote:
>
> [...]
> >With the old version of Xindice, I had to have a seperate
> >Xindice process running.  So, I had a JMS Server, a
> >Cybershop Server and Xindice Server all running.
> >To make things more interesting, I used JBoss for my
> >JMS server, a little overkill :-).   By using the
> >embedded version I can eliminate one process.   With
> >the elimination of the whole CORBA thing, I might be
> >able to use XmlBlaster.
>
> You might be able to use it in these days as well.
> xmlBlaster supports some SOCKET transport layer instead of CORBA. It might
> even be faster.
>
> It seems that there is no other way around than this to avoid singleton
> CORBA conflicts discussed here a year ago.
> [...]
>
> cheers
>
> Heinrich

--
Mark J Stang
System Architect
Cybershop Systems


Re: New security code in scratchpad (no CORBA needed from Xindice to xmlBlaster)

Posted by Heinrich Götzger <go...@gmx.net>.
On Sun, 5 Jan 2003, Mark J. Stang wrote:

[...]
>With the old version of Xindice, I had to have a seperate
>Xindice process running.  So, I had a JMS Server, a
>Cybershop Server and Xindice Server all running.
>To make things more interesting, I used JBoss for my
>JMS server, a little overkill :-).   By using the
>embedded version I can eliminate one process.   With
>the elimination of the whole CORBA thing, I might be
>able to use XmlBlaster.

You might be able to use it in these days as well.
xmlBlaster supports some SOCKET transport layer instead of CORBA. It might
even be faster.

It seems that there is no other way around than this to avoid singleton
CORBA conflicts discussed here a year ago.
[...]

cheers

Heinrich

Re: New security code in scratchpad

Posted by "Mark J. Stang" <ma...@earthlink.net>.
There are several people who are using the embedded driver
on this list.   I wrote an XML Server.   I can send it requests
like "select customer from customers where lastname = 'Stang'".
It is a stand-alone process.   It communicates via JMS.
So, my Clients "publish" requests for data and my server
"subscribes" to those types of requests.   When a request
comes in, it processes it and "publishes" the response back
to the clients.

With the old version of Xindice, I had to have a seperate
Xindice process running.  So, I had a JMS Server, a
Cybershop Server and Xindice Server all running.
To make things more interesting, I used JBoss for my
JMS server, a little overkill :-).   By using the
embedded version I can eliminate one process.   With
the elimination of the whole CORBA thing, I might be
able to use XmlBlaster.

I decided to have a single process non-server version
of my application.  By using the embedded version in
my client, I can remove all the other server processes.
This is great for demo programs and for Customers
who might want to try before they buy.   I can send
them the embedded version/single user and they can
key in real data and see the application in action.
If they decide to buy, I ship them the server jars,
start the server processes using the data from
the embedded version and they don't loose anything.

With the single user version, I can "upgrade" my
customers to a multi-user version without having
to re-install the entire application.   I change one
jar on the client, install the server, move the
db directory and I am done.

>From a security point of view, I am going to have
to provide some Authentication and some
Authorization checking.   I was hoping to see it
as part of the core Xindice.   I will need a list
of Users and Passwords to Authenticate my
clients.   The Authorization is a little more
complicated.

My only concern is that Xindice gets an
extra layer on top of what is already there
that I won't have any use for.   I would like
to see the embedded driver be able to bypass
the security.   I think it should either be an
API on top of the embedded driver.

ciao,

Mark

Gianugo Rabellino wrote:

> Mark J. Stang wrote:
> > How do you see this working in the embedded mode?
> >
>
> I don't see it as an issue. But first I have to confess that I still
> have to be convinced that including the embedded driver in the Xindice
> core is a Good Thing. I don't use it, and don't plan to, so I'm almost
> totally ignorant on that particular implementation. But:
>
> 1. I don't see any reason for this architecture not to work in embedded
> mode too. True, there are major security issues, i.e. you can always get
> access to the internal API, which leads us to:
>
> 2. security in an embedded environment doesn't make much sense. When you
> are on the same VM, you are on the same machine, running your "client"
> processes with the same privileges as the "server" process, and can do
> almost everything. Probably you would have to play with Java security
> policies to have some acceptable security level, but again I don't see
> this as a strict requirement.
>
> Ciao,
>
> --
> Gianugo Rabellino

--
Mark J Stang
System Architect
Cybershop Systems


Re: New security code in scratchpad

Posted by "Mark J. Stang" <ma...@earthlink.net>.
One more thing, the embedded security requirement is to
keep people from walking up to the machine and just
running the application.

Maybe we should define "UserIds" and "Passwords" as
a standard.  I think everyone will need these.

ciao,

Mark

Gianugo Rabellino wrote:

> Mark J. Stang wrote:
> > How do you see this working in the embedded mode?
> >
>
> I don't see it as an issue. But first I have to confess that I still
> have to be convinced that including the embedded driver in the Xindice
> core is a Good Thing. I don't use it, and don't plan to, so I'm almost
> totally ignorant on that particular implementation. But:
>
> 1. I don't see any reason for this architecture not to work in embedded
> mode too. True, there are major security issues, i.e. you can always get
> access to the internal API, which leads us to:
>
> 2. security in an embedded environment doesn't make much sense. When you
> are on the same VM, you are on the same machine, running your "client"
> processes with the same privileges as the "server" process, and can do
> almost everything. Probably you would have to play with Java security
> policies to have some acceptable security level, but again I don't see
> this as a strict requirement.
>
> Ciao,
>
> --
> Gianugo Rabellino

--
Mark J Stang
System Architect
Cybershop Systems


Re: New security code in scratchpad

Posted by Gianugo Rabellino <gi...@apache.org>.
Mark J. Stang wrote:
> How do you see this working in the embedded mode?
> 

I don't see it as an issue. But first I have to confess that I still 
have to be convinced that including the embedded driver in the Xindice 
core is a Good Thing. I don't use it, and don't plan to, so I'm almost 
totally ignorant on that particular implementation. But:

1. I don't see any reason for this architecture not to work in embedded 
mode too. True, there are major security issues, i.e. you can always get 
access to the internal API, which leads us to:

2. security in an embedded environment doesn't make much sense. When you 
are on the same VM, you are on the same machine, running your "client" 
processes with the same privileges as the "server" process, and can do 
almost everything. Probably you would have to play with Java security 
policies to have some acceptable security level, but again I don't see 
this as a strict requirement.

Ciao,

-- 
Gianugo Rabellino



Re: New security code in scratchpad

Posted by "Mark J. Stang" <ma...@earthlink.net>.
How do you see this working in the embedded mode?

Mark

Gianugo Rabellino wrote:

> As you might have noticed, I commited some new code in scratchpad. It's
> nothing special, and it's far from being finished, but I felt that it
> was much better to put it in CVS so that interested parties might
> discuss it and participate in the development.
>
> Just to make things clear, I'm strongly against working on this code (or
> any other one) for the upcoming release. This might go in a 1.2 or
> (better) act as a possible foundation for a new version.
>
> Now, a short description of what has been committed, so that you might
> want to take a look at it. :-) First of all, I decided to try out the
> JAAS way (I was already thinking about it, and Murray's hint was a good
> help in that direction): I'm still not that sure that it's the perfect
> solution for our needs, and I don't think that we might buy the whole
> JAAS object model, but for basic needs it might be OK.
>
> The good news would be that, once in place, security would be pluggable
> in a PAM way, so it will be possible to authenticate the Xindice access
> against an NT domain or against a JDBC datasource. And the other way
> around: since I scratched out also a JAAS LoginModule, once finished
> other JAAS compliant applications might be able to authenticate their
> users against the Xindice userbase.
>
> This is how I layered out my ideas and code: there is be in
> SystemCollection a collection called SysUsers (it already exists but
> it's unused) holding an XML document with the user data (very basic ATM:
> just user, passwords and roles). This is actually an XMLSerializable
> object, so it's possible to use it in a programmatic way: it might
> become a singleton instance in Database.java, with an accessor method
> (here there are some security issues: on top of the TODO list is
> password encryption). This object will be used for managing the user
> base (possibly extending the XMLTools?) and, most of all, by the
> XindiceLoginModule that will be the default LoginModule in the JAAS
> configuration. Database.getCollection(col, user, password) will
> instantiate a JAAS LoginContext and serve the requested collection only
> to authenticated users.
>
> This is of course only the first step, and there are already many
> problems to solve here. At a very least I see:
>
> 1. a chicken and egg problem: we need to ensure that Xindice is able to
> operate (internally) without authentication, or it won't be able to
> retrieve and modify even the user data.
>
> 2. authorization. this is an hard issue: with this setup we only have
> the benefit of restricting the full access, as a whole, to
> unauthenticated users. But is all or nothing: when you are
> authenticated, you can do everything. To move forward and have at least
> a readonly mode, we have to seriously tweak the internals. I'm thinking
> about a Proxy classe for the real Collection (ReadOnlyCollection): do
> you think it makes sense?
>
> OK, thanks if you have read this far, please feel free to fire at will.
>
> As a final note, I hope that Vladimir will appreciate the TDD. :-)
>
> Ciao,
>
> --
> Gianugo

--
Mark J Stang
System Architect
Cybershop Systems