{"ava":{"failFast":false,"files":["dist/tests/**/*.js"],"timeout":"1m"},"description":"hint that that checks if disallowed response headers are sent","devDependencies":{"@hint/utils-tests-helpers":"^1.0.0","ava":"^0.25.0","cpx":"^1.5.0","eslint":"^5.2.0","eslint-plugin-import":"^2.13.0","eslint-plugin-markdown":"^1.0.0-beta.7","eslint-plugin-typescript":"^0.12.0","markdownlint-cli":"^0.12.0","npm-link-check":"^2.0.0","npm-run-all":"^4.1.2","nyc":"^12.0.2","rimraf":"^2.6.2","hint":"^3.1.0","typescript":"^3.0.1","typescript-eslint-parser":"^18.0.0"},"engines":{"node":">=8.0.0"},"files":["dist/src","npm-shrinkwrap.json"],"homepage":"https://webhint.io/","keywords":["webhint","webhint-hint","no-disallowed-headers","no-disallowed-headers-hint","webhint-recommended"],"license":"Apache-2.0","main":"dist/src/hint.js","name":"@hint/hint-no-disallowed-headers","nyc":{"extends":"../../.nycrc"},"peerDependencies":{"hint":"^3.1.0"},"repository":{"type":"git","url":"git+https://github.com/webhintio/hint.git"},"scripts":{"build":"npm run clean && npm-run-all build:*","build-release":"npm run clean && npm run build:assets && tsc --inlineSourceMap false --removeComments true","build:assets":"cpx \"./{src,tests}/**/{!(*.ts),.!(ts)}\" dist","build:ts":"tsc","clean":"rimraf dist","lint":"npm-run-all lint:*","lint:js":"eslint . --cache --ext js --ext md --ext ts --ignore-path ../../.eslintignore --report-unused-disable-directives","lint:md":"markdownlint --ignore CHANGELOG.md *.md","test":"npm run lint && npm run build && npm run test-only","test-only":"nyc ava","watch":"npm run build && npm-run-all --parallel -c watch:*","watch:assets":"npm run build:assets -- -w --no-initial","watch:test":"ava --watch","watch:ts":"npm run build:ts -- --watch"},"version":"1.0.1","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-disallowed-headers@1.0.1","_npmVersion":"6.3.0","_nodeVersion":"10.4.0","_npmUser":{"name":"alrra","email":"alrraa@gmail.com"},"dist":{"integrity":"sha512-CplWX7/RyZ1ftEeQy7utV/5r692AYYHEig5S840WZeI2UvwE8pAPmJTcMgjNEvi/0OOGR9oP2NbbeD5ZzkhWsg==","shasum":"b84a998ceded6ccc4405571579c33e14df0780f1","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-disallowed-headers/download/@hint/hint-no-disallowed-headers-1.0.1.tgz","fileCount":7,"unpackedSize":26819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbhpsCRA9TVsSAnZWagAAjIoP/jRmL8SPBUpYpDt13d+c\nlYXBuS+wK29PI6WrXCMK0+JU7nKpw9+R6iccSHIQ67kaweBDn23+2VgO89VW\nL6vF1xFROzwZZaXil0cnpjW2x5UUpvBJhzHk0aKINtpptoNakd9yTWdxbYbS\nKSN7y+upZOBj0B0Ue8Zoc6Ijj6o62atbwEh5rvTKc0fbP83r1yuHjz5v4ltw\n2QotqSll7xbaCgbWDruU769N55ByoE1oNmjWdKtIFLjnK1nBLrZ6Ihgq+MOd\n5eaZhG1TwnpzG/0dNFD0//75X4TPI395lFudSgVEQ34vDkqDDbC1mRzspa+T\nD//d3J4q/53YsX129aY45W9vojYs76aaEfDNpUqmZghg9EDe9wIta+Ttm4HH\ngPh7b3xyh+CC8wkiN3KYizd+iFvQs2BDMB5rdH3e626huy/UVRGvHUoAM+Dc\nx9UTUgkBxuyl+0dGU93wBqYcHlA5KxxQZU1EFqKEWbGmS66CZK1wIQ1K2PEp\ni/G7A6d6gX+2P0ZEbID1cWvkPwtmXy4KWJwLy+Ojriq8RPpm4xJYsyAlJp7d\n4YqSffyoAJChxnSVmEFObuwQd6+Bu4kxKiuDmYIoCG6YtiyAHVGu7euAKrmu\ny03dThrAOKeztrJU+TT57jSz/kqTBEBwdnYdUcf0TVscvm2TJnGKGT1aEjyC\nMfAb\r\n=S/ct\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5YDfug0YMrsjCRn3KDe06qJ7+FlpQ2iWaXaZXHPGnuAiAiDfF3aplvL8sHrcn+7Dk3CVBLkTDYyG9mATRyJDaeKw=="}],"size":9680,"noattachment":false,"key":"/@hint/hint-no-disallowed-headers/-/@hint/hint-no-disallowed-headers-1.0.1.tgz"},"maintainers":[{"name":"alrra","email":"alrraa@gmail.com"},{"name":"molant","email":"amolleda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hint-no-disallowed-headers_1.0.1_1533942379882_0.11596760237000137"},"_hasShrinkwrap":true,"readme":"# Disallowed HTTP headers (`no-disallowed-headers`)\n\n`no-disallowed-headers` warns against responding with certain HTTP\nheaders.\n\n## Why is this important?\n\nThere are certain HTTP headers that should not be sent:\n\n1) Headers that are often set by servers, frameworks, and server-side\n   languages (e.g.: ASP.NET, PHP), that by default have values that\n   contain information about the technology that set them: its name,\n   version number, etc.\n\nSending these types of HTTP headers:\n\n* does not provide any value to the user experience\n* contributes to header bloat\n* exposes information to potential attackers about\n  the technology stack being used\n\n2) Uncommon or esoteric headers that have limited support, require\n   a lot of knowledge to use correctly, and can create more problems\n   than they solve.\n\n   One example here is the `Public-Key-Pins` header. It has [limited\n   support and usage, it’s being deprecated (along with the related\n   `Public-Key-Pins-Report-Only` header) and can easily create a lot\n   of problems if not done correctly][hpkp deprecation].\n\n## What does the hint check?\n\nBy default, the hint checks if responses include one of the following\nHTTP headers:\n\n* `Expires`\n* `Host`\n* `P3P`\n* `Pragma`\n* `Public-Key-Pins`\n* `Public-Key-Pins-Report-Only`\n* `X-AspNet-Version`\n* `X-AspNetMvc-version`\n* `X-Frame-Options`\n* `X-Powered-By`\n* `X-Runtime`\n* `X-Version`\n\nor the `Server` header with a value that provides a lot of information\nand is not limited to the server name.\n\n### Examples that **trigger** the hint\n\n```text\nHTTP/... 200 OK\n\n...\nServer: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4\nX-Powered-By: PHP/5.3.28\n```\n\n```text\nHTTP/... 200 OK\n\n...\nPublic-Key-Pins-Report-Only:\n  pin-sha256=\"MoScTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=\";\n  pin-sha256=\"C5HTzCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE=\";\n  includeSubDomains;\n  report-uri=\"https://www.example.com/hpkp-report\"\n```\n\n### Examples that **pass** the hint\n\n```text\nHTTP/... 200 OK\n\n...\nServer: apache\n```\n\n```text\nHTTP/... 200 OK\n\n...\n```\n\n## How to configure the server to pass this hint\n\n<details><summary>How to configure Apache</summary>\n\nIf the headers are sent, in most cases, to make Apache stop sending\nthem requires removing the configurations that tells Apache to add\nthem (e.g. for the `X-UA-Compatible` header, that would be mean\nremoving something such as `Header set X-UA-Compatible \"IE=edge\"`).\nHowever, if the headers are added from somewhere in the stack (e.g.:\nthe framework level, language level such as PHP, etc.), and that cannot\nbe changed, you can try to remove them at the `Apache` level, using\nthe following:\n\n```apache\n<IfModule mod_headers.c>\n    Header unset Expires\n    Header unset Host\n    Header unset P3P\n    Header unset Pragma\n    Header unset Public-Key-Pins\n    Header unset Public-Key-Pins-Report-Only\n    Header unset Via\n    Header unset X-AspNet-Version\n    Header unset X-AspNetMvc-version\n    Header unset X-Frame-Options\n    Header unset X-Powered-By\n    Header unset X-Runtime\n    Header unset X-Version\n</IfModule>\n```\n\nWhen it comes to the `Server` header, by default, [Apache does not\nallow removing it][apache issue 40026] (the only way to do that is\nby using an external module). However, Apache can be configured using\nthe [`ServerTokens` directive][servertokens] to provide less\ninformation thought the `Server` header.\n\nNote: The following snippet will only work in the main Apache\nconfiguration file, so don't try to include it in a `.htaccess` file!\n\n```apache\n# Prevent Apache from sending in the `Server` response header its\n# exact version number, the description of the generic OS-type or\n# information about its compiled-in modules.\n#\n# https://httpd.apache.org/docs/current/mod/core.html#servertokens\n\nServerTokens Prod\n```\n\nNote that:\n\n* The above snippets work with Apache `v2.2.0+`, but you need to have\n  [`mod_headers`][mod_headers] [enabled][how to enable apache modules]\n  for them to take effect.\n\n* If you have access to the [main Apache configuration file][main\n  apache conf file] (usually called `httpd.conf`), you should add\n  the logic in, for example, a [`<Directory>`][apache directory]\n  section in that file. This is usually the recommended way as\n  [using `.htaccess` files slows down][htaccess is slow] Apache!\n\n  If you don't have access to the main configuration file (quite\n  common with hosting services), add the first snippets in a\n  `.htaccess` file in the root of the web site/app.\n\n</details>\n<details><summary>How to configure IIS</summary>\n\nTo add or remove headers on IIS, you can use the\n[`<customHeader> element`][customheader] and `<remove>/<add>`\ndepending on what you need.\n\nThe following snippet will remove the headers from all responses:\n\n```xml\n<configuration>\n     <system.webServer>\n        <httpProtocol>\n             <customHeaders>\n                <remove name=\"Expires\"/>\n                <remove name=\"Host\"/>\n                <remove name=\"P3P\"/>\n                <remove name=\"Pragma\"/>\n                <remove name=\"Public-Key-Pins\"/>\n                <remove name=\"Public-Key-Pins-Report-Only\"/>\n                <remove name=\"Via\"/>\n                <remove name=\"X-Frame-Options\"/>\n                <remove name=\"X-Powered-By\"/>\n                <remove name=\"X-Runtime\"/>\n                <remove name=\"X-Version\"/>\n             </customHeaders>\n         </httpProtocol>\n    </system.webServer>\n    <system.web>\n        <!-- X-AspNet-Version, only needed if running an AspNet app -->\n        <httpRuntime enableVersionHeader=\"false\" />\n    </system.web>\n</configuration>\n```\n\nTo remove the header `X-AspNetMvc-version`, open your `Global.asax`\nfile and add the following to your `Application_Start` event:\n\n```c#\nMvcHandler.DisableMvcResponseHeader = true;\n```\n\nRemoving the `Server` header is a bit more complicated and changes\ndepending on the version.\n\nIn IIS 10.0 you can remove it using the [`removeServerHeader` attribute\nof `requestFiltering`][request filtering]:\n\n```xml\n<configuration>\n     <system.webServer>\n        <security>\n            <requestFiltering removeServerHeader =\"true\" />\n        </security>\n    </system.webServer>\n</configuration>\n```\n\nFor previous versions of IIS (7.0-8.5) you can use the following:\n\n```xml\n<configuration>\n     <system.webServer>\n        <rewrite>\n            <outboundRules rewriteBeforeCache=\"true\">\n                <rule name=\"Remove Server header\">\n                    <match serverVariable=\"RESPONSE_Server\" pattern=\".+\" />\n                    <action type=\"Rewrite\" value=\"\" />\n                </rule>\n            </outboundRules>\n        </rewrite>\n    </system.webServer>\n</configuration>\n```\n\nThe above snippet will use a [`URL rewrite`][url rewrite] rule to\nremove the `Server` header from any request that contains it.\n\n</details>\n\n## Can the hint be configured?\n\nYes, you can use:\n\n* `include` to specify additional HTTP headers that should\n  be disallowed\n* `ignore` to specify which of the disallowed HTTP headers\n  should be ignored\n\nE.g. The following hint configuration used in the [`.hintrc`][hintrc]\nfile will make the hint allow responses to be served with the `Server`\nHTTP header, but not with `Custom-Header`.\n\n```json\n{\n    \"connector\": {...},\n    \"formatters\": [...],\n    \"hints\": {\n        \"no-disallowed-headers\": [ \"warning\", {\n            \"ignore\": [\"Server\"],\n            \"include\": [\"Custom-Header\"]\n        }],\n        ...\n    },\n    ...\n}\n```\n\n## How to use this hint?\n\nThis package is installed automatically by webhint:\n\n```bash\nnpm install hint --save-dev\n```\n\nTo use it, activate it via the [`.hintrc`][hintrc] configuration file:\n\n```json\n{\n    \"connector\": {...},\n    \"formatters\": [...],\n    \"hints\": {\n        \"no-disallowed-headers\": \"error\",\n        ...\n    },\n    \"parsers\": [...],\n    ...\n}\n```\n\n**Note**: The recommended way of running webhint is as a `devDependency` of\nyour project.\n\n<!-- Link labels: -->\n\n[hpkp deprecation]: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/he9tr7p3rZ8/eNMwKPmUBAAJ\n[hintrc]: https://webhint.io/docs/user-guide/configuring-webhint/summary/\n\n<!-- Apache links -->\n\n[apache directory]: https://httpd.apache.org/docs/current/mod/core.html#directory\n[apache issue 40026]: https://bz.apache.org/bugzilla/show_bug.cgi?id=40026\n[how to enable apache modules]: https://github.com/h5bp/server-configs-apache/tree/7eb30da6a06ec4fc24daf33c75b7bd86f9ad1f68#enable-apache-httpd-modules\n[htaccess is slow]: https://httpd.apache.org/docs/current/howto/htaccess.html#when\n[main apache conf file]: https://httpd.apache.org/docs/current/configuring.html#main\n[mod_headers]: https://httpd.apache.org/docs/current/mod/mod_headers.html\n[servertokens]: https://httpd.apache.org/docs/current/mod/core.html#servertokens\n\n<!-- IIS links -->\n\n[customheader]: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httpprotocol/customheaders/\n[request filtering]: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/#new-in-iis-100\n[url rewrite]: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module\n","publish_time":1533942380027,"_cnpm_publish_time":1533942380027,"dist-tags":{"latest":"3.1.22"}}