5.11 Securing Registry Keys in Windows NTWhen using RegEdt32 under NT, you'll notice a few things that differ between Windows 2000 and NT. For starters, the Security menu has more commands in it; when you use these commands, the user interface is different as well. However, for the most part the underlying behavior is the same. If anything, NT is less flexible than Windows 2000 because it doesn't have all the same inheritance and permission controls. 5.11.1 Setting PermissionsThe SecurityPermissions... command displays the Registry Key Permissions dialog (see Figure 5.18). To use it, select a key in any root key window, then give the command. When the dialog opens, it shows which key you've selected and which account owns it (you can't change either of them from the dialog, however). The controls in the dialog give you access to the permission settings for the key. Figure 5.18. Registry Key Permissions dialog
Figure 5.19. The Add Users and Groups dialog5.11.2 Auditing Registry Key ActivityAuditing allows you to keep a trail of evidence to identify problems and pin their start down to an exact time. NT's auditing facility lets you audit specified actions taken by specified accounts. For example, you can audit any attempt to change security policy by any accounts, or you could audit failed attempts to log on by a single account. This combination of specifying who and what makes auditing pretty flexible. 5.11.2.1 Enabling auditing on an NT machineWhile auditing is useful, it also takes time. By default, NT leaves system auditing turned off. Before you can audit Registry access (or anything else), you have to enable auditing on the machine you want audited. You do this with the User Manager or User Manager for Domains,[6] yet another of the standard administrative utilities NT includes to simplify your job. Here's how to enable auditing on a single server or workstation:
Figure 5.20. The Audit Policy dialog
Once you take these steps on a machine, you won't have to do them again; auditing on that machine will remain enabled unless you manually turn it off using the same procedure. You do, however, have to execute these steps on every machine for which you want to enable auditing. Once you've done so, you can actually turn on auditing for the Registry. 5.11.2.2 Telling RegEdt32 what to auditThe Registry Key Auditing dialog, shown in Figure 5.21, appears when you choose the SecurityAuditing... menu command. Figure 5.21. The Registry Key Auditing dialogThis dialog can be a little confusing at first, so a look at what its controls do will demystify it some:
As you'd expect, the OK and Cancel buttons allow you to preserve or discard changes you make in this dialog. 5.11.2.3 Reviewing the audit recordsOnce you've told RegEdt32 what to audit, you still need to see the audit entries that have been generated. If you're accustomed to administering Unix machines, you're probably familiar with the syslog service. NT has a similar feature; it keeps an event log that applications and system components may write to. The NT event log is actually three separate logs: one for system data, one for application-generated data, and one for security data. Auditing messages (no matter their source) go into the security log. To view these log messages, you'll need to use Microsoft's Event Viewer application. A complete discussion of how to use the Event Viewer is outside the scope of this book, but the basic process is simple enough to boil down into a few concise steps:
Figure 5.22. The Event Viewer application
Figure 5.23. Registry audit event detail display5.11.3 Changing Key OwnershipLike every other object in NT's world, each Registry key has an owner. As with Unix, NT allows the owner to control access to objects it owns to a certain extent; the superuser or Administrator account can always take ownership of an object and change its permissions when necessary. NT does, however, provide a standard auditing mechanism that logs all manually initiated changes of ownership, so you'll always have an audit trail that shows when someone's taken over one of your objects. When you use this command, you're telling RegEdt32 to change the owner of the currently selected key and all its subkeys to the current account. This blanket change of ownership can lead to unexpected behavior, since many NT components assume they'll always have unrestricted access to all subkeys of HKLM and many subkeys of HKCU and HKCR. However, it's usually a good idea to set appropriate ownership of HKU 's subkeys, as well as those subkeys of HKLM that are safe to reset. The best way to set ownership is with a utility like David LeBlanc's everyone2user, which is discussed in Section 9.4 in Chapter 9. If you insist on doing it manually, RegEdt32 allows you to take ownership of Registry keys with the SecurityOwner... command. The Owner dialog, pictured in Figure 5.24, shows you what key is selected and which account owns it. The Take Ownership button changes the key's (and its subkeys') ownership to whatever account you're logged in as, while the Close button cancels the command without changing anything. Of course, if you don't have Administrator privileges you can't take ownership of any key you don't already own. Figure 5.24. The Owner display |