| Russ 的个人资料Russ Kaufmann日志列表 | 帮助 |
|
|
4月5日 Hardening IP for IIS ServersAahh, the joys of meeting SOX requirements…
Tonight, I am having fun whipping together a script to apply to servers to meet SOX audit recommendations. This particular task is to harden IP on all IIS 6.0 server per KB 324270. I had been tasked with applying changes to IIS 6.0 servers working with others on a team. I volunteered to create the script to handle many of the registry changes required to meet the audit requirements (yeah, I am stupid that way…). They get the joy of testing and deploying the script in production.
My first step was to create the script itself. Afterwards, I had the joy of creating the .ini files that I will use in conjunction with regini. The commands in the script are pretty simple once the .ini files are created, and they are pretty simple, too.
First the script, a very basic command line script (yes, I sanitized it to protect the innocent, and I also removed many lines and simplified it for ease of understanding):
@echo off CLS
rem Apply IP Hardening registry info ECHO Implementing IP Hardening registry entries regini SynAttackProtect.ini regini EnablePMTUDiscovery.ini regini EnableDeadGWDetect.ini regini KeepAliveTime.ini regini NoNameReleaseOnDemand.ini
I created this very simple script (damn, it sure looks easy, doesn't it?), and then I created the individual .ini files. They are simple text files as follow (note, the italicized text is the content of each file):
SynAttackProtect.ini \Registry\Machine System CurrentControlSet Services Tcpip Parameters SynAttackProtect = REG_DWORD 0x1
EnablePMTUDiscovery.ini \Registry\Machine System CurrentControlSet Services Tcpip Parameters EnablePMTUDiscovery = REG_DWORD 0x0
EnableDeadGWDetect.ini \Registry\Machine System CurrentControlSet Services Tcpip Parameters EnableDeadGWDetect = REG_DWORD 0x0
KeepAliveTime.ini \Registry\Machine System CurrentControlSet Services Tcpip Parameters KeepAliveTime = REG_DWORD 0x493e0
NoNameReleaseOnDemand.ini \Registry\Machine System CurrentControlSet Services Netbt Parameters NoNameReleaseOnDemand = REG_DWORD 0x1 Yeah, I am done. How are the other team members going to deploy the script? I am not sure, but I am out of the office for the rest of the week. A point that I would like to note; I don't think a script is the best way to deploy these changes. These entries scream for other ways to get them to all of the servers. I gave my recommendation and was out voted. I am practicing a special "I told you so" dance when they realize that I was right. I think I hurt myself, but I should be healed enough to do the dance when I get back in the office. :) 3月14日 IIS 6.0 Security - System Files, Management, Samples, and Help FilesYes, these are still a problem. In IIS 5.0, many organizations would perform an installation of IIS 5.0 and totally miss some pretty ugly potential vulnerabilities. The biggest of these include:
Some common sense should tell us that we need to get rid of these potential vulnerabilities in IIS 5.0. However, many of us forget that some of these still exist in IIS 6.0. Samples are samples. Why in the world would you ever want these on a production server? Maybe development, but certainly not in production. The same is true of help files. Why would a server need to refer to help files to keep production code running? Well, of course it doesn't need to do that. A production server runs the code you give it, and it should not run anything else. Then there is the dreaded IIS administration web site. Um, in case you had not noticed, you can manage your servers using the MMC snap-in. It is easy to find, after all, it is called, "Internet Information Services (IIS) Manager." Hmmm, I would bet, based on its name, that it could be used for mananaging Internet Information Services. Don't use the HTML version of the admin tool. You should remove the HTML version of the tool in Control Panel\ Add or Remove Programs\ Add\ Remove Windows Components\ Application Server (Details)\ Internet Information Services (IIS) (Details)\ World Wide Web Service (Details)\ Remote Administration (HTML). Just because a tool exists does not mean you should use it. Some non-common sense items related to security have to do with the NTFS permissions on many directories. These directories (OK, you can call them folders if it makes you feel better) should be secured so that administrators have full control, System has full control, and authenticated users have read access:
These files should be secured so that administrators have full control, System has full control, and authenticated users have read and execute access:
Make sure that the permissions for this folder (does that make you feel better?) is secured so that administrators have full control and System has full control.
There is much more than you can do to help secure IIS. For example there is a whole slew of information on hardening TCP/IP that I may write about in the near future. IIS Required ServicesI am still working on the final bits of my IIS 6.0 Security presentation for TechMentor in April. One of the pieces that seems to have a great deal of conflicting information is what services are required by IIS 6. So, here goes: Required Services include:
Potentially Required Services
Not Required by Most Installations - Most of these following services have several vulnerabilities associated with them. I strongly encourage turning these services off when possible, which should be almost all of the time.
<updated because Neil MacMurchy caught something that I missed> 3月6日 Security Configuration WizardI was playing with this new tool (in the soon to be released SP1 for Windows Server 2003) and must say that I am very pleased. I am actually a bit shocked at how well this wizard has been done. It has great levels of detail available and it provides administrators many different options in creating and utilizing security policies. SCW is a fantastic new tool, and I can see it making life easy for administrators around the world. I fired up the wizard and started walking through the steps, and about 15 minutes later, I had a new security policy and applied it to my web servers. Whether it is a good policy or not isn't the issue. SCW allows administrators to configure policies based on:
SCW provides a great deal of granularity for all sorts of implementations. Each of the check boxes usually includes an option where you can see the details relating to the option and get a mini explanation for each option. My favorite feature has to be the ability to roll back any security policies applied using this wizard. I love "un-do" and "do-over" options. If you haven't played with this new tool, crank it up. It is easy and very useful. As I tell my Unix administrator friends, "You too can point and click your way to happiness as a Windows administrator." 1月28日 IIS 6.0 SecurityWow, there is a great deal of confusion on this subject. I asked a few people what they thought this topic is in their minds. I heard several differing views regarding what it means to secure IIS 6.0. So, what is it? Is it securing the server? Is it securing the service? Is it securing the application or site? I tend to lean towards the definition including securing the application or site more than anything else. The goal is to make sure the website and any applications available through the website is available to users. Now, that goal does include securing the server and securing the service, but if you include the website content/applications then you are adding another level to the issue. So, we secure the server doing such fun tasks as turning off unused services and basically locking down the operating system. We put the server in a well protected DMZ. We can also perform such tasks as enabling IP filtering and configuring filters on the firewall(s) to help protect the server from unauthorized port access. We can turn off ICMP ping responses to make the server and its IP address a black hole to script kiddies. We should install antivirus software and anti spyware software. There are so many things we can do and should do. Some tasks that I am not hearing when it comes to securing IIS 6.0 include using tools to republish the site on a regular basis and moving the actual content to servers inside the LAN. If your site is defaced by some incredibly industrious hacker, you can write right back over it with your approved content using several different applications or home grown scripts. The hacker gets the joy of defacing your site for a few minutes and *poof* it is right back to the way it should be in a matter of moments. they can't even brag to their friends that they did it because it is back to normal so quickly. One of my favorite methods of securing content and applications is to have the actual content and the application data inside the LAN. The server can sit in the DMZ, but we can use the features of IIS to redirect requests for content and data back through the inside firewall to internal servers. Even if the IIS server is somehow compromised, they still don't have access to the data in many cases. Security really isn't that difficult to implement. I think the key is to keep the basic security concepts in mind when designing your IIS 6.0 solution. Don't allow more access than is required to view the content or run the applications. Don't allow developers any access to the production box. After all, they are supposed to develop in a development environment, test in a test environment and then turn it over to the systems engineer to deploy the final solution in a production environment. Keep in mind the many different levels of security available to you. Watch the site constantly (or monitor it using good products) and be prepared to repair as necessary. Work closely with the others involved such as the network team and the end users to make sure we do everything we can to keep the solution secure. By the way, I didn't even talk about SSL yet. Stay tuned, there is more to follow on this subject as I flesh it out. I need to do this soon as I am supposed to present a session on IIS 6.0 Security at TechMentor in Orlando this April. |
|
|