Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Security middleware implementation #2909

Merged
merged 7 commits into from
Apr 20, 2018

Conversation

spartDev
Copy link
Contributor

@spartDev spartDev commented Apr 18, 2018

Status

  • WIP
  • Ready for review
  • Needs testing

Deploy after merge (delete what needn't be deployed)

  • api
  • hyperion (frontend)
  • pluto

Release notes for users (delete if codebase-only change)

  • Create security middleware for different node servers to improve security.

  • use of Helmet with some configurations:

    • we don' want to expose any software information to hackers.
     server.disable('x-powered-by');
    • Sets the X-XSS-Protection header to prevent reflected XSS attacks. more info
    • Mitigates clickjacking attacks by setting the X-Frame-Options header. more info
    • Sets the X-Download-Options to prevent Internet Explorer from executing downloads in your site’s context. more info
    • Don’t Sniff Mimetype middleware, noSniff, helps prevent browsers from trying yo guess (“sniff”) the MIME type, which can have security implications. more info
  • use of Hpp express middleware to protect against HTTP Parameter Pollution attacks

Finally, I prefer to separate things and implement the CSP (Content Security Policy) rules in a future PR

close: #2775

Copy link
Contributor

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good to me so far, I'll deploy it to alpha.spectrum.chat and see how well it works!

Notes:

  • pluto doesn't need this, only the api and hyperion

@spartDev
Copy link
Contributor Author

I was not sure about pluto.
I made the change

@mxstbr
Copy link
Contributor

mxstbr commented Apr 20, 2018

I'm deploying this to alpha.spectrum.chat!

Copy link
Contributor

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly, cannot find any bugs! Thanks so much for digging into this, shipping!

@mxstbr mxstbr merged commit 30ed05d into withspectrum:alpha Apr 20, 2018
@spartDev spartDev deleted the securityMiddleware branch April 20, 2018 10:10
@spartDev
Copy link
Contributor Author

👍

@brianlovin
Copy link
Contributor

Awesome stuff here @spartDev :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use helmet to protect our Node servers
3 participants