목차

The Services and Service Accounts Security Planning

The Approach to Running Services More Securely

Service Vulnerabilities

Because services run unattended at startup, they are well suited to server-type applications such as Web services. However, this characteristic has its drawbacks because a user can be unaware that a service is running. Although some services might open a window or dialog box that is visible to the user, little or no user interaction typically occurs with services, so a user can run a number of default services and never be aware of the potential security risks. Recent Internet worms such as Nimda exploit the fact that users can unknowingly run Web servers on their workstations. The infected workstations spread the worm to thousands of computers across the Internet.

Some services, particularly those used by enterprise management tools such as Microsoft® Systems Management Server, Microsoft Operations Manager, and Tivoli, need to log on using a domain user account because they typically require access across the entire domain and possibly to other trusted domains as well. In other scenarios, using a domain user account to run services was once standard practice, but recently organizations have recognized it as a security risk.

The user name and password information for each service that uses a domain or local user account is stored in the registry, which an attacker can exploit when he or she gains administrative access to the computer. As a result, security exposure occurs whenever you configure a service to log on as a user.

Because a security exposure is created whenever a service is configured to log on as a domain user account, the potential to exploit this vulnerability increases based on various factors, including:

Service Vulnerability Scenarios

Several different scenarios of service vulnerability exist, each with different levels of security risk. These scenarios are described in the following figure and the following table. All accounts in the following figure are assumed to be domain accounts. Each account is running at least one service on one of the servers.

Descriptions of domain accounts in the diagram:

Security Vulnerability Priorities

The priority levels used in the following table are:

The following table provides a detailed description of the service vulnerability scenarios and their subsequent vulnerability priority levels. Table 2.1: Security Vulnerability Scenarios

Scenario Description Risk Level
1 Account A is running a service on Server 1. After the
Account A password is uncovered on Server 1, the user has
access to DC 1, which then becomes vulnerable. This is a
critical priority case; you should not use domain accounts
with Administrator-equivalent privileges on a domain
controller to run services on a member server.
Critical
2 Account B is running a service on Server 2. Account B also
has access to Server 1, where Account A is running a
service. After the Account B password is uncovered on
Server 2, the user has achieved the same start state as
Scenario 1—thus DC 1 becomes vulnerable. This logic can
be extended to where Account C is running a service on
Server 3, which in turn could facilitate access to Server 2,
where Account B is running a service, and so forth. This is a
high priority case, not a critical one, because when the
Scenario 1 issue has been resolved, the Scenario 2 issue is
limited to member servers only.
High
3 Account D is running a service on Server 4 or Server 5.
After the Account D password is uncovered on the server,
the user has access to all member servers on which
Account D has privileges. This is a medium priority case (the
transitive nature of Scenario 2 does not exist).
Medium
4 Account E is running a service on a Server 5 and has
access to Server 5 only.
Low
Summary of Service Vulnerabilities

Services are prime vulnerability points for attackers to access the local server or other servers on the network. If you do not need to use a particular service, you should disable it. By disabling unnecessary services, you quickly and easily reduce the attack surface, and gain additional performance benefits by not running these superfluous services.

To protect a service successfully, you must be aware of its vulnerabilities and minimize the service's exposure to them.


System Accounts

A service must log on as an account to access resources and objects on the operating system. If you assign an account to a service that does not have appropriate permissions to log on, the Services snap-in for the Microsoft Management Console (MMC) automatically grants that account the required Log on as a Service user right on the computer being managed. Microsoft Windows Server™ 2003 includes the following three built-in local accounts used as the logon accounts for various system services:


Important: If you change the default service settings, you might prevent key services from running correctly. It is especially important to use caution when you change the Startup type and Log on as settings for services that are set to start automatically by default.


User Accounts

Several categories of user accounts can log on as a service. Each category has its own capabilities and privileges:


Changes to Default Security Settings for Services in Windows Server 2003

With versions of Windows released prior to Windows XP and Windows Server 2003, almost all services included with the operating system used the Local System account by default. Programs that run in this context have unlimited privileges on the local computer,which presents an obvious security risk. With the release of Windows Server 2003, the developers changed the default settings to make the environment more secure. One of these changes is that a smaller number of services now run under the Local System account by default. Instead of using the Local System account, many common services now use the Local Service or Network Service account. These accounts have a much lower level of privileges than the Local System account and, therefore, present a lower security threat.

Many services still log on as the Local System, including Automatic Updates, Computer Browser, Messenger, and the Windows Installer service. Others do not. For example, the Alerter service used the Local System account in Windows 2000 but uses the Local Service account in Windows Server 2003.The DNS Client used the Local System account in Windows 2000 but uses the Network Service account in Windows Server 2003. The following table lists the services that no longer use the Local System account in Windows Server 2003, and lists which service account they now use.


Caution: Do not attempt to change the accounts that services provided with the Windows Server 2003 operating system use, because doing so can cause serious problems and potentially stop important services from running successfully. For example, the DNS Client service uses the Network Service account because the DNS Client service must access network resources such as DNS servers. This service does not work with the Local Service account or any other account that cannot authenticate to network resources.


Table 2.2: New Service Account Settings in Windows Server 2003

Service Name Log On As
Alerter Local Service
Application Layer Gateway Service Local Service
Remote Registry Local Service
Smart Card Local Service
TCP/IP NetBIOS Helper Local Service
Telnet Local Service
Uninterruptible Power Supply Local Service
WebClient Local Service
Windows Image Acquisition (WIA) Local Service
Windows Time Local Service
WinHTTP Web Proxy Auto-Discovery Service Local Service
DHCP Client Network Service
Distributed Transaction Coordinator Network Service
DNS Client Network Service
License Logging Network Service
Performance Logs and Alerts Network Service
Remote Procedure Call (RPC) Locator Network Service

Principles for Running Services More Securely

The path to success in service security includes understanding the nature of the services available in the networked environment and establishing procedures to protect the use of them. This section examines three core principles that you should follow when you plan to run services securely:

Know Your System

Although this recommendation seems obvious, many organizations are not fully aware of the roles and services that run on all their computers.

To know whether your computers are secure or not, you must know the services that run on your computers and their properties. This information is critical to help keep your servers secure. Consider the value of a table of services and service property settings for services that run on your computers, so that you can immediately evaluate your risks. To create such a table can initially be a long and complex process, but it is well worth the effort because it is vitally important to understand the properties of a known good configuration for your different server roles.

Several tools can help you create a list of service properties and running services. These tools include:


Note: There is another command-line tool available called sclist.exe, which is included in the Windows 2000 Server Resource Kit. This tool can show currently running services, stopped services, or all services on both local and remote computers. Sclist.exe can identify services that run on a physically remote computer or a computer that does not have a monitor attached, such as in a server rack.


Use the Principle of Least Privilege

Most security-related training courses and documentation discuss implementing the principle of least privilege. This principle is simple, but the impact of its implementation greatly increases security and reduces risk. The principle of least privilege states that you give an entity the least amount of access it requires to do its job and nothing more. In Windows Server 2003, this principle applies to both user accounts and computer accounts because in Active Directory, both user accounts and computer accounts are security principals, which means that they can both be assigned permissions and privileges.

One reason this principle works so well is that it forces you to assess your network resources and potential security risks. You must learn the access privileges that are actually needed for a given computer or user and then verify that only the required privileges are applied.

Running services more securely requires organizations to deploy services using a least privilege approach. Whenever possible, run services as the Local Service account, so that the account can only gain access to a single computer and not to the entire domain. Services that require authenticated network access might need to use the Network Service account, and you should deploy services that require broader implementation as the Local System account. If you determine that a domain-level administrator account is required to deploy a service, you should treat the server on which you deploy it as a high security server and protect it with the same measures you use for other highly sensitive network resources such as domain controllers. For more information about this topic, see the Create a High Security Servers Group for Domain Administrator Exceptions section in Chapter 3, “How to Run Services More Securely.”

Microsoft has thoroughly tested Windows Server 2003 to ensure that the core operating system services already run under the least privileged account; therefore, you should not usually need to modify these services. Your focus should be to secure the services that are not part of the operating system, such as those supplied as a component of other server product offerings, for example, Microsoft SQL Server™, Microsoft Operations Manager, and services that third-party software manufacturers provide.

You can use Group Policy in Windows Server 2003 to control specific services that can run on a computer or computers. To do this, open the Group Policy object for the organizational unit that contains the computer that you want to configure. Browse to the Computer Configuration\Windows Settings\Security Settings\System Services node and open the Properties page for the service that you want to control. In the Properties dialog box, define the service startup mode (Automatic, Manual, or Disabled) and set security permissions that control which user accounts can carry out particular operations on that service, such as stopping or starting the service.

For more information about what to consider when you decide which account type to use to run a service, see Figure 3.1, “Least Privilege Hierarchy for Service Deployment,” in Chapter 3, “How to Run Services More Securely.”

When you implement the principle of least privilege across your computers, it works in combination with the rule of knowing your system. How do you know if your computers run the minimal number of services if you do not know which services are actually running? By combining these two principles, your administrative staff can assess which services are running on a computer, their status, and the credentials that are in use for each server — then methodically change every possible service to the least privilege necessary. Monitor the computers to make sure no new services can be added without going through proper change-control procedures.

Use the Principle of Least Service

The principle of least service states that the operating system and the network protocols available on any networked device should run only the exact services and protocols required to support the business purpose. For example, if a server is not required to host any Web applications, you should remove or disable the World Wide Web service. Most operating systems and programs install many more services and protocols in their default configuration than are actually required for common usage scenarios.

The best way to set up a new server is to include a step in which the system administrator shuts down all but the bare necessities of the operating system. For example, in Windows operating systems prior to Windows Server 2003, it was common practice to close down the Alerter and Messenger services. In addition, ensure the correct placement of services on the network. For example, you should not place the Routing and Remote Access Service or Internet Information Services (IIS) on a domain controller because they run background services that can increase vulnerability on the domain controller. Microsoft best practice recommends that no additional services, other than those required to operate successfully as a domain controller should be run on a domain controller.


How to Run Services More Securely

Using the approaches and principles discussed in the previous chapters of this guide, this chapter describes the tasks you must perform when planning to run services more securely.

To secure services, you should carry out the following tasks:

Audit All Servers to Determine Essential Service Properties

You must determine exactly how many servers exist within your organization. Although this task sounds simple, a large organization can find it surprisingly complex to identify every server it possesses and to determine to what degree the services on each computer require management. For example, computers that run in the perimeter network require significantly higher levels of service management to reduce the attack surface of these computers.

You should audit each server to list all the running services and record which logon credentials each service uses for authentication. You can use the following tools to help with this task:

Example syntax: SERVICE GET Name,DisplayName,ProcessId,Started,StartMode, StartName

You can use the wmic service list brief command to retrieve a list of basic properties of all services installed as follows:

You can use WMIC from any computer that has WMIC installed to manage any remote computer that runs WMI. The target computer does not need to have WMIC installed or running for WMIC to manage it remotely. To manage a computer remotely, you need to use the /node:<computername> command, which requests the computer to add to the list of nodes from which you want to retrieve information.

Example syntax: WMIC /NODE:Server1,Server2,Server3 SERVICE GET Name,DisplayName,ProcessId,Started,StartMode,SystemName

You can also provide the location of a text file that lists remote computers on which you want use WMIC to perform actions.

Example syntax: WMIC /NODE:@“C:\MyServerList.txt” SERVICE LIST BRIEF

You can use WMIC to ease tasks in the following typical scenarios:

Creating a master list of servers and their services helps to identify and remedy service-related security risks.

You can use your audit to create inventories of all services that use: