<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[[SecurityRatty] tag: hierarchical]]></title>
    <link>http://securityratty.com/tag/hierarchical</link>
    <description></description>
    <pubDate>Fri, 07 Mar 2008 09:49:00 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[A horse's ass approach to virtualization security]]></title>
      <link>http://securityratty.com/article/6d6310950dd47b0806138e4729f21f01</link>
      <guid>http://securityratty.com/article/6d6310950dd47b0806138e4729f21f01</guid>
      <description><![CDATA[The interest and excitement around virtualization is palpable. However, it seems like the security approaches in this area are similar to the constrains that a horse's ass put on the space shuttle...]]></description>
      <content:encoded><![CDATA[The interest and excitement around virtualization is palpable. However, it seems like the security approaches in this area are similar to the constrains that a <a href="http://www.astrodigital.org/space/stshorse.html">horse's ass put on the space shuttle design</a>.<br /><br />Virtualization security solutions today primarily focus on protecting the virtual OS, the virtual networks, or the hypervisor software itself. More specifically, most current virtualization security technologies are focused on preventing hypervisor root kits, providing intrusion detection, anti-malware, anti-virus, network security, etc. In the physical world, this is similar to individually protecting hardware, operating systems, and the networks that connect them. That is, the focus is mainly on protecting infrastructure and perimeter, not data. Protecting that data, however, should be the single most important aspect of virtualization security.<br /><br />Here is why: Any execution environment requires four elements: devices/hardware/OS, networks, applications, and data. With the advent of virtualization, physical devices/OS are being replaced by flexible, on-demand virtual “devices,” networks are being virtualized and applications are being streamed down from virtual environments. Therefore, the only remaining “constant” element is the data itself - which also has a longer lifetime than the ephemeral virtual environment. While protecting the virtual infrastructure is important, I believe the primary focus for protection should be the data – the true IT asset.<br /><br />Virtualization is a game-changer for computing and has forced the IT world to rethink its infrastructure; now virtualization security has to be rethought as well. An information-centric approach to persistently protecting the data itself is the only way to really benefit from virtualization and keep the data truly secure.<br /><br />Or thinking about it another way - why was Google's approach to navigate the web using search better than the initial Yahoo approach of hierarchical mapping? Coz Yahoo was mapping an old yellow-book approach to managing data, while Google took advantage of the new medium.<br /><br />I shall try and elaborate on my thoughts in upcoming posts...<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/BitArmor1?a=I3ERM"><img src="http://feeds.feedburner.com/~f/BitArmor1?i=I3ERM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/BitArmor1?a=Y0Zmm"><img src="http://feeds.feedburner.com/~f/BitArmor1?i=Y0Zmm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/BitArmor1?a=uQozM"><img src="http://feeds.feedburner.com/~f/BitArmor1?i=uQozM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/BitArmor1/~4/420080548" height="1" width="1"/>]]></content:encoded>
      <pubDate>Mon, 13 Oct 2008 21:52:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/virtualization security">virtualization security</category>
      <category domain="http://securityratty.com/tag/virtualization">virtualization</category>
      <category domain="http://securityratty.com/tag/virtualization security solutions">virtualization security solutions</category>
      <category domain="http://securityratty.com/tag/virtual">virtual</category>
      <category domain="http://securityratty.com/tag/virtual infrastructure">virtual infrastructure</category>
      <category domain="http://securityratty.com/tag/approach">approach</category>
      <category domain="http://securityratty.com/tag/on-demand virtual devices">on-demand virtual devices</category>
      <category domain="http://securityratty.com/tag/ephemeral virtual environment">ephemeral virtual environment</category>
      <category domain="http://securityratty.com/tag/data">data</category>
      <source url="http://feeds.feedburner.com/~r/BitArmor1/~3/420080548/horses-ass-approach-to-virtualization.html">A horse's ass approach to virtualization security</source>
    </item>
    <item>
      <title><![CDATA[On The History of Event Processing: Global Network Monitoring]]></title>
      <link>http://securityratty.com/article/0a39883e48015e3b5b486ebc5391de1e</link>
      <guid>http://securityratty.com/article/0a39883e48015e3b5b486ebc5391de1e</guid>
      <description><![CDATA[In A Short History of Complex Event Processing. Part 1: Beginnings , David Luckham opens his history discussion by saying
Event processing has been going on for more than fifty years
However, in On...]]></description>
      <content:encoded><![CDATA[<p>In <a title="A Short History of Complex Event Processing.  Part 1: Beginnings" rel="bookmark" href="http://complexevents.com/?p=321">A Short History of Complex Event Processing. Part 1: Beginnings</a>, David Luckham opens his history discussion by saying;</p>
<blockquote><p>&#8220;Event processing has been going on for more than fifty years.&#8221;</p></blockquote>
<p>However, in <a href="http://epthinking.blogspot.com/2008/08/on-event-processing-as-discipline-and.html" target="_blank">On Event Processing as a Discipline and Some Subsets</a> another colleague mistakenly blogs,</p>
<blockquote><p><em>&#8220;&#8230; <span>people who dealt in this area [network management and event correlation] have never investigated event processing in the larger sense (e.g. looking at additional patterns), and this area has also not spawned the event processing discipline.&#8221;</span></em></p></blockquote>
<p>If you examine just one page from the <a href="http://pavg.stanford.edu/cep/" target="_blank">CEP history at Stanford</a>, researchers there outlined their view of the future applications for CEP, as follows:</p>
<ul>
<li>Instant Insight  - hierarchical event viewing applied to the Enterprise IT layer.
<ul>
<li><a href="http://pavg.stanford.edu/cep/instantinsightpaper.pdf">Analysing business processes</a></li>
</ul>
</li>
<li><a href="http://pavg.stanford.edu/cep/netviewer-presentation.ppt" target="_blank">Network Level Monitoring and Management</a></li>
<li><a href="http://pavg.stanford.edu/ID/">Cyber Security: Network Intrusion Detection</a></li>
<li>Enterprise Monitoring and Management</li>
<li><a href="http://pavg.stanford.edu/cep/final-version-131102.pdf">Modeling and Simulation of Collaborative Business Processes </a></li>
<li>Business Policy Monitoring</li>
<li>Analysis and Debugging of Distributed Systems</li>
</ul>
<p>These applications areas mentioned by Stanford researchers, including Professor Luckham, support and validate our recent discussion <a title="Magic Quadrant for IT Event Correlation and Analysis, 2007" rel="bookmark" href="http://www.thecepblog.com/2008/08/26/magic-quadrant-for-it-event-correlation-and-analysis-2007/"><span style="color: #105cb6;">Magic Quadrant for IT Event Correlation and Analysis, 2007</span></a> where we concluded that <em>&#8220;event correlation and event analysis is Gartner’s closest magic quadrant (MQ)  [...] relates directly to complex event processing (and event processing in general).&#8221;  </em></p>
<p>If you take a detailed look at the 1999 CEP presentation, <a href="http://pavg.stanford.edu/cep/netviewer-presentation.ppt" target="_blank">Defeating Large Scale Attacks: Technology and Strategies for Global Network Monitoring</a> you will readily see that our colleagues are incorrect when they says that event correlational and network management folks have never investigated event processing in the &#8220;larger sense&#8221;.  For example, the 1999 slides above, Stanford, slide 6, is titled &#8220;Complex Event Processing,&#8221; defining CEP from the application perspective of event correlation;</p>
<p><em>Complex Event Processing</em></p>
<ul>
<li>Accept network ‘events’ from any source
<ul>
<li>CISCO NetFlow FlowCollector, tcpdump</li>
</ul>
</li>
<li>Correlates events based on content and temporal relationship between events</li>
<li>Event Processing Agents (EPAs) connected in an Event Processing Network (EPNs)</li>
<li>Both post-mortem and real-time processing</li>
</ul>
<p>This single event correlational project example from David&#8217;s team at Stanford examined the challenging event correlation problems in the context of hierarchical events, maps, patterns, visualization tools, event processing models, patterns languages, network management abstraction layers, and more.  Those core event processing problems from this 1999 example, very large and complex then, still exist today and are much more large and complex - precisely why it is called &#8220;complex event processing.&#8221;</p>
<p>It is quite obvious, in just this one example, that many folks have been looking at event correlation as a motivating application for event processing, in a larger context, for a long time, contrary to what our colleagues write in their &#8220;history of event processing&#8221; posts.  </p>
<p>In a future post I will completely debuke these event processing &#8220;history revisionists.&#8221;   I will illustrate very clearly how the history of event processing goes back at least a decade, and perhaps two (twenty years) before the history outlined in posts like <a href="http://epthinking.blogspot.com/2008/08/on-research-and-practice-in-event.html" target="_blank">On Research and Practice in Event Processing</a> and <a href="http://www.eventstreamprocessing.com/cep-history.htm" target="_blank">The History of Complex Event Processing</a>. </p>
<p>David Luckam stated that the art-and-science of event processing goes back around 50 years. </p>
<p>I am not sure I will go all the way back to 1960 in my next post on the history of event processing.  However,  I will go back at least to the early days of Internet Protocol (IP) networking and illustrate why distributed IP networking, network management and network security, is one of the key  motivating factors for what we now call &#8220;event processing&#8221; and &#8220;complex event processing.&#8221;</p>
]]></content:encoded>
      <pubDate>Sat, 30 Aug 2008 06:17:59 +0000</pubDate>
      <category domain="http://securityratty.com/tag/event">event</category>
      <category domain="http://securityratty.com/tag/event correlational">event correlational</category>
      <category domain="http://securityratty.com/tag/event correlation problemsin">event correlation problemsin</category>
      <category domain="http://securityratty.com/tag/core event">core event</category>
      <category domain="http://securityratty.com/tag/complex event">complex event</category>
      <category domain="http://securityratty.com/tag/complex">complex</category>
      <category domain="http://securityratty.com/tag/event correlation">event correlation</category>
      <category domain="http://securityratty.com/tag/network">network</category>
      <category domain="http://securityratty.com/tag/hierarchical event">hierarchical event</category>
      <source url="http://www.thecepblog.com/2008/08/30/on-the-history-of-event-processing-global-network-monitoring/">On The History of Event Processing: Global Network Monitoring</source>
    </item>
    <item>
      <title><![CDATA[Modelling Situations for Event Processing]]></title>
      <link>http://securityratty.com/article/eb41e60a6e175e4a75dbe8a59fa78ef8</link>
      <guid>http://securityratty.com/article/eb41e60a6e175e4a75dbe8a59fa78ef8</guid>
      <description><![CDATA[CEP, in a nutshell, is about the real-time detection of business opportunities and threats in cyberspace. Business opportunities and threats are often referred to as situations, so we can simply say...]]></description>
      <content:encoded><![CDATA[<p>CEP, in a nutshell, is about the real-time detection of business opportunities and threats in cyberspace.   Business opportunities and threats are often referred to as situations, so we can simply say that CEP is about the real-time situation detection.   </p>
<p>We represent situations in the domain of event processing by building and refining models of situations.  This means that one way to develop CEP applications or designing CEP architectures is to define situations of interest and build models that define the situation.  </p>
<p>After we have a working model of the situation we will generally have a hierarchical model of the situation composed of various components of the situation.    For purposes of discussion I refer to this as situation modelling.   </p>
<p>If a situation is modelled with 15 components then we need to detect these components of the situation.   In addition, it is generally not good enough to simply detect each one of these components of the situation.  We also have to hold the state of each one of the situational components.  </p>
<p>However, it is not good enough to simply observe the state of 15 components of a situation in the detection process; we also need to observe the relationship between the components.</p>
<p>So, let’s say the situation we are looking for is “commercial air plane collision” and we are building a model of this situation.      To keep the model simple we will limit the model to airplanes and omit objects like birds, buildings; but we will include wind, air speed, and direction.</p>
<p>Our situational model consists of primary objects, in this case an airplane.   Now we need a simple model of an airplane, which is modelled, in this overly simple example, as span, velocity, acceleration, altitude, orientation and relative wind speed and direction.  Generally, an object-oriented approach to model building is preferred so we can reuse the model and overload, morph, inherit and encapsulate as necessary.</p>
<p>One example would be when our boss comes to us and says, great job on the airplane collision model, but I also want to know how much jet fuel is on the planes at the moment of our projected situation, so we can estimate the intensity of the explosion.   So we need another model and our earlier very simple airplane model would inherit the jet fuel tank model our boss requires.</p>
<p>I hope from this simple example of model building that you will conclude that modelling is one of the most important aspects of CEP.   Without good models, situation detection impossible, and CEP engines are useless.    Situation modelling is critical to CEP.  </p>
<p>So, if a CEP vendor comes to you and says they have a very powerful CEP engine, ask them to show you a complex model of a situation that is important to you and explain to you how they represent the object.  If models are not represented using an object-oriented approach, I recommend you send the vendor back to their software development lab, because without an OO approach to modelling, you can only represent very simple situations. </p>
<p>Furthermore, let’s say you are leading a team building a large model.   If there are several teams working on various parts of the model, you need a common framework to integrate the work of the various teams.  I strongly recommend an OO approach to your model building systems architecture and work breakdown structure.</p>
<p>In a future post, I will write about the companion to modelling – simulation</p>
]]></content:encoded>
      <pubDate>Tue, 15 Jul 2008 01:04:21 +0000</pubDate>
      <category domain="http://securityratty.com/tag/model">model</category>
      <category domain="http://securityratty.com/tag/airplane collision model">airplane collision model</category>
      <category domain="http://securityratty.com/tag/simple model">simple model</category>
      <category domain="http://securityratty.com/tag/model simple">model simple</category>
      <category domain="http://securityratty.com/tag/situations">situations</category>
      <category domain="http://securityratty.com/tag/hierarchical model">hierarchical model</category>
      <category domain="http://securityratty.com/tag/complex model">complex model</category>
      <category domain="http://securityratty.com/tag/simple airplane model">simple airplane model</category>
      <category domain="http://securityratty.com/tag/real-time situation detection">real-time situation detection</category>
      <source url="http://www.thecepblog.com/2008/07/15/modelling-situations-for-event-processing/">Modelling Situations for Event Processing</source>
    </item>
    <item>
      <title><![CDATA[A Blast from the Past: Processing Patterns for Predictive Business, March 2006]]></title>
      <link>http://securityratty.com/article/82a7aa9e17030f2308e03502a40f3bef</link>
      <guid>http://securityratty.com/article/82a7aa9e17030f2308e03502a40f3bef</guid>
      <description><![CDATA[Forreaders interested in complex event processing and a few of the challenges the industry faces, here is a presentation from 28 months back called Processing Patterns for Predictive Business . This...]]></description>
      <content:encoded><![CDATA[<p>For readers interested in complex event processing and a few of the challenges the industry faces, here is a presentation from 28 months back called <a href="http://http://www.complexevents.com/slides/TIBCO_MARCH_2006.ppt" target="_blank">Processing Patterns for Predictive Business</a>.   This presentation was delivered at the first <a title="Workshop on Event Processing - Presentations" rel="bookmark" href="http://complexevents.com/?page_id=87">Workshop on Event Processing - Presentations</a> at IBM Research Labs, Yorktown Heights, March 14-16th 2006.</p>
<p>The same key points of that presentation are still relevant today:</p>
<p><strong><em>1. Event-Decision Processing is Computationally Intensive</em></strong></p>
<p><em><strong>2. CEP requires a Number of Technologies</strong></em>:</p>
<ul>
<li>Distributed Computing, Publish/Subscribe and SOA</li>
<li>Hierarchical, Cooperative Inference Processing</li>
<li>High Speed, Real Time Processing with State Management</li>
<li>Event-Decision Architecture for Complex Situations and Events</li>
<li>There is no single “CEP Solution” or “CEP Product” <em>(in the market place then, and today)</em></li>
</ul>
<p><em><strong>3. CEP needs a Common Vocabulary and Functional Architecture based on Mature, Industry-Standard Inference Models</strong></em></p>
<p><em><strong>4. Processing and Integration Patterns for CEP need to be Developed and Formalized</strong></em></p>
<p>Since March of 2006 a number of other challenges has surfaced.  I will elaborate on this challenges in a future post.</p>
]]></content:encoded>
      <pubDate>Wed, 09 Jul 2008 03:22:26 +0000</pubDate>
      <category domain="http://securityratty.com/tag/event-decision architecture">event-decision architecture</category>
      <category domain="http://securityratty.com/tag/cep">cep</category>
      <category domain="http://securityratty.com/tag/event-decision">event-decision</category>
      <category domain="http://securityratty.com/tag/cep requires">cep requires</category>
      <category domain="http://securityratty.com/tag/cep product">cep product</category>
      <category domain="http://securityratty.com/tag/patterns">patterns</category>
      <category domain="http://securityratty.com/tag/march">march</category>
      <category domain="http://securityratty.com/tag/event">event</category>
      <category domain="http://securityratty.com/tag/complex event">complex event</category>
      <source url="http://www.thecepblog.com/2008/07/09/a-blast-from-the-past-processing-patterns-for-predictive-business-march-2006/">A Blast from the Past: Processing Patterns for Predictive Business, March 2006</source>
    </item>
    <item>
      <title><![CDATA[A Blast from the Past: CEP at Stanford,1998-2003]]></title>
      <link>http://securityratty.com/article/ecd27eebd62b2df7d9e99b1fcf7ac96f</link>
      <guid>http://securityratty.com/article/ecd27eebd62b2df7d9e99b1fcf7ac96f</guid>
      <description><![CDATA[Courtesy of Complex Event Processing at Stanford
Complex event processing (CEP) is a new technology. It can be applied to extracting and analyzing information from any kind of distributed...]]></description>
      <content:encoded><![CDATA[<p>Courtesy of <a href="http://pavg.stanford.edu/cep/" target="_blank">Complex Event Processing at Stanford</a></p>
<p>Complex event processing (CEP) is a new technology. It can be applied to extracting and analyzing information from any kind of distributed message-based system. It is developed from the Rapide concepts of (1) causal event modeling, (2) event patterns and pattern matching, and (3) event pattern maps and constraints. Complex event processing can be applied to a wide variety of Enterprise monitoring and management problems, from low level network management to high level enterprise intelligence gathering.</p>
<h2>Applications of Complex Event Processing:</h2>
<ul>
<li><strong><a href="http://pavg.stanford.edu/cep/enterprise-viewing.html">Instant Insight</a></strong>  - hierarchical event viewing applied to the Enterprise IT layer. (coming soon)
<ul>
<li><a href="http://pavg.stanford.edu/cep/instantinsightpaper.pdf">Analysing business processes</a> (paper in pdf format)</li>
</ul>
</li>
<li><a href="http://pavg.stanford.edu/cep/netviewer-presentation.ppt">Network Level Monitoring and Management (Powerpoint presentation)</a></li>
<li><a href="http://pavg.stanford.edu/ID/">Cyber Security: Network Intrusion Detection</a></li>
<li>Enterprise Monitoring and Management (coming soon)</li>
<li><a href="http://pavg.stanford.edu/cep/final-version-131102.pdf">Modeling and Simulation of Collaborative Business Processes </a></li>
<li>Business Policy Monitoring. (coming soon)</li>
<li>Analysis and Debugging of Distributed Systems (coming soon)</li>
</ul>
<h2>Presentations:</h2>
<ul>
<li><a href="http://pavg.stanford.edu/cep/ee380abstract.html">&#8220;Complex Event Processing: An Essential Technology for Instant Insight into the Operation of Enterprise Information Systems,&#8221; </a>lecture at the Stanford University Computer Systems Laborary EE380 Colloquium series. <a href="http://stanford-online.stanford.edu/courses/ee380/030115-ee380-100.asx">Video of the lecture (duration: 60 minutes). </a></li>
</ul>
<h2>Publications:</h2>
<ul>
<li><em><a href="http://pavg.stanford.edu/cep/fabline.ps">Complex Event Processing in Distributed Systems.</a></em> David C. Luckham and Brian Frasca, Stanford University Technical Report CSL-TR-98-754, March 1998, 28 pages.<em>Abstract:</em> Complex event processing is a new technology for extracting information from distributed message-based systems. This technology allows users of a system to specify the information that is of interest to them. It can be low level network processing data or high level enterprise management intelligence, depending upon the role and viewpoint of individual users. And it can be changed from moment to moment while the target system is in operation. This paper presents an overview of Complex Event Processing applied to a particular example of a distributed message-based system, a fabrication process management system. The concepts of causal event histories, event patterns, event filtering, and event aggregation are introduced and their application to the process management system is illustrated by simple examples. This paper gives the reader an overview of Complex Event Processing concepts and illustrates how they can be applied using the Rapide toolset to one specific kind of system.<br />
 </li>
<li><em><a href="http://pavg.stanford.edu/cep/99pakdd.ps">Event Mining with Event Processing Networks.</a></em> Louis Perrochon and Walter Mann and Stephane Kasriel and David C. Luckham, The Third Pacific-Asia Conference on Knowledge Discovery and Data Mining. April 26-28, 1999. Beijing, China, 5 pages.<em>Abstract:</em> Event Mining discovers and delivers information and knowledge in a real-time stream of data, or events. We show that the process of delivering knowledge by searching patterns in data and subsequent abstraction of found patterns can be applied in real-time to a complex, asynchronous system. Our event processing engine consists of a network of event processing agents (EPAs) running in parallel that interact using a dedicated event processing infrastructure. The agents can be configured at run-time using a formal pattern language. The underlying infrastructure (1) provides an abstract communication mechanism and thus allows dynamic reconfiguration of the communication topology between agents at run-time and (2) provides transparent, location-independent access to all data. These features allow dynamic allocation of EPAs to different threads and processes on different machines at run time.<br />
 </li>
<li><em><a href="http://pavg.stanford.edu/people/santoro/distrib/ejava.ps">eJava - Extending Java with Causality</a></em>. Alexandre Santoro and Walter Mann and Neel Madhav and David Luckham, Proceedings of the 10th International Conference on Software Engineering and Knowledge Engineering, June 1998, 10 pages.<em>Abstract:</em> Programming languages like Java provide designers with a variety of classes that simplify the process of program development. Some of these classes allow one to easily build multithreaded programs. Though useful, especially in the creation of reactive systems, multithreaded programs present challenging problems such as race conditions and synchronization issues. Validating these programs against a specification is not trivial since Java does not clearly indicate thread interaction. These problems can be solved by modifying Java so that it produces computations, collections of events with both causal and temporal ordering relations defined for them. Specifically, the causal ordering is ideal for identifying thread interaction. This paper presents eJava, an extension to Java that is both event based and causally aware, and shows how it simplifies the process of understanding and debugging multithreaded programs.<br />
 </li>
<li><a href="http://pavg.stanford.edu/cep/99wicsa1.ps.gz">Event-Based Execution Architectures for Dynamic Software Systems</a>. James Vera, Louis Perrochon, David C. Luckham.<br />
Proceedings of the First Working IFIP Conf. on Software Architecture. 1999. San Antonio, Texas.<em>Abstract:</em> Distributed systems&#8217; runtime behavior can be difficult to understand. Concurrent, distributed activity make notions of global state difficult to grasp. We focus on the runtime structure of a system, its execution architecture, and propose representing its evolution as a partially ordered set of predefined architectural event types. This representation allows a system&#8217;s topology to be visualized, analyzed and con-strained. The use of a predefined event types allows the execution architectures of different systems to be readily compared.<br />
 </li>
<li><em><a href="http://pavg.stanford.edu/cep/cidf.ps.gz">Using Context-Based Correlation in Network Operations and Management</a></em>. Louis Perrochon (work in progress, mail author for newest version)<em>Abstract:</em> Network operation consists to a large degree of reaction to activities happening in the network. Better knowledge of the network at any time allows more appropriate reactions. On the example of intrusion detection, we show how context-based correlation of such activities can provide a more detailed view of the network in shorter time. We first present how we model context and then describe the architecture of the Stanford University CEP context-based correlator. Correlation is specified as event patterns in a declarative language that allows us to specify what needs to be detected, instead of specifying how it should be detected. CEP introduces the concept of causal context to intrusion detection. The correlator is able to process events on-line, as they are generated and it can be reconfigured at dynamically. We then show how it increases detection rate, reduce false alarms, and detect large-scale attack patterns at an early stage.</li>
</ul>
]]></content:encoded>
      <pubDate>Mon, 07 Jul 2008 15:20:21 +0000</pubDate>
      <category domain="http://securityratty.com/tag/architectural event types">architectural event types</category>
      <category domain="http://securityratty.com/tag/event">event</category>
      <category domain="http://securityratty.com/tag/event pattern maps">event pattern maps</category>
      <category domain="http://securityratty.com/tag/event types">event types</category>
      <category domain="http://securityratty.com/tag/event aggregation">event aggregation</category>
      <category domain="http://securityratty.com/tag/event patterns">event patterns</category>
      <category domain="http://securityratty.com/tag/complex event">complex event</category>
      <category domain="http://securityratty.com/tag/event based">event based</category>
      <category domain="http://securityratty.com/tag/hierarchical event">hierarchical event</category>
      <source url="http://www.thecepblog.com/2008/07/07/a-blast-from-the-past-cep-at-stanford1998-2003/">A Blast from the Past: CEP at Stanford,1998-2003</source>
    </item>
    <item>
      <title><![CDATA[Kill Switches and Remote Control]]></title>
      <link>http://securityratty.com/article/6faff6d8aced2811984a7463136f6b3a</link>
      <guid>http://securityratty.com/article/6faff6d8aced2811984a7463136f6b3a</guid>
      <description><![CDATA[It used to be that just the entertainment industries wanted to control your computers -- and televisions and iPods and everything else -- to ensure that you didn't violate any copyright rules. But now...]]></description>
      <content:encoded><![CDATA[It used to be that just the entertainment industries wanted to control your computers -- and televisions and iPods and everything else -- to ensure that you didn't violate any copyright rules. But now everyone else wants to get their hooks into your gear.

OnStar will soon include the <a href="http://www.informationweek.com/news/mobility/showArticle.jhtml?articleID=202400922">ability</a> for the police to shut off your engine remotely. Buses are getting the <a href="http://www.nypost.com/seven/06082008/news/regionalnews/busting_terror_114567.htm">same capability</a>, in case terrorists want to re-enact the movie <cite>Speed</cite>. The Pentagon wants a kill switch <a href="http://blog.wired.com/defense/2008/06/the-pentagons-n.html">installed</a> on airplanes, and is worried about potential enemies <a href="http://spectrum.ieee.org/may08/6171">installing</a> kill switches on their own equipment. 

Microsoft is doing some of the most creative thinking along these lines, with something it's calling "<a href="http://arstechnica.com/news.ars/post/20080611-microsoft-patent-brings-miss-manners-into-the-digital-age.html">Digital Manners Policies</a>." According to its <a href="http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50&s1=%2220080125102%22.PGNR.&OS=DN/20080125102&RS=DN/20080125102">patent application</a>, DMP-enabled devices would accept broadcast "orders" limiting capabilities. Cellphones could be remotely set to vibrate mode in restaurants and concert halls, and be turned off on airplanes and in hospitals. Cameras could be prohibited from taking pictures in locker rooms and museums, and recording equipment could be disabled in theaters. Professors finally could prevent students from texting one another during class. 

The possibilities are endless, and very dangerous. Making this work involves building a nearly flawless hierarchical system of authority. That's a difficult security problem even in its simplest form. Distributing that system among a variety of different devices -- computers, phones, PDAs, cameras, recorders -- with different firmware and manufacturers, is even more difficult. Not to mention delegating different levels of authority to various agencies, enterprises, industries and individuals, and then enforcing the necessary safeguards.

Once we go down this path -- giving one device authority over other devices -- the security problems start piling up. Who has the authority to limit functionality of my devices, and how do they get that authority? What prevents them from abusing that power? Do I get the ability to override their limitations? In what circumstances, and how? Can they override my override?

How do we prevent this from being abused? Can a burglar, for example, enforce a "no photography" rule and prevent security cameras from working? Can the police enforce the same rule to avoid another Rodney King incident? Do the police get "superuser" devices that cannot be limited, and do they get "supercontroller" devices that can limit anything? How do we ensure that only they get them, and what do we do when the devices inevitably fall into the wrong hands?

It's comparatively easy to make this work in closed specialized systems -- OnStar, airplane avionics, military hardware -- but much more difficult in open-ended systems. If you think Microsoft's vision could possibly be securely designed, all you have to do is look at the dismal effectiveness of the various copy-protection and digital-rights-management systems we've seen over the years. That's a similar capabilities-enforcement mechanism, albeit simpler than these more general systems.

And that's the key to understanding this system. Don't be fooled by the scare stories of wireless devices on airplanes and in hospitals, or visions of a world where no one is yammering loudly on their cellphones in posh restaurants. This is really about media companies wanting to exert their control further over your electronics. They not only want to prevent you from surreptitiously recording movies and concerts, they want your new television to enforce good "manners" on your computer, and not allow it to record any programs. They want your iPod to politely refuse to copy music to a computer other than your own. They want to enforce <em>their</em> legislated definition of manners: to control what you do and when you do it, and to charge you repeatedly for the privilege whenever possible. 

"Digital Manners Policies" is a marketing term. Let's call this what it really is: Selective Device Jamming. It's not polite, it's dangerous. It won't make anyone more secure -- or more polite.

This essay <a href="http://www.wired.com/politics/security/commentary/securitymatters/2008/06/securitymatters_0626">originally appeared</a> in Wired.com.<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=JiKwGJ"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=JiKwGJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=aXm5MJ"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=aXm5MJ" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Tue, 01 Jul 2008 02:48:37 +0000</pubDate>
      <category domain="http://securityratty.com/tag/wireless devices">wireless devices</category>
      <category domain="http://securityratty.com/tag/devices">devices</category>
      <category domain="http://securityratty.com/tag/devices inevitably">devices inevitably</category>
      <category domain="http://securityratty.com/tag/digital manners policies">digital manners policies</category>
      <category domain="http://securityratty.com/tag/prevent">prevent</category>
      <category domain="http://securityratty.com/tag/prevent security cameras">prevent security cameras</category>
      <category domain="http://securityratty.com/tag/difficult security">difficult security</category>
      <category domain="http://securityratty.com/tag/cameras">cameras</category>
      <category domain="http://securityratty.com/tag/prevent students">prevent students</category>
      <source url="http://www.schneier.com/blog/archives/2008/07/kill_switches_a.html">Kill Switches and Remote Control</source>
    </item>
    <item>
      <title><![CDATA[Security Matters: I've Seen the Future, and It Has a Kill Switch]]></title>
      <link>http://securityratty.com/article/b9aa8529e116abf92778a4755495e63d</link>
      <guid>http://securityratty.com/article/b9aa8529e116abf92778a4755495e63d</guid>
      <description><![CDATA[It used to be that just the entertainment industries wanted to control your computers -- and televisions and iPods and everything else -- to ensure that you didn't violate any copyright rules. But now...]]></description>
      <content:encoded><![CDATA[<p>It used to be that just the entertainment industries wanted to control your computers -- and televisions and iPods and everything else -- to ensure that you didn't violate any copyright rules. But now everyone else wants to get their hooks into your gear.
</p><p>
OnStar will soon include the <a href="http://www.informationweek.com/news/mobility/showArticle.jhtml?articleID=202400922">ability</a> for the police to shut off your engine remotely. Buses are getting the <a href="http://www.nypost.com/seven/06082008/news/regionalnews/busting_terror_114567.htm">same capability</a>, in case terrorists want to re-enact the movie <cite>Speed</cite>. The Pentagon wants a kill switch <a href="http://blog.wired.com/defense/2008/06/the-pentagons-n.html">installed</a> on airplanes, and is worried about potential enemies <a href="http://spectrum.ieee.org/may08/6171">installing</a> kill switches on their own equipment. 
</p><p>
Microsoft is doing some of the most creative thinking along these lines, with something it's calling "<a href="http://arstechnica.com/news.ars/post/20080611-microsoft-patent-brings-miss-manners-into-the-digital-age.html">Digital Manners Policies</a>." According to its <a href="http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50&s1=%2220080125102%22.PGNR.&OS=DN/20080125102&RS=DN/20080125102">patent application</a>, DMP-enabled devices would accept broadcast "orders" limiting capabilities. Cellphones could be remotely set to vibrate mode in restaurants and concert halls, and be turned off on airplanes and in hospitals. Cameras could be prohibited from taking pictures in locker rooms and museums, and recording equipment could be disabled in theaters. Professors finally could prevent students from texting one another during class. 
</p><p>
The possibilities are endless, and very dangerous. Making this work involves building a nearly flawless hierarchical system of authority. That's a difficult security problem even in its simplest form. Distributing that system among a variety of different devices -- computers, phones, PDAs, cameras, recorders -- with different firmware and manufacturers, is even more difficult. Not to mention delegating different levels of authority to various agencies, enterprises, industries and individuals, and then enforcing the necessary safeguards.
</p><p>
Once we go down this path -- giving one device authority over other devices -- the security problems start piling up. Who has the authority to limit functionality of my devices, and how do they get that authority? What prevents them from abusing that power? Do I get the ability to override their limitations? In what circumstances, and how? Can they override my override?
</p><p>
How do we prevent this from being abused? Can a burglar, for example, enforce a "no photography" rule and prevent security cameras from working? Can the police enforce the same rule to avoid another Rodney King incident? Do the police get "superuser" devices that cannot be limited, and do they get "supercontroller" devices that can limit anything? How do we ensure that only they get them, and what do we do when the devices inevitably fall into the wrong hands?
</p><p>
It's comparatively easy to make this work in closed specialized systems -- OnStar, airplane avionics, military hardware -- but much more difficult in open-ended systems. If you think Microsoft's vision could possibly be securely designed, all you have to do is look at the dismal effectiveness of the various copy-protection and digital-rights-management systems we've seen over the years. That's a similar capabilities-enforcement mechanism, albeit simpler than these more general systems.
</p><p>
And that's the key to understanding this system. Don't be fooled by the scare stories of wireless devices on airplanes and in hospitals, or visions of a world where no one is yammering loudly on their cellphones in posh restaurants. This is really about media companies wanting to exert their control further over your electronics. They not only want to prevent you from surreptitiously recording movies and concerts, they want your new television to enforce good "manners" on your computer, and not allow it to record any programs. They want your iPod to politely refuse to copy music a computer other than your own. They want to enforce <em>their</em> legislated definition of manners: to control what you do and when you do it, and to charge you repeatedly for the privilege whenever possible. 
</p><p>
"Digital Manners Policies" is a marketing term. Let's call this what it really is: Selective Device Jamming. It's not polite, it's dangerous. It won't make anyone more secure -- or more polite.
</p>
<p>
---
</p>
<p><em>Bruce Schneier is chief security technology officer of BT, and author of</em> Beyond Fear: Thinking Sensibly About Security in an Uncertain World<em>.</em>
</p><br style="clear: both;"/>
  <img alt="" style="border: 0; height:1px; width:1px;" border="0" src="http://www.pheedo.com/img.phdo?i=2e7004605a2cfdb2dff6647568035341" height="1" width="1"/>
<img src="http://www.pheedo.com/feeds/tracker.php?i=2e7004605a2cfdb2dff6647568035341" style="display: none;" border="0" height="1" width="1" alt=""/><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=TdV5GI"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=TdV5GI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=hCKWyi"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=hCKWyi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=P6GE7i"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=P6GE7i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=YY5ZlI"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=YY5ZlI" border="0"></img></a>
 <a href="http://feeds.wired.com/~f/wired/politics/security?a=rAla0I"><img src="http://feeds.wired.com/~f/wired/politics/security?i=rAla0I" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=DKXIgi"><img src="http://feeds.wired.com/~f/wired/politics/security?i=DKXIgi" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=IE7M8i"><img src="http://feeds.wired.com/~f/wired/politics/security?i=IE7M8i" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=swX5hI"><img src="http://feeds.wired.com/~f/wired/politics/security?i=swX5hI" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/wired/politics/privacy/~4/320220918" height="1" width="1"/><img src="http://feeds.wired.com/~r/wired/politics/security/~4/320220920" height="1" width="1"/>]]></content:encoded>
      <pubDate>Thu, 26 Jun 2008 00:00:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/security">security</category>
      <category domain="http://securityratty.com/tag/wireless devices">wireless devices</category>
      <category domain="http://securityratty.com/tag/devices">devices</category>
      <category domain="http://securityratty.com/tag/prevent">prevent</category>
      <category domain="http://securityratty.com/tag/prevent security cameras">prevent security cameras</category>
      <category domain="http://securityratty.com/tag/difficult security">difficult security</category>
      <category domain="http://securityratty.com/tag/cameras">cameras</category>
      <category domain="http://securityratty.com/tag/prevent students">prevent students</category>
      <category domain="http://securityratty.com/tag/difficult">difficult</category>
      <source url="http://feeds.wired.com/~r/wired/politics/security/~3/320220920/securitymatters_0626">Security Matters: I've Seen the Future, and It Has a Kill Switch</source>
    </item>
    <item>
      <title><![CDATA[Risk and Culture]]></title>
      <link>http://securityratty.com/article/7ed36912c54727439bd60bb27e3c2b24</link>
      <guid>http://securityratty.com/article/7ed36912c54727439bd60bb27e3c2b24</guid>
      <description><![CDATA[The Second National Risk and Culture Study , conducted by the Cultural Cognition Project at Yale Law School. Abstract
Cultural Cognition refers to the disposition to conform one's beliefs about...]]></description>
      <content:encoded><![CDATA[<p>The <a href="http://research.yale.edu/culturalcognition/content/view/124/89/">Second National Risk and Culture Study</a>, conducted by the Cultural Cognition Project at Yale Law School.</p>

<blockquote><strong>Abstract:</strong>

<p>Cultural Cognition refers to the disposition to conform one's beliefs about societal risks to one's preferences for how society should be organized. Based on surveys and experiments involving some 5,000 Americans, the Second National Risk and Culture Study presents empirical evidence of the effect of this dynamic in generating conflict about global warming, school shootings, domestic terrorism, nanotechnology, and the mandatory vaccination of school-age girls against HPV, among other issues. The Study also presents evidence of risk-communication strategies that counteract cultural cognition. Because nuclear power affirms rather than threatens the identity of persons who hold individualist values, for example, proposing it as a solution to global warming makes persons who hold such values more willing to consider evidence that climate change is a serious risk. Because people tend to impute credibility to people who share their values, persons who hold hierarchical and egalitarian values are less likely to polarize when they observe people who hold their values advocating unexpected positions on the vaccination of young girls against HPV. Such techniques can help society to create a deliberative climate in which citizens converge on policies that are both instrumentally sound and expressively congenial to persons of diverse values.</blockquote></p>

<p>And from the conclusion:</p>

<blockquote><strong>Conclusion:</strong>

<p>There <i>is</i> a culture war in America, but it is about <i>facts</i>, not values. There is very little evidence that most Americans care nearly as much about issues that symbolize competing cultural values as they do about the economy, national security, and the safety and health of themselves and their loved ones. There is ample evidence, however, that Americans are sharply divided along cultural lines about what sorts of conditions endanger these interests and what sorts of policies effectively counteract such risks.</p>

<p>Findings from the Second National Culture and Risk Study help to show why. Psychologically speaking, it's much easier to believe that conduct one finds dishonorable or offensive is dangerous, and conduct one finds noble or admirable is socially beneficial, than vice versa. People are also much more inclined to accept information about risk and danger when it comes from someone who shares their values than when it comes from someone who holds opposing commitments.</blockquote> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=Wy4uIH"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=Wy4uIH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=QOMCyH"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=QOMCyH" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Wed, 21 May 2008 01:19:59 +0000</pubDate>
      <category domain="http://securityratty.com/tag/risk">risk</category>
      <category domain="http://securityratty.com/tag/values">values</category>
      <category domain="http://securityratty.com/tag/cultural values">cultural values</category>
      <category domain="http://securityratty.com/tag/hold hierarchical">hold hierarchical</category>
      <category domain="http://securityratty.com/tag/hold">hold</category>
      <category domain="http://securityratty.com/tag/egalitarian values">egalitarian values</category>
      <category domain="http://securityratty.com/tag/hold individualist values">hold individualist values</category>
      <category domain="http://securityratty.com/tag/diverse values">diverse values</category>
      <category domain="http://securityratty.com/tag/national risk">national risk</category>
      <source url="http://www.schneier.com/blog/archives/2008/05/risk_and_cultur.html">Risk and Culture</source>
    </item>
    <item>
      <title><![CDATA[Enabling hierarchical nant builds]]></title>
      <link>http://securityratty.com/article/6d991aa98c59ab5248eca3f43819fd48</link>
      <guid>http://securityratty.com/article/6d991aa98c59ab5248eca3f43819fd48</guid>
      <description><![CDATA[In a recent post , I talked about my experience enabling continuous integration for the internal builds here at Pluralsight. I recently worked with Craig to restructure our nant build. As part of...]]></description>
      <content:encoded><![CDATA[<p>In a <a href="http://www.pluralsight.com/blogs/keith/archive/2008/01/18/49967.aspx" target="_blank">recent post</a>, I talked about my experience enabling continuous integration for the internal builds here at Pluralsight. I recently worked with Craig to restructure our nant build. As part of that, I wanted to ensure that I could run the build from anywhere in the source tree. We use a typical hierarchical build where each project has a build script that knows how to compile, test, deploy, etc. based on the specified target. Then at the top of the tree, there's a build script that runs all the other ones. That root build script is what gets run automatically by <a href="http://ccnet.thoughtworks.com/" target="_blank">Cruise Control</a>.</p>
<p>My root script defines a bunch of properties, like where the output directories for the overall build live, where the tools live, and so on. And that works fine when I run the build from the root. The properties get defined, all the child scripts are run with &lt;nant/&gt; tasks, and they see those properties. But if I want to drill down into the tree and run one of the build scripts lower down, suddenly there's problems because it depends on properties that are only defined in the root script. I really like being able to run builds from anywhere in the tree for perf - if I'm trying to fix a particular project, I don't necessarily want to wait for unit tests on the entire tree to run in order to see if mine passed.</p>
<p>Craig made a great suggestion. Put the properties into a separate script (we named it properties.nant) and &lt;include/&gt; that script. Then to enable hierarchical builds, we'd create a properties.nant file for each folder in the tree, which would &lt;include/&gt; its parent. That way I could define properties anywhere in the tree, and they would be "inherited" by anything below it.</p>
<p>I took that idea one step further, because I didn't want to maintain a bunch of property scripts with nothing in them but an &lt;include/&gt; for the parent. I wrote an &lt;includefromparent/&gt; nant task that walks up the directory tree looking for the target file. So now I can do this:</p>
<p><tt>&lt;includefromparent buildfile="properties.nant"/&gt;</tt></p>
<p>This worked great! But now I ran into a problem. Many of my properties are defined like so in the root properties.nant file:</p>
<p><tt>&lt;property name="libraryOutputDir" value="${project::get-base-directory()}\artifacts\libraries"/&gt;</tt></p>
<p>Do you see the issue? If I run the build with the root script, everything works fine, because it's the root nant project I'm building, and get-base-directory() refers to the root of the project, where the artifacts folder lives. But if I run from lower in the tree, it's a different project, and get-base-directory() refers to a subfolder, where the artifacts folder definitely should NOT be.</p>
<p>I needed a way to find the root of the project tree. So I build a second really simple nant task:</p>
<p><tt>&lt;findmarkeddir markerfile="filetolookfor.txt" property="root"/&gt;</tt></p>
<p>This task simply looks up the directory hierarchy until it finds the specified marker file, then puts the name of that directory (the "marked" directory) into a designated property (here I've called it root). With that in place, I rewrote my property definitions in terms of the base directory:</p>
<p><tt>&lt;property name="libraryOutputDir" value="${root}\artifacts\libraries"/&gt;</tt></p>
<p>Voilà! I can now run builds from any of my build scripts. They inherit properties hierarchically like you'd expect, and the system is quite easy to maintain. If you'd like to use these tasks, I've included the code for them below (not much code, really). And if you've never written a nant task yourself before, here's <a href="http://blogs.geekdojo.net/rcase/archive/2005/01/06/5971.aspx" target="_blank">the article</a> I used to figure out how it's done (it's super easy). <a href="http://nant.sourceforge.net/release/latest/help/fundamentals/tasks.html#taskloader" target="_blank">Here's</a> what you should read to learn about the various options for deploying your custom task assembly so nant recognizes it.</p>
<p>Enjoy!</p>
<p>Here is <b>FindMarkedDirTask.cs</b></p><pre>using System;
using System.Collections.Generic;
using System.Text;
using NAnt.Core;
using NAnt.Core.Attributes;
using System.IO;

namespace PluralsightNantTasks {

[TaskName("findmarkeddir")]
public class FindMarkedDirTask : Task {

  [TaskAttribute("markerfile", Required = true)]
  [StringValidator(AllowEmpty = false)]
  public string MarkerFileName { get; set; }

  [TaskAttribute("property", Required = true)]
  [StringValidator(AllowEmpty = false)]
  public string PropertyName { get; set; }

  protected override void ExecuteTask() {
    string searchDir = this.Project.BaseDirectory;
    do {
      if (MarkerFileExistsIn(searchDir)) {
        this.Project.Properties[PropertyName] = searchDir;
        return;
      }
      searchDir = ParentOf(searchDir);
    } while (!IsRootDirectory(searchDir));
  }

  private bool IsRootDirectory(string path) {
    return Path.GetPathRoot(path) == Path.GetFullPath(path);
  }

  private string ParentOf(string directory) {
    return Path.GetFullPath(Path.Combine(directory, ".."));
  }

  private bool MarkerFileExistsIn(string directory) {
    return File.Exists(Path.Combine(directory, MarkerFileName));
  }
}
}
</pre>
<p>And here is <b>IncludeFromParentTask.cs</b> (note I derive from the built-in include task):</p><pre>using System;
using System.Collections.Generic;
using System.Text;
using NAnt.Core;
using NAnt.Core.Attributes;
using NAnt.Core.Tasks;
using System.IO;
using System.Globalization;

namespace PluralsightNantTasks {

[TaskName("includefromparent")]
public class IncludeFromParentTask : IncludeTask {

  protected override void Initialize() {
    string fileName = BuildFileName;
    if (fileName.Contains("/") || fileName.Contains(@"\\"))
      throw new BuildException(string.Format(
        CultureInfo.CurrentCulture,
        "buildfile attribute must only be a filename"));

    string relativePathToFoundFile = SearchParentDirectory(
      Project.BaseDirectory, fileName, 0);
      
    if (null == relativePathToFoundFile)
      throw new BuildException(string.Format(
        CultureInfo.CurrentCulture,
        "Couldn't find a file named {0}" +
        " in a parent directory of {1}",
        fileName, Project.BaseDirectory));

    // have to use a relative path here
    // because <include /> task uses
    // Path.Combine(projectDir, BuildFileName)
    // to get the full path
    BuildFileName = relativePathToFoundFile;

    base.Initialize();
  }

  private string SearchParentDirectory(string directory,
                        string fileName, int searchDepth) {
    ++searchDepth;
  
    // see if we've traversed all the way to the root
    string currentPath = Path.GetFullPath(directory);
    if (currentPath == Path.GetPathRoot(currentPath))
      return null;

    // recurse until we find the file
    string parentDir = Path.GetFullPath(
      Path.Combine(currentPath, ".."));
    string path = Path.Combine(parentDir, fileName);
    if (File.Exists(path)) {
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i &lt; searchDepth; ++i)
        sb.Append(@"..\");
      return Path.Combine(sb.ToString(), fileName);
    }
    else return SearchParentDirectory(parentDir,
                          fileName, searchDepth);
  }
}
}
</pre><div style="clear:both;"></div><img src="http://pluralsight.com/community/aggbug.aspx?PostID=50388" width="1" height="1">]]></content:encoded>
      <pubDate>Fri, 07 Mar 2008 09:49:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/nant">nant</category>
      <category domain="http://securityratty.com/tag/root script defines">root script defines</category>
      <category domain="http://securityratty.com/tag/script">script</category>
      <category domain="http://securityratty.com/tag/root">root</category>
      <category domain="http://securityratty.com/tag/task">task</category>
      <category domain="http://securityratty.com/tag/simple nant task">simple nant task</category>
      <category domain="http://securityratty.com/tag/root nant project">root nant project</category>
      <category domain="http://securityratty.com/tag/return path">return path</category>
      <category domain="http://securityratty.com/tag/return">return</category>
      <source url="http://pluralsight.com/community/blogs/keith/archive/2008/03/07/50388.aspx">Enabling hierarchical nant builds</source>
    </item>
    <item>
      <title><![CDATA[Enabling hierarchical nant builds]]></title>
      <link>http://securityratty.com/article/83d94a82ba041a457afd0b8abf809cf5</link>
      <guid>http://securityratty.com/article/83d94a82ba041a457afd0b8abf809cf5</guid>
      <description><![CDATA[In a recent post , I talked about my experience enabling continuous integration for the internal builds here at Pluralsight. I recently worked with Craig to restructure our nant build. As part of...]]></description>
      <content:encoded><![CDATA[<p>In a <a href="http://www.pluralsight.com/blogs/keith/archive/2008/01/18/49967.aspx" target="_blank">recent post</a>, I talked about my experience enabling continuous integration for the internal builds here at Pluralsight. I recently worked with Craig to restructure our nant build. As part of that, I wanted to ensure that I could run the build from anywhere in the source tree. We use a typical hierarchical build where each project has a build script that knows how to compile, test, deploy, etc. based on the specified target. Then at the top of the tree, there's a build script that runs all the other ones. That root build script is what gets run automatically by <a href="http://ccnet.thoughtworks.com/" target="_blank">Cruise Control</a>.</p>
<p>My root script defines a bunch of properties, like where the output directories for the overall build live, where the tools live, and so on. And that works fine when I run the build from the root. The properties get defined, all the child scripts are run with &lt;nant/&gt; tasks, and they see those properties. But if I want to drill down into the tree and run one of the build scripts lower down, suddenly there's problems because it depends on properties that are only defined in the root script. I really like being able to run builds from anywhere in the tree for perf - if I'm trying to fix a particular project, I don't necessarily want to wait for unit tests on the entire tree to run in order to see if mine passed.</p>
<p>Craig made a great suggestion. Put the properties into a separate script (we named it properties.nant) and &lt;include/&gt; that script. Then to enable hierarchical builds, we'd create a properties.nant file for each folder in the tree, which would &lt;include/&gt; its parent. That way I could define properties anywhere in the tree, and they would be "inherited" by anything below it.</p>
<p>I took that idea one step further, because I didn't want to maintain a bunch of property scripts with nothing in them but an &lt;include/&gt; for the parent. I wrote an &lt;includefromparent/&gt; nant task that walks up the directory tree looking for the target file. So now I can do this:</p>
<p><tt>&lt;includefromparent buildfile="properties.nant"/&gt;</tt></p>
<p>This worked great! But now I ran into a problem. Many of my properties are defined like so in the root properties.nant file:</p>
<p><tt>&lt;property name="libraryOutputDir" value="${project::get-base-directory()}\artifacts\libraries"/&gt;</tt></p>
<p>Do you see the issue? If I run the build with the root script, everything works fine, because it's the root nant project I'm building, and get-base-directory() refers to the root of the project, where the artifacts folder lives. But if I run from lower in the tree, it's a different project, and get-base-directory() refers to a subfolder, where the artifacts folder definitely should NOT be.</p>
<p>I needed a way to find the root of the project tree. So I build a second really simple nant task:</p>
<p><tt>&lt;findmarkeddir markerfile="filetolookfor.txt" property="root"/&gt;</tt></p>
<p>This task simply looks up the directory hierarchy until it finds the specified marker file, then puts the name of that directory (the "marked" directory) into a designated property (here I've called it root). With that in place, I rewrote my property definitions in terms of the base directory:</p>
<p><tt>&lt;property name="libraryOutputDir" value="${root}\artifacts\libraries"/&gt;</tt></p>
<p>Voilà! I can now run builds from any of my build scripts. They inherit properties hierarchically like you'd expect, and the system is quite easy to maintain. If you'd like to use these tasks, I've included the code for them below (not much code, really). And if you've never written a nant task yourself before, here's <a href="http://blogs.geekdojo.net/rcase/archive/2005/01/06/5971.aspx" target="_blank">the article</a> I used to figure out how it's done (it's super easy). <a href="http://nant.sourceforge.net/release/latest/help/fundamentals/tasks.html#taskloader" target="_blank">Here's</a> what you should read to learn about the various options for deploying your custom task assembly so nant recognizes it.</p>
<p>Enjoy!</p>
<p>Here is <b>FindMarkedDirTask.cs</b></p><pre>using System;
using System.Collections.Generic;
using System.Text;
using NAnt.Core;
using NAnt.Core.Attributes;
using System.IO;

namespace PluralsightNantTasks {

[TaskName("findmarkeddir")]
public class FindMarkedDirTask : Task {

  [TaskAttribute("markerfile", Required = true)]
  [StringValidator(AllowEmpty = false)]
  public string MarkerFileName { get; set; }

  [TaskAttribute("property", Required = true)]
  [StringValidator(AllowEmpty = false)]
  public string PropertyName { get; set; }

  protected override void ExecuteTask() {
    string searchDir = this.Project.BaseDirectory;
    do {
      if (MarkerFileExistsIn(searchDir)) {
        this.Project.Properties[PropertyName] = searchDir;
        return;
      }
      searchDir = ParentOf(searchDir);
    } while (!IsRootDirectory(searchDir));
  }

  private bool IsRootDirectory(string path) {
    return Path.GetPathRoot(path) == Path.GetFullPath(path);
  }

  private string ParentOf(string directory) {
    return Path.GetFullPath(Path.Combine(directory, ".."));
  }

  private bool MarkerFileExistsIn(string directory) {
    return File.Exists(Path.Combine(directory, MarkerFileName));
  }
}
}
</pre>
<p>And here is <b>IncludeFromParentTask.cs</b> (note I derive from the built-in include task):</p><pre>using System;
using System.Collections.Generic;
using System.Text;
using NAnt.Core;
using NAnt.Core.Attributes;
using NAnt.Core.Tasks;
using System.IO;
using System.Globalization;

namespace PluralsightNantTasks {

[TaskName("includefromparent")]
public class IncludeFromParentTask : IncludeTask {

  protected override void Initialize() {
    string fileName = BuildFileName;
    if (fileName.Contains("/") || fileName.Contains(@"\\"))
      throw new BuildException(string.Format(
        CultureInfo.CurrentCulture,
        "buildfile attribute must only be a filename"));

    string relativePathToFoundFile = SearchParentDirectory(
      Project.BaseDirectory, fileName, 0);
      
    if (null == relativePathToFoundFile)
      throw new BuildException(string.Format(
        CultureInfo.CurrentCulture,
        "Couldn't find a file named {0}" +
        " in a parent directory of {1}",
        fileName, Project.BaseDirectory));

    // have to use a relative path here
    // because <include /> task uses
    // Path.Combine(projectDir, BuildFileName)
    // to get the full path
    BuildFileName = relativePathToFoundFile;

    base.Initialize();
  }

  private string SearchParentDirectory(string directory,
                        string fileName, int searchDepth) {
    ++searchDepth;
  
    // see if we've traversed all the way to the root
    string currentPath = Path.GetFullPath(directory);
    if (currentPath == Path.GetPathRoot(currentPath))
      return null;

    // recurse until we find the file
    string parentDir = Path.GetFullPath(
      Path.Combine(currentPath, ".."));
    string path = Path.Combine(parentDir, fileName);
    if (File.Exists(path)) {
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i &lt; searchDepth; ++i)
        sb.Append(@"..\");
      return Path.Combine(sb.ToString(), fileName);
    }
    else return SearchParentDirectory(parentDir,
                          fileName, searchDepth);
  }
}
}
</pre><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=50388" width="1" height="1">]]></content:encoded>
      <pubDate>Fri, 07 Mar 2008 09:49:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/nant">nant</category>
      <category domain="http://securityratty.com/tag/root script defines">root script defines</category>
      <category domain="http://securityratty.com/tag/script">script</category>
      <category domain="http://securityratty.com/tag/root">root</category>
      <category domain="http://securityratty.com/tag/task">task</category>
      <category domain="http://securityratty.com/tag/simple nant task">simple nant task</category>
      <category domain="http://securityratty.com/tag/root nant project">root nant project</category>
      <category domain="http://securityratty.com/tag/return path">return path</category>
      <category domain="http://securityratty.com/tag/return">return</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/03/07/50388.aspx">Enabling hierarchical nant builds</source>
    </item>
  </channel>
</rss>
