<?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>XEN-trifuge &#187; Uncategorized</title>
	<atom:link href="http://xen-trifuge.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://xen-trifuge.com</link>
	<description></description>
	<lastBuildDate>Wed, 04 Apr 2012 00:00:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='xen-trifuge.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>XEN-trifuge &#187; Uncategorized</title>
		<link>http://xen-trifuge.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://xen-trifuge.com/osd.xml" title="XEN-trifuge" />
	<atom:link rel='hub' href='http://xen-trifuge.com/?pushpress=hub'/>
		<item>
		<title>Extending the Rudder</title>
		<link>http://xen-trifuge.com/2010/08/19/extending-the-rudder/</link>
		<comments>http://xen-trifuge.com/2010/08/19/extending-the-rudder/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 01:30:04 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[citrix android]]></category>
		<category><![CDATA[citrix ipad]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Citrix iPAD]]></category>
		<category><![CDATA[Citrix receiver Android]]></category>
		<category><![CDATA[Citrix receiver iPhone]]></category>

		<guid isPermaLink="false">http://jmsazboy.wordpress.com/2010/08/19/extending-the-rudder/</guid>
		<description><![CDATA[The challenges and benefits of mobile devices in the enterprise.  The last 18 months has witnessed a barrage of smart phones and tablets coming onto the market. While these devices score high marks for being &#8220;cool&#8221; I can honestly say, the INFOSEC pessimist in me says &#8220;Malware Vector&#8221; and the enterprise solutions person in me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=238&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><span style="color:#1f497d;font-size:18pt;">The challenges and benefits<br />
</span><span style="color:#1f497d;font-size:18pt;">of mobile devices in the enterprise.<br />
</span></p>
<p style="text-align:left;"> <span style="color:#1f497d;">The last 18 months has witnessed a barrage of smart phones and tablets coming onto the market. While these devices score high marks for being &#8220;cool&#8221; I can honestly say, the INFOSEC pessimist in me says &#8220;Malware Vector&#8221; and the enterprise solutions person in me says I can put enterprise applications in the hands of key C-Level decision makers regardless of where they are. If deployed securely, mobile devices and smart phones could be the culminating of business agility we have all been working toward for years.<br />
</span></p>
<p> <span style="color:#1f497d;">Unfortunately, information security groups are rubbing their temples in the wake of a recent, and rather embarrassing, security breach with Apple&#8217;s iPAD product. A few weeks ago I bought a Chinese knock-off android tablet, after receiving it I connected it to my wireless network, brought up my Syslog server to watch PIX logs and within ten minutes, it was phoning home to a site in Japan! (I knew it!) We have also had stories of some of these smart phones being shipped with malware before they are ever handed to the end users.<br />
</span></p>
<p><span style="color:#1f497d;">In many organizations, prior to connecting to your network remotely, you are forced to undergo rigorous endpoint analysis to ensure that you have a proper and updated virus signature, a host based firewall, an approved build, encryption software, etc. Many INFOSEC groups kicked and fought for these policies in what has been described to me by my colleagues as just short of a bloodbath. For some IT shops, the blood of the remote access policy fight hasn&#8217;t even dried yet and if smart phone vendors think that enterprises will abandoned these polices to accommodate these devices they are delusional. At the same time, securing a smart phone may strip it down to the point that it is really no more valuable than the cell phone they have today.<br />
</span></p>
<p><span style="color:#1f497d;">I read the other day that Juniper is making a VPN client for Smart Phones. While I agree that Juniper VPN is a good product, I think it is risky to grant a VPN tunnel to any of these appliances. Why would a PC have to pass an endpoint scan and a smart phone not? Are they going to build smart phone endpoint scanners/agents?<br />
</span></p>
<p> <span style="color:#1f497d;"><strong>John, if you are so down on smart phones, why do you want to support them?<br />
</strong></span><span style="color:#1f497d;">In our world, the end users do not exist because of us, we exist because of them. The title of this blog post was called &#8220;Extending the Rudder&#8221; and what I mean by that is that key decision makers in a company cannot be given too much agility. I am quite certain that Larry Ellison is not the CEO of oracle because he is the world&#8217;s best DBA. He is in that position because of his ability to steer the company and make critical decisions. Decisions are made through key metrics that are delivered to them via briefings, emails, etc. There is never too many ways to make this information available so long as you can keep it secure.<br />
</span></p>
<p><span style="color:#1f497d;">The mobile platform introduces the ability to take business agility to the next level and effectively &#8220;extend the rudder&#8221; to C-level and/or key decision makers in any organization. This goes beyond helping them look cool on the golf course. Products like </span><a href="http://www.softwarefx.com/mobile/pgmobile/" target="_blank">SoftwareFX</a><span style="color:#1f497d;"> can deliver business intelligence reporting that is custom fit for a particular smart phone or device. The ability to deliver key metrics or enterprise applications to mobile users will make your organization more nimble AND look cool on the golf course.<br />
</span><span style="color:#1f497d;"><strong></strong></span></p>
<p><span style="color:#1f497d;"><strong>Security Breaches:<br />
</strong></span><span style="color:#1f497d;">There was a great article this week from Enterprise Mobile Today on the challenges of supporting mobile devices.  It also included a discussion on the security breach that occurred with Apple&#8217;s iPAD stating &#8220;Although the Valley Wag, the online publication that broke the story, implied that the breach was Apples responsibility, the issue was due to AT&amp;T&#8217;s systems.&#8221;<br />
</span></p>
<p><span style="color:#1f497d;">Guess what, if there is a breach of corporate information on an iPAD issued by your company or agency, or you granted access to enterprise applications to an personally owned iPAD, it&#8217;s <strong>your</strong> responsibility. While Apple has restricted the use of middleware on its iPhone/iPAD applications, the other smart phone vendors may not. At issue here is the willingness to open up the OS on these devices to middleware while at the same time protecting the user and themselves from breaches. I know that Apple has taken a lot of flak for its policies on middleware and there is a big push to get them to back off on it. Either way, so long as these moving parts exists, there is a possible vector for malware, breaches and all around jackassery. There have also been concerns about the security of the Safari browser and opening up your ERP to a mobile device could mean exposing your infrastructure to an OS that currently has no enterprise virus scanning software and, in some cases, has applications installed on it that may carry malware themselves.<br />
</span> </p>
<p><span style="color:#1f497d;"><strong>So how does thin computing get around this?<br />
</strong></span><span style="color:#1f497d;">While I expect a lot of INFOSEC and IT Departments are going to say &#8220;No&#8221; when it comes to permitting the use of smart phones. I believe through thin computing via Citrix receiver and XenAPP or XenDesktop you can easily deliver safe and secure enterprise applications that will not run on the smart phone at all but rather on a locked down XenAPP Server or XenDesktop environment that only sends screen refreshes instead of full session traffic that can be sniffed or interpreted by a bot or malware.<br />
</span></p>
<p><span style="color:#1f497d;">Also noted in the article on Enterprise Mobile Today was the fact that several thousand email addresses were stolen as were some of their contact lists, including those of some high level government officials. Citrix has introduced an email client that has been optimized for mobile users. I highly recommend that you look at the session here: </span><a href="http://www.citrix.com/tv/#videos/2385" target="_blank">http://www.citrix.com/tv/#videos/2385</a><span style="color:#1f497d;"><br />
</span></p>
<p><span style="color:#1f497d;">I think this product is fantastic and shows how organizations are going to have to ready themselves to securely deliver enterprise applications to mobile devices. In this scenario, the users email contacts and personally identifiable information exist on the exchange server and on the XenApp client that is run out of an ICA session. If the phone is lost, stolen, damaged or hacked, the information available on it is of no use as the crown jewels remain safe on the enterprises servers. Two factor authentication that is supported by the Citrix receiver and regular password reset regimen will help secure the end users credentials. All of these factors will allow systems administrators and INFOSEC types to have the freedom to innovate with this new technology.<br />
</span></p>
<p>The drawing below is an example of a VPN tunnel into an internal Network. In most cases, VPN appliances are installed with an &#8220;any any&#8221; rule allowing the clients to connect anywhere in the organization once the log in.</p>
<p> <span style="color:#1f497d;font-size:18pt;"><a href="http://jmsazboy.files.wordpress.com/2010/08/vpn-ipad.png"><img class="alignnone size-full wp-image-247" title="VPN-IPAD" src="http://jmsazboy.files.wordpress.com/2010/08/vpn-ipad.png?w=530" alt=""   /></a></span></p>
<p>In this drawing we see how using the Citrix receiver is not a full VPN tunnel but an ICA Session that sends encrypted pixel refreshes to the end user instead of raw data. This means that if there is a zeus bot, or the like, on the phone looking for key html or xml such as &#8220;password&#8221; or &#8220;Card Number&#8221; it will not appear because the only data coming across is screen refreshes. This effectively keeps the data running on a restricted environment via XenAPP or XenDesktop.</p>
<p> <span style="color:#1f497d;font-size:18pt;"><a href="http://jmsazboy.files.wordpress.com/2010/08/ica-ipad.png"><img class="alignnone size-full wp-image-246" title="ICA-IPAD" src="http://jmsazboy.files.wordpress.com/2010/08/ica-ipad.png?w=530" alt=""   /></a></span></p>
<p><strong></strong> </p>
<p><strong>Conclusion:<br />
</strong>It appears as though the next technological line in the sand will be these mobile devices. The coming battle for superiority in this space will likely involve small OSes such as the Mac BSD hybrid OS and the Linux hybrid(s) that is on a lot of the &#8216;Droid series phones. These are very streamlined distro&#8217;s that you will not simply be able to install a complex anti-virus suit like McAfee or Symantec.  Also, I believe that the prevalence of these devices will only grow and they are upon us as Sys Admins whether we like it or not. As Citrix is basically present in nearly every large company, Citrix receiver, coupled with Access Gateway and SoftwareFX could put you and your team in a position to be able to accommodate this level of agility. Ensure that your INFOSEC teams understand the difference between an ICA Session and a VPN Tunnel, begin to educate decision makers on why we can make use of this technology for end users who are in the field and need this level of agility. Put yourself in a position to say yes, as it doesn&#8217;t take a great deal of innovation to say &#8220;no&#8221;.</p>
<p>God knows, I am hardly the gadget enthusiast, in fact I remember telling people that a phone was for talking on and nothing more but this new breed of smart phone and affordable tablets has me excited to see what we can do for our users in the field who, ultimately, pay all of our salaries.</p>
<p>Thanks for reading.</p>
<p> John</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmsazboy.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmsazboy.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmsazboy.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=238&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xen-trifuge.com/2010/08/19/extending-the-rudder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>

		<media:content url="http://jmsazboy.files.wordpress.com/2010/08/vpn-ipad.png" medium="image">
			<media:title type="html">VPN-IPAD</media:title>
		</media:content>

		<media:content url="http://jmsazboy.files.wordpress.com/2010/08/ica-ipad.png" medium="image">
			<media:title type="html">ICA-IPAD</media:title>
		</media:content>
	</item>
		<item>
		<title>Project Poindexter: (Non-Citrix Related) Grabbing Pix URL logs checking them for malware.</title>
		<link>http://xen-trifuge.com/2010/07/11/project-poindexter-grabbing-pix-url-logs-checking-them-for-malware/</link>
		<comments>http://xen-trifuge.com/2010/07/11/project-poindexter-grabbing-pix-url-logs-checking-them-for-malware/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 20:15:21 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Advanced Persistent Threat]]></category>
		<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Monitor Malware]]></category>
		<category><![CDATA[Syslog]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[PIX]]></category>
		<category><![CDATA[PIX Logs]]></category>

		<guid isPermaLink="false">http://jmsazboy.wordpress.com/2010/07/11/project-poindexter-grabbing-pix-url-logs-checking-them-for-malware/</guid>
		<description><![CDATA[This is my first non-Citrix related post, I don&#8217;t plan on making it a habit but someone suggested that I post this in case it is valuable to other INFOSEC types.  Let me start off by saying I am not a traditional security guy, I don&#8217;t have an abundance of hacking skills, I am not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=190&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is my first non-Citrix related post, I don&#8217;t plan on making it a habit but someone suggested that I post this in case it is valuable to other INFOSEC types. </p>
<p>Let me start off by saying I am not a traditional security guy, I don&#8217;t have an abundance of hacking skills, I am not a black hat, white hat etc. I did work in Security for awhile as the Event Correlation guy for a year and have been trying to leverage digital epidemiology as a way to secure my systems. As I have stated in previous blogs, we have a better chance of curing the common cold than getting rid of malware and 0-day&#8217;s. In fact, I would say there are two kinds of systems, breached and about to get breached. This is the way you have to approach malware in my opinion. What surprised me with the Aurora breach was that it appears as though the INFOSEC community spends the lion&#8217;s share, if not all, of their time on ingress and completely ignores egress. When I look at the Google breach I see an attack that should have been mitigated within 24 hours.</p>
<p>Over the years I have deployed or viewed a number of event correlation utilities, most of them costing in excess of $250K for a large implementation.  What I generally did not like about shrink wrapped solutions and what I am most concerned about in the IT industry is the de-emphasis on heuristics and a dependance on an automated process to detect a problem.  In my opinion, an &#8220;Event Correlator&#8221; is not an appliance, it is an IT Person looking at a series of logs and events and saying &#8220;Holy shit! What the HELL is that!&#8221;.  The fact is, false positives make a lot of really expensive security software completely useless and a stored procedure or IDS/IPS cannot do as good of a job as a human being who can look at a series of logs and make an interpretation.  What I want to provide here is some of the heavy lifting that can then be use by a human to determin if there is an issue. </p>
<p>The purpose of this post is to show people how I grabbed Syslog data from my pix allowing me to grab the URI Stem of all outgoing sessions and log them into a SQL Server. Afterward, I will be able to run key queries to be able to troll for .exe, .dll, .tgz and any other problem extensions. Also, I can upload the latest malware list data and cross reference it with the information in my database which will allow me to see if any of my systems are phoning home to a botnet master, malware distribution site, etc. This is basically a take on my edgesightunderthehood.com post on monitoring APT with Edgesight.</p>
<p>The first order of business is to get the logs to the syslog server. I start by creating a filter that will grab the logs. (See Below)</p>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin1.png?w=530" alt="" /></p>
<p>The next step is to parse the incoming data into separate columns in my database. This is done by setting up a custom db format for the purpose of these logs. The parse script is provided below:<br />
Also, check all checkboxes below &#8220;Read&#8221; and &#8220;Write&#8221;</p>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin2.png?w=530" alt="" /></p>
<p><strong>Parsing Script: (Cut and paste it to a text file then use that text file in the dialog box above)<br />
</strong><span style="font-size:8pt;">################################<br />
Function Main()<br />
Main = &#8220;OK&#8221;<br />
Dim MyMsg<br />
Dim Source<br />
Dim Destination<br />
Dim Payload<br />
</span></p>
<p><span style="font-size:8pt;">With Fields<br />
Source = &#8220;&#8221;<br />
Destination = &#8220;&#8221;<br />
Payload = &#8220;&#8221;    <br />
</span></p>
<p><span style="font-size:8pt;">MyMsg = .VarCleanMessageText<br />
</span></p>
<p><span style="font-size:8pt;">If ( Instr( MyMsg, &#8220;%PIX&#8221; ) ) Then<br />
SourceBeg = Instr( MyMsg, &#8220;: &#8220;) + 2<br />
SourceEnd = Instr( SourceBeg, MyMsg, &#8220;Accessed&#8221;)<br />
Source = Mid( MyMsg, SourceBeg, SourceEnd &#8211; SourceBeg)<br />
DSTBeg = Instr( MyMsg, &#8220;URL&#8221;) + 3<br />
DSTEnd = Instr( DSTBeg, MyMsg, &#8220;:&#8221;)<br />
Destination = Mid( MyMsg, DSTBeg, DSTEnd &#8211; DSTBeg)<br />
End IF    <br />
.VarCustom01 = Source<br />
.VarCustom02 = Destination<br />
.VarCustom03 = Payload<br />
</span></p>
<p><span style="font-size:8pt;">End With<br />
End Function<br />
##################################</span></p>
<p>The last step is to write the data to SQL but first let&#8217;s do a few tasks to prepare the table.</p>
<ol>
<li>Set up an ODBC connection to a SQL Server and create a database called &#8220;Syslog&#8221; and connect to it with an account that has dbo privilages.</li>
<li>
<div>Create the Custom DB Format for grabbing URL&#8217;s</div>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin3.png?w=530" alt="" /></li>
</ol>
<p>Note that this table will have five columns, msgdatetime, msghostname, msgtext, source, destination and payload. (The last column, payload, is not working yet but I will show you how to get the payload later)</p>
<p>3. Once this is done, create an action called &#8220;Write to SQL&#8221; and select &#8220;PIX_URL&#8221; from the custom data fromat list and name the table &#8220;PIX_URL&#8221; then select &#8220;Create Table&#8221;</p>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin4.png?w=530" alt="" /></p>
<p>Okay, so now that we have the data writing to SQL Server, let&#8217;s look at a month&#8217;s worth of data on one of my systems:</p>
<p>This query will give you the payload and the number of times the payload has been accessed. Using the <em>having </em>function I am going to ask for every uri-stem that has been accessed more than 5 times in the last month.</p>
<p><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">select </span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">)</span><span style="color:blue;">as</span> &#8220;Payload&#8221;<span style="color:gray;">, </span><span style="color:fuchsia;">count</span><span style="color:gray;">(</span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">))<br />
</span></span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">from</span> pix_url<br />
</span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">group </span><span style="color:blue;">by </span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">)<br />
</span></span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">having </span><span style="color:fuchsia;">count</span><span style="color:gray;">(</span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">)) </span><span style="color:gray;">&gt;</span> 5<br />
</span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">order </span><span style="color:blue;">by </span><span style="color:fuchsia;">count</span><span style="color:gray;">(</span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">)) </span><span style="color:blue;">desc</span></span> </p>
<p>The idea behind this is that if you note 1000 records to &#8220;123.123.123.123:/botmaster/botnet.exe&#8221; you may want to do something about it. You can also download the malwaredomainlist.com data, import it into SQL and cross reference that data to ensure that you are not communicating with any noted malware sites. Depending on the response of this blog, I may post those instructions as well.</p>
<p> <strong>And here are what the results look like:<br />
</strong></p>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin5.png?w=530" alt="" /></p>
<p><strong>Another query I like to run is one looking for executable files in the URI-stem.<br />
</strong></p>
<p><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">select</span> Msghostname <span style="color:blue;">as</span> &#8220;Firewall&#8221;<span style="color:gray;">, </span><span style="color:gray;">Source,</span> Destination<span style="color:gray;">, </span><span style="color:fuchsia;">substring</span><span style="color:gray;">(</span>msgtext<span style="color:gray;">,</span>41<span style="color:gray;">,</span> 2048<span style="color:gray;">) </span><span style="color:blue;">as</span> &#8220;Payload&#8221;<br />
</span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">from</span> pix_url<br />
</span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">where</span> msgtext <span style="color:gray;">like </span><span style="color:red;">&#8216;%.exe%&#8217;<br />
</span></span><span style="font-family:Courier New;font-size:9pt;"><span style="color:blue;">order </span><span style="color:blue;">by</span> msgdatetime <span style="color:blue;">desc<br />
</span></span></p>
<p>This will allow me to troll for executables that my internal users are accessing, as with most versions of malware, this should show itself early on during the breach.</p>
<p>So how do you monitor?</p>
<p>Well, you don&#8217;t have to sit there with query analyzer open all day but you can set up SQL Server Reporting Services to do this chore for you and deliver a dashboard to operations personnel. Here is a quick view of a dashboard that refreshes ever 5 seconds and turns RED when &#8220;.exe&#8221; is in the URI-Stem. In this scenario, you would be able to investigate the executable that is being downloaded by the client and ensure that it is not malware. You can test this yourself once you set it up by going to any site and typing &#8220;/test.exe&#8221; at the end.</p>
<p><img src="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin6.png?w=530" alt="" /><span style="color:blue;font-family:Courier New;font-size:9pt;"><br />
</span></p>
<p><strong>Conclusion:<br />
</strong>Again, I am not a traditional security guy so this could be utterly useless, I am not the PIX guy at my job, I AM the PIX guy at home though. Also, I have found it very useful to check for Malware and 0-Day&#8217;s that my anti-virus does not pick up. While I cannot speak with as much authority as a number of CISSP&#8217;s and INFOSEC guru&#8217;s, I can say that the continued ignorance surrounding egress will allow malware to run amuck. As I stated in a previous blog, it is foolish to beat your chest at the millions of packets you keep out while the few that get in can take anything they want, and leave unmolested. Just like a store has to let some people in then focus on ensuring no one leaves with anything they didn&#8217;t pay for, IT Security needs to ease over to this mentality and keep track of what is leaving its networks and where it is being sent. At any rate, if this has value to anyone let me know, I will include the RDL (Report File) online for download if anyone wants to set it up. I know a lot of PIX guys aren&#8217;t necessarily web/database guys so if you have any questions, feel free to ask.</p>
<p>Thanks for reading,</p>
<p>John</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmsazboy.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmsazboy.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmsazboy.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=190&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xen-trifuge.com/2010/07/11/project-poindexter-grabbing-pix-url-logs-checking-them-for-malware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin1.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin2.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin3.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin4.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin5.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/07/071110_2012_projectpoin6.png" medium="image" />
	</item>
		<item>
		<title>Project Poindexter: Endpoint Analysis Log Harvesting</title>
		<link>http://xen-trifuge.com/2010/06/26/project-poindexter-endpoint-analysis-log-harvesting/</link>
		<comments>http://xen-trifuge.com/2010/06/26/project-poindexter-endpoint-analysis-log-harvesting/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 18:14:42 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AGEE Endpoint Analysis Logs]]></category>
		<category><![CDATA[AGEE EPA Logs]]></category>
		<category><![CDATA[Citrix Endpoint Analysis]]></category>
		<category><![CDATA[Citrix EPA]]></category>
		<category><![CDATA[Clear2View]]></category>
		<category><![CDATA[Endpoint Analysis Logging]]></category>

		<guid isPermaLink="false">http://jmsazboy.wordpress.com/2010/06/26/project-poindexter-endpoint-analysis-log-harvesting/</guid>
		<description><![CDATA[About four years ago management wanted to know which users were failing their endpoint analysis scans and to what extent we were compliant with endpoint analysis. We spent over $30K on a product called &#8220;Clear2View&#8221; and it did some rudimentary scans logging for us but the data was not very easy to query even though [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=179&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;">About four years ago management wanted to know which users were failing their endpoint analysis scans and to what extent we were compliant with endpoint analysis. We spent over $30K on a product called &#8220;Clear2View&#8221; and it did some rudimentary scans logging for us but the data was not very easy to query even though it was located in a SQL Database and the reporting features were, in my opinion, only so-so. With that, it appears as though Clear2View has gone away and many of us are left wondering how we will get our EPA Scan data on the new AGEE platform. We have been able to get past this dilemma by harvesting the Syslog Data from the AGEE and parsing it into a SQL Server and then integrating it with Business Intelligence.<br />
</span></p>
<p><span style="font-size:10pt;">As with other &#8220;Project Poindexter&#8221; posts, we will cover how to grab EPA Scan results from SYSLOG and write them to a SQL Server then report on them at a cost considerably less than $30K.<br />
</span></p>
<p><span style="font-size:10pt;"><strong>Materials:<br />
</strong>Kiwi Syslog Server (Full version is $260 bucks)<br />
SQL Server w/Reporting Services (You should already have if you have Edgesight)<br />
</span></p>
<p><span style="font-size:10pt;"><strong>Skills:<br />
</strong>Some vbscript or parsing skills, although I will provide the parsing script to you.<br />
The ability to take my SQL Syntax and edit it so that it suites your scans/environment.<br />
The ability to upload an RDL to Reporting Services and map it to a data souce.<br />
<strong><br />
So getting started, here is an Example:<br />
</strong>So, at home with the VPX and some test vm&#8217;s I set up the following scans:<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin1.png?w=530" alt="" /><strong><br />
</strong></span></p>
<p><span style="font-size:10pt;">As you can see, I am testing for the McAfee suite(a canned scan) and to see if the Windows Firewall is running.<br />
</span></p>
<p><span style="font-size:10pt;"><strong>Results: </strong>Here are the results that come into KIWI.<strong><br />
</strong></span></p>
<p><span style="font-size:10pt;">06-26-2010    12:16:05    Local7.Error    192.168.1.75    06/26/2010:11:41:06 GMT ns PPE-0 : SSLVPN CLISEC_EXP_EVAL 104254 : User wireless: &#8211; Client IP 192.168.1.50 &#8211; Vserver 192.168.1.100:443 &#8211; Client security expression CLIENT.SVC(MpsSvc) EXISTS evaluated to FALSE(3)<br />
</span></p>
<p><span style="font-size:10pt;">06-26-2010    12:16:05    Local7.Error    192.168.1.75    06/26/2010:11:41:06 GMT ns PPE-0 : SSLVPN CLISEC_EXP_EVAL 104253 : User wireless: &#8211; Client IP 192.168.1.50 &#8211; Vserver 192.168.1.100:443 &#8211; Client security expression CLIENT.SVC(MCVSRte).VERSION == 9.0.0 -frequency 5 evaluated to FALSE(3)<br />
</span></p>
<p><span style="font-size:10pt;">06-26-2010    12:16:05    Local7.Error    192.168.1.75    06/26/2010:11:41:06 GMT ns PPE-0 : SSLVPN CLISEC_EXP_EVAL 104252 : User wireless: &#8211; Client IP 192.168.1.50 &#8211; Vserver 192.168.1.100:443 &#8211; Client security expression CLIENT.APPLICATION.AV(McafeeVirusScanEnterprise).VERSION == 7.0 -frequency 5 evaluated to FALSE(3)<br />
</span></p>
<p><span style="font-size:10pt;">06-26-2010    12:16:05    Local7.Error    192.168.1.75    06/26/2010:11:41:06 GMT ns PPE-0 : SSLVPN CLISEC_EXP_EVAL 104251 : User wireless: &#8211; Client IP 192.168.1.50 &#8211; Vserver 192.168.1.100:443 &#8211; Client security expression CLIENT.APPLICATION.AV(McafeeVirusScan).VERSION == 7.0 -frequency 5 evaluated to FALSE(3)<br />
</span></p>
<p><span style="font-size:10pt;">06-26-2010    12:16:05    Local7.Error    192.168.1.75    06/26/2010:11:41:06 GMT ns PPE-0 : SSLVPN CLISEC_EXP_EVAL 104250 : User wireless: &#8211; Client IP 192.168.1.50 &#8211; Vserver 192.168.1.100:443 &#8211; Client security expression CLIENT.APPLICATION.AV(McafeeNetshield).VERSION == 7.0 -frequency 5 evaluated to FALSE(3)<br />
</span></p>
<p><span style="font-size:10pt;">So next let&#8217;s take these results and get them parsed then logged to SQL Server:<br />
</span></p>
<p><span style="font-size:10pt;">Create a new Rule called &#8220;EPA Scans&#8221; and create one filter with three actions.<br />
The First Filter is called &#8220;Filter Text &#8211; CLISEC&#8221; and set it up to filter message text for &#8220;CLISEC&#8221;<br />
The first Action is &#8220;DISPLAY&#8221;<br />
The second Action is &#8220;Parse Data&#8221; (Note Check all the boxes for Read and Write and Browse to the location of the Parsing Script which you can get at http://www.ctxsupport.com and go to the &#8220;ACCESS GATEWAY forum)<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin2.png?w=530" alt="" /><br />
</span></p>
<p><span style="font-size:10pt;">The third Action is called &#8220;Write to SQL&#8221; which will require a custom data format so let&#8217;s cover those steps:<br />
</span></p>
<p><span style="font-size:10pt;"><strong>Custom Data Format:<br />
</strong>Create a custom DB Format called EPA_SCANS, it should appear as follows: (Note the Field names AND the <strong>data types</strong> as they are very important)<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin3.png?w=530" alt="" /><br />
Now that you have created your custom DB format go back to your &#8220;Write to SQL&#8221; action<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin4.png?w=530" alt="" /><br />
</span></p>
<p><span style="font-size:10pt;">Make sure that your DNS Connect String is correct and make sure that you name the table EPA_SCANS under database table name and that you use the Custom DB Format EPA_Scans then click on &#8220;Create Table&#8221;<br />
</span></p>
<p><span style="font-size:10pt;">Once this is done you should be all set, log into your VPN/AGEE Address and look for the results by running a simple SQL Query:<br />
</span></p>
<p><span style="font-size:10pt;"><em>select * from epa_scans<br />
order by msgdatetime desc<br />
</em></span></p>
<p><span style="font-size:10pt;"><strong>You should see something like the following:<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin5.png?w=530" alt="" /><br />
</strong></span></p>
<p><span style="font-size:10pt;">Note that in the results I include 7 columns. I always include the entire log in the msgtext column for several reasons, among them Security statutes may dictate that you must have all of the log available and there are instances where parsed logs are not admissible in court. For this endeavor, it is your choice, I have habit of just leaving it in.<br />
</span></p>
<p><span style="font-size:10pt;">Also, my goal of setting up the logging was so that the Service Desk staff could look at the results and tell the end users what the problem is. To deal with that issue let&#8217;s take a look at the actual scans:<br />
</span></p>
<p><span style="font-size:10pt;"><strong>CLIENT.APPLICATION.AV(McafeeNetshield).VERSION == 7.0 -frequency 5 CLIENT.APPLICATION.AV(McafeeVirusScan).VERSION == 7.0 -frequency 5 CLIENT.APPLICATION.AV(McafeeVirusScanEnterprise).VERSION == 7.0 -frequency 5 CLIENT.SVC(MCVSRte).VERSION == 9.0.0 -frequency 5<br />
CLIENT.SVC(MpsSvc) EXISTS<br />
</strong></span></p>
<p><span style="font-size:10pt;">As you can see from the scans above, a Level I engineer may not have a very easy time with this so we are going to change our SQL up a little bit so that we have a more friendly description of the scan so that when someone calls the helpdesk saying they cannot get to a resource due to a failed scan, the person on the phone with them can give them a clear explanation of what the issue is.<br />
</span></p>
<p><span style="font-size:10pt;">So let&#8217;s shake up our SQL just a little:<br />
</span></p>
<p><span style="font-family:Courier New;font-size:8pt;"><span style="color:blue;">select</span> msgdatetime<span style="color:gray;">,</span> userid<span style="color:gray;">,</span> clientip<span style="color:gray;">,</span> scan<span style="color:gray;">=<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">case</span> Scan<br />
</span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">when </span><span style="color:red;">&#8216;CLIENT.SVC(MCVSRte).VERSION == 9.0.0 -frequency 5&#8242; </span><span style="color:blue;">then </span><span style="color:red;">&#8216;Antivirus Service Check&#8217;<br />
 </span></span><span style="font-family:Courier New;font-size:8pt;">   <span style="color:blue;">when </span><span style="color:red;">&#8216;CLIENT.APPLICATION.AV(McafeeVirusScanEnterprise).VERSION == 7.0 -frequency 5 &#8216; </span><span style="color:blue;">then </span><span style="color:red;">&#8216;Antivirus ENT.Version Check&#8217;<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">when </span><span style="color:red;">&#8216;CLIENT.APPLICATION.AV(McafeeVirusScan).VERSION == 7.0 -frequency 5&#8242; </span><span style="color:blue;">then </span><span style="color:red;">&#8216;Antivirus Std. Version Check&#8217;<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">when </span><span style="color:red;">&#8216;CLIENT.APPLICATION.AV(McafeeNetshield).VERSION == 7.0 -frequency 5&#8242; </span><span style="color:blue;">then </span><span style="color:red;">&#8216;Netshield Version 7 Check&#8217;<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">when </span><span style="color:red;">&#8216;CLIENT.SVC(MpsSvc) EXISTS&#8217; </span><span style="color:blue;">then </span><span style="color:red;">&#8216;Check Microsoft Firewall Service&#8217;<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">end</span><span style="color:gray;">,<br />
</span></span><span style="font-family:Courier New;font-size:8pt;">    Result<br />
</span><span style="font-family:Courier New;font-size:8pt;">    <span style="color:blue;">from</span> epa_scans<br />
</span><span style="font-size:8pt;"><span style="color:blue;font-family:Courier New;">order </span><span style="font-family:Courier New;"><span style="color:blue;">by</span> msgdatetime <span style="color:blue;">desc</span></span><br />
</span></p>
<p><span style="font-size:10pt;">WordPress has a habit of placing double quotes on single quotes so it is not likely you can just paste this into your query so I will include this in the Access Gateway area of http://ctxsupport.com. At any rate note the following:<br />
We are taking the cryptic &#8220;</span><span style="font-family:Courier New;font-size:8pt;"><span style="color:red;"> CLIENT.APPLICATION.AV(McafeeVirusScanEnterprise).VERSION == 7.0 -frequency 5&#8243; </span>Text and converting it into a more easily interpreted <span style="color:red;">&#8216;Antivirus ENT.Version Check&#8217;</span>Your SQL Query, and eventually your SQL Reporting services reports will appear as follows:<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin6.png?w=530" alt="" /><br />
</span></p>
<p><span style="font-size:10pt;">Also, your SQL Report will appear as follows:<br />
<img src="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin7.png?w=530" alt="" /><br />
Note that the failures are RED which will alert your staff and also note how much more logical and more intpretable the SCAN information is. You could also rig up a self service by providing a link on the scan sending the user to the place to either innoculate their system or instructions on how to turn on their Microsoft Firewall.<br />
</span></p>
<p><span style="font-size:10pt;">Again all parsing scripts, RDL&#8217;s and SQL Queries are located <a href="http://www.ctxsupport.com/forums/showthread.php?36-Parsing-Scripts-for-VPN-Data-Mining-on-AGEE&amp;p=41#post41" target="_blank">here</a><br />
</span></p>
<p><span style="font-size:10pt;"><strong>Why is this even important:<br />
</strong>Well, as the security screw gets tighter and tighter more and more restrictions are going to be placed on both internal and remote access systems. It will be a disaster to deploy endpoint analysis on a large scale without being able to at least give the support staff the ability to tell the users why they did not get access to a resource. We plan on taking this to the next level and providing an HTML Injection rule so that when a user goes straight to Web Interface because they failed a scan, there is a popup button that tells them they failed with a URL to the report above letting them know what scan failed, and eventually, a hyperlink to take them to a remediation page (Be it instructions or updated signatures).<br />
</span></p>
<p><span style="font-size:10pt;">Also, I believe, there never was a Clear2View for the AGEE anyway so those of us with the AGEE version were kind of left out of that game. This process sets you up with all the business intelligence you need to support NAC-like endpoint analysis and also allows you to report on the level of compliance for your company or agency. Oh&#8230;and it only costs $260 bucks plus some time (which I understand is expensive)<br />
</span></p>
<p><span style="font-size:10pt;"><strong>IMPORTANT NOTE/DISCLAIMER:<br />
</strong>Obiviously, Citrix will not support this but also, you WILL HAVE to be able to edit the SQL Statement both within the Query Analyzer AND the RDL file otherwiseyour report will not show proper data. You do need to have some SQL proficiency to pull this off but you do not have to be a full fledge DBA. If you are a parnter, this could be a very nice value-add for a customer if you have a few hours left in an engagement. It was not excessively difficult to do.<br />
</span></p>
<p><span style="font-size:10pt;">Also, I don&#8217;t run all of the scans that everyone else may or may not run. There may be an instance where a particular scan does not parse properly, if so, shoot me an email and I will see if I can&#8217;t figure it out.<br />
</span></p>
<p><span style="font-size:10pt;">As with the VPN Logging, I plan on producing a video walkthru of this entire task. I should have some head down time at the begining of Next month to walk through it.<br />
</span></p>
<p><span style="font-size:10pt;">This literally took 45 minutes to set up once I had the Parsing scripts and my SQL Figured out. If you run into a problem, feel free to shoot me an email.<br />
</span></p>
<p><span style="font-size:10pt;">Thanks for reading<br />
</span></p>
<p><span style="font-size:10pt;">John<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmsazboy.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmsazboy.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmsazboy.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=179&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xen-trifuge.com/2010/06/26/project-poindexter-endpoint-analysis-log-harvesting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin1.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin2.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin3.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin4.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin5.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin6.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2010/06/062610_1811_projectpoin7.png" medium="image" />
	</item>
		<item>
		<title>Edgeisight Under the Hood: Part 2 (Will be moved to Edgesightunderthehood.com)</title>
		<link>http://xen-trifuge.com/2009/12/15/edgeisight-under-the-hood-part-2/</link>
		<comments>http://xen-trifuge.com/2009/12/15/edgeisight-under-the-hood-part-2/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 01:58:57 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[custom edgesight reports]]></category>
		<category><![CDATA[Edge Sight]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Edgesight Custom Reports]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jmsazboy.wordpress.com/2009/12/15/edgeisight-under-the-hood-part-2/</guid>
		<description><![CDATA[Okay, so in this blog posting I want to continue covering a few more views in Edgesight that I like to run ad hoc queries against.  Today&#8217;s view is called   vw_es_archive_application_network_performance.  This view provides information network delay, server delay, xenapp server, process name and downstream hosts that your XenApp servers communicate with.  I have used this table to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=103&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, so in this blog posting I want to continue covering a few more views in Edgesight that I like to run ad hoc queries against.  Today&#8217;s view is called   <em>vw_es_archive_application_network_performance.  </em>This view provides information network delay, server delay, xenapp server, process name and downstream hosts that your XenApp servers communicate with.  I have used this table to check delays of the executables such as winlogon.exe to check delay between this process and our domain controllers.  I will cover checking delays by process name, xen_app server and downstream host.  </p>
<p> The first part will be to demonstrate how to find Network and Server delay of specific downstream hosts as well as how to measure the average XenAPP Servers delay.  Then in the second part I want to answer one of the questions from the first posting.  </p>
<p> <strong>Down Stream Delay:<br />
</strong>I actually got to present on Edgesight during Synergy 2008 and one of the key points that I tried to drive home is how Edgesight helps you with the never ending B.S. Witch hunts that always seem to occur when someone&#8217;s application is &#8220;running slow on Citrix&#8221;.  I would say that less than 30 % of what I actually investigate ends up being an actual XenAPP issue.  I will go over a few ad hoc queries that will give you the average delay of your down stream hosts and will give you the average delay experienced by each XenAPP Server allowing you to see if you have a specific XenAPP box that may be having some issues.   </p>
<p>The first ad hoc query has to do with downstream hosts, this will return the downstream host and the Network/Server delay.  I have set this query to filter any downstream host that does not have at least 100 records and a server delay of at least 300 miliseconds.  You can edit/remove the &#8220;Having&#8221; clause to suit your environment.        </p>
<p>select distinct hostname, sum(network_delay_sum)/sum(record_count) as &#8220;Network Delay&#8221;, sum(server_delay_sum)/sum(record_count) as &#8220;Server Delay&#8221;<br />
from vw_es_archive_application_network_performance<br />
group by hostname<br />
having sum(record_count) &gt; 100<br />
and sum(server_delay_sum)/sum(record_count) &gt; 300<br />
order by sum(server_delay_sum)/sum(record_count) desc </p>
<p><strong> </strong></p>
<p><strong>In English:</strong> &#8220;Give me the Network and Server delay of every downstream host that has at least 100 records (packets?) and a server latency of at least 300ms&#8221; </p>
<p> <strong>XenAPP Server Delay:</strong> <br />
It is a good idea to monitor your XenAPP Server delay, this will tell you if there is a particular XenAPP Server that is having a layer 1 or layer 2 issue.  This is a quick query that will show you the average delay of your XenAPP Servers.   </p>
<p>select distinct machine_name, sum(network_delay_sum)/sum(record_count) as &#8220;Network Delay&#8221;, sum(server_delay_sum)/sum(record_count) as &#8220;Server Delay&#8221;<br />
from vw_es_archive_application_network_performance<br />
group by machine_name<br />
order by sum(server_delay_sum)/sum(record_count) desc  </p>
<p><strong> </strong></p>
<p><strong>Note: </strong>You will also see<em> &#8220;Edgesight for Endpoints&#8221;</em> client data in this table as well.  </p>
<p><strong> </strong></p>
<p><strong>Executable  Delay:<br />
</strong>This query shows the delay associated  individual executables.  You may check outlook.exe to see if you have a delay in a downstream Exchange server or, in my case, check winlogon.exe for delays to domain controllers.  </p>
<p> select distinct exe_name, sum(network_delay_sum)/sum(record_count) as &#8220;Network Delay&#8221;, sum(server_delay_sum)/sum(record_count) as &#8220;Server Delay&#8221;<br />
from vw_es_archive_application_network_performance<br />
group by exe_name<br />
order by sum(server_delay_sum)/sum(record_count) desc  </p>
<p><strong>Session Statistics:<br />
</strong>Last week I got a a question about session counts and I wanted to answer it in this post, here was the question: </p>
<p> &#8221;I’m looking for a custom report showing the application usage (Published Apps, not processes) on a hourly, daily and monthly base and a custom report showing the concurrent sessions on a hourly, daily and monthly base.&#8221;  </p>
<p>The view I used for this was vw_ctrx_archive_client_start_perf<em> </em>declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
set @begin = &#8217;00&#8242;<br />
set @end = &#8217;23&#8242;<br />
set @app = &#8216;%Outlook%&#8217;<br />
select convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242; as &#8220;Time&#8221;, count(distinct sessid)<br />
from vw_ctrx_archive_client_start_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) = @today-1<br />
and published_application like &#8216;%&#8217;+@app+&#8217;%&#8217;<br />
group by convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242;<br />
order by convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242;<strong> </strong></p>
<p><strong> </strong><strong>In English: </strong>Give me every application on an hourly basis for a specific application.  On this report substitute %APPNAME% for whichever app you want to see.  Note that this is an hourly report so the time format is set to 108.   </p>
<p><strong> </strong><strong>Daily Application Usage:<br />
</strong>In the same view I change the query above just a little to accommodate a query by day.</p>
<p>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
set @app = &#8216;%Outlook%&#8217;<br />
select convert(varchar(10),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, count(distinct sessid)<br />
from vw_ctrx_archive_client_start_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
and published_application like <a href="mailto:'%'+@app+'%'">&#8216;%&#8217;+@app+&#8217;%&#8217;</a><br />
group by convert(varchar(10),dateadd(hh,-4,time_stamp), 111)<br />
order by convert(varchar(10),dateadd(hh,-4,time_stamp), 111)</p>
<p><strong> </strong><strong>Monthly Application Usage:<br />
</strong>Depending on how long you have your retention set (min is 30 days) this query may or may not work for you but this is the number of unique sessions per application for a month.</p>
<p>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
set @app = &#8216;%Outlook%&#8217;<br />
select convert(varchar(7),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, count(distinct sessid)<br />
from vw_ctrx_archive_client_start_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
and published_application like <a href="mailto:'%'+@app+'%'">&#8216;%&#8217;+@app+&#8217;%&#8217;</a><br />
group by convert(varchar(7),dateadd(hh,-4,time_stamp), 111)<br />
order by convert(varchar(7),dateadd(hh,-4,time_stamp), 111)<strong><br />
</strong></p>
<p><strong>Application Matrix:<br />
</strong>SQL Server Reporting Services will let you create a matrix, these two queries are for daily and monthly which will let you sort as follows:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="106" valign="top"> </td>
<td width="106" valign="top">Date 1</td>
<td width="106" valign="top">Date2</td>
<td width="106" valign="top">Date3</td>
<td width="106" valign="top">Date4</td>
<td width="106" valign="top">Date5</td>
</tr>
<tr>
<td width="106" valign="top">Outlook</td>
<td width="106" valign="top">Count1</td>
<td width="106" valign="top">Count2</td>
<td width="106" valign="top">Count3</td>
<td width="106" valign="top">Count4</td>
<td width="106" valign="top">Count5</td>
</tr>
<tr>
<td width="106" valign="top">Word</td>
<td width="106" valign="top">Count1</td>
<td width="106" valign="top">Count2</td>
<td width="106" valign="top">Count3</td>
<td width="106" valign="top">Count4</td>
<td width="106" valign="top">Count5</td>
</tr>
<tr>
<td width="106" valign="top">Oracle Financials</td>
<td width="106" valign="top">Count1</td>
<td width="106" valign="top">Count2</td>
<td width="106" valign="top">Count3</td>
<td width="106" valign="top">Count4</td>
<td width="106" valign="top">Count5</td>
</tr>
<tr>
<td width="106" valign="top">Statistical APP</td>
<td width="106" valign="top">Count1</td>
<td width="106" valign="top">Count2</td>
<td width="106" valign="top">Count3</td>
<td width="106" valign="top">Count4</td>
<td width="106" valign="top">Count5</td>
</tr>
<tr>
<td width="106" valign="top">Custom APP-A</td>
<td width="106" valign="top">Count1</td>
<td width="106" valign="top">Count2</td>
<td width="106" valign="top">Count3</td>
<td width="106" valign="top">Count4</td>
<td width="106" valign="top">Count5</td>
</tr>
</tbody>
</table>
<p> </p>
<p>  This has been the report method that has made my management the happiest so I use the Matrix tool with SSRS as often as possible.  Remember, if you have Edgesight, you have SSRS and setting up reports is no harder than an Access Database.</p>
<p>Here are the queries</p>
<p><strong> </strong></p>
<p><strong>First The Daily Matrix:</strong></p>
<p>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
select convert(varchar(10),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, published_application, count(distinct sessid)<br />
from vw_ctrx_archive_client_start_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
group by convert(varchar(10),dateadd(hh,-4,time_stamp), 111), published_application<br />
order by convert(varchar(10),dateadd(hh,-4,time_stamp), 111), count(distinct sessid) desc<strong> </strong></p>
<p><strong>Then the Monthly Matrix:<br />
</strong>declare @today datetime<br />
set @today = convert(varchar,getdate(),111)<br />
select convert(varchar(7),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, published_application, count(distinct sessid)<br />
from vw_ctrx_archive_client_start_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
group by convert(varchar(7),dateadd(hh,-4,time_stamp), 111), published_application<br />
order by convert(varchar(7),dateadd(hh,-4,time_stamp), 111), count(distinct sessid) desc<strong> </strong></p>
<p><strong> Concurrent Session Statistics:<br />
</strong>A colleague of mine, Alain Assaf, set up a system that gives you this info every five minutes and is almost in real time, go to wagthereal.wordpress.com to see it.  Keep in mind that Edgesight is not real time data so if you set up a private dashboard for it, you may have to wait for it to refresh. </p>
<p>The vw_ctrx_archive_client_start_perf view appears to give us only start times of specific published applications.  Perhaps the most used view of any of my reports is vw_ctrx_archive_ica_roundtrip_perf.  For this set of queries, I will count concurrent sessions but I will also go into ICA Delay&#8217;s for clients in my last post on Edgesight Under the Hood:</p>
<p>I will try to answer the users question on concurrent sessions with three pretty basic queries for hourly, daily and monthly usage:</p>
<p><strong>Hourly Users:<br />
</strong>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
set @begin = &#8217;00&#8242;<br />
set @end = &#8217;23&#8242;<br />
select convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242; as &#8220;Time&#8221;, count(distinct [user])<br />
from vw_ctrx_archive_ica_roundtrip_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) = @today-3<br />
group by convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242;<br />
order by convert(varchar(2),dateadd(hh,-4,time_stamp), 108)+&#8217;:00&#8242;</p>
<p><strong> </strong></p>
<p><strong>Daily Users:<br />
</strong>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
select convert(varchar(10),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, count(distinct [user])<br />
from vw_ctrx_archive_ica_roundtrip_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
group by convert(varchar(10),dateadd(hh,-4,time_stamp), 111)<br />
order by convert(varchar(10),dateadd(hh,-4,time_stamp), 111)<strong> </strong></p>
<p><strong> </strong><strong>Monthly Users:</strong></p>
<p>declare @begin varchar<br />
declare @end varchar<br />
declare @today datetime<br />
declare @app varchar<br />
set @today = convert(varchar,getdate(),111)<br />
select convert(varchar(7),dateadd(hh,-4,time_stamp), 111) as &#8220;Date&#8221;, count(distinct [user])<br />
from vw_ctrx_archive_ica_roundtrip_perf<br />
where convert(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt; @today-30<br />
group by convert(varchar(7),dateadd(hh,-4,time_stamp), 111)<br />
order by convert(varchar(7),dateadd(hh,-4,time_stamp), 111)<strong>  </strong></p>
<p><strong> Conclusion:  <br />
</strong>For the most part, I have vetted all of these queries, you may get varying results, if so, check for payload errors, licensing, etc.  I would really like to see some better documentation on the data model, most of these were basically done by running the query and checking it against the EdgeSight canned reports to see if my SWAG about how they did their calculations was correct.  All of the queries I ran here I checked and looked to be accurate.  If you are going to bet the farm on any of these queries to the brass in your organization, vet my numbers&#8230;.</p>
<p>My next post will deal with ICA latency and delay issues for individual users and servers.</p>
<p>Thanks for reading!</p>
<p>John</p>
<p><strong> </strong>      </p>
<p><a></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmsazboy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmsazboy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmsazboy.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=103&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xen-trifuge.com/2009/12/15/edgeisight-under-the-hood-part-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>
	</item>
		<item>
		<title>Xen and the art of Digital Epidemiology</title>
		<link>http://xen-trifuge.com/2009/11/27/83/</link>
		<comments>http://xen-trifuge.com/2009/11/27/83/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:32:08 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Application Firewall]]></category>
		<category><![CDATA[Netscaler]]></category>
		<category><![CDATA[Secure Ticket Authority]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jmsazboy.wordpress.com/2009/11/27/83/</guid>
		<description><![CDATA[In 2003 I started steering my career toward Citrix/VMWare/Virtualization and at the time, aside from being laughed at for running this fledgling product called ESX Server 1.51, most of my environment was Windows based. There were plenty of shrink-wrapped tools to let me consolidate my events and the only Unix I had to worry about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=83&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In 2003 I started steering my career toward Citrix/VMWare/Virtualization and at the time, aside from being laughed at for running this fledgling product called ESX Server 1.51, most of my environment was Windows based. There were plenty of shrink-wrapped tools to let me consolidate my events and the only Unix I had to worry about was the Linux Kernel on the ESX Server. Now my environment has included a series of new regulatory framework (Sarbanes, CISP, and currently FIPS 140-2). What used to be a Secure Gateway with a single web interface server and my back end XenAPP farm now includes a Gartner leading VPN Appliance, Access Gateway Enterprise Edition, Load balanced(GSLB) web interface servers, an application firewall and XenApp servers hosted on Linux based XenServer and VMWare. So now, when I hear, &#8220;A user called and said their XenAPP Session was laggy where the hell do I begin? How do I get a holistic vision of all of the security, performance and stability issues that could come up in this new environment.</p>
<p>As a security engineer in 2004, I started calling event correlation digital epidemiology. Epidemiology is defined as <em>&#8220;<span style="color:#333333;">the branch of medicine dealing with the incidence and prevalence of disease in large populations and with detection of the source and cause of epidemics of infectious disease&#8221;<br />
</span></em></p>
<p>I think that this same principal can be applied to system errors, computer based viruses and overall trends. At the root of this is the ability to collate logs from heterogeneous sources into one centralized database. During this series, I hope to go over how to do this without going to your boss and asking for half a million dollars for an event correlation package.</p>
<p>I currently perform the following with a $245 copy of KIWI Syslog Server:(Integrated with SQL Server Reporting Services)</p>
<ul>
<li>Log all Application Firewall Alerts to a SQL Server and present them via an Operations dashboard This includes violation (SQL Injection, XSS, etc), Offending IP and Time of day.</li>
<li>Pull STA Logs and provide a dashboard matrix with the number of users, total number of helpdesk calls, percentage of calls (over 2.5% means we have a problem) and the last ten calls (Our operations staff can see that &#8220;PROTOCOL DRIVER ERROR&#8221; and react before we start getting calls. )</li>
<li>I am alerted when key VIP Personnel are having trouble with their SecurID or AD Credentials.</li>
<li>I can track the prevalence of any error, I can tell when it started and how often it occurs.</li>
<li>My service desk has a tracker application that they can consult when a user cannot connect telling them if their account is locked out, Key fob is expired or if they just fat fingered their password. This has turned a 20 minute call into a 3 minute call.</li>
<li>I have a dashboard that tells me the &#8220;QFARM /Load&#8221; data for every server refreshing every 5 minutes and it turns Yellow at 7500 and red at 8500 letting us know when a server may be about to waffle.</li>
</ul>
<p>For this part of Digital Epidemiologist series I will go over parsing and logging STA Logs, why it was important to me and what you can do with them after getting them into a SQL Server.</p>
<p><strong>Abstract:<br />
</strong></p>
<p>A few y ears ago, I was asked &#8220;What is the current number of external vs internal users&#8221;. This involved a very long, complicated query against RMSummaryDatabase that worked okay but was time consuming. One thing we did realize was that every user who accessed our platform externally came through our CAG/AGEE. This meant that they were issued a ticket by the STA Servers. So we configured logging on the STA Servers and realized a few more things. We also got the application that they launched as well as the IP Address of the server they logged into. So now, if a user says they had a bad Citrix experience, we know where they logged in and what applications they used. While Edgesight does most of our user experience troubleshooting for us, it does not upload in real-time and our STA Solution does. We know right then and there.</p>
<p>By integrating this with SQL Server Reporting Services, we have a poor man&#8217;s Thomas Koetzing solution where we can search the utilization of certain applications, users and servers.</p>
<p>For this post we will learn how to set up STA Logging, how to use EPILOG from Intersect Alliance to write the data to a KIWI Syslog Server and then we will learn how to parse and write that to a SQL Server and use some of the queries I have included to gain valuable data that can eventually be used in a SQL Server Reporting Services report.</p>
<p><strong>Setting up STA Logging:<br />
</strong></p>
<p>Go to %systemroot%\program files\Citrix\system32 and add the following to the ctxsta.config file:</p>
<p><strong>LogLevel=3</strong><br />
MaxLogCount=10<br />
MaxLogSize=55 <strong>(Make sure this size is sufficient).</strong></p>
<p>LogDir=W:\Program Files\Citrix\logs\</p>
<p>In the LogDir folder you will note that the log files created will be named sta2009MMDD.log</p>
<p><strong>What exactly is in the logs:</strong><br />
The logs will show up in the following format: (We are interested in the items in bold where a parse script will pipe them into a database for us. )</p>
<p><span style="font-size:8pt;">INFORMATION 2009/11/22:22:29:32 CSG1305 <strong>Request Ticket &#8211; Successful</strong>. ED0C6898ECA0064389FDD6ABE49A03B9 V4 CGPAddress = 192.168.1.47:2598:localhost:1494 Refreshable = false XData = &lt;?xml version=&#8221;1.0&#8243;?&gt;&lt;!&#8211;DOCTYPE CtxConnInfoProtocol SYSTEM &#8220;CtxConnInfo.dtd&#8221;&#8211;&gt;&lt;CtxConnInfo version=&#8221;1.0&#8243;&gt;<strong>&lt;ServerAddress&gt;192.168.1.47:1494&lt;/ServerAddress&gt;&lt;UserName&gt;JSMITH&lt;/UserName&gt;</strong>&lt;UserDomain&gt;cdc&lt;/UserDomain&gt;<strong>&lt;ApplicationName&gt;Outlook 2007&lt;/ApplicationName&gt;</strong>&lt;Protocol&gt;ICA&lt;/Protocol&gt;&lt;/CtxConnInfo&gt; <strong>ICAAddress = 192.168.1.47:1494</strong><br />
</span></p>
<p><strong>Okay, so I have logs in a flat file&#8230;.big deal!<br />
</strong></p>
<p>The next step involves integrating them with a free open source product called &#8220;Epilog&#8221; by this totally kick ass company called intersect alliance (www.intersectalliance.com). We will configure epilog to send these flat files to a KIWI syslog server.</p>
<p>So we will go to the <a href="http://www.intersectalliance.com/projects/EpilogWindows/index.html">Intersect Alliance Download site</a> to get epilog and run through the installation process. Once that is completed you will want to configure your epilog agent to &#8220;tail-and-send&#8221; your STA Log Files. We will do this by telling it where to get the log file and who to send it to.</p>
<p>After the installation go to START-&gt;Programs-&gt;Intersect Alliance-&gt; Snare/Epilog for Windows</p>
<p><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_1.png?w=530" alt="" /></p>
<p><span style="font-size:9pt;"><strong>Under &#8220;LOG CONFIGURATION&#8221; For STA logs we will use the log type of &#8220;Generic&#8221; and we will type in the location of the log files and we will tell Epilog to use the format of STA20%-*.log<br />
</strong></span></p>
<p><span style="font-size:9pt;"><strong>After configuring the location of logs and type of logs you will want to go to &#8220;Network Configuration&#8221; and type in the IP Address of your Syslog Server and select port 514 (Syslog users UDP 514).<br />
</strong></span></p>
<p><span style="font-size:9pt;"><strong>Once done, go to &#8220;Latest Events&#8221; and see if you see your syslog data there.<br />
</strong></span></p>
<p style="text-align:center;"><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_2.png?w=530" alt="" /><strong><br />
</strong></p>
<p><strong>Section III:</strong> KIWI SYSLOG SERVER</p>
<p>I assume that most Citrix engineers have access to a SQL Server and since Epilog is free, the only thing in this solution that costs money is KIWI Syslog Server. A whopping $245 in fact. Over the years a number of event correlation solutions have come along, in fact I was at one company where we spent over $600K on a solution that had a nice dashboard and logged files to a flat file database (WTF? Are you kidding me?!). The KIWI Syslog Server will allow you to set up ten custom database connectors and that should be plenty for any CItrix administrator who is integrating XenServer, XenAPP/Windows servers, Netscaler/AGEE, CAG 2000 and Application firewall logs into one centralized database. While you need to have some intermediate SQL Skills, you do not need to be a superstar and the benefits of digital epidemiology are enormous. My hope is to continue blog posts on how I use this solution and hopefully you will see benefits beyond looking at your STA logs.</p>
<p>The first thing we need to do is add a rule called &#8220;STA-Logs&#8221; and filter for strings that will let KIWI know that the syslog update is an STA Log. We do so by adding two filters. The first one is stating &#8220;GenericLog&#8221;</p>
<p><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_3.png?w=530" alt="" /></p>
<p>The second filter is &#8220;&lt;Username&gt;&#8221;. The two of these filters will match STA syslog messages.</p>
<p><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_4.png?w=530" alt="" /><strong><br />
</strong></p>
<p>Now that we have created our filters, it&#8217;s time to perform actions. There are two actions we want to perform. We want to parse the script (pull all of the data that was bolded from the log text above) and write that data to a table in a database. You add actions by right-clicking action and selecting &#8220;Add Action&#8221;</p>
<p>So our first &#8220;Action&#8221; is to set up a &#8220;Run Script&#8221; action. I have named mine &#8220;Parse Script&#8221;.</p>
<p>Here is the script I use to parse the data (Thank you Mark Schill (<a href="http://www.cmschill.net/">http://www.cmschill.net/</a>) for showing me how to do this.)</p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>The Script: (This will scrub the raw data into the parts you want, click &#8220;Edit Script&#8221; and paste).<br />
</strong></span></p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>##############################</strong><br />
Function Main()<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Main = &#8220;OK&#8221;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Dim MyMsg<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Dim Status<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Dim UserName<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Dim Application<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Dim ServerIP<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">With Fields<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Status = &#8220;&#8221;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">UserName = &#8220;&#8221;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Application = &#8220;&#8221;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">ServerIP = &#8220;&#8221;    <br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">MyMsg = .VarCleanMessageText<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">If ( Instr( MyMsg, &#8220;CtxConnInfo.dtd&#8221; ) ) Then<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Status = &#8220;Successful&#8221;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">UserBeg = Instr( MyMsg, &#8220;&lt;UserName&gt;&#8221;) + 10<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">UserEnd = Instr( UserBeg, MyMsg, &#8220;&lt;&#8221;)<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">UserName = Mid( MyMsg, UserBeg, UserEnd &#8211; UserBeg)<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">AppBeg = Instr( MyMsg, &#8220;&lt;ApplicationName&gt;&#8221;) + 17<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">AppEnd = Instr( AppBeg, MyMsg, &#8220;&lt;&#8221;)<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Application = Mid( MyMsg, AppBeg, AppEnd &#8211; AppBeg)<br />
</span></p>
<p>    <br />
 </p>
<p><span style="font-family:Arial;font-size:10pt;">SrvBeg = Instr( MyMsg, &#8220;&lt;ServerAddress&gt;&#8221;) + 15<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">SrvEnd = Instr( SrvBeg, MyMsg, &#8220;&lt;/&#8221;)<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">ServerIP = Mid( MyMsg, SrvBeg, SrvEnd &#8211; SrvBeg)<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">End If<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">.VarCustom01 = Status<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">.VarCustom02 = UserName<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">.VarCustom03 = Application<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">.VarCustom04 = ServerIP<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">End With<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">##############################<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Now that we can parse the data we need to create a table in a database with the appropriate columns.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">The next step is to create the field format and create the table. Make sure the account in the connect string has DBO privileges to the database. Set up the custom field format with the following fields. Ensure that the type is SQL Database.<br />
</span></p>
<p><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_5.png?w=530" alt="" /><span style="font-family:Arial;font-size:10pt;"><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">As you see below, you will need to set up an ODBC Connection for your Syslog Database and you will need to provide a connect string here (yes&#8230;in clear text so make sure you know who can log onto the syslog server). When you are all set click &#8220;Create Table&#8221; and click &#8220;Apply&#8221;<br />
</span></p>
<p><img src="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_6.png?w=530" alt="" /><span style="font-family:Arial;font-size:10pt;"><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Hopefully once this is done, you will start filling up your table with STA Log entries with the data from the parse script.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">I have included some helpful queries that have been very useful to me: You may also want to integrate this data with SQL Server Reporting Services and with that, you can build a poor man&#8217;s Thomas Koetzing tool.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>Helpful SQL Queries: (Edit @BEG and @END values)<br />
</strong></span></p>
<p><strong> </strong></p>
<p><strong>How many users for each day:(Unique users per day)</strong></p>
<p>declare @BEG datetime<br />
declare @END datetime<br />
set @BEG = &#8217;2009-11-01&#8242;<br />
set @END = &#8217;2009-11-30&#8242;<br />
select convert(varchar(10),msgdatetime, 111), count(distinct username)<br />
from sta_logs<br />
where msgdatetime between @beg and @end<br />
group by convert(varchar(10),msgdatetime, 111)<br />
order by convert(varchar(10),msgdatetime, 111)</p>
<p><strong>Top 100 Applications for this month:</strong></p>
<p>declare @BEG datetime<br />
declare @END datetime<br />
set @BEG = &#8217;2009-11-01&#8242;<br />
set @END = &#8217;2009-11-30&#8242;<br />
select top 100 [application], count(application)<br />
from sta_logs<br />
where msgdatetime between @beg and @end<br />
group by application<br />
order by count(application) desc<strong></strong></p>
<p><strong>Usage by the hour: (Unique users for each hour)</strong></p>
<p>declare @BEG datetime<br />
declare @END datetime<br />
set @BEG = &#8217;2009-11-01&#8242;<br />
set @END = &#8217;2009-11-02&#8242;<br />
select convert(varchar(2),msgdatetime,108)+&#8217;:00&#8242;, count(distinct username)<br />
from sta_logs<br />
where msgdatetime between @beg and @end<br />
group by convert(varchar(2),msgdatetime,108)+&#8217;:00&#8242;<br />
order by convert(varchar(2),msgdatetime,108)+&#8217;:00&#8242;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmsazboy.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmsazboy.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmsazboy.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xen-trifuge.com&#038;blog=7899546&#038;post=83&#038;subd=jmsazboy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xen-trifuge.com/2009/11/27/83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_1.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_2.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_3.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_4.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_5.png" medium="image" />

		<media:content url="http://jmsazboy.files.wordpress.com/2009/11/112709_1531_6.png" medium="image" />
	</item>
	</channel>
</rss>
