views:

1194

answers:

6

I really know nothing about securing or configuring a "live" internet facing web server and that's exactly what I have been assigned to do by management. Aside from the operating system being installed (and windows update), I haven't done a thing. I have read some guides from Microsoft and on the web, but none of them seem to be very comprehensive/ up to date. Google has failed me.

We will be deploying a MVC ASP.NET site.

What is your personal check when you are getting ready to deploy a application on a new windows server?

A: 

I look if there is a *NIX system as firewall somewhere!

Sybiam
the built in Windows Firewall in Server 2003 and 2008 is pretty good!
Jeff Atwood
+2  A: 

use the roles accordingly, the less privileges you use for your services accounts the better, try not to run all as an administrator,

Oscar Cabrero
+9  A: 

This is all we do:

  • Make sure Windows Firewall is enabled. It has an "off by default" policy, so the out of box rule setup is fairly safe. But it never hurts to turn additional rules off, if you know you're never going to need them. We disable almost everything except for HTTP on the public internet interface, but we like Ping (who doesn't love Ping?) so we enable it manually, like so:

    netsh firewall set icmpsetting 8

  • Disable the Administrator account. Once you're set up and going, give your own named account admin rights. Disabling the default Administrator account helps reduce the chance (however slight) of someone hacking it. (The other common default account, Guest, is already disabled by default.)

  • Avoid running services under accounts with administrator rights. Most reputable software is pretty good about this nowadays, but it never hurts to check. For example, in our original server setup the Cruise Control service had admin rights. When we rebuilt on the new servers, we used a regular account. It's a bit more work (you have to grant just the rights necessary to do the work, instead of everything at once) but much more secure.

Jeff Atwood
You don't even need to disable the built in administrator account, you may also rename it using a registry key. (http://support.microsoft.com/kb/816109)
X-Istence
Jeff, there's no hardware firewall in front of the SO servers now? I thought I'd heard something in one of the podcasts.
Matt
A: 

Block incoming ports 135, 137, 138, 139, 445 with a firewall. The builtin one will do. Windows server 2008 is the first one for which using RDP directly is as secure as ssh.

Joshua
+3  A: 

Your biggest problem will likely be application security. Don't believe the developer when he tells you the app pool identity needs to be a member of the local administrator's group. This is a subtle twist on the 'don't run services as admin' tip above.

Two other notable items: 1) Make sure you have a way to backup this system (and periodically, test said backups). 2) Make sure you have a way to patch this system and ideally, test those patches before rolling them into production. Try not to depend upon your own good memory. I'd rather have you set the box to use windowsupdate than to have it disabled, though.

Good luck. The firewall tip is invaluable; leave it enabled and only allow tcp/80 and tcp/3389 inbound.

JohnW
+3  A: 

I had to lockdown one a few years ago...

As a sysadmin, get involved with the devs early in the project.. testing, deployment and operation and maintenance of web apps are part of the SDLC.

These guidelines apply in general to any DMZ host, whatever OS linux or windows.

there are a few books deicated to IIS7 admin and hardening but It boils down to

  1. decide on your firewall architecture and configuration and review for appropriateness. remember to defend your server against internal scanning from infected hosts. depending on the level of risk consider a transparent Application Layer gateway to clean the traffic and make the webserver easier to monitor.

1, you treat the system as a bastion host. locking down the OS, reducing the attack surface(services, ports installed apps ie NO interactive users or mixed workloads, configure firewalls RPC to respond only to specified management DMZ or internal hosts). consider ssh, OOB and/or management LAN access and host IDS verifiers like AIDE tripwire or osiris. if the webserver is sensitive, consider using argus to monitor and record traffic patterns in addition to IIS/FW logs.

  1. baseline the system configuration and then regularly audit against the base line, minimizing or controlling changes to keep this accurate. automate it. powershell is your friend here.

  2. the US NIST maintain a national checklist program repository. NIST, NSA and CIS have OS and webserver checklists worth investigating even though they are for earlier versions. look at the apache checklists as well for configuration suggestions. review the addison wesley and OReilly apache security books to get a grasp of the issues.

http://checklists.nist.gov/ncp.cfm?prod_category://checklists.nist.gov/ncp.cfm?prod_category http://www.nsa.gov/ia/guidance/security_configuration_guides/web_server_and_browser_guides.shtml www.cisecurity.org offer checklists and benchmarking tools for subscribers. aim for a 7 or 8 at a minimum.

  1. Learn from other's mistakes (and share your own if you make them): Inventory your public facing application products and monitor them in NIST's NVD(vulerability database..) (they aggregate CERT and OVAL as well) subscribe and read microsoft.public.iinetserver.iis.security and microsoft security alerts. (NIST NVD already watches CERT) Michael Howard is MS's code security guru, read his blog (and make sure your dev's read it too) it's at: http://blogs.msdn.com/michael_howard/default.aspx

http://blogs.iis.net/ is the IIS teams blog. as a side note if you're a windows guy, always read the team blog for MS product groups you work with.

David Litchfield has written several books on DB and web app hardening. he is a man to listen to. read his blog.

If your dev's need a gentle introduction to (or reminder about) web security and sysadmins too! I recommend "Innocent code" by Sverre Huseby.. havent enjoyed a security book like that since a cookoo's egg. It lays down useful rules and principles and explains things from the ground up. Its a great strong accessible read

  1. have you baselined and audited again yet? ( you make a change you make a new baseline).

  2. Remember, IIS is a meta service (FTP.SMTP and other services run under it). make your life easier and run a service at a time on one box. backup your IIS metabase. If you install app servers like tomcat or jboss on the same box ensure that they are secured and locked down too.. secure web management consoles to these applications, IIS included. IF you have to have DB on the box too. this post can be leveraged in a similar way

  3. logging.an unwatched public facing server (be it http, imap smtp) is a professional failure. check your logs pump them into an RDMS and look for the quick the slow and the the pesky. Almost invariably your threats will be automated and boneheaded. stop them at the firewall level where you can.

  4. with permission, scan and fingerprint your box using P0f and nikto. Test the app with selenium. ensure webserver errors are handled discreetly and in a controlled manner by IIS AND any applications. , setup error documents for 3xx, 4xx and 5xx response codes.

  5. now you've done all that, you've covered your butt and you can look at application/website vulnerabilities. be gentle with the developers, most only worry about this after a breach and reputation/trust damage is done. the horse has bolted and is long gone. address this now. its cheaper. Talk to your dev's about threat trees.

  6. Consider your response to Dos and DDoS attacks. on the plus side consider GOOD traffic/slashdotting and capacity issues. Liase with the Dev's and Marketing to handle capacity issues and server/bandwidth provisioning in response to campaigns/sales new services. Ask them what sort of campaign response theyre expec(or reminting. Plan ahead with sufficient lead time to allow provisioning. make friends with your network guys to discuss bandwidth provisioing at short notice. Unavailabilty due to misconfiguration poor performance or under provisioning is also an issue.. monitor the system for performance, disk, ram http and db requests. know the metrics of normal and expected performance.. (please God, is there an apachetop for IIS? ;) ) plan for appropriate capacity.

  7. During all this you may ask yourself: "am I too paranoid?". Wrong question.. it's "am I paranoid enough?" Remember and accept that you will always be behind the security curve and that this list might seem exhaustive, it is but a beginning. all of the above is prudent and diligent and should in no way be considered excessive.

Webservers getting hacked are a bit like wildfires (or bushfires here) you can prepare and it'll take care of almost everything, except the blue moon event. plan for how you'll monitor and respond to defacement etc.

avoid being a security curmudgeon or a security dalek/chicken little. work quietly and and work with your stakeholders and project colleagues. security is a process, not an event and keeping them in the loop and gently educating people is the best way to get incremental payoffs in term of security improvements and acceptance of what you need to do. Avoid being condescending but remember, if you DO have to draw a line in the sand, pick your battles, you only get to do it a few times.

  1. profit!
Bob Blanchett

related questions