Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
10 KiB

  1. <html>
  2. <head>
  3. <title>Security Lockdown FAQ</title>
  4. </head>
  5. <body>
  6. <FONT FACE="Verdana">
  7. <H1>IIS Security Lockdown FAQ</H1>
  8. <p FONT Size=2>Using the IIS Security Lockdown Wizard, Web site administrators can enable or disable IIS functionality based on the individual needs of their company. To help administrators understand the changes to IIS behavior and the reasoning behind these changes, the IIS Security Lockdown FAQ was developed to answer some common questions about the new functionality.
  9. <p>&nbsp;<table>
  10. <tr>
  11. <td valign="top" width="1%"><b>Q:</b></td><td>Why does IIS 6.0 serve only static HTML files by default?</td></tr>
  12. <tr>
  13. <td valign="top"><b>A:</b></td><td>This change is a direct response to common hacker techniques to compromise a server. Consider for a moment your Web server being like a castle, which you want to defend against attack, while allowing commerce and exchange to occur through well known and regulated paths. Placing your castle in the middle of an open field would allow attack from any angle. But take that same castle and build a moat around it, place a drawbridge across the moat to provide regulated access to the castle, and you dramatically increase the overall security of the castle. Similarly, by reducing the number of features or access points available to a hacker, you can limit the exposure of your Web server to attackers. By default, IIS ships as a fully secured castle, allowing you to determine which drawbridges you open. </td></tr>
  14. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  15. <table>
  16. <td valign="top" width="1%"><b>Q:</b></td><td>What security holes does the Security Lockdown Wizard close? </td></tr>
  17. <td valign="top"><b>A:</b></td><td>IIS 6.0 is a very secure Web server. All the known security issues have been dealt with in IIS6. IIS 6 provides a lot of services and these services are turned off by default. This tool enables the user to turn on the services he needs.</td></tr>
  18. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  19. <table>
  20. <td valign="top" width="1%"><b>Q:</b></td><td>Will my Web server be insecure if I enable ASP or any other feature?</td></tr>
  21. <td valign="top"><b>A:</b></td><td>No. IIS ships without any known vulnerabilities in any feature. You are safe to enable any feature needed to run your business. However, consider the analogy described above before enabling features you do not need. An on-going security program is required to maintain security of your server. This includes monitoring, auditing, applying security hot fixes and service packs. For more information about security patches, please visit <a href="http://www.microsoft.com/security">http://www.microsoft.com/security</a></td></tr>
  22. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  23. <table>
  24. <td valign="top" width="1%"><b>Q:</b></td><td>How can I enable additional functionality?</td></tr>
  25. <td valign="top"><b>A:</b></td><td>The IIS Security Lockdown Wizard is available via the IIS snap-in. To open the IIS snap-in, click <b>Start</b>, click <b>Run</b>, and type <b>inetmgr</b> in the <b>Open</b> text box. From the IIS snap-in, right-click the local computer icon, and then click <b>Security</b>. You can also programmatically control the
  26. IIS Security Lockdown Wizard. For more information, see the question below about
  27. programmatically enabling ISAPI extensions and CGI executables.</td></tr>
  28. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  29. <table>
  30. <td valign="top" width="1%"><b>Q:</b></td><td>How does the IIS Security Lockdown Wizard work?</td></tr>
  31. <td valign="top"><b>A:</b></td><td>IIS 6 maintains a list of modules (ISAPI extensions and CGI executables) that are allowed to load and execute. An ISAPI extension is a Windows DLL that enables dynamic features on your Windows server. For example, ASP.dll is an ISAPI
  32. extension that enables ASP scripts to run. CGI executables are usually EXE
  33. programs that are written to provide dynamic Web server functionality. By
  34. default, IIS does not allow any modules to load or execute; you must configure
  35. IIS to allow the modules to load or process.</td></tr>
  36. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  37. <table>
  38. <td valign="top" width="1%"><b>Q:</b></td><td>If IIS 6 loads only registered DLLs and executables by default, can I enable ISAPI extensions that my company developed?</td></tr>
  39. <td valign="top"><b>A:</b></td><td>IIS provides two ways for you to enable ISAPI extensions. First you can use the IIS Security Lockdown Wizard to add
  40. any ISAPI extensions that you develop to the list of modules that IIS will load.
  41. Second you can programmatically enable ISAPI extensions. For more information, see the
  42. question below about programmatically enabling ISAPI extensions and CGI
  43. executables.</td></tr>
  44. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  45. <table>
  46. <td valign="top" width="1%"><b>Q:</b></td><td>Can you provide a more descriptive error message when I request a Web page that is disabled?</td></tr>
  47. <td valign="top"><b>A:</b></td><td>A more descriptive error message may be beneficial for administrators and developers of the server, but it also gives hackers information they
  48. could use to compromise your server.</td></tr>
  49. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  50. <table>
  51. <td valign="top" width="1%"><b>Q:</b></td><td>What functionality changes should I expect if I upgraded from an IIS 4 or IIS 5.0 server to an IIS 6 server?</td></tr>
  52. <td valign="top"><b>A:</b></td><td>Following an IIS&nbsp; server upgrade, all features
  53. that you had enabled are left enabled. The IIS Security Lockdown wizard automatically appears the first time you open
  54. the IIS snap-in, and it is highly recommended that you immediately disable any features that are not required to run your business. If you choose to not complete the IIS Security Lockdown Wizard, you can access it from the IIS snap-in by right-clicking the local computer, and then clicking <b>Security</b>.</td></tr>
  55. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  56. <table>
  57. <td valign="top" width="1%"><b>Q:</b></td><td>Are there any other IIS 6 security improvements that might effect my Web applications?</td></tr>
  58. <td valign="top"><b>A:</b></td><td>Yes. You should also be aware of the following security improvements:
  59. <UL>
  60. <li>On a clean install, IIS runs as a low privileged account,<I> Network Service</I>. Network Service reduces the access a hacker obtains if he is successful in attacking your server.
  61. <li>IIS has removed sample scripts and other well known virtual directories, which are a common target by hackers.
  62. <li>IIS automatically checks for buffer overflows.<li>IIS prevents attacks from consuming too many resources by setting aggressive limits and timeouts.</ul></td></tr>
  63. <tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>
  64. <table>
  65. <td valign="top" width="1%"><b>Q:</b></td><td>Can I enable my ISAPI extension or CGI executable programmatically? How do I do it?</td></tr>
  66. <td valign="top"><b>A:</b></td><td>Yes. You can enable an ISAPI extension
  67. programmatically using the following ADSI sample:</td></tr>
  68. <tr><td>&nbsp;</td>
  69. <td class="MsoNormal"><code style="font-family: Courier New">
  70. <span style="font-size:10.0pt">if WScript.Arguments.Count &lt; 1 then<br>
  71. &nbsp;&nbsp;&nbsp;WScript.Echo "Usage: " &amp; WScript.ScriptFullName &amp; " full_path_of_ISAPI_to_add"<br>
  72. &nbsp;&nbsp;&nbsp;WScript.Quit<br>
  73. end if<br>
  74. set iis = GetObject("IIS://localhost/w3svc")<br>
  75. oIRL = iis.ISAPIRestrictionList<br>
  76. redim newIRL(UBound(oIRL))<br>
  77. if instr(1,oIRL(0),"1") &gt; 0 then<br>
  78. &nbsp;&nbsp;&nbsp;'Remove ISAPI extension from the list of restricted ISAPI extensions<br>
  79. &nbsp;&nbsp;&nbsp;for i=0 to UBound(oIRL)<br>
  80. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if instr(1,oIRL(i), WScript.Arguments(0)) &gt; 0 then <br>
  81. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'If ISAPI extension is found, don't write it to newIRL<br>
  82. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>
  83. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newIRL(i) = oIRL(i)<br>
  84. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>
  85. &nbsp;&nbsp;&nbsp;next<br>
  86. &nbsp;&nbsp;&nbsp;WScript.Quit<br>
  87. else<br>
  88. &nbsp;&nbsp;&nbsp;'Add ISAPI extension to the list of allowed ISAPI extensions<br>
  89. &nbsp;&nbsp;&nbsp;redim newIRL(UBound(oIRL)&#43;1)<br>
  90. &nbsp;&nbsp;&nbsp;for i=0 to UBound(oIRL)<br>
  91. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newIRL(i) = oIRL(i)<br>
  92. &nbsp;&nbsp;&nbsp;next<br>
  93. &nbsp;&nbsp;&nbsp;newIRL(UBound(newIRL)) = WScript.Arguments(0)
  94. end if<br>
  95. iis.ISAPIRestrictionList = newIRL<br>
  96. iis.SetInfo<br>
  97. WScript.Echo WScript.Arguments(0) &amp; " is now an allowed ISAPI extension."</span></code></td></tr>
  98. <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
  99. <td valign="top">&nbsp;</td><td>You can enable a CGI executable programmatically using the following ADSI sample:</td></tr>
  100. <tr><td>&nbsp;</td>
  101. <td class="MsoNormal"><code style="font-family: Courier New">
  102. <span style="font-size:10.0pt">if WScript.Arguments.Count &lt; 1 then<br>
  103. &nbsp;&nbsp;&nbsp;WScript.Echo "Usage: " &amp; WScript.ScriptFullName &amp; " full_path_of_CGI_to_add"<br>
  104. &nbsp;&nbsp;&nbsp;WScript.Quit<br>
  105. end if<br>
  106. set iis = GetObject("IIS://localhost/w3svc")<br>
  107. oIRL = iis.CGIRestrictionList<br>
  108. redim newIRL(UBound(oIRL))<br>
  109. if instr(1,oIRL(0),"1") &gt; 0 then<br>
  110. &nbsp;&nbsp;&nbsp;'Remove CGI executable from the list of restricted CGI executables<br>
  111. &nbsp;&nbsp;&nbsp;for i=0 to UBound(oIRL)<br>
  112. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if instr(1,oIRL(i), WScript.Arguments(0)) &gt; 0 then <br>
  113. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'If CGI executable is found, don't write it to newIRL<br>
  114. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>
  115. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newIRL(i) = oIRL(i)<br>
  116. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>
  117. &nbsp;&nbsp;&nbsp;next<br>
  118. &nbsp;&nbsp;&nbsp;WScript.Quit<br>
  119. else<br>
  120. &nbsp;&nbsp;&nbsp;'Add CGI executable to the list of allowed CGI executables<br>
  121. &nbsp;&nbsp;&nbsp;redim newIRL(UBound(oIRL)&#43;1)<br>
  122. &nbsp;&nbsp;&nbsp;for i=0 to UBound(oIRL)<br>
  123. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newIRL(i) = oIRL(i)<br>
  124. &nbsp;&nbsp;&nbsp;next<br>
  125. &nbsp;&nbsp;&nbsp;newIRL(UBound(newIRL)) = WScript.Arguments(0)
  126. end if<br>
  127. iis.CGIRestrictionList = newIRL<br>
  128. iis.SetInfo<br>
  129. WScript.Echo WScript.Arguments(0) &amp; " is now an allowed CGI executable."
  130. </span></code></td></tr></table>
  131. </font>
  132. </body>
  133. </html>