{"ava":{"failFast":false,"files":["dist/tests/**/*.js"],"timeout":"1m"},"dependencies":{"@hint/utils":"^3.1.2"},"description":"hint that that checks if disallowed response headers are sent","devDependencies":{"@hint/utils-tests-helpers":"^5.0.4","@types/node":"^12.6.9","@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.2.0","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.2.0"},"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.3","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-disallowed-headers@2.3.3","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"antross","email":"antross@gmail.com"},"dist":{"integrity":"sha512-lRHUqsRLoQTykOct+DXHR/riyAJGvmVYUydVQ7gH6b33xwhypRyEoZjAohmG3W2jAvhEGNePp/DsMy4anUvj8g==","shasum":"1ef74c94b965b3ed212fe394130314674ef54402","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-disallowed-headers/download/@hint/hint-no-disallowed-headers-2.3.3.tgz","fileCount":14,"unpackedSize":44356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSeYoCRA9TVsSAnZWagAAlXsP/AzXwRpjH6dVfGs7Qd2W\n86MBRaDstGQXjCOnFpVQey6BQ2LcGSyfshXdk+jqg5/At1eArdwaGVDQehCu\n5BboA2KY6kEyJj4cf/iq1cTCb5CR7ic/TXY6vEiN/8DHEBJR++2eDa8qiqef\nuUgOxaV7IQCD6L8eR73au9CVwuvPVF5+Eg4k5tofo65e2mnfE+aeWjZrjkev\nxO0iJdxpQ9Cp0Vmg/a8/iWNG9rMPWkhODRSZDhD4X/NH9cMxxF4nYspOFPt5\ncAdrLkRthZ9XSosU+3jxno/D/2lNBj0bXVOfYi6+4XDe+RX1GU9evI/Sz9tW\noUEoW+fwxZuBIsySTRsEtXxmmyU1O+JbCbLifxFXqvRILAFGQSq9k1dN3VYz\nubvbLR/w01A897BtjWIYSI2RM6X99Set8aXj0QiS48VidZGDWVWfPZ7YYkEq\nFZ9/QyLYnvua32V6P6Cev7jRe8NcEiXV/GtXOL1XFNBacbEP2xiWOIN6dWUB\nSMZJlqMWllw9R27gqHNOqiFdR/Ufkwk9C11WutPx2X+FhzOIahTzit3Kwm3K\n1AVjchzM3whmK1fumZQT9rGFkwrEj761wuef55Xem37ZlYDpflIb1CQam7mb\nYqlyO+Uxgk1xPmqM0AhXFAkld1/tKboCgWWXGAedjlYyW3Cx+Yq24USh70e1\nEJmc\r\n=9yVW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTlDiXaN4mWdiVnsIvXhxDkmvGGV0e6kfLEmtc5vU7SQIhAJvZFWHlH89iCiv1aBypblz9jv1CQ3WzOpjv5sOnqZ9A"}],"size":14263,"noattachment":false,"key":"/@hint/hint-no-disallowed-headers/-/@hint/hint-no-disallowed-headers-2.3.3.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.3_1565124136043_0.9910408085879829"},"_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":1565124136149,"_cnpm_publish_time":1565124136149,"dist-tags":{"latest":"3.1.22"}}