Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

May 30, 2007 12:00 AM

Icacls Shows Integrity

See how Icacls handles Vista's new trustworthiness levels
Windows IT Pro
InstantDoc ID #95681
Rating: (0)

Last month, in "Icacls: The New and Improved Cacls?" (InstantDoc ID 95346), I introduced you to Icacls, Windows Vista's eventual replacement of Cacls, the command-line tool that lets you set NTFS file and folder permissions. This month, I drill down into one of Icacls's new capabilities—setting integrity levels for files and folders.

Integrity Levels
Vista has introduced the notion of integrity levels, which is a completely new concept for Windows. An integrity level is a label that the OS applies to objects (e.g., files, folders, registry keys), user sessions, and running processes. Think of this label as a mark that indicates the trustworthiness of that object, user, or process. This trustworthiness becomes useful through another new concept: integrity policy. The default integrity policy for Vista is known as no write up—a shorthand way of saying that processes of lower integrity can't modify objects of higher integrity, no matter what NTFS permissions the processes have on the objects.

How about an example? Suppose you're running the command prompt at a medium integrity level. (I'll define all the integrity levels shortly.) You want to examine a text file named test.txt, which has a high integrity level, by typing

type test.txt 

Suppose you also have an NTFS permission of Full Control on test.txt. You would find that using the Type command to merely read test.txt works just fine. However, if you try to delete the file by typing

erase text.txt 

you'll get an Access Denied error, despite your Full Control permission. It's called a no write up policy because although lower-integrity-level processes can read higher-integrity files just fine, any attempts at writing make the integrity mechanism kick in. And as you've surmised by now, integrity levels take precedence over standard NTFS permissions. Again, the no write up policy is Vista's default behavior, but you can also create no read up and no execute up policies. (I'll leave discussions of those for another day.)

Vista defines five levels of integrity: untrusted, low, medium, high, and system. Microsoft Internet Explorer (IE) in Protected Mode—an IE 7.0 feature only in Vista—caches items as low integrity; Vista sets non-administrative users and most objects on the computer to medium integrity; administrative user accounts run as high integrity; and items that the OS itself owns operate at system integrity. Vista assigns the untrusted level to objects created by people who have the Anonymous Logon group associated with their tokens. However, I've never actually seen the untrusted level in Vista, except when I explicitly create untrusted objects.

Try It Out
To see integrity levels at work, you'll need an administrative account with the new-to-Vista user privilege Modify an object label. Give yourself that privilege in your local Group Policy Editor, reboot, and you'll be ready to play around with integrity levels. (By default, only the System account has this privilege, but any member of the Administrators group can grant it.)

Open an elevated command prompt (in Vista, elevated means to right-click the Command Prompt icon and choose Run as administrator), and create a folder to work in:

md C:\stuff 

Press Enter, then make the \stuff directory your current directory by typing

cd C:\stuff 

Press Enter. Now, create a file named test.txt by typing

echo We're testing integrity levels>test.txt 

Press Enter. Finally, set the file test.txt to high integrity:

icacls test.txt /setintegritylevel h 

Icacls will respond that it has processed the file successfully. Next, open an unelevated command prompt and type

erase c:\stuff\test.txt 

You'll get an Access Denied response, despite the fact that your NTFS permissions are quite sufficient to delete the file. Interesting, huh? As it turns out, Microsoft originally had big plans for integrity levels, but the company backed off from using them in the final days of Vista's creation. To get the most out of integrity levels, though, you'll need a different tool—which I'll introduce you to next month.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.