You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by kimhorn <ki...@icsglobal.net> on 2009/04/01 09:30:34 UTC

Can VFS SFTP Passwords be encrypted

For security no applications, specially scripts, should have passwords kept
in clear text. Currently we encrypt all passwords in Synapse.xml files and
use a Java Class Mediator to decrypt them and to place them in the SOAP or
message context Transport.

However STFP and VFS Proxy and endpoint pose a problem and I cannot see how
they can be used
without exposing the password in clear text:

  <proxy name="StockQuoteProxy" transports="vfs">
	  <parameter
name="transport.vfs.FileURI">vfs:sftp://myusername:mypassword@somehost/home/download?vfs.passive=true</parameter>
  .............
</proxy>
   

<send>
   <endpoint>
      <address
uri="vfs:sftp://myusername:mypassword@somehost/home/upload?vfs.passive=true"/>
   </endpoint>
</send>


This suggests many problems with VFS:
- How can an encrypted password alone be used and unencrypted .
- If not the password then encrypt the whole parameter 'name' How can the
VFS proxy parameter name be set from a property, or registry entry.
- Where then can Java can be used to decrypt it.
- How could the property be set prior to Proxy invocation ? ( a start up
script approach is required. task ?). Maybe like the DataBase info VFS stuff
can be placed in start up properties file.

Any suggestions to make the synapse secure ?


Thanks
Kim



-- 
View this message in context: http://www.nabble.com/Can-VFS-SFTP-Passwords-be-encrypted-tp22821249p22821249.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Proposal to make Mediators more flexible

Posted by Kim Horn <ki...@icsglobal.net>.
No the main point is that "parameters" should be like variables, open to
being set by the program, rather than being fixed as text only in a
Synapse Script. This is a general problem with Synapse language. Below
suggest a new way to set up Mediators that makes Synapse more flexible
and a General password container solution for Synapse.

Re your specific point:
In most B2B cases in our industry today, SFTP is set by external
partners that can only give you a username and password.
So we have to use this mechanism; using keys would not be feasible.

Passwords exposed as text is also a serious security fault with the
synapse database stuff too. 
<pool>
        <driver>org.apache.derby.jdbc.ClientDriver</driver>
        <url>jdbc:derby://localhost:1527/synapsedb;create=false</url>
        <user>synapse</user>
        <password>synapse</password>
</pool>

For example, In OpenESB using the database and SFTP components a
password is hidden by "*****" when entered; I am suggesting a similar
thing; but in the synapse script the text for the password is an
encrypted one.

The above synapse code for <pool> introduces a yet another language
mechanism; why do some mediators have "parameters", some "properties"
and others just random "tags".  Seems like the Synapse "language" is out
of control. All of these should be open to being set by the script.
Solution suggested below.

Our solution now is to place all the VFS stuff and all Data base stuff
in Java Class Mediators, where the passwords can be encrypted; As the
Synapse mediators are not open to script manipulation. However this
defeats the purpose of Synapse; as we are now just writing a big Java
program held together with a few lines of Synapse script that make no
sense at all. 

Seems to me, writing an FTP to Web Service mediator for a "real" world
application is way beyond Synapse at the moment.

A General Proposal is that All passwords for use anywhere in Synapse can
be stored somewhere (registry ?) where they are
Encrypted and then Synapse knows how to decrypt them (a configured seed)
then inject them into the particular mediator service; The services
should include:
- SFTP
- database
- filesystem
- java code
- WS-Security
- In Soap Message
- In Transport Header

Currently we do this for WS-security and Transport using a custom class
mediators; that injects the decrypted password; but the mechanisms, in
Synapse, are not in place for the others and for VFS there is no Payload
to enter the username. So for these you see:

   <property name="Username" value="kim"/>
    <property name="Password" value="JZVmXIledfq9jBmwFZb0Aw=="/>
    <class name="net.icsglobal.thelma.synapse.ThelmaWebAuth"/>

- to do basic auth in Transport

OR
    <class name="net.icsglobal.thelma.synapse.ThelmaWSSAuth"/>

- to do WS-Security

An alternative idea for SFTP / VFS is to introduce the concept of a
"payload" or XML property that is configured prior to polling the SFTP
server. The payload is an XML message containing all Parameters for SFTP
via VFS. In this way the payload can be mediated and changed by scripts
prior to calling VFS.... In this way an encrypted password can be
injected via a class mediator.

A more general solution is that every mediator has an XML property added
to the messageContext for its control.
Each mediator can be called using its XML element (property) that is
open to program manipulation just like any other part of the
messageContext. So for VFS have all of this in a property, a piece of
data:

<VFSMediatorParameters>
    <mediatorID>KimsVFS-1</mediatorID>
    <transport>SFTP</ transport>
    <contentType>text/plain</contentType >
    <fileNamePattern">.*837</ fileNamePattern >
    <pollInterval>15</pollInterval>
    <username>kim</username>
    <password>fgfuASFDf124dj</password>
</VFSParameters>

The ID=KimsVFS-1 maps the xml data to the synapse script; like the use
of keys.

So could call VFS like:

<proxy name="getSFTPData from Fred" type="VFS" key="KimsVFS-1">

The above <VFSMediatorParameters> are set up prior to call and added to
messageContext.

This solution removes the many different and weird language elements in
synapse for setting up mediators; Just have one; an XML structure in a
property of the messageContext. This makes Synapse massively more
flexible. The current approach with many parameters, properties and tags
could just map these to an XML structure above if users wanted to do it
the current way.


Kim



-----Original Message-----
From: Jaeger, Jay - DOT [mailto:Jay.Jaeger@dot.wi.gov] 
Sent: Thursday, 2 April 2009 12:55 AM
To: 'user@synapse.apache.org'
Subject: RE: Can VFS SFTP Passwords be encrypted

A suggestion.  SFTP can use PKI shared keys for authentication.  The
keys are host+user specific.

I am not familiar enough with Synapse to know exactly how you'd go about
it, but I do suggest that the answer lies in using PKI.

JRJ

-----Original Message-----
From: kimhorn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, April 01, 2009 2:31 AM
To: user@synapse.apache.org
Subject: Can VFS SFTP Passwords be encrypted



For security no applications, specially scripts, should have passwords
kept
in clear text. Currently we encrypt all passwords in Synapse.xml files
and
use a Java Class Mediator to decrypt them and to place them in the SOAP
or
message context Transport.

However STFP and VFS Proxy and endpoint pose a problem and I cannot see
how
they can be used
without exposing the password in clear text:

  <proxy name="StockQuoteProxy" transports="vfs">
          <parameter
name="transport.vfs.FileURI">vfs:sftp://myusername:mypassword@somehost/h
ome/download?vfs.passive=true</parameter>
  .............
</proxy>


<send>
   <endpoint>
      <address
uri="vfs:sftp://myusername:mypassword@somehost/home/upload?vfs.passive=t
rue"/>
   </endpoint>
</send>


This suggests many problems with VFS:
- How can an encrypted password alone be used and unencrypted .
- If not the password then encrypt the whole parameter 'name' How can
the
VFS proxy parameter name be set from a property, or registry entry.
- Where then can Java can be used to decrypt it.
- How could the property be set prior to Proxy invocation ? ( a start up
script approach is required. task ?). Maybe like the DataBase info VFS
stuff
can be placed in start up properties file.

Any suggestions to make the synapse secure ?


Thanks
Kim



--
View this message in context:
http://www.nabble.com/Can-VFS-SFTP-Passwords-be-encrypted-tp22821249p228
21249.html
Sent from the Synapse - User mailing list archive at Nabble.com.


RE: Can VFS SFTP Passwords be encrypted

Posted by "Jaeger, Jay - DOT" <Ja...@dot.wi.gov>.
        Who uses FTP anymore ?

You'd be amazed -- and very afraid.  8^)

JRJ

-----Original Message-----
From: Kim Horn [mailto:kim.horn@icsglobal.net]
Sent: Friday, April 03, 2009 12:27 AM
To: user@synapse.apache.org
Subject: RE: Can VFS SFTP Passwords be encrypted


No this is SFTP. Not clear text :-) Sorry just use FTP now days to mean
SFTP.
Who uses FTP anymore ?



-----Original Message-----
From: Jaeger, Jay - DOT [mailto:Jay.Jaeger@dot.wi.gov]
Sent: Friday, 3 April 2009 12:26 AM
To: 'user@synapse.apache.org'
Subject: RE: Can VFS SFTP Passwords be encrypted

I find the notion of going to great lengths to protect FTP passwords
aside from reasonable precautions like good ACLs to prevent widespread
access to the files somewhat "amusing" given the fact that FTP sends its
passwords in CLEAR TEXT.  Anyone at any ISP along the way can see those
passwords, unless you tunnel the FTP inside a VPN.

Actually what I am seeing more and more in the "real world" is the use
of FTP over SSH.  This is a Good Thing (TM).

JRJ

-----Original Message-----
From: Kim Horn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, April 01, 2009 5:34 PM
To: user@synapse.apache.org
Subject: RE: Can VFS SFTP Passwords be encrypted


It may, we are given simple text passwords by systems we have to
interface too. FTP is still the largest B2B mechanism in the US :-). We
cannot ask them to supply us anything else but a simple
username/password; this is the reality of B2B.  The only issue we have
is that these are not kept in clear text in script files. In our domain
this is illegal and in all other domains bad practise.  So all we
require is to be able to have these encrypted in any script files. I
think this Jira suggests a stronger mechanism, sharing keys between SFTP
servers, but is totally impractical in real world B2B.


Kim

-----Original Message-----
From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
Asankha C. Perera
Sent: Thursday, 2 April 2009 3:48 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

Hi Jay / Kim
> A suggestion.  SFTP can use PKI shared keys for authentication.  The
keys are host+user specific.
>
> I am not familiar enough with Synapse to know exactly how you'd go
about it, but I do suggest that the answer lies in using PKI.
>
I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
solution for this.. and possibly we could already tweak VFS to do this..

cheers
asankhaa

--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
No this is SFTP. Not clear text :-) Sorry just use FTP now days to mean
SFTP.
Who uses FTP anymore ?



-----Original Message-----
From: Jaeger, Jay - DOT [mailto:Jay.Jaeger@dot.wi.gov] 
Sent: Friday, 3 April 2009 12:26 AM
To: 'user@synapse.apache.org'
Subject: RE: Can VFS SFTP Passwords be encrypted

I find the notion of going to great lengths to protect FTP passwords
aside from reasonable precautions like good ACLs to prevent widespread
access to the files somewhat "amusing" given the fact that FTP sends its
passwords in CLEAR TEXT.  Anyone at any ISP along the way can see those
passwords, unless you tunnel the FTP inside a VPN.

Actually what I am seeing more and more in the "real world" is the use
of FTP over SSH.  This is a Good Thing (TM).

JRJ

-----Original Message-----
From: Kim Horn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, April 01, 2009 5:34 PM
To: user@synapse.apache.org
Subject: RE: Can VFS SFTP Passwords be encrypted


It may, we are given simple text passwords by systems we have to
interface too. FTP is still the largest B2B mechanism in the US :-). We
cannot ask them to supply us anything else but a simple
username/password; this is the reality of B2B.  The only issue we have
is that these are not kept in clear text in script files. In our domain
this is illegal and in all other domains bad practise.  So all we
require is to be able to have these encrypted in any script files. I
think this Jira suggests a stronger mechanism, sharing keys between SFTP
servers, but is totally impractical in real world B2B.


Kim

-----Original Message-----
From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
Asankha C. Perera
Sent: Thursday, 2 April 2009 3:48 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

Hi Jay / Kim
> A suggestion.  SFTP can use PKI shared keys for authentication.  The
keys are host+user specific.
>
> I am not familiar enough with Synapse to know exactly how you'd go
about it, but I do suggest that the answer lies in using PKI.
>
I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
solution for this.. and possibly we could already tweak VFS to do this..

cheers
asankhaa

--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Can VFS SFTP Passwords be encrypted

Posted by indika kumara <in...@gmail.com>.
Hi Andreas

This should  possible with only changes in VFS transport. But after 8
or 7 in this month , I will not available until 28th . I will move
document to some visible place.

Thanks
Inidka

On Fri, Apr 3, 2009 at 12:24 AM, Andreas Veithen
<an...@gmail.com> wrote:
> I agree that it should be possible to use all Synapse features without
> having to store cleartext passwords in the config files (and without
> having them appear in log files).
>
> Just some random ideas about this topic:
>
> * Indika implemented a mechanism for exactly this, but for the moment
> this is limited to data sources. There is some documentation about
> this feature, but it is somewhat hidden in the Sample Setup guide. We
> should have this documentation in a more prominent place. Maybe as a
> subsection in the new Deployment guide?
>
> * As an alternative to usernames and passwords encoded in URLs,
> Commons VFS supports authentication by passing a
> org.apache.commons.vfs.UserAuthenticator object to the file system
> provider. Maybe we should define a property in the message context to
> allow to pass such an object to the transport. Alternatively we could
> write an adapter so that we can handle e.g. HTTPS and VFS
> authentication in the same way.
>
> * We should then have a mediator that builds the UserAuthenticator
> using the password encryption mechanisms implemented by Indika.
>
> Any thoughts?
>
> Andreas
>
> On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
>> It may, we are given simple text passwords by systems we have to
>> interface too. FTP is still the largest B2B mechanism in the US :-). We
>> cannot ask them to supply us anything else but a simple
>> username/password; this is the reality of B2B.  The only issue we have
>> is that these are not kept in clear text in script files. In our domain
>> this is illegal and in all other domains bad practise.  So all we
>> require is to be able to have these encrypted in any script files. I
>> think this Jira suggests a stronger mechanism, sharing keys between SFTP
>> servers, but is totally impractical in real world B2B.
>>
>>
>> Kim
>>
>> -----Original Message-----
>> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
>> Asankha C. Perera
>> Sent: Thursday, 2 April 2009 3:48 AM
>> To: user@synapse.apache.org
>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>
>> Hi Jay / Kim
>>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
>> keys are host+user specific.
>>>
>>> I am not familiar enough with Synapse to know exactly how you'd go
>> about it, but I do suggest that the answer lies in using PKI.
>>>
>> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
>> solution for this.. and possibly we could already tweak VFS to do this..
>>
>> cheers
>> asankhaa
>>
>> --
>> Asankha C. Perera
>> AdroitLogic, http://adroitlogic.org
>>
>> http://esbmagic.blogspot.com
>>
>>
>>
>>
>>
>

RE: Can VFS SFTP Passwords be encrypted

Posted by "Hubert, Eric" <Er...@foxmobile.com>.
> I agree that it should be possible to use all Synapse features without
> having to store cleartext passwords in the config files (and without
> having them appear in log files).
Me too. :-)
 
> Just some random ideas about this topic:
> 
> * Indika implemented a mechanism for exactly this, but for the moment
> this is limited to data sources. There is some documentation about
> this feature, but it is somewhat hidden in the Sample Setup guide. We
> should have this documentation in a more prominent place. Maybe as a
> subsection in the new Deployment guide?
+1
I did not find the time, but my idea was to build on Idika's work when it comes to the JMX authentication stuff as well. But Andreas seems to have been one step further (he is at least aware of the documentation section). ;-) Thanks for the hint! I will look into this before I explore the code.
Anyway it is still on my todo-list to have a look at what Indika implemented and try to reuse it for that aspect.

Regards,
   Eric

RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
Sounds good. I will look into Indika. At the moment we have a class mediator that calls our own decrypt algorithms to decrypt a string. We place the encrypted strings in Synapse.xml. So we have a tool to create these strings.

One "easy" approach maybe to have the VFS and DataBase mediators use same approach. Have a <username> and a <password> tag; but also a <decrypt-class> tag and a published interface. When this is present it calls the class for a specific getter that does the decryption. The user can configure any approach in that class as long as they code to the interface.

So for VFS it would have to rebuild the URL for FTP from the elements. So would need added VFS tags for server address and file path etc.. I note that the VFS class for SFTP Factory, does all the URL bits separately anyhow.

Maybe this is same as the org.apache.commons.vfs.UserAuthenticator I will have a look at that...


Kim




-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com] 
Sent: Friday, 3 April 2009 5:54 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

I agree that it should be possible to use all Synapse features without
having to store cleartext passwords in the config files (and without
having them appear in log files).

Just some random ideas about this topic:

* Indika implemented a mechanism for exactly this, but for the moment
this is limited to data sources. There is some documentation about
this feature, but it is somewhat hidden in the Sample Setup guide. We
should have this documentation in a more prominent place. Maybe as a
subsection in the new Deployment guide?

* As an alternative to usernames and passwords encoded in URLs,
Commons VFS supports authentication by passing a
org.apache.commons.vfs.UserAuthenticator object to the file system
provider. Maybe we should define a property in the message context to
allow to pass such an object to the transport. Alternatively we could
write an adapter so that we can handle e.g. HTTPS and VFS
authentication in the same way.

* We should then have a mediator that builds the UserAuthenticator
using the password encryption mechanisms implemented by Indika.

Any thoughts?

Andreas

On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
> It may, we are given simple text passwords by systems we have to
> interface too. FTP is still the largest B2B mechanism in the US :-). We
> cannot ask them to supply us anything else but a simple
> username/password; this is the reality of B2B.  The only issue we have
> is that these are not kept in clear text in script files. In our domain
> this is illegal and in all other domains bad practise.  So all we
> require is to be able to have these encrypted in any script files. I
> think this Jira suggests a stronger mechanism, sharing keys between SFTP
> servers, but is totally impractical in real world B2B.
>
>
> Kim
>
> -----Original Message-----
> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
> Asankha C. Perera
> Sent: Thursday, 2 April 2009 3:48 AM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> Hi Jay / Kim
>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
> keys are host+user specific.
>>
>> I am not familiar enough with Synapse to know exactly how you'd go
> about it, but I do suggest that the answer lies in using PKI.
>>
> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
> solution for this.. and possibly we could already tweak VFS to do this..
>
> cheers
> asankhaa
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
Hello Indika,

That fine, thanks very much for that.

Kim

-----Original Message-----
From: indika kumara [mailto:indika.kuma@gmail.com] 
Sent: Monday, 6 April 2009 3:44 PM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

Hi

I feel your requirements are wide. I feel I will not have enough time.
I just put how to use what I did to get secure passwords. You have to
incorporate these changes into what you have done. I am sorry; I will
not have time to do these for this release to cater each requirement
of you. But, I will definitely do this for next release.
I hope following will help.
Please Note: You have to follow - Synapse_Samples_Setup.html under
section Securing Password and Setting up Synapse DataSources

VFS listener case

<parameter name="transport.vfs.password>alias password</parameter>
<parameter name="transport.vfs.passwordProvider>org.apache.synapse.security.secret.handler.SecretManagerSecretCallbackHandler
</parameter>

And considering that above two properties has been resolved and create
an instance of SecretCallbackHandler as bellow.

SecretCallbackHandler passwordProvider  =
SecretCallbackHandlerFactorycreateSecretCallbackHandler(provider);

Then the method similar to flowing (method is from
'DataSourceInformation.java') , can be used to get actual password.

/**
     * Get actual password based on SecretCallbackHandler and alias password
     * If SecretCallbackHandler is null, then returns alias password
     * @return  Actual password
     */
    public String getResolvedPassword() {

        if (passwordProvider != null) {
            if (aliasPassword != null && !"".equals(aliasPassword)) {

                SecretLoadingModule secretLoadingModule = new
SecretLoadingModule();
                secretLoadingModule.init(new
SecretCallbackHandler[]{passwordProvider});
                SingleSecretCallback secretCallback =
                        new
SingleSecretCallback(DataSourceConfigurationConstants.PROMPT,
                                aliasPassword);
                SecretCallback[] secretCallbacks = new
SecretCallback[]{secretCallback};
                secretLoadingModule.load(secretCallbacks);
                return secretCallback.getSecret();
            }
        }
        return aliasPassword;
    }



To resolved many passwords, it can be used logic something similar to
bellow(This code from 'SecretManager.java').

       String identityStorePass;
        String identityKeyPass;
        String trustStorePass;

        // Creating required password class backs
        SingleSecretCallback trustStorePassSecretCallback
                = new SingleSecretCallback(TRUSTSTORE_PASSWORD_PROMPT,
                TRUSTSTORE_PASSWORD_ID);
        SingleSecretCallback identityStorePassSecretCallback
                = new SingleSecretCallback(IDENTITYSTORE_PASSWORD_PROMPT,
                IDENTITYSTORE_PASSWORD_ID);
        SingleSecretCallback identityKeyPassSecretCallback
                = new
SingleSecretCallback(IDENTITYSTORE_PRIVATE_KEY_PASSWORD_PROMPT,
                IDENTITYSTORE_PRIVATE_KEY_PASSWORD_ID);

        // Group all as a one callback
        MultiSecretCallback callback = new MultiSecretCallback();
        callback.addSecretCallback(trustStorePassSecretCallback);
        callback.addSecretCallback(identityStorePassSecretCallback);
        callback.addSecretCallback(identityKeyPassSecretCallback);
        SecretCallback[] secretCallbacks = new SecretCallback[]{callback};

        // Create and initiating SecretLoadingModule
        SecretLoadingModule secretLoadingModule = new SecretLoadingModule();
        secretLoadingModule.init(new
SecretCallbackHandler[]{secretCallbackHandler});

        //load passwords
        secretLoadingModule.load(secretCallbacks);

        identityKeyPass = identityKeyPassSecretCallback.getSecret();
        identityStorePass = identityStorePassSecretCallback.getSecret();
        trustStorePass = trustStorePassSecretCallback.getSecret();


Thanks
Indika


On Mon, Apr 6, 2009 at 10:04 AM, Kim Horn <ki...@icsglobal.net> wrote:
> OK that would be great, note we are also doing it using a class mediator for HTTP Transport and WS_Security.
>
> Thanks
> Kim
>
> -----Original Message-----
> From: indika kumara [mailto:indika.kuma@gmail.com]
> Sent: Monday, 6 April 2009 2:24 PM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> How to secure password in data sources is in document -
> Synapse_Samples_Setup.html under section Securing Password and Setting
> up Synapse DataSources . I will try to add this to VFS too.
>
> Indika
>
> On Mon, Apr 6, 2009 at 7:28 AM, Kim Horn <ki...@icsglobal.net> wrote:
>> Are these security fixes for Data source going into 1.3 ?
>> If not then an interim hack really needs to be done; we just cannot use Synapse at all with passwords in Clear Text.
>> Suggestions:
>>
>> 1) Implement an interface that does de-cryption; so user can supply
>> Their own code whatever that is. So specify a decrypt method that takes a string and returns a string.
>>
>> 2) To fix Data sources add a parameter:
>> <decryption-class>class-Name</ decryption-class>
>> - this takes the supplied password in current <password> tag and gets the decrypted password from class above.
>>
>> 3) To fix VFS need to supply new set of URL options:
>>  <host-path>host-name:port/path</host-path>
>>  <user>synapse</user>
>>  <password>encrypted-password</password>
>>  <decryption-class>class-Name</ decryption-class>
>>
>> - given the above the current <parameter name="transport.vfs.FileURI"> can be built.
>> To be consistent with the strange VFS parameters the above can be changed to something like:
>>
>>  <parameter name="transport.vfs.hostPath>host-name:port/path</parameter>
>>  <parameter name="transport.vfs.user>username</parameter>
>>  <parameter name="transport.vfs.password>encrypted-password</parameter>
>>  <parameter name="transport.vfs.decryptionClass>class-Name</parameter>
>>
>>
>> If people agree to this I will create a Jira and start to do the work.
>>
>>
>> Kim
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
>> Sent: Friday, 3 April 2009 5:54 AM
>> To: user@synapse.apache.org
>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>
>> I agree that it should be possible to use all Synapse features without
>> having to store cleartext passwords in the config files (and without
>> having them appear in log files).
>>
>> Just some random ideas about this topic:
>>
>> * Indika implemented a mechanism for exactly this, but for the moment
>> this is limited to data sources. There is some documentation about
>> this feature, but it is somewhat hidden in the Sample Setup guide. We
>> should have this documentation in a more prominent place. Maybe as a
>> subsection in the new Deployment guide?
>>
>> * As an alternative to usernames and passwords encoded in URLs,
>> Commons VFS supports authentication by passing a
>> org.apache.commons.vfs.UserAuthenticator object to the file system
>> provider. Maybe we should define a property in the message context to
>> allow to pass such an object to the transport. Alternatively we could
>> write an adapter so that we can handle e.g. HTTPS and VFS
>> authentication in the same way.
>>
>> * We should then have a mediator that builds the UserAuthenticator
>> using the password encryption mechanisms implemented by Indika.
>>
>> Any thoughts?
>>
>> Andreas
>>
>> On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
>>> It may, we are given simple text passwords by systems we have to
>>> interface too. FTP is still the largest B2B mechanism in the US :-). We
>>> cannot ask them to supply us anything else but a simple
>>> username/password; this is the reality of B2B.  The only issue we have
>>> is that these are not kept in clear text in script files. In our domain
>>> this is illegal and in all other domains bad practise.  So all we
>>> require is to be able to have these encrypted in any script files. I
>>> think this Jira suggests a stronger mechanism, sharing keys between SFTP
>>> servers, but is totally impractical in real world B2B.
>>>
>>>
>>> Kim
>>>
>>> -----Original Message-----
>>> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
>>> Asankha C. Perera
>>> Sent: Thursday, 2 April 2009 3:48 AM
>>> To: user@synapse.apache.org
>>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>>
>>> Hi Jay / Kim
>>>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
>>> keys are host+user specific.
>>>>
>>>> I am not familiar enough with Synapse to know exactly how you'd go
>>> about it, but I do suggest that the answer lies in using PKI.
>>>>
>>> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
>>> solution for this.. and possibly we could already tweak VFS to do this..
>>>
>>> cheers
>>> asankhaa
>>>
>>> --
>>> Asankha C. Perera
>>> AdroitLogic, http://adroitlogic.org
>>>
>>> http://esbmagic.blogspot.com
>>>
>>>
>>>
>>>
>>>
>>
>

Re: Can VFS SFTP Passwords be encrypted

Posted by indika kumara <in...@gmail.com>.
Hi

I feel your requirements are wide. I feel I will not have enough time.
I just put how to use what I did to get secure passwords. You have to
incorporate these changes into what you have done. I am sorry; I will
not have time to do these for this release to cater each requirement
of you. But, I will definitely do this for next release.
I hope following will help.
Please Note: You have to follow - Synapse_Samples_Setup.html under
section Securing Password and Setting up Synapse DataSources

VFS listener case

<parameter name="transport.vfs.password>alias password</parameter>
<parameter name="transport.vfs.passwordProvider>org.apache.synapse.security.secret.handler.SecretManagerSecretCallbackHandler
</parameter>

And considering that above two properties has been resolved and create
an instance of SecretCallbackHandler as bellow.

SecretCallbackHandler passwordProvider  =
SecretCallbackHandlerFactorycreateSecretCallbackHandler(provider);

Then the method similar to flowing (method is from
‘DataSourceInformation.java’) , can be used to get actual password.

/**
     * Get actual password based on SecretCallbackHandler and alias password
     * If SecretCallbackHandler is null, then returns alias password
     * @return  Actual password
     */
    public String getResolvedPassword() {

        if (passwordProvider != null) {
            if (aliasPassword != null && !"".equals(aliasPassword)) {

                SecretLoadingModule secretLoadingModule = new
SecretLoadingModule();
                secretLoadingModule.init(new
SecretCallbackHandler[]{passwordProvider});
                SingleSecretCallback secretCallback =
                        new
SingleSecretCallback(DataSourceConfigurationConstants.PROMPT,
                                aliasPassword);
                SecretCallback[] secretCallbacks = new
SecretCallback[]{secretCallback};
                secretLoadingModule.load(secretCallbacks);
                return secretCallback.getSecret();
            }
        }
        return aliasPassword;
    }



To resolved many passwords, it can be used logic something similar to
bellow(This code from ‘SecretManager.java’).

       String identityStorePass;
        String identityKeyPass;
        String trustStorePass;

        // Creating required password class backs
        SingleSecretCallback trustStorePassSecretCallback
                = new SingleSecretCallback(TRUSTSTORE_PASSWORD_PROMPT,
                TRUSTSTORE_PASSWORD_ID);
        SingleSecretCallback identityStorePassSecretCallback
                = new SingleSecretCallback(IDENTITYSTORE_PASSWORD_PROMPT,
                IDENTITYSTORE_PASSWORD_ID);
        SingleSecretCallback identityKeyPassSecretCallback
                = new
SingleSecretCallback(IDENTITYSTORE_PRIVATE_KEY_PASSWORD_PROMPT,
                IDENTITYSTORE_PRIVATE_KEY_PASSWORD_ID);

        // Group all as a one callback
        MultiSecretCallback callback = new MultiSecretCallback();
        callback.addSecretCallback(trustStorePassSecretCallback);
        callback.addSecretCallback(identityStorePassSecretCallback);
        callback.addSecretCallback(identityKeyPassSecretCallback);
        SecretCallback[] secretCallbacks = new SecretCallback[]{callback};

        // Create and initiating SecretLoadingModule
        SecretLoadingModule secretLoadingModule = new SecretLoadingModule();
        secretLoadingModule.init(new
SecretCallbackHandler[]{secretCallbackHandler});

        //load passwords
        secretLoadingModule.load(secretCallbacks);

        identityKeyPass = identityKeyPassSecretCallback.getSecret();
        identityStorePass = identityStorePassSecretCallback.getSecret();
        trustStorePass = trustStorePassSecretCallback.getSecret();


Thanks
Indika


On Mon, Apr 6, 2009 at 10:04 AM, Kim Horn <ki...@icsglobal.net> wrote:
> OK that would be great, note we are also doing it using a class mediator for HTTP Transport and WS_Security.
>
> Thanks
> Kim
>
> -----Original Message-----
> From: indika kumara [mailto:indika.kuma@gmail.com]
> Sent: Monday, 6 April 2009 2:24 PM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> How to secure password in data sources is in document -
> Synapse_Samples_Setup.html under section Securing Password and Setting
> up Synapse DataSources . I will try to add this to VFS too.
>
> Indika
>
> On Mon, Apr 6, 2009 at 7:28 AM, Kim Horn <ki...@icsglobal.net> wrote:
>> Are these security fixes for Data source going into 1.3 ?
>> If not then an interim hack really needs to be done; we just cannot use Synapse at all with passwords in Clear Text.
>> Suggestions:
>>
>> 1) Implement an interface that does de-cryption; so user can supply
>> Their own code whatever that is. So specify a decrypt method that takes a string and returns a string.
>>
>> 2) To fix Data sources add a parameter:
>> <decryption-class>class-Name</ decryption-class>
>> - this takes the supplied password in current <password> tag and gets the decrypted password from class above.
>>
>> 3) To fix VFS need to supply new set of URL options:
>>  <host-path>host-name:port/path</host-path>
>>  <user>synapse</user>
>>  <password>encrypted-password</password>
>>  <decryption-class>class-Name</ decryption-class>
>>
>> - given the above the current <parameter name="transport.vfs.FileURI"> can be built.
>> To be consistent with the strange VFS parameters the above can be changed to something like:
>>
>>  <parameter name="transport.vfs.hostPath>host-name:port/path</parameter>
>>  <parameter name="transport.vfs.user>username</parameter>
>>  <parameter name="transport.vfs.password>encrypted-password</parameter>
>>  <parameter name="transport.vfs.decryptionClass>class-Name</parameter>
>>
>>
>> If people agree to this I will create a Jira and start to do the work.
>>
>>
>> Kim
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
>> Sent: Friday, 3 April 2009 5:54 AM
>> To: user@synapse.apache.org
>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>
>> I agree that it should be possible to use all Synapse features without
>> having to store cleartext passwords in the config files (and without
>> having them appear in log files).
>>
>> Just some random ideas about this topic:
>>
>> * Indika implemented a mechanism for exactly this, but for the moment
>> this is limited to data sources. There is some documentation about
>> this feature, but it is somewhat hidden in the Sample Setup guide. We
>> should have this documentation in a more prominent place. Maybe as a
>> subsection in the new Deployment guide?
>>
>> * As an alternative to usernames and passwords encoded in URLs,
>> Commons VFS supports authentication by passing a
>> org.apache.commons.vfs.UserAuthenticator object to the file system
>> provider. Maybe we should define a property in the message context to
>> allow to pass such an object to the transport. Alternatively we could
>> write an adapter so that we can handle e.g. HTTPS and VFS
>> authentication in the same way.
>>
>> * We should then have a mediator that builds the UserAuthenticator
>> using the password encryption mechanisms implemented by Indika.
>>
>> Any thoughts?
>>
>> Andreas
>>
>> On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
>>> It may, we are given simple text passwords by systems we have to
>>> interface too. FTP is still the largest B2B mechanism in the US :-). We
>>> cannot ask them to supply us anything else but a simple
>>> username/password; this is the reality of B2B.  The only issue we have
>>> is that these are not kept in clear text in script files. In our domain
>>> this is illegal and in all other domains bad practise.  So all we
>>> require is to be able to have these encrypted in any script files. I
>>> think this Jira suggests a stronger mechanism, sharing keys between SFTP
>>> servers, but is totally impractical in real world B2B.
>>>
>>>
>>> Kim
>>>
>>> -----Original Message-----
>>> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
>>> Asankha C. Perera
>>> Sent: Thursday, 2 April 2009 3:48 AM
>>> To: user@synapse.apache.org
>>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>>
>>> Hi Jay / Kim
>>>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
>>> keys are host+user specific.
>>>>
>>>> I am not familiar enough with Synapse to know exactly how you'd go
>>> about it, but I do suggest that the answer lies in using PKI.
>>>>
>>> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
>>> solution for this.. and possibly we could already tweak VFS to do this..
>>>
>>> cheers
>>> asankhaa
>>>
>>> --
>>> Asankha C. Perera
>>> AdroitLogic, http://adroitlogic.org
>>>
>>> http://esbmagic.blogspot.com
>>>
>>>
>>>
>>>
>>>
>>
>

RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
OK that would be great, note we are also doing it using a class mediator for HTTP Transport and WS_Security.

Thanks
Kim

-----Original Message-----
From: indika kumara [mailto:indika.kuma@gmail.com] 
Sent: Monday, 6 April 2009 2:24 PM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

How to secure password in data sources is in document -
Synapse_Samples_Setup.html under section Securing Password and Setting
up Synapse DataSources . I will try to add this to VFS too.

Indika

On Mon, Apr 6, 2009 at 7:28 AM, Kim Horn <ki...@icsglobal.net> wrote:
> Are these security fixes for Data source going into 1.3 ?
> If not then an interim hack really needs to be done; we just cannot use Synapse at all with passwords in Clear Text.
> Suggestions:
>
> 1) Implement an interface that does de-cryption; so user can supply
> Their own code whatever that is. So specify a decrypt method that takes a string and returns a string.
>
> 2) To fix Data sources add a parameter:
> <decryption-class>class-Name</ decryption-class>
> - this takes the supplied password in current <password> tag and gets the decrypted password from class above.
>
> 3) To fix VFS need to supply new set of URL options:
>  <host-path>host-name:port/path</host-path>
>  <user>synapse</user>
>  <password>encrypted-password</password>
>  <decryption-class>class-Name</ decryption-class>
>
> - given the above the current <parameter name="transport.vfs.FileURI"> can be built.
> To be consistent with the strange VFS parameters the above can be changed to something like:
>
>  <parameter name="transport.vfs.hostPath>host-name:port/path</parameter>
>  <parameter name="transport.vfs.user>username</parameter>
>  <parameter name="transport.vfs.password>encrypted-password</parameter>
>  <parameter name="transport.vfs.decryptionClass>class-Name</parameter>
>
>
> If people agree to this I will create a Jira and start to do the work.
>
>
> Kim
>
>
>
>
>
> -----Original Message-----
> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
> Sent: Friday, 3 April 2009 5:54 AM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> I agree that it should be possible to use all Synapse features without
> having to store cleartext passwords in the config files (and without
> having them appear in log files).
>
> Just some random ideas about this topic:
>
> * Indika implemented a mechanism for exactly this, but for the moment
> this is limited to data sources. There is some documentation about
> this feature, but it is somewhat hidden in the Sample Setup guide. We
> should have this documentation in a more prominent place. Maybe as a
> subsection in the new Deployment guide?
>
> * As an alternative to usernames and passwords encoded in URLs,
> Commons VFS supports authentication by passing a
> org.apache.commons.vfs.UserAuthenticator object to the file system
> provider. Maybe we should define a property in the message context to
> allow to pass such an object to the transport. Alternatively we could
> write an adapter so that we can handle e.g. HTTPS and VFS
> authentication in the same way.
>
> * We should then have a mediator that builds the UserAuthenticator
> using the password encryption mechanisms implemented by Indika.
>
> Any thoughts?
>
> Andreas
>
> On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
>> It may, we are given simple text passwords by systems we have to
>> interface too. FTP is still the largest B2B mechanism in the US :-). We
>> cannot ask them to supply us anything else but a simple
>> username/password; this is the reality of B2B.  The only issue we have
>> is that these are not kept in clear text in script files. In our domain
>> this is illegal and in all other domains bad practise.  So all we
>> require is to be able to have these encrypted in any script files. I
>> think this Jira suggests a stronger mechanism, sharing keys between SFTP
>> servers, but is totally impractical in real world B2B.
>>
>>
>> Kim
>>
>> -----Original Message-----
>> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
>> Asankha C. Perera
>> Sent: Thursday, 2 April 2009 3:48 AM
>> To: user@synapse.apache.org
>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>
>> Hi Jay / Kim
>>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
>> keys are host+user specific.
>>>
>>> I am not familiar enough with Synapse to know exactly how you'd go
>> about it, but I do suggest that the answer lies in using PKI.
>>>
>> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
>> solution for this.. and possibly we could already tweak VFS to do this..
>>
>> cheers
>> asankhaa
>>
>> --
>> Asankha C. Perera
>> AdroitLogic, http://adroitlogic.org
>>
>> http://esbmagic.blogspot.com
>>
>>
>>
>>
>>
>

Re: Can VFS SFTP Passwords be encrypted

Posted by indika kumara <in...@gmail.com>.
How to secure password in data sources is in document -
Synapse_Samples_Setup.html under section Securing Password and Setting
up Synapse DataSources . I will try to add this to VFS too.

Indika

On Mon, Apr 6, 2009 at 7:28 AM, Kim Horn <ki...@icsglobal.net> wrote:
> Are these security fixes for Data source going into 1.3 ?
> If not then an interim hack really needs to be done; we just cannot use Synapse at all with passwords in Clear Text.
> Suggestions:
>
> 1) Implement an interface that does de-cryption; so user can supply
> Their own code whatever that is. So specify a decrypt method that takes a string and returns a string.
>
> 2) To fix Data sources add a parameter:
> <decryption-class>class-Name</ decryption-class>
> - this takes the supplied password in current <password> tag and gets the decrypted password from class above.
>
> 3) To fix VFS need to supply new set of URL options:
>  <host-path>host-name:port/path</host-path>
>  <user>synapse</user>
>  <password>encrypted-password</password>
>  <decryption-class>class-Name</ decryption-class>
>
> - given the above the current <parameter name="transport.vfs.FileURI"> can be built.
> To be consistent with the strange VFS parameters the above can be changed to something like:
>
>  <parameter name="transport.vfs.hostPath>host-name:port/path</parameter>
>  <parameter name="transport.vfs.user>username</parameter>
>  <parameter name="transport.vfs.password>encrypted-password</parameter>
>  <parameter name="transport.vfs.decryptionClass>class-Name</parameter>
>
>
> If people agree to this I will create a Jira and start to do the work.
>
>
> Kim
>
>
>
>
>
> -----Original Message-----
> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
> Sent: Friday, 3 April 2009 5:54 AM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> I agree that it should be possible to use all Synapse features without
> having to store cleartext passwords in the config files (and without
> having them appear in log files).
>
> Just some random ideas about this topic:
>
> * Indika implemented a mechanism for exactly this, but for the moment
> this is limited to data sources. There is some documentation about
> this feature, but it is somewhat hidden in the Sample Setup guide. We
> should have this documentation in a more prominent place. Maybe as a
> subsection in the new Deployment guide?
>
> * As an alternative to usernames and passwords encoded in URLs,
> Commons VFS supports authentication by passing a
> org.apache.commons.vfs.UserAuthenticator object to the file system
> provider. Maybe we should define a property in the message context to
> allow to pass such an object to the transport. Alternatively we could
> write an adapter so that we can handle e.g. HTTPS and VFS
> authentication in the same way.
>
> * We should then have a mediator that builds the UserAuthenticator
> using the password encryption mechanisms implemented by Indika.
>
> Any thoughts?
>
> Andreas
>
> On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
>> It may, we are given simple text passwords by systems we have to
>> interface too. FTP is still the largest B2B mechanism in the US :-). We
>> cannot ask them to supply us anything else but a simple
>> username/password; this is the reality of B2B.  The only issue we have
>> is that these are not kept in clear text in script files. In our domain
>> this is illegal and in all other domains bad practise.  So all we
>> require is to be able to have these encrypted in any script files. I
>> think this Jira suggests a stronger mechanism, sharing keys between SFTP
>> servers, but is totally impractical in real world B2B.
>>
>>
>> Kim
>>
>> -----Original Message-----
>> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
>> Asankha C. Perera
>> Sent: Thursday, 2 April 2009 3:48 AM
>> To: user@synapse.apache.org
>> Subject: Re: Can VFS SFTP Passwords be encrypted
>>
>> Hi Jay / Kim
>>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
>> keys are host+user specific.
>>>
>>> I am not familiar enough with Synapse to know exactly how you'd go
>> about it, but I do suggest that the answer lies in using PKI.
>>>
>> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
>> solution for this.. and possibly we could already tweak VFS to do this..
>>
>> cheers
>> asankhaa
>>
>> --
>> Asankha C. Perera
>> AdroitLogic, http://adroitlogic.org
>>
>> http://esbmagic.blogspot.com
>>
>>
>>
>>
>>
>

RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
Are these security fixes for Data source going into 1.3 ?
If not then an interim hack really needs to be done; we just cannot use Synapse at all with passwords in Clear Text. 
Suggestions:

1) Implement an interface that does de-cryption; so user can supply 
Their own code whatever that is. So specify a decrypt method that takes a string and returns a string.

2) To fix Data sources add a parameter:
<decryption-class>class-Name</ decryption-class>
- this takes the supplied password in current <password> tag and gets the decrypted password from class above.

3) To fix VFS need to supply new set of URL options:
 <host-path>host-name:port/path</host-path>
 <user>synapse</user>
 <password>encrypted-password</password>
 <decryption-class>class-Name</ decryption-class>

- given the above the current <parameter name="transport.vfs.FileURI"> can be built.
To be consistent with the strange VFS parameters the above can be changed to something like:

 <parameter name="transport.vfs.hostPath>host-name:port/path</parameter>
 <parameter name="transport.vfs.user>username</parameter>
 <parameter name="transport.vfs.password>encrypted-password</parameter>
 <parameter name="transport.vfs.decryptionClass>class-Name</parameter>


If people agree to this I will create a Jira and start to do the work.


Kim

 



-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com] 
Sent: Friday, 3 April 2009 5:54 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

I agree that it should be possible to use all Synapse features without
having to store cleartext passwords in the config files (and without
having them appear in log files).

Just some random ideas about this topic:

* Indika implemented a mechanism for exactly this, but for the moment
this is limited to data sources. There is some documentation about
this feature, but it is somewhat hidden in the Sample Setup guide. We
should have this documentation in a more prominent place. Maybe as a
subsection in the new Deployment guide?

* As an alternative to usernames and passwords encoded in URLs,
Commons VFS supports authentication by passing a
org.apache.commons.vfs.UserAuthenticator object to the file system
provider. Maybe we should define a property in the message context to
allow to pass such an object to the transport. Alternatively we could
write an adapter so that we can handle e.g. HTTPS and VFS
authentication in the same way.

* We should then have a mediator that builds the UserAuthenticator
using the password encryption mechanisms implemented by Indika.

Any thoughts?

Andreas

On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
> It may, we are given simple text passwords by systems we have to
> interface too. FTP is still the largest B2B mechanism in the US :-). We
> cannot ask them to supply us anything else but a simple
> username/password; this is the reality of B2B.  The only issue we have
> is that these are not kept in clear text in script files. In our domain
> this is illegal and in all other domains bad practise.  So all we
> require is to be able to have these encrypted in any script files. I
> think this Jira suggests a stronger mechanism, sharing keys between SFTP
> servers, but is totally impractical in real world B2B.
>
>
> Kim
>
> -----Original Message-----
> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
> Asankha C. Perera
> Sent: Thursday, 2 April 2009 3:48 AM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> Hi Jay / Kim
>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
> keys are host+user specific.
>>
>> I am not familiar enough with Synapse to know exactly how you'd go
> about it, but I do suggest that the answer lies in using PKI.
>>
> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
> solution for this.. and possibly we could already tweak VFS to do this..
>
> cheers
> asankhaa
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

Re: Can VFS SFTP Passwords be encrypted

Posted by Andreas Veithen <an...@gmail.com>.
I agree that it should be possible to use all Synapse features without
having to store cleartext passwords in the config files (and without
having them appear in log files).

Just some random ideas about this topic:

* Indika implemented a mechanism for exactly this, but for the moment
this is limited to data sources. There is some documentation about
this feature, but it is somewhat hidden in the Sample Setup guide. We
should have this documentation in a more prominent place. Maybe as a
subsection in the new Deployment guide?

* As an alternative to usernames and passwords encoded in URLs,
Commons VFS supports authentication by passing a
org.apache.commons.vfs.UserAuthenticator object to the file system
provider. Maybe we should define a property in the message context to
allow to pass such an object to the transport. Alternatively we could
write an adapter so that we can handle e.g. HTTPS and VFS
authentication in the same way.

* We should then have a mediator that builds the UserAuthenticator
using the password encryption mechanisms implemented by Indika.

Any thoughts?

Andreas

On Thu, Apr 2, 2009 at 00:34, Kim Horn <ki...@icsglobal.net> wrote:
> It may, we are given simple text passwords by systems we have to
> interface too. FTP is still the largest B2B mechanism in the US :-). We
> cannot ask them to supply us anything else but a simple
> username/password; this is the reality of B2B.  The only issue we have
> is that these are not kept in clear text in script files. In our domain
> this is illegal and in all other domains bad practise.  So all we
> require is to be able to have these encrypted in any script files. I
> think this Jira suggests a stronger mechanism, sharing keys between SFTP
> servers, but is totally impractical in real world B2B.
>
>
> Kim
>
> -----Original Message-----
> From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
> Asankha C. Perera
> Sent: Thursday, 2 April 2009 3:48 AM
> To: user@synapse.apache.org
> Subject: Re: Can VFS SFTP Passwords be encrypted
>
> Hi Jay / Kim
>> A suggestion.  SFTP can use PKI shared keys for authentication.  The
> keys are host+user specific.
>>
>> I am not familiar enough with Synapse to know exactly how you'd go
> about it, but I do suggest that the answer lies in using PKI.
>>
> I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
> solution for this.. and possibly we could already tweak VFS to do this..
>
> cheers
> asankhaa
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

RE: Can VFS SFTP Passwords be encrypted

Posted by "Jaeger, Jay - DOT" <Ja...@dot.wi.gov>.
I find the notion of going to great lengths to protect FTP passwords aside from reasonable precautions like good ACLs to prevent widespread access to the files somewhat "amusing" given the fact that FTP sends its passwords in CLEAR TEXT.  Anyone at any ISP along the way can see those passwords, unless you tunnel the FTP inside a VPN.

Actually what I am seeing more and more in the "real world" is the use of FTP over SSH.  This is a Good Thing (TM).

JRJ

-----Original Message-----
From: Kim Horn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, April 01, 2009 5:34 PM
To: user@synapse.apache.org
Subject: RE: Can VFS SFTP Passwords be encrypted


It may, we are given simple text passwords by systems we have to
interface too. FTP is still the largest B2B mechanism in the US :-). We
cannot ask them to supply us anything else but a simple
username/password; this is the reality of B2B.  The only issue we have
is that these are not kept in clear text in script files. In our domain
this is illegal and in all other domains bad practise.  So all we
require is to be able to have these encrypted in any script files. I
think this Jira suggests a stronger mechanism, sharing keys between SFTP
servers, but is totally impractical in real world B2B.


Kim

-----Original Message-----
From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
Asankha C. Perera
Sent: Thursday, 2 April 2009 3:48 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

Hi Jay / Kim
> A suggestion.  SFTP can use PKI shared keys for authentication.  The
keys are host+user specific.
>
> I am not familiar enough with Synapse to know exactly how you'd go
about it, but I do suggest that the answer lies in using PKI.
>
I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper
solution for this.. and possibly we could already tweak VFS to do this..

cheers
asankhaa

--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





RE: Can VFS SFTP Passwords be encrypted

Posted by Kim Horn <ki...@icsglobal.net>.
It may, we are given simple text passwords by systems we have to
interface too. FTP is still the largest B2B mechanism in the US :-). We
cannot ask them to supply us anything else but a simple
username/password; this is the reality of B2B.  The only issue we have
is that these are not kept in clear text in script files. In our domain
this is illegal and in all other domains bad practise.  So all we
require is to be able to have these encrypted in any script files. I
think this Jira suggests a stronger mechanism, sharing keys between SFTP
servers, but is totally impractical in real world B2B.


Kim

-----Original Message-----
From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
Asankha C. Perera
Sent: Thursday, 2 April 2009 3:48 AM
To: user@synapse.apache.org
Subject: Re: Can VFS SFTP Passwords be encrypted

Hi Jay / Kim
> A suggestion.  SFTP can use PKI shared keys for authentication.  The
keys are host+user specific.
>
> I am not familiar enough with Synapse to know exactly how you'd go
about it, but I do suggest that the answer lies in using PKI.
>   
I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper 
solution for this.. and possibly we could already tweak VFS to do this..

cheers
asankhaa

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Can VFS SFTP Passwords be encrypted

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Jay / Kim
> A suggestion.  SFTP can use PKI shared keys for authentication.  The keys are host+user specific.
>
> I am not familiar enough with Synapse to know exactly how you'd go about it, but I do suggest that the answer lies in using PKI.
>   
I guess https://issues.apache.org/jira/browse/SYNAPSE-507 is a proper 
solution for this.. and possibly we could already tweak VFS to do this..

cheers
asankhaa

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





RE: Can VFS SFTP Passwords be encrypted

Posted by "Jaeger, Jay - DOT" <Ja...@dot.wi.gov>.
A suggestion.  SFTP can use PKI shared keys for authentication.  The keys are host+user specific.

I am not familiar enough with Synapse to know exactly how you'd go about it, but I do suggest that the answer lies in using PKI.

JRJ

-----Original Message-----
From: kimhorn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, April 01, 2009 2:31 AM
To: user@synapse.apache.org
Subject: Can VFS SFTP Passwords be encrypted



For security no applications, specially scripts, should have passwords kept
in clear text. Currently we encrypt all passwords in Synapse.xml files and
use a Java Class Mediator to decrypt them and to place them in the SOAP or
message context Transport.

However STFP and VFS Proxy and endpoint pose a problem and I cannot see how
they can be used
without exposing the password in clear text:

  <proxy name="StockQuoteProxy" transports="vfs">
          <parameter
name="transport.vfs.FileURI">vfs:sftp://myusername:mypassword@somehost/home/download?vfs.passive=true</parameter>
  .............
</proxy>


<send>
   <endpoint>
      <address
uri="vfs:sftp://myusername:mypassword@somehost/home/upload?vfs.passive=true"/>
   </endpoint>
</send>


This suggests many problems with VFS:
- How can an encrypted password alone be used and unencrypted .
- If not the password then encrypt the whole parameter 'name' How can the
VFS proxy parameter name be set from a property, or registry entry.
- Where then can Java can be used to decrypt it.
- How could the property be set prior to Proxy invocation ? ( a start up
script approach is required. task ?). Maybe like the DataBase info VFS stuff
can be placed in start up properties file.

Any suggestions to make the synapse secure ?


Thanks
Kim



--
View this message in context: http://www.nabble.com/Can-VFS-SFTP-Passwords-be-encrypted-tp22821249p22821249.html
Sent from the Synapse - User mailing list archive at Nabble.com.