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

<channel>
	<title>Rob Garrett - Blog &#187; Security</title>
	<atom:link href="http://blog.robgarrett.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robgarrett.com</link>
	<description>Software and Technology Tid-bits</description>
	<lastBuildDate>Fri, 03 Feb 2012 21:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.robgarrett.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/aab8ef1df0f0164f4c766c98b644e9fb?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Rob Garrett - Blog &#187; Security</title>
		<link>http://blog.robgarrett.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.robgarrett.com/osd.xml" title="Rob Garrett - Blog" />
	<atom:link rel='hub' href='http://blog.robgarrett.com/?pushpress=hub'/>
		<item>
		<title>Windows Vista UAC &#8211; Further Reading</title>
		<link>http://blog.robgarrett.com/2007/01/04/windows-vista-uac-further-reading/</link>
		<comments>http://blog.robgarrett.com/2007/01/04/windows-vista-uac-further-reading/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 22:44:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2007/01/04/windows-vista-uac-further-reading.aspx</guid>
		<description><![CDATA[Then and Now Microsoft Windows XP™ initially creates all user accounts as local administrators. Administrators have full access to system-wide resources and can execute any privileged operation. Microsoft guidelines suggest that users run day-to-day tasks under a least privileged account (LUA), however many users prefer to operate at the administrator level for the following typical [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=2418&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Then and Now</h3>
<p>Microsoft Windows XP™ initially creates all user accounts as local administrators. Administrators have full access to system-wide resources and can execute any privileged operation. Microsoft guidelines suggest that users run day-to-day tasks under a least privileged account (LUA), however many users prefer to operate at the administrator level for the following typical reasons:</p>
<ul>
<li>Home users like administrator rights for similar reasons – applications are installed and available immediately without configuration in separate profile or execution restriction.</li>
<li>ActiveX controls are glorified COM controls deployable via the Internet and, like COM, require installation. LUA users typically do not receive installation rights, breaking the use of badly designed Active-X controls (controls requiring access to protected areas of the operating system).</li>
<li>Reduced dependency on helpdesk support – if users can install their own applications there is a reduced burden on the helpdesk and support group because there is no need for centralized deployment mechanisms (SMS, Group Policy) and/or system administrators to install applications manually.</li>
</ul>
<p>Ensuring that users operate day-to-day tasks as LUA mitigates the impact of malware on critical areas of the operating system and installed applications. However, standard users find they cannot perform typical configuration tasks (change the system time zone or install a printer) without administration rights. Moreover, some applications will not operate on Windows XP without using the “run-as” option or logging on as an administrator, usually involving special permission changes for legacy applications and opening up security vulnerabilities. Windows 95 and 98 had no security model, so legacy applications initially developed for these platforms that have migrated with subsequent versions may not consider security constraints.</p>
<h3>UAC &#8211; Under the Hood</h3>
<p>Windows Vista supports two types of user accounts – standard users and administrator users. Standard users behave much like the LUA user on Windows XP where protected resources on the platform are restricted without prompt for administrator credentials. Unlike the least privileged account-type on Windows XP, standard users can make more configuration changes than before. Only when standard users attempt to change a system-wide resource setting does Vista prompt for administrator credentials. Administrator accounts operate in one of two modes – filtered or elevated. Standard users receive a standard “filtered token,” denoting reduced permissions, upon logon, whereas administrators receive two tokens – the “filtered token” and a “full access token.” During normal operation, administrators use the filtered token, when attempting to execute privileged operations the <strong>Application Information Service</strong> – a system service facilitating the elevation of user privilege – will elevate the administrator to the higher full trust token.</p>
<h3>
Application Manifest Files and Elevation</h3>
<p>How does Vista know when to elevate? Firstly, to dispel a myth that elevation can occur at any time during the execution of a process – incorrect. The AIS determines required elevations on a per-process basis – and how exactly does it do that?</p>
<p>The Application Information Service makes some assumptions about certain applications – applications labeled “setup.exe,” “update.exe,” and MSI files (plus a few other criteria) are installation applications and AIS requests administrator full access credentials or confirmation. All other application types execute using the filtered token, unless an accompanied manifest file stipulates otherwise.</p>
<p>What is a manifest file?</p>
<p>A manifest file is an XML file associated with an executable application (EXE), containing metadata about the application, and may include trust information for elevation. The following is an example manifest file:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243; standalone=&#8221;yes&#8221;?&gt;</p>
<p>&lt;assembly xmlns=&#8221;urn:schemas-microsoft-com:asm.v1&#8243; manifestVersion=&#8221;1.0&#8243;&gt;</p>
<p>&lt;trustInfo xmlns=&#8221;urn:schemas-microsoft-com:asm.v3&#8243;&gt;</p>
<p>&lt;security&gt;</p>
<p>&lt;requestedPrivileges&gt;</p>
<p>&lt;requestedExecutionLevel level=&#8221;requireAdministrator&#8221; uiAccess=&#8221;true&#8221;/&gt;</p>
<p>&lt;/requestedPrivileges&gt;</p>
<p>&lt;/security&gt;&lt;/trustInfo&gt;</p>
<p>&lt;/assembly&gt;</p>
<p>In the above manifest file, the requestedExecutionLevel stipulates the required level and whether elevation is required. Possible levels of execution are:</p>
<ul>
<li><strong>asInvoker</strong> – The application executes at the same level as the standard user filtered token</li>
<li><strong>highestAvailable</strong> – The application executes at the highest level of privilege the user can obtain</li>
<li><strong>requireAdministrator</strong> – The application requires administrator full access token privilege</li>
</ul>
<p>.NET EXE assemblies are associated with manifest files when the manifest has the same name as the executable with a “.manifest” extension. For example, the executable test.exe is associated with the manifest file test.exe.manifest. Embedding of the manifest as a resource is also possible.</p>
<p>WIN32 executables also use a manifest to request elevation, although, unlike managed assemblies, WIN32 manifest files must embed in the executable file. The following information details embedding of a WIN32 manifest file:</p>
<p><a href="http://community.bartdesmet.net/blogs/bart/archive/2006/10/28/Windows-Vista-_2D00_-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt.exe.aspx">Link</a></p>
<h3>Default Behavior</h3>
<p>The following is the default behavior for Vista installations:</p>
<ul>
<li>UAC is enabled by default, so users may experience compatibility prompts with legacy applications</li>
<li>The first account created during Vista installation is an administrator account (with dual tokens), all subsequent created accounts are standard user accounts</li>
<li>The built in administrator account is disabled by default</li>
<li>Elevation prompts are displayed on the secure desktop</li>
</ul>
<h3></h3>
<h3>The Shield Icon</h3>
<p>Common practice is to display a “shield icon” on all controls that require elevation. The following image shows the date and time properties – the standard user can make configuration changes, however, if they press the “Change Date and Time” button AIS will prompt for administrator credentials or consent.</p>
<p>Wait a minute! How can an application prompt for elevation mid-process if AIS determines the execution level before execution?</p>
<p>Answer &#8211; Vista provides a clever mechanism called the “COM Elevation Moniker,” which is a mechanism in which applications can execute code in a WIN32 COM server, out of process executable, with elevated execution privileges. Further documentation on developing for Vista UAC provides more in depth detail on the COM Elevation Moniker.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/2418/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/2418/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/2418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/2418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/2418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=2418&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2007/01/04/windows-vista-uac-further-reading/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Vista &#8211; User Account Control</title>
		<link>http://blog.robgarrett.com/2007/01/04/windows-vista-user-account-control/</link>
		<comments>http://blog.robgarrett.com/2007/01/04/windows-vista-user-account-control/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 01:32:50 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2007/01/04/windows-vista-user-account-control.aspx</guid>
		<description><![CDATA[Presently, users of the Microsoft Windows™ operating system have had to face several challenges to secure the integrity of the data residing on their computer. Users have had to cope with the vast slew of malware, including viruses, spyware, and root-kits, which typically cause damage to data and/or applications residing on the user’s desktop pc. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=2417&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[</p>
<p>Presently, users of the Microsoft Windows™ operating system have had to face several challenges to secure the integrity of the data residing on their computer. Users have had to cope with the vast slew of malware, including viruses, spyware, and root-kits, which typically cause damage to data and/or applications residing on the user’s desktop pc. As quickly as anti-virus vendors release tools to prevent the threat of virus attack or spyware installation, hackers and script-kiddies release newer and smarter versions to work around the safeguards. Microsoft is constantly battling to produce patches and updates to close security vulnerabilities in their operating systems and applications, and now we live in a time where third-party developers are required to embed security aware code in their applications. </p>
<p>Prior to Windows XP Service Pack 2, the Windows platform did little to protect the user from malware. It was up to the initiative of individual users to install anti-virus and anti-spyware applications, and to keep up to date with the Windows patches and updates. Microsoft heard the cries of its customers, and in 2004 announced the release of Windows XP Service Pack 2. SP2 brought a number of security enhancements to the Windows platform in the flavor of enhanced firewall, Internet Explorer popup blocker, automatic updates, and security warnings about the execution of ActiveX controls from the web. </p>
<p>The existence of Windows XP SP2 was not enough to protect the end-user; SP2 went further to alert the user to suspicious activity from malware, but did not protect the users from their own mistakes. For example, many users fail to acknowledge the importance of the message contained in security prompts and blindly ignore the warnings to accomplish their task. Third party applications and web browsers not taking advantage of SP2 security constraints are still able to download malware from the Internet without detection. In 2005, Song BMG Music Entertainment installed root kit software on their audio CDs to circumvent piracy and to provide Sony with music listener statistics – users running Windows full administrator privileged accounts were susceptible to the root-kit from simply inserting these audio CDs in their CDROM tray. </p>
<p>Most of aforementioned problems with malware have one thing in common – they all operate on the assumption that the interactive user is running with full administrator privileges. By default, Windows XP installs a default “Administrator” account, and most users perform their day-to-day tasks under this account. Use of administrator accounts alleviates execution problems with poorly written applications &#8211; software that unnecessarily uses privileged areas of the operating system, provides the convenience of on the spot installation of applications without switching accounts (and sometimes a reboot), and gives the user total control over the operating system. The first step in the direction of securing the Windows platform is to restrict the everyday user to least user privilege – LUA.  </p>
<p>Converting to LUA is only half of the battle – many applications (non-XP certified) will not execute properly without administrative privileges. Services and third-party background processes still act as security vulnerability because they execute in higher privileged contexts, and can provide a security hole for hackers to exploit. Microsoft has stepped up to the plate and has provided a potential solution to lessen the security concerns from users of its Windows platform – enter Windows Vista and User Access Control.<br />
<h4>Windows Vista – Providing a more secure environment</h4>
</p>
<p>Security is not a process &#8211; it is a mentality, and must be considered from the initial development of software applications, though to user execution. Developers writing software atop the .NET Framework can take advantage of Code Access Security – restrictions applied to code elements for different execution contexts – to protect the user at the application level, and now Microsoft have taken the next step and added enhanced security restriction at the operating system level in the form of User Access Control on the Vista platform. </p>
<p>What is UAC? </p>
<p>&nbsp;Regardless of whether a particular user has administrator rights, all users logging on to the Vista platform receive a “filtered token” at login time, which prevents access to security sensitive operations. When the time comes to execute a privileged operation, the user must elevate to a higher level of operation. </p>
<p>What does this mean to the end user? </p>
<p>Users without administration rights attempting to execute a privileged operation observe a request for administration credentials. This is akin to the “run-as” operation on Windows XP/2003 where a user can execute a process as another user, except UAC enables elevation for particular privileged operations, not just the execution of an application. </p>
<p>Microsoft refers to this process of elevation request as “over-the-shoulder” credentials.</p>
<p><img /></p>
<p>Users with administration rights also experience the effects of UAC. Since all users, administrators included, login with a filtered token UAC will prompt administrators with a consent dialog before promoting to an elevated token for secure execution. </p>
<p><img /></p>
<p>It is worth noting that Windows determines elevation requirements before a process is executed and if elevation is required the entire process is elevated to the privileged level upon successful OTS credential or administrator consent.</p>
<p>UAC consists of more than just elevation. Effectively, UAC does away with the “Power Users” group, which provided users with administrative privileges to perform basic system tasks while running applications. UAC now enables standard users to perform standard configuration tasks and Windows will prompt for elevation for specific privileged operations. </p>
<p>UAC provides a short-term solution for legacy applications operating in “XP compatibility” mode with a virtual file system and registry. When a legacy application requires write permission to a protected area of the file system or registry, the changes affect a virtual copy allowing the legacy application to function without hurting the operating system. Microsoft intends this solution as short-term as developers begin to author UAC aware applications. </p>
<p>Windows prompts for elevation via a secure desktop to prevent malicious applications from tricking users into requesting elevation without their knowledge – whilst the consent/credential dialog is visible; the user is operating within a secure desktop, preventing any software applications from interacting with the user interface.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/2417/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/2417/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/2417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/2417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/2417/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=2417&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2007/01/04/windows-vista-user-account-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Code Access Security – A Primer</title>
		<link>http://blog.robgarrett.com/2006/06/01/code-access-security-%e2%80%93-a-primer/</link>
		<comments>http://blog.robgarrett.com/2006/06/01/code-access-security-%e2%80%93-a-primer/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 05:37:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2006/05/31/1994.aspx</guid>
		<description><![CDATA[Overview This post serves as a primer for software developers interested in learning about Code Access Security (CAS) in .NET. The following information is not exhaustive of the subject matter and contains the basic overview of Code-Access-Security. Those interested in this subject are encouraged to read further. The following articles cover code security and are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1994&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<h1>Overview<br />
</h1>
</div>
<p>This post serves as a primer for software developers interested in learning about Code Access Security (CAS) in .NET.  The following information is not exhaustive of the subject matter and contains the basic overview of Code-Access-Security.  Those interested in this subject are encouraged to read further.
</p>
<p>The following articles cover code security and are a good follow-up to this post.
</p>
<p><a href="http://www.codeproject.com/dotnet/UB_CAS_NET.asp">http://www.codeproject.com/dotnet/UB_CAS_NET.asp<br />
</a></p>
<p><a href="http://msdn.microsoft.com/msdnmag/issues/05/11/CodeAccessSecurity/default.aspx">http://msdn.microsoft.com/msdnmag/issues/05/11/CodeAccessSecurity/default.aspx</a><span style="font-size:10px;"><br />
		</span></p>
<p><a href="http://msdn.microsoft.com/msdnmag/issues/05/11/HostingAddIns/">http://msdn.microsoft.com/msdnmag/issues/05/11/HostingAddIns/</a>
	</p>
<p>Shawn Farkas is one of many experts on Code Access Security, and as well as the author of many magazines, he posts regularly on his weblog:
</p>
<p><a href="http://blogs.msdn.com/shawnfa/">http://blogs.msdn.com/shawnfa/</a><span style="font-size:10px;"><br />
		</span></p>
<p>
&nbsp;</p>
<div>
<h1>What is Code Access Security?<br />
</h1>
</div>
<p>Most computer users and security experts are accustomed to Role-Based Security (RBS), where particular users belong to specific groups, assigned permissions to protected resources.  Windows XP/2003, SQL Server, IIS, and a host of server applications use Role-Based Security to provide access protection.
</p>
<p>Code Access Security is different to Role-Based Security in that it restricts access to protected resources at the code level.  Coming from a role-based way of thinking, code access security can be a confusing concept because there is no user attempting access in the typical sense.  Code Access Security defines a set of permissions and the policy, which defines assignment of those permissions, by evaluating the evidence belonging to the code requesting access.
</p>
<p>
&nbsp;</p>
<div>
<h1>Why should we care about Code Access Security?<br />
</h1>
</div>
<p>Typically, software development and security roles are very distinctive:
</p>
<p><em>Software developers create software to run on workstations and servers, and security experts lock down access at the user level to these workstations and servers</em>.
</p>
<p>The above approach has been in place for as long as developers have been creating software and the software has been manipulating secured data; however, this methodology has a few flaws:
</p>
<ul>
<li>
<div>Deployment of software in the above scheme is troublesome – developers are used to writing and testing software with a full set of permissions.  When deploying software, developed in this fashion, in a locked-down environment, the software often fails.
</div>
</li>
<li>
<div>The best software developers are not always the best security experts, and vice versa.  Software developers hate to work through security constraints and security experts often like to lock down systems to the point where they are sometimes unusable.
</div>
</li>
</ul>
<p>Code Access Security is a new way of thinking.  Just as industry has learned that performance is not a last minute consideration in the software development lifecycle, neither is security.  Code Access Security prevents malicious code penetrating secure systems by detecting insecure code before it executes, and potential security holes be pinpointed to code modules that demand a higher permission set.</p>
<p>With Code Access Security, you can:
</p>
<ul>
<li>
<div>Restrict what code can do
</div>
</li>
<li>
<div>Restrict who can call code
</div>
</li>
<li>
<div>Identify code
</div>
</li>
</ul>
<p>Code Access Security works hand-in-hand with security design and threat modeling, in that any .NET assembly can be marked as “security transparent.”  Security transparent assemblies contain code that does not access protected resources, and is safe to operate in partial trust environments.  More on security transport assemblies later in this  post.
</p>
<p>Some environments, in which custom code may execute, are partial trust.  Microsoft guidelines suggest that all ASP.NET installations hosting multiple applications be set at medium trust to guarantee autonomy.  Developers writing code for hosted environments will have no choice but to make sure their code runs at ASP.NET medium trust level.  The next version of SharePoint (Office 12 Server and WSS 3.0) operates at partial trust out of the box.
</p>
<p>
&nbsp;</p>
<div>
<h1>The Fundamentals<br />
</h1>
</div>
<p>As mentioned in the previous section, Code Access Security does not use user or role identification, so how does Code Access Security in .NET work?
</p>
<p>Before execution of verifiable code, the .NET platform determines if the code has permission to complete its function successfully.  This process involves collecting information about the code – <strong>evidence</strong>, determining the required <strong>permissions</strong> to complete execution by obtaining the current <strong>policy</strong> for the enterprise/machine/user/app domain.  The list below further documents the main constituents to Code Access Security:
</p>
<ul>
<li>
<div><strong>Evidence</strong> is a set of attributes that belong to code.  For example, certain .NET assemblies may be strong named and have a particular public key token.  Other assemblies may have originated via “Click Once Deployment” at a certain web address, or reside within a particular directory on the file system.</p>
</div>
</li>
<li>
<div><strong>Permissions</strong> represent access to a protected resource or the ability to perform a protected operation.  The .NET Framework provides a number of classes that represent different permissions.  For example, if some code needs access to files on disk then a <span style="font-family:Courier New;font-size:10px;">FileIOPermission</span> is required; the <span style="font-family:Courier New;font-size:10px;">ReflectionPermission </span>is required for any code that attempts to perform refection, etc.</p>
</div>
</li>
<li>
<div><strong>Permission Set</strong> is a collection of permissions.  The system defines several permission sets and different assemblies in a .NET application may fall into zero, one or more of these permission sets.  The Framework defines a number of default permission sets, including “<em>Full Trust”</em> – a set that contains all permissions, and “<em>Nothing”</em> – a set that contains no permissions.</p>
</div>
</li>
<li>
<div><strong>Code Group</strong> is mapping of evidence to permission sets.  Code groups combine to form a tree where code must exhibit the desired evidence to satisfy membership of the group.
</div>
</li>
<li>
<div><strong>Security Policy</strong> is a configurable set of rules that the CLR follows when determining the permissions to grant to code.  There exist four independent policy levels:</p>
</div>
</li>
</ul>
<ul>
<li>
<div>Enterprise – All managed code in an enterprise setting
</div>
</li>
<li>
<div>Machine – All managed code on a single computer
</div>
</li>
<li>
<div>User – Managed code in all processes associated with the current user
</div>
</li>
<li>
<div>Application Domain – Managed code in the host’s application domain</div>
</li>
</ul>
<div>
<div>
<h1>What about ASP.NET?<br />
</h1>
</div>
</div>
<p>ASP.NET builds atop of Code Access Security and provides five permission sets; each set depicted as a trust level:
</p>
<ul>
<li>
<div>Full
</div>
</li>
<li>
<div>High
</div>
</li>
<li>
<div>Medium
</div>
</li>
<li>
<div>Low
</div>
</li>
<li>
<div>Minimal
</div>
</li>
</ul>
<p>Each trust level above contains permissions, ranging from a complete set of permissions &#8211; “Full” trust &#8211; to limited permissions &#8211; “Minimal” trust.
</p>
<p>A separate policy configuration file exists for each trust level and packaged with the ASP.NET installation.  An ASP.NET application stipulates the level of trust and location of policy file in the application configuration file (web.config):
</p>
<p><span style="font-family:Courier New;font-size:10px;">&lt;trustLevel name="High" policyFile="web_hightrust.config"/&gt;<br />
</span></p>
<p>Applications that operate in partial trust (not full trust) and require elevated permissions can run in a higher trust level or by defining custom permissions in a new policy file.  If an application only requires a handful of permissions, not present at the current trust level, then it makes sense to define a custom policy and permission set.  Increasing the trust level may add many more permissions not required by the application, creating security vulnerability.
</p>
<p>
&nbsp;</p>
<div>
<h1>Applying Code Access Security<br />
</h1>
</div>
<p>Two different kinds of syntax are available when adding Code Access Security to code: declarative and imperative.
</p>
<p>Declarative syntax involves applying attributes to methods, classes, or assemblies.  The “Just-in-Time” (JIT) compiler reads meta-data generated from these attributes to evaluate these calls.
</p>
<p><span style="font-family:Courier New;font-size:10px;">
</p>
<p></span>[FileIOPermission(SecurityAction.Demand, Unrestricted=true)]
<br />
public class Foo { ... }
<br />

<p>Imperative syntax involves the use of method calls to create instances of security classes at runtime.
</p>
<p><span style="font-family:Courier New;font-size:10px;">
</p>
<p></span>public class Foo
<br />
{
<br />
public void MethodOne(..)
<br />
{
<br />
    new FileIOPermission(PermissionState.Unrestricted).Demand();
<br />
}
<br />
}
<br />

<p>Both of the examples above are requesting unrestricted access to the file system.  Most of the security permission classes in the .NET framework provide properties to customize the level of access; the <span style="font-family:Courier New;font-size:10px;">FileIOPermission</span> includes properties to permit read/write access to particular files and directories in the file system.  The example below permits all access to a particular file by changing the parameters passed to the constructor:
</p>
<p><span style="font-family:Courier New;font-size:10px;">new FileIOPermission(FileIOPermissionAccess.AllAccess,"C:\Test.txt").Demand();<br />
</span></p>
<p>So, what happens when code declares a security permission attribute or instantiates a new permission class imperatively?
</p>
<p>All three examples above call a “demand” on the desired permission class.  The demand instructs the CLR to walk the call stack of the current process making sure that each method call has the desired permission requested.  If one of the calling methods in the stack does not have the permission then the CLR throws a security exception.
</p>
<p>Most of the classes in the .NET Framework demand (or link demand) permissions when accessing protected resources.  If a developer writes code that uses one of the framework classes, say to access a database or perform reflection, and the developer’s code is running in partial trust, then the developer’s code must the desired permission, otherwise the CLR will throw a security exception.
</p>
<p>By default, any code developed against the .NET framework runs as “full trust.” except in the following cases:
</p>
<ul>
<li>
<div>The developer explicitly creates a sandbox application domain with partial trust
</div>
</li>
<li>
<div>Configures application assemblies as partial trust using the .NET Framework Configuration tool
</div>
</li>
<li>
<div>Runs the application code in ASP.NET at a trust level other than full
</div>
</li>
<li>
<div>Is running the code in some other host application preconfigured to partial trust
</div>
</li>
<li>
<div>The code is executed across a network
</div>
</li>
</ul>
<p>When operating at “full trust” all security demands made by classes in the framework (or by custom developer classes that are security aware) succeed.  Only during deployment to a partial trust environment is there a problem.  Developers should get in the habit of developing under partial trust when developing code that access protected resources.
</p>
<p>Permission demand is one of several actions that applicable to permission classes, other actions available are:
</p>
<ul>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.Demand</span> – All callers higher in the call stack must have the permission specified by the current permission object.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.LinkDemand</span> –Only the immediate caller in the call stack must have the permission specified by the current permission object.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.InheritanceDemand</span> &#8211; Derived classes or overriding methods must have the permission specified by the current permission object.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.Assert</span> – If the calling code has the desired permission then the stack walk for permission check stops.  Use asserts only when encapsulating code that is known to be secure because callers further up the stack running in partial trust may not be aware of a demand further down the chain.  Code containing asserts without the actual permission will allow permission checking to continue up the call stack.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.Deny</span> – Callers cannot access a protected resource specified by the permission, even if the caller has permission to access the resource.  So if a method in the call stack specifies a deny action and a method further down the chain attempts to access the resource, regardless of whether they have the permission, the method lower in the call stack will fail access.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.PermitOnly</span> &#8211; Link a deny action only a permit only action specifies that the caller is denied access to all resources except for those defined in the current permission object.  Further definition of this action is beyond the scope of this post.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.RequestMinimum</span> &#8211; Only used within the scope of an assembly, this action defines the set of minimum permissions required for the assembly to execute.</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.RequestOptional</span> – Only used within the scope of an assembly, this action defines the set of permissions optional to execute (not required).</p>
</div>
</li>
<li>
<div><span style="font-family:Courier New;font-size:10px;">SecurityAction.RequestRefuse</span> &#8211; Only used within the scope of an assembly, this action defines a set of permissions that may be requested and misused, and should therefore never be granted, even if the current security policy allows it.  Further definition of this action is beyond the scope of this post.
</div>
</li>
</ul>
<p>Asserts deserve special consideration because they prevent permission demands from reaching callers higher in the call stack.  Asserts are useful when a method is required to call some code that demands higher permission and the caller of the method is in partial trust.  For example, a trusted custom assembly with elevated trust could call out to the file system using one of the framework API calls; the framework will demand a <span style="font-family:Courier New;font-size:10px;">FileIOPermission</span>, which must not propagate beyond the level of the custom assembly.  Placing assert code around the call to the file system API will ensure that that demand never leaves the scope of the method containing the assert code.  The custom assembly must have the <span style="font-family:Courier New;font-size:10px;">FileIOPermission</span>, otherwise the assert code is ignored and demands will continue up the stack to partial trusted code.  The following is an example of an assertion code around a call to a method, which demands security permission.  Notice the revert call at the end of the code, this revert will cancel the assert code.  It is important to limit the scope of assertion so to avoid creating a security vulnerability, place only the code that requires the security permission between the assert call and the revert call.
</p>
<p><span style="font-family:Courier New;font-size:10px;"></span></p>
<p>new FileIOPermission(PermissionState.Unrestricted).Assert();
<br />
// Do something that causes a FileIOPermission
<br />
CodeAccessPermission.RevertAssert();
<br />

<p>
&nbsp;</p>
<div>
<h1>Transparent Assemblies<br />
</h1>
</div>
<p>Transparent assemblies are .NET assemblies that are free from security critical code.  The .NET Framework 2.0 enables developers to define assemblies as transparent so that security audits can rule out these assemblies as potentially security vulnerable.  Transparent assemblies voluntarily give up the ability to elevate the permissions of the call stack, and the following rules apply:
</p>
<ul>
<li>
<div>Transparent code cannot asset for permissions to stop a stack walk from continuing
</div>
</li>
<li>
<div>Transparent code cannot satisfy a link demand
</div>
</li>
<li>
<div>Unverifiable code is forbidden in transparent assemblies
</div>
</li>
<li>
<div>Calls to P/Invoke or unmanaged code will cause a security permission demand
</div>
</li>
</ul>
<p>Security transparent assemblies run either at the permission level granted, or at the permission level of the caller, whichever is less.
</p>
<p>By default, all assemblies are security critical – the opposite of security transparent – but made into a transparent assembly by adding the following attribute at the assembly level:
</p>
<p><span style="font-family:Courier New;font-size:10px;">[assembly:SecurityTransparent]<br />
</span></p>
<p>The CLR throws a security exception if a transparent assembly attempts to elevate permissions.  In cases where the developer wants to make the entire assembly as transparent, except for a few methods, use the following attribute:
</p>
<p><span style="font-family:Courier New;font-size:10px;">[assembly:SecurityCritical]<br />
</span></p>
<p>The attribute named above is a little misleading in that it marks the entire assembly as transparent but allows security critical code.  Decorate methods that require elevated as follows:
</p>
<p><span style="font-family:Courier New;font-size:10px;">
</p>
<p></span>[SecurityCritical]
<br />
public void foo()
<br />
{
<br />
new FileIOPermission(PermissionState.Unrestricted).Demand();
<br />
…..
<br />
}
<br />

<p>
&nbsp;</p>
<div>
<h1>Allowing Partially Trusted Callers<br />
</h1>
</div>
<p>By default, strongly named, trusted assemblies obtain an implicit link demand for full trust on every public method of every publicly available class within the assembly.  The CLR performs this insertion to protect fully trusted assemblies from misused by attackers.  For example, a trusted assembly may have full access to loading a disk file.  An attacker realizes that the assembly has not been security audited, and can manipulate the file loaded.  The implicit link demand ensures that the attacker cannot execute the method if not running in full trust.
</p>
<p>Assuming developers have security audited their code and want to allow partially trusted callers to call a full trusted assembly – the “Allow Partially Trusted Callers Attribute” (APTCA) enables developers to suppress the implicit link demand:
</p>
<p><span style="font-family:Courier New;font-size:10px;">[assembly: AllowPartiallyTrustedCallers]<br />
</span></p>
<p><strong>Developers should take the utmost care when enabling partially trusted callers to call trusted assemblies.<br />
</strong></p>
<p>Some APTCA assemblies may still demand or link demand explicit permissions, in which case the addition of the APTCA does not remove the explicit demands, and a security exception generated in partially trusted code. </p>
<p></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1994/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1994/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1994/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1994/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1994/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1994&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2006/06/01/code-access-security-%e2%80%93-a-primer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>LUA Bugs</title>
		<link>http://blog.robgarrett.com/2006/03/04/lua-bugs/</link>
		<comments>http://blog.robgarrett.com/2006/03/04/lua-bugs/#comments</comments>
		<pubDate>Sat, 04 Mar 2006 11:30:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2006/03/04/1871.aspx</guid>
		<description><![CDATA[So, you&#8217;ve made the jump to Least Privileged User Account (LUA), but some of your applications no longer work&#8230;.&#160; These are known as &#8220;LUA Bugs&#8221;, and Aaron Margosis has written a post about fixing them.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1871&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;ve made the jump to Least Privileged User Account (LUA), but some of your applications no longer work&#8230;.&nbsp; These are known as &#8220;LUA Bugs&#8221;, and Aaron Margosis has written a <a href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx">post</a> about fixing them.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1871/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1871/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1871/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1871/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1871/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1871&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2006/03/04/lua-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>LUA and Windows XP</title>
		<link>http://blog.robgarrett.com/2006/01/25/lua-and-windows-xp/</link>
		<comments>http://blog.robgarrett.com/2006/01/25/lua-and-windows-xp/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 18:06:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2006/01/25/1826.aspx</guid>
		<description><![CDATA[For those of you that read my blog often (or talk to me directly), you&#8217;ll know that I am constantly advocating that users operate their computers under a least-privileged user account &#8211; LUA.&#160; Many have taken my advice, of not running day-to-day operations under an administrator account, or account with elevated privileges (yes, that includes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1826&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those of you that read my blog often (or talk to me directly), you&#8217;ll know that I am constantly advocating that users operate their computers under a least-privileged user account &#8211; LUA.&nbsp; Many have taken my advice, of not running day-to-day operations under an administrator account, or account with elevated privileges (yes, that includes accounts in the Power Users group on Windows).&nbsp; Most MAC and Linux users know this concept already, but there are still a staggering number of Windows users who still insist that they need elevated privileges to operate their PC.&nbsp; </p>
<p>Well, you no longer need to take my word for granted, Microsoft has recently published a white paper on the merits of operating as LUA, and the paper can be downloaded <a href="http://www.microsoft.com/downloads/details.aspx?familyid=6a1291e7-9ecd-4d5d-9eeb-308c5d522e14&amp;displaylang=en">here</a>.&nbsp; If you&#8217;re a Windows XP user, I strongly advice that you read this paper, it&#8217;ll open your eyes to how easy it can be to prevent spy ware, viruses, and other malicious code on the Windows platform.</p>
<p>Many thanks to Robert Hurlbut for bringing this paper to my attention via his <a href="http://weblogs.asp.net/rhurlbut/archive/2006/01/19/435912.aspx">blog</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1826/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1826/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1826/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1826/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1826/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1826&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2006/01/25/lua-and-windows-xp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Sony is still advising users to install their rootkit&#8230;</title>
		<link>http://blog.robgarrett.com/2005/11/17/sony-is-still-advising-users-to-install-their-rootkit/</link>
		<comments>http://blog.robgarrett.com/2005/11/17/sony-is-still-advising-users-to-install-their-rootkit/#comments</comments>
		<pubDate>Thu, 17 Nov 2005 23:15:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2005/11/17/1711.aspx</guid>
		<description><![CDATA[Quoted from:&#160; http://cp.sonybmg.com/xcp/english/howtouse.html To install the software on this disc, you must have Administrator rights on your computer. Administrator rights are typically the default setting for home computers, however, in many work environments it is not the default setting. If you do not have Administrator rights, log out of your account and log in as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1711&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quoted from:&nbsp; <a href="http://cp.sonybmg.com/xcp/english/howtouse.html">http://cp.sonybmg.com/xcp/english/howtouse.html</a></p>
<p><i>To install the software on this disc, you<br />
                                  must have Administrator rights on your computer.<br />
                                  Administrator rights are typically the default<br />
                                  setting for home computers, however, in many<br />
                                  work environments it is not the default setting.<br />
                                  If you do not have Administrator rights, log<br />
                                  out of your account and log in as an Administrator</i>.</p>
<p>The above statement should cause a light bulb to illuminate in your head.&nbsp; </p>
<p>Q: Why would a least privileged user (LUA) require administrative permissions to play an audio CD on a Windows/Mac computer?<br />
A: Because it is trying to install something nasty on your computer.</p>
<p>Yet another reason why I am an advocate for LUA.</p>
<p></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1711/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1711/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1711/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1711&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2005/11/17/sony-is-still-advising-users-to-install-their-rootkit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Avoiding Sony&#8217;s DRM Rootkit</title>
		<link>http://blog.robgarrett.com/2005/11/10/avoiding-sonys-drm-rootkit/</link>
		<comments>http://blog.robgarrett.com/2005/11/10/avoiding-sonys-drm-rootkit/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 14:04:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2005/11/10/1700.aspx</guid>
		<description><![CDATA[It may not have escaped your attention that Sony has been featured in the news a lot recently, concerning proven allegations about Sony BMG installing DRM root kits on Windows computers, belonging to consumers: http://news.bbc.co.uk/2/hi/technology/4400148.stm Essentially, root kits are malicious pieces of software that are installed in the lower-levels of the Windows operating system, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1700&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It may not have escaped your attention that Sony has been featured in<br />
the news a lot recently, concerning proven allegations about Sony BMG<br />
installing <acronym title="Digital Rights Management">DRM</acronym> root kits on Windows computers, belonging to consumers: </p>
<p><a href="http://news.bbc.co.uk/2/hi/technology/4400148.stm">http://news.bbc.co.uk/2/hi/technology/4400148.stm</a></p>
<p>Essentially, root kits are malicious pieces of software that are<br />
installed in the lower-levels of the Windows operating system, which<br />
can hide from anti-spy ware and anti-virus checkers.&nbsp; Sony<br />
claim that they employed the use of root kits to install digital rights management<br />
software on Windows PCs to limit the damage to the corporation as a<br />
result of piracy.&nbsp; Consumers believe that Sony has gone too far in<br />
their efforts.&nbsp; The root kit was originally <a href="http://www.sysinternals.com/blog/2005/10/sony-rootkits-and-digital-rights.html">discovered by Mark<br />
Russinovich</a> after running &#8220;<a href="http://www.sysinternals.com/Utilities/RootkitRevealer.html">root kit revealer</a>&#8221; &#8211; an application,<br />
engineered by <a href="http://www.sysinternals.com/">Sysinternals</a>, to find root kits on a Windows platform -<br />
on his computer.</p>
<p>So, how do you avoid Sony&#8217;s root kit, and any other root kit that might be lurking in software?</p>
<p><b>Operate your PC under <acronym title="Least-privileged User Account">LUA</acronym></b>.&nbsp; Root kit installers need access to low-level OS functions, drivers, and possibly the kernel to operate &#8211; <i>non of these areas are available when running as LUA</i>.&nbsp; </p>
<p>LUA will not protect you from root kits hidden in software that you<br />
actively install as an administrator, but will prevent passive<br />
installers from burying root kits in your Windows operating system<br />
without your knowledge.&nbsp; So, you will still need to be diligent<br />
when installing software (know where the software came from, is it<br />
reputable?, is there any known press about the use of root kits<br />
associated with the software vendor?), but will not have to worry so<br />
much about hidden software being installed when you plop an audio CD or DVD in your<br />
computer.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1700/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1700/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1700/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1700&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2005/11/10/avoiding-sonys-drm-rootkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging ASP.NET as non-admin (LUA)</title>
		<link>http://blog.robgarrett.com/2005/11/09/debugging-asp-net-as-non-admin-lua/</link>
		<comments>http://blog.robgarrett.com/2005/11/09/debugging-asp-net-as-non-admin-lua/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 00:51:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2005/11/09/1698.aspx</guid>
		<description><![CDATA[See my previous post about LUA, and why it is a good idea.&#160; Today I managed to get ASP.NET 2.0 to debug correctly, using Visual Studio .NET 2005 under LUA.&#160; Thanks to Andrew Duthie&#8217;s post.&#160; I needed to tweak my system a little, here are my steps in digest (II6 only): 1. Create a new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1698&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>See my <a href="http://robgarrett.com/blogs/software/archive/2005/11/09/1697.aspx">previous post about LUA</a>, and why it is a good idea.&nbsp; Today<br />
I managed to get ASP.NET 2.0 to debug correctly, using Visual Studio<br />
.NET 2005 under LUA.&nbsp; Thanks to Andrew Duthie&#8217;s <a href="http://blogs.msdn.com/gduthie/archive/2004/11/17/258856.aspx">post</a>.&nbsp; I needed to tweak my system a little, here are my steps in digest (II6 only):</p>
<p>1. Create a new user group (Control Panel, Administrative Tools, Computer Manager, Local Users and Groups), called ASPNETDebug.<br />
2. Add the LUA user to the ASPNETDebug group.<br />
3. Add the LUA user to the IIS_WPG group.<br />
4. Modify the following local account policies (Control Panel,<br />
Administrative Tools, Local Security Policy, Security Settings, Local<br />
Policies, User Rights Assignments):</p>
<ul>
<li>&#8220;Adjust memory quotas for a process&#8221; &#8211; add the ASPNETDebug user group.</li>
<li>&#8220;Replace a process level token&#8221; &#8211; add the ASPNETDebug user group.</li>
</ul>
<p>5. Modify the NTFS permissions on the following directories, and add the ASPNETDebug group with modify permissions:</p>
<ul>
<li><font face="Courier New" size="2">%windows%temp</font></li>
<li><font face="Courier New" size="2">%windows%Microsoft.NETFramework%framework version%Temporary ASP.NET Files</font></li>
</ul>
<p>6. Create a new application pool in IIS 6 (not based on any other app pool).<br />
7. Change the identity of the newly created application pool to the LUA.<br />
8. Change the app pool of ASP.NET web site application being debugged to the newly created app pool.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1698/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1698/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1698/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1698&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2005/11/09/debugging-asp-net-as-non-admin-lua/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>Running as Non-Admin</title>
		<link>http://blog.robgarrett.com/2005/11/09/running-as-non-admin/</link>
		<comments>http://blog.robgarrett.com/2005/11/09/running-as-non-admin/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 00:31:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2005/11/09/1697.aspx</guid>
		<description><![CDATA[I have recently converted my developer workstations over to running as non-admin.&#160; I was inspired to move over to a least-privilege user account after sitting in on a talk by Randy Hayes – president for the CMAP (Central Maryland Association of .NET Professionals) user group.&#160; The principle theme of Randy’s talk was about better protecting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1697&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have recently converted my developer workstations over to running as<br />
non-admin.&nbsp; I was inspired to move over to a least-privilege user<br />
account after sitting in on a talk by Randy Hayes – president for the<br />
CMAP (Central Maryland Association of .NET Professionals) user<br />
group.&nbsp; The principle theme of Randy’s talk was about better<br />
protecting your Windows machine from spy ware and viruses by running as<br />
a non-admin.</p>
<p>Since being part of the audience for Randy’s talk I have been preaching<br />
the need to run as a least-privilege user account (LUA) to all my<br />
friends, family and work colleagues, so I decided to write up a post on<br />
the subject.</p>
<p>I am not too proud to announce that Randy’s talk changed the way in<br />
which I think of security on the Windows platform, and this post is<br />
testament to his teaching.&nbsp; With a few exceptions, most of the<br />
details in this post are from Randy’s talk.</p>
<p><span style="text-decoration:underline;font-weight:bold;">The Problem</span><br />
Your Windows computer is under attack!&nbsp; If you take a fresh<br />
install of Windows XP, sans-service pack and patches, and then connect<br />
it directly to the Internet, within seconds your machine will likely be<br />
compromised by a virus or spy ware applications.&nbsp; Installation of<br />
service packs, use of a firewall and network address translation (using<br />
a router) can all help, but what about malicious code that gets<br />
downloaded to your PC by you? </p>
<p>Each web site that you visit, from your computer, has the potential to<br />
host malicious code, which is downloaded, installed and executed<br />
without you even knowing about it.&nbsp; If you are not careful about<br />
opening email attachments from unknown senders, you could also be<br />
opening yourself up for attack.</p>
<p>I hear the same complaints when I speak to peers and family members –<br />
“My Windows machine is running and slow and/or swamped with<br />
viruses”.&nbsp; Conversely, when I speak to Macintosh and Linux users,<br />
I do not hear quite as many complaints – why is that?&nbsp; The answer<br />
has nothing to do with Windows having a larger user base, but more<br />
likely because Windows is easy to penetrate due to the default user<br />
account holding administrator privileges.</p>
<p><span style="font-weight:bold;text-decoration:underline;">A Potential Solution</span><br />
Industry has an answer to the mass amounts of spy ware and virus<br />
applications that attack the Windows operating system, in the form of<br />
utilities, which scan your computer and remove malicious code that has<br />
been detected.</p>
<p>There are so many different anti-virus and anti-spy ware utilities to<br />
choose from.&nbsp; Some are better than others, some are free, some are<br />
expensive, some require subscription, some do not, but they all have<br />
suffer from one inherent problem – Utilities are only effective in<br />
detecting known malicious code.&nbsp; So what about malicious code that<br />
we do not yet know about?</p>
<p>As fast as developers can develop code to detect known anti-virus and<br />
spy-ware, the faster new breeds of malicious code are invented and<br />
released on the Internet.&nbsp; This leaves your machine open to attack<br />
while you wait for the next release of service pack.&nbsp; </p>
<p><span style="font-weight:bold;text-decoration:underline;">A Better Solution</span><br />
A better solution involves lowering that attack service on your<br />
computer – running as LUA.&nbsp; When you operate your day-to-day tasks<br />
under and account with administrator privileges the attack surface<br />
consists of:</p>
<p>•&nbsp;&nbsp;&nbsp; Your operating system files<br />
•&nbsp;&nbsp;&nbsp; Your application files<br />
•&nbsp;&nbsp;&nbsp; Your machine registry<br />
•&nbsp;&nbsp;&nbsp; Your personal files<br />
•&nbsp;&nbsp;&nbsp; Your personal registry</p>
<p>Switching over to a LUA immediately restricts the attack service to the following:</p>
<p>•&nbsp;&nbsp;&nbsp; Your personal files<br />
•&nbsp;&nbsp;&nbsp; Your personal registry</p>
<p>This is because the LUA, by default, does not have write access to operating system and application files.</p>
<p>In an ideal world your personal files and personal registry would be<br />
protected from attack also, however, all is not as bad as it<br />
seems.&nbsp; Most spy ware and virus applications are after attacking<br />
your operating system and applications – rendering your machine<br />
unusable.&nbsp; Personal files can (and should) be backed up, in the<br />
event of machine failure or attack, as can the user registry.&nbsp; In<br />
a worst case scenario, if a virus attacked your personal files and<br />
personal registry all that is required is to delete your work files,<br />
delete the user profile and create a new one.&nbsp; If your operating<br />
system or applications are affected, then you are looking at repaving<br />
your entire machine.</p>
<p>How to tell if you are an admin in Windows:</p>
<p>•&nbsp;&nbsp;&nbsp; Right click the start button, if you see “explore all users” you ARE an admin<br />
•&nbsp;&nbsp;&nbsp; Double click the clock in the system try, if the date/time applet appears the you ARE an admin<br />
•&nbsp;&nbsp;&nbsp; Right click the “My Computer” icon on the desktop,<br />
click computer name.&nbsp; If you see a “change” box then you ARE an<br />
admin<br />
<span style="font-weight:bold;text-decoration:underline;"><br />
How to run as LUA<br />
</span>•&nbsp;&nbsp;&nbsp; Remove your user account from the<br />
“Administrators” group.&nbsp; If you are using the default<br />
“Administrator” account, then create another low privileged user for<br />
your day to day tasks.<br />
•&nbsp;&nbsp;&nbsp; Never use the “Power Users” group – even though<br />
this group is not the “Administrators” group, users that belong to this<br />
group still have administrative privileges across your machine.<br />
•&nbsp;&nbsp;&nbsp; <span style="font-weight:bold;color:rgb(0,0,255);">If you are part of a corporate domain and the only<br />
administrative account on your machine is your day-to-day user account (many<br />
corps disable the main &#8220;Administrator&#8221; account) , then be sure to<br />
create a local admin account on your machine before revoking the<br />
administrative privileges of your day-to-day account.&nbsp; This will<br />
ensure that you have at least one an administrative account on your machine, which<br />
can be used via the &#8220;run-as&#8221; command.</span></p>
<p><span style="font-weight:bold;text-decoration:underline;">NTFS is your friend</span><br />
NTFS is a system that manages your file system, and includes management<br />
of file security.&nbsp; If your file system is using FAT/FAT32 you will<br />
need to convert to NTFS to take advantage of file security.&nbsp; </p>
<p>Chances are that you may not have messed with the default security<br />
permissions that were applied to operating system and application files<br />
when Windows was installed. This being the case, your operating system<br />
and application files will be protected from malicious code when<br />
running as LUA.&nbsp; If, however, you have made changes to NTFS<br />
security and wish to restore permissions to the default Windows<br />
installation settings, execute the following statement at a command<br />
prompt:</p>
<p><font size="2"><span style="font-family:courier new;">secedit /configure /cfg %windir%repairsecsetup.inf /db secsetup.sdb /verbose /areas FILESTORE</span></font></p>
<p><span style="font-weight:bold;color:rgb(255,0,0);">Warning: The<br />
above command will reset all of the file security permissions on your<br />
operating system drive, so you shall need to be running as an<br />
administrator, and be aware that any changes made to file security<br />
permissions after you installed Windows will be lost.</span> </p>
<p><span style="font-weight:bold;text-decoration:underline;">Objections</span><br />
•&nbsp;&nbsp;&nbsp; <span style="font-style:italic;">“I do not want to be restricted”</span><br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; Neither will malicious code<br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; You will spend all your time<br />
updating the signatures of your anti-spy ware and anti-virus utilities</p>
<p>•&nbsp;&nbsp;&nbsp; <span style="font-style:italic;">“Some of my applications do not work as non-admin”</span><br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; Find out why, some effort may be<br />
required to get apps to work as non-admin, but the secure peace of mind<br />
pay off is worth the effort.<br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; Call the manufacturer and DEMAND that they make their application work under LUA<br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; Avoid software that does not carry the “designed for Microsoft Windows XP”</p>
<p>•&nbsp;&nbsp;&nbsp; <span style="font-style:italic;">“I hate logging out to install software or perform an administrative configuration”</span><br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; Get used to using the “run-as”<br />
option (right click shortcuts with the left shift key down)<br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; In commercial organizations it<br />
is common practice to log on as a domain admin to install and configure<br />
software, but office users do not all have the<br />
 domain password.&nbsp; </p>
<p>•&nbsp;&nbsp;&nbsp; <span style="font-style:italic;">“Some of my developed code does not execute under LUA”</span><br />
&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp; This is a good opportunity to<br />
take a look at your code and find out why it requires administrative<br />
rights to execute.&nbsp; If you can get your code to work as LUA then<br />
it will most likely deploy better, and require limited hands-on<br />
installation when moving it to a production environment.</p>
<p><span style="font-weight:bold;text-decoration:underline;">Where can I find out more information?</span><br />
•&nbsp;&nbsp;&nbsp; Randy Hayes’s presentation slides can be downloaded from <a href="http://madcodecamp.com/%5Cmaterials%5C102905%5CProtection_in_an_Unsecured_World_Randy_Hayes.zip">here</a><br />
•&nbsp;&nbsp;&nbsp; <a href="http://www.non-admin.com">www.non-admin.com</a> is a new web site being set up by<br />
Randy to educate non-technical readers on configuring their computer as<br />
LUA</p>
<p>
<span style="font-weight:bold;text-decoration:underline;"></span><span style="font-weight:bold;text-decoration:underline;"><br />
</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/1697/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/1697/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/1697/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=1697&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2005/11/09/running-as-non-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
		<item>
		<title>DPAPI in C#</title>
		<link>http://blog.robgarrett.com/2005/06/16/dpapi-in-c/</link>
		<comments>http://blog.robgarrett.com/2005/06/16/dpapi-in-c/#comments</comments>
		<pubDate>Thu, 16 Jun 2005 20:00:00 +0000</pubDate>
		<dc:creator>Rob Garrett</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">/cs/blogs/software/archive/2005/06/16/933.aspx</guid>
		<description><![CDATA[Okay, I am posting a link to this awesome example of DPAPI (Data Protection API) for C# and VB.net, mainly for my own reference. If you want to encrypt data in web.config files on shared servers, this is the way to do it. http://www.obviex.com/samples/dpapi.aspx Thanks to Julie Lerman for making me aware of DPAPI.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=933&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, I am posting a link to this awesome example of DPAPI (<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/windataprotection-dpapi.asp">Data<br />
Protection API</a>) for C# and VB.net, mainly for my own reference. If you<br />
want to encrypt data in web.config files on shared servers, this is the<br />
way to do it.</p>
<p><a href="http://www.obviex.com/samples/dpapi.aspx">http://www.obviex.com/samples/dpapi.aspx</a></p>
<p>Thanks to <a href="http://www.thedatafarm.com/blog/PermaLink.aspx?guid=10e1a700-0fa4-4066-b830-291f6e861c6f">Julie Lerman</a> for making me aware of DPAPI.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/robgarrett.wordpress.com/933/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/robgarrett.wordpress.com/933/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robgarrett.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robgarrett.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robgarrett.wordpress.com/933/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.robgarrett.com&amp;blog=7688126&amp;post=933&amp;subd=robgarrett&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.robgarrett.com/2005/06/16/dpapi-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Rob Garrett</media:title>
		</media:content>
	</item>
	</channel>
</rss>
