Recall & Review
beginner
What is Helmet in Express?
Helmet is a middleware for Express that helps secure your app by setting various HTTP headers to protect against common web vulnerabilities.
Click to reveal answer
intermediate
Name two HTTP headers that Helmet sets to improve security.
Helmet sets headers like Content-Security-Policy (CSP) to control resources the browser can load, and X-Frame-Options to prevent clickjacking attacks.
Click to reveal answer
beginner
How do you add Helmet to an Express app?
You install Helmet with npm, then require it and use it as middleware: <br><code>const helmet = require('helmet');<br>app.use(helmet());</code>Click to reveal answer
beginner
True or False: Helmet automatically fixes all security issues in your Express app.
False. Helmet helps by setting security headers but you still need to write secure code and handle other security aspects.
Click to reveal answer
intermediate
What does the Content-Security-Policy header do when set by Helmet?
It tells the browser which sources of content (like scripts, images) are allowed to load, helping prevent cross-site scripting (XSS) attacks.
Click to reveal answer
What is the main purpose of Helmet in an Express app?
✗ Incorrect
Helmet's main role is to set security-related HTTP headers to protect your app.
Which of these headers is NOT set by Helmet by default?
✗ Incorrect
Helmet disables the X-Powered-By header to hide Express usage, it does not set it.
How do you apply Helmet middleware in an Express app?
✗ Incorrect
You use Helmet by calling app.use(helmet()) after requiring it.
Which security risk does Content-Security-Policy help prevent?
✗ Incorrect
CSP restricts sources of executable scripts, reducing XSS risks.
True or False: Helmet replaces the need for other security practices in your app.
✗ Incorrect
Helmet helps but does not replace secure coding and other security measures.
Explain how Helmet improves security in an Express app and name at least two headers it sets.
Think about what headers control in the browser.
You got /4 concepts.
Describe the steps to add Helmet to a new Express project and why it is important.
Focus on setup and purpose.
You got /5 concepts.