{"ava":{"failFast":false,"files":["dist/tests/**/*.js"],"timeout":"1m"},"dependencies":{"@hint/utils":"^3.1.1"},"description":"hint that that checks if disallowed response headers are sent","devDependencies":{"@hint/utils-tests-helpers":"^5.0.3","@types/node":"^12.6.8","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.12.0","ava":"^1.4.1","cpx":"^1.5.0","eslint":"^5.15.1","eslint-plugin-import":"^2.18.2","eslint-plugin-markdown":"^1.0.0","hint":"^5.1.2","npm-link-check":"^3.0.0","npm-run-all":"^4.1.5","nyc":"^14.1.0","rimraf":"^2.6.3","typescript":"^3.5.1"},"engines":{"node":">=8.0.0"},"homepage":"https://webhint.io/","keywords":["no-disallowed-headers","no-disallowed-headers-hint","webhint","webhint-hint","webhint-recommended"],"license":"Apache-2.0","main":"dist/src/hint.js","name":"@hint/hint-no-disallowed-headers","nyc":{"extends":"../../.nycrc"},"peerDependencies":{"hint":"^5.1.2"},"repository":{"type":"git","url":"git+https://github.com/webhintio/hint.git"},"scripts":{"build":"npm run i18n && npm-run-all build:*","build-release":"npm run clean && npm run i18n && npm run build:assets && tsc --inlineSourceMap false --removeComments true","build:assets":"cpx \"./{src,tests}/**/{!(*.ts),.!(ts)}\" dist","build:ts":"tsc -b","clean":"rimraf dist","i18n":"node ../../scripts/create-i18n.js","lint":"npm-run-all lint:*","lint:js":"eslint . --cache --ext js --ext md --ext ts --ignore-path ../../.eslintignore --report-unused-disable-directives","lint:dependencies":"node ../../scripts/lint-dependencies.js","lint:md":"node ../../scripts/lint-markdown.js","test":"npm run lint && npm run build && npm run test-only","test-only":"nyc ava","test-release":"npm run lint && npm run build-release && 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":"2.3.2","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-disallowed-headers@2.3.2","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"antross","email":"antross@gmail.com"},"dist":{"integrity":"sha512-K+kG92a3N4f9pgAr1oZJn2zdYBY8f1G+i9SOvXrklZxbzaWJtM5+aBxAGjRgoxcomsnw0KknnGXS4cEWeefjHA==","shasum":"9bfaa7dc481adaca055a7ab9b9379febad0b3b4a","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-disallowed-headers/download/@hint/hint-no-disallowed-headers-2.3.2.tgz","fileCount":14,"unpackedSize":44087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQJryCRA9TVsSAnZWagAAjy0P/1mNhL9RjAiAlGG5M7n2\n2eCLPs/shvv11xQWO6bSq/r35HjBnceAvzsl7Kkh5oxHk2Dms1LXG1iaXj3n\nduBvqoygUJKMLkOQYPP1GXWFnFX2YRs1pViwxgVXsLDu2bZ47tZ3+Y8xXMcg\nAwNwJii3QPs4O97AqbTmrAS7UwjTrbAa7kk9lqvbwfTuROuHNXBRKoPP5UrM\nGclx0kULPqXXdobz8B/1+//DJ4rH+FwdKKBhktDVt0FKpcv/iy6xC+cr0g2/\nj5qf/RztzLkIPGujx/DIDOfLQtklZFNw/9MNQHvhKlOXZnKVw7bAYioJRAGV\nmKNszfeVVJ0vZKVvM488yiWcvMql+f7OOusFhh49zZMlT7M/r6+uOLHpPeSE\n0NAhgLDKqGld0WLaw0iJVblP5HdH4KMnTV1bSe9mZyWv4jAVHiKRNVYNjtxV\nSPgS/NpZQUPlVT66E7Yb3Q19EnqmqfHjsvg80RXSdjl/Cl/DLHiK2lw5hhjD\nii+GqsF8XH7EVxrdSVlf1DB7XATDDRfeUiOxkF849XcnHsPy8N6nELDm1FVB\n6l3NKb+y93Y8qkqOR6/2wrZfFF3oNG+PiYhMfdsvqGNSKthMF/m1kfQ4cvu0\nBLgIkWuBLrbKNggNrKs+6qRkuu1QORZGKw23vBuNzz7PgiDklFDWbSsp2lYY\nPRIm\r\n=WNSS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJSW8QpTqDCpiM8S2ubVAw94PB60FyRSBj32Mp1cYoVAiA2/6pq0f7hqn5snbsRkAT4F4dnZGVG06PYjKTBMldwNA=="}],"size":14202,"noattachment":false,"key":"/@hint/hint-no-disallowed-headers/-/@hint/hint-no-disallowed-headers-2.3.2.tgz"},"maintainers":[{"email":"antross@gmail.com","name":"antross"},{"email":"amolleda@gmail.com","name":"molant"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hint-no-disallowed-headers_2.3.2_1564515058022_0.7972723709998741"},"_hasShrinkwrap":false,"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":1564515058188,"_cnpm_publish_time":1564515058188,"dist-tags":{"latest":"3.1.22"}}