<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Objectopia &#187; Jon Court</title>
	<atom:link href="http://objectopia.com/author/joncourt/feed/" rel="self" type="application/rss+xml" />
	<link>http://objectopia.com</link>
	<description></description>
	<lastBuildDate>Fri, 23 Dec 2011 12:33:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='objectopia.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Objectopia &#187; Jon Court</title>
		<link>http://objectopia.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://objectopia.com/osd.xml" title="Objectopia" />
	<atom:link rel='hub' href='http://objectopia.com/?pushpress=hub'/>
		<item>
		<title>A story of an awful tirade from an awful woman</title>
		<link>http://objectopia.com/2011/12/23/getting-shouted-at-by-an-awful-stranger-why-do-you-let-them-talk-to-you-like-that/</link>
		<comments>http://objectopia.com/2011/12/23/getting-shouted-at-by-an-awful-stranger-why-do-you-let-them-talk-to-you-like-that/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 12:27:31 +0000</pubDate>
		<dc:creator>Jon Court</dc:creator>
				<category><![CDATA[Grrrr...]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://objectopia.com/?p=403</guid>
		<description><![CDATA[I got verbally abused yesterday by a horrible woman in my own front yard and I let it happen! Why the hell did I let it happen - it was totally unacceptable behaviour I was subjected to and now I'm just mad mad mad at my 'weakness' and not sleeping well.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=403&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m mad, very mad and a bit ashamed of myself for cow-towing to an awful woman who had the audacity to berate me in my own home about the state of my garden! My biggest question is why the hell did I let her speak to me like that! And why couldn&#8217;t she just ask if I could do something about a particular weed that was seeding to her garden.</p>
<h3>A story of an awful tirade from an awful woman</h3>
<p>Yesterday morning I was working at home minding my business when I was hailed from a complete stranger coming up my drive. Being polite and friendly I wandered out and said hello thinking that it was a delivery or perhaps someone needed some help (I was expecting a question about directions or something). I live in a very nice neighbourhood where I know all my closest neighbours and all the local shop keepers; my kids are friends with many of my neighbours kids too. I was expecting another of these pleasant conversations &#8211; hey it was a sunny day and I was in a good mood. Christmas in a couple of days.</p>
<p>What followed was an awful tirade from an awful woman starting with &#8216;HOW CAN YOU LIVE LIKE THIS, IT&#8217;S DISGUSTING, WHY AREN&#8217;T YOU DOING SOMETHING ABOUT IT&#8217;. Completely taken aback and immediately on the back foot I&#8217;ve gone down the appeasement track &#8211; &#8216;Yes, I completely agree it&#8217;s messy, we&#8217;ve got plans in the pipeline to remedy it but we&#8217;re not ready yet&#8217;. This is the truth, I find little point in working for hours clearing and preening the garden when we&#8217;re planning to reshape it with a big digger soon &#8211; we have often put time in though, particularly my wife has spent days pulling up some of the weeds only for them to grow back (we spray too from time to time), but we have a family and like to spend time doing things we care more about &#8211; as would many people I expect. Well, the appeasement didn&#8217;t work, I got &#8216;THAT&#8217;S NOT GOOD ENOUGH, YOU&#8217;VE GOT MUSCLES, PULL ALL THIS OUT&#8217;. I say &#8216;I agree it&#8217;s a mess, I don&#8217;t really have time to fix it we&#8217;re quite busy&#8217;. I get &#8216;WE&#8217;RE ALL BUSY&#8217;&#8230;. blah blah you get the point. It went on for about 10 minutes. The simple truth is that for us it&#8217;s not a priority.</p>
<p>So, smarting, shocked and a little ashamed of myself I get to work finding someone who can clear the plot quick smart before I get another berating. I found someone, they&#8217;ve been a bit pricey, but they&#8217;ve come around and cleared it out today. I&#8217;ve also used the opportunity of a day off and a skip bin on the property to break up an old fish pond that&#8217;s been bothering be for a while. So net net it&#8217;s a positive result right? Wrong!!</p>
<h3>Now I&#8217;m so mad I can&#8217;t sleep</h3>
<p>Now that I&#8217;ve woken from my &#8216;trance&#8217; I&#8217;m left thinking what the &#8216;hell happened to me, why the hell did I do that?!&#8217; I just let a horrible person blithely walk all over me while I moped around like a troublesome schoolboy and then quick smart did as I was told. I&#8217;m 38, I&#8217;ve worked in banks where I&#8217;ve been shouted at by the stereotypical equities trader &#8211; and not put up with it. How did this woman put me immediately on the back foot and in cow-towing mode rather that me telling her to piss off and come back when she can talk to me as an equal. I certainly wouldn&#8217;t let my kids talk to me like that.</p>
<p>I&#8217;m left so mad half at her and half at myself I&#8217;m struggling to sleep. I can only envision the smugness. Horribleness wins the day again dammit!</p>
<h3>So why did I cave?</h3>
<p>Generally I think it&#8217;s because when it&#8217;s unexpected you&#8217;re on the back foot and not sure if they have a point? You&#8217;re immediately apologetic (well you are if you want to be generally a decent person anyway). It&#8217;s not until later when you review the situation for probably the 100th time in your head that you start to berate yourself and imagine other responses and lament that you weren&#8217;t quick enough, or that you&#8217;re just not good enough at arguing, etc&#8230; etc&#8230;</p>
<p>In my current case there are a few reasons I think:</p>
<ol>
<li>she has a point &#8211; the garden is a mess, an her main concern is a particular weed which is close to seeding &#8211; probably into her garden (I don&#8217;t know where she lives, must be close by though);</li>
<li>it was a bolt from the blue so I was gobsmacked and mentally unprepared to put this kind of childish behaviour down;</li>
<li>she&#8217;s obviously very upset and has probably been stewing on it for a while (perhaps she needed to be angry to have the courage to come up the drive) &#8211; I hate for people to be feeling like that;</li>
<li>I hate to think all our neighbours are getting upset with us &#8211; I like this community (this is the main reason I actually did something about it);</li>
<li>I&#8217;m busy thinking fast about all these scenarios while in the background she&#8217;s stomping around ranting in an epic tantrum so I continue to be unprepared to put the stroppy behaviour down;</li>
<li>I&#8217;m unsure of my position &#8211; perhaps harking back to some natural hierarchy encoding or something, she is older an wiser (perhaps not in this case) than me.</li>
</ol>
<h3>So what should I have done?</h3>
<p>With 20/20 hindsight I think an opening salvo of appeasement was the correct response in this case and in so doing I gave her the benefit of the doubt that she is actually just an upset nice person. That not working? then a firm &#8216;cease and desist the personal attack&#8217; and a request to discuss the matter civilly would have been the correct next action.</p>
<p>The &#8216;cease and desist&#8217; action may or may not have worked &#8211; but at least I wouldn&#8217;t have stewed over my weakness in the situation for the last couple of days. It&#8217;s going to cost years at the end of my life I expect. I would still have gone ahead with the section clear &#8211; if just for reason 4 above &#8211; but at least I would have been clear on my reasons and she would have been clear that the kind of childish temper tantrum she was displaying would not be tolerated.</p>
<h3>As it stand&#8217;s I&#8217;m still mad and trying to find a way through</h3>
<p>Christmas is coming and the only person really being hurt by this whole debacle is me. What do I do to get past it?</p>
<p>Well, writing this is helping I think. I&#8217;m thinking just now that perhaps I need to change my view of an awful woman to just a &#8216;upset nice person&#8217; and perhaps apologise for my tardiness? Perhaps the tantrum was very out of character for her? I would expect a thank-you and a sincere apology in that case, I&#8217;m open-minded to it but not hopeful.</p>
<h3>It is unacceptable to behave like that though &#8211; especially straight off the bat</h3>
<p>It was a childish temper tantrum &#8211; there&#8217;s no doubt about that. Be she a &#8216;upset nice person&#8217; or just a born and bred &#8216;awful person&#8217; it still stands that it was unacceptable to personally attack me and my family with a tirade of abuse straight off the bat. All it&#8217;s done is left bad feeling and sleep for us&#8230; I suspect she&#8217;s sleeping soundly.</p>
<h3>She only needed to ask!!</h3>
<p>We&#8217;re friendly and nice, we&#8217;d bend over backwards if asked by any of our neighbours. A simple request to &#8216;take out that thistle weed please&#8217; would have been enough and would have been an excellent goodwill exercise. Instead she&#8217;s assumed we&#8217;re bad people and out to ruin her garden with our terrible weeds and I&#8217;m left running scenarios for what I&#8217;m going to say next time I run into her and feeling generally rather bad (seems like a grieving process). That&#8217;s very unfriendly, disrespectful and just not nice behaviour. I don&#8217;t like this woman and I&#8217;ve only just met her. Jeez if I was an unfriendly type I might have clocked her.</p>
<p>I certainly hope it doesn&#8217;t happen again.</p>
<address> </address>
<address>Regards,</address>
<address>Jon</address>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/objectopia.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/objectopia.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/objectopia.wordpress.com/403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=403&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://objectopia.com/2011/12/23/getting-shouted-at-by-an-awful-stranger-why-do-you-let-them-talk-to-you-like-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7ddc6e9ae66ab24ffd7fcf82cea3c8d7?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Jon Court</media:title>
		</media:content>
	</item>
		<item>
		<title>Securing your JBoss JMX Invoker Layer</title>
		<link>http://objectopia.com/2009/10/01/securing-jmx-invoker-layer-in-jboss/</link>
		<comments>http://objectopia.com/2009/10/01/securing-jmx-invoker-layer-in-jboss/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 04:53:18 +0000</pubDate>
		<dc:creator>Jon Court</dc:creator>
				<category><![CDATA[Java etc...]]></category>
		<category><![CDATA[AuthenticationInterceptor]]></category>
		<category><![CDATA[AuthorizationInterceptor]]></category>
		<category><![CDATA[Invoker Layer]]></category>
		<category><![CDATA[jaas]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[JBoss 4.2.1.GA]]></category>
		<category><![CDATA[JMX]]></category>
		<category><![CDATA[JMX Security]]></category>
		<category><![CDATA[jmx-console]]></category>
		<category><![CDATA[jmx-invoker]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[MBean]]></category>
		<category><![CDATA[twiddle]]></category>
		<category><![CDATA[XMBean]]></category>

		<guid isPermaLink="false">http://objectopia.com/?p=154</guid>
		<description><![CDATA[If you use JBoss you would have secured the JMX Console and the Web Console (or you should have) but did you also secure the invoker layer? Or put another way - can any old monkey with the knowledge shutdown your container even though you've secured your JMX &#38; Web consoles?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=154&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you use JBoss and have a nicely secured JMX Console and/or Web Console it&#8217;s a fairly safe bet that, like me, you haven&#8217;t secured the invoker layer; meaning any old monkey can most likely shutdown your container whenever they feel like it.</p>
<p>Recently I implemented an MBean in JBoss to use as a batch trigger from a ControlM implementation and was surprised (probably shouldn&#8217;t have been though) that all my carefully crafted security for the JMXConsole and Web Console was ignored with complete impunity by the tool (twiddle.sh) that I used to invoke my MBean. Since then I&#8217;ve been through a pile of pain trying to get an RMI call to a JBoss XMBean to require authentication and I thought I&#8217;d put some instructions in plain language on how to do it.</p>
<p>I do this for two reasons:</p>
<ol>
<li>because I bet a lot of developers miss this one; and</li>
<li>because the documentation and other information I find online is limited and confusing.</li>
</ol>
<p>For demonstration I&#8217;m going to use a standard JBoss MBean for setting system properties in a running application container.</p>
<h3>A Simple Example of Setting a System Property in JBoss using Twiddle</h3>
<p>Using the default JBoss version of twiddle.sh (in the bin directory beneath JBoss home) against the default JNP location of JBoss (localhost:1099) you can execute the following to set a system property in a running container.</p>
<p><pre class="brush: bash; light: true;">
# this assumes you're in the bin directory of JBoss Home.
./twiddle.sh -s localhost:1099 invoke &quot;jboss:type=Service,name=SystemProperties&quot; set myprop mypropvalue
'null'
</pre></p>
<p>To verify that you have been succesful (assuming you didn&#8217;t get an exception in the last operation) you can do the following:</p>
<p><pre class="brush: bash; light: true;">
# this assumes you're in the bin directory of JBoss Home.
./twiddle.sh -s localhost:1099 invoke &quot;jboss:type=Service,name=SystemProperties&quot; get myprop
mypropvalue
</pre></p>
<p>This example will work from anywhere on your network where you&#8217;re not prevented from reaching the JNP URL of the container (prevented by a firewall or IP filter for example) regardless of the JMX Console and Web Console security you&#8217;ve put in place (there is plenty of documentation around for securing the JMX Console and Web Console). This is because the JMX Console and Web Console are HTTP based and as such are secured in the normal way you would secure a website on JBoss (i.e. in web-inf.xml and jboss-web.xml) whereas the invoker layer is not HTTP based and as such must use an alternate method of security; the key file in this operation is the jmx-invoker-service.xml file in the JBoss deploy directory.</p>
<h3><strong>Securing the Invoker Layer</strong></h3>
<p>The invoker layer is the one you are calling through when you query or invoke on an MBean via RMI (i.e. with twiddle.sh &#8211; as above). This layer is <strong>not </strong>subject to the security constraints you <strong>will </strong>have placed on your HTTP based JMX Console or Web Consoles.</p>
<p>To make this layer secure the key file you&#8217;re interested in is the jmx-invoker-service.xml in the JBoss deploy directory; and the key operation configuration you will need to change is for &#8216;invoke&#8217;.</p>
<p>The <strong>default </strong>configuration of the invoke operation in this file is:</p>
<p><pre class="brush: xml; highlight: [24,25];">
&lt;server&gt;

	&lt;!-- excluded for brevity --&gt;

	&lt;mbean code=&quot;org.jboss.jmx.connector.invoker.InvokerAdaptorService&quot; name=&quot;jboss.jmx:type=adaptor,name=Invoker&quot; xmbean-dd=&quot;&quot;&gt;
		&lt;xmbean&gt;
			&lt;description&gt;The JMX Detached Invoker Service&lt;/description&gt;
			&lt;class&gt;org.jboss.jmx.connector.invoker.InvokerAdaptorService&lt;/class&gt;

			&lt;!-- excluded for brevity --&gt;

			&lt;operation&gt;
				&lt;description&gt;The detached invoker entry point&lt;/description&gt;
				&lt;name&gt;invoke&lt;/name&gt;
				&lt;parameter&gt;
					&lt;description&gt;The method invocation context&lt;/description&gt;
					&lt;name&gt;invocation&lt;/name&gt;
					&lt;type&gt;org.jboss.invocation.Invocation&lt;/type&gt;
				&lt;/parameter&gt;
				&lt;return-type&gt;java.lang.Object&lt;/return-type&gt;
				&lt;descriptors&gt;
					&lt;interceptors&gt;

						&lt;!-- Uncomment to require authenticated users --&gt;
						&lt;!-- &lt;interceptor code=&quot;org.jboss.jmx.connector.invoker.AuthenticationInterceptor&quot; securityDomain=&quot;java:/jaas/jmx-console&quot;/&gt; --&gt;

						&lt;!-- Interceptor that deals with non-serializable results --&gt;
						&lt;interceptor code=&quot;org.jboss.jmx.connector.invoker.SerializableInterceptor&quot; policyClass=&quot;StripModelMBeanInfoPolicy&quot;/&gt;

					&lt;/interceptors&gt;
				&lt;/descriptors&gt;
			&lt;/operation&gt;
		&lt;/xmbean&gt;
	&lt;/mbean&gt;
&lt;/server&gt;
</pre></p>
<p>So to switch on authentication we do what it says and &#8216;Uncomment to require authenticated users&#8217;:</p>
<p><pre class="brush: xml; highlight: [24,25];">
&lt;server&gt;

	&lt;!-- excluded for brevity --&gt;

	&lt;mbean code=&quot;org.jboss.jmx.connector.invoker.InvokerAdaptorService&quot; name=&quot;jboss.jmx:type=adaptor,name=Invoker&quot; xmbean-dd=&quot;&quot;&gt;
		&lt;xmbean&gt;
			&lt;description&gt;The JMX Detached Invoker Service&lt;/description&gt;
			&lt;class&gt;org.jboss.jmx.connector.invoker.InvokerAdaptorService&lt;/class&gt;

			&lt;!-- excluded for brevity --&gt;

			&lt;operation&gt;
				&lt;description&gt;The detached invoker entry point&lt;/description&gt;
				&lt;name&gt;invoke&lt;/name&gt;
				&lt;parameter&gt;
					&lt;description&gt;The method invocation context&lt;/description&gt;
					&lt;name&gt;invocation&lt;/name&gt;
					&lt;type&gt;org.jboss.invocation.Invocation&lt;/type&gt;
				&lt;/parameter&gt;
				&lt;return-type&gt;java.lang.Object&lt;/return-type&gt;
				&lt;descriptors&gt;
					&lt;interceptors&gt;

						&lt;!-- Uncomment to require authenticated users --&gt;
						&lt;interceptor code=&quot;org.jboss.jmx.connector.invoker.AuthenticationInterceptor&quot; securityDomain=&quot;java:/jaas/jmx-console&quot;/&gt;

						&lt;!-- Interceptor that deals with non-serializable results --&gt;
						&lt;interceptor code=&quot;org.jboss.jmx.connector.invoker.SerializableInterceptor&quot; policyClass=&quot;StripModelMBeanInfoPolicy&quot;/&gt;

					&lt;/interceptors&gt;
				&lt;/descriptors&gt;
			&lt;/operation&gt;
		&lt;/xmbean&gt;
	&lt;/mbean&gt;
&lt;/server&gt;
</pre></p>
<p>If you haven&#8217;t changed the default security realm for your JMX Console (i.e. java:/jaas/jmx-console) you will now have an invoker layer secured with the same credentials as for your JMX Console. To change this add a new security realm to your global login-config.xml in the conf directory of your container and match the name you give it in the securityDomain attribute of the Authentication Interceptor.</p>
<p>I&#8217;ve not yet delved too deeply into setting a specific set of roles, at this point I set my invoker user to JBossAdmin which means that user can do pretty much anything exposed to JMX. That&#8217;s ok for my purposes tho (feel free to write a response with the details of setting roles for particular JMX functions <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<h3>Invoking on a Secure Invoker Layer</h3>
<p>Ok so now that it&#8217;s secure how do you invoke an operation on it?</p>
<p>With the default JBoss twiddle.sh utility there are arguments -u (or &#8211;user=) for user and -p (&#8211;password=) for password.</p>
<p><pre class="brush: bash; light: true;">
# this assumes you're in the bin directory of JBoss Home.
./twiddle.sh -s localhost:1099 --user=myuser --password=mypassword invoke &quot;jboss:type=Service,name=SystemProperties&quot; get myprop
mypropvalue
</pre></p>
<p>These arguments work fine except your password is now in clear text and even worse is visible in the process list while it&#8217;s executing &#8211; in clear text with &#8216;password=&#8217; conveniently placed for extraction by a simple script!! This seems a bit of an oversight in the tool to me.</p>
<p>To get around this issue in my environment I took the source and modified the main class of twiddle.jar to accept a password from Standard In (patch is below &#8211; no promises or guarantees though) which prevents the password showing in your password list and allows you to use standard encryption utilities to decrypt and pipe it into the process without ever making it visible clear text.</p>
<p>You would now invoke as follows:</p>
<p><pre class="brush: bash; light: true;">
# this assumes you're in the bin directory of JBoss Home.
mypassword | ./twiddle.sh -s localhost:1099 --user=myuser invoke &quot;jboss:type=Service,name=SystemProperties&quot; get myprop
mypropvalue
</pre></p>
<p>or better; from an encrypted password file (or better yet a repository) such as follows:</p>
<p><pre class="brush: bash; light: true;">
# this assumes you're in the bin directory of JBoss Home and have previously encrypted your password and encryption key into ~/.&lt;username&gt;.key and ~/.&lt;username&gt;.psw.
KEY=`cat ~/.&lt;execution username&gt;.key`
PWD=`cat ~/.&lt;execution username&gt;.psw | crypt $KEY`

PWD | ./twiddle.sh -s localhost:1099 --user=myuser invoke &quot;jboss:type=Service,name=SystemProperties&quot; get myprop
mypropvalue
</pre></p>
<p>to encrypt your password to be used as above you might do:</p>
<p><pre class="brush: bash; light: true;">
echo &quot;&lt;password&gt;&quot; | crypt &gt; ~/.&lt;execution username&gt;.psw
</pre></p>
<p>which will request an encryption key which you would save as follows (for this example anyway):</p>
<p><pre class="brush: bash; light: true;">
cat &quot;&lt;encryption key&gt;&quot; &gt; ~/.&lt;execution username&gt;.key
</pre></p>
<p>These files would, of course, be accessable only from your execution user.</p>
<h3>Securing the JMX Console</h3>
<p>For reference the key files you&#8217;re interested in here are:</p>
<ul>
<li>conf/login-config.xml</li>
<li>deploy/jmx-console.war/META-INF/web.xml</li>
<li>deploy/jmx-console.war/META-INF/jboss-web.xml</li>
</ul>
<h3><strong>Securing the JMX Web Console</strong></h3>
<p>For reference the key files you&#8217;re interested in here are:</p>
<ul>
<li>conf/login-config.xml</li>
<li>deploy/management/web-console.war/META-INF/web.xml</li>
<li>deploy/management/web-console.war/META-INF/jboss-web.xml</li>
</ul>
<h3><strong>Stack</strong></h3>
<p>These instructions will apply broadly but for reference purposes the stack I have is:</p>
<ul>
<li>JBoss 4.2.3.GA</li>
<li>Java jdk1.6.0_13</li>
<li>Windows XP or Solaris 10</li>
</ul>
<h3>References</h3>
<p><a title="http://www.jboss.org/community/wiki/Twiddle" href="http://www.jboss.org/community/wiki/Twiddle" target="_blank">http://www.jboss.org/community/wiki/Twiddle</a></p>
<p><a title="http://www.jboss.org/community/wiki/jbossserver-aquicktour" href="http://www.jboss.org/community/wiki/jbossserver-aquicktour#The_JBoss_Server___A_Quick_Tour-The_JMX_Console" target="_blank">http://www.jboss.org/community/wiki/jbossserver-aquicktour</a></p>
<p><a title="https://jira.jboss.org/jira/secure/attachment/12313982/jboss-securejmx.pdf (PDF Document)" href="https://jira.jboss.org/jira/secure/attachment/12313982/jboss-securejmx.pdf">https://jira.jboss.org/jira/secure/attachment/12313982/jboss-securejmx.pdf</a> (PDF Document)</p>
<address> </address>
<address> </address>
<address>Regards,</address>
<address>Jon</address>
<address> </address>
<address> </address>
<p> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Patch For Twiddle to Take Password from StdIn (no promises or guarantees)</p>
<p><pre class="brush: bash; collapse: true; light: false; toolbar: true;">

Index: src/main/org/jboss/console/twiddle/Twiddle.java
===================================================================
--- src/main/org/jboss/console/twiddle/Twiddle.java    (revision 94201)
+++ src/main/org/jboss/console/twiddle/Twiddle.java    (working copy)
@@ -24,8 +24,10 @@
 import gnu.getopt.Getopt;
 import gnu.getopt.LongOpt;

+import java.io.BufferedReader;
 import java.io.File;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -41,7 +43,6 @@
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-
 import org.jboss.console.twiddle.command.Command;
 import org.jboss.console.twiddle.command.CommandContext;
 import org.jboss.console.twiddle.command.CommandException;
@@ -148,7 +149,7 @@
 }
 };
 }
-
+
 public Command createCommand(final String name)
 throws NoSuchCommandException, Exception
 {
@@ -383,7 +384,7 @@

 out.println(&quot;A JMX client to 'twiddle' with a remote JBoss server.&quot;);
 out.println();
-      out.println(&quot;usage: &quot; + PROGRAM_NAME + &quot; [options] &lt;command&gt; [command_arguments]&quot;);
+      out.println(&quot;usage: [echo &lt;password&gt; | ] &quot; + PROGRAM_NAME + &quot; [options] &lt;command&gt; [command_arguments]&quot;);
 out.println();
 out.println(&quot;options:&quot;);
 out.println(&quot;    -h, --help                Show this help message&quot;);
@@ -397,6 +398,10 @@
 out.println(&quot;    -u, --user=&lt;name&gt;         Specify the username for authentication&quot;);
 out.println(&quot;    -p, --password=&lt;name&gt;     Specify the password for authentication&quot;);
 out.println(&quot;    -q, --quiet               Be somewhat more quiet&quot;);
+      out.println();
+      out.println(&quot;A password should be passed in by echoing it and piping it to the command. If you&quot;);
+      out.println(&quot;use the -p (--password) option your password may be visible in clear text in a &quot;);
+      out.println(&quot;process listing such as `ps -ef`.&quot;);
 out.flush();
 }

@@ -421,6 +426,28 @@
 Getopt getopt = new Getopt(PROGRAM_NAME, args, sopts, lopts);
 int code;

+        /* Get standard in if it's there - assume it's a password. This is to allow a password to be passed and
+         * prevent it showing in a process listing (e.g. ps -ef in Unix). The -p argument will be ignored if
+         * the password is passed through Standard In.
+         */
+        boolean passwordRetrievedFromStdIn = false;
+        if (System.in.available() &gt; 0) {
+            InputStreamReader inp = new InputStreamReader(System.in);
+            BufferedReader br = new BufferedReader(inp);
+            String stdin = br.readLine();
+
+            if (stdin != null &amp;amp;&amp;amp; stdin.trim().length() &gt; 0) {
+                String password = stdin.trim();
+                SecurityAssociation.setCredential(password);
+
+                passwordRetrievedFromStdIn = true;
+
+                if (log.isDebugEnabled()) {
+                    log.debug(&quot;Password retrieved from standard in. Ignoring -p argument.&quot;);
+                }
+            }
+        }
+
 PROCESS_ARGUMENTS:

 while ((code = getopt.getopt()) != -1)
@@ -531,8 +558,13 @@
 SecurityAssociation.setPrincipal(new SimplePrincipal(username));
 break;
 case 'p':
-                 String password = getopt.getOptarg();
-                 SecurityAssociation.setCredential(password);
+                  if (!passwordRetrievedFromStdIn) {
+                     String password = getopt.getOptarg();
+                     SecurityAssociation.setCredential(password);
+
+                     log.warn(&quot;Password retrieved from -p argument. Your password may be visible in cleartext in a process listing during execution. &quot; +
+                             &quot;Consider using Standard In to enter the password instead (i.e. echo \&quot;password\&quot; | twiddle ...)&quot;);
+                  }
 break;

 // Enable quiet operations

</pre></p>
<address> </address>
<address> </address>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;">
<pre> light="true"</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/objectopia.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/objectopia.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/objectopia.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=154&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://objectopia.com/2009/10/01/securing-jmx-invoker-layer-in-jboss/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7ddc6e9ae66ab24ffd7fcf82cea3c8d7?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Jon Court</media:title>
		</media:content>
	</item>
		<item>
		<title>Passionate About Programming</title>
		<link>http://objectopia.com/2009/06/27/passionate-about-programming/</link>
		<comments>http://objectopia.com/2009/06/27/passionate-about-programming/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 06:27:20 +0000</pubDate>
		<dc:creator>Jon Court</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Certified Awesome]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Passionate Programmer]]></category>
		<category><![CDATA[Software Delivery]]></category>

		<guid isPermaLink="false">http://objectopia.wordpress.com/?p=98</guid>
		<description><![CDATA[Today I bought The Passionate Programmer from the Pragmatic Bookstore; this is the 2nd Edition of My Job Went to India: 52 Ways to Save Your Job and has been re-targeted more clearly at becoming an &#8216;awesome developer&#8217; rather than &#8216;doing enough to not get fired&#8217; which the earlier title implied. While buying this I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=98&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I bought <a href="http://www.pragprog.com/titles/cfcar2/the-passionate-programmer">The Passionate Programmer</a> from the Pragmatic Bookstore; this is the 2nd Edition of <a href="http://www.pragprog.com/titles/mjwti/my-job-went-to-india">My Job Went to India: 52 Ways to Save Your Job</a> and has been re-targeted more clearly at becoming an &#8216;awesome developer&#8217; rather than &#8216;doing enough to not get fired&#8217; which the earlier title implied. While buying this I was distracted by a post on The Pragmatic Life blog called <a href="http://praglife.typepad.com/pragmatic_life/2009/06/share-your-passion.html/">Share Your Passion</a> which inspired me to share what it is that makes us (the bloggers here) passionate about developing software. BTW: So far the book is great &#8211; thanks <a href="http://chadfowler.com/">Chad</a>.</p>
<p>There is synchronicity at play here; when we started this blog the other day we were toying with subtitles and one of the ones we considered seriously was a tongue in check &#8216;awesomeness codified&#8217; (personally I still like this the best even though I didn&#8217;t come up with it <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> ). Part of the reason we started this blog is to put stuff out in the public domain to get feedback. To reach out to people who know and understand more than us in the public domain and to share what we&#8217;ve found to those close behind us on the curve. We are hoping to get the sort of feedback that will help us move closer to &#8216;awesomeness&#8217; in software development. We also want to have a place to whinge about things we find annoying <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> .</p>
<p>Each of us is near the top of the chain in our organisation; we have broad and deep skills in many areas of the Java and Java EE space and have been around the block many times in both successful and failed projects; we&#8217;ve been shouted at, we&#8217;ve worked all night, gotten depressed and received accolades and glory. Also, a large part of our experience has been in banking &#8211; which has it&#8217;s own world of pain points but can also be a glorious industry to work in for a software developer.</p>
<p>Obviously you take the good with the bad &#8211; but how have we kept our heads above water (psychologically) during the bad times &#8211; it is because we are passionate about what we do and deep down we are still enjoying the cut and thrust of software development it even when the poo is hitting the fan.</p>
<p>We were discussing recently how much we enjoyed one night a few years ago where we were in the office all night and most of the next day (after a full days work too) because of the intensity of the situation that the business was in. Basically we received in one night far more volume than was expected and we had to &#8216;massage&#8217; it through systems that were in their infancy and in no way ready to scale to the level of data we had to process. Regardless of how we got into this situation (obviously in an ideal world we might have planned better) we had to now manage it and were on the critical path of a successful or failed year end process (i.e. make or lose lotsa money). This meant that we had some very senior executive director level people in the business right down to the current season of graduate interns and us all working as a unit, in the zone, to get over the line. It was stressful, difficult and tiring but we felt a part of something; we were able to display skills and aptitudes in a very visible way and deliver results instantly, not just the results in managing overburdened systems but in joining business decisions using peripheral skills gained in building software for the business we were a part of. It was an environment of mutual trust and respect with everybody intensely focused on a positive outcome regardless of position or role in the business. This is awesomeness codified.</p>
<p>Anyway, back to the point &#8211; we want to become &#8216;awesome developers&#8217;. This doesn&#8217;t mean &#8216;they who know the most api calls in the java.lang package&#8217; or &#8216;they who can make JBoss sing the national anthem &#8211; in a language of your choice (while washing the dishes)&#8217;*; it means we want to love what we are doing and to inspire others (in the space) to love what they are doing; it means we want to be able to deliver robust, reusable, reliable and &#8216;awesome&#8217; solutions better and better every time; it means we accept that someone will always know more than us and that we will strive to meet those people that we might incorporate what they know into delivering better and better solutions; it means we want to be a part of and understand the businesses we work with and within, again so we can deliver better and better solutions; it means we want colleagues (it &amp; business) to say &#8216;wow, they really care about what they do&#8217;.</p>
<p>So this is why we blog. We want the feedback; we want to attract developers who are already awesome &#8211; though they may not know it &#8211; to help us improve. However, to be brutally honest maybe we just want to be famous <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>* we can though, well &#8211; maybe not the dishes bit.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/objectopia.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/objectopia.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/objectopia.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=98&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://objectopia.com/2009/06/27/passionate-about-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7ddc6e9ae66ab24ffd7fcf82cea3c8d7?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Jon Court</media:title>
		</media:content>
	</item>
		<item>
		<title>MS Word for Mac &#8211; Hate the Toolbox</title>
		<link>http://objectopia.com/2009/06/18/ms-word-for-mac/</link>
		<comments>http://objectopia.com/2009/06/18/ms-word-for-mac/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 11:49:27 +0000</pubDate>
		<dc:creator>Jon Court</dc:creator>
				<category><![CDATA[Grrrr...]]></category>
		<category><![CDATA[Microsoft Word for Mac]]></category>

		<guid isPermaLink="false">http://joncourt.wordpress.com/2009/06/18/ms-word-for-mac/</guid>
		<description><![CDATA[Is it just me or is the toolbox in MS Word 2008 for Mac ridiculously small (read: horrid). I&#8217;m battling with a document with many styles at the moment and am finding myself scrolling up and down, up and down endlessly in a scroll window that displays 5 styles at a time. I&#8217;ve got RSI [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=28&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Is it just me or is the toolbox in MS Word 2008 for Mac ridiculously small (read: horrid). I&#8217;m battling with a document with many styles at the moment and am finding myself scrolling up and down, up and down endlessly in a scroll window that displays 5 styles at a time. I&#8217;ve got RSI just thinking about it.</p>
<p>On a lighter note &#8211; I&#8217;m lovin&#8217; the new Ribbon concept in the Windows version. Who ever designed that deserves a pat on the back (and a big bonus). It takes a little getting used to but is just great when your up the learning curve.</p>
<p>If there is some friendly competition between the Word for Mac and the Word for Windows UI teams then I think the Windows team well and truly wins this round.</p>
<p>Jon</p>
<p>PS: If anyone knows how to increase the size of the toolbox or dock it please tell me how. Please &#8211; I&#8217;m dying here.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/objectopia.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/objectopia.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/objectopia.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=objectopia.com&amp;blog=8328377&amp;post=28&amp;subd=objectopia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://objectopia.com/2009/06/18/ms-word-for-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7ddc6e9ae66ab24ffd7fcf82cea3c8d7?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Jon Court</media:title>
		</media:content>
	</item>
	</channel>
</rss>
