Why not use "." rather than "@"?  Seems more natural to me...

David

Rick Hillegas (JIRA) wrote:
[ https://issues.apache.org/jira/browse/DERBY-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465306 ]
Rick Hillegas commented on DERBY-2109:
--------------------------------------

I agree that a DatabasePrincipal should encode both the database name and the 
authorization id inside that database. It is interesting that the same 
authorization id can have different credentials depending on the connected 
database.

I don't know what the terms-of-art here are, but for the rest of this 
discussion, I'm going to use the following nomenclature:

systemWideID - This is a user name that is authenticated with databaseName = 
null.

databaseScopedID - This is a user name that is authenticated with a non-null 
databaseName.

It is interesting that we authenticate the user twice when creating a database. 
First we authenticate with a systemWideID. If that succeeds, we create the 
database and mark that authorization id as the database owner. Then we 
re-authenticate the user as a databaseScopedID, using the same credentials. 
Clearly this assumes that at bootstrap time, the same credentials will work for 
the systemWideID and the databaseScopedID.

The policy file syntax for Principals is a little limited. That is, you're only 
allowed to declare one argument to your Principal's constructor. This means 
that we have to glue together the authorization id and database name. Maybe we 
can model this on the names used for KerberosPrincipal. Those names are of the 
form [EMAIL PROTECTED] I don't know if the @ is going to be a nuisance. Any 
separator we choose will have escaping problems and @ may be particularly 
annoying to customers who want their authorization ids to be email addresses. 
But here's what it would look like:

# this is a systemWideID
grant principal org.apache.derby.authentication.DatabasePrincipal "fred" ...

# this is a databaseScopedID
grant principal org.apache.derby.authentication.DatabasePrincipal "[EMAIL 
PROTECTED]" ...

# this systemWideID is an email address
grant principal org.apache.derby.authentication.DatabasePrincipal 
"fred@@comcast.net" ...

# this databaseScopedID is an email address
grant principal org.apache.derby.authentication.DatabasePrincipal "fred@@[EMAIL 
PROTECTED]" ...

I think that the create-database privilege should be granted to systemWideIDs 
for the following reasons:

1) The actual database creation today depends on whether we can authenticate 
the systemWideID, not the databaseScopedID.

2) This is a generic privilege which is not bound to a particular database name.

I think that the engine-shutdown privilege is also a systemWideID. So for this 
first release, I think we only need systemWideIDs--although the user guides 
should explain the implications of escaping @.

System privileges
-----------------

                Key: DERBY-2109
                URL: https://issues.apache.org/jira/browse/DERBY-2109
            Project: Derby
         Issue Type: New Feature
         Components: Security
   Affects Versions: 10.3.0.0
           Reporter: Rick Hillegas
            Fix For: 10.3.0.0

        Attachments: systemPrivs.html, systemPrivs.html


Add mechanisms for controlling system-level privileges in Derby. See the 
related email discussion at 
http://article.gmane.org/gmane.comp.apache.db.derby.devel/33151.
The 10.2 GRANT/REVOKE work was a big step forward in making Derby more  secure 
in a client/server configuration. I'd like to plug more client/server security 
holes in 10.3. In particular, I'd like to focus on  authorization issues which 
the ANSI spec doesn't address.
Here are the important issues which came out of the email discussion.
Missing privileges that are above the level of a single database:
- Create Database
- Shutdown all databases
- Shutdown System
Missing privileges specific to a particular database:
- Shutdown that Database
- Encrypt that database
- Upgrade database
- Create (in that Database) Java Plugins (currently  Functions/Procedures, but 
someday Aggregates and VTIs)
Note that 10.2 gave us GRANT/REVOKE control over the following  
database-specific issues, via granting execute privilege to system  procedures:
Jar Handling
Backup Routines
Admin Routines
Import/Export
Property Handling
Check Table
In addition, since 10.0, the privilege of connecting to a database has been 
controlled by two properties (derby.database.fullAccessUsers and 
derby.database.defaultConnectionMode) as described in the security section of 
the Developer's Guide (see 
http://db.apache.org/derby/docs/10.2/devguide/cdevcsecure865818.html).

Reply via email to