Showing posts with label group policy. Show all posts
Showing posts with label group policy. Show all posts

Monday, June 13, 2005

Using Active Directory Group Policy to Make hosts File Read Only

According to SANS NewsBites Nov 4, 2004 New Phishing Tactic is Stealthy,
MessageLabs has reported seeing what could become a new twist in phishing scams. These emails contain a script that, once the email is opened, rewrite host files to automatically redirect users to phishing sites when they attempt to visit legitimate banking sites.
The article advised you protect from this particular kind of attack by disabling Windows Scripting Host. However, if your users are technical people and require to use this for their dayto day work, you don't have the luxury.

But you can change the hosts file to read only and enforce it via Group Policy. Here is how:
  • In Group Policy Management Console, create a new group policy.
  • Go to Computer Configuration | Windows Settings | Security Settings | File System.
  • Add the file:
    %SystemRoot%\system32\drivers\etc\hosts
  • Change the permissions of the file to:
    TypeNamePermission
    AllowBUILDIN\AdministratorsRead
    AllowNT AUTHORITY\SYSTEMRead
    AllowBUILDIN\UsersRead
  • Save and link this group policy to the desired OU accordingly.
Don't forget to enable security policy enforcement. Best practice is to define this as your baseline policy.
  • In Group Policy Management Console again, create a new baseline group policy (or click on your baseline group policy if you already have one).
  • Go to Computer Configuration | Administrative Templates | System | Group Policy.
  • Click on Security policy processing.
  • Choose Enabled radio button, and check the Process even if the Group Policy object have not changed.
  • Save and link it to the desired OU accordingly.

Tuesday, May 10, 2005

Using Active Directory Group Policy to Protect Against SYN Flood DoS Attack

I have been seeing waves of SYN Flood denial of service attack against our applications every so often. During the attack, hugh volume of TCP SYN packets was being sent to our web application until they exhausted all the resources on the corresponding server. It is pretty annoying because it affects the experience of our other legitimate users using our applications.

Our firewalls could keep track of the number of connections from a single source, and if that exceeds a certain threshold, they could deny further connection attempts. This does a pretty good job so far. But I am a little concerned about the growing number of those attacks, and eventually a distributed denial of service one.

Turns out on the Windows 2000/ 2003 server, there are several registry settings that one can use to harden the TCP/IP stack. e.g. SynAttackProtect. By setting this registry value to 1, the server will time out all half open connections more quickly during a SYN attack (determined by several thresholds), and be able to recover the resource sooner to serve legitimate users.

I want to enable it on all our servers. Can Active Directory Group Policy help? Yes! Here is how:
  • Created a custom Administrative Template as follows:

    CLASS MACHINE
    CATEGORY "Network"
    CATEGORY "TCP/IP Hardening"
    POLICY "SynAttackProtect"
    KEYNAME "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
    EXPLAIN "This registry value causes Transmission Control Protocol (TCP) to adjust retransmission of SYN-ACKS. When you configure this value, the connection responses time out more quickly during a SYN attack (a type of denial of service attack). Set SynAttackProtect to Disabled (0 - default) for typical protection against SYN attacks. Set SynAttackProtect to Enabled (1) for better protection against SYN attacks. This parameter causes TCP to adjust the retransmission of SYN-ACKS. When you set SynAttackProtect to 1, connection responses time out more quickly if the system detects that a SYN attack is in progress. Refers to Microsoft KB 324270 for more information."
    VALUENAME "SynAttackProtect"
    VALUEON NUMERIC 1
    VALUEOFF NUMERIC 0
    END POLICY
    END CATEGORY
    END CATEGORY

  • Save the file as SynAttackProtect.adm.
  • In the Group Policy Editor, go to View menu | Filtering, uncheck the "Only show policy settings that can be fully managed" checkbox.
  • Then go to Computer Configuration | Administrative Templates, and use Add/Remove Template to add this SynAttackProtect.adm custom administrative template.
  • Now, under Administrative Template | Network, a TCP/IP Hardening category will appear.
  • Under this TCP/IP Hardening category, double-click on SynAttackProtection and change the status to Enable.
  • Close the Group Policy Editor to finish.
  • Link this group policy to the right OU to apply onto all the servers under it. (always do it on test servers first!)
  • Within 90 minutes (default time for Active Directory Group Policy refresh), the servers will have the new registry setting.
  • You still have to reboot the servers to make the registry change effective.
One thing you have to know is that this kind of group policy is a tattoo type policy. The registry setting would not be changed back to the original value if you later on remove this group policy. To undo the change, you will have to explicitly change this group policy SynAttackProtect setting to Disable.

Refer to Microsoft KB 324270 article for complete detail on how to harden the TCP/IP stack against denial of service attacks in Windows Server 2003.

Thursday, March 31, 2005

Using Active Directory Group Policy to Deploy SmbDeviceEnabled Registry Setting

I deployed a pair of firewall appliances onto our network using Network Address Translation (NAT). Soon after that, users start to report they encounter intermittent network problems. e.g. Corrupted word documnet, garbage data in files on file server, XP machines receive a "Write Delay Error" warning, corrupted Visual Source Safe database.

One thing in common is that the problems are all found when the connection is using Server Message Block (SMB) protocol.

Turns out there is a problem with SMB protocol running on NAT. Refer to Microsoft KB 301673 article for more detail. The work around is to change a registry setting so that NetBT protocol will be used. You can change it either on the client workstations or the servers side.

For us, since the client workstations may connect to more than one servers, and some of those servers are not managede by us (and as a result, they are outside our firewalls, we have to change the registry setting on the client side.

So, I used Active Directory Group Policy to help me to deploy the registry setting.
  • Create a custom Administrative Template as follows:

    CLASS MACHINE
    CATEGORY "NetBT Settings"
    POLICY "SmbDeviceEnabled"
    KEYNAME "SYSTEM\CurrentControlSet\Services\NetBT\Parameters"
    EXPLAIN "This policy configures the registry value HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\SmbDeviceEnabled. You can disable this value to solve the problem of SMB using NAT. Refers to Microsoft KB 301673 for more information."
    VALUENAME "SmbDeviceEnabled"
    VALUEON NUMERIC 1
    VALUEOFF NUMERIC 0
    END POLICY
    END CATEGORY

  • Save the file as NetBT.adm.
  • In the Group Policy Editor, go to View menu | Filtering, uncheck the "Only show policy settings that can be fully managed" checkbox.
  • Then go to Computer Configuration | Administrative Templates, and use Add/Remove Template to add this NetBT.adm custom administrative template.
  • Now, under Administrative Template, a NetBT Settings category will appear.
  • Under this NetBT Settings category, double-click on SmbDeviceEnabled and change the status to Disable.
  • Close the Group Policy Editor to finish.
  • Link this group policy to the right OU to apply onto all the machines under it. (always do it on test machines first!)
  • Within 90 minutes (default time for Active Directory Group Policy refresh), the machines will obtain the new registry value.
  • You still have to reboot the machines to make the registry change effective.
One thing you have to know is that this kind of group policy is a tattoo type policy. The registry setting would not be changed back to the original value if you later on remove this group policy. To undo the change, you will have to explicitly change this group policy NetBT Settings to Enable.

Wednesday, March 30, 2005

WSU IT Forum Presentation

The Vice President of Information Technology of our university organized the first Information Technology Forum. I was invited to co-present with the Enterprise Administrator. The topic is Active Directory: Securing the Enterprise.

Here is the slides of my part of the presentation.



Of course, it's my professional responsibility (as a systems administrator) to strip out or obscure any real server name and infrastructure details. But the essence of the presentation, the power of Active Directory and group policies, remains.

Monday, March 28, 2005

Using Active Directory Group Policy to Protect Against Adware/ Spyware Tracking Cookies

Continuing my journey to fully utilize Active Directory to streamline computer management, I found that we could use Group Policy to block adware and spyware tracking cookies.

More police powers for spyware

Here is how:
  • Start Group Policy Editor.
  • Under User Configuration | Windows Settings | Internet Explorer Maintenance | Security,
  • Right-click on Security Zones and Content Ratings.
  • Under Security Zones and Privacy, choose Import the current security zones and privacy settings.
  • Note: Before you click on Modify Settings
    It will import the Internet Explorer Security Zones and Privacy settings of the machine where you are running the Group Policy Editor. Be careful! Since Windows 2003 disables a lot of IE settings by default, you may not want to run the editor on a Windows 2003 machine and define a IE group policy for Windows XP machines.
  • Click Modify Settings.
  • Go to Privacy tab. Click Sites.
  • Add the advertisement sites/ domains that you want to block their tracking cookies.
  • Click OKs to finish.
This approach only works for Internet Explorer. Of course, it doesn't compare with a real adware/ spyware checking software, since they can do other checks, like file system, registry. I call this a poor man's version. It doesn't cost you anything, other than the time it takes to configure the group policy, and then link it to the right Organization Unit (OU) for deployment.