<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Teiid+Server+Transport+Security">Teiid Server Transport Security</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~kylin">Kylin Soong</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* *2-way* -- Mutual client and server authentication. The server and client applications each have a keystore for their private keys and each has a truststore that authenticates the other. The server will present a certificate, which is obtained from the keystore related properties. The client should have a truststore configured to accept the server certificate.  The client is  also expected to present a certificate, which is obtained from its keystore.  The client certificate should be accepted by the trust store configured by the truststore related properties. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >For non-anonymous SSL, the suite is negotiated - see <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">_enabled\-cipher\-suites_</span> <span class="diff-added-words"style="background-color: #dfd;">_enabled-cipher-suites_</span> below below. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Depending upon the SSL mode, follow the guidelines of your organization around creating/obtaining private keys.  If you have no organizational requirements, then follow this guide to create [self-signed certificates|Generating Self Signed Certificates] with their respective keystores and truststores. The following keystore and truststore combinations are required for different SSL modes. The names of the files can be chosen by the user. The following files are shown for example purposes only. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>Properties <br></td></tr>
            <tr><td class="diff-changed-lines" >* [mode|#Encryption Modes] <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">-</span> <span class="diff-added-words"style="background-color: #dfd;">\-</span> diabled\|login\|enabled <br></td></tr>
            <tr><td class="diff-unchanged" >_disabled_ = no transport or message level security will be used.
_login_ = only the login traffic will be encrypted at a message  level using 128 bit AES with an ephemeral DH key exchange. Only applies  to the &#39;teiid&#39; transport and no other config values are needed in this  mode.
_enabled_ = traffic will be secured with SSL using the other configuration properties.  &quot;teiid&quot; transport clients *must* connect using SSL with the mms protocol.  ODBC &quot;pg&quot; transport clients may optionally use SSL. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* keystore/type - Keystore type created by the keytool. Optional - by default &quot;JKS&quot; is used. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >* [authentication-mode|#SSL Authentication Modes] <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">-</span> <span class="diff-added-words"style="background-color: #dfd;">\-</span> anonymous\|1-way\|2-way,  Type of SSL Authentication Mode. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>* keymanagement-algorithm - Type of key algorithm used. Optional - by default is based upon the VM, e.g. &quot;SunX509&quot; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* enabled-cipher-suites - A comma separated list of cipher suites allowed for encryption between server and client.  The values must be valid supported cipher suites otherwise SSL connections will fail.  Optional - defaults to all supported cipher suites for the vm. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Alternatively, you can use the CLI to add or modify the transport configuration <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}</span> <span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">You will typically use the CLI to modify the transport configuration. <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}</span> <span class="diff-added-words"style="background-color: #dfd;">{code}</span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-mode,value=enabled) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-authentication-mode,value=1-way) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-ssl-protocol,value=TLSv1) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-keymanagement-algorithm,value=SunX509) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-enabled-cipher-suites,value=&quot;SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA&quot;) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-name,value=ssl-example.keystore) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-password,value=redhat) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-type,value=JKS) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-key-alias,value=teiid) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-key-password,value=redhat) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=truststore-name,value=ssl-example.truststore) <br>/subsystem=teiid/transport=jdbc:write-attribute(name=truststore-password,value=redhat) <br> <br>{code} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{info:Using password Vault} <br>If  you do not like to leave clear text passwords in the configuration file, then you can use JBoss AS vault mechanism for storing the keystore and truststore passwords. Use the directions defined here [https://community.jboss.org/docs/DOC-17248|https://community.jboss.org/docs/DOC-17248] <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Encryption Strength <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Both anonymous SSL and login only (JDBC specific) encryption are configured to use 128 bit AES encryption by default.  By default 1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.  Users can restrict the cipher suites used by specifying the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">_enabled\-cipher\-suites_</span> <span class="diff-added-words"style="background-color: #dfd;">_enabled-cipher-suites_</span> property above in the SSL configuration. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h1. Examples <br> <br>* [1-way ssl authentication mode|https://developer.jboss.org/docs/DOC-55352] <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>There are two types of remote transports, each with it's own encryption configuration:</p>

<ul>
        <li>"teiid" - Defaults to only encrypt login traffic, in which none of the other configuration properties are used.</li>
</ul>


<ul>
        <li>"pg" - Defaults to no SSL
<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The pg transport for ODBC access defaults to clear text username password authentication.</td></tr></table></div></li>
</ul>


<p>SSL configuration is part of the <em>"transport"</em> configuration in the Teiid subsystem.</p>

<h1><a name="TeiidServerTransportSecurity-EncryptionModes"></a>Encryption Modes</h1>

<p>Teiid supports a couple different encryption modes based on the <em>"mode"</em> attribute on <em>"ssl"</em> element.</p>

<ul>
        <li><b>logIn</b> &#45; This is the default setting for the transports.
        <ul>
                <li>JDBC (non-data by default) messages between client and server are encrypted using 128 bit AES with a <a href="http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange" class="external-link" rel="nofollow">Diffie-Hellman</a> key that is negotiated per connection.  When possible a 2048 bit key exchange will be used otherwise 1024 bit will be used.  Oracle/Sun 1.7 JREs are known not to support key lengths over 1024 bits.  The <a href="/author/display/TEIID/Driver+Connection" title="Driver Connection">connection property</a> encryptRequest can be used to encrypt requests and results using the same 128 AES scheme.</li>
                <li>For the pg transport authentication is expected to be secure - which currently is only GSS logins.</li>
        </ul>
        </li>
</ul>


<ul>
        <li><b>enabled</b> &#45; Mode to enable SSL.  Clients are required to connect using SSL.</li>
</ul>


<ul>
        <li><b>disabled</b> &#45; turns off any kind of encryption. This is the default for the pg transport.</li>
</ul>


<h1><a name="TeiidServerTransportSecurity-SSLAuthenticationModes"></a>SSL Authentication Modes</h1>

<ul>
        <li><b>anonymous</b> &#8211; No certificates are required, but all communications are still encrypted using the TLS_DH_anon_WITH_AES_128_CBC_SHA SSL suite. In most secure intranet environments, anonymous is suitable to just bulk encrypt traffic without the need to setup SSL certificates. No certificates are exchanged, settings are not needed for the keystore and truststore properties. Clients must have <tt>org.teiid.ssl.allowAnon</tt> set to true (the default) to connect to an anonymous server.</li>
</ul>


<ul>
        <li><b>1-way</b> &#8211; Only authenticates the server to the client.  Requires a private key keystore to be created for the server and a truststore at the client that authenticates that certificate.</li>
</ul>


<ul>
        <li><b>2-way</b> &#8211; Mutual client and server authentication. The server and client applications each have a keystore for their private keys and each has a truststore that authenticates the other. The server will present a certificate, which is obtained from the keystore related properties. The client should have a truststore configured to accept the server certificate.  The client is  also expected to present a certificate, which is obtained from its keystore.  The client certificate should be accepted by the trust store configured by the truststore related properties.</li>
</ul>


<p>For non-anonymous SSL, the suite is negotiated - see <em>enabled-cipher-suites</em> below below.</p>

<p>Depending upon the SSL mode, follow the guidelines of your organization around creating/obtaining private keys.  If you have no organizational requirements, then follow this guide to create <a href="/author/display/TEIID/Generating+Self+Signed+Certificates" title="Generating Self Signed Certificates">self-signed certificates</a> with their respective keystores and truststores. The following keystore and truststore combinations are required for different SSL modes. The names of the files can be chosen by the user. The following files are shown for example purposes only.</p>

<p><em>1-way</em></p>

<ol>
        <li>server.keystore - has server's private key</li>
        <li>server.truststore - has server's public key</li>
</ol>


<p><em>2-way</em></p>

<ol>
        <li>server.keystore - has server's private key</li>
        <li>server.truststore - has server's public key</li>
        <li>client.keystore - client's private key</li>
        <li>client.truststore - has client's public key</li>
</ol>


<h1><a name="TeiidServerTransportSecurity-FullConfigurationOptions"></a>Full Configuration Options</h1>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example XML Configuration</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;ssl mode="enabled" authentication-mode="1-way" ssl-protocol="TSLv1" keymanagement-algorithm="algo"
         enabled-cipher-suites="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA"&gt;
            &lt;keystore name="cert.keystore" password="passwd" type="JKS" key-alias="alias" key-password="passwd1"/&gt;
            &lt;truststore name="cert.truststore" password="passwd"/&gt;
&lt;/ssl&gt;
</pre>
</div></div>

<p>Properties</p>
<ul>
        <li><a href="#TeiidServerTransportSecurity-EncryptionModes">mode</a> &#45; diabled&#124;login&#124;enabled<br/>
<em>disabled</em> = no transport or message level security will be used.<br/>
<em>login</em> = only the login traffic will be encrypted at a message  level using 128 bit AES with an ephemeral DH key exchange. Only applies  to the 'teiid' transport and no other config values are needed in this  mode.<br/>
<em>enabled</em> = traffic will be secured with SSL using the other configuration properties.  "teiid" transport clients <b>must</b> connect using SSL with the mms protocol.  ODBC "pg" transport clients may optionally use SSL.</li>
</ul>


<ul>
        <li>ssl-protocol&#45; Type of SSL protocol to be used. Optional - by default TLSv1. 
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>SSLv3 is not recommended due to the POODLE security vulnerability.</td></tr></table></div></li>
</ul>


<ul>
        <li>keystore/type - Keystore type created by the keytool. Optional - by default "JKS" is used.</li>
</ul>


<ul>
        <li><a href="#TeiidServerTransportSecurity-SSLAuthenticationModes">authentication-mode</a> &#45; anonymous&#124;1-way&#124;2-way,  Type of SSL Authentication Mode.</li>
</ul>


<ul>
        <li>keymanagement-algorithm - Type of key algorithm used. Optional - by default is based upon the VM, e.g. "SunX509"</li>
</ul>


<ul>
        <li>keystore/name - The file name of the keystore, which contains the private key of the Server. The file name can be relative resource path available to the Teiid deployer classloader or an absolute file system  path. A typical installation would place the keystore file in the conf directory of the profile where Teiid is deployed with a file name relative to the conf path.  Typically required if 1-way or 2-way authentication is used.</li>
</ul>


<ul>
        <li>keystore/password - password for the keystore.  Required if the keystore has a password.</li>
</ul>


<ul>
        <li>keystore/key-alias - Alias name for the private key to use.  Optional - only needed if there are multiple private keys in the keystore and you need to choose which one to use.</li>
</ul>


<ul>
        <li>keystore/key-password - Alias name for the private key to use.  Optional - only needed if the key password is different than the keystore password.</li>
</ul>


<ul>
        <li>truststore/name - This is the truststore containing the public certificate(s) for client keys. Depending upon how you created the keystore and truststores, this may be same file as defined under "keystore/name" property.  Required if "authenticationMode" is "2-way".</li>
</ul>


<ul>
        <li>truststore/password - password for the truststore.  Required if the truststore has a password.</li>
</ul>


<ul>
        <li>enabled-cipher-suites - A comma separated list of cipher suites allowed for encryption between server and client.  The values must be valid supported cipher suites otherwise SSL connections will fail.  Optional - defaults to all supported cipher suites for the vm.</li>
</ul>


<p>Alternatively, you can use the CLI to add or modify the transport configuration</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">

/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-mode,value=enabled)
/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-authentication-mode,value=1-way)
/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-ssl-protocol,value=TLSv1)
/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-keymanagement-algorithm,value=SunX509)
/subsystem=teiid/transport=jdbc:write-attribute(name=ssl-enabled-cipher-suites,value="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA")
/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-name,value=ssl-example.keystore)
/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-password,value=redhat)
/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-type,value=JKS)
/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-key-alias,value=teiid)
/subsystem=teiid/transport=jdbc:write-attribute(name=keystore-key-password,value=redhat)
/subsystem=teiid/transport=jdbc:write-attribute(name=truststore-name,value=ssl-example.truststore)
/subsystem=teiid/transport=jdbc:write-attribute(name=truststore-password,value=redhat)

</pre>
</div></div>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>If  you do not like to leave clear text passwords in the configuration file, then you can use JBoss AS vault mechanism for storing the keystore and truststore passwords. Use the directions defined here <a href="https://community.jboss.org/docs/DOC-17248" class="external-link" rel="nofollow">https://community.jboss.org/docs/DOC-17248</a></td></tr></table></div>

<h1><a name="TeiidServerTransportSecurity-EncryptionStrength"></a>Encryption Strength</h1>

<p>Both anonymous SSL and login only (JDBC specific) encryption are configured to use 128 bit AES encryption by default.  By default 1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.  Users can restrict the cipher suites used by specifying the <em>enabled-cipher-suites</em> property above in the SSL configuration.</p>

<h1><a name="TeiidServerTransportSecurity-Examples"></a>Examples</h1>

<ul>
        <li><a href="https://developer.jboss.org/docs/DOC-55352" class="external-link" rel="nofollow">1-way ssl authentication mode</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Teiid+Server+Transport+Security">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646063&revisedVersion=27&originalVersion=26">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Teiid+Server+Transport+Security?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>