Baseline and security
According to its definition, baseline is something you can measure all the time and compare it to identify the difference between the current state and the starting point. In general, the business and technical requirements reflect the core of a baseline policy. It can also be a combination of your business requirements and industry-best practices. As a security administrator, your job is to translate these polices into a technical policy that you can apply in your IT environment.
Different companies and industries follow different standards and policies to secure their IT infrastructure. The following are some of the popular standards that are widely used in the industry:
- National Institute of Standards and Technology (NIST): http://www.nist.gov/
- Center for Internet Security (CIS): http://www.cisecurity.org/
- Security Technical Implementation Guides (STIGs): http://iase.disa.mil/stigs
- National Security Agency (NSA) Configuration Guides: https://www.nsa.gov/ia/mitigation_guidance/security_configuration_guides/index.shtml
- Microsoft Security Baselines
The details of these agencies and their recommendations can be reviewed on their websites.
Out of the box, Windows Server 2012 and higher provides a few security tools that can be used as a starting point for your Windows Server security configuration. We will start this journey with a built-in security tool called Microsoft Security Configuration Wizard (SCW). This is a very powerful role-based tool that is included with Windows Server 2012 or higher. You can easily translate your business security policies into a technical policy using this tool. As a first step, you need to define your business security requirements or policies. Once you have that documented, you can use Microsoft SCW to create a policy template for different types of servers. In general, these business security requirements can be achieved by disabling unwanted services, blocking unused ports, modifying registry settings, and restricting network and server access. In other words, Microsoft SCW will help you to identify minimum functionality requirements for a server-based on an installed role or service on that particular server. Then this policy can be applied to a server or set of servers using Microsoft SCW, or any other mechanisms like Group Policy Objects (GPOs).
The following is a five-step process to get you to implement the policy in an efficient manner:
- Define your business security policy.
- Translate it into a technical policy.
- Create a policy template using a tool.
- Policy review and validation.
- Policy implementation.
Security Configuration Wizard
The Microsoft Security Configuration Wizard tool has four major sections: Role-Based Service Configuration, Network Security, Registry Settings, and Auditing Policy. Each of these sections has sub-categories to address specific service requests, based on the top level category. The following table provides a high-level explanation of the available options inside Microsoft SCW:
Role-Based Service Configuration | |
---|---|
Server role |
This section provides an option to select or deselect appropriate roles based on your requirements. SCW will automatically detect installed roles on the server. All the dependent roles will also be selected automatically. |
Client features |
In this section, you can select client features that are specific for the role you have chosen in the previous step. |
Administration option |
Provides an option to select different administration tools and options. |
Additional services |
By default, SCW will select all required service-based roles, features, and administrative options. This section will give you an option to review these configurations and to make changes if needed. |
Handling unwanted services |
In this section, you will have an option to select unidentified services. SCW will not display services if they are not present in the local system. |
Network Security | |
Network security rules |
In this section, you can select firewall rules, traffic types, ports, and so on. |
Registry Settings | |
SMB security setting |
Provides an option to enable or disable SMB security signing. |
LDAP Signing requirement |
If the Domain Controller role is selected, you will see an option to configure LDAP signing. |
Outbound Authentication methods |
This section provides an option to configure remote computer authentication methods. You will have an option to select either domain account or local account. |
Auditing Policy | |
System Audit Policy |
This section provides an option to enable or disable auditing on a selected server. |
Since creating a business security policy is beyond the scope of this book, my assumption would be that you have a business security policy already defined and in place. So we will be starting with the Translating your policy into a technical policy section.
Translating your policy into a technical policy
In this stage, as a security administrator, your job is to convert the existing business security policy into a technical policy. Since we are planning to use Microsoft SCW for this exercise, we can map our policy directly into an SCW policy.
I always use a worksheet to map these policies so as to make sure they align with existing options in the tool. The following is a sample worksheet. It helps an administrator identify the policies that are available in SCW and map them accordingly. On the left side of the worksheet, we have Business Security Policy. They directly come from the business or service owners. On the center of the worksheet, we have Technical Policy; in this case, I have included all available SCW roles and services in this section. The right column, Comments, is for mentioning any additional steps or comments required to complete the task.
As an example, you can see a sample internal portal server policy in the following worksheet where I have mapped a Business Security Policy to a Technical Policy:
Business Security Policy | Â |
Technical Policy |
Comments |
---|---|---|---|
 |
Role-Based Service Configuration (SCW) | ||
It must be a dedicated server for the proposed application. All other non-dependent services must be disabled. | Â |
Server role |
Review #4 and #5 as well. |
Required client features must be running on the server to support the application. | Â |
Client features | Â |
Administrators must be able to remotely administer the server, IIS task scheduler, WMI, and log files. | Â |
Administration option | Â |
Custom monitoring service (InfraMon) must be enabled and running on all servers. | Â |
Additional services | Â |
All unwanted and non-dependent services must be disabled. | Â |
Handling unwanted services | Â |
 |
Network Security (SCW) | ||
Only HTTP port 80 and 443 allowed to this server. All other non-dependent ports and services must be disabled. | Â |
Network security rules | Â |
 |
Registry Settings (SCW) | ||
Client computers must be running Windows 7 or higher to access this application. | Â |
SMB security setting | Â |
 |  |
LDAP Signing requirement | Â |
Only domain users can access this application. | Â |
Outbound Authentication methods | Â |
 |
Auditing Policy (SCW) | ||
Successful and failed login attempts must be audited and saved. | Â |
System Audit Policy | Â |
 |
Testing (SCW) | ||
Solution must be tested and evaluated in the lab before implementing in production. | Â | Â |
Test the security policy in the lab using SCW. |
 |
Implementation (GPO) | ||
Solution must be deployed using an automated mechanism. It must be transparent to the application developers and owners. | Â | Â |
Export security policy and GPO and implement it in the correct OU. |
 |
Rollback Plan (GPO) | ||
Must be able to roll back to previous state if/as needed. | Â | Â |
Use GPO. |
In the preceding exercise, we had a perfect one-to-one matching between Security Business Policy and SCW options, but in the real world, it may be different. So you may need to modify the policy worksheet based on your requirements. If the options are not available in SCW, you may need to configure it manually using GPO or other mechanisms.
Creating a policy template
In order to generate a policy template, you must be a local administrator on the server. SCW can be run from a local server or from a remote server. If you are running SCW from a remote server, you need to make sure that the required ports and firewall rules are enabled on this remote server. By default, SCW tries to establish an admin$
share connection to the remote server. Perform the following steps:
- Open Server Manager. You can open Server Manager from the status bar, or by typing
Server Manager
in the Windows Start screen. - From the Tools menu, select the Security Configuration Wizard option.
- Click on Next on the Welcome to the Security Configuration Wizard page.
- Select the Create a new security policy option on the Configuration Action page. Click on Next.
- On the Select Server page, enter the server name in the Server textbox, or click on the Browse button to search for a server from the Active Directory. This server will be used to create a baseline policy based on the roles and features installed on this server.
- If you specify a remote server, and the current logged-in user does not have local administrative permissions on the remote server, you can specify an alternate account using the Specify User Account… option. Click on Next.
- SCW analyzes the remote server and updates the configuration database based on the installed role and features on the selected server. You can see the details by selecting the View Configuration Database option from the Processing Security Configuration Database page:
- The View Configuration Database option opens the SCW Viewer window to display the configuration database.
- If you see Windows Security Warning for the ActiveX control, select Yes to continue the operation.
- The Security Configuration Database option has five different sections—Server Roles, Client Features, Administration and Other Options, Services, and Windows Firewall. You will be evaluating and modifying these settings based on your business security policy requirement.
- You can safely close the SCW Viewer window without interrupting any other tasks.
- Click on Next to continue.
- Click on Next on the Role-Based Service Configuration page.
- In the Select Server Roles window:
- From the View drop-down box, you can select All roles, Installed Roles, Uninstalled Roles, or Select Roles. Since we are creating a baseline policy based on an install role, we will select Installed Roles.
Note
If the required roles are not installed on the server, you can add these roles from Server Manager by selecting the Add roles and features option. All required roles must be installed prior to creating a baseline policy.
- You will notice that some of the roles are selected by default. These are some of the required or dependent components for successful creation, implementation, and rollback of these policies.
- Select the appropriate roles here. As an example, I am selecting the Web Server role here.
- Click on Next to continue.
- From the View drop-down box, you can select All roles, Installed Roles, Uninstalled Roles, or Select Roles. Since we are creating a baseline policy based on an install role, we will select Installed Roles.
- On the Select Client Features page, select the appropriate client features based on your security requirements. Click on Next.
- On the Select Administrative and Other Options page, select the appropriate options based on your security policy requirement. Click on Next.
- As an example, in this exercise, I will be selecting the following administrative options:
- Remote Windows Administration.
- Also, you will see a few new options based on the selected roles and features on the previous page.
- Select Web Server options from the View drop-down menu.
- Here, I am using my worksheet as an example. Based on the requirement, we need to have remote administration enabled. So, I will be selecting the Remote Administration for Web Server (IIS) option.
- Click on Next.
- On the Select Additional Services page, select the additional services based on your requirement. According to my security policy requirement, "A custom monitoring service (InfraMon) must be enabled and running on all servers." As shown in the following screenshot, you will have an option to select or deselect additional services from this window. Click on Next.
- On the Handling Unspecified Service page, select the appropriate option based on your security policy requirement. Unspecified services are services that are not part of the default configuration database. Since they are unknown to the SCW application, and may be a security threat, you will be presented with the following two options:
- Do not change the startup mode of the service: This will leave the existing startup mode (Automatic, Manual, and so on) of the services intact.
- Disable the service: If you are not sure about the listed service, you can use the Disable the service option to disable these types of services at operating system startup.
- Once you complete the configuration, you can click on Next to proceed to the next step in the process.
- You can confirm these settings on the Confirm Service Changes window. Click on Next.
- Click on Next to continue with network security configuration, from the Network Security window. If you do not have a network security requirement, you can skip this configuration using the Skip this section option.
- In the Network Security Rules window, select the appropriate firewall rules. For example, if you need to modify the HTTP traffic rule, you can:
- Select the World Wide Web Services (HTTP Traffic-In) rule.
- Select Edit to edit an existing policy or Add to add a custom policy.
- On the Add or Edit rule window, you have the following tabs:
- Program and Services: Enable or disable services and programs
- Protocols and Ports: Enable or disable ports and protocols
- Scope: Restrict IP address traffic based on selected IP address range
- Click on Next.
- Click on Next to continue with registry security configuration, from the Registry Security window.
- If you don't have a registry security requirement, you can skip this configuration using the Skip this section option.
- On the Require SMB Security Signatures page, select the appropriate options based on your security policy requirement.
- Click on Next
- On the Outbound Authentication Methods page, select the appropriate options. Click on Next.
- On the Outbound Authentication using Domain Account page, select the appropriate options based on your security requirement. The following are the available options:
- Windows NT 4.0 Service Pack 6a or later operating system
- Clock that is synchronized with the select server's clock
- Click on Next.
- On the Registry Setting Summary page, review the selected settings and click on Next to continue.
- Select Next to continue with audit policy configuration from the Audit Policy window:
- If you don't have auditing requirements, you can skip this configuration using the Skip this section option, or you can configure the auditing by selecting the options from the System Audit Policy page. As an example, I will be selecting the Audit successful and unsuccessful activities option.
- Click on Next.
- On the Audit Policy Summary page, review the selected settings and click on Next to continue.
- Click on Next on the Save Security Policy page.
- On the Security Policy File Name page, enter the Name and Description values for the policy. Click on Next.
- Select the Apply Later option on the Apply Security Policy page.
- Click on Finish on the Completing the Security Configuration Wizard page.
Note
By default, all the polices will be saved in the
%Systemroot%\Security\MSSCW\Policies
folder.
Policy review and validation
At this point, you have created a baseline security template based on your business security requirement. As always, it is a best practice to evaluate these configurations in an isolated lab environment before it is implemented in the production environment.
Microsoft SCW creates an XML file as an output policy file, which can be reviewed by using any XML reader. Microsoft has provided a command-line supplement SCW tool called SCWCMD to accomplish this. SCWCMD is a powerful tool that can support the following actions:
- SCWCMD analyze: Analyzes the computer based on your security policy
- SCWCMD configure: Applies SCW security to a computer
- SCWCMD register: This updates the SCW database based on your custom roles and features
- SCWCMD rollback: This will roll back the policies from the previously applied computer
- SCWCMD transform: This converts an SCW-generated policy to a GPO-based policy
- SCWCMD view: This views the existing SCW policy
We will be using the SCWCMD tool with view option for our policy review and validation process:
- From the command prompt, enter the following command:
SCWCMD view /x:WebServerBaseLineV1.0.xml
- It will open SCW Viewer. Click on Yes to access Windows Security Warning. You should be able to review the policy settings from SCW Viewer.
Once you have verified the settings, you can apply it to one server to evaluate the result. We will be using Security Configuration Wizard (SCW) to achieve this:
- Open Security Configuration Wizard (SCW) from Server Manager.
- Click on Next in the Welcome window.
- In the Configuration Action window, select the Apply an existing security policy option.
- In the Existing security policy file window, select the previously created policy file.
- Click on Next.
- In the Select Server window, select the correct destination server. Click on Next.
- You can view the policy detail in the Apply Security Policy window. Click on Next to continue.
At this point, as an administrator, your job is to validate and verify the result. Once you are satisfied with the result, you can move to the production implementation.
Policy implementation
Applying a policy using Microsoft SCW is suitable for a small environment or testing purposes. However, in an enterprise environment, it may not be sufficient. Some type of automated mechanism should be in place. Since Microsoft Group Policy Object (GPO) is a commonly used tool in any environment, we can use GPO to deploy these security configurations into the designated servers. Since Microsoft SCW and Microsoft GPO are not directly connected, the first step in the process is to export output of the SCW XML file into the GPO format, and then import this into Active Directory.
In our scenario, we will be using the SCWCMD Transform command with the syntax scwcmd transform /p:<SCWPolicy.xml> /g:<GPOName>
:
- Open the command line from your Windows Server 2012 server.
- Type
scwcmd transform /p:WebServerBaseLineV1.0.XML /g:WebServerBaselineV1.0
and press Enter. - This will convert and export the policy into Active Directory.
- Open Group Policy Manager Console. You can open it from Server Manager or type
Group Policy Manager
on the start screen. - Expand your Domain, Domain Name, and then Group Policy Objects nodes. The exported policy will be in the Group Policy Objects node.
- The GPO configuration can be verified by evaluating the policies in the Settings tab.
- Once you are satisfied with the policy, it can be deployed (linked) to an existing Organizational Unit (OU). In this scenario, we will be linking it to an OU called InternalWebServers.
Note
Keep in mind that the
SCWCMD Trasnform
command will only export the polices into Active Directory. You need to manually link these GPO, using Group Policy Administration console. - Locate the correct OU by expanding the top level OU. In this scenario, I will be selecting the InternalWebServers OU.
- Right-click on the InternalWebServers OU and select the Link an Existing GPO option.
- Select the WebServerBaseLiveV1.0 GPO from the Select GPO window. Click on OK.
- This will link the existing GPO to this OU and all severs inside this OU will automatically receive the policy.
Note
The GPO will get updated on to these computers during the default GPO interval. However, you can force the update manually by using the GPUpdate/Force
command, or by selecting the Group Policy Update option from the GPMC console.
Analyzing the result and troubleshooting
The SCWCMD tool provides an option to troubleshoot the computers so as to ensure that these computers are in compliance with your security policy. We will be using the SCWCMD Analyze
option to analyze a computer's existing policy against an implemented policy. We can use this command against any computer regardless of whether you have used SCW or GPO to implement these policies. The result will be saved in an XML file in the working directory, unless you have specified a different path. These files can be viewed using the SCWCMD View
option.
Here, I am running the SCWCMD Analyze
command against a non-hardening server to demonstrate the result:
- From the command prompt, enter the
SCWCMD Analyze /m:Server02 /p:WebServerBaseLineV1.0.XML
command. - The output will be saved in the same directory and the default filename will be the server name. In this scenario, it will be called
Server02.XML
. - The
SCWCMD view
command can be used to view this file. This command will open the result file in SCW Viewer. - From the command prompt, enter
SCWCMD View /x:Server02.XML
. - If you receive an Active X Windows Security Warning, click on Yes to continue.
- Depending on the policy and configuration of the server, you will see different listings such as Misconfigured Services, Rules are not on the system, and the like on the Security Configuration Wizard Analysis Results window.
A backup or rollback plan
A backup or rollback plan is important for any business. Microsoft SCW provides an easy method to revert the changes to its previous state. During the policy implementation, SCW will create the rollback files on the local server with the current configuration. These are XML files and are located in %systemdir%\security\msscw\rollbackfiles folder
.
Note
Rollback files are located on the local server itself.
If the rollback files are not available in the default folder, you will receive the following error message during the server selection:
Once you perform the rollback operation, the XML files get deleted from the rollbackfiles
folder. So, if you want to keep a record of these policies and settings, you will need to back up these files before performing the rollback operation.
Note
Microsoft SCW can only roll back the changes that have been applied by the SCW tool. If you use any other mechanisms like GPO, SCW won't be able to revert these changes.
If you use GPO to implement the policy, you can move these servers to a different OU to avoid applying these policies. Keep in mind that some policies are tattooed into the system. In that case, you need to create another GPO to revert these changes.
The following instructions provide the details of a rollback method using SCW"
- Open Security Configuration Wizard from Server Manager.
- Click on Next in the Welcome window.
- From the Configuration Action window, select the Rollback the last applied security policy option. Click on Next.
- In the Select Server window, select the appropriate server name. Click on Next.
- In the Rollback Security Configuration window, you can click on View Rollback File to verify the rollback details. It will open SCW Viewer. Click on Next to continue with the rollback operation.
- You will see the status and progress in the next screen. Click on Next.
- Click on Finish on the Completing the Security Configuration Wizard screen to complete the rollback operation.