How to disable unwanted HTTP methods

Source: Internet
Author: User

By default, the insecure options and trace methods are enabled for iis7.0. We recommend that you disable these methods.

The following environments are Windows Server 2008 and iis7.0.

Method (1): Web. config

Add the following code under the <configuration> node:

<system.webServer>    <security>      <requestFiltering>        <verbs allowUnlisted="false">          <add verb="GET" allowed="true"/>          <add verb="POST" allowed="true"/>          <add verb="HEAD" allowed="true"/>        </verbs>      </requestFiltering>    </security></system.webServer>

 

The preceding Code only allows the get, post, and head methods.

Allowunlisted = "false": reject unlisted predicates.

Method (2): iis7.0 --> "Authorization rule"

Add "allow" and "deny" rules. Only one specific predicate can be entered.

Method (3): iis7.0 --> applicationhost. config

File Path: c: \ windows \ system32 \ inetsrv \ config \

  • To configure how IIS handles unlisted predicates, use the following syntax:

    Appcmd set config/section: requestfiltering/verbs. allowunlisted: True | false

    For example, to reject unlisted predicates, type the following command at the command prompt and press Enter:

    Appcmd set config/section: requestfiltering/verbs. allowunlisted: false

  • To configure the predicate to be filtered, use the following syntax:

    Appcmd set config/section: requestfiltering/+ Verbs. [verb =' String ', Allowed = 'true | false']

    VariableVerb StringSpecifies the predicate that will apply this restriction.

    For example, to specify that get is allowed, type the following command at the command prompt and press Enter:

    Appcmd set config/section: requestfiltering/+ Verbs. [verb = 'get', allowed = 'true']

References:

Http://technet.microsoft.com/zh-cn/library/86bb183f-a016-40ca-b9c3-bbb2f5c8a4b5.aspx

Http://www.iis.net/learn/manage/configuring-security/use-request-filtering

Http://technet.microsoft.com/zh-cn/library/hh831621

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.