Understanding User Account Control (UAC), A Brief Summary

Below are some notes I took while troubleshooting a UAC issue. I found it useful to understand the difference between Rights and Permissions, as well as how to identify when UAC was coming into play.

What is the Difference Between Permissions and Rights (Privileges)?

Permissions apply to Objects

A permission is an authorization to perform an operation on a specific object, such as a file.

Every container and object on the network has a set of access control information attached to it that is called a security descriptor. This information controls the type of access that is allowed to users and groups. For example, each file has a security descriptor.

Each permission that an object’s owner grants to a particular user or group is stored as an ACE (Access Control Entry).

The entire set of permission entries in a security descriptor is known as a permission set or ACL (Access Control List).

Rights (Privileges) apply to User Account Actions

User rights enable administrators to assign specific privileges and logon rights to groups or users. These rights authorize users to perform specific actions, such as logging on to a system interactively or backing up files and directories. User rights are different from permissions because user rights apply to user accounts and permissions are attached to objects.

Administrators can use user rights to manage who has the authority to perform operations that span an entire computer, rather than a particular object.

Conflict between Rights vs Permissions

Conflicts between privileges (rights) and permissions normally occur only in situations where the rights that are required to administer a system overlap the rights of resource ownership. When rights conflict, a privilege (“right”) overrides a permission. This is partly why when UAC is enabled, you may get prompted when trying a certain administrative operation even though you have full control permissions on the folders/regkeys needed. The problem is typically attributed to the administrative right not being invoked.

UAC (User Access Control)

Standard and Administrator Access Tokens

When an administrator logs on, the user is assigned two separate access tokens:

a full administrator access token and a

standard user access token.

The full administrator access token is not invoked until the user attempts to perform anadministrative task.

In other words, if you log on as a member of the local administrators group, you will run with your administrative privileges disabled until you attempt to run an application or task that has been marked to require administrative privileges. When UAC is enabled, local administrator accounts run as standard user accounts until elevation is required.

When does UAC come into play?

At process creation.

You can see the type of token an account is running with by viewing the ProcessCreation entry in the security event log.

You can run the PowerShell script below to extract this information from the security event log.

$evtLogEntries=Get-EventLog-LogNameSecurity-After$datetimeAfter-EntryTypeSuccessAudit-Message"A new process has been created*"|Where-Object {$_.Message -match"Account Name:`t`t$user_nameonly_withoutdomainprefix"}

"%%1936" { write-host"`tToken Elevation Type: Type 1 is a full token with no privileges removed or groups disabled.A full token is only used if User Account Control is disabled or if the user is the built-in Administrator account or a service account."}

"%%1937" { write-host"`tToken Elevation Type: Type 2 is an elevated token with no privileges removed or groups disabled.An elevated token is used when User Account Control is enabled and the user chooses to start the program using Run as administrator.An elevated token is also used when an application is configured to always require administrative privilege or to always require maximum privilege, and the user is a member of the Administrators group."}

"%%1938" { write-host"`tToken Elevation Type: Type 3 is a limited token with administrative privileges removed and administrative groups disabled.The limited token is used when User Account Control is enabled, the application does not require administrative privilege, and the user does not choose to start the program using Run as administrator."}

Why was UAC created?

Historically, most IT departments have granted users full administrator rights on their machines to simplify management and minimize failures. Application developers designed their applications assuming that they would be installed and run as an administrator. Even when Windows® XP was initially installed, all user accounts were created as local administrators.

UAC reduces the number of programs that run with elevated privileges, therefore helping to prevent users from accidentally/unknowingly changing their system settings, and helping to prevent "malware" from gaining system-wide access.

This shift also encourages developers to write more secure applications because they can eliminate unnecessary requests for excessive administrative-level access to Windows resources only by using the minimal required permissions. Well-designed UAC experiences allow users to be more productive when running as Standard users.

How is it decided if elevation is required?

The application may have the “Run this program as an administrator” privilege level set (right click exe properties ->compatibility tab->privilege level)

The application has a manifest which marks it as requiring administrator rights (manifested with RequireAdministrator). See Step 6: Create and Embed an Application Manifest (UAC) http://msdn.microsoft.com/en-us/library/bb756929.aspx