Application security encompasses measures taken throughout the application's life-cycle to prevent exceptions in the security policy of an application or the underlying system (vulnerabilities) through flaws in the design, development, deployment, upgrade, or maintenance of the application.

Friday, August 10, 2012

IIS Security Checklist

Various hacking attacks have proven that web security remains the most critical issue to any business that conducts its operations online. Web servers are one of the most targeted public faces of an organization, because of the sensitive data they usually host. Securing a web server is as important as securing the website or web application itself and the network around it.

If you have a secure web application and an insecure web server, or vice versa, it still puts your business at a huge risk. So now days all the company are doing the through penetration testing of their web application either by internal security team member or by external security consultant. In parallel to this web application security we have to take care of our web servers. As there are lots of configuration involves in web servers, so we have to ensure all web server configuration are correct and secured.
 
Patches and Updates
  1. MBSA is run on a regular interval to check for latest operating system and components updates.
  2. The latest updates and patches are applied for Windows, IIS server, and the .NET Framework. (These are tested on development servers prior to deployment on the production servers.)
  3. Subscribe to the Microsoft Security Notification Service at http://www.microsoft.com/technet/security/bulletin/notify.asp
IISLockdown
  1. IISLockdown has been run on the server.
  2. URLScan is installed and configured.
Services
  1. Unnecessary Windows services are disabled.
  2. Services are running with least-privileged accounts.
  3. FTP, SMTP, and NNTP services are disabled if they are not required.
  4. Telnet service is disabled.
  5. ASP .NET state service is disabled and is not used by your applications.
Protocols
  1. WebDAV is disabled if not used by the application OR it is secured if it is required. For more information, see Microsoft Knowledge Base article 323470, "How To: Create a Secure WebDAV Publishing Directory."
  2. TCP/IP stack is hardened.
  3. NetBIOS and SMB are disabled (closes ports 137, 138, 139, and 445).
Accounts
  1. Unused accounts are removed from the server.
  2. Windows Guest account is disabled.
  3. Administrator account is renamed and has a strong password..
  4. IUSR_MACHINE account is disabled if it is not used by the application.
  5. If your applications require anonymous access, a custom least-privileged anonymous account is created.
  6. The anonymous account does not have write access to Web content directories and cannot execute command-line tools.
  7. ASP.NET process account is configured for least privilege. (This only applies if you are not using the default ASPNET account, which is a least-privileged account.)
  8. Strong account and password policies are enforced for the server.
  9. Remote logons are restricted. (The "Access this computer from the network" user-right is removed from the Everyone group.)
  10. Accounts are not shared among administrators.
  11. Null sessions (anonymous logons) are disabled.
  12. Approval is required for account delegation.
  13. Users and administrators do not share accounts.
  14. No more than two accounts exist in the Administrators group.
  15. Administrators are required to log on locally OR the remote administration solution is secure.
Files and Directories

  1. Files and directories are contained on NTFS volumes.
  2. Web site content is located on a non-system NTFS volume.
  3. Log files are located on a non-system NTFS volume and not on the same volume where the Web site content resides.
  4. The Everyone group is restricted (no access to \WINNT\system32 or Web directories).
  5. Web site root directory has deny write ACE for anonymous Internet accounts.
  6. Content directories have deny write ACE for anonymous Internet accounts.
  7. Remote IIS administration application is removed (\WINNT\System32\Inetsrv\IISAdmin).
  8. Resource kit tools, utilities, and SDKs are removed.
  9. Sample applications are removed (\WINNT\Help\IISHelp, \Inetpub\IISSamples).
Shares
  1. All unnecessary shares are removed (including default administration shares).
  2. Access to required shares is restricted (the Everyone group does not have access).
  3. Administrative shares (C$ and Admin$) are removed if they are not required (Microsoft Management Server (SMS) and Microsoft Operations Manager (MOM) require these shares).
Ports

  1. Internet-facing interfaces are restricted to port 80 (and 443 if SSL is used).
  2. Intranet traffic is encrypted (for example, with SSL) or restricted if you do not have a secure data center infrastructure.
Registry

  1. Remote registry access is restricted.
  2. SAM is secured (HKLM\System\CurrentControlSet\Control\LSA\NoLMHash). This applies only to standalone servers.
Auditing and Logging

  1. Failed logon attempts are audited.
  2. IIS log files are relocated and secured.
  3. Log files are configured with an appropriate size depending on the application security requirement.
  4. Log files are regularly archived and analyzed.
  5. Access to the Metabase.bin file is audited.
  6. IIS is configured for W3C Extended log file format auditing.
Sites and Virtual Directories

  1. Web sites are located on a non-system partition.
  2. "Parent paths" setting is disabled.
  3. Potentially dangerous virtual directories, including IISSamples, IISAdmin, IISHelp, and Scripts virtual directories, are removed.
  4. MSADC virtual directory (RDS) is removed or secured.
  5. Include directories do not have Read Web permission.
  6. Virtual directories that allow anonymous access restrict Write and Execute Web permissions for the anonymous account.
  7. There is script source access only on folders that support content authoring.
  8. There is write access only on folders that support content authoring and these folder are configured for authentication (and SSL encryption, if required).
  9. FrontPage Server Extensions (FPSE) are removed if not used. If they are used, they are updated and access to FPSE is restricted.
Script Mappings

  1. Extensions not used by the application are mapped to 404.dll (.idq, .htw, .ida, .shtml, .shtm, .stm, idc, .htr, .printer).
  2. Unnecessary ASP.NET file type extensions are mapped to "HttpForbiddenHandler" in Machine.config.
ISAPI Filters
  1. Unnecessary or unused ISAPI filters are removed from the server.
IIS Metabase

  1. Access to the metabase is restricted by using NTFS permissions (%systemroot%\system32\inetsrv\metabase.bin).
  2. IIS banner information is restricted (IP address in content location disabled).
Server Certificates

  1. Certificate date ranges are valid.
  2. Certificates are used for their intended purpose (for example, the server certificate is not used for e-mail).
  3. The certificate's public key is valid, all the way to a trusted root authority.
  4. The certificate has not been revoked.
Machine.config

  1. Protected resources are mapped to HttpForbiddenHandler.
  2. Unused HttpModules are removed.
  3. Tracing is disabled
  4. Debug compiles are turned off.
Code Access Security

  1. Code access security is enabled on the server.
  2. All permissions have been removed from the local intranet zone.
  3. All permissions have been removed from the Internet zone.
Other Check Points

  1. IISLockdown tool has been run on the server.
  2. HTTP requests are filtered. URLScan is installed and configured.
  3. Remote administration of the server is secured and configured for encryption, low session time-outs, and account lockouts.
Dos and Don'ts

  • Do use a dedicated machine as a Web server.
  • Do physically protect the Web server machine in a secure machine room.
  • Do configure a separate anonymous user account for each application, if you host multiple Web applications.
  • Do not install the IIS server on a domain controller.
  • Do not connect an IIS Server to the Internet until it is fully hardened.
  • Do not allow anyone to locally log on to the machine except for the administrator.

1 comment:

  1. Sabyasachi this is really very good information about the Web Server hardening...Good Work

    ReplyDelete