geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Cai (JIRA)" <>
Subject [jira] Commented: (GERONIMO-3003) Encrypt password strings in deployment plans
Date Wed, 29 Jul 2009 02:50:15 GMT


Jack Cai commented on GERONIMO-3003:

Thanks Ivan, Kevan and David!

I think it makes good sense to simply store encrypted values in GBeanOverride. I reviewed
David's revised patch and suggest to add the below lines to the patch so that GBeanOverride.applyOverride()
will encrypt attribute values which are not encrypted in config.xml but should be encrypted.
This is to handle scenarios in which users change a password in config.xml and want it get
encrypted when the server writes back to config.xml.

@@ -357,6 +402,19 @@
             String valueString = entry.getValue();
             Object value = getValue(attributeInfo, valueString, configName, gbeanName, classLoader);
+            /*
+             * Make sure encrypted attributes are encrypted even if they are in
+             * plain text originally.
+             */
+            if (valueString != null
+                    && attributeInfo.getEncryptedSetting() == EncryptionSetting.ENCRYPTED)
+                String decryptedValue = (String) attributeInfo
+                        .getEncryptedSetting().decrypt(valueString);
+                if (valueString.equals(decryptedValue)) {
+                    entry.setValue(attributeInfo.getEncryptedSetting().encrypt(
+                            valueString));
+                }
+            }
             data.setAttribute(attributeName, value);

> Encrypt password strings in deployment plans
> --------------------------------------------
>                 Key: GERONIMO-3003
>                 URL:
>             Project: Geronimo
>          Issue Type: Improvement
>      Security Level: public(Regular issues) 
>          Components: deployment
>    Affects Versions: Wish List
>            Reporter: Aman Nanner
>            Priority: Minor
>             Fix For: Wish List
>         Attachments: GERONIMO-3003-2.2-2.patch, GERONIMO-3003.patch, GERONIMO-3003_21.patch
> Geronimo currently has a feature where password strings in the config.xml get encrypted
using the {{org.apache.geronimo.util.EncryptionManager}}.  This encryption is performed in
the {{org.apache.geronimo.system.configuration.GBeanOverride}} class.
> It would be desirable to have the same encryption applied to the password strings in
deployment plans (e.g. datasource or JMS deployment plans within an EAR).  Even though the
plans are only used during the deployment process, and not at runtime, the plans are left
with plaintext password strings sitting in them.  It would be nice if the deployment process
could internally encrypt the strings and then write back out the deployment plan to the file
system.  Also, this means that the deployment process will require the ability to decrypt
strings that are already in encrypted format in the plan (in the case of redeployment, for
> More discussion of this feature can be found in the following mailing list thread:
> I would suggest that an appropriate spot to perform the encryption is in the {{org.apache.geronimo.j2ee.deployment.EARConfigBuilder}}
class, perhaps in the following code just before the file is written to a temporary file:
> ----
>                     if (gerModule.isSetAltDd()) {
>                         // the the url of the alt dd
>                         try {
>                             altVendorDDs.put(path, DeploymentUtil.toTempFile(earFile,
>                         } catch (IOException e) {
>                             throw new DeploymentException("Invalid alt vendor dd url:
" + gerModule.getAltDd().getStringValue(), e);
>                         }
> ----
> However, somebody more familiar with the design might be able to suggest a better solution.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message