<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://weblogic.sys-con.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Blog That!</title>
 <link>http://weblogic.sys-con.com/</link>
 <description>Latest articles from Blog That!</description>
 <language>en</language>
 <copyright>Copyright 2009 Ulitzer.com</copyright>
 <generator>Ulitzer.com</generator>
 <lastBuildDate>Sun, 08 Nov 2009 03:35:34 EST</lastBuildDate>
 <docs>http://backend.userland.com/rss</docs>
 <ttl>10</ttl>
<item>
 <title>Working with WLS 10.3.1 SQLAuthenticator Password Algorithms - Part 1</title>
 <link>http://weblogic.sys-con.com/node/1130973</link>
 <description>WebLogic Server 10.3.1 supports loading user credentials and roles from a number of different sources, such as LDAP or a database, through the concept of &quot;Security Providers&quot;.  In order to work with a database table structure a &quot;SQL Authenticator&quot; provider is required.&lt;br /&gt;&lt;br /&gt;Edwin Biemond has a good &lt;a href=&quot;http://biemond.blogspot.com/2008/12/using-database-tables-as-authentication.html&quot;&gt;example&lt;/a&gt; of setting up both the database table structures and configuring the WLS SQL Authenticator against these tables.  To keep the example simple, for the password field in the JHS_USERS table Edwin&#039;s has set the SQL Authenticator to write raw plain text passwords to the table.  This makes it really easy for demonstration purposes to see what&#039;s written to the database.&lt;br /&gt;&lt;br /&gt;To extend Edwin&#039;s post, a common requirement will be that:&lt;br /&gt;&lt;br /&gt;a) The password value is written in an encrypted form to the database&lt;br /&gt;b) Other non-WLS applications can generate the same encrypted result such that the encrypted passwords can be compared&lt;br /&gt;&lt;br /&gt;The need for point &quot;a&quot; is obvious, unencrypted password in the database is a security weakness.  But what about &quot;b&quot;, why would you want this?&lt;br /&gt;&lt;br /&gt;For many organisations the list of users and roles will be stored in database tables, and that information will be sourced by many different subsystems implemented in different technologies.  It&#039;s not uncommon for sites to have Oracle Forms, .Net, JEE (and ADF of course!) applications all relying on the database user tables for their authentication and authorisation information.&lt;br /&gt;&lt;br /&gt;Each of these subsystems would require users to login.  The subsystem would then encrypt the password, retrieve the corresponding password from the database for the identified user, and compare the results.  If they compare, we have a valid user; if the encrypted passwords are different, ring the alarm bells, we have an imposter (or at least make them login again ;-)&lt;br /&gt;&lt;br /&gt;All things would be well with this solution, until you throw in the fact that each subsystem may support different encryption algorithms that would produce different results, effectively failing the encrypted password comparison each time.  It becomes essential therefore that WLS&#039;s SQL Authenticator supports different encryption algorithms in order to provide as much flexibility as possible.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Password Settings&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On configuring a SQL Authenticator as per Edwin&#039;s example, on accessing the Provider Specific information (from the WLS console select Security Realms -&gt; myrealm -&gt; Providers tab -&gt; your named SQL Authenticator -&gt; Configuration tab -&gt; Provider Specific tab), you&#039;ll note the following options that influence the generation of encrypted passwords:&lt;br /&gt;&lt;br /&gt;* &lt;span style=&quot;font-weight:bold;&quot;&gt;Plaintext Passwords Enabled&lt;/span&gt; – true/false – relates how passwords are read from the database table.  If true when WLS retrieves the password from the database, and it encounters a non encrypted password, it will undertake a non encrypted comparison between the user&#039;s password who is attempting to login against the database retrieved password.  If false, WLS will enforce the database password must be encrypted for it to undertake an encrypted password comparison.&lt;br /&gt;&lt;br /&gt;The question arises, how does WLS know the database password is encrypted?  The answer is derived from the next detailed property Password Style Retained, where WLS when writing a new encrypted password to the database prefixes the encrypted password with the encryption algorithm that was used to encrypt the password.  If it&#039;s missing, WLS assumes a plaintext password.&lt;br /&gt;&lt;br /&gt;If the Plaintext Passwords Enabled property is false, one other side effect is if you attempt to set the Password Style property to PLAINTEXT, then update a user&#039;s password in the database, WLS will throw an error stating it doesn&#039;t support PLAINTEXT passwords:&lt;br /&gt;&lt;br /&gt;[Security:099063]Plaintext password usage was rejected.&lt;br /&gt;&lt;br /&gt;Thanks to Ming at Oracle Support for clarifying this property.&lt;br /&gt;&lt;br /&gt;* &lt;span style=&quot;font-weight:bold;&quot;&gt;Password Style Retained&lt;/span&gt; – true/false – the following properties unlike the Plaintext Passwords Enabled property deal with when updating existing user passwords in the database table, not when the password is read.  When WLS writes a password to the table&#039;s password field, along with the encrypted text, it prefixes the password with the password algorithm used wrapped in ellipses.  For example if the SHA-1 algorithm is used, the password would look like:&lt;br /&gt;&lt;br /&gt;{SHA-1}W6PH5MM5PZ8GGIULBPGZG37MJ9G=&lt;br /&gt;&lt;br /&gt;If the Password Style Retained property is set to true, and the existing password has a different encryption algorithm to that specified in the Password Algorithm field, WLS will use the latter to update the password.  If Password Style Retained is set to false, regardless, WLS will overwrite the password with that specified in the Password Algorithm field.&lt;br /&gt;&lt;br /&gt;* Password Algorithm – text field – default SHA-1 – as per the WLS documentation this can be any Java Cryptography Extension (JCE).  Questionably what are the allowable values derived from the JCE?  These are listed in the JSE 6.0 Java Cryptography Architecture Standard Algorithm Name &lt;a href=&quot;http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#algspec&quot;&gt;Documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For password generation we want a &lt;a href=&quot;http://en.wikipedia.org/wiki/Cryptographic_hash_function&quot;&gt;hash&lt;/a&gt; (aka. message digest or 1-way encryption) algorithm.  From the documentation we find that our options are limited to SHA-1 (the default Password Algorithm value), MD2 and MD5.  &lt;br /&gt;&lt;br /&gt;Note that the JSE documentation states the bit size of the produced message digest (SHA-1 = 160-bit, MD2 = 128-bit, MD5 = 128-bit), which will influence the size of your password field to store the encrypted database value.&lt;br /&gt;&lt;br /&gt;The Password Algorithm can be ignored if the Password Style is PLAINTEXT, or, the Password Style Retained is set to true and the password to be updated does not match the current Password Algorithm&#039;s specified function.&lt;br /&gt;&lt;br /&gt;* &lt;span style=&quot;font-weight:bold;&quot;&gt;Password Style&lt;/span&gt; – PLAINTEXT, HASHED, SALTEDHASHED – as guessed the PLAINTEXT option will write the unencrypted password to the database.  A value of HASHED implies the Password Algorithm will be used.  SALTEDHASHED also produces encrypted passwords though different from HASHED.  I&#039;m currently unsure of the difference between HASHED and SALTEDHASHED, the WLS documentation doesn&#039;t differentiate between them, though it does result in a different encrypted value.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Testing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Assuming you&#039;ve configured your SQL Authenticator correctly as per Edwin&#039;s post, let&#039;s test what the different settings of the properties do.&lt;br /&gt;&lt;br /&gt;For our testing let&#039;s assume there&#039;s always an existing user ALPHA whose password we want to update, as well as new users BETA, CHARLIE and DELTA (and so on) who we want to create with a new password.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;First test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Plaintext Passwords Enabled = true&lt;br /&gt;Password Style Retained = true&lt;br /&gt;Password Algorithm = SHA-1&lt;br /&gt;Password Style = HASHED&lt;br /&gt;&lt;br /&gt;For the existing user ALPHA the encrypted password doesn&#039;t include the algorithm prefix (ie. {SHA-1}), in fact it was created by some other system that doesn&#039;t include the prefix.  The ALPHA&#039;s password will be updated to &quot;password&quot;.&lt;br /&gt;&lt;br /&gt;For a new user BETA the password will be set to &quot;password&quot;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;First result&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Updated user ALPHA password = &quot;password&quot;&lt;br /&gt;&lt;br /&gt;For the ALPHA users this result occurs because WLS encounters the Plaintext Passwords Enabled set to true, and the original password stored for the ALPHA user is unencrypted (ie. it&#039;s missing the algorithm prefix).  WLS therefore decides an update to the password must be a plaintext password update.&lt;br /&gt;&lt;br /&gt;New user BETA password = {SHA-1}W6ph5Mm5Pz8GgiULbPgzG37mj9g=&lt;br /&gt;&lt;br /&gt;In this case the BETA user makes use of the SHA-1 algorithm.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Second test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Plaintext Passwords Enabled = true&lt;br /&gt;Password Style Retained = false&lt;br /&gt;Password Algorithm = SHA-1&lt;br /&gt;Password Style = HASHED&lt;br /&gt;&lt;br /&gt;Same as the last test, for the existing ALPHA user the encrypted password doesn&#039;t include the algorithm prefix (ie. {SHA-1}), in fact it was created by some other system that doesn&#039;t include the prefix.  The ALPHA&#039;s password will be updated to &quot;password&quot;.&lt;br /&gt;&lt;br /&gt;For a new user CHARLIE the password will be set to &quot;password&quot;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Second result&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Updated user ALPHA password = {SHA-1}W6ph5Mm5Pz8GgiULbPgzG37mj9g=&lt;br /&gt;&lt;br /&gt;New user CHARLIE password = {SHA-1}W6ph5Mm5Pz8GgiULbPgzG37mj9g=&lt;br /&gt;&lt;br /&gt;In this case the Password Style Retained has overwritten the updated user ALPHA&#039;s password style with the new SHA-1 algorithm equivalent as the Password Style Retained = false setting removes the original plaintext algorithm – in other words the SHA-1 algorithm takes precedence.  As expected the CHARLIE user&#039;s passwords uses the SHA-1 algorithm by default.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Third test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this test we&#039;ll use the existing SHA-1 user ALPHA SHA-1 password, while switching to the MD2 algorithm, while not retaining passwords styles:&lt;br /&gt;&lt;br /&gt;Plaintext Passwords Enabled = true&lt;br /&gt;Password Style Retained = false&lt;br /&gt;Password Algorithm = MD2&lt;br /&gt;Password Style = HASHED&lt;br /&gt;&lt;br /&gt;Existing ALPHA password = {SHA-1}W6ph5Mm5Pz8GgiULbPgzG37mj9g=&lt;br /&gt;&lt;br /&gt;For a new user DELTA the password will be set to &quot;password&quot;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Third result&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Existing ALPHA password = {MD2}8DiBqIxuORNfDsxg79YJuQ==&lt;br /&gt;&lt;br /&gt;New user DELTA password = {MD2}8DiBqIxuORNfDsxg79YJuQ==&lt;br /&gt;&lt;br /&gt;As can be seen WLS switches to the MD2 algorithm in both cases as the Password Style Retained = false property enforces this.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Fourth test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the last test we&#039;ll switch back to the SHA-1 algorithm, and attempt to update the ALPHA user&#039;s MD2 password to the SHA-1 equivalent asking WLS not to retain the existing password style:&lt;br /&gt;&lt;br /&gt;Plaintext Passwords Enabled = true&lt;br /&gt;Password Style Retained = false&lt;br /&gt;Password Algorithm = SHA-1&lt;br /&gt;Password Style = HASHED&lt;br /&gt;&lt;br /&gt;Existing ALPHA password = {MD2}8DiBqIxuORNfDsxg79YJuQ==&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Fourth result&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Existing ALPHA password = {SHA-1}W6ph5Mm5Pz8GgiULbPgzG37mj9g=&lt;br /&gt;&lt;br /&gt;As expected the ALPHA user&#039;s password is changed from the MD2 to SHA-1 encrypted password, again as the Password Style Retained = false property takes affect.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Conclusion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point we&#039;ve seen how WLS can generate encrypted passwords using different algorithms down to the database.  From here it&#039;s important to check the encrypted results in the database are actually &quot;standard&quot;.  In other words if a competing technology uses the SHA-1 algorithm to encrypt a password for example, will it see the same encrypted result WLS produced.  This will be addressed in a following post.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&#039;1&#039; height=&#039;1&#039; src=&#039;https://blogger.googleusercontent.com/tracker/38586079-624150363070835252?l=one-size-doesnt-fit-all.blogspot.com&#039;/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/OneSizeDoesntFitAll/~4/20I7__6ktnU&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;p&gt;&lt;a href=&quot;http://weblogic.sys-con.com/node/1130973&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 05 Oct 2009 15:00:00 EDT</pubDate>
 <guid isPermaLink="true">http://weblogic.sys-con.com/node/1130973</guid>
</item>
<item>
 <title>WebLogic Server - Identity vs Trust Keystores</title>
 <link>http://weblogic.sys-con.com/node/1102839</link>
 <description>In computing most technologies have lots of terms and acronyms to learn, it&#039;s par for the course, you get used to it.  However in computer security the frustration is multiplied as there are often many different terms that mean the same thing.  It makes implementing security hard, because understanding it is hard, and I&#039;m not surprised why security is considered badly implemented because the average Joe will struggle (and for the record I&#039;m the average Chris so I struggle too ;-).&lt;br /&gt;&lt;br /&gt;I&#039;ve been trying recently to get straight in my head what is stored in the WLS identity and trust keystores, and what the difference between identity and trust is anyhow.  Thanks to kind assistance from &lt;a href=&quot;http://kingsfleet.blogspot.com/&quot;&gt;Gerard Davison&lt;/a&gt;, I think I can now post my understandings, and as usual, hopefully the post is helpful to other readers.  As noted however security to me is a difficult area, and so be sure to check the facts here, your mileage with this post may vary.&lt;br /&gt;&lt;br /&gt;The following WLS documentation attempts to explain the concepts of identity and trust:&lt;br /&gt;&lt;a href=&quot; http://download.oracle.com/docs/cd/E12839_01/web.1111/e13707/identity_trust.htm#i1170342&quot;&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/E12839_01/web.1111/e13707/identity_trust.htm#i1170342&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;...in ripping out one of the core paragraphs, with a slight rewrite of my own we can see the concept of identity, and how it relates to the public and private keys:&lt;br /&gt;&lt;br /&gt;&quot;The public key is embedded in a digital certificate with additional information describing the owner of the public key, such as name, street address, and e-mail address *as well as the hostname*. *Along with this the digital certificate containing the public key, and the separate related private key, provide identity for the server*.&quot;&lt;br /&gt;&lt;br /&gt;...ultimately to identify the server, to assert the server is who the server says it is.&lt;br /&gt;&lt;br /&gt;The digital certificate containing the public key is also referred to as the &quot;server certificate&quot;, as for example in 1-way-SSL traffic between the server and client, the server certificate containing the public key is what is initially passed to the client.&lt;br /&gt;&lt;br /&gt;There is a missing piece in the puzzle.  Regardless that the digital certificate states the owner of the public key, their name and so on, how does a client know that the &quot;identity&quot; asserted by the digital certificate is true?  That&#039;s where Certificate Authorities (CAs) come in. &lt;br /&gt;&lt;br /&gt;Ignoring self signed digital certificates, a typical digital certificate used on the internet containing the public key and owner details is signed by a trusted CA who has verified the identity of the owner.  Presumably when purchasing digital certificates from CAs, this is what some of the cost covers, the CAs research into ensuring that the identity details embedded in the digital cert are actually true.&lt;br /&gt;&lt;br /&gt;At runtime on receiving the digital certificate, the client checks the CA and if the CA is one that the client trusts (or a CA in a chain of trusted CAs), then the identity of the server is established/verified.&lt;br /&gt;&lt;br /&gt;Thus the &quot;identity&quot; of the server is established by what&#039;s stored in the &quot;identity&quot; keystore, and its contents are what are farmed out to clients establishing secure connections with the server, who then verify the supplied digital certificate&#039;s CA against the clients own list of trusted CAs.  The &quot;identity keystore&quot; is also referred to as the &quot;server keystore&quot;, because it establishes the server&#039;s identity (ie. I am who I say I am). &lt;br /&gt;&lt;br /&gt;WLS side note: As mentioned the digital certificate also includes the host name of the server, or in other words the digital certificate is pegged to that server and that server alone.  This implies on that server with its relating digital certificate, *all* of the applications will share that single digital certificate for secure communications.  Occasionally a requirement will arise where each application must have its own digital certificate.  In WLS because keystores are configured under an individual WLS &quot;managed server&quot;, if you have two separate applications, it is not possible to use separate digital certificates for each in one managed server.  The solution is to create another managed server with its own keystores.  &lt;br /&gt;&lt;br /&gt;WLS web service side note: Following on from the previous side note, for web services that use in-message encryption and digital signatures, there is often the requirement for multiple different digital certificates.  Under WLS to provision the WS-Security model, WLS has a separate Web Service Security Configuration (WSSC) to provision this setup.&lt;br /&gt;&lt;br /&gt;Finally regarding the trust keystore, what is its job in all of this?  The trust keystore is typically used for storing CA digital certificates, essentially the CAs who will be used to check any digital certificates that are given to the server at runtime (just the same as the client did above).  In the standard 1-way-SSL between a client and the WLS server, the trust keystore doesn&#039;t come into the equation as the client has its own trust keystore (containing the CAs) and the server has nothing to verify.  Yet in the case of mutual SSL (aka. 2 way SSL) between the client and server, the client and server actually swap each other digital certificates to establish identity of both parties, and in this case the server must be able to test the identity of the client through the CA of the client&#039;s digital certificate.&lt;br /&gt;&lt;br /&gt;Mutual SSL side note: the setup of mutual SSL is more complicated than this.  Readers are advised to refer to the following Oracle &lt;a href=&quot;http://www.oracle.com/technology/pub/articles/damo-howto.html&quot;&gt;article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Final author&#039;s note: if any readers find anything particularly wrong with the ideas presented in this post I&#039;d be keen to hear them please.  As I&#039;ve really only experience with 1-way-SSL, it&#039;s hard to know if what I&#039;ve said applies to the concepts of mutual SSL and other security configurations.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&#039;1&#039; height=&#039;1&#039; src=&#039;https://blogger.googleusercontent.com/tracker/38586079-7659683152307350793?l=one-size-doesnt-fit-all.blogspot.com&#039;/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/OneSizeDoesntFitAll/~4/E0uIN0OIr48&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;&lt;p&gt;&lt;a href=&quot;http://weblogic.sys-con.com/node/1102839&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Sat, 12 Sep 2009 17:30:00 EDT</pubDate>
 <guid isPermaLink="true">http://weblogic.sys-con.com/node/1102839</guid>
</item>
<item>
 <title>WebLogic Blog Round-Up</title>
 <link>http://weblogic.sys-con.com/node/102719</link>
 <description>If one of the true signs of a vibrant developer community is an active blogosphere surrounding a technology, then the WebLogic family of technologies certainly passes that test with flying colors. In case you&#039;re not yet active yourself, WLDJ brings you a comprehensive selection from some of the best known (and many of the not so well-known too). Don&#039;t forget that you can blog yourself now, too, at the WLDJ site - you can get started in just three minutes at &lt;a href=&quot;http://blog-n-play.com&quot; title=&quot;http://blog-n-play.com&quot;&gt;http://blog-n-play.com&lt;/a&gt;.&lt;p&gt;&lt;a href=&quot;http://weblogic.sys-con.com/node/102719&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 21 Jun 2005 14:00:00 EDT</pubDate>
 <guid isPermaLink="true">http://weblogic.sys-con.com/node/102719</guid>
</item>
</channel>
</rss>
