PageBox: servlet running in sandbox on J2EE PageBox

for
support@pagebox.net PageBox: servlet running in sandbox on J2EE Word version of this document Printer-friendly version of this document Cuckoo generated
Rationale FAQ Dev site PHP version Install Security Customization Demo Distributed Application

PageBox for PHP security

Foreword

PageBox for PHP is quite powerful and therefore requires proper security measures.

In this document we focus on the security in an Apache environment.

PageBox security

PageBox doesn't really change the picture: If your server pages have unrestricted access to the server resources and if someone finds the way to add or modify a server page, then the security of the server is compromised.

PageBox for PHP triggers commands to install and remove presentations.

These commands are specified in inflate.pb and delete.pb.

As a bare minimum, define inflate.pb, delete.pb and the commands that you can distribute in Read-Only mode.

You can also enforce the security measures described in the PHP and Apache documentation.

PHP security

Safe mode

If you try using PageBox on an ISP/ASP your inflate and delete commands will probably not work because your ISP has configured PHP in Safe Mode.

From the PHP documentation:

"Safe Mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use Safe Mode for now."

First check if Safe Mode is set with environment.php:

Many functions are restricted or disabled by safe mode. Look in the PHP documentation for their list.

If PHP is used in safe mode, exec() and the other functions executing system programs refuse to start programs that are not in safe_mode_exec_dir .

Therefore you must copy the programs used by inflate.pb and delete.pb in safe_mode_exec_dir.

Note:

On Windows, you need %SYSTEMROOT%\system32\cmd.exe to run batch files.

Repository security

Authentication

With Apache you need to update conf/httpd.conf.

Assuming that you installed the Pagebox repository on D:/Program Files/Apache Group/Apache/htdocs/repository you can use that definition:

<Directory "D:/Program Files/Apache Group/Apache/htdocs/repository">

AuthType Basic

AuthName PageBox

AuthUserFile "D:/Program Files/Apache Group/Apache/PageBox-users.ht"

AuthGroupFile "D:/Program Files/Apache Group/Apache/PageBox-groups.ht"

Require group PageBox

</Directory>

You create and populate D:/Program Files/Apache Group/Apache/PageBox-users.ht with the htpasswd command, for instance:

htpasswd -bc D:/Program Files/Apache Group/Apache/PageBox-users.ht admin admin

htpasswd -b D:/Program Files/Apache Group/Apache/PageBox-users.ht publisher1 publisher

htpasswd -b D:/Program Files/Apache Group/Apache/PageBox-users.ht publisher2 publisher

htpasswd -b D:/Program Files/Apache Group/Apache/PageBox-users.ht subscriber1 subscriber

htpasswd -b D:/Program Files/Apache Group/Apache/PageBox-users.ht subscriber2 subscriber

Then you create D:/Program Files/Apache Group/Apache/PageBox-groups.ht:

PageBox: admin publisher1 publisher2 subscriber1 subscriber2

Thank to the Require group PageBox statement, only users belonging to PageBox group, admin publisher1 publisher2 subscriber1 subscriber2 are allowed to query repository resources.

Restart Apache. Now when you query publisher.php, subscriber.php or admin.php you are displayed this dialog box:

Login dialog.

Enter a valid user and password belonging to PageBox group.

Then you are granted access to repository pages based on adminUser.rep and users.rep content.

See the Customization guide for more information.

Encryption

Without encryption the user and password are send on the wire in clear text.

With Apache,

  1. Install mod_SSL

  2. Configure a server certificate

Contact:support@pagebox.net
©2001 Alexis Grandemange. Last modified .

Version 0.0.2

  • PageBox only downloads supported presentation (whose extension is defined in inflate.pb)

  • Repository locking

  • Repository audit

  • Repository retry on deploy / undeploy (cleanup)

Version 0.0.3

  • Repository allows subscribing a subset of the Repository presentations (select.php and asubscribe.php)

  • Repository supports presentation download (download.php)

  • Repository allows specifying the URL of the presentation documentation

Table of Content
Foreword
PageBox security
PHP security
Safe mode
Repository security
Authentication
Encryption