<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx</link><description>Of all security changes in Vista, UAC with its spit token and MIC is for obvious reasons getting most attention. But there are a lot of other areas that have been tightened up for security reasons and we keep finding new ones that impact customers. One</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#847554</link><pubDate>Fri, 20 Oct 2006 09:17:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:847554</guid><dc:creator>Antti Nivala</dc:creator><description>&lt;p&gt;The lack of SeBackupPrivilege prevents our M-Files software from installing on Vista (upgrade from one version to another fails). The impact to us is severe and it seems it will require major rework to get the installation system run on Vista given this limitation. Are you sure that this limitation is worth adding given that it will prevent the installation of some applications on Vista? Ours surely cannot be the only one.&lt;/p&gt;
&lt;p&gt;Our MSI package has a CA that requires SeBackupPrivilege because it calls RegLoadKey. We call RegLoadKey because during an upgrade (not related to MSI upgrade), we need to migrate each user's settings in the registry from the old version's key to the new version's key. After copying the settings, we uninstall the old version, which deletes the settings from each user's registry hive in the same way.&lt;/p&gt;
&lt;p&gt;Is there any way our MSI package could modify the other users' HKCU settings in Vista?&lt;/p&gt;
&lt;p&gt;Any chance on you allowing RegLoadKey in CAs, perhaps in some other way than putting SeBackupPrivilege back?&lt;/p&gt;
</description></item><item><title>re: Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#875964</link><pubDate>Thu, 26 Oct 2006 16:36:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:875964</guid><dc:creator>prsTM</dc:creator><description>&lt;p&gt;My service is trying to create a pipe that's writeable by any user account. I've tried to set the security attributes two ways. Both of them work fine on XP, but on Vista, the user process gets an Access Denied on its CreateFile call.&lt;/p&gt;
&lt;p&gt;Any help you-all can provide would be most welcome.&lt;/p&gt;
&lt;p&gt;The first method I used was fairly straightforward:&lt;/p&gt;
&lt;p&gt;SECURITY_DESCRIPTOR sd;&lt;/p&gt;
&lt;p&gt;	::InitializeSecurityDescriptor( &amp;amp;sd,SECURITY_DESCRIPTOR_REVISION );&lt;/p&gt;
&lt;p&gt;	::SetSecurityDescriptorDacl( &amp;amp;sd,TRUE, (PACL)NULL,FALSE );&lt;/p&gt;
&lt;p&gt;	SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES),&lt;/p&gt;
&lt;p&gt;								&amp;amp;sd,&lt;/p&gt;
&lt;p&gt;								FALSE };&lt;/p&gt;
&lt;p&gt;And the second one more complex, provided by another developer:&lt;/p&gt;
&lt;p&gt;CSharedSecurityDescriptor sd;&lt;/p&gt;
&lt;p&gt;	if ( !sd.Init() )&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;		DWORD dw = ::GetLastError();&lt;/p&gt;
&lt;p&gt;		ReportMessage(&amp;quot;Could not init security descriptor&amp;quot;, true);&lt;/p&gt;
&lt;p&gt;		return 1;&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	SECURITY_ATTRIBUTES sa = {sizeof sa, &amp;amp;sd, FALSE};&lt;/p&gt;
&lt;p&gt;class CSharedSecurityDescriptor : public SECURITY_DESCRIPTOR&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;public:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;CSharedSecurityDescriptor()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dacl = NULL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp;bool Init(void)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( !InitializeSecurityDescriptor( this, SECURITY_DESCRIPTOR_REVISION ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CWellKnownSID2 sidUsers(DOMAIN_ALIAS_RID_USERS);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CWellKnownSID2 sidAdmins(DOMAIN_ALIAS_RID_ADMINS);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DWORD nACLSize = sizeof(ACL) + ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) + sizeof(CWellKnownSID2)) * 3);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PACL pACL = (PACL)LocalAlloc(LPTR, nACLSize);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( pACL )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( InitializeAcl( pACL, nACLSize, ACL_REVISION) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//do not use the EX version - ACE inheritance is not required.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( AddAccessAllowedAce( pACL, ACL_REVISION, GENERIC_ALL, &amp;amp;sidUsers ) &amp;amp;&amp;amp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AddAccessAllowedAce( pACL, ACL_REVISION, GENERIC_ALL, &amp;amp;sidAdmins ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( SetSecurityDescriptorDacl( this, TRUE, pACL, FALSE ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LocalFree( pACL );&lt;/p&gt;
&lt;p&gt;				 &amp;nbsp;SetSecurityDescriptorDacl( this, TRUE, NULL, FALSE ); &amp;nbsp; &amp;nbsp;//set NULL DACL - allow all&lt;/p&gt;
&lt;p&gt;				 &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return TRUE == SetSecurityDescriptorDacl( this, TRUE, NULL, FALSE ); &amp;nbsp; &amp;nbsp;//set NULL DACL - allow all&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;~CSharedSecurityDescriptor()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BOOL bPresent = FALSE, bDefaulted = TRUE;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PACL pACL = NULL;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( GetSecurityDescriptorDacl( this, &amp;amp;bPresent, &amp;amp;pACL, &amp;amp;bDefaulted ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( bPresent &amp;amp;&amp;amp; !bDefaulted &amp;amp;&amp;amp; pACL )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;::LocalFree( pACL );&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;protected:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;struct CWellKnownSID2 : public SID //a SID with 2 sub authorities&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CWellKnownSID2( DWORD dwSecondSubAuth )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SecureZeroMemory( IdentifierAuthority.Value, sizeof(IdentifierAuthority.Value) );&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Revision = SID_REVISION;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SubAuthorityCount = 2;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IdentifierAuthority.Value[5] = 5; //SECURITY_NT_AUTHORITY {0,0,0,0,5}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SubAuthority[0] = SECURITY_BUILTIN_DOMAIN_RID;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;m_dwSecondSubAuth = dwSecondSubAuth;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DWORD m_dwSecondSubAuth;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
</description></item><item><title>re: Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#1567610</link><pubDate>Thu, 01 Feb 2007 01:12:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1567610</guid><dc:creator>Peter.Delgado</dc:creator><description>&lt;p&gt;I suggest that you simply add the group Everyone or some common group (more secure) to the dacl as follows (note the use of the ATL security classes which simplifies the procedure)&lt;/p&gt;
&lt;p&gt;-Pete&lt;/p&gt;
&lt;p&gt;CDacl daclPerm;&lt;/p&gt;
&lt;p&gt;CSid sidEveryone = CreateWellKnownLocalSid ( WinWorldSid );&lt;/p&gt;
&lt;p&gt;daclPerm.AddAllowedAce ( sidEveryone, GENERIC_ALL );&lt;/p&gt;
&lt;p&gt;CSecurityDesc sd;&lt;/p&gt;
&lt;p&gt;sd.SetDacl ( daclPerm );&lt;/p&gt;
&lt;p&gt;CSecurityAttributes sa ( sd );&lt;/p&gt;
&lt;p&gt;m_hPipe = &amp;nbsp;::CreateFile ( m_PipeName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, &amp;amp;sa, OPEN_EXISTING, 0, NULL) ;&lt;/p&gt;
&lt;p&gt;In addition, the code for the function CreateWellKnownLocalSid is as follows:&lt;/p&gt;
&lt;p&gt;CSid CreateWellKnownLocalSid ( WELL_KNOWN_SID_TYPE WellKnownSidType )&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	CSid sidRet;&lt;/p&gt;
&lt;p&gt;	DWORD dwSize = SECURITY_MAX_SID_SIZE;&lt;/p&gt;
&lt;p&gt;	PSID pSid = ::_alloca ( dwSize );&lt;/p&gt;
&lt;p&gt;	if ( ::CreateWellKnownSid ( WellKnownSidType, NULL, pSid, &amp;amp;dwSize) )&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;		sidRet = CSid (reinterpret_cast&amp;lt;const SID*&amp;gt;( (pSid ) ) );&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	return sidRet;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#1884292</link><pubDate>Thu, 15 Mar 2007 05:51:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1884292</guid><dc:creator>brianwa84</dc:creator><description>&lt;p&gt;Echoing Antti, our software uses RegLoadKey to read/write to each user's registry on install/uninstall. Losing SeBackupPrivilege makes it so that our installer/uninstaller can only successfully install/uninstall for the current user, even when MSI is running us from the LocalSystem account. I agree that numerous applications are likely to use RegLoadKey to perform some kind of per-user installation, and losing it will make MSI a much less useful installation mechanism.&lt;/p&gt;
</description></item><item><title>re: Impact of Least Privilege in System Services</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#2010465</link><pubDate>Mon, 02 Apr 2007 10:50:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2010465</guid><dc:creator>brianwa84</dc:creator><description>&lt;p&gt;Are there any changes to give any privileges back to the windows installer service, or will a better approach be to hack around it and/or use nsis or installshield or some other installation platform?&lt;/p&gt;
</description></item><item><title>What changed in Windows Installer 4.5?</title><link>http://blogs.msdn.com/vistacompatteam/archive/2006/10/19/impact-of-least-privilege-in-system-services.aspx#8447660</link><pubDate>Fri, 02 May 2008 00:20:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8447660</guid><dc:creator>Windows Installer Team Blog</dc:creator><description>&lt;p&gt;Apart from the feature work that we did in Windows Installer 4.5, we made a few changes to Windows Installer&lt;/p&gt;
</description></item></channel></rss>