Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 195644

Summary: Add security support to New Agent Controller
Product: z_Archived Reporter: Igor Alelekov <igor.alelekov>
Component: TPTPAssignee: Igor Alelekov <igor.alelekov>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: chris.l.elford, guru.nagarajan, igor.alelekov, jcayne, jgwest, jkubasta, kiryl.kazakevich, nelliec, paulslau, samwai, sluiman, srinivas.p.doddapaneni, stoian, xubing
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: All   
URL: http://www.eclipse.org/tptp/groups/Architecture/documents/features/hf_195644.html
Whiteboard: closed460
Bug Depends on:    
Bug Blocks: 74579, 206875, 206878    
Attachments:
Description Flags
Platform.Execution patch
none
Platform.Common.UI patch
none
JVMTI.Client patch
none
Hyades.Trace.UI patch
none
Agent Controller patch for Linux
none
generateKey.sh
none
updated platform.execution patch
none
updated platform.common.ui patch
none
updated AC patch
none
Feature description document
none
patch to remove openssl dependency from 441
none
FDD for Pluggable Layer
none
Pluggable layer implementation
none
FD for Pluggable Layer none

Description Igor Alelekov CLA 2007-07-06 07:23:46 EDT
Currently new AC supports security in "Backward compatibility mode" only.
This is enhancement request to track implementation of security support in AC regular mode.
Comment 1 Chris Elford CLA 2007-07-06 14:08:37 EDT
What interface are you considering using for the SSL?  A proxy of some sort or an embedded interface like openssl?  
Comment 2 Igor Alelekov CLA 2007-07-06 15:07:42 EDT
(In reply to comment #1)
> What interface are you considering using for the SSL?  A proxy of some sort or
> an embedded interface like openssl?  

Since the AC is native I would like to use a native solution. I've chosen openssl as most Linux distributions come with precompiled openssl package and it is fully compatible with JSSE used in TPTP clients. On Windows we also can use openssl but it is required to be installed separatelly. I'm going to try Win API instead of it, I thought it might be more light solution.
Comment 3 Igor Alelekov CLA 2007-07-10 10:31:03 EDT
Created attachment 73419 [details]
Platform.Execution patch

Implementation consists of 5 patches.
This is the patch for the Platform.Execution component.
Comment 4 Igor Alelekov CLA 2007-07-10 10:32:07 EDT
Created attachment 73421 [details]
Platform.Common.UI patch
Comment 5 Igor Alelekov CLA 2007-07-10 10:34:33 EDT
Created attachment 73422 [details]
JVMTI.Client patch
Comment 6 Igor Alelekov CLA 2007-07-10 10:35:34 EDT
Created attachment 73423 [details]
Hyades.Trace.UI patch
Comment 7 Igor Alelekov CLA 2007-07-10 10:36:31 EDT
Created attachment 73425 [details]
Agent Controller patch for Linux
Comment 8 Igor Alelekov CLA 2007-07-10 10:48:48 EDT
Client patches implement security for all platforms.
AC patch do this for Linux only.

I've tested these patches on Linux and Windows. Currently, security windows code is commented out to avoid build failure.

This implementation uses openssl library preinstalled on most Linux builds.
On Windows we have two options:
- To use the openssl. It requres user to install (optionally) openssl if he intends to use security feature.
- To use Win API (Win.SDK)

Both option require changes to be made in TPTP build system on Windows.
Comment 9 Igor Alelekov CLA 2007-07-10 11:06:07 EDT
Created attachment 73429 [details]
generateKey.sh

Updated generateKey.sh to generate necessary certificate

Important: using JVMTI profiling with security enabled assumes that patch #187887 is applied.
Comment 10 Chris Elford CLA 2007-08-16 18:55:12 EDT
discuss for 4.5?  Igor already has patch under discussion.
Comment 11 jkubasta CLA 2007-08-21 08:52:25 EDT
Igor, as you already have a patch and as this is a major regression, the fix needs to be included in 441. 
Comment 12 Igor Alelekov CLA 2007-08-21 08:55:51 EDT
(In reply to comment #11)
> Igor, as you already have a patch and as this is a major regression, the fix
> needs to be included in 441. 

OK, I'll test it again tomorrow to ensure it can be checked in.
Comment 13 Igor Alelekov CLA 2007-08-29 08:25:15 EDT
Created attachment 77241 [details]
updated platform.execution patch
Comment 14 Igor Alelekov CLA 2007-08-29 08:26:16 EDT
Created attachment 77242 [details]
updated platform.common.ui patch
Comment 15 Igor Alelekov CLA 2007-08-29 08:26:42 EDT
Created attachment 77243 [details]
updated AC patch
Comment 16 Samson Wai CLA 2007-08-29 15:53:08 EDT
All 3 patches checked into 4.4.1 (head).

Igor please mark this as fixed. Thanks.
Comment 17 Igor Alelekov CLA 2007-08-30 02:06:54 EDT
Resolving as fixed
Comment 18 jkubasta CLA 2007-09-13 09:59:03 EDT
Igor, shipping with a dependency on OpenSSL is not acceptable to TPTP.  Could you please work to find an alternate solution? Thanks.
Comment 19 Igor Alelekov CLA 2007-09-13 10:15:04 EDT
I don't know.
I saw two ways only - to use external ssl library or to implement this one by ourself.
Comment 20 Chris Elford CLA 2007-09-24 19:31:10 EDT
Obviously, implementing a whole SSL stack is not really viable...  The potential options here seem to be:

(1) use JNI upcalls to the JSSE implementation (The old AC used JSSE)

This is not desirable because the new AC attempts to disassociate itself from the need for an underlying JVM.  Adding such a dependence seems a questionable decision.  Especially if we intend to yank it for an OpenSSL solution in 4.5.

(2) Wait for TPTP 4.5

The real problem is that we cannot add a dependence in a 3rd point release (e.g., 4.4.1).  We can add a dependency in a 2nd point release (e.g., 4.5).  Personally, I'm wondering if this is the direction that we're going to need to end up with.

(3) Pull in the OpenSSL codebase

OpenSSL is licensed under a BSD style license.  I know that we cannot add an external dependence in a point release.  Is it permissible to pull in external code in a point release?

(4)

If you just want windows support, one could rely on the Windows builtin SSL support.  Unfortunately, it looks like it requires Vista if one wants to use the "easy" interfaces...  http://msdn2.microsoft.com/en-us/library/bb394815.aspx.

Comment 21 Harm Sluiman CLA 2007-09-24 23:18:50 EDT
(In reply to comment #20)
> I think these are good questions to ask and could be discussed in the context of  an AG review. We have opposing forces in this discussion. One being that for comsumer products, we have a regression in end user function without a fix, and introducing additional dependencies that consumers would need to approve the lic. off is time consuming if even viable. On the other hand the code base now in use never had this feature and has a design point to be Java agnostic.

Coming from the consumer side of this I have a pretty strong bias, and it was made very clear to us that the existing consumers could/would not accept a new dependency like openSSL on short notice or in a patch release. From a consumer point of view the capability was there before and additional external dependencies is not needed. It is not just a matter of lic. it is also a matter of support.

I agree with the principal behind the AC design point, but I am not clear on it in the context of tooling that primarily targets Java and uses Java as the setup/config tool runtime.

I suggest an AG review of the detailed alternative, and that the consumers ensure they have a voice along with our motivation for the desire to not have a Java dependency.
Comment 22 Igor Alelekov CLA 2007-09-25 01:38:50 EDT
(In reply to comment #20)
> (1) use JNI upcalls to the JSSE implementation (The old AC used JSSE)
> This is not desirable because the new AC attempts to disassociate itself from
> the need for an underlying JVM.  Adding such a dependence seems a questionable

JNI calls may cause significant overhead. From other hand, using lazy dynamic jvm loading and native implementation of hyades file services (bug #196435) this overhead could be eliminated for users who don't need security features.

> (4)
> If you just want windows support, one could rely on the Windows builtin SSL
> support.  Unfortunately, it looks like it requires Vista if one wants to use
> the "easy" interfaces... 
> http://msdn2.microsoft.com/en-us/library/bb394815.aspx.

It seems that SSL is available on Windows starting with Windows NT SP 4 and on all versions of Windows 2000 (via schannel.dll). Corresponding examples could be found in Platform.SDK samples. From other hand, separate implementation for each platform requires additional efforts for support.

Comment 23 Harm Sluiman CLA 2007-09-25 08:00:34 EDT
Adding Paul since he is now the AG lead and should facilitate this decision soon.
Comment 24 Chris Elford CLA 2007-10-04 15:00:46 EDT
Unfortunately, I won't be able to dial in for AG review tommorrow.  My final comments are below...

If we wait until 4.5, the implementation is pretty much done (using OpenSSL) and only legal followthru is required.  It would be available for users June 30.

If we do not wait for 4.5, and go with a lazy loaded JVM and JSSE, the earliest users would get it would be 4.4.1 on Feb 29.

By doing some extra work, we would get it to users about 4 months faster.  The only technical questions are:
* How much work?
* How big of an overhead for the JNI?

The real question here is less technical. Are enough users requesting it such that this 4 months is critical?  If there are enough real users asking for it in a vocal enough fashion, its may be worth doing something for them if the time to fix is reasonable. 

Are all user complaints on windows or are they on both windows and linux?  (This could suggest that using windows schannel may be desirable).

I am toying with the concept of JSSE in 4.4.1 and OpenSSL in 4.5.  Given that a pure native solution exists, I'm unclear of the value of keeping JSSE via JNI around.  However, it seems a waste to me to implement JSSE/JNI model for such a small time period.

Eventually when we do TPTP 5, I would hope that we could eliminate the VM altogether from the AC.  Setting up more relationships between the new agent controller and the VM is at odds with that goal.
Comment 25 jkubasta CLA 2007-10-10 10:47:30 EDT
Created attachment 80051 [details]
Feature description document
Comment 26 Igor Alelekov CLA 2007-10-11 08:16:11 EDT
Created attachment 80132 [details]
patch to remove openssl dependency from 441

Hi Samson,
Could you please review the patch.
It removes the dependency of TPTP 4.4.1 on openssl. 
Thanks,
Igor
Comment 27 jkubasta CLA 2007-10-18 11:23:43 EDT
Perhaps we should split this into two features:
1) 441 feature for JSSE/JNI
2) 45 feature for OpenSSL?
Comment 28 Paul Slauenwhite CLA 2007-10-18 22:10:19 EDT
(In reply to comment #27)
> Perhaps we should split this into two features:
> 1) 441 feature for JSSE/JNI
> 2) 45 feature for OpenSSL?
> 

Yes, except the 4.4.1 work would be under a defect since the missing security with JVMTI constitutes a regression from JVMPI.

Ignor, please open a defect for the 4.4.1 work and include the comments from our calls.
Comment 29 Igor Alelekov CLA 2007-10-19 07:50:36 EDT
(In reply to comment #28)
> Igor, please open a defect for the 4.4.1 work and include the comments from
> our calls.

If you agree, I'll open two bugzillas: 
- enh.request to implement pluggable architecture for ssl providers
- defect to track implementation of JSSE security as pluggable module

Current defect can be considered as "Implementation of pluggable module for native ssl provider using openSSL library".

Comment 30 Paul Slauenwhite CLA 2007-10-19 08:04:26 EDT
(In reply to comment #29)
> (In reply to comment #28)
> > Igor, please open a defect for the 4.4.1 work and include the comments from
> > our calls.
> 
> If you agree, I'll open two bugzillas: 
> - enh.request to implement pluggable architecture for ssl providers
> - defect to track implementation of JSSE security as pluggable module
> 
> Current defect can be considered as "Implementation of pluggable module for
> native ssl provider using openSSL library".
> 

Hot exactly.  The 4.4.1 defect will include the JSSE and pluggable layer.  The 4.5 enhancement will include a pluggable OpenSSL implementation.
Comment 31 Igor Alelekov CLA 2007-10-19 08:44:02 EDT
Bug #206878 opened to track implementation of JSSE ssl provider.
Bug #206875 opened to track implementation of OpenSSL ssl provider.
Pluggable layer will be supported by the current bug.
Comment 32 Paul Slauenwhite CLA 2007-10-21 20:35:32 EDT
Approved by the AG for TPTP 4.5 with the following comments:

-See meetings from review call
(http://dev.eclipse.org/mhonarc/lists/tptp-platform-dev/msg02106.html).
-Bugzilla 195644 will be converted to a defect, along with defect 206878
(JSSE SSL provider) to provide pluggable security in 4.4.1.
-Bugzilla 206875 will provide a SSL provider in 4.5.
Comment 33 Paul Slauenwhite CLA 2007-10-21 20:37:16 EDT
(In reply to comment #32)

For TPTP 4.4.1.

Comment 34 Igor Alelekov CLA 2007-10-22 07:53:33 EDT
Created attachment 80870 [details]
FDD for Pluggable Layer
Comment 35 Samson Wai CLA 2007-10-23 11:19:40 EDT
I would suggest using the following generic functions to retrieve the provider name and info instead of sslGetProviderName() and sslGetProviderInfo().

void sslSetValue(char* name, char* value)
char* sslGetValue(char* name)

Using these functions will allow better flexibility for passing and retrieving information between AC and the provider.
Comment 36 Igor Alelekov CLA 2007-10-25 09:35:43 EDT
(In reply to comment #35)
> I would suggest using the following generic functions to retrieve the provider
> name and info instead of sslGetProviderName() and sslGetProviderInfo().
> void sslSetValue(char* name, char* value)
> char* sslGetValue(char* name)
> Using these functions will allow better flexibility for passing and retrieving
> information between AC and the provider.

I agree with sslGetValue() and sslSetValue().
But I would like to have provider's name/version written to log file.
To ensure that provider will supply this info I'm suggesting that sslGetProviderName() will remain.
Comment 37 Igor Alelekov CLA 2007-12-06 04:09:57 EST
Created attachment 84612 [details]
Pluggable layer implementation

I have tested this on Windows and Linux with tptpOpenSSL and tptpJSSE ssl provider modules.

For tptpOpenSSL I used SampleSecureClient and regular profiling as test cases.
For tptpJSSE I used SampleSecureClient only, since profiling with JSSE requires additional jvm to create, which is limited. Samson is investigating this issue.
Comment 38 Igor Alelekov CLA 2007-12-06 10:32:11 EST
Created attachment 84631 [details]
FD for Pluggable Layer
Comment 39 Igor Alelekov CLA 2008-01-14 03:17:28 EST
The patch is checked into CVS head and into 441 branch.
Resolving the bug.
Comment 40 Igor Alelekov CLA 2008-02-01 05:41:43 EST
*** Bug 74579 has been marked as a duplicate of this bug. ***
Comment 41 Igor Alelekov CLA 2008-02-14 08:00:34 EST
*** Bug 103827 has been marked as a duplicate of this bug. ***
Comment 42 Paul Slauenwhite CLA 2009-06-30 09:58:31 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.