Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 65647 invoked from network); 2 Jul 2007 20:58:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 20:58:27 -0000 Received: (qmail 49914 invoked by uid 500); 2 Jul 2007 20:58:28 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 49847 invoked by uid 500); 2 Jul 2007 20:58:28 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 49777 invoked by uid 99); 2 Jul 2007 20:58:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 13:58:28 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 13:58:24 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2B52F1A981A; Mon, 2 Jul 2007 13:58:04 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r552594 - in /db/derby/docs/trunk/src: adminguide/tadminnetservbasic.dita adminguide/tadminnetservcustom.dita devguide/cdevbabejgjd.dita devguide/rdevcsecure871406.dita devguide/rdevcsecure871422.dita devguide/rdevcsecure871439.dita Date: Mon, 02 Jul 2007 20:58:03 -0000 To: derby-commits@db.apache.org From: scotsmatrix@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070702205804.2B52F1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: scotsmatrix Date: Mon Jul 2 13:58:03 2007 New Revision: 552594 URL: http://svn.apache.org/viewvc?view=rev&rev=552594 Log: DERBY-2737: Added documentation to permissions needed to include read/write. Patch submitted by me. Modified: db/derby/docs/trunk/src/adminguide/tadminnetservbasic.dita db/derby/docs/trunk/src/adminguide/tadminnetservcustom.dita db/derby/docs/trunk/src/devguide/cdevbabejgjd.dita db/derby/docs/trunk/src/devguide/rdevcsecure871406.dita db/derby/docs/trunk/src/devguide/rdevcsecure871422.dita db/derby/docs/trunk/src/devguide/rdevcsecure871439.dita Modified: db/derby/docs/trunk/src/adminguide/tadminnetservbasic.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/adminguide/tadminnetservbasic.dita?view=diff&rev=552594&r1=552593&r2=552594 ============================================================================== --- db/derby/docs/trunk/src/adminguide/tadminnetservbasic.dita (original) +++ db/derby/docs/trunk/src/adminguide/tadminnetservbasic.dita Mon Jul 2 13:58:03 2007 @@ -25,64 +25,32 @@ - -

-If you boot the Network Server without specifying a security manager, -the Network Server will install a default Java security manager -enforcing a Basic policy. This happens if you boot the Network Server -as your VM's entry point, e.g.: -

- - +

If you boot the Network Server without specifying a security +manager, the Network Server will install a default Java security manager enforcing +a Basic policy. This happens if you boot the Network Server as your VM's entry +point, e.g.:

java org.apache.derby.drda.NetworkServerControl start ... - - -

-Note that you should run your Network Server -with user authentication enabled. For details on how to enable user authentication, -please see the section titled "Working with user authentication" in the Derby -Developer's Guide. -

- -

-Some of your application code may run as procedures and functions -which you have declared using the CREATE PROCEDURE and CREATE FUNCTION -statements. You will need to add privileged blocks to your declared procedures -and functions if they perform sensitive operations such as file and -network i/o, -classloading, system property reading, etc.. -

- -

-If for some reason you do not want to run your client/server -application under a security manager, you may override the Network -Server's impulse to install a default policy. For details on how to do -this, please see -. -

- -

-Note that the Network Server attempts to install a security manager -only if you boot the server as the entry point of your VM. The Network -Server will not attempt to install a security manager if you start the -server from your application using the programmatic API -described in the following section: -. -

- -

-You will find a Template security policy in the Derby -distribution at -demo/templates/server.policy. Most likely, you will want to -customize this policy. For example, probably you will want to restrict -the server's liberal file i/o permissions which let the server -backup/restore to/from any location in the local file system. For -details on how to customize the Template policy, please see -. -A copy of the Basic policy follows: -

- - +

Note that you should run your Network Server with user authentication +enabled. For details on how to enable user authentication, please see "Working +with user authentication" in the .

Some +of your application code may run as procedures and functions which you have +declared using the CREATE PROCEDURE and CREATE FUNCTION statements. You will +need to add privileged blocks to your declared procedures and functions if +they perform sensitive operations such as file and network i/o, classloading, +system property reading, etc.

If for some reason you do not want +to run your client/server application under a security manager, you may override +the Network Server's impulse to install a default policy. For details, see .

Note that the Network Server +attempts to install a security manager only if you boot the server as the +entry point of your VM. The Network Server will not attempt to install a security +manager if you start the server from your application using the programmatic +API described in the following section: .

You +will find a template security policy in the Derby distribution at demo/templates/server.policy. +Most likely, you will want to customize this policy. For example, probably +you will want to restrict the server's liberal file i/o permissions which +let the server backup/restore to/from any location in the local file system. +For details on how to customize the Template policy, please see . +The following example is a copy of the Basic policy:

grant codeBase "${derby.install.url}derby.jar" { // @@ -91,7 +59,10 @@ permission java.lang.RuntimePermission "createClassLoader"; permission java.util.PropertyPermission "derby.*", "read"; permission java.io.FilePermission "${derby.system.home}","read"; - permission java.io.FilePermission "${derby.system.home}${/}-", "read,write,delete"; + permission java.io.FilePermission "${derby.system.home}${/}-", + "read,write,delete"; + permission java.util.PropertyPermission "derby.storage.jvmInstanceId", + "write"; // // This permission lets you backup and restore databases @@ -112,7 +83,6 @@ // permission java.net.SocketPermission "${derby.security.host}:*", "accept"; }; - -
+
Modified: db/derby/docs/trunk/src/adminguide/tadminnetservcustom.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/adminguide/tadminnetservcustom.dita?view=diff&rev=552594&r1=552593&r2=552594 ============================================================================== --- db/derby/docs/trunk/src/adminguide/tadminnetservcustom.dita (original) +++ db/derby/docs/trunk/src/adminguide/tadminnetservcustom.dita Mon Jul 2 13:58:03 2007 @@ -25,45 +25,31 @@ - -

-The Network Server's Basic security policy is documented in a previous -section of this manual: -. -Most likely, you will want to -customize your own security policy. For example, probably you will want to restrict -the server's liberal file i/o permissions which let the server -backup/restore to/from any location in the local file system. -Customizing the security policy is simple: -

- -
    -
  • A Template policy lives in the Derby distribution at -demo/templates/server.policy. Copy it from this location to -your own file, say myCustomized.policy. All of the following -edits take place in your custom file.
  • -
  • Replace the ${derby.install.url} variable with the location -of the Derby jars in your local file system.
  • -
  • Replace the ${derby.system.home} variable with the location -of your Derby system directory. Alternatively, rather than replacing -this variable, you can simply set the value of the -derby.system.home system property when you boot the server.
  • -
  • Replace the ${derby.security.host} variable with the address of the -network interface on which the server is listening. Note that the -special wildcard address "0.0.0.0" is not understood by -SocketPermission, even though Derby accepts this wildcard as a valid -value for the -h option of the Network Server startup command. If you -must grant blanket permission to this wildcard address, specify -"*" in the policy file, instead.
  • -
  • Refine the file permissions needed by backup/restore, -import/export, and the loading of application jars.
  • -
- -

-A sample, customized policy file follows: -

- - +

The Network Server's Basic security policy is documented in +the secion . Most likely, you +will want to customize your own security policy. For example, you might want +to restrict the server's liberal file i/o permissions which let the server +backup to and restore from any location in the local file system. Customizing +the security policy is simple:

    +
  • A template policy lives in the Derby distribution at demo/templates/server.policy. +Copy the from this location to your own file, say myCustomized.policy. +All of the following edits take place in your custom file.
  • +
  • Replace the ${derby.install.url} variable with the location of +the Derby jars in your local file system.
  • +
  • Replace the ${derby.system.home} variable with the location of +your Derby system directory. Alternatively, rather than replacing this variable, +you can simply set the value of the derby.system.home system property +when you boot the server.
  • +
  • Replace the ${derby.security.host} variable with the address of +the network interface on which the server is listening. Note that the special +wildcard address "0.0.0.0" is not understood by SocketPermission, even though +Derby accepts this wildcard as a valid value for the -h option of the Network +Server startup command. If you must grant blanket permission to this wildcard +address, specify "*" in the policy file.
  • +
  • Refine the file permissions needed by backup/restore, import/export, and +the loading of application jars.
  • +

The following example is a copy of a sample, customized policy file:

+ grant codeBase "file:/usr/local/share/sw/derby/lib/derby.jar" { // @@ -72,7 +58,10 @@ permission java.lang.RuntimePermission "createClassLoader"; permission java.util.PropertyPermission "derby.*", "read"; permission java.io.FilePermission "/usr/local/shoppingCartApp/databases","read"; - permission java.io.FilePermission "/usr/local/shoppingCartApp/databases/-", "read,write,delete"; + permission java.io.FilePermission "/usr/local/shoppingCartApp/databases/-", + "read,write,delete"; + permission java.util.PropertyPermission "derby.storage.jvmInstanceId", + "write"; // // This permission lets a DBA reload the policy file while the server @@ -110,17 +99,9 @@ // permission java.net.SocketPermission "buyCoolStuff.acme.com:*", "accept"; }; - - -

-After customizing the Basic policy, you may bring up the Network -Server as follows: -

- - +

After customizing the Basic policy, you may bring up the +Network Server as follows:

java -Djava.security.manager -Djava.security.policy=/usr/local/shoppingCartApp/lib/myCustomized.policy org.apache.derby.drda.NetworkServerControl start -h localhost - - -
+
Modified: db/derby/docs/trunk/src/devguide/cdevbabejgjd.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/cdevbabejgjd.dita?view=diff&rev=552594&r1=552593&r2=552594 ============================================================================== --- db/derby/docs/trunk/src/devguide/cdevbabejgjd.dita (original) +++ db/derby/docs/trunk/src/devguide/cdevbabejgjd.dita Mon Jul 2 13:58:03 2007 @@ -1,4 +1,5 @@ +