{"id":1389,"date":"2009-10-05T08:24:21","date_gmt":"2009-10-05T13:24:21","guid":{"rendered":"http:\/\/www.coresecuritypatterns.com\/blogs\/?p=1389"},"modified":"2020-08-08T04:13:28","modified_gmt":"2020-08-08T04:13:28","slug":"unleashing-ssl-acceleration-and-reverse-proxying-with-kernel-ssl-kssl","status":"publish","type":"post","link":"https:\/\/websecuritypatterns.com\/blogs\/2009\/10\/05\/unleashing-ssl-acceleration-and-reverse-proxying-with-kernel-ssl-kssl\/","title":{"rendered":"Unleashing SSL Acceleration and Reverse-Proxying with Kernel SSL (KSSL)"},"content":{"rendered":"<p style=\"center;\"><a href=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2009\/09\/kssl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-1390\" src=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2009\/09\/kssl-300x193.png\" alt=\"\" width=\"240\" height=\"154\"><\/a>Last few weeks, I have been pulled into an interesting gig for demonstrating security for _____&nbsp; SOA\/XML Web Services&nbsp;and Java EE applications&#8230;. so I had a chance to play&nbsp;with some untold security features of Solaris 10.<strong> <span style=\"underline;\">KSSL<\/span><\/strong> is one of the <em>unsung yet powerful<\/em> security features of Solaris 10.&nbsp; As the name identifies, KSSL is a Solaris Kernel Module that helps representing server-side SSL protocol to help offloading operations such as&nbsp;SSL\/TLS based&nbsp;communication, SSL\/TLS termination&nbsp;and reverse-proxying for enduser applications. KSSL takes advantage of <strong>Solaris Cryptographic Framework (SCF),&nbsp;<\/strong>to act as an SSL proxy server performing complete&nbsp;SSL handshake processing in the Solaris Kernel and also using the underlying hardware cryptographic providers (SSL accelerators, PKCS11 Keystores and HSMs) to enable SSL acceleration and supporting secure key storage.<\/p>\n<p>Before I jump into how to use KSSL for offloading SSL operations, here is some compelling aspects you may want to know:<\/p>\n<ol>\n<li>Helps non-intrusively introduce an SSL proxy server for Web servers, Java EE application servers and also applications that does&#8217;nt implement SSL.<\/li>\n<li>KSSL proxy listens to all secured requests on the designated SSL port (ex. HTTPS:\/\/:443)&nbsp; and renders a cleartext traffic via reverse proxy (ex. HTTP:\/\/:8080) port for the underlying Web or application server. All SSL operations including the SSL handshake and session state are performed asynchronously in the Solaris Kernel and without the knowledge of the target application server.<\/li>\n<li>KSSL automatically uses SCF for offloading operations to underlying hardware cryptographic providers with no extra effort needed.<\/li>\n<li>Manages all the SSL certificates independently supporting most standard formats (ex. PKCS12, PEM),&nbsp; the key artifacts can be stored in a flatfile or a PKCS11 conformant keystore (If you are worried about loosing the private key).<\/li>\n<li>Supports the use Solaris zones, where each IP identified zone can be configured with a KSSL proxy<\/li>\n<li>Delivers <span style=\"underline;\">25% &#8211; 35% faster SSL performance<\/span> in comparison with traditional SSL configurations of most popular&nbsp;Web servers and Java EE application servers.<\/li>\n<li>KSSL can be used to delegate Transport-layer security and the applications may choose to implement WS-Security mechanisms for message-layer security.<\/li>\n<\/ol>\n<p>Those are some compelling aspects of KSSL that are hard to ignore&#8230;. if you really&nbsp;understand the pain&nbsp;from&nbsp;<em>performance overheads<\/em> associated with SSL\/TLS \ud83d\ude42&nbsp; As I verified,&nbsp;KSSL works well with most common Web servers and Java EE applications servers.<\/p>\n<h2>Try it yourself<\/h2>\n<p>Certainly it is worth a try&#8230;and you should able to do it very quickly than configuring SSL for your web sever !<\/p>\n<ul>\n<li>Obtain your server SSL and CA certificates. If you just want to test-drive KSSL&nbsp;and considering to&nbsp;using a self-signed OpenSSL certificate.. just follow the example commands and make sure that&nbsp;your web server hostname is correct. If you choose to use a flatfile based SSL keystore, KSSL requires to have all your certificate artifacts (including private key and certificates) in a single file.&nbsp; If you need more OpenSSL help, read my <a href=\"http:\/\/www.coresecuritypatterns.com\/blogs\/?p=763\" target=\"_blank\" rel=\"noopener noreferrer\">earlier post<\/a>.<\/li>\n<\/ul>\n<p style=\"30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ex. To create a self-signed server certificate using OpenSSL (in PEM format).<\/p>\n<blockquote>\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;openssl req -x509 -nodes&nbsp; -days 365 -subj<\/pre>\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"\/C=US\/ST=Massachusetts\/L=Burlington\/CN=myhostname\"<\/pre>\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;-newkey rsa:1024&nbsp; -keyout myServerSSLkey.pem -out mySelfSSLcert.pem<\/pre>\n<\/blockquote>\n<p style=\"30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ex.&nbsp; Concatenate the server certificates in a single file.<\/p>\n<blockquote>\n<pre>&nbsp;&nbsp;&nbsp;&nbsp;cat mySelfSSLcert.pem myServerSSLkey.pem &gt; mySSLCert.pem<\/pre>\n<\/blockquote>\n<ul>\n<li><span style=\"Lucida Sans Unicode;\">Configure the KSSL proxy service, &nbsp;assuming the secured requests are forwarded to an SSL port (ex. 443) and the reverse-proxy of your backend Web server listens to a non-SSL port (ex. 8080).&nbsp;Use -f option to identify the certificate fomat, to represent&nbsp;PEM (-f pem) and to represent PKCS12 (-f pk12).&nbsp; If the certificates are located in a HSM\/PKCS11 Keystore, use -f pkcs11 to identify the token directory, -T to identify the token label and -C to identify the certificate_subject.<\/span><\/li>\n<\/ul>\n<p style=\"30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ex. To configure the KSSL proxy service with SSL Port 443 and reverse-proxy port is 8080 using PEM based certificates and the passphrase stored in file (ex. password_file).<\/p>\n<blockquote>\n<pre style=\"90px\">           ksslcfg create -f pem -i mySSLCert.pem -x 8080 -p password_file webserver_hostname 443<\/pre>\n<\/blockquote>\n<ul>\n<li>\n<div style=\"90px\">Verify the KSSL proxy service under Solaris Service Management Framework (SMF) controls, the KSSL services is identified with FMRI svcs:\/network\/ssl\/proxy.<\/div>\n<\/li>\n<\/ul>\n<pre style=\"90px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; svcs - a | grep \"kssl\"<\/pre>\n<ul>\n<li>\n<div style=\"90px\">&nbsp;Assuming your webserver in the backend listens at port 8080, you should able to test the SSL configuration provided by the KSSL proxy.&nbsp; Open your browser, goto <a href=\"https:\/\/webserver_host:443\/\">https:\/\/webserver_host:443\/<\/a> you should be prompted by the SSL dialog warning to accept a self-signed certificate.<\/div>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<div style=\"90px\">More importantly, if your Solaris host is a Sun CMT server (based on UltraSPARC T1\/T2 processor), <span style=\"underline;\">KSSL automatically takes advantage of the cryptographic acceleration and no additional configuration is necessary<\/span>.<\/div>\n<\/li>\n<\/ul>\n<p style=\"90px\">Here is an unofficial benchmark that highlights performance comparisons&nbsp;with KSSL and other SSL options.&nbsp;&nbsp;The following shows the latency of an Web application running on Oracle Weblogic server using different SSL configurations&nbsp;(Certificate using RSA 1024) on a Sun CMT server (T5440) &#8211; To interpret the graph, make a note <span style=\"underline;\">&#8220;Smaller the&nbsp;Latency&nbsp;means Faster&#8221;.<\/span><\/p>\n<p style=\"90px\">&nbsp;<\/p>\n<p style=\"60px;\"><a href=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2009\/10\/solariskssl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1428 alignnone\" src=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2009\/10\/solariskssl.png\" alt=\"\" width=\"632\" height=\"235\"><\/a><\/p>\n<p style=\"90px\">Adopting to Sun CMT servers (based on&nbsp;UltraSPARC T1\/T2 processors) helps delivering on-chip cryptographic acceleration for supporting SSL\/TLS and its cryptographic functions. With KSSL based SSL deployment, you will atleast&nbsp;get an additional 30% performance advantage&nbsp;while comparing with other Web server based&nbsp;SSL deployments.&nbsp;I heard that Intel Nehalem EX processors are expected to provide similar on-chip crypto capabilities, not sure&nbsp;!&nbsp;&nbsp;Either way, using KSSL is a no brainer and it works.&nbsp; If you are itching the head to provide transport-layer security for your applications, this could be easiest way to go !&nbsp; Ofcourse, it can help you score some points in&nbsp;those IT infrastructure security assessment checklists verifying for&nbsp;PCI-DSS, FISMA, HIPPA and\/or similar regulatory\/industry compliance mandates !&nbsp;&nbsp;\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last few weeks, I have been pulled into an interesting gig for demonstrating security for _____&nbsp; SOA\/XML Web Services&nbsp;and Java EE applications&#8230;. so I had a chance to play&nbsp;with some untold security features of Solaris 10. KSSL is one of the unsung yet powerful security features of Solaris 10.&nbsp; As the name identifies, KSSL is a Solaris Kernel Module that&#8230; <a href=\"https:\/\/websecuritypatterns.com\/blogs\/2009\/10\/05\/unleashing-ssl-acceleration-and-reverse-proxying-with-kernel-ssl-kssl\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,20,21,6,8,11],"tags":[28,37,39,50,57,62,75],"class_list":["post-1389","post","type-post","status-publish","format-standard","hentry","category-compliance","category-java-ee","category-java-security","category-main","category-pki-main","category-smartcards-pki","tag-compliance-main","tag-j2ee","tag-java","tag-openssl","tag-pki-main","tag-security","tag-ws-security"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/comments?post=1389"}],"version-history":[{"count":1,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1389\/revisions"}],"predecessor-version":[{"id":2838,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1389\/revisions\/2838"}],"wp:attachment":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/media?parent=1389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/categories?post=1389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/tags?post=1389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}