<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Markerbench]]></title>
  <link href="http://www.markerbench.com/atom.xml" rel="self"/>
  <link href="http://www.markerbench.com/"/>
  <updated>2019-03-27T10:45:39-04:00</updated>
  <id>http://www.markerbench.com/</id>
  <author>
    <name><![CDATA[Andrew Jaquith]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Metricon X &mdash; Opening Remarks]]></title>
    <link href="http://www.markerbench.com/blog/2019/03/21/metricon-x-opening/"/>
    <updated>2019-03-21T00:00:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2019/03/21/metricon-x-opening</id>
    <content type="html"><![CDATA[<p><em>This is the nominal text of Andy Jaquith&rsquo;s opening remarks for <a href="http://www.markerbench.com/blog/2019/01/28/metricon-x-agenda/">Metricon X</a>, delivered on March 21, 2019. It has been lightly edited for clarity and a few identities have been slightly disguised.</em></p>

<h1>Welcome</h1>

<p>I appreciate everybody coming today. It&rsquo;s a great turnout for a conference that we rather deliberately did not advertise. If you&rsquo;re here, it&rsquo;s because you wanted to be here. You&rsquo;ve self-selected.</p>

<p>The theme of the conference is &ldquo;plus &ccedil;a change&hellip;,&rdquo; the second half of which is &ldquo;plus c&rsquo;est la m&ecirc;me chose.&rdquo; Colloquially: &ldquo;the more things change, the more they stay the same.&rdquo; So what we&rsquo;re really here to talk about are the constants and the change. But because I suspect that we will have ample time to reheat some of the old chestnuts (the constants), I&rsquo;d like to offer a few remarks on the <em>changes</em> &mdash; that is, notable happenings in the world of security metrics over the last 12 years.</p>

<!-- more -->


<h1>Data-driven security took root</h1>

<p>One of the most gratifying things to emerge in security over the last 10-plus years is the increased fluency and comfort people have with real security data. This is not completely new. <a href="http://www.cheswick.com/ches/">Bill Cheswick</a>&rsquo;s work at Bell Labs in the late 1990s on network mapping, for example, helped create a company (<a href="http://www.lumeta.com">Lumeta</a>) that specialized in analyzing networks, and developed a specialty in analytics for use in M&amp;A situations. <a href="https://www.linkedin.com/in/jameshcowie/">Jim Cowie</a>, formerly CTO of Renesys, as another example, was doing large-scale analytics on BGP routes at the turn of the millennium. The last dozen years has brought many more examples, notably:</p>

<ul>
<li><strong>The Verizon Data Breach Investigations Report (DBIR)</strong>, which fused together law-enforcement data and private sources to paint a data-rich picture of what data breaches look like, are caused by, and cost. The <a href="https://enterprise.verizon.com/resources/reports/dbir/">DBIR</a>, and publications such as Larry Ponemon&rsquo;s eponymous studies on breach costs, helped popularize a metric known as &ldquo;cost per record.&rdquo; As a result, we now have relatively well-accepted currency for calculating potential and actual consumer information exposures.</li>
<li><strong>Observables and ratings</strong>. Spurred on, in part, by the challenges of the the questionnaire-based approach to evaluating vendor security, vendors such as <a href="www.bitsight.com">BitSight</a> and <a href="securityscorecard.com">Security Scorecard</a> have focused on inferring the security of companies based on what they can empirically observe. If your MX and DNS records are messed up, or if spam is coming from IP address space you control, or if externally-facing systems appear to be compromised, then the rest of your security program probably isn&rsquo;t any good either. Ratings are derived from how spotless one&rsquo;s external presence is. Data about your supply base, for example, can help you make a decision about when need to dispatch the goon squad to interrogate a high-risk vendor.</li>
<li><strong>The increased use of statistical and data science tools</strong> to analyze large security data sets. These include Python (eg <a href="https://pandas.pydata.org">PANDAS</a> and <a href="https://www.numpy.org">NumPy</a>), and the <a href="https://www.r-project.org">R ecosystem</a>, the <a href="https://www.tidyverse.org">HadleyVerse</a> and so on. There are a healthy number of &ldquo;R-heads&rdquo; in the security metrics community, such as <a href="https://www.linkedin.com/in/jayjacobs1/">Jay Jacobs</a>, <a href="https://www.linkedin.com/in/hrbrmstr/">Bob Rudis</a> and many others. I count myself among them. Although many of the studies are custom-made, the prevailing attitude is to practice reproducible science using a tool-driven analysis and workflow. Find interesting problems and data sets. Explore them. Publish findings. Repeat!</li>
</ul>


<p>And also, somewhere along the line, data science became a Thing. Some of us used to call it &ldquo;statistics.&rdquo; Speaking of which&hellip;</p>

<h1>&ldquo;AI&rdquo; has come to security, with uneven results</h1>

<p>&ldquo;AI&rdquo; has come to security, with uneven results. I say &ldquo;AI&rdquo; in quotes because what we call AI in the popular press is not about endowing computing machines with cognition. I must tell you, every time I see that Microsoft commercial with the rapper Common extolling the virtues of &ldquo;AI,&rdquo; I feel like Marvin Minsky spins another turn in his grave, and that Douglas Hofstadter rips up and crumples one of his piano compositions and weeps.</p>

<p>Once you get beyond the commercials, &ldquo;AI&rdquo; is primarily about creating models to make better predictions, using a bag of tricks that includes supervised and unsupervised learning, neural networks, bayesian strategies, Markov networks, bootstrapping, anomaly detection, and a whole set of other buzzwords that many of our attendees have better first-hand experience with than I.</p>

<p>In security, many of these &ldquo;AI&rdquo; techniques are being put to use to help solve some very real operational security problems, for example, making a security operations team more efficient. Consider an enterprise-class SOC with dozens of analysts. The sensor grid will ingest daily log volumes in the tens of millions, extract tens of thousands of potentially suspicious activities, and then reduce these down to dozens of cases to put in front of human analysts. As a rule of thumb, it&rsquo;s about roughly one million pieces of straw in every haystack, for each needle found in it.</p>

<p>Financial services and national agencies are two types of organizations that have the threat volume, funding and organizational capability to fund vendor and internal efforts in this space. They have big haystacks and lots of needles to find. A large focus of research and vendor efforts is in increasing the signal-to-noise ratio. From a measurement perspective, this means using &ldquo;AI&rdquo; to correctly classify genuine intrusions (true positives) and non-intrusions (true negatives), and reduce the false-positive and false-negative rate.</p>

<p>But results have been &ldquo;uneven&rdquo; because it&rsquo;s a tough problem space. Many vendors will tell you that they&rsquo;ve got bulletproof, universal techniques that solve all sorts of superficially related problems. For example, network intrusion detection and insurance fraud are both anomaly detection problems, right? I&rsquo;ve heard a vendor say, &ldquo;well, our AI/neural net/ML engine solves both of these problems.&rdquo; Actually, they are in different domains and have very different characteristics in terms of variety of data sources, completeness, and outlier detection strategies. There is no one size fits all. I&rsquo;m inherently suspicious of generalizable AI in security. But every time I see a well-bounded, domain specific strategy, I&rsquo;m happy.</p>

<p>In addition, there is lots of low-hanging fruit that can be harvested by simply fusing data together at the presentation level to make investigations more efficient. SOC labor optimization is more like an operations research problem than an &ldquo;AI&rdquo; problem. With respect to making SOCs more efficient, there&rsquo;s plenty of room for experimentation at both ends of the funnel, by attacking the top and middle of the funnel to present the truest and most accurate incidents; and then, improving the efficiency of the investigations of the cases that fall through to the bottom of the funnel.</p>

<h1>Success disasters are great teachers</h1>

<p>Dr Dan Geer first introduced me to the concept of a &ldquo;success disaster&rdquo;; something that goes so well that it creates painful side-effects. Here in New York, you could argue that the <a href="https://mic.com/articles/52843/the-cronut-craze-is-spiraling-out-of-control#.8QY5hj6NM">cronut craze</a> that began in 2013 was a success disaster for the Dominique Ansell Bakery. Sure, there were lines around of the block, but it led to a black market in resellable cronuts, counterfeit cronuts, quotas for cronuts, and I am sure, staff burnout and ingredient shortages. It was also a disaster for ordinary customers. If, for you, the Ansell Bakery had been a lovely place to have your morning French roast while leisurely enjoying a croissant, reading Le Monde and chain-smoking Galois cigarettes, it is no longer. That dream was trampled by all of the marauding tourists.</p>

<p>In security metrics, it&rsquo;s been gratifying to see a lot more focus on data, analytics and metrics. And many of the metrics I&rsquo;ve been seeing are much better than the stuff that drove me batty when I wrote my book twelve years ago. You know, stuff like turning highs, mediums, lows into cardinal numbers like 5, 3, and 1, or (worse) 9, 3 and 1, and then doing math on them and claiming the results are &ldquo;quanty.&rdquo; Or creating an &ldquo;index&rdquo; that uses mystery math to jam a bunch of semi-related indicators into a score that can&rsquo;t be easily explained, on the theory that because the Dow Jones Industrial average is an index, and we all know that a higher means we&rsquo;re richer, then our security metric needs to be an index too. These are mistakes anybody can make, and usually do when they start off.</p>

<p>Many organizations have matured their thinking and have gotten religion about measuring things. At a bank I&rsquo;m familiar with, for example, the GRC team produces a 100-page monthly pack of metrics that cover all areas of technology risk. Many of the metrics count things things that risk or control owners consider important, typically trailing indicators, often with breakdowns by organizational units, and almost always with commentary and correct attribution about sources. The 1,000 or so metrics in this pack are assiduously collected every month and assembled into a polished report. This is wonderful. It is a success. It is also a disaster, because the quantity of data is challenging to assimilate. It is challenging to see the forest for the trees.</p>

<p>Here&rsquo;s another success disaster: vulnerability management. Everybody in the audience knows what a vulnerability scan is, and what it does. It finds weaknesses and exposures in technology assets, typically on endpoints such as servers and desktops. The tools have gotten very good and produce few false positives. What&rsquo;s more, there&rsquo;s a general consensus on an industry-wide rating scheme for measuring severity: the Common Vulnerability Scoring System (<a href="https://www.first.org/cvss/">CVSS</a>). The market is mature, with well-established vendors such as <a href="https://www.qualys.com">Qualys</a>, <a href="https://www.rapid7.com">Rapid7</a> and <a href="https://www.tenable.com">Tenable</a>.</p>

<p>What&rsquo;s not to like about vulnerability scanners? They have a consistent measurement system, are accurate and pervasive. If the scanner says something is bad, it must be right? We should fix all &ldquo;critical&rdquo; vulnerabilities right away, shouldn&rsquo;t we? Sounds great. But the problem is that there are too many darned vulnerabilities: millions in the typical large enterprise. What do you fix first? This is very much a success disaster.</p>

<p>These kinds of problems are excellent teachers, because they force you to think differently about the problems. In the vulnerability management space, for example, one must begin with the concession that not all vulnerabilities are cost-effective to fix. Some matter more than others. How important is the asset they are on? And is the vulnerability weaponized? Are attackers actively exploiting the vulnerability in the wild? Both of these are tedious and error-prone processes to do as one-offs, but can be attacked with a bit of engineering. So now you have vendors such as <a href="https://www.kennasecurity.com">Kenna</a> (founded by one of securitymetrics.org&rsquo;s early members, <a href="https://www.linkedin.com/in/bellis/">Ed Bellis</a>), applying logic over-the-top of the scanners you&rsquo;re already using. Maybe you don&rsquo;t need to fix 1 million vulnerabilities. Maybe this week, the only thing you worry about is the one-half of one percent of the vulns, or 5,000 patches relating to a single <a href="https://cve.mitre.org">CVE</a> that other companies are seeing abused by scripted attacks. That is a nice win, even better than the proverbial 80/20.</p>

<p>For coping with success disasters in areas such as risk and control issues, I tend to worry less about the overall numbers of issues, and focus more on the pockets of risk &ldquo;debt&rdquo; that aren&rsquo;t being paid down. Suppose you&rsquo;ve got 10,000 risk issues and control breaks on the books, across the whole company. That sounds like a lot, but only 250 of them are in your highest-severity bracket. What&rsquo;s the best way to figure out which ones to attack?</p>

<p>There are many ways to look at the data &mdash; for example, finding who has the largest number of high-severity issues, or those with the largest number of longest-aged ones. Mean-time-to-close is another. Personally, I like &ldquo;velocity&rdquo; as the right way to look at the problem. Who&rsquo;s paying down debt fastest, and who&rsquo;s letting it sit?</p>

<p>I stole a metric from the warehousing industry called &ldquo;turnover,&rdquo; which is defined as the number of SKUs flowing through a warehouse, divided into the average inventory.   For example, Apple&rsquo;s inventory turnover in 2017 was 60, meaning it sold through everything in its warehouses every 6 days.</p>

<p>When adapted for issue turnover, we define it as the number of closed issues divided into the average inventory. You don&rsquo;t get credit for issues you postpone or renew. So for example, if you start with 100 issues on Feb 1, and end with 120 on Feb 28th, that&rsquo;s bad, right? But what if you closed 65, and added 85? That&rsquo;s pretty good, because you closed half of your issues during the month. Your issue turnover is 0.5, or when expressed as an annualized figure means your inventory would turn over 6 times per year. That&rsquo;s actually quite outstanding. Now imagine computing issue turnover by organizational unit and severity of issue. You&rsquo;d see the high and low performers right away.</p>

<p>This issue turnover metric works well because it is easy to understand and rewards the behaviors we want to see: paydown of issue debt. This is another example of how a success disaster causes us to evolve our thinking, and allows us to prioritize better.</p>

<h1>Controls instrumentation offers terrific bang for the buck</h1>

<p>When I joined a large investment bank as the MD for technology risk measurement and analytics, I was excited that I&rsquo;d be able to put some of my ideas about security metrics into practice. I&rsquo;d done a fair bit of metrics work on a smaller scale in prior roles, but the bank had both the commitment and the resources to do it properly. But what I found out quite quickly after coming in was that the primary use of &ldquo;metrics&rdquo; was in demonstrating controls conformance, chiefly for Sarbanes-Oxley and assurance r&eacute;gimes such as SSAE-18. Our biggest customer wasn&rsquo;t the security organization &mdash; it was our external auditors. They needed our data to be able to show quantitatively that the key controls were working. Our second biggest customer was the finance organization, because they ran SOX, although they were less interested in the data than the results.</p>

<p>The &ldquo;sweet spot&rdquo; for the continuous controls monitoring program was identity and authorization, which lies at the heart of technology risk management. &ldquo;No privilege without identity. Approve all privileges. Remove them in a timely manner when roles change or someone leaves the firm.&rdquo; These were well-instrumented operational processes with well-defined systems to tap for the data. Because we calculated control effectiveness at a very granular level, we could state with confidence whether a particular control was effective or not. We had the data to prove it. No arguments.</p>

<p>A key insight the team had was to being applying a similar approach to a large annual process that many of you are intimately familiar with, the Risk and Control Self-Assessment (RCSA, or as my contact from the Fed calls it, the &ldquo;ricksa&rdquo;). If you&rsquo;ve had the pleasure of doing one, it&rsquo;s usually an annual exercise that touches the entire enterprise. Both business-managed and control-function-managed controls are included. Everybody does it a little differently, but the basic steps are similar: (1) define &ldquo;assessment units&rdquo; that will perform the risk and control assessments; (2) set up the ratings scales for assessing inherent and residual risk; (3) have each assessment unit assess their inherent risk; (4) have each control owner assess the controls that help reduce these risks; (5) synthesize the results, calibrate them, determine residual risk and roll everything up.</p>

<p>All of this sounds nice in theory, but the defects in practice are known.</p>

<ol>
<li>Because so many people are involved, RCSAs can&rsquo;t be done regularly; at most, most organizations will do them once a year.</li>
<li>Because the ratings are subjective, a lot of time is spent &ldquo;calibrating&rdquo; and &ldquo;challenging&rdquo; to try to ensure that nobody lied particularly egregiously. And,</li>
<li>Because of time constraints and the lack of detailed empirical facts about the control environment, assessors must evaluate in a very coarse-grained way, perhaps, at a sub-line of business level at best. What this means is that a significant risk or control weakness affecting a particular asset is steamrollered over by the tyranny of averages.</li>
</ol>


<p>In short, these RCSA exercises aren&rsquo;t timely, objective or precise. So what good are they? Based on comments from practitioners, not much good at all. And the regulators know it, which is why they are quite openly fishing for alternative approaches.</p>

<p>What we found was that applying the continuous controls monitoring strategy to RCSA offered a terrific bang for the buck. The key was to do it in a commercial way. For example, consider Dorian&rsquo;s wonderful <a href="https://unifiedcompliance.com">Unified Compliance Framework</a>, which offers a consistent and universal taxonomy of controls that can be mapped to every technology or cyber framework, regulation or statute. If you pick just three of these mandates, for example <a href="https://www.iso.org/isoiec-27001-information-security.html">ISO 27000</a>, the EU&rsquo;s General Data Protection Regulation (<a href="https://gdpr-info.eu">GDPR</a>) and the <a href="https://www.nist.gov/cyberframework">NIST Cyber-Security Framework</a>, UCF will tell you that you need something like 600 controls, with another 300&ndash;400 implied. You would never want to automate the measurement of that number of controls. That would not be commercial, and you&rsquo;d never be done.</p>

<p>Instead, why not pick the 50 technology controls that we know from experience offer the biggest risk reduction potential, and instrument just those? We developed a playbook, which went more-or-less like this: &ldquo;hey subject matter experts, we think change management, software lifecycle, data quality, tech ops, asset management, intrusion detection etc etc are the most important risk areas. How would you define &lsquo;success&rsquo; in these areas? What metrics can we agree on that describe success? Who owns the data?&rdquo; And then: defining a project plan for sourcing, loading, transforming and refining the data, in waves, so that we can compute the metrics we agreed constitute success. As a sweetener, we bribed the data owners with free labor to get their data into the computing plant.</p>

<p>There are some caveats:</p>

<ul>
<li>The data is <em>never complete</em>, but that&rsquo;s ok, because it&rsquo;s good enough to be indicative&hellip; and certainly better than &ldquo;1-5 scales&rdquo; that are based mostly on opinions leavened with a few facts.</li>
<li>The early results are <em>always ugly</em>, but that&rsquo;s ok, because un-instrumented controls are always ugly the first time one sees the data. But nobody ought to get fired if the data&rsquo;s all new and the control implementers haven&rsquo;t been given time to fully adopt or get their performance in shape.</li>
<li>And it <em>takes time</em>, but that&rsquo;s ok, especially if one sequences the plan to deliver quick wins first</li>
</ul>


<p>In short, having a rigorous plan to delivery incremental value of a small number of representative metrics makes assessment processes more timely, precise and objective. It&rsquo;s important to keep the exercise limited to key controls that you can tangibly measure. And it is critical to keep reminding everybody about all of the cost and complexity that&rsquo;s being removed &mdash; typically, millions of dollars of labor that is largely guesswork.</p>

<h1>Audience is everything</h1>

<p>People want data for different reasons. And people consume data differently. What might seem good to you might be Greek to someone else. As a rule, I believe that when we build exhibits and reports, we tend to condescend to the reader. We assume that if we don&rsquo;t lard exhibits with lots of reds, yellows, and greens, the person who is reading it won&rsquo;t get it. Or we use simple pie and bar charts that waste space and are not data-dense. I ranted about this in my book a long time ago, but it&rsquo;s still true. I rarely see information graphics related to security metrics that are more complicated than one-dimensional, for example, categorical data displayed as a bar chart. This is understandable in many ways, because most information graphs used in high-volume reports don&rsquo;t need to do too much. They&rsquo;re not there because they provide a lot of diagnostic power. They are meant to just get a simple message out. But is the message even right? If you don&rsquo;t know who your audience is and what they want, it can&rsquo;t possibly be &mdash; and so you are forced to keep it simple. If you knew your audience better, you could take them along much further, with more relevant and powerful metrics.</p>

<p>When I look at published metrics and exhibits, I ask five questions that have a simple mnemonic: A-B-C-D-E.</p>

<ul>
<li>A is for <em>Audience</em>. Do we know who we&rsquo;re putting our metrics in front of? Do we know what they want?</li>
<li>B is for <em>Behaviors</em>. If you&rsquo;re looking at a chart of exhibit, what behaviors do I want the audience to change based on the inferences or conclusions in the data?</li>
<li>C: can I <em>Concisely</em> and clearly communicate, in the simplest way possible, the data I that the audience will need to make&hellip;</li>
<li>D: &hellip;the <em>Decisions</em> based on the data I put in front of them?</li>
<li>E: Lastly, does my data include commentary with an <em>Editorial</em> voice that showcases my expertise and provides context to guide the audience to the decision?</li>
</ul>


<p>Because Audience is everything, you have to start there. That&rsquo;s a key lesson I&rsquo;ve learned personally over the last dozen years.</p>

<p>Outside of the security field, I two relatively new disciplines have emerged as Things that people specialize in that relate to the question of Audience. The first is <em>data visualization</em> as a discrete field of study, and a sub-field related to information dashboard design. For data visualization (or &ldquo;data vis&rdquo;), toolsets such as <a href="https://www.tableau.com">Tableau</a>, <a href="https://d3js.org">D3</a> and <a href="https://ggplot2.tidyverse.org">GGplot</a> have turned visualization into a rich grammar that can be programmed, layered and reused. And websites like <a href="https://informationisbeautiful.net">Information Is Beautiful</a> and <a href="https://flowingdata.com">Flowing Data</a> celebrate novel ways of mashing up and showcasing data. <a href="http://www.stephen-few.com">Stephen Few</a> has been doing pathbreaking work on dashboard design &mdash; I can&rsquo;t recommend his work highly enough, because of the rigor with which he approaches make-overs of the sorts of dashboards that we are all showing our bosses. As security and risk professionals, we all benefit from the increasing formalism of the field of data visualization, and from efforts to promote more &ldquo;visualization literacy.&rdquo;</p>

<p><em>Data journalism</em> is the second Thing I&rsquo;ve been following that benefits our field, and it too relates to Audience. Made mainstream by Nate Silver&rsquo;s FiveThirtyEight <a href="https://fivethirtyeight.com/tag/2018-election/">election prediction work</a>, nearly every premier news publication has invested in what is now called data journalism. Data journalists are either quants like Nate who happen to write persuasively, or data-curious journalists that got their Nerd on and developed a niche. The essence of data journalism is telling stories with data. Notable publications that are doing this really well include the <a href="https://www.nytimes.com/section/upshot">New York Times</a>, which has been doing some extraordinary data journalism over the last ten years; <a href="www.economist.com">the Economist</a>, which has always had excellent, honest, sound data graphics but has recently gone much deeper into analytics; and of course, the now-ESPN-owned <a href="fivethirtyeight.com">fivethirtyeight.com</a>.  And academics such as <a href="http://www.thefunctionalart.com">Alberto Cairo</a> are also doing incredible work in this space.</p>

<p>A few years ago I made a highly speculative hire &mdash; I hired the head of the data journalism team from a major business publication. The theory was, we&rsquo;ve got lots of data, but we&rsquo;re doing a crap job telling the story. Let&rsquo;s see if we can bring in someone with a hybrid skillset. She writes well, and fast &mdash; is used to writing on deadline. As a reporter, she&rsquo;s got a nose for the headline. And she&rsquo;s got data chops. Maybe not like a full-on data scientist would, but hey, give it time. It turned out she was exactly what we needed. It was a true win-win&hellip; the bank got a massive upgrade in clarity and impact. And my new team member was happy as a clam because by making the jump into financial services, we were also able to raise her compensation by a very healthy amount.</p>

<p>The point I&rsquo;m trying to make here is that the skills that made our data journalist such a valuable member of the team was, more-or-less, ABCDE. In short: knowing your audience, what they want, and what you want out of them. And then, constructing the simplest and most efficient narrative that encourages inquiry, while also making setting the stage for decisions that shape behavior.</p>

<p>This talk was meant as a retrospective, so I could have talked about any number of things. I mentioned these five trends&hellip;</p>

<ul>
<li>data-driven security</li>
<li>&ldquo;AI&rdquo; in security</li>
<li>success disasters as teachers</li>
<li>controls instrumentation</li>
<li>audience focus</li>
</ul>


<p>&hellip;because they represented topics that I&rsquo;ve learned a lot about, and that have benefited the industry. Thanks for listening to this rather old-school speech &mdash; no slides &mdash; and I look forward to seeing what Metricon XX will bring.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Twenty-Year War on Cybercrime]]></title>
    <link href="http://www.markerbench.com/blog/2015/06/06/gartner-speech/"/>
    <updated>2015-06-06T00:00:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2015/06/06/gartner-speech</id>
    <content type="html"><![CDATA[<p><em>This is the text of a speech I delivered at the Gartner Group Security and Risk Management Summit in June 2015. I originally wrote the speech for Sir Roger Carr, the Chairman of BAE Systems, to use at one of his public appearances. But it was too good not to re-use for myself as the BAE Applied Intelligence&rsquo; strategy lead. I felt no shame in doing so, seeing that I&rsquo;d written it&hellip;</em></p>

<h1>Introduction</h1>

<p>Good afternoon. Thank you for coming. It is a privilege to speak with you today. I&rsquo;ve been asked to speak to you about digital crime: its rise, its significance, and what can be done about it.</p>

<p>But I also know that I am the last thing between you and beer, so I will keep this talk as short and sweet as I can.</p>

<!-- more -->


<p>Certainly, “cyber security” (I hate that phrase, but there we are) is a topic that can be treated lightly, and it is ambitious to try and cover the whole subject in 20 minutes. Nonetheless. I will discuss the rise of digital crime: how criminal enterprises, state-sponsored actors, and other parties are robbing the industrialized world of its secrets and personal information. I’ll discuss the impact that these activities have on businesses, citizens and governments. And I’ll discuss what can be done from our perspective as BAE Systems, one of the world’s largest defense contractors and providers of digital crime solutions.</p>

<h2>Introduce Self</h2>

<p>But first, allow me to introduce myself and BAE Systems.</p>

<p>I am the strategy officer for BAE Systems Applied Intelligence. I’m a recovering analyst; you might know me from, as they say on late-night TV, “another network,” in this case Forrester, where I covered data security and mobile security, and advised hundreds of enterprise clients on these topics, and on security strategy. I also wrote a fairly well-regarded book on security metrics called, funnily enough, “<a href="https://www.amazon.com/Security-Metrics-Replacing-Uncertainty-Doubt/dp/0321349989">Security Metrics</a>.”</p>

<h2>Introduce BAE</h2>

<p>Most of you probably know BAE Systems because of the work we do with the UK government and the Ministry of Defense. BAE’s role is to safeguard and enhance our customers’ vital interests. We have a robust defense business: we build aircraft such as the the Typhoon; we build, service and repair naval ships; we make land-based armaments, such as the Bradley Fighting Vehicle; and we are a key supplier to aerospace and defense companies worldwide.</p>

<p>Most of you probably do <em>not</em> know that we have a billion-dollar risk and security business, which we call <em>Applied Intelligence</em>. We are probably the largest cyber-security company that you have never heard of. We have over 5,000 customers in many industries in three continents, with a concentration in financial services. We secure our customers’ intellectual property and their email; we detect fraud and reduce the cost of compliance; we help them identify and reduce their financial and reputational risks; we host their key collaboration services; and we monitor and defend their networks from intrusions.</p>

<p>All of these activities give us a unique vantage point on the challenges of cyber-security, and on the problem of digital crime.</p>

<h1>The Rise of Digital Crime</h1>

<p>First, let&rsquo;s talk about the rise of digital crime: what it is, and what it means. When we speak about “digital crime” we mean the use of computers either as the main component of, or as an accessory to, criminal activities that result in financial gain or in competitive advantage. Broadly speaking, “digital crime” includes all dastardly deeds that span cyber-crime, financial crime, fraud, and insider activity. The common element is that unlike purely physical crimes — for example, pickpockets on a crowded subway car, these crimes rely on technology in some way.</p>

<p>Increasingly, we see significant interplay between the different types of digital crime. Cyber is a key enabler of financial fraud, of healthcare fraud, and of the theft of industrial secrets. As reported by Scotland Yard in April 2014, <a href="http://www.standard.co.uk/news/crime/seven-out-of-10-frauds-are-now-cyber-crimes-police-chief-warns-9297024.html">seven out of ten financial fraud offenses involve cyber in some way</a>. And because every part of society is becoming increasingly automated, instrumented, and network-connected, we expect that cyber will be involved in an increasingly large proportion of crimes over the next few years.</p>

<h2>Two types of threat actors: nation-states and criminal enterprises</h2>

<p>Today, digital crime is perpetrated by two main types of actors: nation-states and criminal enterprises. Many of the most important cyber incidents that you have no doubt read about over the last five years have involved <em>nation-states.</em> These nation-states are engaged in state-sponsored hacking and industrial espionage on a grand scale. Two years ago, for example, US forensics firm Mandiant revealed that an elite hacking unit of the People&rsquo;s Liberation Army was responsible for stealing industrial secrets from the U.S. defense industrial base, leading security software firms, and other businesses. More recently, North Korea stands accused of penetrating the networks of Sony Pictures to embarrass executives and steal intellectual property.</p>

<p>The goal of these types of state-sponsored cyber activities is to obtain industrial secrets for sovereign advantage. The adversaries are advanced, persistent, and most certainly a threat.</p>

<p><em>Criminal enterprises</em> present a danger of a different sort. Their goals are to obtain what one might call “toxic data”: payment card details; personal health information; and personally identifying information, such as pension and other government identifiers. This information is fungible, and can be sold on black markets for profit, or to commit identity theft — at which point it is used for fraudulent financial purposes.</p>

<p>Some examples. Last year, the U.S. retailer Target suffered from a data breach that caused the payment card details of over 40 million customers to be stolen, plus the personal details of over 70 million additional customers. And last month, the healthcare company Anthem was breached, exposing millions of healthcare records. A Bloomberg report suggested that the <a href="http://www.bloomberg.com/news/articles/2015-02-05/signs-of-china-sponsored-hackers-seen-in-anthem-attack">real target of the Anthem breach were the employees of its customers</a>, which included Northrop Grumman and Boeing. Attackers were in effect using weaknesses found in Anthem’s defenses to get to these other companies.</p>

<h2>The advantages attackers have over defenders</h2>

<p>Although both classes of attacker — state-sponsored actors and organized criminal enterprises — have different objectives, they have several things in common, which give them advantages over their targets, who must defend themselves:</p>

<ul>
<li><p>First, both classes of adversary are supported by an <em>integrated criminal supply chain.</em> The supply chain is fully stratified, with loose networks of cyber weapons suppliers, middle-men, intermediaries, distributors, and 24 x 7 support providers. The wheels of this supply chain are helpfully greased by digital currencies such as BitCoin, which enable the anonymous exchange of funds between buyers and sellers.</p></li>
<li><p>Second: both classes of adversary are <em>highly creative</em>, willing to use all means at their disposal. These means include hacking, lying, fraud, identity theft, infiltration, and compromising trusted suppliers. They also include the use of any and all channels: phone, cyber, wi-fi, in-person and physical.</p></li>
<li><p>Third: both depend on the fact that their victims’ <em>networks are increasingly far-flung, cloud based, and porous</em>. With the advent of mobile, cloud, social networking, consumerization, and extended digital supply chains, companies must deal with exponentially more complexity in their networks than they did just ten years ago.</p></li>
</ul>


<p>But it gets worse. You may not know that that the <em>lingua franca</em> of the Internet, the TCP and IP protocols, were never designed to be secure. They were designed to make the Internet resilient, to allow packets to flow to their destinations even when parts of the infrastructure were damaged. Every security protocol we have, was written — after the fact — to flow on top of those resilient, but insecure, protocols. Because security was never woven into the basic building blocks of the Internet, attackers inevitably find flaws in the ones we’ve fitted on top of them.</p>

<p>Against such a backdrop, the adversary is always assured of asymmetric advantage. Defenders have to get it right all the time. Attackers, just once. To use a colloquial phrase, one might expect that for attackers, this should be rather like shooting fish in a barrel. And indeed it has been.</p>

<h1>The Impact of Digital Crime</h1>

<p>The impact of digital crime is significant no matter how one chooses to measure it.</p>

<ul>
<li><p>The cost of digital crime begins with the <em>direct costs</em>; the cost of cleanup, notifications to customers, and fines. Target stores has spent almost $150 million cleaning up after their data breach. Heartland Payments Systems, a payment processor, was breached in 2008 and had over a hundred million payment card details stolen, with direct costs from the breach totaling nearly $150 million, only 30 million of which was covered by insurance. In general, industry analysts estimate that breaches of customer information can cost victims — companies and customers — millions of dollars. But the criminals nearly always make a mint: the gangs that broke into Target, for example, <a href="http://krebsonsecurity.com/2014/05/the-target-breach-by-the-numbers/">may have made over 675 million dollars of profit</a>.</p></li>
<li><p>The cost of digital crime includes the damage to the victim’s <em>reputation</em>. A significant breach can cause significant personal embarrassment to executives and to customers. The co-chairman of Sony Pictures, for example, was forced resign last month because her company’s security was so poor. The CEO of Target stores resigned because of its hack. Security is indeed becoming a board level issue in the sense that people are getting fired because they don&rsquo;t have enough of it.</p></li>
<li><p>The cost of digital crime includes <em>changes in stock price and profits</em> in the wake of a security breach, although these are usually temporary. Often overlooked are the inevitable class-action <em>lawsuits</em> that arise against public companies after data breaches. The management of Heartland Payment Systems has spent over five years defending itself against 27 separate consumer and institutional class-action lawsuits.</p></li>
<li><p>Finally, the cost of digital crime includes the <em>loss of trust</em> of one&rsquo;s customers. Once lost, it is often difficult to regain. This is particularly challenging with firms that sell to other businesses. In the Heartland case, after years of growing its merchant base at double-digit rates between 10 and 20 percent, in the 2 years following the breach, merchant growth went into reverse, dropping 2%.</p></li>
</ul>


<p>(more examples here…)</p>

<p>These costs — direct costs, damage to reputation, stock price and profit drops, lawsuits, and loss of trust — are significant costs for any individual organization to bear. Taken in aggregate, the near-continuous stream of bad news leads to a gradual erosion of trust in digital business in general.</p>

<h1>What can be done</h1>

<p>The problems associated with digital crime are complex. So are the solutions, but that is in part because of the way we as customers, suppliers and national governments have been thinking about the problem of digital crime. We need to think differently. We need to think deeply. And we need to think quickly.</p>

<h2>Systems thinking, not silo thinking</h2>

<p>First, we need to think about systems as a whole, and not about silos.</p>

<p>To use an analogy, consider the West’s responses to various failed and successful hijacks of aircraft by terrorists. The first plots were revealed in 2006. A plot was foiled to detonate liquid explosives on 7 airplanes over the Atlantic. These explosives were peroxide-based and easily disguised in drinks bottles. After foiling the plot, the US and UK airline authorities duly banned bringing liquids through airport security. In September 2001, the 9/11 hijackers took control of airline cockpits using knives and box-cutters. Authorities duly prohibited knives and box-cutters on flights. Then, in December, show-bomber Richard Reid tried to set off a PETN-based bomb embedded in his shoe; the plot was foiled. Authorities duly forced passengers to remove their shoes.</p>

<p>Security expert Bruce Schneier argues that none of these things have made any difference in minimizing the risk of hijackings. Only two things have: reinforcement of cockpit doors, and the fact that passengers are willing to fight back against attackers.</p>

<p>Whether you agree with Bruce or not on this point, you can surely agree that the pattern used for preventing hijackings is “silo thinking”: looking for the artifacts used in the last attack and hoping that strategy will be effective in preventing the next one. Enumerating the <em>things</em> that are bad, rather than spotting the <em>patterns</em> that are bad.</p>

<p>In cyber, we have been following a similar script. Consider the case of Target stores. Target suffered a horrendous breach; most people can appreciate the seriousness of that. What is less appreciated is that Target was compliant with the industry standard for security at the time of the hack: the Payment Card Industry’s Data Security Standard (PCI-DSS). By definition, Target owned and operated:</p>

<ul>
<li>anti-virus software</li>
<li>firewalls</li>
<li>intrusion detection systems, and:</li>
<li>log management software to filter through security device logs.</li>
</ul>


<p>All of these items are mandated by PCI-DSS and are required to be installed on systems that process cardholder data.</p>

<p>In addition, the retailer also operated a security operations center in Minnesota. It had installed a $1.5 million advanced malware detection system, FireEye, which <em>did</em> detect the malware that ultimately compromised its network.</p>

<p>In short, Target could not possibly have been accused of skimping on security.</p>

<p>What happened? Target’s failure came down to something fairly simple: the various silos of security did not talk to each other. Target’s advanced malware detection system saw the malware and created an alert. But the information was not acted on by Target’s staff. It was lost amidst the noise, or not presented in a relevant or timely way. Target did not arrive at the conclusions they needed to fast enough, which was not “you’ve got malware” but: “your point of sale systems are being taken over by a criminal enterprise.” In short, Target’s tragedy was the failure to think of its data sources, individual security systems, directories, suppliers and point-of-sale terminals as a single, interconnected system, and to attach relevance and meaning to the patterns of behavior seen within it.</p>

<p>A <em>system</em>, in the broad definition, is a set of connected technologies or processes that form a greater, more complex whole. Target thought it had a system in place, but it’s clear it only had silos: FireEye, the Bangalore team, the Security Operation Center in Minnesota, and many individual security technologies. When needed the most, they acted (or didn’t act) separately.</p>

<p>When we rethink security, we must re-imagine security processes as an integrated whole. Systems thinking. To prevent and detect attacks, one must integrate all the elements — email, networks, physical, web, monitoring systems and many others. The components don’t all have to be from the same company, but they need to be integrated in such a way that the data flows seamlessly. Crucially, the information needs to be filtered and packaged so that it can be rapidly assessed, evaluated and acted on by human analysts.</p>

<h2>Getting the full picture of risk</h2>

<p>Second, we need to think about the full picture of risk.</p>

<p>Digital crime, particularly cyber crime, does not happen in a vacuum. Regardless of whether an attacker is trying to steal secrets, purloin personal information or launder lucre, nearly every type of digital crime can be reduced to a few common steps.</p>

<ol>
<li><em>The attacker must plan his “campaign”:</em> perform reconnaissance, communicate with confederates, collect insider information, create exploits, or infiltrate a network of people.</li>
<li><em>The attacker must commit his crime:</em> break into a system, steal an identity, launch a denial of service attack, abuse administrator privileges, or use non-public information.</li>
<li><em>The attacker must harvest his gains:</em> purchase or sell goods, make fraudulent claims, sell secrets, or launder money.</li>
</ol>


<p>Every method used in these steps generate some sort of tell-tale signal or artifact: a phone call, an entry in a log, a transaction, an intrusion alert, a payment or a sale.</p>

<p>Appreciating the full picture of risk means having full knowledge, within the span of your control, of all of these artifacts. It means having the ability to sift through noise to find signal. It means acquiring, analyzing and acting on information at high speeds and at large scales. And it means having effective processes, technology and skills to spot anomalies, communicate them coherently, and act quickly.</p>

<h2>Scaling up</h2>

<p>Third, we need to scale up.</p>

<p>The problems of digital crime are complex, critical and costly. I will explain this by way of example. Much of the work that we are inspired to do by our customers are multi-billion-pound problems, for example:</p>

<ul>
<li>First-party financial fraud costs institutions $18 billion a year globally</li>
<li>Intellectual property stolen from U.S. firms costs $300 billion every year</li>
<li>U.S. health care fraud costs insurers and the government nearly $75 billion annually, of which over $6 billion is cyber-related</li>
<li>Tax fraud globally is estimated at 5% of the total global economy: over $300 billion in the US and over $100 billion here in the UK</li>
</ul>


<p>What unites these problems is that they are sufficiently large to escape the grasp of any one company, institution, or government. Effective approaches must <em>necessarily</em> be multi-company, industry-wide, and transnational in scope. For complex, critical and costly problems, only large-scale solutions will suffice.</p>

<p>For example, here in the UK, we work with the Insurance Fraud Bureau. Software supplied by our Applied Intelligence unit analyzes every auto and property insurance claim submitted by every claimant in the country. This industry-wide capability has resulted in over 600 arrests and a large reduction in the amount of insurance fraud committed. This is not something that could work for a single insurer. This truly is a Big Data problem.</p>

<p>Here in the United States, we are working with several state insurance agencies to reduce medical insurance fraud, again, as an industry-wide solution within each state. We provide essential network security services for nearly 15% of all American banking and credit union institutions. We monitor a quarter-million daily transactions processed by a New York-based clearing house, about $1.2 billion worth of instruments every day.</p>

<p>These are all examples of how having a multi-company, transnational vantage helps solve industry-wide problems.</p>

<h1>Conclusions</h1>

<p>The three strategies I’ve described — employing systems thinking, not silo thinking; getting the full picture of risk; and “scaling up” to span industries and international boundaries — are key to solving the complex, costly and critical problem of digital crime. But these items will not be sufficient in and of themselves. Because what we also need as businesses, as consumers and as society as a whole is a new mindset.</p>

<h2>The risk intelligence mindset</h2>

<p>The mindset we need to adopt is a more informed, intelligent approach to thinking about and managing risk: “risk intelligence” if you like. Not every plan to protect the business will be perfect. It is impossible to imagine a world in which there is no fraud, no theft, and no successful cyber-attacks. BAE might well wish it could sell silver bullets in addition to the conventional kind, but silver bullets do not exist.</p>

<p>What I mean by “risk intelligence” is that customers have enough information to act, even in conditions of uncertainty. I mean that when customers’ most well-considered security and risk plans fail, they can still act decisively, and can make decisions appropriate for their businesses. Customers need to be able to:</p>

<ul>
<li>quickly <em>acquire</em> data about risks and threats at the highest level that could affect them and their customers;</li>
<li>effectively <em>analyze</em> the data on hand to create information that can be put to use; and then:</li>
<li>decisively <em>act</em> on that information to achieve better business outcomes: for example, reducing fraud, repelling cyber attacks, or rapidly responding to a break-in.</li>
</ul>


<h2>Learning from John Boyd</h2>

<p>There is a precedent for this type of thinking, and it comes courtesy of BAE’s main business, the military business. In the 1970s American military strategist Colonel John Boyd wrote about something called the “OODA loop,” which stands for Observe, Orient, Decide and Act. Boyd theorized that in combat conditions, one must:</p>

<ul>
<li>Observe the enemy’s movements;</li>
<li>Orient oneself by creating a mental picture of the situation;</li>
<li>Decide on the courses of action available, and then:</li>
<li>Act decisively</li>
</ul>


<p>Boyd believed that the combatant who can observe, orient, decide and act fastest would win the battle. This means achieving the clearest and most accurate conception of battlefield position, and then taking action, as fast as possible. Boyd also believed that a combatant who can observe, orient, decide and act faster can overwhelm his adversary’s decision-making capability, achieving victory in a fraction of the time required by conventional warfare.</p>

<p>That was why Hitler’s <em>blitzkrieg</em> attacks were so effective. It is why the US-led Operation Desert Storm, for which Boyd was a key architect, was able to conquer Iraq — a country whose territory is nearly twice the size of the UK — in less than four days.</p>

<p>It is also why digital crimes take days, months and years to detect. Adversaries are able to observe, orient, decide and act much more quickly than their victims.</p>

<p>So, when we say that to properly combat digital crime, we need “risk intelligence,” we mean quickly acquiring data, effectively analyzing it, and decisively acting. In essence: speeding up customers’ own analytics and decision-making processes to match or exceed the speed of the adversary.</p>

<h2>Result: make customers’ jobs easier</h2>

<p>Imagine a world where risk intelligence becomes the norm. Done right, our customers’ jobs become simpler. Today, the Chief Information Security Officer’s role in most organizations is to catalog all of the vulnerabilities in the environment; prioritize them; and then serially eliminate them one after the other. He or she buys many best-of-breed products to solve many narrow problems. Along the way, he or she writes policies that few people read, and some business unit owners actually regard as harmful. He or she spends valuable staff time answering hundreds of pesky audit questionnaires. That is the day job.</p>

<p><em>The after-hours job</em> is what happens when the company is actually compromised or subjected to fraud or attack. In these circumstances, the Security Officer scrambles, dodges, and weaves before making the best of a bad situation. Because policy is prioritized over speed of decision-making, the Security Officer is always caught by surprise.</p>

<p>In future, the Chief Information Security Officer’s job will be measured not by the pound — that is, by the weight of policies produced and purchase orders placed. It will be measured instead by the tick — that is, by the number of ticks of the clock between when the adversary initially acts, and when he or she is able to acquire, analyze and act in response, or <em>in advance</em> of the adversary’s next move.</p>

<h2>Parting thought</h2>

<p>I will close with a quote from Sir Winston Churchill:</p>

<blockquote><p>“Want of foresight, unwillingness to act when action would be simple and effective, lack of clear thinking, confusion of counsel until the emergency comes, until self-preservation strikes its jarring gong &ndash; these are the features which constitute the endless repetition of history.”</p></blockquote>

<p>Let us learn from history.</p>

<p>Thank you for your time and attention today.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The DevOps Security Handbook&#58; Building Security In With Chef, Part III]]></title>
    <link href="http://www.markerbench.com/blog/2013/10/06/chef-3rd-course/"/>
    <updated>2013-10-06T20:15:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/10/06/chef-3rd-course</id>
    <content type="html"><![CDATA[<h1>Introduction</h1>

<p><em>This is the third in a series of occasional posts about security and DevOps. The ultimate goal of this series is to show how to build a reasonably secure Apache web server using the popular DevOps automation tool <a href="http://www.opscode.com/chef/">Chef</a>. The server will be suitable for serving static content such as that generated by <a href="http://octopress.org">OctoPress</a>. Each post explores a new aspect of Chef.</em></p>

<p>If you read the <a href="http://www.markerbench.com/blog/2013/10/01/chef-starter/">first</a> and <a href="http://www.markerbench.com/blog/2013/10/03/chef-2nd-course/">second</a> posts in this series, you learned how to set up the Chef workstation and server; created <code>webserver</code> and <code>base</code> roles; created a test environment and a virtual machine; and built a partially hardened server called <code>tester.local</code>. This server has a minimized Apache configuration, and a restricted OpenSSH configuration.</p>

<p>In this post, I will demonstrate one of the most challenging aspects of any server automation project: copying sensitive keying materials, such as SSL private keys, to server nodes. Although SSL certificates themselves are not sensitive,  certificate private keys are. In order to use Chef to truly “build security in,” these materials must be securely conveyed from the Chef server to the target server nodes. To do this, you will use Chef’s encrypted data bag feature and an add-on feature called <code>chef-vault</code>. You will create a custom cookbook recipe that performs all of the necessary decryption and file-creation actions on the target node. At the end of this post, you will possess a repeatable, reliable and secure method for conveying SSL keying materials or other secrets to target nodes.</p>

<!-- more -->


<h1>Generate self-signed SSL certificate</h1>

<p>To use SSL with your webserver, you must have an SSL certificate. In production environments, you will likely use a certificate signed by a public certificate authority, such as VeriSign, Thawte, or GoDaddy. But you can also use a self-signed certificate, which you will do here. At the command line, change to your <code>chef-repo/.chef</code> directory. Type:</p>

<pre><code>openssl genrsa -aes128 -out tester.local.key-with-password 2048
</code></pre>

<p>This creates a 2048-bit RSA key and wraps it with 128-bit key secured by a password. You should see output similar to the following (and will be prompted to enter a password):</p>

<pre><code>Generating RSA private key, 2048 bit long modulus
........+++
..+++
e is 65537 (0x10001)
Enter pass phrase for tester.local.key-with-password:
Verifying - Enter pass phrase for tester.local.key-with-password:
</code></pre>

<p>In most situations it isn’t desirable to have a password protecting the actual key file, because when you start Apache, it will block until the password is entered. If you have a large-scale infrastructure, you don’t want to type in passwords every time some random server starts up. (As a compensating control — later on in this post — you will make the key file accessible only to <code>root</code>.) To ensure that Apache starts cleanly, let’s remove the password. Type:</p>

<pre><code>openssl rsa -in tester.local.key-with-password -out tester.local.key
</code></pre>

<p>Enter the password when prompted. A new key file <code>tester.local.key</code> will be created. Remove the old password-protected key file:</p>

<pre><code>rm tester.local.key-with-password
</code></pre>

<p>Next, generate a certificate signing request (CSR). Type:</p>

<pre><code>openssl req -new -key tester.local.key -out tester.local.csr
</code></pre>

<p>Enter data used in the certificate: country name, state, locality, organization name, OU name, common name, and email address, as shown in the sample output below:</p>

<pre><code>You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Massachusetts
Locality Name (eg, city) []:Boston
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Markerbench
Organizational Unit Name (eg, section) []:SSL Test Certificate Directorate
Common Name (e.g. server FQDN or YOUR name) []:tester.local
Email Address []:nobody@markerbench.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
</code></pre>

<p>Most of the fields are mandatory, but only one really matters: the common name. This must match the name of the webserver host; in this case, <code>tester.local</code>.</p>

<p>The CSR will be written to <code>tester.local.csr</code>. After it is created, create a self-signed certificate by typing:</p>

<pre><code>openssl x509 -req -days 365 -in tester.local.csr -signkey tester.local.key -out tester.local.pem
</code></pre>

<p>You will see this output:</p>

<pre><code>Signature ok
subject=/C=US/ST=Massachusetts/L=Boston/O=Markerbench/OU=SSL Test Certificate Directorate/CN=tester.local/emailAddress=nobody@markerbench.com
Getting Private key
</code></pre>

<p>The certificate will be written to <code>tester.local.pem</code>. You can verify the certificate contents by using OpenSSL’s <code>x509</code> command:</p>

<pre><code>openssl x509 -in tester.local.crt -noout -text
</code></pre>

<p>You should see output similar to this:</p>

<pre><code>Certificate:
Data:
    Version: 1 (0x0)
    Serial Number:
        90:aa:b2:e4:06:ca:50:32
    Signature Algorithm: sha1WithRSAEncryption
    Issuer: C=US, ST=Massachusetts, L=Boston, O=Markerbench, OU=SSL Test Certificate Directorate, CN=tester.local/emailAddress=nobody@markerbench.com
    Validity
        Not Before: Oct  5 21:05:32 2013 GMT
        Not After : Oct  5 21:05:32 2014 GMT
    Subject: C=US, ST=Massachusetts, L=Boston, O=Markerbench, OU=SSL Test Certificate Directorate, CN=tester.local/emailAddress=nobody@markerbench.com
    Subject Public Key Info:
        Public Key Algorithm: rsaEncryption
        RSA Public Key: (2048 bit)
            Modulus (2048 bit):
                00:c4:3b:79:55:78:15:c2:82:a6:e3:e9:f0:64:c7:
                …(content omitted)
                56:e1:57:0d:b0:e0:37:31:19:ee:31:95:8f:2f:a6:
                c3:3b
            Exponent: 65537 (0x10001)
Signature Algorithm: sha1WithRSAEncryption
    1e:a6:1a:27:d3:5d:08:bc:ad:00:df:4e:6a:5b:4c:a4:be:80:
    …(content omitted)
    23:0e:02:be:3e:e8:89:75:58:03:7d:70:ac:13:a3:f4:d5:02:
    2e:d8:58:7f
</code></pre>

<p>Congratulations. You have created a self-signed certificate called <code>tester.local.pem</code> in the local directory, and a corresponding private key file <code>tester.local.key</code>.</p>

<h1>Installing Chef-vault for distributing secrets</h1>

<p>With the certificate and private key created, the next challenge is to use Chef to copy these two files to the correct locations on the web server. SSL certificates are stored at <code>/etc/ssl/certs</code>; private keys are stored at <code>/etc/ssl/private</code>.</p>

<p>There are many ways to convey the SSL certificate and key to the webserver. The easiest way would be to include these files in a cookbook as file resources, then use a recipe to copy them to the correct locations on the server. That is easy, but not very  secure because the keying materials would be stored as part of the cookbook, and therefore in the clear. (The Git source tree contains your cookbooks and all of their supporting files. If the SSL private key were checked in as an unencrypted regular file, other people would be able to see it.)</p>

<p>It would be much nicer to store the SSL private key in an encrypted form — somehow — so that it can be copied to the server without worrying about who sees it (an attacker would just see ciphertext). After it is copied the server note, it can be decrypted in-place and moved to the correct destination in <code>/etc/ssl/private</code>.</p>

<p>Chef has some tools that make conveying secret materials easier. It provides a construct called a <a href="http://docs.opscode.com/essentials_data_bags.html">data bag</a> for storing custom configuration items and other materials that target nodes need. Data bags are essentially hash maps (otherwise known as associative arrays, or in Rubyspeak, “hashes”) that are stored on the Chef server and retrieved by target nodes when <code>chef-client</code> runs. Data bags items can be encrypted. To encrypt a data bag item, you pass an symmetric encryption key (or password) to the <code>knife data bag create</code> command. For example:</p>

<pre><code>knife data bag create certs tester_local_key --secret-file /tmp/my_secret_key
</code></pre>

<p>…where <code>my_secret_key</code> is a secret key generated, for example, by OpenSSL. To decrypt the item on target nodes, the target nodes perform an equivalent decryption operation, passing in the same secret key used to originally encrypt the item.</p>

<p>Go back and re-read that last paragraph. See anything problematic? <em>Nodes that need to decrypt the data bag item need the the secret key used to encrypt it</em>. That might sound obvious, but the it raises a question: how does the secret key actually get copied to the nodes? The Chef documentation is silent about how this is done; it leaves the problem of key management as an exercise for the reader. We are left to assume that the secret key is “somehow” copied to the target nodes.</p>

<p>How should this be done? You could copy the secret key using a Chef recipe, but you’d have the same problem all over again — sensitive keying material would be exposed. You could, instead, copy the secret key manually to the node over SSH, but that defeats the whole point of Chef — automation of configuration tasks.</p>

<p>It would be much nicer if there was a way to encrypt sensitive materials without requiring lots of complicated key management. Sadly, Chef does not provide such a method. However, a clever programmer named Kevin Moser, who works for Nordstrom, has created Chef plugin called <code>chef-vault</code> that solves the key management problem rather elegantly.</p>

<p>Kevin’s <a href="https://github.com/Nordstrom/chef-vault">chef-vault</a> tool takes a clever approach. Chef-vault uses a type of <a href="http://en.wikipedia.org/wiki/Key_encapsulation">key encapsulation</a> to protect secret materials using the public keys of target nodes that need them. These public keys are the same ones the nodes use to authenticate to Chef. Because these keys must, by definition, already exist, using them for encryption creates no extra work for you. Essentially, Chef-vault’s <code>encrypt</code> operation does the following:</p>

<ul>
<li>Creates a symmetric encryption key (“secret key”). This secret key encrypts the plaintext (the thing you want to encrypt), and creates a ciphertext.</li>
<li>Adds the ciphertext to the data bag.</li>
<li>For each target node, encrypts the secret key with the node’s public key, creating an encapsulated key blob. The same operation is repeated for authorized users using their public keys as well</li>
<li>Adds each encapsulated key blob to the data bag</li>
</ul>


<p>The result of Chef-vault’s <code>encrypt</code> operation is a data bag that contains an encrypted item for the secret being protected, and, for each authorized user and target node, an encrypted data blob that allows each user or node (and <em>only</em> that user or node) to recover the encryption key and, thus, decrypt the encrypted item. Chef-vault (essentially) extends Chef’s data bag structures to use its own public-key encryption system so that secret keys can be conveyed securely to target nodes. This rather neatly solves the secret-key distribution problem.</p>

<p>Enough talk. Let’s install <code>chef-vault</code>. Normally, you would use the Ruby command <code>gem install chef-vault</code> to install it. However, as of this writing, only <code>chef-vault</code> version 2.1 has the ability to encrypt entire files. That ability is missing in the version of <code>chef-vault</code> in the Gem repositories. So you must build it yourself using the latest version from Github.</p>

<p>At the command line, change to a directory outside of your <code>chef-repo</code> directory. Type:</p>

<pre><code>git clone https://github.com/Nordstrom/chef-vault.git
</code></pre>

<p>You will see output similar to this:</p>

<pre><code>Cloning into 'chef-vault'...
remote: Counting objects: 667, done.
remote: Compressing objects: 100% (343/343), done.
remote: Total 667 (delta 324), reused 619 (delta 279)
Receiving objects: 100% (667/667), 107.30 KiB | 0 bytes/s, done.
Resolving deltas: 100% (324/324), done.
</code></pre>

<p>Change to the new <code>chef-vault</code> directory and build the Gem:</p>

<pre><code>cd chef-vault
gem build chef-vault.gemspec
</code></pre>

<p>You will see output similar to this:</p>

<pre><code>WARNING:  no homepage specified
WARNING:  description and summary are identical
  Successfully built RubyGem
  Name: chef-vault
  Version: 2.1.0
  File: chef-vault-2.1.0.gem
</code></pre>

<p>Install <code>chef-vault</code> by typing:</p>

<pre><code>gem install chef-vault-2.1.0.gem
</code></pre>

<p>Ruby will report successful installation as follows:</p>

<pre><code>Successfully installed chef-vault-2.1.0
1 gem installed
Installing ri documentation for chef-vault-2.1.0...
Installing RDoc documentation for chef-vault-2.1.0...
</code></pre>

<h1>Creating an encrypted vault for the SSL certificate and key</h1>

<p>With <code>chef-vault</code> installed, you can now use it to encrypt sensitive materials and convey them securely to nodes. As an example, let’s encrypt the SSL certificate file. Change back to the <code>chef-repo</code> directory. Type the following, where <em>username</em> is your Chef username:</p>

<pre><code>knife encrypt create certs tester_local_pem --mode client --file .chef/tester.local.pem -A "username"
</code></pre>

<p>This Knife <code>encrypt</code> command tells <code>chef-vault</code> to encrypt the contents of file <code>.chef/tester.local.pem</code> (the SSL certificate) and to authorize the user <code>username</code> to decrypt or update its contents. You can use any valid Chef username, or multiple usernames separated by commas. (If you need to find out your Chef username is, type <code>knife user list</code>.)</p>

<p>The contents of the <code>encrypt</code> operation are added to a vault named <code>certs</code>. The vault is backed by a data bag with the same name. You can verify that the data bag <code>certs</code> exists by typing:</p>

<pre><code>knife data bag list
</code></pre>

<p>You will see the data bag <code>certs</code> in the list. You can see the items added to the data bag via the <code>knife data bag show</code> command. Type:</p>

<pre><code>knife data bag show certs
</code></pre>

<p>You will see the following items:</p>

<pre><code>tester_local_pem
tester_local_pem_keys
</code></pre>

<p>The first item, <code>tester_local_pem</code> is a hash that contains the encrypted contents of the file. The second item, <code>tester_local_pem_keys</code>, is a hash containing the list of authorized nodes, users and their associated public-key-encrypted blobs.</p>

<p>Take a look at the encrypted file contents. The command for viewing data bag items is <em>knife data bag show name-of-data-bag name-of-item</em>. Type:</p>

<pre><code>knife data bag show certs tester_local_pem
</code></pre>

<p>You should see output similar to the following:</p>

<pre><code>file-content:
  cipher:         aes-256-cbc
  encrypted_data: QpB63Qv2650jwmWfj3IX4iXAIoGz8WZkggoV+wbLyI0T4nUivD5QBovdjtJU
  YkhI9QOrbW55HVwew7tLW+ee0cetjZm+Amaa0Gyo8ehBsTbRAeY3jkdWv8Ia
  …
  (content omitted)
  …
  jGAUa+xcdDedmBSiRxoUwrjSq85hnAGwmKovXqKZeK4=

  iv:             kOrZ5kIrTCmwRloUodCtgA==

  version:        1
file-name:
  cipher:         aes-256-cbc
  encrypted_data: kEL5rHzmx85diXKC1AL7EXdEID+SC1E58GuNFBeu9lK1k+Bv5GbcQXK/iDtS
  L8tQ

  iv:             xEhV676bjE4SwVYZZwkFtw==

  version:        1
id:           tester_local_pem
</code></pre>

<p>As you can see, the <code>file_content</code> hash key contains the a child hash containing the cipher (AES-256-CBC), initialization vector, and the encrypted data blob. The <code>file-name</code> hash key contains similar data that corresponds to the original file name (which is also encrypted).</p>

<p>Let’s look at the encryption keys. Type:</p>

<pre><code>knife data bag show certs tester_local_pem_keys
</code></pre>

<p>You should see output similar to the following:</p>

<pre><code>admins:  arj
arj:     SDqZuaFrpy28YOSDDhkyDmDBLPZHuRSDXjOgHklnaetDjl8QI7zuTvznmg1Q
…
(content omitted)
…
f+s7gdSVBZ0el7Uc9gDhOFZA0hz0ADqcIPd2hA90PQ==

clients:
id:      tester_local_pem_keys
</code></pre>

<p>Here, the <code>admins</code> entry’s value is <code>arj</code>, indicating that the user <code>arj</code> is authorized to decrypt or update the contents. The <code>arj</code> entry contains the secret key, encrypted with <code>arj</code>’s public key. Of course, instead of seeing <code>arj</code> you will see your own username. Note that the <code>clients</code> entry is empty because no nodes are authorized to decrypt yet.</p>

<p>You can decrypt the secret by using the <code>knife decrypt</code> command. Type:</p>

<pre><code>knife decrypt certs tester_local_pem file-content --mode client
</code></pre>

<p>This command decrypts the payload stored in the key path <code>tester_local_pem</code> > <code>file-content</code> in data bag <code>certs</code>. Because your Chef user is an authorized user, you should be able to see the decrypted content. It starts with the string <code>-----BEGIN CERTIFICATE-----</code>. Compare the output to the contents of the file <code>.chef/tester.local.pem</code>; the contents should be identical.</p>

<p>At this point, only one party (your Chef user) is authorized to decrypt the certificate. Of course, the web server needs to be authorized also! To authorize more users or nodes after the original <code>knife encrypt create</code> operation, use the <code>knife encrypt update</code> command. In this case, you want to authorize the <code>tester.local</code> node that will actually use the SSL certificate. Type:</p>

<pre><code>knife encrypt update certs tester_local_pem --mode client --file .chef/tester.local.pem -S "name:tester.local"
</code></pre>

<p>You can examine the contents of the data bag by typing <code>knife data bag show certs tester_local_pem</code> again. If you do that, you will see that the contents of the data bag item are much the same as before, although the initialization vector <code>file-content</code> > <code>iv</code> and encrypted data blocks <code>encrypted_data</code> are different. That is because the vault has re-encrypted the contents with different keys.</p>

<p>Examine the <code>tester_local_pem_keys</code> entry. Type:</p>

<pre><code>knife data bag show certs tester_local_pem_keys
</code></pre>

<p>You will see that the contents of this entry are now a little different:</p>

<pre><code>admins:       arj
arj:          SDqZuaFrpy28YOSDDhkyDmDBLPZHuRSDXjOgHklnaetDjl8QI7zuTvznmg1Q
…(content omitted)
f+s7gdSVBZ0el7Uc9gDhOFZA0hz0ADqcIPd2hA90PQ==

clients:      tester.local
id:           tester_local_pem_keys
tester.local: y7DM7oQZj9+Yd5oRLFA4eSVOZ/+g/NYUNjfMJvsxxd1Nv85yLigzjb1JlaYm
…(content omitted)
yYWtFXX47765NivPGNTszfJQ8igNNBy1+YvfQn/wNw==
</code></pre>

<p>You can see that the <code>clients</code> entry contains the value <code>tester.local</code>, and that a corresponding encrypted data blob named <code>tester.local</code> has been added. Splendid!</p>

<p>With the certificate correctly added to the vault, let’s add the  private key. Instead of doing a two-step process of creating the encrypted data items and <em>then</em> authorizing the node, let’s do it in one step by supplying both the user and node to the <code>create</code> operation. Type:</p>

<pre><code>knife encrypt create certs tester_local_key --mode client --file .chef/tester.local.key -A "arj" -S "name:tester.local"
</code></pre>

<p>Substitute your own username instead of <code>arj</code>, of course.</p>

<p>If you want to, you can verify that the SSL private key was added successfully by typing the now-familiar <code>knife data bag show certs tester_local_key</code> command.</p>

<h1>Creating a cookbook for configuring SSL</h1>

<p>At this point you have added the SSL certificate and its corresponding private key to the encrypted data vault <code>certs</code>. Now you need to get the vault’s contents over to the target nodes so you can create the certificate and private key files.</p>

<p>First, create a new cookbook called <code>ssl-config</code>:</p>

<pre><code>knife cookbook create ssl-config
</code></pre>

<p>Add the new cookbook to the <code>webserver</code> role so that it is executed whenever <code>chef-client</code> runs:</p>

<pre><code>knife role edit webserver
</code></pre>

<p>Add the recipe for <code>ssl-config</code> to the role by editing the <code>run_list</code> as follows:</p>

<pre><code>"run_list": [
  "recipe[apt]",
  "recipe[apache2]",
  "recipe[ssl-config]"
],
</code></pre>

<p>Next, edit the default recipe file <code>ssl-config/recipes/default.rb</code> as follows:</p>

<pre><code>chef_gem 'chef-vault'
require 'chef-vault'

directory '/etc/ssl/certs' do
  recursive true
  owner 'root'
  group 'root'
  mode '0755'
end

directory '/etc/ssl/private' do
  owner 'root'
  group 'root'
  mode '0700'
end

# Certificate entries equal to hostname but with _ replaced by .
vault         = 'certs'
hostname      = node['fqdn']
cert_prefix   = hostname.sub('.','_')
cert_cert     = "#{cert_prefix}_pem"
cert_key      = "#{cert_prefix}_key"
cert_chain    = "#{cert_prefix}_chain"
puts "Creating certificates for #{hostname} using vault #{vault}."

# Decrypt certificate
puts "Decrypting certificate from hash item #{cert_cert}."
begin
  item = ChefVault::Item.load(vault,cert_cert)
  file "/etc/ssl/certs/ssl-cert-snakeoil.pem" do
    owner 'root'
    group 'root'
    mode '0444'
    content item['file-content']
  end
rescue ChefVault::Exceptions::KeysNotFound
  raise ChefVault::Exceptions::ItemNotFound,
    "Certificate not found at #{vault}/#{cert_cert}!"
end

# Decrypt certificate chain
puts "Decrypting certificate chain."
begin
  item = ChefVault::Item.load(vault,cert_chain)
  file "/etc/ssl/certs/#{hostname}.chain" do
    owner 'root'
    group 'root'
    mode '0444'
    content item['file-content']
  end
rescue ChefVault::Exceptions::KeysNotFound
  Chef::Log.warn("No certificate chain in #{vault}/#{cert_chain}.")
end

# Decrypt private key
puts "Decrypting key from hash item #{cert_key}."
begin
  item = ChefVault::Item.load(vault,cert_key)
  file "/etc/ssl/private/ssl-cert-snakeoil.key" do
    owner 'root'
    group 'root'
    mode '0400'
    content item['file-content']
  end
rescue ChefVault::Exceptions::KeysNotFound
  raise ChefVault::Exceptions::ItemNotFound,
    "Private key not found at #{vault}/#{cert_key}!"
end

# Configure the SSL default site if enabled
apache_site "default-ssl" do
  enable node['apache']['default_site_enabled']
end
</code></pre>

<p>There might appear to be a lot going on in this recipe, but it is actually quite simple. First, the <code>chef_gem</code> and <code>require</code> lines tell the target node’s Chef client to download the <code>chef-vault</code> Gem.</p>

<p>The <code>directory '/etc/ssl/certs' do</code> block creates the directory that should contain the SSL certificate <code>/etc/ssl/certs</code> if it does not already exist. Directory ownership is changed to <code>root</code> and it is made world-readable.</p>

<p>The <code>directory '/etc/ssl/private' do</code> block creates the directory that should contain the SSL private key <code>/etc/ssl/private</code> if it does not already exist. Directory ownership is changed to <code>root</code> and it is made readable only by root.</p>

<p>The next part of the recipe assigns variables used for looking up and decrypting the node’s certificate, private key and certificate chain. The key names for these items are equal to the fully-qualified domain name of the node with periods escaped as underscores, plus the <code>_pem</code>, <code>_key</code>, and <code>_chain</code> suffixes, respectively. For example, for your test VM <code>tester.local</code> these values are <code>tester_local_pem</code>, <code>tester_local_key</code>, and <code>tester_local_chain</code>. (In case you were wondering: that is why the <code>knife encrypt create</code> commands you typed earlier created items named <code>tester_local_pem</code> and <code>tester_local_key</code>.)</p>

<p>The next three code blocks (each beginning with the comment <code># Decrypt</code>) actually decrypt the file contents and save them to files. Let’s look the first of these.</p>

<p>In the first decryption block, the line <code>ChefVault::Item.load(vault,cert_cert)</code> decrypts the certificate object and assigns the result to the variable <code>item</code>. The value of <code>item</code> will be a hash. The next 6 lines that begin with <code>file "/etc/ssl/certs/ssl-cert-snakeoil.pem" do</code> create the certificate file, assign ownership to root, make it world-readable, and set the contents to <code>item</code>’s hash entry named <code>file-content</code>. Note that all of this code is enclosed in a begin/rescue/end block, so that the <code>ChefVault::Exceptions::KeysNotFound</code> exception can be trapped. <code>ChefVault::Item.load</code> throws this exception if the vault does not contain the expected entry, in this case one whose key is <code>tester_local_pem</code>. If the entry is not found (for example, because you forgot to add the certificate to the vault), the recipe will throw and exception and fail — as it should.</p>

<p>The second decryption block decrypts and saves the certificate chain, if one was added to the vault. Because <code>tester.local</code>’s SSL certificate was self-signed, it does not need a certificate chain. However, in production situations you might have one, and if you do, you can ensure that it is copied to the server by adding it to vault using the usual <code>knife encrypt create</code> command and specifying an item named <em>nodename_chain</em>, where <em>nodename</em> is the escaped form of the fully-qualified domain name (periods replaced by underscores). Unlike the first decryption block, however, the recipe does not crash and burn if the certificate chain item is not found. Instead, the recipe simply warns that no chain was found.</p>

<p>The third decryption block decrypts and saves the private key. As with the first decryption block, the recipe fails if the key’s expected entry is not found in the vault.</p>

<p>The last block turns on the <code>default-ssl</code> site in Apache, which is preconfigured to use the various <em>ssl_snakeoil</em> certificate files and private keys.</p>

<p>The <code>ssl-config</code> recipe is fairly bare-bones, but sufficiently flexible that it will work with any SSL-enabled web server node. As discussed above, all you must do is (1) ensure that the node’s SSL certificate and private key are added to the vault correctly, and (2) configure the node’s run-list so that it executes the <code>ssl-config</code> recipe.</p>

<h1>Copying SSL certificates to the server</h1>

<p>With all of the prep work out of the way, it is time to finally configure the server. Upload the <code>ssl-config</code> cookbook to the Chef server:</p>

<pre><code>knife cookbook upload ssl-config
</code></pre>

<p>SSH into <code>tester.local</code>:</p>

<pre><code>vagrant ssh
</code></pre>

<p>Once in, run <code>chef-client</code>:</p>

<pre><code>sudo su
chef-client
</code></pre>

<p>Many console messages will scroll past you at a dizzying pace. Look for these lines:</p>

<pre><code>Recipe: ssl-config::default
…
Creating certificates for tester.local using vault certs.
Decrypting certificate from hash item tester_local_pem.
Decrypting certificate chain.
[2013-10-06T23:29:50+00:00] WARN: No certificate chain in certs/tester_local_chain.
Decrypting key from hash item tester_local_key.
</code></pre>

<p>These indicate that the recipe worked as expected. If there is a problem finding or decrypting the certificate or private key, the output will show an exception. Assuming the recipe ran successfully, the output will also contain lines showing that the certificate and private key files were created also. Look for lines similar to these, which shows the certificate file was created:</p>

<pre><code>- create new file /etc/ssl/certs/ssl-cert-snakeoil.pem
- update content in file /etc/ssl/certs/ssl-cert-snakeoil.pem from none to 53f4ae
    --- /etc/ssl/certs/ssl-cert-snakeoil.pem    2013-10-06 23:29:51.663590528 +0000
    +++ /tmp/.ssl-cert-snakeoil.pem20131006-9127-hmw8o1 2013-10-06 23:29:51.667592528 +0000
    @@ -0,0 +1,23 @@
    +-----BEGIN CERTIFICATE-----
</code></pre>

<p>…and these, which shows the private key file was created:</p>

<pre><code>- create new file /etc/ssl/private/ssl-cert-snakeoil.key
- update content in file /etc/ssl/private/ssl-cert-snakeoil.key from none to 60fcbe
    --- /etc/ssl/private/ssl-cert-snakeoil.key  2013-10-06 23:29:51.727622527 +0000
    +++ /tmp/.ssl-cert-snakeoil.key20131006-9127-m9p4zk 2013-10-06 23:29:51.731624527 +0000
    @@ -0,0 +1,27 @@
    +-----BEGIN RSA PRIVATE KEY-----
</code></pre>

<p>After the recipe runs, you can verify the files were correctly created by <code>cat</code>-ing the files <code>/etc/ssl/certs/ssl-cert-snakeoil.pem</code> and <code>/etc/ssl/private/ssl-cert-snakeoil.key</code>. The files should be owned by <code>root/root</code>; permissions should be restricted to 444 and 400, respectively.</p>

<h1>Testing the webserver</h1>

<p>To test that the webserver is working as it should, we need to do two more things: edit the <code>webserver</code> role to enable SSL and the default site. Then, we re-push the cookbook and restart the server.</p>

<p>First, edit the role as follows using the usual command <code>knife role edit webserver</code>. As shown below, add SSL as an enabled module by adding <code>"ssl",</code> to the <code>default_modules</code> array, and turn set the <code>default_site_enabled</code> value to <code>true</code>:</p>

<pre><code>"override_attributes": {
    "apache": {
      "allow_override": "None",
      "contact": "nobody@example.com",
      "default_modules": [
        "alias",
        "cgi",
        "deflate",
        "dir",
        "log_config",
        "logio",
        "mime",
        "rewrite",
        "ssl",
        "setenvif"
      ],
      "default_site_enabled": true,
....
</code></pre>

<p>Also, enable port 443 in the <code>listen_ports</code> section:</p>

<pre><code>      "listen_ports": [
        "80",
        "443"
      ],
</code></pre>

<p>On <code>tester.local</code>, run <code>chef-client</code> as root again and watch the node converge using these new settings.</p>

<p>Then, open your browser to <code>tester.local</code> using regular HTTP. You should see a page that screams <strong>It works!</strong>. Try using HTTPS; you should see the same message (and likely after getting an SSL warning about an untrusted certificate).</p>

<h1>Save your work</h1>

<p>You are done. Back up your nodes, roles, data bags and environments from the Chef server to your local workstation. Type:</p>

<pre><code>knife backup export
</code></pre>

<p>You will see the following output:</p>

<pre><code>Backing up nodes
Backing up nodes tester.local
Backing up roles
Backing up roles base
Backing up roles webserver
Backing up data bags
Backing up data bag certs item tester_local_key
Backing up data bag certs item tester_local_key_keys
Backing up data bag certs item tester_local_pem
Backing up data bag certs item tester_local_pem_keys
Backing up environments
Backing up environments testing
</code></pre>

<p>Next, edit <code>.gitignore</code> in your <code>chef-repo</code> directory so that your SSL certificate and private key are not stored in Git. Add this line somewhere near the top (for example, underneath the line <code>.chef/*.pem</code>):</p>

<pre><code>.chef/*.key
</code></pre>

<p>Finally, commit your work. You can see what files were modified with the usual command <code>git status</code>; if you do, you will see that some new files have been added:</p>

<pre><code>.chef/chef_server_backup/data_bags/certs/
cookbooks/ssl-config/
</code></pre>

<p>You will see that a few have also been modified. Commit everything:</p>

<pre><code>git commit -am "DevOps Secuity Handbook Part 3"
</code></pre>

<p><em>Remember, the keying materials (the <em>.key and </em>.pem files in the .chef directory) are not versioned in your Git repository. This is both a feature and a bug. You can safely move the <code>tester.local.pem</code> and <code>tester.local.key</code> files to offline media now, if you wish; they are safely encrypted in the data bag <code>certs</code> and no longer need to be in the local filesystem.</em></p>

<h1>Next: Adding custom content</h1>

<p>If you have completed the instructions in this post, you learned how to do some very useful things. You created a self-signed SSL certificate and private key for <code>tester.local</code>. You installed the <code>chef-vault</code> plugin for storing the SSL certificate and private key as encrypted data bag items. You authorized the user <code>arj</code> and node <code>tester.local</code> to decrypt these items. And you created a cookbook that decrypts the certificate, private key and certificate chain and creates files in the correct locations on the server.</p>

<p>In the next post, you will use Chef to configure Apache for serving custom content. You will create a non-privileged user whose home directory stores static HTML. This directory will be served up by Apache as the default website. In keeping with the SSH configuration introduced in this post, the user account will be configured to use SSH public keys for authentication rather than passwords.</p>

<p><em>This post was updated July 22, 2015 to change the naming convention for SSL certificate files on the target box. It also added a short section that enables the default normal and SSL sites, as well as a short section for testing the actual SSL configuration.</em></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The DevOps Security Handbook&#58; Building Security In With Chef, Part II]]></title>
    <link href="http://www.markerbench.com/blog/2013/10/03/chef-2nd-course/"/>
    <updated>2013-10-03T13:30:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/10/03/chef-2nd-course</id>
    <content type="html"><![CDATA[<h1>Introduction</h1>

<p><em>This is the second in a series of occasional posts about security and DevOps. The ultimate goal of this series is to show how to build a reasonably secure Apache web server using the popular DevOps automation tool <a href="http://www.opscode.com/chef/">Chef</a>. The server I am describing how to build will be suitable for serving static content. Readers of this blog know that I am a fan of static blogging tools like <a href="http://octopress.org">Octopress</a>, which I use to generate this website.</em></p>

<p>If you read the <a href="http://www.markerbench.com/blog/2013/10/01/chef-starter/">first post in this series</a>, you learned how to set up the Chef workstation and server account. You created an Apache server role and a test environment; set up a virtual machine; and built your first node. In this post, I will show you how to create a new role called <code>base</code> that includes security enhancements to OpenSSH. You will also fine-tune Apache to remove non-essential modules.</p>

<!-- more -->


<h1>Tightening the Apache configuration</h1>

<p>To recap, in the last post I described how to create a sample virtual machine called <code>tester.local</code>, onto which Chef installed the Apache 2 web server. If you were (as they say in the game-show world) “playing along at home,” you created a sample role called <code>webserver</code> that caused the <code>apache2</code> and <code>apt</code> packages to be installed on the node <code>tester.local</code>. You also bootstrapped the node so that it converged into the desired state.</p>

<p>As a refresher, let’s review a few details from last time. In your <code>chef-repo</code> directory, at the command line type:</p>

<pre><code>knife role edit webserver
</code></pre>

<p>You should see something that looks like this:</p>

<pre><code>{
  "name": "webserver",
  "description": "Web server for my.org",
  "json_class": "Chef::Role",
  "default_attributes": {
  },
  "override_attributes": {
    "apache": {
      "listen_ports": [ "80" ]
    }
  },
  "chef_type": "role",
  "run_list": [
    "recipe[apt]",
    "recipe[apache2]"
  ],
  "env_run_lists": {
  }
}
</code></pre>

<p>This configuration works just fine, of course. It sets up Apache with the usual defaults. Lots of modules are enabled, and a default website is configured automatically. For demonstrations, that might be dandy. But in production situations, you should tighten up the configuration so that it is more secure. Security professionals know, as a general rule, that when something has fewer configured options, it is usually more secure. In that spirit, let’s:</p>

<ul>
<li>Minimize the attack surface by removing Apache modules we don’t need</li>
<li>Decrease the amount of information “leaked” by the server by turning off server tokens and signatures</li>
<li>Increase server performance by eliminating HTTP keep-alives</li>
<li>Remove the default server website</li>
</ul>


<p>If you have tried to do these things in the past, you probably wrote shell-code or some other kind of custom script. Or perhaps, like me, painstakingly hand-tuned the server and wrote down all of your specific hardening steps in a notebook in case you needed to do it again. The genius of Chef’s <code>apache2</code> cookbook is that you no longer have to do those things. The <code>apache2</code> cookbook recipes are cleverly written; they allow Apache to be heavily customized without requiring you to write code. Nearly everything that Apache does (or should <em>not</em> do) can be controlled through <em>attributes</em>.</p>

<p>Attributes and their values can be defined in cookbooks via <em>attribute files</em> and within recipes. They can also be defined for individual roles or environments. When attributes are defined in more than one place, those defined for specific environments beat those defined for roles, which in turn beat those defined in cookbooks.</p>

<p>Attribute values can also have multiple priorities. In reverse order of precedence, these are <em>default</em>, <em>force default</em>, <em>normal</em>, <em>override</em>, <em>force override</em> and <em>automatic</em> priority types. That is, the default attributes are used unless there are force-default, override, force-override or automatic values supplied somewhere; force-default attributes apply unless normal, override, force-override or automatic values are found, and so on. The precedence rules are fairly complex; OpsCode’s documentation <a href="http://docs.opscode.com/essentials_cookbook_attribute_files.html">discusses them at length</a>.</p>

<p>In this case, you will define a several <em>override</em> attributes that will take precedence over the default values defined in the <code>apache2</code> recipes. When <code>chef-client</code> runs on the target node <code>tester.local</code>, these overridden values will be used in the various recipes to produce a more secure web server.</p>

<p>At the console, type:</p>

<pre><code>knife role edit webserver
</code></pre>

<p>In the editor screen, modify the <code>webserver</code> role so that it looks like this:</p>

<pre><code>{
  "name": "webserver",
  "description": "Web server for my.org",
  "json_class": "Chef::Role",
  "default_attributes": {
  },
  "override_attributes": {
    "apache": {
      "allow_override": "None",
      "contact": "nobody@example.com",
      "default_modules": [
        "alias",
        "cgi",
        "deflate",
        "dir",
        "log_config",
        "logio",
        "mime",
        "rewrite",
        "setenvif"
      ],
      "default_site_enabled": false,
      "directory_index": "disabled",
      "directory_options": "None",
      "ext_status": false,
      "keepalive": "Off",
      "keepaliverequests": "100",
      "keepalivetimeout": "15",
      "listen_ports": [
        "80"
      ],
      "serversignature": "Off",
      "servertokens": "Prod",
      "timeout": "120",
      "traceenable": "Off"
    }
  },
  "chef_type": "role",
  "run_list": [
    "recipe[apt]",
    "recipe[apache2]"
  ],
  "env_run_lists": {
  }
}
</code></pre>

<p>The hash named <code>apache</code> (inside the <code>override_attributes</code> hash), contains the attributes that modify how the Apache is configured. If you are familiar with Apache configuration files, you can probably guess what many of the attributes do. In order, the override values tell Apache to:</p>

<ul>
<li><code>allow_override</code>: Prevents <code>.htaccess</code> files placed in content directories from <a href="http://httpd.apache.org/docs/current/mod/core.html#allowoverride">overriding any directives</a> already in place for the directory</li>
<li><code>contact</code>: Sets the <a href="http://httpd.apache.org/docs/current/mod/core.html#serveradmin">contact email address</a> printed on Apache error pages to a bogus address</li>
<li><code>default_modules</code>: Restricts <a href="http://httpd.apache.org/docs/current/mod/mod_so.html#loadmodule">Apache loadable modules</a> to just the few needed to server static content; in this case, <code>mod_alias</code>, <code>mod_cgi</code>, <code>mod_deflate</code>, <code>mod_dir</code>, two logging modules, <code>mod_mime</code> (MIME support), <code>mod_rewrite</code> (for URL re-writing) and <code>mod_setenvif</code> (useful for sending different responses based on browser types)</li>
<li><code>default_site_enabled</code>: Disables the default website</li>
<li>directory_index: Disables <a href="http://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex">directory indexing</a></li>
<li>directory_options: Disable all “<a href="http://httpd.apache.org/docs/current/mod/core.html#options">extra features</a>” in directories, such as fancy indexing, symlink-following, multi-views, server-side includes and so forth</li>
<li><code>ext_status</code>: Disables <a href="http://httpd.apache.org/docs/current/mod/core.html#extendedstatus">extended status</a> messages</li>
<li><code>keepalive</code>, <code>keepaliverequests</code> and <code>keepalivetimeout</code>: Disables HTTP <a href="http://httpd.apache.org/docs/current/mod/core.html#keepalive">Keep-Alive</a> messages, which can cause performance to suffer in many cases</li>
<li><code>serversignature</code>: Removes <a href="http://httpd.apache.org/docs/current/mod/core.html#serversignature">server signatures</a> from error messages</li>
<li><code>servertokens</code>: Minimizes the <a href="http://httpd.apache.org/docs/current/mod/core.html#servertokens">response header field</a> to include just the webserver software (“Apache”) but not the version, OS or compiled-in options</li>
<li><code>timeout</code>: Increases the time the server <a href="http://httpd.apache.org/docs/current/mod/core.html#timeout">is allowed to respond to a request</a> to 120 seconds</li>
<li><code>traceenable</code>: Removes support for the <a href="http://httpd.apache.org/docs/current/mod/core.html#traceenable">HTTP TRACE</a> method</li>
</ul>


<p>Of these attributes, the <code>default_modules</code> attribute is the most interesting because its value causes various Apache modules to be enabled or disabled. By default, the <code>apache2</code> recipe loads a huge number of modules. By overriding the defaults you can restrict what is loaded to a small subset.</p>

<p>Note that Apache always loads a few other modules regardless of the value of the <code>default_modules</code> attribute. These include authorization, content negotiation, timeout and status modules. But by keeping the list of modules small, you keep the server’s memory footprint smaller. You also get rid of features that aren’t needed in most websites and can be sources of risk, such as WebDAV support, LDAP authentication, proxying and so forth.</p>

<p>I do not claim to be an Apache expert by any means, but default settings in the list above are reasonably tight. Certainly, they are good enough to demonstrate how you can use attributes to customize how the Apache cookbook runs.</p>

<p>Now that you have created override attributes for the <code>web server</code> role, it is time to put them to use. Save and close the role editor; the contents will be saved to the Chef server.</p>

<p>SSH into the test VM and execute the node’s run-list again so that the new attribute values are applied. From the post from last time, recall that the Chef role <code>webserver</code> had been assigned to <code>tester.local</code>. All that you need to do, therefore, is run the client again. SSH into the box and elevate to <code>root</code>:</p>

<pre><code>vagrant ssh
sudo su
</code></pre>

<p>and then:</p>

<pre><code>chef-client
</code></pre>

<p>You should see a dizzying rush of console messages, including many indicating that various Apache-related files are being modified. The run process should only take a few seconds. Assuming all recipes succeed, you will see a message at the bottom similar to the following:</p>

<pre><code>Recipe: apache2::default
  * service[apache2] action restart
    - restart service service[apache2]

Chef Client finished, 31 resources updated
</code></pre>

<p>Congratulations; your Apache server is now just a little bit faster, and a little bit tighter. You did it solely by twiddling a few attributes, without having to write any code. Nice, huh?</p>

<h1>Creating a new role for server hardening</h1>

<p>Let’s do some more attribute-twiddling. This time, your objective is to tighten the configuration of several common server components that reside on most servers: the SSH configuration, and the Chef client itself.</p>

<p>Download the cookbooks for SSH and the Chef client:</p>

<pre><code>knife cookbook site install openssh
knife cookbook site install chef-client
</code></pre>

<p>Upload the cookbooks to the Chef server:</p>

<pre><code>knife cookbook upload --all
</code></pre>

<p>Create a second role. This role, called <code>base</code>, will be used by all servers and will include recipes that every server should use. Type:</p>

<pre><code>knife role create base
</code></pre>

<p>…and supply the following contents into the editor:</p>

<pre><code>{
  "name": "base",
  "description": "Essential recipes for securing every server",
  "json_class": "Chef::Role",
  "default_attributes": {
  },
  "override_attributes": {
    "openssh": {
      "server": {
        "allow_agent_forwarding": "no",
        "allow_tcp_forwarding": "no",
        "client_alive_count_max": "0",
        "client_alive_interval": "600",
        "ignore_user_known_hosts": "yes",
        "login_grace_time": "30s",
        "password_authentication": "no",
        "permit_root_login": "no",
        "rsa_authentication": "no"
      }
    }
  },
  "chef_type": "role",
  "run_list": [
    "recipe[openssh]",
    "recipe[chef-client::delete_validation]"
  ],
  "env_run_lists": {
  }
}
</code></pre>

<p>The <code>openssh</code> recipe configures SSH on the machine. The override attributes above it configure the OpenSSH server daemon so that it uses sensible settings. Root logins are disabled, password authentication is disallowed; only public-key authentication is allowed. Session-forwarding is disabled, making the server unsuitable for use a “jump box.” (For more information on hardening SSHD, see the many <a href="http://www.faqs.org/docs/securing/chap15sec122.html">fine</a> <a href="http://www.thegeekstuff.com/2011/05/openssh-options/">articles</a> on the subject.)</p>

<p>In addition to the SSH settings, notice the addition of the <code>chef-client::delete_validation</code> recipe. This recipe does something rather important from a security prospective. As discussed previously, Chef server communicates with its nodes and clients using public/private key pairs. When a new node is added, a shared “validation key” is copied to the new node. This is a standard 2048-bit RSA private key with a name similar to <code>organization-validator.pem</code>; it is stored in your Chef repository’s <code>.chef</code> directory. It is <em>not</em> versioned by Git because <code>.chef/*.pem</code> is added to <code>.gitignore</code>, and it is obviously very sensitive. Anyone who obtained the validation key could conceivably join your Chef node set and gain access to the configuration data, recipes and more. Despite the sensitivity of this key, however, after the bootstrap operation completes, Chef inexplicably leaves it on the new node! It would be much nicer to remove it after the bootstrap.</p>

<p>For security reasons, you should remove the validation key after the initial bootstrap because it is not needed any more. The <code>chef-client::delete_validation</code> recipe does that. That is why it is in the run-list for the <code>base</code> role.</p>

<h1>Adding the <code>base</code> role to the server</h1>

<p>After you define the <code>base</code> role, you need to apply it to the test VM <code>tester.local</code> by adding it to the node’s run list. At present, <code>tester.local</code> is only running recipes that are part of the <code>webserver</code> role. As you might expect, you can add to a node’s run-list by using <code>knife</code>. Type:</p>

<pre><code>knife node run_list add tester.local "role[base]"
</code></pre>

<p>You will see output similar to the following that confirms that the <code>base</code> role has been added to <code>tester.local</code>’s run list.</p>

<pre><code>tester.local:
  run_list:
    role[webserver]
    role[base]
</code></pre>

<p>SSH back into the test box (type <code>vagrant ssh</code> followed by <code>sudo su</code>). Run <code>chef-client</code> again.</p>

<p>You will see many messages scroll by indicating that the <code>/etc/ssh/sshd_config</code> and <code>/etc/ssh/ssh_config</code> files have been updated. By default, the Chef <code>openssh</code> cookbook configures these files with the default settings that ship with OpenSSH. Console output should look similar to the following:</p>

<pre><code>Recipe: openssh::default
  * package[openssh-client] action install (up to date)
  * package[openssh-server] action install (up to date)
  * service[ssh] action enable
    - enable service service[ssh]

  * service[ssh] action start (up to date)
  * template[/etc/ssh/ssh_config] action create
    - update content in file /etc/ssh/ssh_config from 265a26 to 74365c
        --- /etc/ssh/ssh_config 2012-04-02 11:49:30.000000000 +0000
        +++ /tmp/chef-rendered-template20131003-3037-n6ytk  2013-10-03 02:14:48.674543237 +0000
        @@ -1,53 +1,3 @@
...
  * template[/etc/ssh/sshd_config] action create
    - update content in file /etc/ssh/sshd_config from 33469d to 1ba1c4
        --- /etc/ssh/sshd_config    2013-05-11 06:10:17.805866080 +0000
        +++ /tmp/chef-rendered-template20131003-3037-6xl885 2013-10-03 02:14:49.114323240 +0000
        @@ -1,88 +1,14 @@
        -# Package generated configuration file
        -# See the sshd_config(5) manpage for details
        +# Generated by Chef for tester.local

Recipe: openssh::default
  * service[ssh] action restart
    - restart service service[ssh]
</code></pre>

<p>You can verify that SSH has been reconfigured correctly by trying to SSH into <code>tester.local</code> using the default Vagrant account credentials (<code>vagrant</code>/<code>vagrant</code>). They should no longer work. However, typing the <code>vagrant ssh</code> command should still get you in. That is because the <code>vagrant ssh</code> authenticates using an embedded private key that is hardcoded into Vagrant. The public half of this key is an authorized key in the <code>vagrant</code> account’s list of public keys. (You can verify this yourself by examining the file <code>/home/vagrant/.ssh/authorized_keys</code> on <code>tester.local</code>. It shows one entry whose description reads “vagrant insecure public key.” How did it get there? Well, that is part of the ”contract” of building a <a href="http://docs-v1.vagrantup.com/v1/docs/base_boxes.html">Vagrant-compatible base box</a>.)</p>

<blockquote><p>Note: running the <code>openssh</code> recipe with the attributes as shown above can have adverse consequences on production nodes if you aren’t prepared. The recipe with the attributes as shown removes SSH <code>root</code> access. Unless you have another way of becoming <code>root</code> on the box, you might find yourself locked out! If your machine is a Vagrant machine, you can use the <code>vagrant ssh</code> command to become root. For non-Vagrant machines, you will need a non-root account that allows public-key logins and can <code>su</code> to <code>root</code>. You have been warned.</p></blockquote>

<h1>Next: Managing SSL certificates and keys</h1>

<p>This post introduced the concept of using Chef to partially harden a web server. You reduced the number of loadable Apache modules to a minimum set, disabled unnecessary services and reduced the amount of useful information an attacker could obtain. You created a second role called <code>base</code> and assigned two recipes, <code>openssh</code> and <code>chef-client::delete_validation</code>. These recipes configure OpenSSH in a more restrictive manner by disabling password authentication, disabling root logins and preventing session forwarding. The <code>delete_validation</code> recipe removes the Chef validation key from the node after it is created, which removes a potential security risk.</p>

<p>In the <a href="http://www.markerbench.com/blog/2013/10/06/chef-3rd-course/">next post</a>, you will switch back to Apache. You will use Chef to perform one of the most challenging aspects of any server configuration: copying SSL keying materials to server nodes.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The DevOps Security Handbook&#58; Building Security In With Chef, Part I]]></title>
    <link href="http://www.markerbench.com/blog/2013/10/01/chef-starter/"/>
    <updated>2013-10-01T16:18:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/10/01/chef-starter</id>
    <content type="html"><![CDATA[<h1>Introduction</h1>

<p>This is the first in a series of posts about <a href="http://www.opscode.com/chef/">Chef</a>, an infrastructure automation platform. The goal of this series is to describe how to build a reasonably secure Apache web server. By using Chef, we can quickly and efficiently build identical web servers with assurance that they will work the same way, every time, and have the security properties we want.</p>

<!-- more -->


<p>You will build this server in stages. The server will ultimately contain the following elements:</p>

<ul>
<li>Apache 2 HTTP web server, with minimal modules and a virtual host defined for serving website content</li>
<li>A limited user account whose home directory contains the website content. The account only accepts SSH remote logins that use public-key authentication. The Apache virtual host’s document root will point to a subdirectory of the account’s home</li>
<li>A user group whose name matches the user account name, and which contains the user as its only member</li>
<li>Hardened configuration with minimized services, synchronized time, intrusion prevention, and other security characteristics</li>
</ul>


<p>For purposes of testing, the server will be spun up as a virtual machine on your local workstation. You will use VirtualBox VMs for this purpose.</p>

<p>This first post will describe how to set up a basic test infrastructure that uses Chef. You will set up the Chef workstation and server account, create an Apache server role and a test environment, set up a virtual machine, and build your first node. The web server will not do much, and it will not be especially secure — at least not initially. Subsequent posts will gradually add more security components. By adding security features gradually, you will learn how to use Chef. As a side effect, you will learn how Chef’s philosophy of “convergence” makes it easy to gradually massage your nodes into the states you want. This is important when adding Chef to servers that already exist.</p>

<h1>Getting started</h1>

<p>In order to demonstrate how Chef works, you will need a virtual machine to play with. To create one, you will use Vagrant to instantiate a new VirtualBox VM. Our goal is to create a VM that you can boot and access on your laptop for testing purposes. After you do that, you will bootstrap it with Chef so that you can configure and manage it.</p>

<p>Some prerequisites. You will need to download and install:</p>

<ul>
<li><a href="https://www.virtualbox.org">VirtualBox</a> from Oracle, which creates and manages guest virtual machines.</li>
<li><a href="http://www.vagrantup.com">Vagrant</a>, which creates, manages, and destroys VirtualBox VM images from the command line.</li>
<li><a href="http://git-scm.com">Git</a>, the ubiquitous version-control system that will allow you to “check in” your Chef repository and manage its versions as you create the server.</li>
<li><a href="http://www.opscode.com/chef/">Chef 11.x</a> workstation software, which is where all of the magic happens.</li>
<li><a href="https://www.ruby-lang.org/en/">Ruby</a> 1.9.3 or higher</li>
</ul>


<p>Chef works best on Unix- and Linux-based systems. I used a Mac to prepare this guide. But my instructions are largely platform independent; as long as you have a Linux- or BSD-based workstation, or a Mac, you should be in good shape.</p>

<p>OpsCode’s QuickStart guide does a fine job explaining how to do the initial preparatory steps in their <a href="https://learnchef.opscode.com/quickstart/workstation-setup/">Workstation setup page</a>. OpsCode recommends that you install a Ruby version manager. I use RVM myself, although the documentation (in the Advanced tab) recommends RBENV. Open up OpsCode’s QuickStart guide and do everything on Page 1. It should take you about 5 minutes.</p>

<p>Next, you need to create an <a href="http://www.opscode.com/enterprise-chef/">Enterprise Chef</a> account, and download the starter package using the Enterprise Chef web interface.  <a href="https://learnchef.opscode.com/quickstart/chef-repo/">Page 2 of the  documentation page</a> explains how to do this. The free version of Enterprise Chef supports up to five nodes, which is perfect for our purposes. After you sign up and create an account, create a new Organization and download the “Starter Kit” as described on QuickStart Page 2. Follow the instructions on this page all the way up to the “Create a Simple Cookbook” section. Once you have done that, you have configured your Chef workstation properly.</p>

<p>A word about the “Starter Kit.” The Starter Kit is a zipped bundle that contains a sample Chef repository directory structure, and crucially, a private key for the your workstation, which Chef calls a “client.” When you expand the Starter Kit,  it will unpack into a directory called <code>chef-repo</code>. This is your Chef repository, and you should move it somewhere useful. I put mine in <code>~/workspace</code>, which is where I keep all of my dev stuff, but you can put it anywhere you like.</p>

<p>Using the Chef workstation tools, you create and edit Chef roles, environments, cookbooks and other locally on your workstation. When you want to push new versions out to your nodes, you use Knife to upload them to the Enterprise Chef server. When you upload, Knife uses the client’s private key to authenticate with the Enterprise Chef server.</p>

<p>With the initial setup stuff out of the way, let’s start getting into the fun stuff.</p>

<h1>Creating sample server run-lists, roles and environments</h1>

<p>I have found the OpsCode QuickStart documentation to be quite well-written. But it only gets you so far, and it leaves out some important steps for using Chef in a more serious way. Let’s take this opportunity to stray from the OpsCode documentation a bit and lay down some additional foundation-work for building the web server. In particular, let’s set up some initial run-lists, roles and environments for your test VM.</p>

<p>Some background. Chef “converges” nodes into their desired states by applying a ”run-list” of <a href="http://docs.opscode.com/essentials_cookbook_recipes.html">recipes</a> to each node. The run-list of recipes (Apache2, NTPD, user creation, etc) that apply can be specified in several ways. The quickest and most direct way is to specify the node’s run-list of recipes when the node is initially bootstrapped with Chef; that is, when the Chef agent (<code>chef-client</code>) is initially installed on the node. Bootstrapping the node configuration is done using Knife, and the syntax looks like this:</p>

<pre><code>knife bootstrap tester.local --run-list "recipe[apt],recipe[apache2]" -E testing
</code></pre>

<p>I have omitted some of the syntax the sake of simplicity; don’t try running this. There are important concepts to understand here. The <code>bootstrap</code> command causes the <code>chef-client</code> application to be installed on the node. The <code>chef-client</code> is essentially an <em>agent</em>. It configures and installs software based on instructions (”recipes”) it receives from the Chef server. Notice the <code>run-list</code> parameter: it indicates that the APT and Apache2 recipes will be applied to node <code>tester.local</code>. What this means is that when <code>chef-client</code> is bootstrapped onto the node, the APT and Apache packages will be downloaded, installed and configured as well.</p>

<p>Notice also the <code>-E</code> parameter. This means that <code>tester.local</code> should be assigned to an environment called <code>testing</code>, which you will define in a minute. By ”environment,” Chef means a group of nodes that typically correspond to a stage of development, for example “testing,” “staging,” or “production.” Let&rsquo;s create the <code>testing</code> environment now. Type:</p>

<pre><code>knife environment create testing
</code></pre>

<p>…and type or paste the following JSON contents into the file:</p>

<pre><code>{
  "name": "testing",
  "description": "Test environment",
  "cookbook_versions": {
  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {
  },
  "override_attributes": {
  }
}
</code></pre>

<p>Nothing tricky here — just a simple JSON file with a few attributes in it. The <code>default_attributes</code> and <code>override_attributes</code> items can be used to supply variables to the recipes that are unique to the testing environment, for example, debug settings or dummy passwords. You will leave these blank for now because they don’t apply in this case.</p>

<p>As I mentioned, there are several ways to assign run-list items to nodes. Direct assignment of recipes during bootstrapping, shown in the edited <code>knife bootstrap</code> command above, is the easiest way. But that won&rsquo;t scale if you have multiple nodes that must be configured identically. It makes more sense, instead, to create a <em>role</em>, which allows common run-lists to be defined for groups of machines that do the same thing. Instead of bootstrapping with a specific run-list of recipes, you can bootstrap with roles. When you use a role, Chef looks up (dereferences, if you will) the run-list for the role and applies all of the recipes it contains, along with any custom attributes. You can think of roles as a type of pointer.</p>

<p>Let’s create a new role called <code>webserver</code>. In it you will add the components needed to run your website. Type:</p>

<pre><code>knife role create webserver
</code></pre>

<p>…and supply these contents:</p>

<pre><code>{
  "name": "webserver",
  "description": "Web server for my.org",
  "json_class": "Chef::Role",
  "default_attributes": {
  },
  "override_attributes": {
    "apache": {
      "listen_ports": [ "80" ]
    }
  },
  "chef_type": "role",
  "run_list": [
    "recipe[apt]",
    "recipe[apache2]",
  ],
  "env_run_lists": {
  }
}
</code></pre>

<p>Notice that the <code>run-list</code> attribute contains the <code>apache2</code> cookbook, similar to what you used in the initial bootstrap command. The  <code>listen-ports</code> override attribute tells the <code>apache2</code> cookbook to configure Apache to listen just on port 80. You will learn more about override attributes in a future post. But if you are curious about how the cookbook works, and about the various attributes you can use to customize Apache’s configuration, see OpsCode’s <a href="http://community.opscode.com/cookbooks/apache2">online decimation</a>. Notice also the <code>apt</code> recipe; this is required because Debian’s APT package updater is how Apache is actually installed onto the node.</p>

<p>To bootstrap using roles instead of directly specifying recipes, you would use the following syntax (some details omitted):</p>

<pre><code>knife bootstrap tester.local --run-list "role[webserver]" -E testing
</code></pre>

<p>Again, don’t type this in, because it won’t work without some additional syntax; you will get to it soon enough.</p>

<p>Let&rsquo;s complete the initial Chef setup. So far, you have created a sample test environment called <code>testing</code>, and a sample server role called <code>webserver</code>. To complete the initial setup, you need to do two more things: download the actual cookbooks that Chef will apply to the node; and upload the cookbooks to the Chef server so that any nodes that are assigned it can get it. The cookbooks we need are <code>apt</code> (required to install Apache), and <code>apache2</code> (Apache itself).</p>

<p>To install the apache2 cookbook, type:</p>

<pre><code>knife cookbook site install apache2
</code></pre>

<p>This command looks up the <code>apache2</code> cookbook on the Opscode <a href="http://community.opscode.com">community cookbook site</a> and causes it to be downloaded to your workstation. You will see a series of output messages showing the progress of the download, followed by a completion message when it succeeds. While you are at it, go ahead and install the <code>apt</code> cookbook too.</p>

<p>After downloading both, commit your current Chef repo to Git:</p>

<pre><code>git add .
git commit -m "Added Apache and APT cookbooks."
</code></pre>

<p>Then upload your cookbooks to the Chef server:</p>

<pre><code>knife cookbook upload --all
</code></pre>

<p>It might seem a little strange to have to upload the cookbooks to the Chef server. After all, they are managed centrally from the community cookbook site. Why can’t roles simply reference the cookbooks stored there, instead of needing to make copies? Frankly, I am not too sure why this is the case. I suspect Chef works this way so that cookbooks and recipes can be hacked up when needed. Regardless, you must upload cookbooks to Chef server after you update them. If you don’t, the Chef client on any nodes you create will continue to use outdated recipes.</p>

<h1>Backing up Chef server data</h1>

<p>Because you are using Enterprise Chef, your nodes, roles, environments and data bags are stored on the server — not locally. While I trust OpsCode to keep their servers up and available, I like to keep copies of important data on my client so that I have a record of them, and can version them with Git. You should, too.</p>

<p>To do that, you will need to install the <code>backup-export</code> Knife plugin, part of the <a href="https://github.com/stevendanna/knife-hacks">Knife Hacks</a> package. Then, you should copy a specific plugin file from GitHub into our local Chef knife plugin cache in <code>~/.chef/plugins/knife</code>, creating the directory if necessary. A few quick commands should do the trick:</p>

<pre><code>mkdir -p ~/.chef/plugins/knife
curl https://raw.github.com/stevendanna/knife-hacks/master/plugins/backup_export.rb &gt; ~/.chef/plugins/knife/backup_export.rb
</code></pre>

<p>Change back to your <code>chef-repo</code> directory and issue the following command:</p>

<pre><code>knife backup export
</code></pre>

<p>You’ll see output similar to this:</p>

<pre><code>Backing up nodes
Backing up nodes tester.local
Backing up roles
Backing up roles webserver
Backing up data bags
Backing up environments
Backing up environments testing
</code></pre>

<p>By default, backups are stored in <code>.chef/chef_server_backup</code>. You can change this by modifying the <code>chef_server_backup_dir</code> entry in <code>.chef/knife.rb</code>, but there’s no obvious benefit to doing that here. It is sufficient simply to have them present in the Chef repo directory, because they can be checked into Git using the usual familiar <code>git add .</code> and <code>git commit</code> steps. Go ahead and do that now.</p>

<p>If you have gotten this far, your initial Chef setup is complete. Now, let’s create a test machine.</p>

<h1>Creating a virtual machine for testing</h1>

<p>Change to your Chef repo directory. Create a new file <code>Vagrantfile</code> with these contents, or edit the existing one so that it matches this:</p>

<pre><code># -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
  config.vm.box = "opscode-ubuntu-12.04-i386"
  config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04-i386_provisionerless.box"
  config.vm.hostname = "tester.local"
  config.vm.define :tester do |t|
  end
  config.vm.network "private_network", ip: "192.168.56.2"
  config.vm.provider :virtualbox do |vb|
    vb.gui = false
    vb.name = "tester.local"
  end
end
</code></pre>

<p><code>Vagrantfile</code>’s job is to tell Vagrant how to set up the test VM. If you have used Vagrant before, you will notice that this <code>Vagrantfile</code> is shorter than the default file Vagrant supplies. Here&rsquo;s what it does:</p>

<ul>
<li>Downloads an Ubuntu 12.04 base box (essentially, a virtual machine image) from OpsCode’s repository on Amazon</li>
<li>Creates a VirtualBox VM based on the machine image</li>
<li>Gives the VM the network name <code>tester.local</code>. This is the name that the Unix command <code>hostname</code> will return when you log into it</li>
<li>Names the VirtualBox machine <code>tester</code>. This is the name used to start, stop and delete the VM when using the VirtualBox command-line tools or the VirtualBox GUI.
Names the VirtualBox image directory <code>tester.local</code>. By default, VirtualBox names the image based on the directory that contains <code>Vagrantfile</code>, plus a timestamp suffix. The <code>vb.name</code> property inside the <code>config.vm.provider</code> block overrides the default so that it matches the host name.</li>
<li>Configures the VM’s networking interface to use a private network address 192.168.56.2. This will allow us to start the VM and see it on our workstation, but the VM won’t be accessible from the outside.</li>
<li>Specifies that when you boot the VM, it will be booted in headless mode; the VirtualBox GUI won’t be displayed.</li>
</ul>


<p>That is all you need to instantiate a new VM on our workstation. Next, edit your workstation’s <code>/etc/hosts</code> file and add a line that points to the VM using the private IP address and name <code>tester.local</code>:</p>

<pre><code>192.168.56.2    tester.local
</code></pre>

<p>Great. Now, let’s go ahead and actually create the VM. From the command line in the same directory as <code>Vagrantfile</code>, type:</p>

<pre><code>vagrant up
</code></pre>

<p>Vagrant will look by default in the same directory for <code>Vagrantfile</code>, and having found it, will create the VM according to the contents of the file. You will see output similar to the following:</p>

<pre><code>Bringing machine 'tester' up with 'virtualbox' provider...
[tester] Importing base box 'opscode-ubuntu-12.04-i386'...
[tester] Matching MAC address for NAT networking...
[tester] Setting the name of the VM...
[tester] Clearing any previously set forwarded ports...
[tester] Creating shared folders metadata...
[tester] Clearing any previously set network interfaces...
[tester] Preparing network interfaces based on configuration...
[tester] Forwarding ports...
[tester] -- 22 =&gt; 2222 (adapter 1)
[tester] Booting VM...
[tester] Waiting for VM to boot. This can take a few minutes.
[tester] VM booted and ready for use!
[tester] Setting hostname...
[tester] Configuring and enabling network interfaces...
[tester] Mounting shared folders...
[tester] -- /vagrant
</code></pre>

<p>The entire process should take between 30 seconds to a minute if the base box is already cached on your workstation. If not, the first time you do <code>vagrant up</code> Vagrant will need to download the machine image from Amazon.</p>

<p>You can verify that the new test VM is up by pinging tester and verifying that it responds:</p>

<pre><code>Tweety:chef-repo arj$ ping tester.local
PING tester (192.168.56.2): 56 data bytes
64 bytes from 192.168.56.2: icmp_seq=0 ttl=64 time=0.582 ms
64 bytes from 192.168.56.2: icmp_seq=1 ttl=64 time=0.638 ms
…
</code></pre>

<p>Typing <code>vagrant status</code> will also indicate that the VM is up and running:</p>

<pre><code>Tweety:chef-repo arj$ vagrant status
Current machine states:

tester                    running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
</code></pre>

<p>You can repeat this process as often as you like by destroying and recreating the VM:</p>

<pre><code>vagrant halt tester
vagrant destroy tester
</code></pre>

<p>If you would like to verify that the VM is really up, you can SSH into the box using the username <code>vagrant</code> and password <code>vagrant</code>. You can also use the command <code>vagrant ssh</code> which does the same thing.</p>

<blockquote><p>Note: by default, base boxes used with Vagrant ship with a pre-installed SSH public/private key pair that is used for SSHing into VMs it creates. These base boxes also ship with default <code>vagrant/vagrant</code> credentials. This configuration is <a href="http://stackoverflow.com/questions/14715678/vagrant-insecure-by-default">not secure</a>. For testing purposes on your local workstation this should not be a problem, because we have configured the VM to use host-based networking. It cannot be accessed outside of the workstation. But production servers should not use Vagrant with its default configuration.</p></blockquote>

<h1>Bootstrapping the virtual machine with Chef</h1>

<p>So far, so good. You have successfully created a test virtual machine, but it isn&rsquo;t much good to us yet because it doesn’t have Chef on it. Until it does, you cannot manage it.</p>

<p>It is (finally!) time to “bootstrap” the VM using Knife. This installs the <code>chef-client</code> agent on the node, and registers the new node with the Chef server. Type in the following:</p>

<pre><code>knife bootstrap tester.local --ssh-user vagrant  --ssh-password vagrant --run-list "role[webserver]" -E testing --sudo
</code></pre>

<p>Viola! Assuming you did everything as described, Chef will SSH into the box, download and install Chef client onto it, and begin converging the node into its desired state; in this case, installing and configuring Apache.</p>

<p>Immediately after hitting Enter, a long list of output lines should appear. These should resemble the following:</p>

<pre><code>Bootstrapping Chef on tester.local
tester.local --2013-09-29 03:20:41--  https://www.opscode.com/chef/install.sh
tester.local 
tester.local Resolving www.opscode.com (www.opscode.com)... 
tester.local 184.106.28.82
tester.local 
tester.local Connecting to www.opscode.com (www.opscode.com)|184.106.28.82|:443... 
tester.local connected.
tester.local 
tester.local HTTP request sent, awaiting response... 
tester.local 200 OK
</code></pre>

<p>followed by</p>

<pre><code>tester.local Starting Chef Client, version 11.6.0
tester.local 
tester.local resolving cookbooks for run list: ["apt", "apache2"]
tester.local 
tester.local Synchronizing Cookbooks:
tester.local 
tester.local   - apt
tester.local 
tester.local   - apache2
tester.local 
tester.local Compiling Cookbooks...
</code></pre>

<p>and then a series of lines that indicate that APT and Apache have been installed. The last lines indicate that Apache has been installed and restarted, and that the resources on the box have been updated:</p>

<pre><code>tester.local Recipe: apache2::default
tester.local 
tester.local   * service[apache2] action restart
tester.local 
tester.local 
tester.local     - restart service service[apache2]
tester.local 
tester.local 
tester.local 
tester.local Chef Client finished, 28 resources updated
tester.local 
</code></pre>

<p>If you see output similar to this, and no errors, it means that you have successfully converged your first node. Congratulations! Excellent work.</p>

<p>You verify that the web server is up by firing up your browser to the address <code>http://tester.local</code>. It should return a “Forbidden” message because we have not actually provided any HTML pages for Apache to serve up. But that is evidence enough that Apache is actually working.</p>

<h1>Next: Adding security to the box</h1>

<p>This post covered the basics of how to get going with Chef. You have installed the Chef workstation software and supporting components Git, Ruby and VirtualBox and Vagrant. You have created a sample role called <code>webserver</code> and assigned two sample recipes, <code>apache2</code> and <code>apt</code>, to it. You created a virtual machine called <code>tester</code> with the domain name <code>tester.local</code> and bootstrapped Chef onto it, placing it under Chef control.</p>

<p>In the <a href="http://www.markerbench.com/blog/2013/10/03/chef-2nd-course/">next post</a>, you will begin doing more useful work. I’ll describe how to fine-tune the Apache installation. We will also begin increasing the security of the machine.</p>

<p><em>This post was updated October 1, 2013 to change the hostname used in the examples from <code>tester</code> to <code>tester.local</code>. It was updated on October 2, 2013 to remove references to the half-configured SSL support for Apache; I’ll cover this more fully in a future post.</em></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Building Security In Using Chef]]></title>
    <link href="http://www.markerbench.com/blog/2013/09/23/Building-Security-in-Using-Chef/"/>
    <updated>2013-09-23T00:02:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/09/23/Building-Security-in-Using-Chef</id>
    <content type="html"><![CDATA[<p>Lately I have been spending a lot of time with a new best friend. This new friend is reliable; he does everything according to plan and always exactly the same way. The results are exactly the same every time, too. And he speaks to me in a language that I understand — the language of food.</p>

<p>I am not talking about a new buddy gourmand, about a pal I go out to restaurants with, or about a super-reliable project manager. My new best friend is a technology called Chef, made by <a href="http://www.opscode.com/">OpsCode</a>.</p>

<!-- more -->


<p><a href="http://www.opscode.com/chef/">Chef</a>, along with <a href="http://puppetlabs.com/puppet/what-is-puppet">Puppet</a> and <a href="http://cfengine.com/">CFEngine</a>, is a flexible toolset for building infrastructure. The Chef mantra is “infrastructure as code,” which means simply that you can build infrastructure — servers and workstations the same way every time. Chef has important implications for security because, by using it, you can ensure that your nodes have exactly the security properties you want by “baking it in” to what Chef calls “cookbooks,” the core component. I&rsquo;ll come back to the security implications in a few minutes, but in the meantime I should explain what a cookbook is.</p>

<p>Cookbooks are packages that define how packages, applications or system functions should be built and configured. Cookbooks exist for Apache, NTP, user and group account creation, and just about every common application you can imagine. At a file level, cookbooks are basically composed of property files, templates and clever glue-code. The cookbook’s job is to declare required packages and dependencies; provide templates for configuration files that need to be modified, and provide Ruby code that sets up the packages, configures things or does whatever is needed to achieve the desired result. The process for building nodes is similar to how developers build code.</p>

<h1>Typical Chef workflow</h1>

<p>Here’s what a typical project workflow looks like. With Chef, you:</p>

<ul>
<li>Create a new developer project using Git</li>
<li>Download one or more cookbooks for the applications or services you want to manage; or, you create new ones from scratch</li>
<li>Modify the properties associated with each cookbook as needed</li>
<li>Upload the modified cookbooks and/or properties to the master Chef server</li>
<li>“Bootstrap” new nodes from standard machine images, for example a generic CentOS VM. The bootstrap process injects Chef agents onto the new nodes and then&hellip;</li>
<li>“Converge” each new nodes into the desired state by downloading the required cookbooks and properties (the “run list”) that apply, and then running all of the cookbook recipes in the run-lists</li>
</ul>


<p>I’ve glossed over quite a few things here, but the overall strategy is that the Chef agent transforms the node into the state you want. Sometimes this takes multiple passes through the run-list, although the Chef agent is generally smart enough to figure out how to manage dependencies without intervention. That is why Chef uses the term “converge” to describe how the node morphs into the desired state. Nodes need not be clones of each other, and indeed Chef can be injected into existing systems long after they are created. One might say that the Chef philosophy is exactly the opposite of the traditional “golden image” concept where every system is an exact copy of every other. It is more correct to say that with Chef, every package and application within scope — those you have created cookbooks for — is <em>configured</em> in exactly the way you expect. Chef stresses <em>idempotency</em> — a fancy way of saying that when you execute the run-list on multiple nodes, you get the same result every time. For the curious, Sean O’Meara provides an excellent overview of Chef <a href="http://blog.afistfulofservers.net/post/2011/03/16/a-brief-chef-tutorial-from-concentrate/">on his blog</a>.</p>

<h1>Chef tools for cooking in the kitchen</h1>

<p>Chef includes several components that work together to produce consistent results every time:</p>

<ul>
<li><strong>Knife</strong>, a command-line workhorse that you use to create, download, edit and upload cookbooks, clients, nodes, roles and environments. <em>Clients</em> are the workstations that edit Chef configurations. <em>Nodes</em> are the machines that Chef produces. <em>Roles</em> are run-lists of cookbooks and configs for a common purpose, for example, a role called “webserver” with cookbooks and properties for Apache, PHP, CGI, and your company&rsquo;s standard HTML chrome. <em>Environments</em> are variations on either global configurations or roles for specific situations, for example “development,” “production,” etc.</li>
<li><strong>Chef-server</strong>, which serves as a master repository for your cookbooks, property files, and lists of clients, nodes and environments. You can set up your own server by downloading and running the community open source version. OpsCode also provides a <a href="http://www.opscode.com/enterprise-chef/">hosted option called Enterprise Chef</a>, which is free when used with five nodes or less.</li>
<li><strong>Public/private keys</strong>, which allow clients, nodes and servers to authenticate each other without needing passwords. When your initial account is created on Chef server via the web GUI, the server creates a key-pair. The private half is added to a zipped download bundle that is expanded on the client into a directory. The client directory is then checked into Git (keying materials are <em>not</em> checked in). Whenever Knife is executed, it uses the private key to authenticate with the server first. The client bundle also includes a “validation key,” which is copied to new nodes at the time of creation. This validation key is used to initiate a key-exchange process with the server to create a node-specific key, after which point the validation key can be removed from the node.</li>
<li><strong>Resource providers</strong>, which perform tasks listed in cookbook scripts. These <a href="http://docs.opscode.com/resource.html">providers</a> allow Chef cookbook commands to remain relatively abstracted from the underlying OS commands. For example, the <code>include</code> resource provider invokes the package managers on various systems (<code>yum</code> for Red Hat or CentOS, <code>apt</code> for Debian-style Linuxes etc). Creative combinations enable interesting results: for example, you can populate directories on target nodes with Git checkout contents. If you had previously versioned website page contents, contents, creating an up-to-date static webserver can be done automatically by causing it to pull the latest content from the master repo — a neat trick.</li>
<li><strong>Community site</strong>, which hosts cookbooks from OpsCode and third parties, saving you the trouble of writing your own cookbooks. The <a href="http://community.opscode.com/cookbooks/apache2">Apache cookbook</a>, for example, is extremely complete and allows for flexible customization. I have not finished fooling around with it yet in my own experiments, but the properties files allow for quite a bit of hardening; you can specify which Apache modules to include and exclude, create website aliases, map directories and do many of the things that old Apache-tuners like me have been doing by hand for years. As you might expect, the degree of configurability for any particular cookbook varies greatly depending on the skill of the author and amount of iterative refinement the cookbook recipes have received over time.</li>
</ul>


<p>In addition to its own components, Chef also makes good use of a few other key tools that you might be familiar with, chiefly:</p>

<ul>
<li><strong>Git</strong>, the distributed version control system at the epicenter of the DevOps movement. When you create a new Chef project, the first thing you usually do is commit the new project into a local <a href="http://git-scm.com/">Git repository</a>. At that point, you can easily create and link to a remote repository so that changes to the project are appropriately versioned centrally. As noted above, client-side keying materials are not automatically versioned; they are part of the default <em>.gitignore</em> file initially downloaded from the server.</li>
<li><strong>Vagrant</strong>, a command-line utility for managing virtual machines. <a href="http://www.vagrantup.com/">Vagrant</a> allows you to download and cache a pristine community machine image, which can be quickly spun up,  bootstrapped with Chef, and destroyed. The default VM image type is Oracle’s VirtualBox, but Vagrant can also manage VMWare, Amazon and Rackspace images. With VirtualBox images, Vagrant can also manage networking settings so that it is easy to create test machines on your laptop. Using Chef and Vagrant together,  for example, I was able to create a new virtual machine, bootstrap it with Chef, and converge it to a desired Apache state in about 30 seconds.</li>
</ul>


<h1>Implications for security</h1>

<p>So, why is a security guy like me fooling around with Chef, and what are the implications for security? Here’s what I like about it:</p>

<ul>
<li><strong>Infrastructure as code</strong>. I really like how you can create and manage machines essentially as code. I do a fair amount of programming as an after-hours “professional hobby,” so it is great to be able to use some of the same tools and languages (notably Git and Ruby) here also.</li>
<li><strong>Clever crypto</strong>. The mutual authentication system using naked public/private keys is clever. I’ve always felt that for the sorts of things Chef does, certificates would be too heavyweight and too much bother. While it is true that the client-side private key is not, by default, protected with a password, one can easily be added. The no-password default, however, does strike a nice balance of making it easy to communicate with Chef server without needing to worry too much. As long as the client node is protected, subversion isn’t a huge worry.</li>
<li><strong>Stepwise assimilation</strong>. I like how Chef can be added to an existing machine so that it can be massaged into the desired state. When I have a little more time, I plan to perfect my Apache cookbook adaptations and converge my existing <a href="http://www.securitymetrics.org">securitymetrics.org</a> server into it. That would allow me to quickly recreate the web-server parts of the site if it got 0wned. I keep a rather long list of anal-retentive instructions for hand-tuning the Apache, Mailman, Logwatch, SSHD, etc. I intend to gradually move each of these items under Chef control. Gradual assimilation is nice, because it easier for most organizations to implement rather than focusing on big-gulp “golden image” projects.</li>
<li><strong>Baked-in security possibilities</strong>. As you might imagine, the ability to converge nodes into predictable and known states is Chef’s strong point. If you are a security professional who believes in Building Security In (“Mr McGraw, white courtesy phone&hellip;”), Chef gives you powerful tools in service of that goal. Through Chef, cookbooks, services and applications can be <a href="http://docs.opscode.com/resource_service.html">minimized</a>. Key exposures can be limited via existing cookbooks or through custom ones that you may create.</li>
</ul>


<h1>Key caveats when working with Chef</h1>

<p>So, that’s what I like about Chef. However, Chef has some important limitations that security professionals must keep in mind:</p>

<ul>
<li><strong>Chef’s frame of reference is that of an Agile developer</strong>, not that of a system administrator or a security pro. Cookbooks and recipes, and infrastructure-as-code are powerful metaphors, but they are different than those used by traditional configuration management tools. There is no concept of a CMDB other than in a very loose sense — the Chef server data and any projects managed by Git. Using Chef effectively requires you tho think like a developer. In companies where Agile or Lean has taken root — where development and operations are tightly coupled in a common workflow — this is a plus. But shops that aren’t fully wedded to the DevOps philosophy are likely to find Chef’s mindset a little alien.</li>
<li><strong>Chef’s learning curve is steep and can lock you in</strong>. Chef property files and cookbook scripts are nothing more than stock Ruby files arranged in specific directory layouts and used in specific ways. Consequently, mastering Chef requires one to <a href="http://docs.opscode.com/just_enough_ruby_for_chef.html">learn a bit of Ruby</a>. Personally, I’ve found Ruby easier to learn than Perl or Bash (neither one of which I like very much). It allows me to express intent more simply and in a more compact fashion. What it means is that if you are a security or infrastructure professional who wants to build security in, you will have to roll up your sleeves a bit and learn a new language. Your investment in learning Chef and Ruby will lead to increased lock-in, which is <em>usually</em> a good thing. Certainly, it is better than the alternatives — rat’s nests of Perl, Bash, wikis and READMEs.</li>
<li><strong>Chef’s documentation is average for open projects</strong>, with the pluses and minuses this implies. OpsCode offers a licensing and support model similar to other hybrid companies: the source code is freely available for most components; licensing is generous and corporate-friendly (Apache 2.0 license); and a vibrant community helps newbies ascend the initial learning curves. If you want support you have to pay. For those who want to self-support, documentation is on par but not dramatically better than many open source projects: it covers basic use cases well, but minor deviations from potted plots cause hiccups. In my own experiments, for example, a server node wasn’t converging as it should have because <code>chef-client</code> wasn’t running as root. Error messages were cryptic and shed no light on the cause. Attempting to reinitialize the master workstation client made matters worse because I erased my private keys. I eventually figured out what was going on, but only through logical deduction rather than consulting the documentation.</li>
<li><strong>Chef is server-centric</strong>, and won’t help you converge state on other types of devices, such as routers, load-balancers or databases. For those whose ambitions extend to automating the configuration of entire virtual or physical environments, you will need to bolster Chef with other tools. That isn’t necessarily a minus, but it does mean that Chef is only good at the things it is meant to be good at. It won’t be the only tool in your bag.</li>
</ul>


<h1>Alternatives to Chef</h1>

<p>As Sean’s blog points out, <a href="http://blog.afistfulofservers.net/post/2011/12/30/cfengine-puppet-and-chef-part-1/">Chef is not the only game in town</a>. Puppet serves a similar role for many companies, and its design philosophy is close to that of Chef. Both were inspired by CFEngine. I chose to experiment with Chef because I felt it had more polish and refinement than Puppet. I have no idea whether this is actually true or not. At a certain point, it does not matter. Whether you like Chef, Puppet or CFEngine, the point is to try them out and see where it takes you. I am quite pleased so far with Chef and look forward to using it more with my own projects. I will post more details in future blog posts.</p>

<p>If you are a security or infrastructure who is working with Chef or similar tools, I would love to hear about you experiences. Add a comment or send me an email!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[New Web Adventures with Heroku]]></title>
    <link href="http://www.markerbench.com/blog/2013/08/26/new-web-adventures/"/>
    <updated>2013-08-26T08:55:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/08/26/new-web-adventures</id>
    <content type="html"><![CDATA[<p>Many ardent followers of this blog know that among other things, one of my professional hobbies is application development. I am a &ldquo;weekend programmer.&rdquo; I always have a side project or two going, but do not professionally program (much) as part of my day job. That&rsquo;s not necessarily for lack of talent (cough), but for lack of desire to make my living from it. That said, as the CTO of a cloud security software company, it&rsquo;s rather good to know how software is built these days. As a bonus, by staying close to dev via a hobby or two, I can relate better to my colleagues who actually do make their living from programming.</p>

<!-- more -->


<p>I have been programming most of my life. I learned to program around age 11 on time-sharing systems, and then later, on the Apple II+ and the PDP 11-44. My high-school computer science team was nationally ranked, usually #1 or #2 in the country, and I scored well enough on my high school Advanced Placement (AP) test — 5 on a 5 scale — to waive all of my college science requirements in college. I could have majored in computer science but chose economics and political science instead, with huge dollops of Japanese and architecture on the side. I took just one computer science class in college — for fun — as a senior. It was CS 201, the hard-core freshman course for future majors. The course focused on LISP. I hated it, frankly, because Lisp is a weird language, and because all of my 201 classmates were jumping with both feet into their future majors and left me breathing their dust. As a result, I found myself — for the first time in my life — on the ass end of the grading curve. That aside, I got my first consulting gigs after college as a programmer, and have kept coding, on-and-off, ever since.</p>

<p>A few of my &ldquo;weekend projects&rdquo; have been more than that. For example, in the early 2000s I became enamored of Java 2 Enterprise Edition (J2EE) in general, and with a Java-based wiki software package (JSPWiki) in particular. I didn&rsquo;t like JSPWiki&rsquo;s security model and volunteered to re-write it. That was fun. Five years later, I had contributed about 100,000 lines of code, added LDAP and database authentication, re-wrote the authorization system, given it a new front end based on <a href="http://www.stripesframework.org/display/stripes/Home">Stripes</a>, and helped incubate it into a <a href="http://jspwiki.apache.org">top-level Apache Software Foundation project</a>. By that time, I had essentially become the co-lead on the project with my colleague <a href="http://www.ecyrd.com/ButtUgly/">Janne Jalkanen</a>. But I found that I was no longer using the software day-to-day, and other life priorities intervened (marriage and a job change). So I retired from JSPWiki.</p>

<p>More recently, I have indulged interests in two areas: mobile development — iOS in particular — and <a href="http://www.markerbench.com/blog/2013/01/17/phoenix/">Dev Ops</a>. In the mobile realm, I have been working on-and-off on an ambitious (too ambitious?) productivity app that will address a need that everyone has.</p>

<p>On Dev Ops, I have lately been fooling around with some of the build-automation and hosting frameworks. <a href="http:///www.heroku.com">Heroku</a> is my current preoccupation. It combines server-side build automation with hosting. What that means is that developers can write code in their language of choice using a Heroku-mandated directory structure and packaging specification. Developers check in their code to Heroku&rsquo;s servers using <a href="http://git-scm.com">Git</a>. When the code is checked in, Heroku packages the app based on the packaging document — called a <em>Procfile</em> — and deploys it in one or more web servers, depending on how much scalability the customer pays for. Heroku also offers a pre-configured private SQL database (Postgres), which developers can use for application data storage. As a bonus, Heroku offers a downloadable set of command-line utilities called <a href="https://toolbelt.heroku.com">Toolbelt</a> that allow the server-side environment to be simulated and tested on the client. Best of all, Heroku offers compute time on one server — which they call a <a href="https://devcenter.heroku.com/articles/dynos"><em>dyno</em></a> — more-or-less for free, assuming the cycles don&rsquo;t exceed a relatively generous threshold.</p>

<p>From the developer&rsquo;s perspective, Heroku is pretty great. Code is effortlessly deployed when it&rsquo;s checked in. One simply pushes the latest code to Heroku using the usual method — <code>git push heroku master</code>. Heroku&rsquo;s server-side hook detects the check-in, builds the deployment bundle (what Heroku calls a _slug) and deploys it on the dyno(s) in a few seconds. All of the most popular server-side development stacks are supported: <a href="https://devcenter.heroku.com/articles/intro-for-java-developers">JEE</a>, <a href="https://devcenter.heroku.com/articles/ruby-support">Ruby + Rails</a>, <a href="https://devcenter.heroku.com/articles/rack">Ruby + Sinatra</a>, <a href="https://devcenter.heroku.com/articles/play-support">Java + Play</a>, <a href="https://devcenter.heroku.com/articles/scala-support">Scala</a>, <a href="https://devcenter.heroku.com/articles/nodejs-support">Node.js</a>, <a href="https://devcenter.heroku.com/articles/clojure-support">Clojure</a>, <a href="https://devcenter.heroku.com/articles/python-support">Python + Django</a> and many more. There&rsquo;s a <a href="https://devcenter.heroku.com/categories/heroku-postgres">Postgres database in the cloud</a> that is pre-provisioned for each application and is just &ldquo;there&rdquo; waiting to be used. A <a href="https://addons.heroku.com">vibrant ecosystem</a> allows third parties to offer NoSQL, monitoring and other services. Server scaling is merely a question of pulling out a credit card and buying some more incremental compute cycles. The documentation is simple and clear. And Heroku&rsquo;s command-line Toolbelt tools make everything very, very easy and quick.</p>

<p>What it all means is that developers can create, deploy, test and use low-volume web applications without spending a dime. Other than typing a few initial Toolbelt commands, everything else is done using their everyday workhorse, Git. The infrastructure is completely abstracted so that pushing an app out to the Internet is as simple as typing the words <code>git push</code>.</p>

<p>All of which ought to be terrifying for security managers.</p>

<p>From the big picture perspective, Heroku represents a complete rethink, and outsourcing of, the entire application development stack. That it can all be done for free — at least, for the first hit — means that Heroku and providers that offer similar stacks (CloudBees, Joyent, Engine Yard) create a natural alternative to traditional IT for prototyping, experimentation, and possibly, deployment.</p>

<p>We can take this one step further. What Heroku and services like it means is that in the future, IT will remain relevant only if it can continue to engender respect with developers. If IT insists on being a roadblock — for example, if it can&rsquo;t or won&rsquo;t buy prototyping servers fast enough, imposes uninformed mandates about &ldquo;company standard&rdquo; frameworks, continues to require CVS (shudder) or SVN (wince) rather than Git, or breaks out in hives at the mention of this newfangled Hadoop thingy — it will create economic incentives for developers to look elsewhere. By &ldquo;IT&rdquo; I mean it as an aggregate entity — the architect rule-setters, security-gate-keepers and purse-string-holders that collectively and emergent-ly determine how applications are made and where they run.</p>

<p>In my next post, I&rsquo;ll offer some perspective on some of my experiments with the <a href="http://www.playframework.com">Play Framework</a>, a radical re-think of Java that offers a compelling alternative to traditional JEE applications. My occasional correspondent and Twitter friend <a href="http://www.jroller.com/robwilliams/category/Java">Rob Williams</a> turned me on to Play. It can be deployed quickly and simply on Heroku. I&rsquo;ll have some observations shortly.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[First Look at Stephen Few&rsquo;s &ldquo;Information Dashboard Design, Second Edition&rdquo;]]></title>
    <link href="http://www.markerbench.com/blog/2013/08/13/my-kind-of-cranky/"/>
    <updated>2013-08-13T23:01:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/08/13/my-kind-of-cranky</id>
    <content type="html"><![CDATA[<p>Twenty years ago, a polymath prophet named <a href="http://www.edwardtufte.com">Edward Tufte</a> self-published an incendiary book, <em><a href="http://www.amazon.com/Visual-Display-Quantitative-Information/dp/096139210X">The Visual Display of Quantitative Information</a></em>. It forever changed how a certain species of white-collar professional viewed the world. As a DNA-tested, confirmed member of the species <em>homo visualis</em>, I can tell you that his book, and successors such as <em><a href="http://www.amazon.com/Envisioning-Information-Edward-R-Tufte/dp/0961392118">Envisioning Information</a></em>, taught me how to create strong, effective statistical graphics. Tufte introduced the concepts of <em>chart junk,</em> the <em>data-to-ink ratio,</em> <em>small multiples</em> and <em>sparklines</em>. He argued forcefully and persuasively that designers of statistical graphics need not condescend to their audiences. And perhaps most important, he inspired a generation of authors, professionals and scientists — call them &ldquo;Tuftees&rdquo; — to strive for simplicity, clarity and honesty in their representations of data.</p>

<!-- more -->


<p>Indeed, in my book <em><a href="http://www.amazon.com/Security-Metrics-Replacing-Uncertainty-Doubt/dp/0321349989">Security Metrics: Replacing Fear, Uncertainty, and Doubt</a>,</em> I wrote an entire <a href="http://my.safaribooksonline.com/book/networking/security/9780321349989/visualization/ch06">40-page chapter</a> on how to graphically present security data. That chapter owes everything to Tufte. I mention my own book not out of a desire to gratuitously promote it (not that there&rsquo;s anything wrong with that), but because in the 2nd edition of Stephen Few&rsquo;s <em><a href="http://www.amazon.com/Information-Dashboard-Design-At---Glance/dp/1938377001/">Information Dashboard Design: Displaying Data for At-A-Glance Monitoring</a></em> I can sense exactly why and how Mr Few was driven to write his own book about visualization.</p>

<p>In my case, I felt compelled to summarize quickly everything I had learned about effective graphical techniques, because I wanted to help security professionals create exhibits that weren&rsquo;t awful. After I put fingers to keyboard to write the chapter, though, I found it hard to stop writing. No treatment of security metrics would be complete without an honest discussion of visualization techniques, and that took space and length to do well. Cranky about the state of graphical practice in my own industry, and lacking decent models to point others at, I decided to build some of my own, often imperfect, models. (<a href="http://my.safaribooksonline.com/book/networking/security/9780321349989/visualization/ch06"><em>Really cranky</em></a>, too: after re-reading chapter 6, it&rsquo;s a wonder Addison-Wesley let me publish the book at all!) In short, pissyness led to something productive.</p>

<p>You can smell the same faint alternating whiffs of frustration and hope in Mr Few&rsquo;s book, too. He&rsquo;s my kind of cranky. He&rsquo;s a Tuftee. The first half of the book, about 110 sparse pages, focuses on what <em>not</em> to do when designing dashboards. Dozens of examples of bad dashboards fill the first hundred pages. I can only imagine the nightmare of getting screenshot copyright clearances from the vendors whose products he made examples of.</p>

<p>But despite the sport he has with the screenshots, <em>Information Dashboard Design</em> also grounds practitioners in the basics. Few defines a <em>dashboard</em> as:</p>

<blockquote><p>…a visual display of the most important information needed to achieve one or more objectives, consolidated and arranged on a single screen so that the information can be monitored at a glance.</p></blockquote>

<p>That is nicely said. Building on this fundamental definition, the first half of the book covers these additional topics:</p>

<ol>
<li><strong>Clarifying the Vision</strong>: What is a dashboard? Why do we use them?</li>
<li><strong>Thirteen common mistakes in dashboard design</strong>: exactly what you&rsquo;d imagine; this is a regular rogues gallery</li>
<li><strong>Assessing what&rsquo;s needed</strong>: what people need when they see a dashboard</li>
<li><strong>Fundamental considerations</strong>: how frequency of use, screen sizes, and data types influence dashboard design</li>
<li><strong>Tapping into the power of visual perception</strong>: how we can use what we know about cognition to improve perception of dashboards</li>
<li><strong>Achieving eloquence through simplicity</strong>: A Tufte-inspired discussion of maximizing the data/ink ratio, and of getting rid of filler and unnecessary ornamentation</li>
<li><strong>Advantages of graphs</strong>: why pictures are worth a thousand words</li>
</ol>


<p>The remainder of the book covers putting theory into practice. I have not read these chapters yet, but am looking forward to them.</p>

<p>If you are a Tuftee, you won&rsquo;t find much in the first half of Mr Few&rsquo;s book that breaks new ground. At least, not as of 2013. But then again, in 2006, this book was a big deal. It was well-received, sold well enough to merit a second edition, and has been widely cited since.</p>

<p>I admire Mr Few very much for writing this book. I don&rsquo;t get the impression that he was a graphic designer by training. Nor does he appear to have an economics or statistics degree — indeed, I can&rsquo;t find a résumé or LinkedIn profile anywhere. And he&rsquo;s not a programmer. Not that any of that matters. Few is clearly a fanatic; he won&rsquo;t change his mind, and won&rsquo;t change the subject.</p>

<p>The principles in this book don&rsquo;t apply just to dashboards, however. Every business professional who creates <em>any</em> kind of chart or exhibit can benefit from this book. I can say that with a high level of confidence — and I haven&rsquo;t even gotten to the really good bits yet.</p>

<p>Stay tuned for my review of the second half of the book.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[TIA Panel: M2M and Cybersecurity: What does success as an industry look like?]]></title>
    <link href="http://www.markerbench.com/blog/2013/06/04/tia-m2m-talk/"/>
    <updated>2013-06-04T00:00:00-04:00</updated>
    <id>http://www.markerbench.com/blog/2013/06/04/tia-m2m-talk</id>
    <content type="html"><![CDATA[<p><em>This is the nominal text of panel remarks I delivered at the Telecommunications Industry Association&rsquo;s M2M &amp; Cybersecurity Workshop on June 4th, 2013. The objective of the panel was to discuss the following topic:</em></p>

<blockquote><p>Define a cohesive vision for a secure, reliable and economically viable machine network. What are the key objectives and what level of risk can be tolerated?</p></blockquote>

<p>Good afternoon. I am Andrew Jaquith, the CTO of SilverSky, a leading cloud security provider. It&rsquo;s great to talk to you today. You may not know SilverSky, so first, a little about us and our qualifications:</p>

<!-- more -->


<ul>
<li>SilverSky protects our customers&#8217; most important information. We manage customers&#8217; email and collaboration, secure their data with our security software, and monitor their infrastructure for compromises, all from our cloud.</li>
<li>We have 6000 customers, mostly in the private sector, including 1800 in the most risk averse and security sensitive industry there is: financial services
We filter 50 million emails a day, and analyze 425 million security events</li>
<li>We protect half a trillion in banking and financial assets</li>
<li>We have a growing presence in telecommunications and communications service providers. We partner with Cbeyond, Telepacific, NTT, Windstream and — thanks to an an acquisition we are announcing tomorrow — with XO and Peak10</li>
</ul>


<p>While we aren&rsquo;t a device maker or carrier ourselves, we see a large volume of network traffic and security events every day. We see a lot of activity and have an perspective of what&rsquo;s going on in the private sector.</p>

<p>Let&rsquo;s talk about machine-to-machine (M2M). M2M means any digital, network-protected device that is part of a larger system. The &ldquo;M&rdquo; in M2M means something with an IP address. Everything from ATM machines to smartphones to copiers to energy grid sensors to that networked refrigerator we&rsquo;ve all been predicting — at least, ever since MIT networked its soda machine in the early 1990s. I remember as a young pup around 1993 when Novell predicted that one day, there would be 1 billion network-connected devices. That prediction seemed audacious then; it is merely quaint now.</p>

<p>The &ldquo;2M&rdquo; part of M2M means that connected thing is a node in a larger network, and that the communications are only partially directed by a human. A consumer, for example, might own a mobile phone. They will surf the web, buy their kids gifts on Amazon, and play Words with Friends with, well, their friends. There&rsquo;s nothing about these activities that is different or more interesting than what we have seen on the PC. However, all of the supporting services underpinning the mobile experience — cellular data communications, background telemetry, push notifications, carrier updates — that is all M2M traffic. So are the networked soda machine replenishment signals, SCADA traffic, the cellular tower updates, etc. These are not initiated by humans; these are all machines talking to machines.</p>

<p>The reason we are all here: talking about security in M2M. We are here, I think, because so much of what we experience and take for granted every day relies on networking; that is, the &ldquo;2M&rdquo; part. Increasingly, all of that networking is under the covers, and not directly perceived or controlled by the consumer or end customer. It is of paramount importance, therefore, that we can trust the networks, devices, clouds and data that underpin the M2M economy. We need to trust the things that filter the water we drink, transmit the power we consume, and connect us to other people.</p>

<p>What is does success at securing M2M look like? With something as diverse as M2M, one cannot easily articulate a &ldquo;vision&rdquo; for security. There is no single &ldquo;system&rdquo; one can articulate a vision for. It&rsquo;s a &ldquo;system&rdquo; in the same way that health care is a system: fragmented, partly analog, few standards, and filled with many parties with competing interests.</p>

<p>But the need is clear. Risks abound across the system. A popular grey-hat security research project, for example, has released automated exploits for SCADA systems from Rockwell, GE, Schneider, Siemens and many others — making it relatively easy for attackers to weaponize and use on a large scale. Scary. And these are people who are supposed to be our friends. Then there are those who are not our friends: nation-states such as China, Russia and Iran, which have funded large offensive cyber-warfare teams. It is certain that M2M systems are on the target list.  Rounding out the list of threat actors includes the usual criminal gangs, unsavory hackers, miscreants, attention-seekers, pirates and — arguably the worst of the bunch — Mr Murphy (as in Murphy&rsquo;s Law).</p>

<p>So, defining a vision for M2M is arguably a fool&rsquo;s errand. That said, if I could suggest one big hairy audacious goal for M2M security, it would be this:</p>

<blockquote><p>The absence of surprise</p></blockquote>

<p>&ldquo;Surprise&rdquo; in the context of M2M means disrupted business, theft of service, successful attacks on critical infrastructure, civil unrest, loss of life or livelihood, theft of secrets or corrupted data. Drilling down a bit more, &ldquo;absence of surprise&rdquo; implies four other goals. It implies:</p>

<ul>
<li><em>Designing for failure</em>: having compensating processes for dealing with compromises</li>
<li><em>Designing for resilience</em>: making it possible to diagnose, upgrade in the field, and have robust functions in less-than-optimal environments</li>
<li><em>Eternal vigilance</em>: having a strategy for continuous monitoring; for incident handling, and for response activities (often neglected)</li>
<li><em>Risk management</em>: eyes-open knowledge of what adverse events are acceptable, and how frequently they can be tolerated</li>
</ul>


<p>Let me illustrate by example. Ten years ago I helped design of a security subsystem for some hardware devices due to be deployed by one of the most zealous and security conscious organizations around. This organization would do just about anything to ensures that their mission was achieved, that their devices were not compromised, and that they were as protected as possible from the threat posed by attackers. No, I&rsquo;m not talking about the military, the CIA, or the NSA. I&rsquo;m talking about cable TV.</p>

<p>The job was to design Comcast&rsquo;s next-generation conditional access system (called DCAS aka True Thru-Way). What was the goal? To design a bulletproof CAS that would securely deliver any programming of the customer&rsquo;s choice, so they could get anything they wanted <em>and</em> paid for. <em>But</em> — and this is important — not what they didn&rsquo;t pay for. Also: nobody else could get the programming without paying either. The system we designed had a three key features designed to advance this goal:</p>

<ul>
<li><em>Device integrity</em>: keep the device in a known state. This implied that we needed not just a way of keeping a set-top box (STB) from being tampered with, but a way of knowing when it was being tampered with.</li>
<li><em>Content protection</em>: require encryption between the cable network head end and the STBs. A strategy for hardening the box. Creating a cryptographic &ldquo;key ladder&rdquo; with long-lived session keys and ephemeral ones, so that compromising a more frequently used key meant a finite window of time for the compromise. We also needed &ldquo;secure elements&rdquo; on the box that would be &ldquo;personalized&rdquo; for each unit.</li>
<li><em>Device updates</em>: develop a way of revving the local STB firmware and updates. That implied having a &ldquo;root of trust&rdquo; derived from keys that were managed centrally. We know from watching the experiences of DirecTV (and today, Apple) with &ldquo;hackers&rdquo; that adversarial warfare with determined opponents makes defenders stronger.</li>
</ul>


<p>What this meant in our case: lots of crypto. Serious review and iteration. Willingness to learn through evolution. Knowing that you have to walk a fine line between between security robustness, flexibility, usability and ability to manage at scale in the field. Perhaps most important: all of the design decisions were informed by an acceptance by Comcast of exactly how hard it ought to be for a pirate to pop a box and get free TV. How hard should it really be, and what would the company tolerate? Also, Comcast defined which &ldquo;tail risks&rdquo; they wanted to avoid. That is, what does catastrophic failure look like? In this case, just for example, Comcast wanted to make sure that other than stealing the topmost root key — which was made very, very difficult — no mass compromise was possible; an attacker would have to go box-by-box.</p>

<p>This should give you an idea of what is required to build devices with high levels of security, where that security supports the business goal. For a more modern example, look at Apple&rsquo;s iPhone. That is a great example of fairly robust security and usability. Fifteen years ago, if I told you that you would see the rise of a consumer computing platform with over 500 million units deployed, where the entire platform includes trusted boot, mandatory access control, full device encryption, mandatory application screening, mandatory application signing from a central authority, a vibrant developer scene, and very little (essentially zero) malware, and one that doesn&rsquo;t drive customers batty — indeed is one heck of a pleasure to use — you&rsquo;d say I was nuts. But yet that&rsquo;s what we have. I don&rsquo;t advocate Apple&rsquo;s model <em>per se</em>. But it illustrates one way to try to accomplish many goals, and do them all well enough that the net risk to consumers is very low.</p>

<p>On the other side, look at what happened with Stuxnet. The attack was essentially via USB stick plus a stealthy worm that attacked Siemens SCADA systems used to control and monitor centrifuges for enriching uranium. This system runs a variant of Windows. Very few of the ideal security characteristics one would like to see in a robust, secure embedded operations system were in place in this case. (Arguably in the case of Stuxnet this was a feature rather than a bug.)</p>

<p>My wish for the industries that are involved in M2M, looping back to my original comment, is that we design collectively and individually for the absence of surprise. Any surprises you get should be those you expect&hellip; And then, of course, they aren&rsquo;t surprises. They fall into the category of what Donald Rumsfeld memorably called &ldquo;known unknowns.&rdquo; Our eyes are wide open, based on enlightened economic self interest. In addition, I would hope that have enough eyes wide open that many of the &ldquo;unknown unknowns&rdquo; are imagined as well.</p>

<p>That won&rsquo;t be good enough in all cases, though. In closing, we will need to consider incentives to swing the calculus to align economic self interest with good security outcomes. Speaking as a trained economist who works in the security field (and who programs to relax), almost all security failures are rooted in perverse economic incentives. Our goal ought to be to align incentives so we get better outcomes. In my view, everything should be on the table: software security liability for manufacturers, legal shielding for sharing of security data and incidents, promotion of industry standards and inclusion of these standards in purchasing guidelines, and, in cases where the risks demand it, regulation or legislation.</p>

<p>If we do all of these things, we will have successfully used our collective imaginations to identify, reduce, or willingly accept the M2M risks we face, both today and in the future.</p>

<p>Thanks very much for listening.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[&ldquo;Everything was green. Mulally thought that was odd for a company losing billions.&rdquo;]]></title>
    <link href="http://www.markerbench.com/blog/2013/02/21/Mulally-leadership/"/>
    <updated>2013-02-21T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/02/21/Mulally-leadership</id>
    <content type="html"><![CDATA[<p>I have been a fan of the Ford Motor Company ever since I was a boy. There&rsquo;s no rational reason for it, but then again, experts tell us that brand preferences are formed at very early ages. Somewhere around the age of 10 or so I decided I liked Ford cars. My first car after college was a 1993 Ford Taurus, which I later gave to my sister when I moved overseas. My second car was a 1998 Ford Contour. I changed to a nice little Honda Civic five years ago; at the time, the domestics weren&rsquo;t looking so great. But I still have a certain patriotic wistfulness about Fords, and probably always will have. For this reason, I&rsquo;ve been watching Ford&rsquo;s recovery with interest.</p>

<!-- more -->


<p>Most people know that Ford didn&rsquo;t take a dime in government money during the Great Recession. It was the only one of the Big Three automakers that did not. Much of the credit for this belongs to Alan Mulally, the CEO of Ford. He made the gutsy and prescient decision to take out a $23 billion loan two years before the recession hit. He used absolutely everything as collateral to get it, including the iconic blue oval logo. Since that time, Ford sold off its troubled and de-focusing Jaguar, Volvo and Aston-Martin luxury brands, built a terrific new line of fuel-efficient cars, whittled the number of cars &ldquo;platforms&rdquo; it used globally down to just a few, and steadily increased its car quality.</p>

<p>Ford&rsquo;s near-death experience &mdash; and subsequent rejuvenation &mdash; have been the subject of many case studies. A good short one, and the impetus for this post, is <a href="http://www.bus.umich.edu/NewsRoom/ArticleDisplay.asp?news_id=25318">&ldquo;An Insider&rsquo;s View of the Ford Story&rdquo;</a> from the Ross School of Business at the University of Michigan. In it, Ford COO Mark Fields tells a wonderful anecdote that most of us can relate to:</p>

<blockquote><p>At a weekly business status meeting early in Mulally&rsquo;s tenure, charts from top executives didn&rsquo;t indicate the company was in any trouble. Ford uses a color code for topics — green for good, yellow for a potential issue, red for a problem — and everything was green. Mulally thought that odd for a company losing billions.</p>

<p>Meanwhile Fields, then president of the Americas, had an issue with a product launch that year. The new Edge had a liftgate problem that threatened to delay its critical debut.</p>

<p>&ldquo;I said, &lsquo;Code it red,&rsquo; and they said, &lsquo;Are you sure you want to do that?&rsquo;,&rdquo; Fields said. &ldquo;I said, &lsquo;This is what Alan wants. Let&rsquo;s go for it.&rsquo;&rdquo;</p>

<p>Finally it was Fields&#8217; turn — Edge launch: bright red. &ldquo;I could feel the chairs move away from the table,&rdquo; said Fields. &ldquo;I said we have a problem, and I&rsquo;d love to have help from manufacturing and quality to help resolve it. Alan turns to me and starts clapping. The next week, everybody&rsquo;s chart was like a rainbow.</p></blockquote>

<p>By all accounts, Alan Mulally is a no-BS guy who does not fear hearing bad news. Indeed, everything I&rsquo;ve read suggests that he <a href="http://money.cnn.com/2009/05/11/news/companies/mulally_ford.fortune/">encourages his staff to bring problems to the surface</a> so that they can be discussed dispassionately and dealt with. Crucially, he encourages his team to do this without finger-pointing. At Ford, this has helped break through the factionalism that had traditionally plagued the company. As Fields puts it, &ldquo;Working together has been so crucial for us to get through a very difficult time and work through our issues on our own.&rdquo;</p>

<p>As described in an older CNN Money story, establishing trust and a culture of openness was a big change. But there&rsquo;s no doubt that the <a href="http://money.cnn.com/2009/05/11/news/companies/mulally_ford.fortune/">ultimate referee is Mulally</a>:</p>

<blockquote><p>There are no pre-meetings or briefing books. &ldquo;They don&rsquo;t bring their big books anymore because I&rsquo;m not going to grind them with as many questions as I can to humiliate them,&rdquo; Mulally says. &ldquo;We&rsquo;ll see them next week. We don&rsquo;t take action &ndash; I&rsquo;m going to see you next week.&rdquo; No BlackBerrys are allowed, and no side conversations either &ndash; Mulally is insistent about that. &ldquo;If somebody starts to talk or they don&rsquo;t respect each other, the meeting just stops. They know I&rsquo;ve removed vice presidents because they couldn&rsquo;t stop talking because they thought they were so damn important.&rdquo;</p></blockquote>

<p>Ford&rsquo;s success isn&rsquo;t solely due to the leadership qualities of the CEO, of course. Building better quality cars, after all, is the point of the whole exercise. That, the company has done well. But I love this story because it shows how setting the &ldquo;tone at the top&rdquo; matters, and that having a positive culture of problem-solving can (literally) <a href="http://www.cbsnews.com/8301-34227_162-57563380/fords-souped-up-dividend-could-lure-new-investors/">pay dividends</a> all around.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Bully for BlackBerry. But Is It Too Late?]]></title>
    <link href="http://www.markerbench.com/blog/2013/02/15/Bully-for-BlackBerry/"/>
    <updated>2013-02-15T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/02/15/Bully-for-BlackBerry</id>
    <content type="html"><![CDATA[<p>Last week Research In Motion <a href="http://www.theverge.com/2013/1/30/3932568/blackberry-10-event-rim-rebrands-the-q10-z10-and-everything-you-need">announced three things</a>:</p>

<ul>
<li>It had renamed itself to BlackBerry</li>
<li>It would soon ship two new BlackBerry 10-compatible devices, the Q10 (with keyboard) and Z10 (touchscreen only)</li>
<li>It had shipped the new BlackBerry Enterprise Service, version 10</li>
</ul>


<p>These three announcements, taken together, signaled the end of a long period of frustration for customers, employees and shareholders. After a wait of nearly three years, BlackBerry, indeed, delivered the goods. Reviewers of the Q10 and Z10 have generally been impressed; these are solid handsets. <a href="http://www.pcmag.com/article2/0,2817,2414752,00.asp">Ditto for the BlackBerry 10 operating system</a>. BlackBerry Enterprise Service 10 <a href="http://docs.blackberry.com/en/admin/deliverables/48906/Introducing_BlackBerry_Enterprise_Service_10-en.pdf">includes updated software</a> updated for managing BlackBerry 10 devices and PlayBooks (the BlackBerry Device Service); a new bundled, reskinned, version of the Ubitexx MDM software it acquired in 2011 for managing iOS and Android devices (now called the Universal Device Service); and, an updated version of the server software for routing data to older BlackBerry devices using the &ldquo;classic&rdquo; BlackBerry network infrastructure (BlackBerry Enterprise Server). BES 10 also includes an updated version of BlackBerry Enterprise Server Express (aka &ldquo;the cheap one&rdquo;) for customers who don&rsquo;t need all of the power and complexity that the non-Express version offers.</p>

<p>At least one reviewer intoned that with its new offerings, enterprises now had a <a href="http://www.zdnet.com/blackberry-10-is-the-first-blackberry-to-fully-support-byod-7000010717/">true BlackBerry BYOD (bring-your-own-device) solution</a>. It seems that the wait may have been worth it.</p>

<p>Left unanswered, though, is the existential question of whether it matters.</p>

<!-- more -->


<p>Recitation of the facts make for lamentable reading. The company&rsquo;s share of new handset sales in North America was just under <a href="http://bgr.com/2013/02/14/android-ios-combined-market-share-327356/">3% for the most recent quarter</a>, down from 35% just five years ago. Apple came out of nowhere to become the US&#8217; biggest handset maker, something BlackBerry had no answer for. The Android juggernaut, led by Samsung, seems poised to take most of the rest of the market, leaving BlackBerry and Microsoft-aligned handset makers such as Nokia to fight for the scraps. As reported by Asymco&rsquo;s inimitable Horace Dediu, Apple and Samsung <a href="http://bgr.com/2013/02/08/apple-samsung-mobile-profit-graph-322405/">together accounted for 103% of the smartphone industry&rsquo;s profits</a> &mdash; a number greater than 100% because competitors (RIM and others) lost money. The question isn&rsquo;t so much whether BlackBerry will suddenly exit the market &mdash; partial annuity business are nearly impossible to kill. The question is, can it continue to make products that it can sell at a profit?</p>

<p>The path to profitability starts with great products, which in ideal circumstances lead to a virtuous cycle of desire, demand, scale, continued cost decreases and increased pricing power. That assumes that the company executes well. It hasn&rsquo;t in the past. The PlayBook, for example, contained the germ of a good idea but didn&rsquo;t take root with buyers for lots of reasons. Among them, an asinine and insulting advertising campaign that failed to ignite interest. (Alternatively: &ldquo;We&rsquo;re the only tablet that delivers the <em>whole Internet</em> because we have Adobe Flash!&rdquo; and, &ldquo;Amateur Hour is Over,&rdquo;). The PlayBook also initially omitted key features, such as the ability to do on its own the thing that BlackBerry customers prized most: get email.</p>

<p>BlackBerry also stubbornly clung to the idea that it needed to be a network provider, years after TCP/IP over cellular had become commonplace. What was once a compelling competitive advantage has turned into disadvantage: an extra cost for customers to bear, and a single point of failure. For context, see something I wrote on the Forrester analyst blog <a href="http://blogs.forrester.com/andrew_jaquith/10-08-05-putting_rim's_%22security%22_challenges_perspective">three years ago</a>:</p>

<blockquote><p>The BlackBerry was introduced in 1999 as a two-way pager on steroids. Back then, TCP/IP over GSM (and other wireless networks) was just a pipe dream. RIM implemented a system by which all traffic is collected from the mobile networks of the sender, funneled through RIM servers and then routed back onto the recipient’s mobile networks and pushed to the handset. In essence, RIM &mdash; rather than the Interwebs &mdash; provided the routing capabilities needed to ensure that mail and messages are delivered. That was necessary, and worked well, when Internet data plans were not universally available. It gave BlackBerry instant push e-mail and guaranteed delivery. And critically, it was a competitive advantage that no other wireless vendor had.</p></blockquote>

<p>And then, last year, in the wake of the pervasive RIM network outages that swept the globe, I <a href="https://silversky.com/blog/blackberry-outages-highlight-rims-central-point-failure">noted the following</a> on the SilverSky (<em>nee</em> Perimeter E-Security) blog:</p>

<blockquote><p>Data plans that provide TCP/IP over wireless carrier networks are now ubiquitous, nullifying a key RIM advantage. Moreover, push email protocols such as ActiveSync are licensed by the two Post-PC device leaders, Apple and Google. ActiveSync isn&rsquo;t as good as BlackBerry push email, but it is good enough for most businesses. But in spite of the ubiquity of TCP/IP-over-wireless, RIM continues to do its own thing. Essentially, when you choose BlackBerry, you are making a bet that RIM&rsquo;s reliability will be better than that of your wireless carrier&rsquo;s data service. That might have been a safe assumption five years ago, but [with the recent outages] it isn&rsquo;t any longer.</p></blockquote>

<p>Fast-forward to last week&rsquo;s announcements. BlackBerry has directly addressed the network issue with the new handsets in two ways. First, to BlackBerry&rsquo;s great credit, they are allowing the new Q10 and Z10 devices to get email, calendars and contacts over ActiveSync, using regular carrier data networks. Even better, the BES management server appears to be able to communicate with BB 10-compatible handsets over the carrier data networks, too. In short: BlackBerry has signaled its intent to make the classic RIM data service &mdash; yesterday&rsquo;s network &mdash; optional. The company has not played this up, for obvious reasons. But it&rsquo;s a big win for customers. I&rsquo;ve already gotten inquiries from several SilverSky customers who want to scrap their expensive data plans and use the new devices in ActiveSync-only configurations.</p>

<p>This sounds like good news, but is it too good to be true? Some early reviews suggest that BlackBerry&rsquo;s ActiveSync <a href="http://www.pcmag.com/article2/0,2817,2414752,00.asp">feature support isn&rsquo;t complete</a>, with one reviewer finding himself unable to inviting people to meetings, for example. On the CrackBerry boards, many confused addicts <a href="http://crackberry.com/no-you-dont-need-bis-plan-blackberry-10-phones">can&rsquo;t figure out</a> whether a separate data plan really is needed for devices that are managed by BES. BlackBerry&rsquo;s website and documents are <a href="http://docs.blackberry.com/en/admin/deliverables/48906/Introducing_BlackBerry_Enterprise_Service_10-en.pdf">maddeningly vague</a>.</p>

<p>Worse, BlackBerry&rsquo;s three administration components &mdash; BlackBerry Device Service, Universal Device Service, and BlackBerry Enterprise Server &mdash; are not well integrated. Well, they are &ldquo;integrated&rdquo; in the sense that the are all part of the &ldquo;BlackBerry Enterprise Service&rdquo; 10 family, and some user interface elements are shared. But administrators must read three different manuals. There&rsquo;s also components called BlackBerry Management Studio, BlackBerry Mobile Fusion Studio and BlackBerry Enterprise Server Express, which have their own interfaces as well. Confused? Old-hand BES-heads probably aren&rsquo;t. But suppose you are an enterprise CIO who considering, or has already purchased, a product from an MDM <em>arriviste</em> such as MobileIron, AirWatch of FiberLink. Would you &ldquo;leap backwards&rdquo; and consolidate everything with BlackBerry&rsquo;s new services? You might, or you might decide that the company&rsquo;s management tools still aren&rsquo;t ready. Compared to the seductive &ldquo;one-console, one-policy, all-device&rdquo; visions that the <em>arrivistes</em> are painting, BlackBerry&rsquo;s looks complex and parochial by comparison. Why suffer through Jackson Pollock when you can run away with a Renoir?</p>

<p>BlackBerry, then, has five challenges as I see it. It must:</p>

<ul>
<li><strong>Stanch the bleeding in its traditional customer base</strong>. The new Q10 and Z10 handsets and BB 10 operating system should ensure that wavering customers give the new products a long look. That&rsquo;s step one. Continuing to keep up a rapid cadence  for operating system upgrades, third party app availability and new handset models: that is step two. Step three will be convert existing customers as quickly as possible to the new operating system and server software, locking them in for another few product cycles.</li>
<li><strong>Eliminate any perceived or actual dependencies on the classic RIM network</strong>. BlackBerry needs to show customers that the traditional RIM routing and transport service isn&rsquo;t needed any more, and that it has fully embraced ActiveSync as an alternative mail protocol. It must do this to eliminate the notion that its products are expensive to operate in addition to stodgy (although the &ldquo;stodgy&rdquo; perception will be lessened by the new handsets). This will necessarily reduce network and BES revenues but will increase sales of handsets. It is, in effect, a form of cannibalization. BlackBerry executives need to adopt the same attitude the late Steve Jobs did when explaining to shareholders why Apple didn&rsquo;t fear the prospect of iPads cannibalizing Mac revenues: &ldquo;<a href="http://www.businessinsider.com/best-steve-jobs-quotes-from-biography-2011-10?op=1">if you don&rsquo;t cannibalize yourself, someone else will</a>.&rdquo;</li>
<li><strong>Offer a compelling, unified alternative to MDM products</strong>. MDM vendors offer the promise of being able to define a single IT policy once, and apply it across all devices regardless of make or model. The reality is different, though;  industry&rsquo;s dirty secret is that most of the MDM products are focused almost exclusively on ActiveSync platforms, and iOS in particular. BlackBerry management features are usually <a href="http://www.maas360.com/products/mobile-device-management/blackberry/">paper-thin</a>. That is partly because BlackBerry doesn&rsquo;t offer good APIs, and partly because customers need help most with ActiveSync; the BlackBerrys they have are company-owned and well-managed. With focus, BlackBerry could offer a first-class management experience across all device types. But &mdash; and this is important &mdash; ActiveSync support can&rsquo;t be half-assed.</li>
<li><strong>Offer &ldquo;something more&rdquo; to CIOs</strong>. The preceding three recommendations will at best stabilize BlackBerry&rsquo;s declining share of the enterprise mobility market. To grow it robustly, the company needs to offer something other handset makers and MDM vendors can&rsquo;t. Some suggestions: (1) extend the &ldquo;Balance&rdquo; data labeling technology to iOS and Android; (2) introduce a bulletproof proxy platform that does for ActiveSync what BES did for RIM devices and what Blue Coat did for web security (think: attachment management and stripping; bandwidth management; content inspection; time and location controls; APIs third parties can use, etc); (3) unveil a cross-device, encrypted mobile cloud backup and sharing network (think: a more secure iCloud + DropBox on steroids). These might not be the right sorts of &ldquo;something more&rdquo;; but regardless, the focus should be on differentiating versus handset makers and MDM vendors.</li>
<li><strong>Attract consumers again</strong>. Although BlackBerry likes to talk about its success in developing markets (<a href="http://www.economist.com/news/business/21567977-its-devices-are-still-popular-there-africa-wont-save-rim-blackberry-babes">Exhibit A: Nigeria</a>), substantial revenue growth won&rsquo;t come unless it can succeed in developed markets. Consumers, which substantially outnumber business customers, are the key. BlackBerry could do many things to increase its consumer share, ranging from incremental to radical. The most radical step would be ride the coattails of a consumer-friendly OS by shifting platforms yet again, to Android &mdash; or better &mdash; to Windows Phone. Less radical steps include building products that target demanding &ldquo;prosumer&rdquo; segments such as photography, design or programming; bribing popular app makers to develop to BlackBerry first; or… well, I&rsquo;m at a bit of a loss here. BlackBerry will never be cool. But being seen as &ldquo;reliable,&rdquo; &ldquo;fast&rdquo; and &ldquo;trustworthy&rdquo; might be enough.</li>
</ul>


<p>BlackBerry must do most &mdash; say, four out of five &mdash; of these things well in order to grow again. If the company does not, it will continue to shrink, slowly ceding shelf space to Apple and Samsung. It must make BlackBerry executives crazy to think that enterprises are willing to grapple with consumer-grade devices instead of soldiering on with their trusty, secure BlackBerrys. It must make them crazier still to know that they must put to pasture one their finest inventions, the RIM network. And yet, that is the world we live in. One where &ldquo;good-enough&rdquo; security and management has beaten great, where TCP/IP-over-cellular has supplanted proprietary networks, and where the black-and-white of company-owned has been replaced by the gray of BYOD.</p>

<p>It is late in the day for BlackBerry. It&rsquo;s not too late, however, for the company to pull more rabbits out of its toque. I hope it will.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Four Things To Like About Obama's Executive Order on Cyber-Security... and Four to Dislike]]></title>
    <link href="http://www.markerbench.com/blog/2013/02/14/SOTU/"/>
    <updated>2013-02-14T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/02/14/SOTU</id>
    <content type="html"><![CDATA[<p>During his <a href="http://www.whitehouse.gov/blog/2013/02/13/president-obamas-2013-state-union">State of the Union Address</a> on Tuesday night, President Obama announced an Executive Order on Cyber-Security. The full text is available in many places, including <a href="http://www.wired.com/images_blogs/threatlevel/2013/02/Presidents-Cybersecurity-Executive-Order.pdf">Wired</a>. I&rsquo;d urge you to read it in full; it is short and well-written, as you might expect anything coming from this president (or his staff) to be.</p>

<!-- more -->


<p>The Order directs DHS to notify private companies in &ldquo;critical infrastructure&rdquo; sectors of any impending attacks by extending the Enhanced CyberSecurity Services program. To promote greater information-sharing, the Order provides a &ldquo;safe harbor&rdquo; to companies that share information with DHS. It directs the National Institute for Standards and Technology (<a href="http://www.nist.gov/index.html">NIST</a>) to create a new &ldquo;Cyber-Security Framework&rdquo; to reduce risk in critical industries. And to evaluate the success of the program, the Order includes a series of regularly recurring opportunities to review and recommend new actions to take.</p>

<p>Understand that the President signed the Order because of lack of a Congressional alternative. Last year&rsquo;s two dueling cyber-security bills died in session due to partisan wrangling. Republican senator John McCain objected to the initial bipartisan proposal, the CyberSecurity Act, because <a href="http://www.cio.com/article/700382/McCain_GOP_Vow_Alternative_Cybersecurity_Bill">of the idea that government has a role to play in setting standards</a>, which it clearly does. McCains&rsquo;s alternative bill, the SECURE IT Act, preserved the CyberSecurity Act&rsquo;s focus on information-sharing but watered down any additional regulatory oversight. The Order more closely resembles the McCain bill, if only by the necessity that the Order cannot ask agencies to do anything beyond what existing laws allow.</p>

<p>I reviewed the Executive Order and found a lot to like in it. But it&rsquo;s lacking in important ways, too. Here&rsquo;s what I liked:</p>

<ul>
<li><strong>The scope of the proposed Cyber-Security Framework is comprehensive</strong>. The Framework will ostensibly &ldquo;help owners and operators of critical infrastructure to identify, assess and manage cyber risk.&rdquo; It will identify areas of improvement that can be addressed by the private sector, identify methods for reducing risk, and will recommend ways that companies can measure their success at implementing their programs. This is good. Critical infrastructure companies, particularly those in comparative security backwaters like utilities, need all of the help they can get.</li>
<li><strong>Materials shared by private sector are shielded from discovery</strong>. Section 5c of the order states that &ldquo;Information submitted voluntarily in accordance with
<a href="http://www.law.cornell.edu/uscode/text/6/133">6 U.S.C. 133</a> by private entities under this order shall be protected from disclosure to the fullest extent permitted by law.&rdquo; What that means is that any information shared with the government can&rsquo;t be obtained under a FOIA request, for example. The information could still be discovered in a private suit.</li>
<li><strong>NIST&rsquo;s Cyber-Security Framework will incorporate industry standards</strong>. I have a lot of respect for the work NIST does. I know and have worked with many people in the agency. NIST also regularly collaborates with outside organizations such as the Center for Internet Security (CIS) and SANS. These groups are doing good work as clearing-houses for effective practices. It&rsquo;s good to see the President explicitly ask NIST to &ldquo;incorporate voluntary consensus standards and industry best practices to the fullest extent possible.&rdquo;</li>
<li><strong>The Order offers wiggle-room to define what industries are &ldquo;critical</strong>.&rdquo; The specific sectors covered by the Order are not mentioned in the text, but the scope defines critical infrastructure as &ldquo;systems and assets, whether physical or virtual, so vital to the United States that the incapacity or destruction of such systems and assets would have a debilitating impact on security, national economic security, [or] national public health or safety.&rdquo; One can easily imagine that the critical sectors are likely to include energy, utilities, and financial services. But transportation, pharma, and the defense-industrial base would qualify, too, depending on the how the President and his advisors see things. We&rsquo;ll see how this evolves, but having flexibility here is important.</li>
</ul>


<p>The President&rsquo;s Cyber-Security Order is important because it puts an important stake in the ground in the absence of legislation. It recommends many important and fine things that we need more of, notably information sharing. But the Order also disappoints because it misses opportunities to do more. Some shortcomings are due to natural limits imposed on the Executive branch. The President cannot propose new regulation, for example. Others are failures of vision. Here are the four problem areas I see:</p>

<ul>
<li><strong>Participation by private companies is voluntary</strong>. The Order directs DHS to initiate an information-sharing program with industry to give them advance warning of attacks, and to obtain relevant information from target companies. The Order also asks DHS to create &ldquo;incentives designed to promote participation&rdquo; in the program and to analyze whether those incentives have been effective. That sounds like a tacit admission that they won&rsquo;t be effective. To be fair to the President, he has no power under existing laws to compel participation; by definition, he must rely on incentives, persuasion, and motherhood-and-apple-pie instincts. Come to think of it, maybe he should send private sector CEOs… <em>apple pies</em>. Until legislation is passed that mandates participation, apple pies might be the best he can do.</li>
<li><strong>Private companies that might have security insights aren&rsquo;t included</strong>. Many large security companies have a significant amount of operational visibility into the day-to-day risks and attacks in critical infrastructure sectors. These include managed security services provides such as Symantec, IBM/ISS, Verizon, Dell SecureWorks and my company. They also include software and security companies that underpin large parts of the &ldquo;trust infrastructure&rdquo; that we all rely on, companies like RSA Security, Symantec (<em>née</em> VeriSign), Microsoft and Apple. Although one could file this in the &ldquo;be careful what you wish for&rdquo; category, it would seem odd that companies that control the keys to the many critical infrastructure kingdoms, or have visibility about what goes in or out of them, would not be in scope.</li>
<li><strong>Wrong-headed emphasis on technology neutrality</strong>. The Order takes pains to emphasize that any guidance issued by NIST should be technology-neutral so that companies can &ldquo;benefit from a competitive market for products and services.&rdquo; Never mind that this sentence makes no sense. The whole sentiment seems wrong to me, because cyber-security is one area where government <em>should</em> make specific recommendations about technologies. It is a fact that some technologies are better and safer choices than others. Divorcing the guidance from the technology turns NIST&rsquo;s efforts into a big &ldquo;process&rdquo; exercise. Process is good, but fixing things is better. All the guidance in the world isn&rsquo;t going to stop your wide-open Windows NT 3.5 SCADA systems from being owned if they haven&rsquo;t been patched since 1995. I don&rsquo;t want NIST to &ldquo;name and shame&rdquo; or &ldquo;pick winners and losers,&rdquo; but it should be prescriptive where possible. That&rsquo;s not a technology-neutral activity.</li>
<li><strong>The framework will take too long to develop</strong>. NIST won&rsquo;t finish its draft Cyber-Security Framework until mid-October. The final framework won&rsquo;t come until February 2014. NIST offers <a href="http://csrc.nist.gov/publications/PubsSPs.html">plenty of vendor-neutral, technology-neutral guidance already</a>, covering everything from risk assessment to metrics. It seems to me that existing materials could be easily re-packaged for critical industries without much effort. Let&rsquo;s hope the dates are sandbagged, and that we will see drafts sooner than October.</li>
</ul>


<p>Overall, though, President Executive Order for Improving Critical Infrastructure Cyber-Security is an important step forward. Let&rsquo;s hope it prods Congress into passing something more permanent, prescriptive, and durable, with the regulatory powers DHS needs to get the job done.</p>

<p><em>Note: this article also appears <a href="https://silversky.com/blog/four-things-to-like-about-obamas-executive-order-on-cyber-security-and-four-to-dislike">on my company blog</a> at silversky.com.</em></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Moving securitymetrics.org to Octopress]]></title>
    <link href="http://www.markerbench.com/blog/2013/02/04/Moving-Securitymetrics/"/>
    <updated>2013-02-04T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/02/04/Moving-Securitymetrics</id>
    <content type="html"><![CDATA[<p>Soon, I will be moving the securitymetrics.org website to a simpler, secure and more usable system &mdash; the same platform that powers Markerbench. It should be done in time for Mini-Metricon (March 1st, 2013).</p>

<!-- more -->


<p>Some background. When I started <a href="http://www.securitymetrics.org">securitymetrics.org</a> in 2004 with Dan Geer and Kevin Soo Hoo, I had visions of making a cool, collaborative website for it. I liked the &ldquo;wiki&rdquo; philosophy (simple markup, text-based) and thought it would work well as a lightweight collaboration platform. I was, at the time, the co-author/co-architect of <a href="http://incubator.apache.org/jspwiki/">JSPWiki</a>, an open source JEE-based wiki package. Because it contained a lot of my code, went the reasoning, I&rsquo;d know just whose throat to choke when things went wrong. I could customize the server in all sorts of ways when I wanted to. And as a side benefit, I&rsquo;d get to demonstrate my mad enterprise skillz by using JSPWiki&rsquo;s four-tier architecture (client, web server, app server, database). That was the theory.</p>

<p>But a few things happened between 2004 and now:</p>

<ul>
<li>Competing content-management systems &mdash; like Wordpress and Drupal &mdash; got better and better. With bigger dev teams came more features. The wiki software hasn&rsquo;t kept pace &mdash; no social integration, for example.</li>
<li>Spammers overran my wiki self-registation system. As a result, I was forced to disable additional registrations, rendering securitymetrics.org not very collaborative at all.</li>
<li>I discovered I hated maintaining and upgrading that four-tier architecture I had been so proud of.</li>
<li>The wiki server&rsquo;s memory leaks meant it needed monthly reboots &mdash; if I remembered. If I didn&rsquo;t, it meant lots of downtime.</li>
<li>The threat environment got a lot nastier, leaving me leery of running ANY kind of content management server, never mind a wiki server.</li>
<li>I got married. No explanation needed here, I suspect.</li>
</ul>


<p>It has been clear for a while that securitymetrics.org needed something better. Something simpler, more secure and (preferably) social. After a long period of on-and-off searching, I found something pretty close to ideal: <a href="http://octopress.org">Octopress</a>.</p>

<p>As I&rsquo;ve written before, Octopress is a <a href="http://www.markerbench.com/blog/2013/01/08/static-blogging/">static website generator</a>; it is derived from Jekyll. You can think of it as a website &ldquo;compiler.&rdquo; You feed it text files, and it emits lovely HTML, CSS and JavaScript with all of the modern goodies built-in: discussion threads and comments via Discus, social integration via Twitter, Google and Facebook &ldquo;like&rdquo; buttons, search via Google Simple Site Search, and site traffic analysis via Google Analytics. The best part is that all of the components are 100% static. There are no application servers, no databases, no users; and, no user input accepted or stored. All of the dynamic behaviors result from loading up various bits of client-side JavaScript to invoke other people&rsquo;s stuff. That makes the attack surface pretty close to zero. And, because everything is static, all that static stuff can be WAN-accelerated until it screams, and stored just about anywhere (Amazon S3, GitHub Pages, Heroku) without worry.</p>

<p>What does this mean for securitymetrics.org?</p>

<ul>
<li>We will switch over to the new site at or around Mini-Metricon on March 1st.</li>
<li>The new website will be better looking and much better organized. I&rsquo;ve edited and re-organized ALL of the Metricon content, for example, while I was at it.</li>
<li>I will be the sole &ldquo;publisher&rdquo; of the website, at least for the time being, but welcome all collaborators.</li>
<li>We will have a new workflow for people who want to write on the securitymetrics blog. It will involve Markdown and DropBox.</li>
<li>After Mini-Metricon I will probably move the mailing list to a new, faster, provider (first things first: website, then listserv)</li>
</ul>


<p>For those of you who will be attending Mini-Metricon, I am looking forward to showing you the new site.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[All Andy's Posts Now on Markerbench]]></title>
    <link href="http://www.markerbench.com/blog/2013/01/29/All-Posts-On-Markerbench/"/>
    <updated>2013-01-29T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/01/29/All-Posts-On-Markerbench</id>
    <content type="html"><![CDATA[<p>As part of a continuing experiment with static blogging, I have moved all of my historical blog posts from <a href="http://www.securitymetrics.org">securitymetrics.org</a> to Markerbench.com. Everything is now here, including the somewhat notorious essay <a href="http://www.markerbench.com/blog/2005/05/04/Escaping-the-Hamster-Wheel-of-Pain/">Escaping the Hamster Wheel of Pain</a>, which introduced a certain rodent-related metaphor to the security trade and served as the introduction to my book, <a href="http://www.amazon.com/Security-Metrics-Replacing-Uncertainty-Doubt/dp/0321349989">&ldquo;Security Metrics: Replacing Fear, Uncertainty and Doubt&rdquo;</a>.</p>

<p>For the curious, here&rsquo;s some background on why I moved everything here:</p>

<!-- more -->


<p>The securitymetrics.org site has for many years been running on <a href="http://incubator.apache.org/jspwiki/">JSPWiki</a>, a Java Enterprise Edition (JEE) application that uses &ldquo;wiki text&rdquo; as a markup language. It has served me well, and I am proud to have been one of the platform&rsquo;s primary authors. However, my (older) deployed version of JSPWiki has suffered from a slow memory leak that has required me to restart the web app container about once per month. I have also had to disable site registration and commenting features, due to the lack of a reasonably-bulletproof spam filtering system. That meant that securitymetrics.org had become essentially a static website. So, why go to the trouble and expense of hosting it on a complex web app server? Now that I&rsquo;ve gotten the hang of <a href="http://octopress.org">Octopress</a>, a Jekyll-based static web publishing system, the time was right to make the move to a much simpler alternative. And because I had used securitymetrics.org as a personal blog, it seemed like a good idea to move all of the bloggish-type posts here.</p>

<p>Moving everything to Octopress means that I now write in Markdown, John Gruber&rsquo;s <a href="http://daringfireball.net/projects/markdown/">elegant markup language</a>. Among other things, that gives me the ability to use my preferred writing application, <a href="http://www.iawriter.com">iAWriter</a> &mdash; a beautiful writer&rsquo;s tool that synchronizes with iCloud and hence, with all my devices. Markdown is a simpler markup language than wiki text; similar in many respects but with some key differences:</p>

<ul>
<li><strong>Headings</strong>: in Markdown, you create a new heading this way: <code>#</code> (Heading 1), <code>##</code> (Heading 2), etc whereas in wiki text you use are <code>!!!</code>, <code>!!</code>, and <code>!</code> respectively. I find the Markdown syntax a little more economical.</li>
<li><strong>Emphasis</strong>: in Markdown, you emphasis text by surrounding it with <code>_</code> (for <em>italics</em>) and <code>__</code> (for <strong>bold</strong>). In wiki text you use <code>''</code> for italics and <code>_</code> for bold. Not a big difference, but logically, it makes sense that more emphasis means more characters to type (2 for bold versus 1 for italics).</li>
<li><strong>Code blocks and inline code</strong>: In Markdown you indent text by four or more spaces to indicate a code block, and you indicate inline code by enclosing the text in back ticks (<code>`</code>). In wiki text you enclose the text with triple and double curly braces: <code>}</code> and &#8220;.</li>
<li><strong>Hyperlinks</strong>: You create links in Markdown with the hyperlinked text enclosed in square brackets, and the link itself in parentheses, for example this snippet <code>[link](http://www.markerbench.com)</code> links to my blog. In wiki text, you use square brackets separated by a pipe <em>eg,</em> <code>[link | http://www.markerbench.com]</code>. Both are lightweight enough for my needs; the Markdown syntax is slightly easier.</li>
</ul>


<p>I&rsquo;ll miss JSPWiki&rsquo;s neat table syntax, which allowed you to create tables simply and cleanly (<code>|| head 1 || head 2 || head 3</code> for header rows and <code>| cell 1 | cell 2 | cell 3</code> for regular rows), but you can create tables in Markdown simply by passing through HTML. That&rsquo;s ok with me; I haven&rsquo;t seen a clean way to do tables on any platform. Supposedly-&ldquo;WYSIWYG&rdquo; editors &mdash; such as the one in Wordpress &mdash; mess tables up regularly. Writing them out manually is a little more work, but not too much.</p>

<p>Apart from the syntax itself, one difference between Octopress and JSPWiki is the way post metadata is stored. In JSPWiki, metadata such as the author name is stored in <code>.properties</code> files; last-modified times are whenever the file was last touched. In Octopress, one stores this and other information in the Markdown document itself, right at the top, in YAML syntax. For example, here&rsquo;s the YAML for this post:</p>

<pre><code>---
title: All Andy's Posts Now on Markerbench
created_at: 2013-01-29 07:00:00 -0500
layout: post
categories:
- blog
- applications
comments: true
---
</code></pre>

<p>Pretty simple stuff; you need to remember a few basic rules. Beyond the syntax, though, I like the simplicity of the system as a whole. By turning the blog into something that I &ldquo;publish&rdquo; with simple command-line invocations, I get rid of a lot of headaches. Instead of worrying about a web application that I need to maintain, upgrade, and secure, I only need to worry about my writing. (And the occasional GitHub update.)</p>

<p>Being the industrious-lazy sort, to move the blog posts, I created a little Ruby script that munged the wiki markup and produced decent Markdown. All of the posts needed a little work done to them, mostly to fix a few bullet issues my script didn&rsquo;t account for, and to assign categories to each post. At some point I will post the script to GitHub, as soon as I get the hang of <em>that</em>. I&rsquo;ll also, for the sake of completeness, I will likely cross-post a few notable essays from my <a href="http://blog.perimeterusa.com">work blog</a>.</p>

<p>After I have tinkered a bit more with the Markerbench site, I&rsquo;ll go ahead and move <a href="http://securitymetrics.org">http://securitymetrics.org</a> to Octopress as well, right in time for Metricon 8! I may, or may not, put the site contents on GitHub pages, as I have with this blog. Regardless, making it a totally static website makes it simple to host and scale. In addition, moving the rest of the securitymetrics.org site will allow me to use a much less expensive hosting plan. The only thing I&rsquo;ll need a hosting subscription for, at that point, is to host the securitymetrics.org mailing list.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Paving Over the Proprietary Web: The Java Security Bigger Picture]]></title>
    <link href="http://www.markerbench.com/blog/2013/01/21/paving-over-the-proprietary-web/"/>
    <updated>2013-01-21T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/01/21/paving-over-the-proprietary-web</id>
    <content type="html"><![CDATA[<p>Perhaps you&rsquo;ve heard about the <a href="http://www.kb.cert.org/vuls/id/625617">recently disclosed Java 7 zero-day exploit</a>. The flaw allows a remote attacker to take complete control of a computer. It has been incorporated into many exploit kits. The Department of Homeland security regards the Java exploit as sufficiently serious to recommend &ldquo;<a href="http://www.us-cert.gov/cas/techalerts/TA13-010A.html">disabling Java in web browsers until adequate updates are available</a>.&rdquo; Oracle&rsquo;s fixes — <a href="http://isc.sans.edu/diary/Java+7+Update+11+Still+has+a+Flaw/14983">aren&rsquo;t</a>.</p>

<p>Many of my colleagues at other security firms have spilled a lot of ink describing why this particular Java exploit is bad. It is indeed that bad; Apple, for example, has forced down an update that blocks the <a href="http://appleinsider.com/articles/13/01/11/zero-day-flaw-prompts-apple-to-block-java-7-from-os-x">Java 7 plugin from executing in the browser at all</a>, at least until Oracle is able to distribute an update. If you are in the habit of keeping Java switched on in your browser, you should turn it off — of course. But that <a href="https://isc.sans.edu/diary/When+Disabling+IE6+or+Java+or+whatever+is+not+an+Option+/14947">isn&rsquo;t always possible</a>. Client-side Java, for example, powers GoToMeeting. Many other companies — including my own — rely on client-side Java for critical functions. So one cannot simply <a href="http://threatpost.com/en_us/blogs/its-time-abandon-java-012113">rip it out</a>, or mandate that it be banned. Reality has a habit of messing up the best-intended recommendations. But make no mistake, at some point very soon Java on the client needs to go. CIOs, please take note.</p>

<!-- more -->


<p>Client-side Java is part of the web&rsquo;s proprietary past, and its time is ending. That proprietary past also includes ActiveX and Flash, two other technologies that saw widespread adoption in the early 2000s. That all three of these technologies came of age at roughly the same time isn&rsquo;t a coincidence; they all filled gaps in the web experience. ActiveX was Microsoft&rsquo;s way of adding native client functionality to a then-crude web experience; client-side Java (Swing, Java Web Start etc) did the same. Flash and its cousin ShockWave provided smooth video and animations.</p>

<p>Since 2005, though, the native web has changed dramatically, and for the better. HTML 5, CSS and JavaScript toolkits have been the major catalysts of a revolution in web design. The <code>canvas</code> element <a href="http://en.wikipedia.org/wiki/Canvas_element">added to HTML 5</a>, for example, allowed standards-compliant browsers to draw shapes, create and fill paths, and animate objects. This, plus the <code>video</code> element, <a href="http://en.wikipedia.org/wiki/HTML5_video">freed designers</a> from needing Flash. <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets</a> (CSS) Levels 2 and 3 gave designers increasingly pixel-perfect control over the placement and appearance of content — a task made even easier with CSS pre-processors such as <a href="http://lesscss.org">LESS</a> and <a href="http://sass-lang.com">Sass</a>, and with kitted CSS assemblies such as <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>. On the JavaScript front, third-generation toolkits such as <a href="http://jquery.org">jQuery</a> made it simple to make websites dynamic and responsive. You can do all of these things for free, without needing to buy any of the various Studios from Adobe or Microsoft.</p>

<p>The slow-motion revolution in how the Web is made means that the <em>raîson-d&#8217;être</em> for proprietary web technologies is going away. Like a lumbering concrete mixer, HTML5 and JavaScript are slowly paving over the parts of the web that had previously been occupied by Flash, ActiveX and Java. Ironically, the vendors of these proprietary technologies have, in their own ways, added limestone, clay and water to the paving machine.</p>

<p>Microsoft, for example, turned an entire generation of web developers against it with its long, and ultimately fruitless, <a href="http://web.archive.org/web/20080420044607/http://www.microsoft.com/windowsxp/expertzone/chats/transcripts/08_0320_ez_ie8.mspx">resistance against robust CSS support</a> in Internet Explorer. Although modern versions of IE are highly standards-compliant, Internet Explorer did not pass the CSS Acid3 test until <a href="http://www.winrumors.com/internet-explorer-9-and-10-now-pass-acid3-test-with-100-thanks-to-test-changes/">September 2011</a>. Any web developer who has been working with CSS for more than 5 years, for example, can probably regale you with stories of massive hacks needed to allow older Microsoft browsers to work with standards-based websites.</p>

<p>The roots of Adobe Flash&rsquo;s decline are a little different. Nothing was &ldquo;broken&rdquo; with Flash, functionally speaking<a href="#flash"><sup>1</sup></a>. Two related events resulted in a decline in Flash usage: Steve Jobs&#8217; public refusal to add Flash support to the iPhone and successor iOS devices; and Google&rsquo;s decision to convert its vast library of YouTube clips to HTML 5-compatible WebM and H.264 formats.</p>

<p>These actions, plus the increasing viability and efficiency of WebM and H.264, meant that you didn&rsquo;t need Flash video any longer. This has clear implications for customers. For customer-facing websites, you can (and should strongly consider) retiring Flash video in favor of H.264. This is a quick win; the re-encoding process is relatively quick and painless. That said, the need is not as urgent compared to Java. Adobe&rsquo;s security team (under the leadership my former @stake colleague Brad Arkin) has upped the tempo of bug fixes, adopted auto-update, and is taking security seriously enough that Flash has become less risky than it had been. Still, if you could remove a dependency on a third-party component that needs to be maintained and updated in addition to the base operating system, why wouldn&rsquo;t you?</p>

<p>Java, on the other hand, is simply a mess. From a pure features perspective, Java&rsquo;s caretaker parent, Oracle, no longer employs the kind and number of Java engineers that will keep it up-to-date — never mind put it back on the cutting edge. Most of the Java engineers and visionaries such as <a href="http://en.wikipedia.org/wiki/James_Gosling">James Gosling</a>, <a href="http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683">Josh Bloch</a>, <a href="http://www.tbray.org/ongoing/">Tim Bray</a>, <a href="http://amyfowlersblog.wordpress.com">Amy Fowler</a>, and <a href="http://adambosworth.wordpress.com/2004/11/18/iscoc04-talk/">Adam Bosworth</a> — the people I learned from and looked up to while I was learning Java J2EE — left long ago to greener pastures. Although server-side Java is still widely used, nobody I know would consider it for greenfield development for use with a browser.<a href="#android"><sup>2</sup></a></p>

<p>From a security standpoint, it is hard to see why Oracle would be Johnny-on-the-spot with security fixes. As my other (!) former @stake colleague David Litchfield has pointed out, the company doesn&rsquo;t have <a href="http://www.forbes.com/2010/02/02/hacker-litchfield-ellison-technology-security-oracle.html">the best track record on security</a>. We can reasonably assume that fixing client-side Java security holes isn&rsquo;t anywhere near the top of Oracle&rsquo;s priority list. And even if it becomes so because screaming customers demand it, legacy products get legacy engineers. That&rsquo;s just the way it is.</p>

<p>The same goes for Microsoft&rsquo;s ActiveX. Developers don&rsquo;t use it for new web-based projects, and the company has for several years recommended that developers use <a href="#other">other technologies<sup>3</sup></a> to make dynamic websites. The risks associated with ActiveX continue to be high, no doubt because ActiveX controls are basically chunks of native code written by various vendors of varying skill, remotely triggered by websites that may or may not be under the user&rsquo;s control. (What could go wrong with <em>that</em>?) To be sure, Microsoft has done as much as any vendor in the industry to set the standard for responsible and secure development practices. Over the years, they have responded relatively quickly to the <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-4969">various</a> <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0158">ActiveX</a> <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-1243">security</a> <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0814">issues</a> that have popped up over the years. But as with client-side Java, it&rsquo;s legacy technology maintained by legacy engineers.</p>

<p>It is much, <em>much</em> easier to talk about how the slow-moving concrete machine that is the modern web — HTML 5, CSS, and JavaScript — will slowly pave over the proprietary web. It is harder to state with confidence what it will mean for security. However, one may hazard a few guesses. The decline of these three technologies <em>should</em> increase the overall level of security over time. Logic dictates that a browser festooned with fewer proprietary plugins is a more secure browser. Put differently: migrating older websites to use CSS, HTML 5 and JavaScript support will have the effect of concentrating the attack surface by reducing the number of parties who must defend that surface. Over time, the broad public ought to be better served by having Apple or Google or Microsoft be responsible for the entire web browsing experience — including security.</p>

<p>But in the short term, it won&rsquo;t be so clean. Based on vulnerability counts — an imprecise metric at best — the &ldquo;younger guys&rdquo; don&rsquo;t score well. For example, the US National Vulnerability Database shows that the WebKit browsing engine had over 198 disclosed vulnerabilities last year. Internet Explorer? Just 61. Meanwhile, ActiveX, Java and Flash had 73,  169, and 67, respectively. I draw no other conclusions from these data, other than the simplest one — increased use of native browser capabilities is likely to increase risks in the short term, even as the decreased use of proprietary technologies decreases it over the longer term. At some point the two lines will cross and we will all be better off.</p>

<p>In the meantime, the cement truck keeps rumbling.</p>

<hr />

<p><small><a id="flash"><sup>1</sup></a> Functionality aside, Flash&rsquo;s security track record has been poor for a while.</small></p>

<p><small><a id="flash"><sup>2</sup></a> Java development is alive and well on the Android platform, of course.</small></p>

<p><small><a id="other"><sup>3</sup></a> It&rsquo;s fair to say that Microsoft has been all over the place on this subject over the last 10 years: <a href="http://www.yourhtmlsource.com/javascript/dhtmlexplained.html">DHTML</a>, <a href="http://en.wikipedia.org/wiki/Extensible_Application_Markup_Language">XAML</a>/SilverLight, and now <a href="http://www.infragistics.com/community/blogs/nick-landry/archive/2012/06/19/developing-apps-for-microsoft-surface-windows-8-windows-rt-and-windows-phone.aspx">Windows 8-style apps</a></small>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Review of Gene Kim&rsquo;s novel, &ldquo;The Phoenix Project&rdquo;]]></title>
    <link href="http://www.markerbench.com/blog/2013/01/17/phoenix/"/>
    <updated>2013-01-17T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/01/17/phoenix</id>
    <content type="html"><![CDATA[<p>Over the Christmas holidays, I read an advance copy of Gene Kim&rsquo;s first novel, &ldquo;<a href="http://itrevolution.com/books/phoenix-project-devops-novel/">The Phoenix Project</a>.&rdquo; Gene&rsquo;s co-authors were Kevin Behr and George Spafford. It was a better read than I was expecting. It is about 350 pages. Here&rsquo;s my review.</p>

<p>The book aims to describe how to bring TQM and &ldquo;lean&rdquo; (as in, &ldquo;manufacturing&rdquo;) disciplines to IT. Although TQM is especially important in the context of operations, the book shows how &ldquo;systems thinking&rdquo; that spans the development and IT operations organizations, and reaches upstream into finance, sales and marketing is critically important for technology-reliant companies. Because all but the most hidebound companies rely on IT to run (and transform) their businesses, the lessons in this book are generalizable to every company.</p>

<!--more-->


<p>The book is less of a dramatic novel than a disguised set of parables about IT and DevOps, using a fictional company, crisis and characters to illustrate them. Most lessons are imparted by a mysterious &ldquo;board member&rdquo; named Erik, who serves as a combination Greek chorus, Zen master, drill sergeant and mentor to the main protagonist, a generically named midrange IT operations manager named Bill. Bill receives a battlefield promotion into a role he is unprepared for while, all around him, systems are crashing and strategically important projects are running horrifically off track. Most of us who have been in IT roles for a while can relate.</p>

<p>The authors are at their best when they focus on the technology and related (often broken) processes that permeate most companies’ IT processes. The protagonist Bill&rsquo;s evolution as a manager from fire-fighting and free-fall, to productivity and proactivity, is well-done. As he embraces his new job, he slowly begins to understand the four types of work: business projects, IT projects, changes, and unplanned work. He also learns the tools he needs to increase his ability to do all four types of work using techniques such as simple change management meetings, kanban boards, monitoring processes and targeted, cross-functional &ldquo;tiger teams&rdquo; that automate the ability to deliver finished work more quickly.</p>

<p>It is very clear that the authors have a soft spot for the Agile and Lean styles of application development, the hallmarks of which feature short two-week development &ldquo;sprints,&rdquo; tight feedback loops between operations and development, and continuous integration workflows that build, test and deploy finished systems in minutes or hours rather than in weeks. The type of skills and tools needed to successfully implement these types of processes are loosely called &ldquo;DevOps,&rdquo; and they are what have enabled companies like Flickr and Twitter to innovate quickly. By the end of the book, Bill&rsquo;s company has embraced this thinking, too. Although there is a certain amount if hand-wavey &ldquo;and then a miracle occurred&rdquo; glossing over of how Bill and his formerly bedraggled band of IT misfits manage to pull it all off, it&rsquo;s fun to watch.</p>

<p>In contrast to the care and attention spent on describing IT processes, the characters through which the various lessons are imparted are paper-thin; we don&rsquo;t really get to know them all that well, and it is not obvious why we should care about their fates. Like in a typical Tarantino film, the dialogue is mostly one voice spoken by multiple characters. I don&rsquo;t think that is a major flaw, though; most readers are not going to read Gene&rsquo;s book expecting another Navokov, or even the Second Coming of Crichton.</p>

<p>Overall, the book succeeds in its goal of communicating complex processes by way of extended example. If you want to understand the most important ways in which modern, technology-reliant companies need to transform their IT organizations, this book offers a valuable introduction. If I had one criticism, it is that I found myself wishing that the &ldquo;lessons&rdquo; from each chapter were summarized at the end of each major section, textbook-style. And although I had some trouble getting through the first 20 pages or so — which bogs down with exposition and character development — the rest of the book flew by.</p>

<p>I read &ldquo;The Phoenix Project&rdquo; in essentially one sitting with a break for lunch. I liked it much more than I thought I would, and recommend it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Outsource your web risks with a static website]]></title>
    <link href="http://www.markerbench.com/blog/2013/01/08/static-blogging/"/>
    <updated>2013-01-08T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2013/01/08/static-blogging</id>
    <content type="html"><![CDATA[<p>A few weeks ago I put together my annual <a href="https://blog.perimeterusa.com/3180/">Predictions blog post</a> for the coming year. In that post and accompanying <a href="http://www.perimeterusa.com/knowledge-center/webinars/on-demand">webinar</a>, I suggested five emerging risk areas that CISOs need to pay attention to in the coming year. These are:</p>

<ol>
<li>CISOs will wrestle with the risks of “as-a-Service” platforms</li>
<li>Android’s security issues will force CISOs to take action</li>
<li>Cloud application vendors will compete on metrics</li>
<li>California will become the <em>de facto</em> privacy regulator</li>
<li>Your password policy will undergo a major overhaul</li>
</ol>


<!--more-->


<p>Of these, prediction numbers 1 and 3 both related to cloud services, and to the security thereof. The first one, about Platform-as-a-Service (PaaS) was by far the one that I spent the most time thinking about. That is because PaaS is the one that CISOs have the least amount of control over. It is the sneakiest. From CISO&rsquo;s standpoint, knowing that large parts of your developer toolchain (source code repository, test VMs) and runtime environment (web servers, databases) is sitting out there in &ldquo;the cloud&rdquo; is scary, not least because these parts didn&rsquo;t exactly go through the traditional procurement channel. Even worse, your typical IT security auditor isn&rsquo;t really going to know what to do with PaaS, other than slap hands on face, MacCauley Culkin-style, and make a beeline for the exit.</p>

<p><img src="http://www.markerbench.com/images/paas-2013.png" title="Platform-as-a-Service Ecosystem" ></p>

<p>However, in this post I will describe one way in which the use of pervasive — and free — platform cloud services can actually <em>reduce</em> risk. That may sound ridiculous on its face, but I offer one worked example that proves the point: static websites.</p>

<!--more-->


<p><em>Static websites</em> are exactly what you might think: websites whose content is entirely static. The server never executes any business logic: it simply retrieves whatever is asked for and serves it up to the client. By &ldquo;whatever is asked for&rdquo; we mean plain-old HTML, images, cascading style sheets, JavaScript or anything else that makes up the website. Static websites depend on four principles:</p>

<ol>
<li>Websites are &ldquo;compiled&rdquo; offline on a workstation, and &ldquo;published&rdquo; by uploading to the server</li>
<li>Servers execute no code, and only serve static resources</li>
<li>All dynamic features execute on the browser via JavaScript</li>
<li>Third party services provide &ldquo;outsourced&rdquo; commenting, social and analytics features via JavaScript, which are removed from the server&rsquo;s areas of concern</li>
</ol>


<p>Because the web server is not doing anything other than serving up static resources, it can be dumb as a bag of hammers, and locked down within an inch of its life. Even better, the simplicity of the server results in a radically reduced attack surface; there are no &ldquo;user accounts,&rdquo; no databases, and no middleware. Because the server does not need to, and indeed cannot, accept any user input, no application code needs to be audited.</p>

<h3>A new wrinkle on an old idea</h3>

<p>Static websites are not new. They have been around for a long, long time — as long as the World Wide Web. In fact, prior to the invention of CGI and early server-side scripting languages like Cold Fusion, <em>all</em> websites were static. But in the mid-1990s, developers began adding server-side languages and scripting frameworks to make websites more dynamic. These include PHP, ASP, JSP, and more recently, server-side JavaScript implementations like <a href="http://nodejs.org">Node.JS</a>.</p>

<p>Developers have also increased the number of components that collaborate server-side, too. In the early days, simple static websites required only a web server. But modern dynamic web applications are composed from many architectural components in addition to the web servers themselves. These additions include the various server-side scripting languages, plus application servers, application code, databases, and directories. And that is just for the simple applications. Even the humblest business website that serves up nothing more than corporate information from a content management system (CMS) needs most of these components. A site like that needs a web server (for example, <a href="http://httpd.apache.org">Apache</a>), scripting language (<a href="http://php.net">PHP</a>), content management system (<a href="http://drupal.org">Drupal</a>), database (MySQL) and a directory for authentication (Active Directory). That&rsquo;s five components, and collectively they aren&rsquo;t doing all that much.</p>

<p>In contrast to the complexity of modern web applications, static websites turn back the clock on the web. The static website philosophy mixes old-school web publishing and new-school DevOps. If you want an example of old school, for example, look at my friend Dan Geer&rsquo;s <a href="http://geer.tinho.net">website</a> or a <a href="http://geer.tinho.net/geer.suitsandspooks.8ii12.txt">representative posting</a> on it. Dan&rsquo;s site is just text; no flashiness, and no graphics. On its face, Dan&rsquo;s site and mine are similar in one major respect. Both offer the same thing: static resources served up by a dumb server.</p>

<h3>Why not compile your website instead?</h3>

<p>Modern static websites differ from their old-school cousins in two ways. First, the highly automated, explicitly developer-centric processes used to produce them feature many of the same tools used to produce code. Authors write posts using plain text editors rather than a WYSIWYG editor or CMS. They &ldquo;check in&rdquo; their posts into code versioning repositories the same way they check in their code. After the post or page is ready to publish, a designated DevOps person — perhaps the author — types a few commands to &ldquo;compile&rdquo; the site and upload it. Some static website aficionados have automated the process completely: one simply saves a new version of a post to a designated directory, and the website compiler automatically checks the page into GitHub, regenerates the site from scratch, and publishes it to the web server.</p>

<p>The second difference between modern static websites and their old-school cousins is inclusion of dynamic features by deliberately &ldquo;outsourcing&rdquo; them to other, usually free, service providers. Instructions on the static web page cause JavaScript code to be loaded and executed, which communicates with the provider&rsquo;s service and provides the illusion of dynamic behavior. This allows site owners to include modern features would ordinarily require server-side code. Years ago, if you needed analyze website visitor traffic, you would install WebTrends on the server. Today, you just pop in a couple of lines of JavaScript for <a href="http://www.google.com/analytics/">Google Analytics</a> (free). If you wanted commenting features with protections against spam, you needed an application that had a back-end database and a decent anti-spam filter, like <a href="http://wordpress.org">WordPress</a>. Now, you can simply embed <a href="http://disqus.com">Disqus</a> (which is also free). Or suppose you wanted to allow visitors to recommend and share items on your website. Traditionally, you&rsquo;d need to create a web form, hook it up to an email server, and create scripts to send recommendations via email. Now, all you need are a few JavaScript statements to load up Facebook&rsquo;s &ldquo;Like&rdquo; button, Twitter tweet and follow buttons, or Google&rsquo;s +1.</p>

<p>Dynamic features aren&rsquo;t just the only parts of the website that can be outsourced. The underlying web servers can be, too. For example, <a href="https://github.com">GitHub</a> provides a free service called GitHub Pages that allows developers to upload HTML and other static resources. These are served up just like a website. <a href="http://aws.amazon.com/s3/">Amazon S3</a> provides a similar service. For low-volume websites like this one (ha!), Amazon S3 is completely free.</p>

<h3>Outsourcing risk</h3>

<p>Static websites are simple, and require just one architectural component: a web server. By contrast, the typical corporate website that does nothing more than serve up company information, and forward leads to <a href="http://www.salesforce.com">Salesforce</a>, nonetheless requires five. The simpler website is better because it is less complex, and less complex is good.</p>

<p>But that is not the only advantage static websites have. Modern web applications aren&rsquo;t just complex, but risky as well. They typically need to reach beyond the DMZ&rsquo;s back-side firewall to resources inside the company; for example, to a database or three, or to an Active Directory forest. These additional network connections confer a corresponding amount of risk. Then there&rsquo;s the setup, operations and maintenance tasks. Each architectural component needs to be configured, hardened, horizontally scaled, patched and monitored — forever.</p>

<p>But when you create a static website, most of the complexity goes away, along with the cost and risk associated with each. If you choose to outsource the remaining architectural component — the web server — to a third party, that goes away too. Why not let the fine folks at Amazon, <a href="http://www.heroku.com">Heroku</a> or GitHub configure, harden, scale, patch and monitor the web server? They are likely to be better at it than you are.</p>

<p>Simplifying your architecture by eliminating complexity — and outsourcing the web server — eliminates a huge amount of security risk by cutting the attack surface nearly to zero. But the outsourcing of dynamic features such as user tracking, commenting, social sharing, analytics has another side-effect. Because the web server processes no user-generated content, a whole class of application and data-related security risks goes away. Cross-site scripting, SQL injection, parameter tampering, and the rest of the <a href="https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project">OWASP Top Ten</a> are no longer worries. You don&rsquo;t have any potential data breach obligations because you don&rsquo;t keep any data. There is nothing to steal.</p>

<p>Of course, just because <em>you</em> no longer need to worry about application and data-related security risks, your outsourced comment-management service (Disqus) still does. They, and Facebook, Twitter and other providers your client-side JavaScript links to still need to police their members for spam, fraud, impersonation, and identity theft. They need to secure their JavaScript APIs and web applications. But you don&rsquo;t need to do any of these things any more; with a static website, you have essentially outsourced your risks to them. Indeed, it is more correct to say that you have <em>transferred</em> them.</p>

<p>A few security risks remain. Access to servers that host static content must be controlled. If you manage those servers, you need to manage the SSH keys or passwords used for uploading content. And you should probably restrict the number of people allowed to operate the website compiler machinery to a few. And of course, you also need to worry about, um… a bunch of other, er… important stuff, like for example… let&rsquo;s see…</p>

<p>Honestly, I can&rsquo;t think of anything else. Lock down the web servers and make sure only the right people can compile and post. That shouldn&rsquo;t be too hard, right?</p>

<p>Static websites aren&rsquo;t for everybody. They still require a certain amount of developer <em>savoir-faire</em>, and they won&rsquo;t reduce the need to build genuine web applications for business units. You can&rsquo;t build a static e-commerce site or anything stateful, for example. But if you are a security-conscious company that just needs an online presence, static websites might be just the thing.</p>

<p>If you disagree, feel let me know in the Comments section below. I&rsquo;m using Disqus — of course!</p>

<h3>Coda: the making of this web page</h3>

<p>I became interested in static websites several months ago when I read a few stray articles about the concept. But it wafted past me like so much second-hand smoke; I didn&rsquo;t really inhale. However, after I did my <a href="http://www.perimeterusa.com/knowledge-center/webinars/on-demand">Predictions webinar</a> in December, I began spending more time digging into the capabilities of &ldquo;new school&rdquo; free-ish web service providers such as Heroku and GitHub. At a holiday party, my friend, neighbor and Drupal guru Stephan pointed out that these days it is pretty easy for a motivated developer to assemble a complete app infrastructure more-or-less for free.</p>

<p>A few weeks later, to support one of my professional hobbies, I opened a  repository on GitHub. Shortly thereafter, I read a few more articles about static blogging and started connecting the dots. I decided it would be fun to create my own static website to prove the concept. But to make it interesting, I wanted to create something representative of what most people would want. That meant that it needed to have the typical kinds of things you would expect, such as commenting features and social integration. I downloaded and started experimenting with two static blogging packages with a lot of buzz, <a href="http://nanoc.stoneship.org">Nanoc</a> and <a href="http://jekyllrb.com">Jekyll</a>.</p>

<p>Both implement the &ldquo;website compiler&rdquo; strategy: you customize some templates, write a few posts in <a href="http://daringfireball.net/projects/markdown/">Markdown</a> and then type a few commands to generate the site and upload the contents to a web server. After starting with Nanoc and finding myself a little frustrated, I moved on to Jekyll. I was halfway through my proof-of-concept with Jekyll when I discovered <a href="http://www.jekyllbootstrap.com">Jekyll Bootstrap</a>, a more kitted and polished version of Jekyll that didn&rsquo;t have the some-assembly-required feeling. But finally, I discovered <a href="http://octopress.org">Octopress</a>. It too is based on Jekyll, but includes pre-configured support for Google Analytics, Discus, Facebook, Twitter and Google+. In short, exactly what I wanted.</p>

<p>So I got to work getting a feel for the software, started drafting this post, and after about a day or two of after-hours work, things looked good. I needed to find a place to host the blog and decided on <a href="http://pages.github.com">GitHub Pages</a>, which is part of my GitHub account. While I was at it, I created Google Analytics and Disqus accounts. All pretty easy to do. Octopress worked pretty nicely once I got over a few self-imposed obstacles. What you see here, on this page, is a totally out-of-the box standard version of OctoPress, with nothing more than a few titles and text properties changed. <em>[Author&rsquo;s note: as of February 1, 2013, Markerbench is no longer out-of-the box; I now build it using a brilliant Twitter Bootstrap-derived theme created by Adrian Artiles.]</em></p>

<p>With a little more effort, maybe someday I&rsquo;ll be able to make something as nice-looking as the <a href="http://www.trailofbits.com">Trail of Bits</a> website. One can but dream, no? <em>[Author&rsquo;s note: it turned out to be a fairly straightforward weekend project.]</em></p>

<p>As for this blog post: I initially set out to write something very silly about how cool it was to try my hand at this. But the post kept getting longer. Whoops.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[“Every time you perform arithmetic operations on ordinal numbers, God kills a kitten”]]></title>
    <link href="http://www.markerbench.com/blog/2008/02/19/Every-time-you-perform-arithmetic-operations-on-ordinal-numbers-God-kills-a-kitten/"/>
    <updated>2008-02-19T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2008/02/19/Every-time-you-perform-arithmetic-operations-on-ordinal-numbers-God-kills-a-kitten</id>
    <content type="html"><![CDATA[<p>I was reading Rich Beijtlich&rsquo;s <a href="http://taosecurity.blogspot.com/2006/07/control-compliant-vs-field-assessed.html">blog</a> today, and came across that quote from a commenter known only as <code>JimmyTheGeek</code>. Wonderfully funny, and spot on.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Passwords-O-Plenty]]></title>
    <link href="http://www.markerbench.com/blog/2008/02/05/Passwords-O-Plenty/"/>
    <updated>2008-02-05T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2008/02/05/Passwords-O-Plenty</id>
    <content type="html"><![CDATA[<p>Before the holidays I ran a quick, three-question, survey of the securitymetrics.org mailing list membership about the number of passwords people use. Here are the results, drawn from 51 responses (not bad, considering the list membership is about 400 people). I&rsquo;d promised the respondents that I&rsquo;d share the results&hellip; so here they are.</p>

<!--more-->


<h3>Securitymetrics.org Quickie Survey: Online Credentials</h3>

<p><strong>1. How many online accounts do you manage, in total? How many &ldquo;sensitive&rdquo; accounts do you maintain?</strong></p>

<p>By &ldquo;account&rdquo; I mean a public or private website, server or network that you log in to, for which you maintain a password or other credential. For example, a password or application entry in an OS X Keychain could be considered an account.</p>

<p>For purposes of this question, &ldquo;sensitive accounts&rdquo; means ones that you would consider problematic if they were compromised. Typically, these could be accounts that keep credit card information, manage your 401k details, or contain employment details.</p>

<p>Results (n=51):</p>

<table class="table table-striped"><thead><tr><th>Metric</th><th>All accounts</th><th>Sensitive accounts</th></tr></thead>
<tr><td>Mean</td><td>60.7 accounts</td><td>20.6 accounts</td></tr>
<tr><td>Standard deviation</td><td>55.0</td><td>29.7</td></tr>
<tr><td>Min</td><td>3</td><td>0</td></tr>
<tr><td>First quartile</td><td>23.5</td><td>6</td></tr>
<tr><td>Median</td><td>40</td><td>15</td></tr>
<tr><td>Second quartile</td><td>72.5</td><td>25</td></tr>
<tr><td>Max</td><td>207</td><td>207</td></tr>
<tr><td>Mode</td><td>40</td><td>20</td></tr>
</table>


<p><em>Comments:</em> I draw 3 conclusions from these figures.</p>

<ul>
<li>First, people have lots of accounts to keep track of &mdash; on average.</li>
<li>That said, the quartiles and median show that respondents skew towards the &ldquo;conservative case&rdquo; &mdash; that is, they most don&rsquo;t tend to maintain too many accounts. A few crazy outliers (like me) are pushing the average number up.</li>
<li>Third, the ratio of sensitive-to-non-sensitive accounts stays fairly constant across quartiles, ranging from 26-38%. In other words: of all of the account passwords people maintain, it&rsquo;s a fair bet that about a third of them will be &ldquo;sensitive.&rdquo;</li>
</ul>


<p>I&rsquo;d also note that the survey base is self-selected &mdash; in the sense that it&rsquo;s the members of this list. Most of us are professional paranoids, right? Not sure if that means that the average user is worse off than the respondent base (more passwords to keep track of) or better off. Regardless, I&rsquo;d say it does confirm what I already knew: we&rsquo;re drowning in passwords. Further insights or armchair-psychology comments welcome.</p>

<p><strong>2. What is your primary coping strategy for managing your online accounts?</strong></p>

<ul>
<li>I keep all of my passwords the same: 10%</li>
<li>I write everything down on paper: 12%</li>
<li>I use a form-filler product, like Apple&rsquo;s Keychain, and use random passwords 12%</li>
<li>No particular strategy: 20%</li>
<li>Other: 47%</li>
</ul>


<p><em>Comments:</em> I can&rsquo;t draw too many conclusions from the responses to this question, because I asked it badly. Considering that my day job is as an analyst, you&rsquo;d think I would&rsquo;ve asked this question in a way that got better answers. :)</p>

<p><strong>3. Do you like the idea of surveying securitymetrics.org members about security practices?</strong></p>

<ul>
<li>Yes: This is a good idea: 92%</li>
<li>No: I&rsquo;ve got enough spam as it is: 8%</li>
</ul>


<p><em>Comments:</em> Everyone seems to like the idea of surveying the membership more often. Cool! I&rsquo;ve asked mailing list members to suggest ideas for future surveys.</p>

<p><em>Note:</em> I&rsquo;ve proposed that we spend some time on the subject of community-building at this year&rsquo;s Mini-Metricon at RSA. More on this later&hellip; Betsy Nichols is going to put up a blog entry about Mini-Metricon on the website later today.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Retired Comedians and Missed Opportunities]]></title>
    <link href="http://www.markerbench.com/blog/2008/01/31/Retired-Comedians-and-Missed-Opportunities/"/>
    <updated>2008-01-31T00:00:00-05:00</updated>
    <id>http://www.markerbench.com/blog/2008/01/31/Retired-Comedians-and-Missed-Opportunities</id>
    <content type="html"><![CDATA[<p>There&rsquo;s this old joke about a comedians&#8217; retirement home that goes something like this:</p>

<p>An aging comedian decides to retire to a community that has just other comedians living in it. On his first day there, he does down to lunch, and there&rsquo;s a bunch of retired fellow comics sitting around the table.</p>

<!--more-->


<p>The conversation they&rsquo;re having puzzles the man a bit. One of comics at the table yells out, &ldquo;12!&rdquo; and everybody just dies laughing. Then another one says, &ldquo;44!&rdquo; and a three of them laugh so hard they roll straight out of their chairs and onto the floor.</p>

<p>When a lull in the conversation comes, the new guy introduces himself, and asks, &ldquo;Hey, what&rsquo;s going on? What&rsquo;s so funny about yelling out numbers?&rdquo;</p>

<p>One of the comics says, &ldquo;Oh, you&rsquo;re the new kid on the block, eh? Here&rsquo;s what&rsquo;s going on. We&rsquo;ve all been retired for many years. We&rsquo;ve been telling and re-telling the same old jokes for so long, we&rsquo;ve assigned them all numbers. To save time, instead of telling the joke again, we just say the number!&rdquo;</p>

<p>&ldquo;Wow,&rdquo; says the new guy. &ldquo;I&rsquo;ve never seen that before. That&rsquo;s pretty cool. Mind if I join you?&rdquo;</p>

<p>&ldquo;Sure,&rdquo; the other comic says, and beckons him to sit down.</p>

<p>The new guy is eager to fit in. So five minutes later, he yells out, &ldquo;28!&rdquo; NOBODY laughs &mdash; you could&rsquo;ve heard a pin drop.</p>

<p>His voice qwavering, the new guy asks, &ldquo;What&rsquo;s wrong? Isn&rsquo;t number 28 a good joke too?&rdquo;</p>

<p>&ldquo;Sure it is,&rdquo; pipes in the other comic. &ldquo;But it&rsquo;s all about the delivery!&rdquo;</p>

<p>I mention this because I can&rsquo;t stand Jeff Jones&#8217; quarterly festivals of FUD. Rather than complain yet again, and in detail, about how dumb vulnerability-counting is, why the methodology is flawed, why it has limited bearing on security, how the system is easily gamed, why it&rsquo;s colored by Jeff&rsquo;s obvious agenda, and why it&rsquo;s a <em>tragedy</em> that Microsoft does not do what it should, namely mine the world&rsquo;s most complete bug databases and code repositories for truly compelling information about code quality and application security metrics.</p>

<p>But I won&rsquo;t do that again. I&rsquo;m just going to, like these comics, just yell out the shorthand.</p>

<p>&ldquo;Jeff Jones.&rdquo;</p>

<p>Note that I&rsquo;m not laughing.</p>
]]></content>
  </entry>
  
</feed>
