| 1 |
From: [email protected] Fri Aug 23 11:04:42 2002 |
| 2 |
Return-Path: <[email protected]> |
| 3 |
Delivered-To: [email protected] |
| 4 |
Received: from localhost (localhost [127.0.0.1]) |
| 5 |
by phobos.labs.netnoteinc.com (Postfix) with ESMTP id BED4A44164 |
| 6 |
for <zzzz@localhost>; Fri, 23 Aug 2002 06:03:50 -0400 (EDT) |
| 7 |
Received: from phobos [127.0.0.1] |
| 8 |
by localhost with IMAP (fetchmail-5.9.0) |
| 9 |
for zzzz@localhost (single-drop); Fri, 23 Aug 2002 11:03:50 +0100 (IST) |
| 10 |
Received: from webnote.net (mail.webnote.net [193.120.211.219]) by |
| 11 |
dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g7MJiiZ22036 for |
| 12 |
<[email protected]>; Thu, 22 Aug 2002 20:44:44 +0100 |
| 13 |
Received: from outgoing.securityfocus.com (outgoing2.securityfocus.com |
| 14 |
[66.38.151.26]) by webnote.net (8.9.3/8.9.3) with ESMTP id UAA06503 for |
| 15 |
<[email protected]>; Thu, 22 Aug 2002 20:44:51 +0100 |
| 16 |
Received: from lists.securityfocus.com (lists.securityfocus.com |
| 17 |
[66.38.151.19]) by outgoing.securityfocus.com (Postfix) with QMQP id |
| 18 |
3B4388F353; Thu, 22 Aug 2002 12:41:59 -0600 (MDT) |
| 19 |
Mailing-List: contact [email protected]; run by ezmlm |
| 20 |
Precedence: bulk |
| 21 |
List-Id: <secprog.list-id.securityfocus.com> |
| 22 |
List-Post: <mailto:[email protected]> |
| 23 |
List-Help: <mailto:[email protected]> |
| 24 |
List-Unsubscribe: <mailto:[email protected]> |
| 25 |
List-Subscribe: <mailto:[email protected]> |
| 26 |
Delivered-To: mailing list [email protected] |
| 27 |
Delivered-To: moderator for [email protected] |
| 28 |
Received: (qmail 10062 invoked from network); 22 Aug 2002 17:41:11 -0000 |
| 29 |
Content-Type: text/plain; charset="us-ascii" |
| 30 |
From: Mario Torre <[email protected]> |
| 31 |
To: [email protected] |
| 32 |
Subject: Encryption approach to secure web applications |
| 33 |
Date: Thu, 22 Aug 2002 20:15:15 +0200 |
| 34 |
User-Agent: KMail/1.4.1 |
| 35 |
MIME-Version: 1.0 |
| 36 |
Message-Id: <[email protected]> |
| 37 |
Content-Transfer-Encoding: 8bit |
| 38 |
X-MIME-Autoconverted: from quoted-printable to 8bit by dogma.slashnull.org |
| 39 |
id g7MJiiZ22036 |
| 40 |
|
| 41 |
Hi everybody! |
| 42 |
|
| 43 |
I'm writing a web application in java (tomcat + jsp/servlets + database |
| 44 |
access with postgreSQL). |
| 45 |
|
| 46 |
This will be released under the GPL and will eventually be useful as a |
| 47 |
framework for other web applications. |
| 48 |
|
| 49 |
The application main focus is e-commerce, but not limited to that. |
| 50 |
|
| 51 |
I would like to use some form of cryptography to protect data on the |
| 52 |
database, but I have some problem figuring out the right approach. |
| 53 |
|
| 54 |
Above all, how to store passwords and keys in a shared web server. |
| 55 |
|
| 56 |
A problem that I was unable to solve is how to store keys for |
| 57 |
encryption/decryption. The api that I'm using is the jca (jdk1.4.x), |
| 58 |
and the methods of saving generated keys in keystores fails always. |
| 59 |
|
| 60 |
I can serialize the object, and store in the database, but this is not |
| 61 |
the most secure approach: this key is needed to decrypt data in the |
| 62 |
database, but the database is accessible from the web application. |
| 63 |
Assuming that I can find a good and secure place where to store the |
| 64 |
database password, I can use a different database with different |
| 65 |
user... Argh... to complex and doesn't really solve the problem. |
| 66 |
|
| 67 |
Where I can found good documentation about this topic? |
| 68 |
|
| 69 |
There is another approach that I would share with the list, something I |
| 70 |
thought that can be of bit interest, but probabily wrong and insecure. |
| 71 |
After all, I'm a real beginner in secure programming, and I'm here to |
| 72 |
learn methods and technics. |
| 73 |
|
| 74 |
First of all, I need a secure way to keep database passwords secure, so |
| 75 |
I have to keep them separate from the main server. The right approach |
| 76 |
could be using a small java bean application that run as normal user |
| 77 |
(not tomcat, so it is not shared with other web services or, worst, the |
| 78 |
nobody user), that has no shell login, but has a default home directory |
| 79 |
or a place where it can hold passwords and keys. |
| 80 |
|
| 81 |
The web application could then open an ssl connection (could be done in |
| 82 |
the init method at server startup) to get database passwords. The small |
| 83 |
bean could check via code signature/rmi/whatever else that the source |
| 84 |
is the right one, and handle all the database connections, or give the |
| 85 |
db connection/password to the main web application. |
| 86 |
|
| 87 |
In this way, we solve the problem of keeping the keys and passwords in |
| 88 |
shared directories, and also, an attacker should get root/bean user |
| 89 |
account to read data. This is not perfect, and works only if your |
| 90 |
provider gives the opportunity to configure a separated java |
| 91 |
application (that means, really, another server running in the |
| 92 |
background). |
| 93 |
|
| 94 |
Any suggestions? |
| 95 |
|
| 96 |
Thank you, |
| 97 |
Mario Torre |
| 98 |
-- |
| 99 |
Please avoid sending me Word or PowerPoint attachments. |
| 100 |
See http://www.fsf.org/philosophy/no-word-attachments.html |
| 101 |
|