Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using 'helmet' npm package in node server #22

Closed
Martinsos opened this issue Jul 27, 2020 · 8 comments · Fixed by #239
Closed

Consider using 'helmet' npm package in node server #22

Martinsos opened this issue Jul 27, 2020 · 8 comments · Fixed by #239
Labels
enhancement New feature or request good first issue Good for newcomers no-haskell Coding task that does not need Haskell knowledge

Comments

@Martinsos
Copy link
Member

https://www.npmjs.com/package/helmet -> sets some reasonable default HTTPS response headers.

@Martinsos
Copy link
Member Author

Martinsos commented Oct 20, 2020

Draft:

  1. Add helmet to the list of npm dependencies in waspc/src/Generator/ServerGenerator.hs.
  2. Add helmet as top-lvl Express middleware (via app.use) in waspc/data/Generator/templates/server/src/app.js, and configure it if needed.

This might be enough! Although I don't know enough about helmet to know for sure at the moment.

@Martinsos Martinsos added the no-haskell Coding task that does not need Haskell knowledge label Mar 11, 2021
@caz-gh
Copy link
Contributor

caz-gh commented Mar 26, 2021

Hi, is this still needed? If so, then would the default configuration options be good enough for now?

@Martinsos
Copy link
Member Author

Hey @caz-gh , yes, this is still on!
Well, the idea was just to make the app more secure, and it seemed like using helmet might be a good step in that direction. That said, I never used helmet nor have I explored its options, so I am not sure what is the right config -> default will probably work!
What is your experience with helmet? Ideally, whoever implements this issue, would explore the options to some extent, to make sure they are making sense + to understand the effects of it.
Let me know if you want to work on this and I will help you out with Wasp/Haskell stuff if needed!

@caz-gh
Copy link
Contributor

caz-gh commented Apr 6, 2021

@Martinsos, here are the HTTP header behaviors set when using the default helmet top-level wrapper (app.use(helmet())) containing all helmet's middleware:

I don't have much experience with using anything other than the default helmet settings, but I can definitely look into this further! So far, I've added helmet to my fork of Wasp and the defaults seem to be working when I look at the response headers I get with a newly created Wasp app.

@Martinsos
Copy link
Member Author

Martinsos commented Apr 6, 2021

@caz-gh sounds good, and thanks for putting in the work! Please go for it and make a pull request -> if you get stuck or just slowed down at any point at all, let me know and I will help out.

@Martinsos
Copy link
Member Author

Hey @caz-gh , how is it going, are you still interested in taking care of this one?

@caz-gh
Copy link
Contributor

caz-gh commented May 12, 2021

Hi @Martinsos , sorry I was a little busy recently but I'll be making the pull request in a bit!

@Martinsos
Copy link
Member Author

No prob, just checking in, looking forward to it :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers no-haskell Coding task that does not need Haskell knowledge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants