{"ava":{"failFast":false,"files":["dist/tests/**/*.js","!dist/tests/**/fixtures/**/*.js"],"timeout":"1m"},"dependencies":{"@hint/utils-debug":"^1.0.1","@hint/utils-i18n":"^1.0.1","@hint/utils-network":"^1.0.2","@hint/utils-string":"^1.0.1","@hint/utils-types":"^1.0.1"},"description":"hint that that checks if disallowed response headers are sent","devDependencies":{"@hint/utils-create-server":"^3.4.2","@hint/utils-tests-helpers":"^6.1.0","@types/node":"^12.12.14","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.12.0","ava":"^3.4.0","cpx":"^1.5.0","eslint":"^6.8.0","eslint-plugin-import":"^2.18.2","eslint-plugin-markdown":"^1.0.2","npm-run-all":"^4.1.5","nyc":"^15.0.0","rimraf":"^3.0.2","typescript":"^3.8.3"},"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":"^6.0.0"},"repository":{"directory":"packages/hint-no-disallowed-headers","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,.md,.ts --ignore-path ../../.eslintignore","lint:dependencies":"node ../../scripts/lint-dependencies.js","lint:md":"node ../../scripts/lint-markdown.js","test":"npm run i18n && npm run lint && npm run build && npm run test-only","test-only":"nyc ava","test-release":"npm run i18n && 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.4.2","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-disallowed-headers@2.4.2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-E5W+X7pIUwSkUx+52Crm0fO+oEgbbM/a5C93ftv9jSIUJImBPGBm+bjWUtRmphozWgMXL+mJ+Q7HcOa5dHaSyg==","shasum":"c72c3ee75d853b39608237e1e7c4dea349670bb8","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-disallowed-headers/download/@hint/hint-no-disallowed-headers-2.4.2.tgz","fileCount":14,"unpackedSize":52545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpkMCRA9TVsSAnZWagAAbEMP+weR2zzdmgWxHhSyg2u6\nyG14bfsB9rieoO9+tUlJFeroGqu/C93FUlYUe2uqD+9rn7NKOTo/xEyfgqP3\nJ5OIr8AGl/wBgpNM4QkbfBQeeeGmQtQUywiJ3M3WE674KS8HOTJol97AmDEF\nRqV4dMfIr0ePBad5YPyG6igRd+b5tBeaLVty/fT8M9CohXZX66UE/02ETWk9\nNVMBDCKUj9i1rnpKn73idbOUbDLUnraXLa+dvIQujPD+V+MS3Lk0eewXDKNW\nMt4gjLsjx4Jal9tmz5XryuY343G9TTxR2wfw9l5XhoQV9duYuEd4t88VapOM\nEaK4DJLEHYjgylyz+4kON9AP1Ip/YZYgbGnukJcJ0fPOCi832lud+HVjI1ju\nvC8thHEwHO3c8VOu3J9rAI8kHwDJ/tPxpzyFh3vaT8i87eytCBvOadgS/xUN\nOZxdtd4LzFFFD3R/rTgjoMrZ/xhxoXibufwFHFnx1Otlp5wbPYwTBZ11Vjny\nnGAO0U2c4rDBHbQ5FFomTzFOX+JInz5ig4zqpUchYS3978WlD0uhfj0VA5Sh\nl78R/OgcAuCDyK4eLVc95AdhxgpuNGHdjdvx/BvS1a9/6zRkkdIn7Vn+XZUW\niWAo4L7HtUdCo9i5KpHH5T+36jRjIEWuPfGceBjVizgkAucaVYwSTL40MIPn\nsj/0\r\n=RcYV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGfN+PidY8gQvQsZxBjy07t7qmwSblaoT21VYtZSaAYrAiAeB0mQ5DTUGX/XpftuS25hZp5j9ND5fDzvr4cpe3zjgw=="}],"size":16224,"noattachment":false,"key":"/@hint/hint-no-disallowed-headers/-/@hint/hint-no-disallowed-headers-2.4.2.tgz"},"maintainers":[{"email":"antross@gmail.com","name":"antross"},{"email":"amolleda@gmail.com","name":"molant"}],"_npmUser":{"name":"antross","email":"antross@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hint-no-disallowed-headers_2.4.2_1584568588367_0.8751352304114348"},"_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":1584568588508,"_cnpm_publish_time":1584568588508,"dist-tags":{"latest":"3.1.22"}}