Locking Down Windows

Multiuser systems are security holes in and of themselves. The simplest systems—those used by only one person—are the easiest ones to secure because there's much less diversity and variance of usage on the part of one person than there is on the part of many. Unfortunately, most of our IT environments require multiple user accounts, so the following section focuses on some prudent ways to lock down Windows systems, including Windows Server 2008 machines and associated client workstation operating systems.

Long passwords are more secure, period. As you might suspect, there are more permutations and combinations to try when one is attempting to crack a machine via brute force, and common English words, on which a dictionary attack can be based, are generally shorter than eight characters in length. By the same token, passwords that have not been changed in a long time are also insecure. Although most users grudgingly change their passwords on a regular basis when encouraged by administrators, some accounts—namely the Administrator and Guest accounts—often have the same password for life, which makes them an easy target for attack.

To counter these threats, consider setting some basic requirements for passwords. To set these restrictions on individual workstations and Windows Server 2008 member servers, follow these steps:

You can accomplish the same through GP if you have a Windows domain by selecting an appropriate GPO and loading the Group Policy Object Editor, as explained in Chapter 6. Keep in mind that changes to the domain password policy will affect all machines within the scope of the GP. The configuration tree within the Group Policy Object Editor remains the same.

New to Windows Server 2008 is the ability to define different password policies for different users. No longer do you have to set up distinct domains when you need different password policies to apply to specific users; with Windows Server 2008, you can apply specific password policies to users' accounts in global security groups.

To use this new feature, there are a few prerequisites software-wise. They include:

What is a PSO? The password settings object resides in the password settings container, which is unique to any given domain. The PSO has different attributes, which can in turn hold different values, for password and account lockout policies, like complexity and age requirements, maximum unsuccessful logon attempts before logout, and so on. The PSO can be linked to individual user accounts or groups, and these accounts can have multiple PSOs assigned to them.

The process to enable fine-grained password control and to enable access to PSO lacks a lot of finish; unfortunately, you have to go spelunking into the internals of Active Directory in order to enable this support. Before you embark on this procedure, I recommend generating a full backup of your system. Here is the process:

From this point all we have to do is to assign the new policy to most any combination of users and groups. To do so:

  1. Right-click the PSO from within ADSI Editor and select Properties, and on the resulting screen, click the Filter button.

  2. Select the following options: "Mandatory," "Optional," "Constructed," "Backlinks," and "System-only." Ensure that the "Show only attributes that have values" option is not selected.

  3. In the list on the Attibute Editor tab, navigate to msDS-PSOAppliesTo.

  4. Select msDS-PSOAppliesTo and click the Edit button at the bottom left of the screen.

  5. The "Multi-valued Distinguished Name with Security Principal Editor" window appears. Click the Add DN button and then enter the security group, user, or any combination thereof that should be affected by this new password settings policy. You'll need to use the distinguished name, which is the LDAP version of a container name. You can have as many entries on this screen as you like.

  6. Click OK.

Your new policy is now configured, deployed, and filtered on the appropriate security group (Table 7-1).

Three old-fashioned methods of gaining unauthorized access to a system are to attempt authentication using the following:

Windows can thwart these styles of attack using an account lockout policy, which will disable an account for a specified period after a certain number of unsuccessful logon attempts.

To set the account lockout policy, follow these steps:

In addition to securing local accounts, the newer Windows platforms give you the ability to lock down certain rights and configurations on the local computer in addition to any domain security policy that might be configured. Several of the available options do little to thwart attacks, so in this section I'll cover the six most effective changes you can make to your local security policy.

You can enable all of the hardening suggestions in this section through the Security Options section of the Local Security Policy snap-in to the MMC. You can usually find this snap-in under Start, All Programs, and Administrative Tools. To get to the appropriate section, navigate the snap-in tree by selecting Computer Configuration, Windows Settings, Security Settings, and Local Policies. Then click Security Options, and the different configuration switches will appear in the righthand pane.

The instructions in this section assume that you have already loaded the snap-in and navigated to the appropriate section.

Some users log on to the network and then don't log off for months. This is a prominent security hole, as when that user leaves her desk, she still is authenticated to the network with her credentials. Malicious people can use this to do destructive things: delete and transfer files, plant a "root kit" or backdoor program, or change passwords.

You can make automatic logoff work in two ways: first, each valid user needs to have a time when she is not permitted to log on. This can be sometime in the early morning, perhaps 3:00 to 3:30 a.m. Then, a change to the local security policy needs to be made so that when the user's logon time expires, she is not permitted to log on.

To set up a logon time restriction on a domain controller for an Active Directory-enabled domain, follow these steps:

Now, make the change to the computer's local security policy. Inside the Local Computer Policy snap-in, change "Automatically log off users when logon time expires" to Enabled. If you do not have a domain, instead change "Automatically log off users when logon time expires (local)" to Enabled. This will work even if users have locked their workstations.

Windows Server 2008 and GP allow you to configure security options that reside inside GPOs that will apply to groups of computers. GP can manage security settings throughout an Active Directory environment in seven areas. They are shown in Table 7-2.

The default domain controller security policy, like the default domain security policy, applies a common configuration to a group of computers, but this time the focus is only on domain controllers. Domain controllers often have special security considerations that ought to be addressed separately, and this default policy does that. Follow these steps:

Figure 7-3 shows the default domain controller security policy on a standard, out-of-the-box installation of Windows Server 2008.

There is a special way in which account policies are distributed to domain controllers that deserves comment. All domain controllers in a specific domain will apply security policies established at the domain level regardless of where the actual computer object for that domain controller resides in Active Directory. This helps to ensure that consistent account policies apply to any domain account. All other policies are applied at the normal hierarchical level, both to domain controllers and to other workstations and servers in the domain. Only domain controllers are affected by this special exception. This is just a tip to remember when you're planning account policy distribution among your organizational units.

With power comes complexity, and GP is no exception. Windows administrators have squandered away many hours of their lives on basic GP troubleshooting. Answers to quandaries such as, "Why isn't this policy in effect on this system?" or "I thought I turned off IPSec!" can be difficult to track down if your Active Directory is full of GPOs that are applied inconsistently, redundantly, and inappropriately.

To curtail your security policies and make them easier to locate, disable, change, and apply, try to follow these guidelines.

Organize your policies logically and define boundaries to contain them

Although your Active Directory might be organized by geographic location, your system management needs might revolve around a different paradigm: for instance, you might need IPSec for all company executives' laptops, but they might not all be in your New York office. Or all middle managers in your corporation might require a customized version of Internet Explorer that doesn't lock them out from accessing the Internet, which might be the default configuration for all computers in the domain. The idea is to map out the kinds of restrictions you need, and then define boundaries to which those policies apply. This will make it easier to apply them to the target users and computers even if the geographical and managerial boundaries do not match.

Inside those boundaries, configure policies that represent common values in your organization

Do you usually configure workstations in your finance department to lock a computer after three unsuccessful logon attempts? Does a particular domain in your forest need additional desktop restrictions—should they not be allowed to run the Control Panel, for instance? Change their wallpaper? Install software on their own? These are the kinds of policy sets that likely sound familiar. Group these together and create GPOs for each of these like sets of policy settings.

Configure organizational units inside Active Directory that contain machines grouped according to similar roles or functions within an organization

This gets further into the granularity of your security policies. For example, Windows comes by default with domain controllers residing in a separate organizational unit in Active Directory. You might consider putting desktops, laptops, and servers into their own organizational units, which makes it easier to apply policies, such as requiring use of the EFS, only to laptops.

Now I'll present an understatement: it can require some work to configure GP correctly and effectively. The most difficult parts of the process are planning and laying out the policy settings; Windows takes care of the actual deployment to client computers, which is one of the features that makes GP a compelling management tool. This ease of deployment is a double-edged sword, however: it is equally simple to misconfigure an ACL or change a setting (anybody who has played with the "require signed communications" settings knows this all too well) and wreak utter havoc on your domain. The process also is made more difficult by the lack of an API, so you can't write simple automation programs to help you out. You have to go the long way.

Even more difficult sometimes is getting the big picture. That is to say, it is hard to see how your Active Directory layout and structure—which logically and traditionally have likely mimicked your organization's hierarchical personnel structure—can co-exist with GPOs, which seem to cross hierarchy boundaries and rely on other scopes of application. With careful planning, however, GP can overlay your existing directory structure and complement it with its own management boundaries.