<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Christopher Mills</title>
	<atom:link href="http://www.chrisam.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisam.net/blog</link>
	<description>A place for stuff I write.</description>
	<lastBuildDate>Fri, 11 Jun 2010 01:00:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flag Question From My Dad</title>
		<link>http://www.chrisam.net/blog/2010/06/11/flag-question-from-my-dad/</link>
		<comments>http://www.chrisam.net/blog/2010/06/11/flag-question-from-my-dad/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 01:00:51 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[american]]></category>
		<category><![CDATA[family]]></category>
		<category><![CDATA[flags]]></category>

		<guid isPermaLink="false">http://www.chrisam.net/blog/?p=125</guid>
		<description><![CDATA[My Dad wrote an email asking the following: Dear Folks, Does anyone know the position of a second flag on a common halyard? I fly the US flag on top and the POW MIA flag beneath. A few years back, I wrote a letter to the Flag Code organization in Pittsburgh and did not get [...]]]></description>
			<content:encoded><![CDATA[<p>My Dad wrote an email asking the following:</p>
<blockquote><p>Dear Folks,</p>
<p>Does anyone know the position of a second flag on a common halyard?<br />
I fly the US flag on top and the POW MIA flag beneath.<br />
A few years back, I wrote a letter to the Flag Code organization in Pittsburgh and did not get an answer.<br />
I have heard various comments relative to that positioning. I can not find it in my code booklet.<br />
I heard originally that it should be a flag height break between flags. I also heard that the flag below the US flag should not be touched by the hanging US flag. I cannot find anything in print with either of those comments.<br />
I was also told that you were not to fly any other flag with the US flag. I know that is bogus according to the flag code. All I could find in the code is that the US flag flies on the top. It just does not seem to specify details of separation. That is what I am looking for!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2010/06/11/flag-question-from-my-dad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s on your (ideal) border?</title>
		<link>http://www.chrisam.net/blog/2010/05/01/whats-on-your-ideal-border/</link>
		<comments>http://www.chrisam.net/blog/2010/05/01/whats-on-your-ideal-border/#comments</comments>
		<pubDate>Sat, 01 May 2010 22:27:02 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.chrisam.net/blog/?p=122</guid>
		<description><![CDATA[If you had a beefy Linux box with plenty of storage hanging on to your border router that can see all of your network&#8217;s ingress/egress traffic, what would you put on it? Why? Let me know in the comments or via twitter! I&#8217;m thinking some sort of netflow collector, maybe a layer 7 re-assembler. Full [...]]]></description>
			<content:encoded><![CDATA[<p>If you had a beefy Linux box with plenty of storage hanging on to your border router that can see all of your network&#8217;s ingress/egress traffic, what would you put on it? Why?</p>
<p>Let me know in the comments or via <a title="Twitter - TheChrisAM" href="http://twitter.com/thechrisam" target="_blank">twitter</a>!</p>
<p>I&#8217;m thinking some sort of netflow collector, maybe a layer 7 re-assembler. Full packet capture/logging perhaps?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2010/05/01/whats-on-your-ideal-border/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That Shrimp Damn Near Melted My Face Off</title>
		<link>http://www.chrisam.net/blog/2009/12/28/that-shrimp-damn-near-melted-my-face-off/</link>
		<comments>http://www.chrisam.net/blog/2009/12/28/that-shrimp-damn-near-melted-my-face-off/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 05:45:08 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[tampa]]></category>

		<guid isPermaLink="false">http://www.chrisam.net/blog/?p=119</guid>
		<description><![CDATA[My wife and I went out for a grown-up night. We planned on hitting up the Brass Tap, but they were way too crowded. We decided to try Prime Bar instead. Prime Bar is located in the Wiregrass Shops in New Tampa across from the Brass Tap. We both just wanted a beer, but the [...]]]></description>
			<content:encoded><![CDATA[<p>My wife and I went out for a grown-up night. We planned on hitting up the Brass Tap, but they were way too crowded. We decided to try Prime Bar instead. Prime Bar is located in the Wiregrass Shops in New Tampa across from the Brass Tap.</p>
<p>We both just wanted a beer, but the menu had a few unique items. After looking it over a few times, we finally settled on the Habanero Shrimp Tempura. I expected to receive a paper-lined plastic basket with some soggy battered/fried shrimp with some wing sauce on them. I was pleasantly surprised.</p>
<p>The shrimp was plated on a large tortilla on a bed of lettuce. There was a separate bowl for the ranch sauce, and a few carrots and celery sticks. I took a bite of the shrimp expecting a mediocre flavor. I was immediately wowed. This was the spiciest dish I had at a restaurant in recent memory. The sauce was super spicy with the perfect balance of tangy. The tempura was delicate and very crispy.</p>
<p>I ordered a Rogue Dead Guy ale at the same time as the shrimp. It turned out to be the perfect compliment to the dish, both for flavor as well as cooling down the experience.</p>
<p>Altogether, the atmosphere at Prime Bar was kind of dead, but the food and beer were spot on. The decor and furniture arrangement reminded me of a hotel bar. If they work at bringing in the customers while at the same time not compromising the bold flavors, I think they might have a good thing going.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/12/28/that-shrimp-damn-near-melted-my-face-off/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Today is cookie-baking day</title>
		<link>http://www.chrisam.net/blog/2009/12/22/today-is-cookie-baking-day/</link>
		<comments>http://www.chrisam.net/blog/2009/12/22/today-is-cookie-baking-day/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:32:57 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[baking]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[home]]></category>

		<guid isPermaLink="false">http://www.chrisam.net/blog/?p=113</guid>
		<description><![CDATA[I thought I&#8217;d share a cookie recipe I&#8217;ve been baking for a few years. My grandma used to make these. It&#8217;s a sweet, buttery cookie that crumbles apart. Fourteen Ingredient Cookies Ingredients 1 cup butter 1 cup oil 1 cup brown sugar 1 cup granulated sugar 1 egg 1 cup oatmeal 1 cup Rice Krispies [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d share a cookie recipe I&#8217;ve been baking for a few years. My grandma used to make these. It&#8217;s a sweet, buttery cookie that crumbles apart.</p>
<h1 style="padding-left: 30px;">Fourteen Ingredient Cookies<a href="http://www.flickr.com/photos/tenaciousgirl/4207156511/in/set-72157622929616003/"><img class=" alignright" style="border: 2px solid black;" title="Fourteen Ingredient Cookie" src="http://farm3.static.flickr.com/2652/4207156511_29a7662b89_m.jpg" alt="Fourteen Ingredient Cookie" width="240" height="160" /></a></h1>
<h2 style="padding-left: 30px;">Ingredients</h2>
<ul style="padding-left: 30px;">
<li>1 cup butter</li>
<li>1 cup oil</li>
<li>1 cup brown sugar</li>
<li>1 cup granulated sugar</li>
<li>1 egg</li>
<li>1 cup oatmeal</li>
<li>1 cup Rice Krispies</li>
<li>1 tsp cream of tartar</li>
<li>1/2 tsp baking soda</li>
<li>1/2 tsp salt</li>
<li>1 cup coconut</li>
<li>1 tsp vanilla</li>
<li>1/2 cup chopped nuts</li>
<li>3 1/2 cups flour</li>
</ul>
<h2 style="padding-left: 30px;">Instructions</h2>
<p style="padding-left: 30px;">Preheat oven to 350 degrees F.</p>
<p style="padding-left: 30px;">Cream together the butter, eggs, and sugar. Add the oil &amp; mix well.</p>
<p style="padding-left: 30px;">Add dry ingredients.</p>
<p style="padding-left: 30px;">Drop onto ungreased cookie sheet.</p>
<p style="padding-left: 30px;">Bake for 12-15 minutes</p>
<p style="padding-left: 30px;">Yield: 4-5 Dozen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/12/22/today-is-cookie-baking-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Direction For This Blog</title>
		<link>http://www.chrisam.net/blog/2009/12/12/new-direction-for-this-blog/</link>
		<comments>http://www.chrisam.net/blog/2009/12/12/new-direction-for-this-blog/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 17:41:28 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrisam.net/blog/?p=111</guid>
		<description><![CDATA[I&#8217;ve been trying to stick to strictly SCAP-related posts, but there&#8217;s so much more to write about. Having recently deleted my FaceBook account due to the new privacy policies, I will now use this blog as my general purpose outlet. I&#8217;ll be using my new domain http://chrisam.net/blog from now on. The old domain will still [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to stick to strictly SCAP-related posts, but there&#8217;s so much more to write about. Having recently deleted my FaceBook account due to the new privacy policies, I will now use this blog as my general purpose outlet. I&#8217;ll be using my new domain http://chrisam.net/blog from now on. The old domain will still work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/12/12/new-direction-for-this-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Article: The Best Way To Remediate</title>
		<link>http://www.chrisam.net/blog/2009/10/13/article-the-best-way-to-remediate/</link>
		<comments>http://www.chrisam.net/blog/2009/10/13/article-the-best-way-to-remediate/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:36:02 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[measurable]]></category>

		<guid isPermaLink="false">http://www.packetsense.net/blog/?p=103</guid>
		<description><![CDATA[My colleague Aharon was recently published in SC Magazine with an article on SCAP and Vulnerability Management. &#8230; A fortuitous byproduct of implementing the Security Content Automation Protocol (SCAP) within the organization is that we no longer have to rely on tracking security patches to address vulnerabilities. &#8230; Check it out! http://www.scmagazineus.com/The-best-way-to-remediate/article/151843/]]></description>
			<content:encoded><![CDATA[<p>My colleague Aharon was recently published in SC Magazine with an article on SCAP and Vulnerability Management.</p>
<blockquote><p>&#8230; A fortuitous byproduct of implementing the Security Content Automation Protocol (SCAP) within the organization is that we no longer have to rely on tracking security patches to address vulnerabilities. &#8230;</p></blockquote>
<p>Check it out!</p>
<p><a class="alignleft" title="SC Magazine: The Best Way To Remediate" href="http://www.scmagazineus.com/The-best-way-to-remediate/article/151843/" target="_self">http://www.scmagazineus.com/The-best-way-to-remediate/article/151843/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/10/13/article-the-best-way-to-remediate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Configuring suPHP on CentOS 5.3</title>
		<link>http://www.chrisam.net/blog/2009/10/11/installing-and-configuring-suphp-on-centos-5-3/</link>
		<comments>http://www.chrisam.net/blog/2009/10/11/installing-and-configuring-suphp-on-centos-5-3/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:56:25 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.packetsense.net/blog/?p=93</guid>
		<description><![CDATA[suPHP how-to - Learn how to install suPHP on CentOS]]></description>
			<content:encoded><![CDATA[<p>I’m deviating from my SCAP posts a bit. I was looking at better ways to secure sites when I stumbled on this.</p>
<h1>What is suPHP?</h1>
<p>suPHP will execute php scripts as the user you specify. This enhances security by not running scripts as the web server user (nobody) or as root (really bad idea). So even if there is a vulnerable php script installed, it can at most execute with the permissions of the non-privileged user you choose for it to use.</p>
<h1>How does it work?</h1>
<p>PHP scripts are interpreted by suPHP and suPHP then calls the php interpreter as the specified user and interprets the scripts as that user.</p>
<h1>Why am I writing this How-To?</h1>
<p>I have found several guides that *almost* get it done, but then there are a few details that you have to go hunt for. Hopefully this guide is easy to use and can get you set up on the first try.</p>
<h1>Installation and Configuration</h1>
<h2>First Steps</h2>
<p>There is an suPHP package in the RPMForge repository. You will need this installed. Follow the guide on the CentOS Wiki: http://wiki.centos.org/AdditionalResources/Repositories/RPMForge<br />
If you follow each step for CentOS 5, it will work. I guarantee it.</p>
<p>The RPMForge package you will need is called “mod_suphp” and as of this writing, here are the package details:<br />
Name       : mod_suphp<br />
Arch       : i386<br />
Version    : 0.7.0<br />
Release    : 1.el5.rf<br />
Size       : 597 k<br />
Repo       : rpmforge<br />
Summary    : Apache module that enables running PHP scripts under different users</p>
<h3>Install The Package</h3>
<p>yum install mod_suphp</p>
<p>This will install a few configuration files:<br />
/etc/suphp.conf &#8211; This is the configuration file for suPHP itself<br />
/etc/httpd/conf.d/suphp.conf &#8211; This is the configuration file for the suPHP Apache module</p>
<h2>Edit the suPHP Config file &#8211; /etc/suphp.conf</h2>
<p>There are a few lines that need changd to make this work.</p>
<h3>webserver_user=apache</h3>
<p>Depending on what user you run your web server as, you may need to change this line.</p>
<h3>x-httpd-php=php:/usr/bin/php</h3>
<p>This line must be modified to put double quotes around the value. suPHP will not work without it. You must also change it to use the PHP commandline interpreter, php-cgi. It should look like this:</p>
<pre> x-httpd-php="php:/usr/bin/php-cgi"</pre>
<h3>x-suphp-cgi=execute:!self</h3>
<p>The same applies with this line. Put double quotes around the value, so it looks like this:</p>
<pre>x-suphp-cgi="execute:!self"</pre>
<h2>Edit the suPHP Apache Module Configuration File &#8211; /etc/httpd/conf.d/suphp.conf</h2>
<p>This file loads the suPHP Apache module as well as sets global configuration for the module. On my server, different sites (VirtualHosts) on my server have files owned by different users. To allow each user/VirtualHost to run PHP as their user, we do not enable nor configure suPHP globally. To skip global configuration, I comment out every line in /etc/httpd/conf.d/suphp.conf except the LoadModule line.</p>
<p>Configuration of the suPHP module will be handled on a per-VirtualHost basis in the httpd.conf.</p>
<h2>Edit the httpd config file to set up individual VirtualHosts &#8211; /etc/httpd/conf/httpd.conf</h2>
<p>suPHP usage is defined per VirtualHost. An unchanged VirtualHost directive will still execute PHP, but as the web server user. You can change this so PHP will not execute at all unless it uses suPHP, but I don’t do that in my config.</p>
<p>Below is my unchanged VirtualHost directive for http://www.packetsense.net:</p>
<pre style="padding-left: 30px;">&lt;VirtualHost *:80&gt;</pre>
<pre style="padding-left: 30px;">ServerName packetsense.net</pre>
<pre style="padding-left: 30px;">ServerAlias www.packetsense.net</pre>
<pre style="padding-left: 30px;">DocumentRoot /home/packetsense/www/</pre>
<pre style="padding-left: 30px;">ScriptAlias /cgi-bin/ /home/packetsense/cgi-bin/</pre>
<pre style="padding-left: 30px;">ScriptAlias /cgi-sys/ /home/packetsense/cgisys/</pre>
<pre style="padding-left: 30px;">SetEnv PHPRC /home/packetsense/etc/</pre>
<pre style="padding-left: 30px;">ErrorDocument 404 /404.html</pre>
<pre style="padding-left: 30px;">php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fchris@packetsense.net"</pre>
<pre style="padding-left: 30px;">ServerAdmin chris@packetsense.net</pre>
<pre style="padding-left: 30px;">php_admin_flag allow_url_fopen off</pre>
<pre style="padding-left: 30px;">&lt;/VirtualHost&gt;</pre>
<p>You may not have all those directives defined in your config, but that doesn’t really matter.<br />
To set a VirtualHost to work with suPHP, you only need to add 4 lines.</p>
<pre style="padding-left: 30px;">suPHP_Engine on</pre>
<pre style="padding-left: 30px;">suPHP_UserGroup username groupname</pre>
<pre style="padding-left: 30px;">AddHandler x-httpd-php .php .php3 .php4 .php5</pre>
<pre style="padding-left: 30px;">suPHP_AddHandler x-httpd-php</pre>
<p>In my case, my files are owned by User: packetsense, and Group: packetsense.</p>
<p>My modified VirtualHost directive now looks like this:</p>
<pre style="padding-left: 30px;">&lt;VirtualHost *:80&gt;</pre>
<pre style="padding-left: 30px;">ServerName packetsense.net</pre>
<pre style="padding-left: 30px;">ServerAlias www.packetsense.net</pre>
<pre style="padding-left: 30px;">DocumentRoot /home/packetsense/www/</pre>
<pre style="padding-left: 30px;"><strong>suPHP_Engine on</strong></pre>
<pre style="padding-left: 30px;"><strong>suPHP_UserGroup packetsense packetsense</strong></pre>
<pre style="padding-left: 30px;"><strong>AddHandler x-httpd-php .php .php3 .php4 .php5</strong></pre>
<pre style="padding-left: 30px;"><strong>suPHP_AddHandler x-httpd-php</strong></pre>
<pre style="padding-left: 30px;">ScriptAlias /cgi-bin/ /home/packetsense/cgi-bin/</pre>
<pre style="padding-left: 30px;">ScriptAlias /cgi-sys/ /home/packetsense/cgisys/</pre>
<pre style="padding-left: 30px;">SetEnv PHPRC /home/packetsense/etc/</pre>
<pre style="padding-left: 30px;">ErrorDocument 404 /404.html</pre>
<pre style="padding-left: 30px;">php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fchris@packetsense.net"</pre>
<pre style="padding-left: 30px;">ServerAdmin chris@packetsense.net</pre>
<pre style="padding-left: 30px;">php_admin_flag allow_url_fopen off</pre>
<pre style="padding-left: 30px;">&lt;/VirtualHost&gt;</pre>
<h2>Finally: All that’s left is to restart the web server service.</h2>
<h2>Now: Test It</h2>
<p>To see which user your PHP is running as, create a file in your web directory called whoami.php. Include this code:</p>
<pre style="padding-left: 30px;">&lt;?php</pre>
<pre style="padding-left: 30px;">echo "Output of the 'whoami' command:&lt;br /&gt;&lt;br /&gt;\n";</pre>
<pre style="padding-left: 30px;">echo exec('/usr/bin/whoami');</pre>
<pre style="padding-left: 30px;">?&gt;</pre>
<p>You should see something like this:<br />
Output of the &#8216;whoami&#8217; command:</p>
<p>packetsense</p>
<h2>Common Problems</h2>
<h3>500 Internal Server Error</h3>
<p>Check your /var/log/httpd/error_log. You might see something like this:</p>
<pre>[Sun Oct 11 11:27:47 2009] [error] [client 72.185.236.25] SoftException in Application.cpp:249:
File "/home/packetsense/www/whoami.php" is writeable by group</pre>
<pre>[Sun Oct 11 11:27:47 2009] [error] [client 72.185.236.25] Premature end of script headers: whoami.php</pre>
<p>In this case, just chmod 644 the file you’re working with. Alternatively, you can adjust the tolerance for file permissions by editing the /etc/suphp.conf file. Look at this section:</p>
<pre style="padding-left: 30px;">; Security options</pre>
<pre style="padding-left: 30px;">allow_file_group_writeable=false</pre>
<pre style="padding-left: 30px;">allow_file_others_writeable=false</pre>
<pre style="padding-left: 30px;">allow_directory_group_writeable=false</pre>
<pre style="padding-left: 30px;">allow_directory_others_writeable=false</pre>
<p>Change them to true.</p>
<p>Another cause of the internal server error might be if you did not change the interpreter line in /etc/suphp.conf from:<br />
x-httpd-php=&#8221;php:/usr/bin/php” to x-httpd-php=&#8221;php:/usr/bin/php-cgi&#8221;</p>
<h3>Your PHP source code displays in the browser in Plain Text</h3>
<p>Check your /etc/suphp.conf for proper quote marks and the php-cgi interpreter specified.</p>
<h3>Problems with Sessions</h3>
<p>If your scripts use PHP sessions, you may run into failures when PHP attempts to write to the /var/lib/php/session directory. By default, it is chmod 770, and owner is root, group is apache. I recommend adding your users to a phpsession group and then to chgrp the /var/lib/php/session directory to the phpsession group. I ran into this problem when trying to run PHPMyAdmin</p>
<h2>Please let me know if this is helpful to you. Also, please leave any comments, corrections, or suggestions.</h2>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/10/11/installing-and-configuring-suphp-on-centos-5-3/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Common Remediation Owner Enumeration (My Faux Standard In Development)</title>
		<link>http://www.chrisam.net/blog/2009/06/18/common-remediation-owner-enumeration-my-faux-standard-in-development/</link>
		<comments>http://www.chrisam.net/blog/2009/06/18/common-remediation-owner-enumeration-my-faux-standard-in-development/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 03:24:00 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.packetsense.net/blog/?p=90</guid>
		<description><![CDATA[So we&#8217;ve run into a small snag with our automation: Automatically assigning remediation owners. It&#8217;s easy for our UNIX pilot. The same group fixes all the OS vulnerabilities. When we start adding Windows into the mix, it gets a little harder. When a vulnerability is discovered for, let&#8217;s say Adobe Reader, we have different assignment [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve run into a small snag with our automation: Automatically assigning remediation owners. It&#8217;s easy for our UNIX pilot. The same group fixes all the OS vulnerabilities. When we start adding Windows into the mix, it gets a little harder.</p>
<p>When a vulnerability is discovered for, let&#8217;s say Adobe Reader, we have different assignment teams that remediate it depending on the device. We have a separate group of engineers for Windows Servers, Windows Workstations, and for our Citrix remote access applications. (Luckily, we&#8217;re not running Adobe Reader on our UNIX platforms)</p>
<p>Tomorrow, I will start working on the logic to automatically determine remediation ownership and assign it correctly. It will be a complicated process mapping Application Owners to Applications, and Applications to Platforms to Devices. There will be multiple application owners per application CPE (Common Platform Enumeration), but one application owner per Application CPE per Device CPE.</p>
<p>Do any of you already have a solution for this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/06/18/common-remediation-owner-enumeration-my-faux-standard-in-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting the data from the DB into the PHP Classes</title>
		<link>http://www.chrisam.net/blog/2009/06/17/getting-the-data-from-the-db-into-the-php-classes/</link>
		<comments>http://www.chrisam.net/blog/2009/06/17/getting-the-data-from-the-db-into-the-php-classes/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:21:15 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[measurable]]></category>

		<guid isPermaLink="false">http://www.packetsense.net/blog/?p=86</guid>
		<description><![CDATA[This is just an example. I have no idea how you store your data. This is the method that works for my database framework. You can see where it queries the DB and then calls the classes I posted earler. This code loops through all the vulnerability scan records in the database for the current [...]]]></description>
			<content:encoded><![CDATA[<p>This is just an example. I have no idea how you store your data. This is the method that works for my database framework. You can see where it queries the DB and then calls the classes I posted earler. This code loops through all the vulnerability scan records in the database for the current day. You would need to print the arrays somewhere to make it useful.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//I keep all my DB Login details in a separate file</span>
<span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'includes/db.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$myCvss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> cvss_details<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Get Info From DB:</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT vulns.server, vulns.cve_number, assets.business_risk, assets.data_risk, assets.location_risk, nvd_cve.cvss_score, nvd_cve.cvss_access_vector, nvd_cve.cvss_access_complexity, nvd_cve.cvss_authentication, nvd_cve.cvss_confidentiality_impact, nvd_cve.cvss_integrity_impact, nvd_cve.cvss_availability_impact FROM `vulns` LEFT JOIN (assets,nvd_cve) ON (assets.server=vulns.server AND nvd_cve.cve=vulns.cve_number) WHERE vulns.report_date = CURDATE()&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$myCvss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> cvss_details<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//debug defines</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_cve_number</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cve_number'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_nist_cvss</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_score'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_server</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'server'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Define Base Score Details</span>
	<span style="color: #666666; font-style: italic;">//Exploitability Metrics</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_access_vector</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_access_vector'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_access_complexity</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_access_complexity'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_authentication</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_authentication'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//Impact Metrics</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_conf_impact</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_confidentiality_impact'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_integ_impact</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_integrity_impact'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_avail_impact</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_availability_impact'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Environmental Score Metrics</span>
	<span style="color: #666666; font-style: italic;">//General Modifiers</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_collateral_damage_potential</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_target_distribution</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//Impact Subscore Modifiers</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_conf_req</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'data_risk'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_integ_req</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'location_risk'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_avail_req</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'business_risk'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Temporal Score Metrics</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_exploitability</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_remediation_level</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myCvss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_report_confidence</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$server_name</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'server'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$cve_number</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cve_number'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$cvss_base_score</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cvss_score'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$calc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> calculate_cvss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$cvss_overall_score</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$calc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">calculate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myCvss</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/06/17/getting-the-data-from-the-db-into-the-php-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Class for Calculating SCAP CVSS V2 Device Specific Score</title>
		<link>http://www.chrisam.net/blog/2009/06/17/php-class-for-calculating-scap-cvss-v2-device-specific-score/</link>
		<comments>http://www.chrisam.net/blog/2009/06/17/php-class-for-calculating-scap-cvss-v2-device-specific-score/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:09:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[measurable]]></category>

		<guid isPermaLink="false">http://www.packetsense.net/blog/?p=81</guid>
		<description><![CDATA[Did I mention that I wasn&#8217;t a programmer? If you can make improvements to this code, I&#8217;d love to hear from you. This is my hackjob of code for doing what I need to do. Anyway, here&#8217;s my calculator. The DB call code will be in another post. class calculate_cvss &#123; function calculate&#40;$cvssDetail&#41; &#123; $adjustedImpact [...]]]></description>
			<content:encoded><![CDATA[<p>Did I mention that I wasn&#8217;t a programmer? If you can make improvements to this code, I&#8217;d love to hear from you. This is my hackjob of code for doing what I need to do. Anyway, here&#8217;s my calculator. The DB call code will be in another post.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> calculate_cvss <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> calculate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cvssDetail</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$adjustedImpact</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">adjusted_impact</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conf_impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conf_req</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">integ_impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">integ_req</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">avail_impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">avail_req</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$adjustedImpactFunction</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">adjusted_impact_function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedImpact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$exploitabilitySubScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exploitability_subscore</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">access_complexity</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">authentication</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">access_vector</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$adjustedBaseScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">adjusted_base_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$adjustedImpactFunction</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$adjustedTemporalScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">adjusted_temporal_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedBaseScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exploitability</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remediation_level</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">report_confidence</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$adjustedTemporalScore</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$environmentalScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">environmental_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">collateral_damage_potential</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">target_distribution</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$impact</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">impact</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conf_impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">integ_impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">avail_impact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$impact</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$impactFunction</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">impact_function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$baseScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">base_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$impactFunction</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$baseScore</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$baseScore</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$temporalScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">temporal_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$baseScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exploitability</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remediation_level</span><span style="color: #339933;">,</span><span style="color: #000088;">$cvssDetail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">report_confidence</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$overallScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">overall_score</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$environmentalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$temporalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$baseScore</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Debug Printing</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;CVE Number: <span style="color: #006699; font-weight: bold;">$cvssDetail-&gt;cve_number</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Server:	<span style="color: #006699; font-weight: bold;">$cvssDetail-&gt;server</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Impact SubScore: <span style="color: #006699; font-weight: bold;">$impact</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Exploitability SubScore: <span style="color: #006699; font-weight: bold;">$exploitabilitySubScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;CVSS Temporal Score: <span style="color: #006699; font-weight: bold;">$temporalScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;CVSS Environmental Score: <span style="color: #006699; font-weight: bold;">$environmentalScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;--Adjusted Temporal Score: <span style="color: #006699; font-weight: bold;">$adjustedTemporalScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;--Collateral Damage Potential: <span style="color: #006699; font-weight: bold;">$cvssDetail-&gt;collateral_damage_potential</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;--Target Distribution: <span style="color: #006699; font-weight: bold;">$cvssDetail-&gt;target_distribution</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;NIST CVSS Score: <span style="color: #006699; font-weight: bold;">$cvssDetail-&gt;nist_cvss</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;CVSS Base Score: <span style="color: #006699; font-weight: bold;">$baseScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Overall CVSS Score: <span style="color: #006699; font-weight: bold;">$overallScore</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$overallScore</span>&quot;</span><span style="color: #339933;">;</span>				
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> adjusted_impact<span style="color: #009900;">&#40;</span><span style="color: #000088;">$confImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$confReq</span><span style="color: #339933;">,</span><span style="color: #000088;">$integImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$integReq</span><span style="color: #339933;">,</span><span style="color: #000088;">$availImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$availReq</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$adjustedImpact</span> <span style="color: #339933;">=</span> <span style="color: #990000;">min</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color:#800080;">10.41</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$confImpact</span><span style="color: #339933;">*</span><span style="color: #000088;">$confReq</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$integImpact</span><span style="color: #339933;">*</span><span style="color: #000088;">$integReq</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$availImpact</span><span style="color: #339933;">*</span><span style="color: #000088;">$availReq</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$adjustedImpact</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> adjusted_impact_function<span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedImpact</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedImpact</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$adjustedImpactFunction</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$adjustedImpactFunction</span> <span style="color: #339933;">=</span> <span style="color:#800080;">1.176</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$adjustedImpactFunction</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> exploitability_subscore<span style="color: #009900;">&#40;</span><span style="color: #000088;">$accessComplexity</span><span style="color: #339933;">,</span><span style="color: #000088;">$authentication</span><span style="color: #339933;">,</span><span style="color: #000088;">$accessVector</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$exploitabilitySubScore</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">*</span><span style="color: #000088;">$accessComplexity</span><span style="color: #339933;">*</span><span style="color: #000088;">$authentication</span><span style="color: #339933;">*</span><span style="color: #000088;">$accessVector</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> adjusted_base_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$adjustedImpactFunction</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$adjustedBaseScore</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">0.6</span><span style="color: #339933;">*</span><span style="color: #000088;">$adjustedImpact</span><span style="color: #339933;">+</span><span style="color:#800080;">0.4</span><span style="color: #339933;">*</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">-</span><span style="color:#800080;">1.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$adjustedImpactFunction</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$adjustedBaseScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> adjusted_temporal_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedBaseScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitability</span><span style="color: #339933;">,</span><span style="color: #000088;">$remediationLevel</span><span style="color: #339933;">,</span><span style="color: #000088;">$reportConfidence</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$adjustedTemporalScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$adjustedBaseScore</span><span style="color: #339933;">*</span><span style="color: #000088;">$exploitability</span><span style="color: #339933;">*</span><span style="color: #000088;">$remediationLevel</span><span style="color: #339933;">*</span><span style="color: #000088;">$reportConfidence</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> environmental_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$collateralDamagePotential</span><span style="color: #339933;">,</span><span style="color: #000088;">$targetDistribution</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$environmentalScore</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">-</span><span style="color: #000088;">$adjustedTemporalScore</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$collateralDamagePotential</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$targetDistribution</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$environmentalScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> overall_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$environmentalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$temporalScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$baseScore</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$environmentalScore</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temporalScore</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$overallScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$baseScore</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$overallScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temporalScore</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$overallScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$environmentalScore</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$overallScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> impact<span style="color: #009900;">&#40;</span><span style="color: #000088;">$confImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$integImpact</span><span style="color: #339933;">,</span><span style="color: #000088;">$availImpact</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$impact</span> <span style="color: #339933;">=</span> <span style="color:#800080;">10.41</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$confImpact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$integImpact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span><span style="color: #000088;">$availImpact</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$impact</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> impact_function<span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$impactFunction</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$impactFunction</span> <span style="color: #339933;">=</span> <span style="color:#800080;">1.176</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$impactFunction</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> base_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$impact</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$impactFunction</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$baseScore</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">.6</span><span style="color: #339933;">*</span><span style="color: #000088;">$impact</span><span style="color: #339933;">+</span><span style="color:#800080;">.4</span><span style="color: #339933;">*</span><span style="color: #000088;">$exploitabilitySubScore</span><span style="color: #339933;">-</span><span style="color:#800080;">1.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$impactFunction</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$baseScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> temporal_score<span style="color: #009900;">&#40;</span><span style="color: #000088;">$baseScore</span><span style="color: #339933;">,</span><span style="color: #000088;">$exploitability</span><span style="color: #339933;">,</span><span style="color: #000088;">$remediationLevel</span><span style="color: #339933;">,</span><span style="color: #000088;">$reportConfidence</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$temporalScore</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$baseScore</span><span style="color: #339933;">*</span><span style="color: #000088;">$exploitability</span><span style="color: #339933;">*</span><span style="color: #000088;">$remediationLevel</span><span style="color: #339933;">*</span><span style="color: #000088;">$reportConfidence</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$temporalScore</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chrisam.net/blog/2009/06/17/php-class-for-calculating-scap-cvss-v2-device-specific-score/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
