Showing posts with label SSL. Show all posts
Showing posts with label SSL. Show all posts

Saturday, July 2, 2011

Disable sslv2 and weak ciphers for IHS 6


The methods for disabling specific SSL cipher suites vary based on the web server and the underlying operating systems. Microsoft Internet Information Services (IIS):- by editing windows registry, and Apache 2 - by using mod_ssl directives.

When an SSL connection is established, the client (Web browser) and the Web server negotiate the cipher to use for the connection. The Web server has an ordered list of ciphers, and the first cipher in that list which is supported by the client will be selected.

Threat:
The Secure Socket Layer (SSL) protocol allows for secure communication between a client and a server. SSL encryption ciphers are classified based on encryption key length as follows:                                                                          
HIGH - key length larger than 128 bits                                            
MEDIUM - key length equal to 128 bits                                             
LOW - key length smaller than 128 bits                                            
Messages encrypted with LOW encryption ciphers are easy to decrypt.               
Commercial SSL servers should only support MEDIUM or HIGH strength ciphers to guarantee transaction security.  


Solution:  Disable support for LOW encryption ciphers.                            
Apache Typically, for Apache/mod_ssl, httpd.conf or ssl.conf should have the following lines:                                                                
SSLProtocol -ALL +SSLv3 +TLSv1                                                  
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

Solution: Change the list of ciphers supported, and add SSLProtocoLDisable SSLv2.

The following configuration directs the server to prefer strong 128-bit RC4 ciphers first and will provide a significant performance improvement over the default configuration. 
This configuration does not support the weaker 40-bit, 56-bit, or NULL/Plaintext ciphers that security scanners might complain about.

The order of the SSLCipherSpec directives dictates the priority of the ciphers, so we order them in a way that will cause IBM HTTP Server to prefer less CPU intensive ciphers.


we can verify the same with the ssldigger utility.
download link - http://www.mcafee.com/us/downloads/free-tools/ssldigger.aspx



Refere the sample httpd.conf (Tested with IHS-6.1)

---Sample httpd.conf-----congigurations starts----
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Listen 443

<VirtualHost YourServer:443>
ServerName YourServer
DocumentRoot "D:\IBM\HTTPServer\htdocs\en_US"
SSLEnable
Keyfile "D:\IBM\HTTPServer\ssl\temp\test_cert.kdb"
SSLV2Timeout 100
SSLV3Timeout 1000


## SSLv3 128 bit Ciphers
SSLCipherSpec SSL_RSA_WITH_RC4_128_MD5
SSLCipherSpec SSL_RSA_WITH_RC4_128_SHA

## FIPS approved SSLV3 and TLSv1 128 bit AES Cipher
SSLCipherSpec TLS_RSA_WITH_AES_128_CBC_SHA

## FIPS approved SSLV3 and TLSv1 256 bit AES Cipher
SSLCipherSpec TLS_RSA_WITH_AES_256_CBC_SHA

## Triple DES 168 bit Ciphers
## These can still be used, but only if the client does
## not support any of the ciphers listed above.
SSLCipherSpec SSL_RSA_WITH_3DES_EDE_CBC_SHA

## The following block enables SSLv2. Excluding it in the
## presence of the SSLv3 configuration above disables
## SSLv2 support.

## SSLv2 128 bit Ciphers
SSLCipherSpec SSL_RC4_128_WITH_MD5
SSLCipherSpec SSL_RC4_128_WITH_SHA

## SSLv2 168 bit 3DES cipher
## These can still be used, but only if the client does
## not support any of the ciphers listed above.
SSLCipherSpec SSL_DES_192_EDE3_CBC_WITH_MD5
</VirtualHost>
SSLDisable

---httpd.conf-----congigurations ends----

once the httpd configurations are doen same can be tested by using tool THCSSLCheck.exe
pls find the attached Result files for before the configurations and after the remediations for ihs 6.1



The httpd.conf file is configured correctly with the strong ciphers and weak SSLv2 ciphers are disabled:
The below config will disable SSLv2 ciphers
<VirtualHost *:443>      
    SSLEnable              

    ## Set strong ciphers  
    SSLCipherSpec 3A        
    SSLCipherSpec 34        
    SSLCipherSpec 35

</VirtualHost>
Attached is the Result file after enabling the strong ciphers as mentioned above

Sunday, December 26, 2010

Error While starting gsk7 of WAS 5.1 Start Key Management Utility

Error While starting gsk7 of WAS 5.1 Start Key Management Utility








Starting the IBM Key Management application an error occurs
stating the following:

"The Java Cryptographic Extension(JCE) files were not found.
Please check that the JCE files have been installed in the correct
directory"/

Web Solution
The Global Security Kit environment needs to be prepared to
work properly.
1. Open up a Command Prompt window
2. cd %JAVA_HOME%\lib\ext
3. copy ..\..\..\..\GSK7\classes\jre\lib\ext\*.jar
4. del ibmjcaprovider.jar
5. cd ..\security
6. copy ..\..\..\..\GSK7\classes\gsk_java.security java.security
7. Select 'YES' to overwrite the files
8. Start the gsk7ikm application.

you can try the below one also.
From GSK 7 folder structure copy this
D:\Program Files\ibm\gsk7\classes\jre\lib\ext\ibmpkcs.jar
D:\Program Files\ibm\gsk7\classes\jre\lib\ext\ibmjceprovider.jar
to JavaHome D:\j2sdk1.4.2_03\jre\lib\ext
Register its entry into the java.security OF javaHome by adding these below code to
your java.security file.
security.provider.6=com.ibm.spi.IBMCMSProvider
security.provider.7=com.ibm.crypto.provider.IBMJCE
policy.url.2=file:${java.home}/lib/security/java.pol

Thursday, December 23, 2010

Install SSL Certificate on IBM Http Server

Before installing the SSL certificate, install both of these CA certificates into your key store. Follow the instructions in 'Storing a CA certificate' below.

If the authority who issues the SSL certificate is not a trusted CA in the key database, you must first store the CA certificate and designate the CA as a trusted CA. Then you can import the CA-signed SSL certificate into the key database. You cannot import a CA-signed SSL certificate from a CA who is not a trusted CA in the key database. For instructions see 'Storing a CA certificate' below.

Storing a CA Certificate:
1. Enter IKEYMAN on a command line on UNIX, or start the Key Management utility in the IBM HTTP Server folder on Windows.
2. Select Key Database File from the main User Interface, select Open.
3. In the Open dialog box, select your key database name. Click OK.
4. In the Password Prompt dialog box, enter your password and click OK.
5. Select Signer Certificates in the Key Database content frame, click the Add button.
6. In the Add CA Certificate from a File dialog box, select the certificate to add or use the Browse option to locate the certificate. Click OK.
7. In the Label dialog box, enter a label name and click OK.

Import the CA-signed SSL certificate into a key database:
1. Enter IKEYMAN on a command line on UNIX, or start the Key Management utility in the IBM HTTP Server folder on Windows.
2. Select Key Database File from the main User Interface, select Open.
3. In the Open dialog box, select your key database name. Click OK.
4. In the Password Prompt dialog box, enter your password, click OK.
5. Select Personal Certificates in the Key Database content frame and then click the Receive button.
6. In the Receive Certificate from a File dialog box, select the certificate file. Click OK.

Thursday, December 16, 2010

Server certificate rejected by ChainVerifier (SSL Error with TIBCO BW 5.3)

An IOException was thrown while trying to execute the Http method caused by: java.io.IOException: Failed to create secure client socket: Server certificate rejected by ChainVerifier

Simple Steps to make your TOMCAT Run on HTTPS using KEYTOOL utility

1). keytool -genkey -alias www.mytest.com -keyalg RSA -keysize 2048 -keystore www_mytest_com.jks

2). keytool -certreq -alias www.mytest.com -file www_mytest_com.csr -keystore www_mytest_com.jks

3). keytool -import -trustcacerts -alias www.mytest.com -file D:\www_mytest_com.p7b -keystore www_mytest_com.jks
This will install Certificate and the Root Certificate associated with the same., sometimes this will not work and in that case try the below steps.

3.1). keytool -import -alias www.mytest.com -file D:\www_mytest_com.cer -keystore www_mytest_com.jks
3.2). keytool -import -trustcacerts -file D:\www_mytest_com_root.cer -keystore www_mytest_com.jks

4). Modify server.xml and Restart TOMCAT SERVER
 <Connector port="443" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" keyAlias="www.mytest.com"
    keystoreFile="C:\Program Files\Java\jre6\bin\www_mytest_com.jks"
    keypass="changeit"/>

**Note: By default Tomcat will look for your Keystore with the file name .keystore in the home directory with the default password changeit. The home directory is generally /home/user_name/ on Unix and Linux systems, and C:\Documents and Settings\user_name\ on Microsoft Windows systems

**TIBCO Admin Console needs certificate in PEM format and here is the method to export your CERT into PEM

exportcert - This option is available with JRE-1.6 if u r using JRE-1.5 then simply try export option and it will export the cert into the PEM format.

keytool -exportcert -alias www.mytest.com -keypass changeit -keystore www_mytest_com.jks -rfc -file keytool_www_mytest_com.pem -storepass changeit

Useful links @ Tibco SSL Certificates
http://www.tibcommunity.com/docs/DOC-2178
http://www.tibcommunity.com/docs/DOC-2195

Tuesday, November 30, 2010

Simple steps to generate the Certificate for Apache Server 2.2 using openssl

1) Go to the command prompt
2) cd C:\Program Files\Apache Software Foundation\Apache2.2\bin
3) set OPENSSL_CONF=C:\Program Files\Apache Software Foundation\Apache2.2\conf\openssl.cnf ( if Required )
4) openssl
5) genrsa -des3 -out test.com.key 1024
6) rsa -in test.com.key -out server.pem
7) req -new -key test.com.key -out test.com.csr
8) Once the above steps completed total 3 files will be generated to the location C:\Program Files\Apache Software Foundation\Apache2.2\bin
            test.com.key
            server.pem
            test.com.csr
8) Get the Certificate from Certified Authority using csr file "test.com.csr"
9) Installing the Certificate (test.com.cer) Received from the Certified Authority
i) Copy the test.com.cer and server.pem into the "C:\Program Files\Apache Software Foundation\Apache2.2\conf"
ii) Now Edit the httpd.conf Uncomment Both the lines #Loadmodule ssl_module modules/mod_ssl.so and #Include conf/extra/httpd-ssl.conf
iii) Now Edit the httpd-ssl.conf file from location "C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra" Change the from  SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server.crt" to SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/test.com.cer"
10) Restart the Apache Server and Check the same.

Run your Tomcat server on HTTPS

Simple Steps to make your TOMCAT Run on HTTPS using KEYTOOL utility

1). keytool -genkey -alias www.mytest.com -keyalg RSA -keysize 2048 -keystore www_mytest_com.jks

2). keytool -certreq -alias www.mytest.com -file www_mytest_com.csr -keystore www_mytest_com.jks

3). keytool -import -trustcacerts -alias www.mytest.com -file D:\www_mytest_com.p7b -keystore www_mytest_com.jks
This will install Certificate and the Root Certificate associated with the same., sometimes this will not work and in that case try the below steps.

3.1). keytool -import -alias www.mytest.com -file D:\www_mytest_com.cer -keystore www_mytest_com.jks
3.2). keytool -import -trustcacerts -file D:\www_mytest_com_root.cer -keystore www_mytest_com.jks

4). Modify server.xml and Restart TOMCAT SERVER


**Note: By default Tomcat will look for your Keystore with the file name .keystore in the home directory with the default password changeit. The home directory is generally /home/user_name/ on Unix and Linux systems, and C:\Documents and Settings\user_name\ on Microsoft Windows systems