{ "name": "Information Security with HelmetJS", "order": 1, "time": "5 hours", "helpRoom": "HelpBackend", "challenges": [ { "id": "58af07504bbe015e85a91dbd", "title": "Introduction to Information Security with HelmetJS Challenges", "description": [ [ "", "", "HelmetJS is a type of middleware for Express-based applications that automatically sets HTTP headers to prevent sensitive information from unintentially being passed between the server and client. While HelmetJS does not account for all situations, it does include support for common ones like Content Security Policy, XSS Filtering, and HTTP Strict Transport Security, among others. HelmetJS can be installed on an Express project from npm, after which each layer of protection can be configured to best fit the project.

Working on these challenges will involve you writing your code on Glitch on our starter project. After completing each challenge you can copy your public glitch url (to the homepage of your app) into the challenge screen to test it! Optionally you may choose to write your project on another platform but it must be publicaly visible for our testing.
Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!", "" ] ], "releasedOn": "Feb 17, 2017", "challengeSeed": [], "tests": [], "type": "waypoint", "challengeType": 7, "isRequired": false, "translations": {} }, { "id": "587d8247367417b2b2512c36", "title": "Install and Require Helmet", "description": [ "As a reminder, this project is being built upon the following starter project on Glitch, or cloned from GitHub.", "Helmet helps you secure your Express apps by setting various HTTP headers. Install the package, then require it." ], "challengeSeed": [], "tests": [ { "text": "\"helmet\" dependency should be in package.json", "testString": "getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, 'helmet'); }, xhr => { throw new Error(xhr.responseText); })" } ], "solutions": [], "hints": [], "type": "backend", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {} }, { "id": "587d8247367417b2b2512c37", "title": "Hide Potentially Dangerous Information Using helmet.hidePoweredBy()", "description": [ "As a reminder, this project is being built upon the following starter project on Glitch, or cloned from GitHub.", "Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The helmet.hidePoweredBy() middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))" ], "challengeSeed": [], "tests": [ { "text": "helmet.hidePoweredBy() middleware should be mounted correctly", "testString": "getUserInput => $.get(getUserInput('url') + '/_api/app-info').then(data => { assert.include(data.appStack, 'hidePoweredBy'); assert.notEqual(data.headers['x-powered-by'], 'Express')}, xhr => { throw new Error(xhr.responseText); })" } ], "solutions": [], "hints": [], "type": "backend", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {} }, { "id": "587d8247367417b2b2512c38", "title": "Mitigate the Risk of Clickjacking with helmet.frameguard()", "description": [ "As a reminder, this project is being built upon the following starter project on Glitch, or cloned from GitHub.", "Your page could be put in a or