3.5: Establishing Security Baselines
Before you can recognize abnormal system behavior as a sign of attack, you need to know what normal behavior is. In other words, you need a security baseline. In setting a baseline, it is important to harden or lock down your servers and networks at a level where incursions are less likely to occur. These exercises introduce you to the concepts of operating system, network, and application hardening.
Exercise 3.5.1: Hardening Windows and Unix Operating Systems
Operating system hardening includes locking down files, folders, and applications, as well as the operating system itself. In Chapter 1, you looked at mandatory access control (MAC), discretionary access control (DAC), rule-based access control (RBAC), and role-based access control (also RBAC). Earlier in this chapter, you looked at securing data using EFS. These topics all play a role in the overall picture of hardening the operating system. In this exercise, you look at security baselines in Windows and Unix.
Exercise 3.5.1.1: Microsoft Baseline Security Analyzer
Microsoft provides a tool known as the Microsoft Baseline Security Analyzer (MBSA) that scans Windows-based computers for security vulnerabilities. MBSA scans computers for critical updates and patches and determines the need for further system hardening. In this exercise, you install MBSA and scan your computer for security vulnerabilities. Perform this exercise on a Windows 2000 Professional computer. The steps are the same for Windows XP Professional:
-
Log on to the computer running Windows 2000 computer as an administrator.
-
Navigate to http://www.microsoft.com/technet/security/tools/mbsahome.mspx, select the download link, and download the MBSA setup file to your computer.
-
Double-click the setup file and follow the instructions in the setup wizard that appears. The wizard installs an icon on the desktop.
-
If you receive a message informing you that you need to install the Microsoft XML Parser version 3.0, follow the link provided to install this parser, and then continue the setup.
-
Double-click this icon to start MBSA.
-
On the welcome screen, select the Scan a Computer option to scan your computer.
-
The Pick a Computer to Scan screen (see Figure 3.14) enables you to select a computer (which is your computer by default) as well as the types of scans that will be performed. Leave all options selected and click Start Scan.
-
MBSA downloads the latest security update information from Microsoft and performs the scan. It displays a security report, as shown in Figure 3.15, which highlights vulnerabilities present on the system.
-
To obtain information on vulnerabilities, select the Result Details link under the categories of interest. MBSA displays information related to the vulnerabilities present on the system, as shown in Figure 3.16.
-
To obtain information on correcting problems, select the link labeled How to Correct This. This link connects to the Help and Support Center to display information related to the issue at hand as well as procedures for correcting the problem.
-
To revisit previously obtained security reports, select the Pick a Security Report to View option from the left side of the MBSA window (refer to Figure 3.15), and then select the report to be viewed from the list that appears.
Figure 3.14 MBSA enables you to select from several types of scans.
Figure 3.15 The MBSA security report provides information on system security vulnerabilities.
Figure 3.16 A weak password is one type of information that MBSA can display.
CAUTION
Hardening servers and networks involves more than just locating and fixing vulnerabilities using the procedures we have discussed here. You need to pay attention to the general topics we discussed in Chapter 1 as well as physical security recommendations such as locking doors. We discuss physical security in more detail in Chapter 5, "Operational and Organizational Security."
Exercise 3.5.1.2: Security Configuration and Analysis
Another tool provided by Microsoft that analyzes security settings and applies baseline security configurations is the Security Configuration and Analysis (SCA) console. This tool uses a security template to analyze a computer against a predefined level of security and apply the security settings against the computer. These templates are useful because they provide the ability to configure a series of computers with consistent security settings and reapply the settings should a problem arise. The security template is a series of configuration settings that affect items such as the following:
-
Account PolicyDefines settings related to user account logon such as password strength and expiration, lockout of accounts after entering incorrect passwords, and settings related to Kerberos authentication.
-
Local PolicyDefines which types of events will be audited; which groups are granted which rights on the system; and additional security options, such as the use of digital signing and encryption, the display of legal messages, the installation of unsigned drivers, the use of smart cards, and so on.
-
Event LogDefines settings related to the size of and access to security logs as well as their retention methods.
-
Restricted GroupsDefines the membership of groups that have the capability to administer the system.
-
System ServicesDefines whether certain services running on the system are started, stopped, or disabled (prevented from starting). We discussed the disabling of unnecessary services in Chapter 1.
-
RegistryDefines access permissions placed on portions of the system Registry.
-
File SystemDefines access permissions placed on files and folders.
NOTE
Security templates available in Windows XP Professional and Windows Server 2003 include additional security settings such as wireless network policies, public-key policies related to EFS, and trusted root certification authorities.
In this exercise, you use SCA to analyze the baseline security settings and apply a security template to a computer running Windows 2000 Professional. You can also do this exercise on a computer running Windows XP Professional:
-
Log on to the computer running Windows 2000 as an administrator.
-
Click Start, Run; type mmc; and press Enter. This opens a blank Microsoft Management Console (MMC).
-
Click Console, Add/Remove Snap-in to open the Add/Remove Snap-in dialog box.
-
Click Add, select the Security Configuration and Analysis snap-in, click Add, and then click Close.
-
Click OK. The Security Configuration and Analysis snap-in is added to the blank console.
-
Click Console, Save As; type a descriptive name such as Security.msc; and then click Save. The console is saved in the Administrative Tools folder unless you select another location such as the desktop.
-
To analyze your computer's security settings, you need to create a database. Right-click Security Configuration and Analysis and choose Open Database. Type a name for the database (such as Test1) and then click Open.
-
Select a template from the Import Template dialog box that opens (see Figure 3.17). A good template to use is the securews.inf template, which applies secure settings to a workstation computer. Click Open.
-
To analyze the computer's security settings, right-click Security Configuration and Analysis and choose Analyze Computer Now. Click OK to accept the log file path.
-
The configuration settings are compared against the settings in the security database, and a series of nodes appears in the left pane. To compare the computer settings against those in the database, expand the desired nodes and select the appropriate policy. As shown in Figure 3.18, the settings in a series of policies appear in the right pane. A green check mark indicates that the computer's security settings meet the standard defined by the database, whereas a red X indicates a setting that differs from that in the database.
-
Select the various nodes in turn and note how the settings differ from those in the database.
-
To configure the computer with the database settings, right-click Security Configuration and Analysis and choose Configure Computer Now. Click OK to accept the log file path.
-
Repeat Steps 9 to 11 and notice that the security settings defined by the database have been applied.
-
When you are finished, close the console. Click No if you are asked whether to save your settings.
Figure 3.17 To configure a security database in SCA, you need to import a template from those in the template database.
Figure 3.18 SCA indicates policies whose settings differ from those in the template with a red "X."
NOTE
A red X could indicate a security setting that is actually more secure than that of the database, as well as the more usual security weakness.
Exercise 3.5.1.3: Developing a System Hardening Checklist
The process of hardening an operating system is little more than reducing the number of vulnerabilities that could allow the system to be compromised. Although every system is unique, you should employ certain strategies for all computers.
This exercise directs you to research general Windows and Unix/Linux hardening strategies and start developing a simple hardening checklist:
-
From a Web browser, navigate to http://www.sans.org/top20/. This Web page presents the SANS/FBI 20 Most Critical Internet Security Vulnerabilities list. The list actually contains the top-10 vulnerabilities each for Windows and Unix. It is a great place to start hardening your operating system.
-
Continue to http://staff.washington.edu/dittrich/R870/security-checklist.html and choose several hardening steps from the top of the Unix Security Checklist. Because you can choose from so many options, pick five checklist items from the Account Security section.
-
Continue to http://labmice.techtarget.com/articles/securingwin2000.htm and choose several hardening steps from the Windows 2000 Security Checklist. Pick the top-five checklist items. Note that the top items on the list deal with account security:
-
Do any of the checklist items exist in both operating systems?
-
Why are account issues near the top of most security checklists?
-
Which of the checklist items should be easiest to address?
-
Develop a hardening checklist of at least five items you would address for Windows, based on the information you have found. Provide details for each checklist item. For example, one common checklist item suggests that you disable any unneeded protocols and services.
-
Arrange your security checklist in priority order. Which item should be addressed first? Explain why you chose each item's priority.
-
Add a section to your security checklist that discusses recurring actions. What steps must you take periodically to keep a system secure?
-
Complete your sample operating system hardening checklist by adding a brief discussion of items you have chosen not to include. For example, if your system resides behind several firewalls, you might choose not to implement a firewall on your server. What else would you not implement and why?
NOTE
Although you already have one checklist item, choose several common services that make sense to disable. See whether you can document 10 services. (Refer to Chapter 1 if necessary.) You might need to do more searching.
Exercise 3.5.2: Hardening a Network
Much of the activity involved in network hardening involves actions that we have already examined. These include configuring access control lists (ACLs) on sensitive files and folders, configuring router access policies, disabling unnecessary services, and configuring auditing, all of which we discussed in Chapter 1, and configuring remote access and VPN access, specifying IPSec policies, securing Web and FTP servers, and configuring wireless network security, all of which we discussed in Chapter 2.
Another part of hardening a network is knowing what is out there that might cause a problem. In Chapter 1, we looked at port scanning tools such as Nmap, which you can use to scan networks for open ports that intruders might use to initiate an attack. Another component of network hardening is the removal of services (including disabling of NetBIOS over TCP/IP), which we discussed in Chapter 1.
In Exercise 3.5.1.2, we looked at using SCA to harden a computer by applying a security template. In this exercise, we harden a Windows-based network by applying the security template to the network in Group Policy. Perform this exercise from a computer running Windows 2000 Server configured as a domain controller:
-
Log on to the server as an administrator.
-
Click Start, Programs, Administrative Tools, Active Directory Users and Computers.
-
Expand the left pane of Active Directory Users and Computers to locate the domain or organizational unit (OU) to which the computers in the network you want to harden belong.
-
Right-click this domain or OU and choose Properties.
-
On the Group Policy tab of the Properties dialog box that opens, select the desired Group Policy object (GPO) and click Edit to open the Group Policy console.
-
Navigate to the Computer Configuration\Windows Settings\Security Settings node.
-
Right-click this node and choose Import Policy.
-
From the dialog box shown in Figure 3.19, select the template you want to apply, and then click Open.
-
This action applies the security settings in the template. To check their application, expand the Security Settings node, select the required subnodes, and verify the settings displayed in the right pane.
Figure 3.19 You can apply a security template in Group Policy.
Exercise 3.5.3: Securing and Hardening Application Servers
The average network runs many types of servers, including Web servers, email servers, FTP servers, DHCP servers, DNS servers, NNTP servers, file and print servers, and database servers. Default installations of these servers are more often set up for convenience rather than security, so it is important that you secure these servers to the level that is appropriate to the services they provide.
MBSA analyzes components of various server applications as part of its installation. In this exercise, you run MBSA on a server configured with one or more of the applications mentioned here and note the results. Perform this exercise on a computer running Windows 2000 Server. The steps are similar in Windows Server 2003:
NOTE
Performing this exercise on a computer running a default version of Windows 2000 Server with a few services such as Internet Information Services (IIS) will yield more security vulnerabilities than it will on Windows Server 2003. Microsoft has hardened the default settings of server applications considerably with the new server release.
-
Log on to the server as an administrator.
-
If you are working at a test server (which you should be for this type of exercise), you might want to install additional services such as the FTP, SMTP, and NNTP components of IIS and a DHCP server.
-
Use the procedure of Exercise 3.5.1.1 to install and run MBSA on the server.
-
Scroll the security report to note the vulnerabilities and obtain information on correcting them. For example, a default installation of IIS 5.0 on Windows 2000 yields the vulnerabilities shown in Figure 3.20.
Figure 3.20 MBSA reports several vulnerabilities in the default installation of IIS 5.0 on a computer running Windows 2000 Server.
CAUTION
Application servers hosting specific applications such as email need additional hardening actions. For example, you need to prevent email servers from being used as open relays. You might encounter questions with respect to specific application servers on the Security+ exam. For more information on hardening specific application servers, refer to the Exam Cram 2 or Training Guide books in the "Need to Know More?" section.
Exercise 3.5.4: Securing Data Repositories and Databases
Databases present a special security challenge because users and customers must have the proper level of access for the purpose to which the database has been built, but at the same time you are preventing all types of unauthorized access. In this exercise, you take a look at some of the problems facing administrators of databases running on Microsoft SQL servers:
-
From a Web browser, connect to the Internet and navigate to http://www.sql-server-performance.com/vk_sql_security.asp. The author, Vyas Kondreddi, provides a comprehensive review of SQL Server security. Locate answers to the following questions:
-
What types of authentication does an SQL database accept, and what recommendation is suggested for improving login security?
-
What three roles does SQL Server use for controlling access to objects within the database, and how are these roles used in assigning permissions?
-
In what way do the best practices suggested by Kondreddi correspond to general recommendations suggested by Microsoft for controlling access by users to regular files and folders?
-
What recommendation does Kondreddi make with regard to the default system administrator (sa) account?
-
Note that security recommendations are in many cases similar to those for securing other servers. What additional precaution is available with regard to backups of SQL Server databases?
-
SQL Server has been the target of several worms, most notably the Slammer worm that struck in 2003. Go to http://www.microsoft.com/sql/techinfo/administration/2000/security/securingsqlserver.asp. What are the 10 steps that they recommend for hardening the SQL server? Summarize the types of vulnerabilities that each step is designed to help protect against.
-
Marcin Policht has produced a series of articles on SQL security for Database Journal. Navigate to http://www.databasejournal.com/features/mssql/article.php/3334851 for the first article. Note the use of net libraries by SQL Server and the need to balance performance and security concerns. What means can you employ in SQL Server 2000 to encrypt net libraries?
-
Continue to Policht's second article at http://www.databasejournal.com/features/mssql/article.php/3341651. He discusses the need for secure authentication methods, again emphasizing the two authentication modes and the need for securing the sa account password. What are several advantages of operating the SQL server in an Active Directory domain environment? What is impersonation, and how is it used on SQL Server? Summarize the uses and drawbacks of the delegation process.
-
Continue to Policht's third article at http://databasejournal.com/features/mssql/article.php/3349561. Note the services associated with SQL Server. What recommendations does Policht make with regard to these services? Why should you not use the Local System Account when configuring these services?
-
The second segment of Policht's third article, found at http://databasejournal.com/features/mssql/article.php/10894_3349561_2, continues the discussion of accounts used by services. Why should you use a newly created user account for SQL Server Agent Services? What user rights and permissions do you need to assign to this account? Note that you should not add this account to a privileged group such as Administrators or Power Users unless certain actions need to be performed, as detailed in this article.
-
Policht's fourth article, found at http://databasejournal.com/features/mssql/article.php/3357861, discusses authorization, which determines the level of privileges granted to accounts accessing the databases and objects in SQL Server. What are server roles used for? Name the most important server roles and describe the capabilities granted to these roles. Describe some of the factors that determine what access rights are granted to each database. What are the two types of database roles, and what do the default roles provide? Note that you can define your own custom database roles.
-
Policht's fifth article, found at http://www.databasejournal.com/features/mssql/article.php/3363521, defines application roles in SQL Server. How do application roles differ from the database roles discussed in the previous article? Summarize his recommendations regarding the use and management of database roles and application roles.
-
Policht's sixth article, found at http://databasejournal.com/features/mssql/article.php/3370701, focuses on ownership and object permissions. What are two main factors that help determine the access to objects in SQL Server? Note that ownership of a database object confers a set of rights and permissions. How are these similar to the case of NTFS folders and files? What is ownership chaining, when does it take place, and what potential vulnerability can it introduce?
-
Those of you involved with Oracle database servers should go to http://www.petefinnigan.com/orasec.htm and peruse the links to a large number of papers related to Oracle database security.
What Did I Just Learn?
Now that you have looked at system, network, and database hardening, let's take a moment to review all the critical items you've experienced in this lab:
-
Microsoft provides MBSA and SCA, both of which you can use to analyze computers on a network for security vulnerabilities.
-
You can use SCA to configure a fixed set of security parameters on an individual computer or import these settings to a GPO for configuring a series of computers on a network.
-
Various application servers might present additional vulnerabilities. You can use MBSA to locate these vulnerabilities and obtain recommendations for fixing them.
-
Databases such as SQL Server present specific vulnerabilities, some of which have been exploited by worms such as SQL Slammer. You need to follow both general and specific recommendations for hardening database servers.