<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tech-Blog: Tag idm</title>
    <link>/articles/tag/idm</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Mike Pierson's technology blog</description>
    <item>
      <title>Extracting IdM Configuration from a Running Instance</title>
      <description>&lt;p&gt;An IdM customer recently found themselves in a pickle: they wanted to integrate additional resources into their IdM deployment, but did not have access to the original configuration files or CBE.&lt;/p&gt;

&lt;p&gt;Here are the steps we took to extract configuration from their production repository:&lt;/p&gt;
&lt;ol&gt;
 &lt;li&gt;export configuration from running system via lh
 &lt;li&gt;split export file, one file per top level element
 &lt;li&gt;mangle XML objects (remove date based attributes, GUID etc)
 &lt;li&gt;repeat above for reference, out-of-the-box, IdM deployment
 &lt;li&gt;diff XML object sets (custom deployment vs. reference deployment)
&lt;/ol&gt;

&lt;p&gt;And the details...&lt;/p&gt;

&lt;h3&gt;Export Configuration&lt;/h3&gt;

&lt;p&gt;Use the lh command to extract the running configuration:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ export WSHOME=/var/lib/tomcat/webapps/idm
   mpierson:$ $WSHOME/bin/lh console -c "export /tmp/export.xml"
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: the export process may take some time, and consume significant cycles on the host and the repo; the resulting export.xml file will be of the order of 100Mb, depending on the number of user/resource accounts.&lt;/p&gt;


&lt;h3&gt;Split Export File&lt;/h3&gt;

&lt;p&gt;To facilitate comparison of the custom configs to the reference deployment, split the export file into many files, one per top level waveset element:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ xsltproc split-waveset.xslt /tmp/export.xml
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;We used a &lt;a href='http://qdvt1jwcv8mbupt2.tech-blog.s3.amazonaws.com/split-waveset.xslt'&gt;simple XSL transform&lt;/a&gt; that writes each child of the top level &lt;i&gt;waveset&lt;/i&gt; element to a file, using file names based on name or id attributes, if available.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: the example XSL transform will write the files to a directory called 'split', and there will potentially be &lt;b&gt;many&lt;/b&gt; files created.&lt;/p&gt;

&lt;h3&gt;Mangle XML Objects&lt;/h3&gt;

&lt;p&gt;Again, to facilitate comparison of the custom config objects to the reference deployment, we mangled the split XML files to remove date based attributes, owner/modifier attributes, and GUIDs:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ ./remove-transient-attrs.sh split-dir idm-key-prefix
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;... where &lt;i&gt;split-dir&lt;/i&gt; is the name of the directory containing XML files to be cleansed, and &lt;i&gt;idm-key-prefix&lt;/i&gt; is the first 5-6 characters of the instance ID prefix (i.e. '123456' in "#ID#123456789ABC...")&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: here is the &lt;a href='http://qdvt1jwcv8mbupt2.tech-blog.s3.amazonaws.com/remove-transient-attrs.sh'&gt;bash script&lt;/a&gt; that utilized &lt;i&gt;find&lt;/i&gt; and &lt;i&gt;perl&lt;/i&gt; to strip the relevant attributes.&lt;/p&gt;

&lt;h3&gt;Repeat for Reference Deployment&lt;/h3&gt;

&lt;p&gt;Repeat steps 1 thru 3 to produce an reference set of waveset objects.  Ensure that you reference IdM deployment matches the version, including hotfixes, of the running instance being analyzed.&lt;/p&gt;

&lt;h3&gt;Catalog Differences in Custom Deployment&lt;/h3&gt;

&lt;p&gt;We applied &lt;i&gt;diff&lt;/i&gt; recursively over the two sets of waveset objects:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ diff -N -r --brief -w reference-elements/ custom-elements/
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;The results of a diff will likely include a number of run-time objects, including User, Account, XmlData, and Syslog elements.  Filter run-time objects from the diff for a better view of configuration:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ diff -N -r --brief -w reference-elements/ custom-elements/ |\
    grep -v Account| grep -vi syslog |\
    grep -v TaskInstance | grep -v "User-" |\
    grep -v TaskResult | grep -v XmlData |\
    grep -v WorkItem
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;We used a similar approach to produce a list of the XML objects that define the IdM configuration:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ diff -N -r --brief -w reference-elements/ custom-elements/ |\
    grep -v Account| grep -vi syslog |\
    grep -v TaskInstance | grep -v "User-" |\
    grep -v TaskResult | grep -v XmlData |\
    grep -v WorkItem |\
    awk '{print $4;}' &gt; files.txt
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Notes&lt;/b&gt;: the results of this process provides a starting point for a rigorous reverse engineering endeavour. Manual inspection of the results, and extensive testing are recommended!&lt;/p&gt; 




</description>
      <pubDate>Fri, 24 Apr 2009 22:16:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5ce192e5-9cf2-4199-ba12-0295b39e091f</guid>
      <author>Mike</author>
      <link>/articles/2009/04/24/extracting-idm-configuration-from-a-running-instance</link>
      <category>technology</category>
      <category>idm</category>
      <category>sun</category>
      <trackback:ping>/articles/trackback/461</trackback:ping>
    </item>
    <item>
      <title>Documenting Sun IDM XML Objects</title>
      <description>&lt;p&gt;&lt;i&gt;Note 1: this post details an approach for documenting the configuration objects of Sun's &lt;a href='http://www.sun.com/software/products/identity_mgr/index.xml'&gt;Identity Manager&lt;/a&gt; product.  It's propbably not interesting unless you're an IDM developer.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Note 2: the following article applies to IDM 7.1.  Not sure about earlier or later versions.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;IDM's XML configuration objects have limited support for in-situ programmer comments.  Most high-level elements allow &amp;lt;&lt;i&gt;Comments&lt;/i&gt;&amp;gt; elements, while others support a &lt;i&gt;description&lt;/i&gt; attribute.  Herewith an approach that leverages the existing documentation aspects of the Waveset.dtd, generic XML comment notation, and the waveset XML data iteself to generate IDM implementation documentation.&lt;/p&gt;

&lt;p&gt;A schematic that shows how the approach takes waveset XML objects and converts them to standard document formats:&lt;/p&gt;
&lt;p style='text-align: center; '&gt;&lt;img src='http://tech-blog.mpierson.net/files/Waveset2docbook.png'&gt;&lt;/p&gt;

&lt;p&gt;For the impatient, the XSL that transforms Waveset XML to Docbook XML is &lt;a href='http://tech-blog.mpierson.net/files/waveset2docbook.xsl'&gt;waveset2docbook.xsl&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Documenting a Single XML Object&lt;/h3&gt;
&lt;p&gt;A recipe for generating documentation from an IDM configuration XML file:&lt;/p&gt;

&lt;ol&gt;

 &lt;li&gt;&lt;p&gt;Add a &lt;i&gt;&amp;lt;Comments&amp;gt;&lt;/i&gt; element or @description XML comment to your waveset object.  See below for list of supported elements.&lt;/p&gt;&lt;/li&gt;

 &lt;li&gt;
  &lt;p&gt;Using your favourite XSL processor, transform the waveset XML object to &lt;a href='http://www.docbook.org/'&gt;Docbook&lt;/a&gt; format using &lt;a href='http://tech-blog.mpierson.net/files/waveset2docbook.xsl'&gt;waveset2docbook.xsl&lt;/a&gt;.&lt;br /&gt;
  I use &lt;a ref=''&gt;xsltproc&lt;/a&gt;, e.g.:&lt;/p&gt;
  &lt;blockquote&gt;
    &lt;pre&gt;mpierson:$ xsltproc --stringparam fileName "custom/WEB-INF/config/MyResource.xml" \
  waveset2docbook.xsl custom/WEB-INF/config/MyResource.xml &gt; docs/MyResource.xml&lt;/pre&gt;
  &lt;/blockquote&gt;
  &lt;p&gt;(The &lt;i&gt;fileName&lt;/i&gt; stringparam allows the file's path in the CBE to be included in the documentation.)&lt;/p&gt;
 &lt;/li&gt;

 &lt;li&gt;
  &lt;p&gt;Add an XML declaration to the generated Docbook file:&lt;/p&gt;
  &lt;pre&gt;
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;!DOCTYPE article
  PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"&amp;gt;
  &lt;/pre&gt;
 &lt;/li&gt;
 
 &lt;li&gt;
   &lt;p&gt;Open the generated Docbook XML in OpenOffice using file type &lt;i&gt;Docbook&lt;/i&gt;.  This should work in versions 2.x and 3.x of OpenOffice.&lt;/p&gt;
   &lt;p&gt;- or -&lt;/p&gt;
   &lt;p&gt;Use the &lt;a href='http://docbook.sourceforge.net/'&gt;Docbook XSL stylesheets&lt;/a&gt; to convert your generated Docbook file to HTML or PDF (or &lt;a href='http://wiki.docbook.org/topic/formats'&gt;many other formats&lt;/a&gt;).&lt;/p&gt;
 &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using the above recipe, I've documented a sample LDAP resource adapter definition:&lt;/p&gt;
 &lt;blockquote&gt;&lt;a href='http://tech-blog.mpierson.net/files/MyResource.xml'&gt;MyResource.xml&lt;/a&gt; -&amp;gt; &lt;a href='http://tech-blog.mpierson.net/files/MyResource.dbk'&gt;MyResource.dbk&lt;/a&gt; -&amp;gt; &lt;a href='http://tech-blog.mpierson.net/files/MyResource.doc'&gt;MyResource.doc&lt;/a&gt;&lt;/blockquote&gt;

&lt;h3&gt;Documenting the Entire IDM Implementation&lt;/h3&gt;
&lt;p&gt;A more practical application of this approach to IDM docs, is to produce a single 'as-built' document for all configured XML objects.  This is best achived via a script, which repeats the procedure for a single XML waveset object, and appends each result to a single Docbook document.&lt;/p&gt;

&lt;p&gt;An example script that does just this (including the required Docbook XML declaration) is &lt;a href='http://tech-blog.mpierson.net/files/makeDocs.sh'&gt;here&lt;/a&gt;.  You'll see in the script that I like the generated docs to be included as an appendix in the project documentation.&lt;/p&gt;  

&lt;h3&gt;Supported Waveset Elements&lt;/h3&gt;

&lt;p&gt;The current version of waveset2docbook.xsl supports a subset of the waveset.dtd, but includes most of the high-level elements.&lt;/p&gt;
 &lt;table cellpadding='5' cellspacing='1' border='1'&gt;
  &lt;tr&gt;
    &lt;th&gt;Element&lt;/th&gt;
    &lt;th&gt;Description Element&lt;/th&gt;
    &lt;th&gt;Other Aspects Documented&lt;/th&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:User Extended Attributes&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;extended attributes are enumerated&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:UserUIConfig&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;SummaryAttrNames, QueryableAttrNames, FindSearchAttrs, RepoIndexAttrs&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:Reconciliation Policy&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;
     reconciliation policy attributes (fetch timeout etc.), plus per-resource type configuration (correlation rule, confirmation rule, proxy user, etc.)
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;LoginApp&lt;/td&gt;
    &lt;td&gt;@description&lt;/td&gt;
    &lt;td&gt;LoginModGroups are enumerated&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;LoginModGroup&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;resource type, module type, control type, correlation rule, authentication parameters&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Organizations&lt;/td&gt;
    &lt;td&gt;@description&lt;/td&gt;
    &lt;td&gt;path from Top, policies&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Policy:Account Policy&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Description&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;account ID policy, password policy&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Policy:String Quality Policy&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Description&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;string quality policy attributes are enumerated&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Resource&lt;/td&gt;
    &lt;td&gt;@description&lt;/td&gt;
    &lt;td&gt;flat file format attributes, @prodRef for reference to IDM resource documentation, active sync attributes (proxy user, correlation rule, confirmation rule), &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Rule&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Comments&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;rule type (correlation, confirmation, other)&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:Rule Library&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;documented rules are enumerated, including contents of Comment element in each rule&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;EmailTemplate&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Comments&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;status of 'html enabled' flag&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;TaskDefinition&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Comments&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;referenced sub-tasks, referenced forms&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:WFProcess (sub-task)&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Comments&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;referenced sub-tasks, referenced forms&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;Configuration:Custom Catalog&lt;/td&gt;
    &lt;td&gt;none&lt;/td&gt;
    &lt;td&gt;name and value of each message is listed&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;TaskSchedule&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Description&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;task to run, repitition count and unit&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;User&lt;/td&gt;
    &lt;td&gt;@description&lt;/td&gt;
    &lt;td&gt;user form, admin groups, organizations&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;User Form&lt;/td&gt;
    &lt;td&gt;&lt;i&gt;Comments&lt;/i&gt; element&lt;/td&gt;
    &lt;td&gt;referenced forms&lt;/td&gt;
  &lt;/tr&gt;

 &lt;/table&gt;
&lt;p style='margin-bottom: 2em'&gt;&lt;/p&gt;

&lt;h3&gt;OpenOffice And Docbook&lt;/h3&gt;

&lt;p&gt;It's worth noting that OpenOffice supports Docbook 'out-of-the-box', but &lt;a href='http://xml.openoffice.org/xmerge/docbook/supported_tag_table.html'&gt;not all elements are supported&lt;/a&gt;.  I've adapted the docbook XSL filter from OpenOffice 3.0 to do a better job of rendering the &lt;i&gt;&amp;lt;literallayout&amp;gt;&lt;/i&gt; elements generated by waveset2docbook.xsl. Download it &lt;a href='http://tech-blog.mpierson.net/files/docbooktosoffheadings.xsl'&gt;here&lt;/a&gt;, your results may vary.  The OpenOffice site has instructions for &lt;a href='http://xml.openoffice.org/xmerge/docbook/'&gt;customizing the XML filters&lt;/a&gt;, but I just used the Tools -&amp;gt; XML Filter Settings in OO 3.0.&lt;/p&gt;

</description>
      <pubDate>Fri, 23 Jan 2009 13:23:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1bee94eb-7885-473a-8148-5d5ab1ad6ff3</guid>
      <author>Mike</author>
      <link>/articles/2009/01/23/documenting-sun-idm-xml-objects</link>
      <category>programming</category>
      <category>idm</category>
      <category>docbook</category>
      <category>xsl</category>
      <trackback:ping>/articles/trackback/443</trackback:ping>
    </item>
    <item>
      <title>links for 2007-02-13</title>
      <description>&lt;ul class="delicious"&gt;
	&lt;li&gt;
		&lt;div class="delicious-link"&gt;&lt;a href="http://textdrive.com/hosting/accelerator"&gt;TextDrive Accelerator Hosting&lt;/a&gt;&lt;/div&gt;
		&lt;div class="delicious-tags"&gt;(tags: &lt;a href="http://del.icio.us/mpierson/solaris"&gt;solaris&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/hosting"&gt;hosting&lt;/a&gt;)&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;div class="delicious-link"&gt;&lt;a href="http://docs.sun.com/source/819-6127/adapters.html"&gt;IDM 7: Developing adapters&lt;/a&gt;&lt;/div&gt;
		&lt;div class="delicious-tags"&gt;(tags: &lt;a href="http://del.icio.us/mpierson/sun"&gt;sun&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/idm"&gt;idm&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/java"&gt;java&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/identity"&gt;identity&lt;/a&gt;)&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;


</description>
      <pubDate>Mon, 12 Feb 2007 19:18:57 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:76cf78f4-b1c6-404b-bf13-bd9e9e190f23</guid>
      <author>Mike</author>
      <link>/articles/2007/02/12/links-for-2007-02-13</link>
      <category>delicious</category>
      <category>solaris</category>
      <category>hosting</category>
      <category>sun</category>
      <category>idm</category>
      <category>java</category>
      <category>identity</category>
      <trackback:ping>/articles/trackback/333</trackback:ping>
    </item>
  </channel>
</rss>

