Giter VIP home page Giter VIP logo

Comments (41)

yonjah avatar yonjah commented on May 5, 2024 2

Maybe we can create a branch and work on it together.

I can think of a few topics that are security related (other than the one mention in issue #51)

  • Validating and sanitizing all inputs (POST/GET/HEADER/COOKIES)
  • Setting secure headers
  • OWASP TOP 10 (INJECTION/CSRF/XSS maybe each need a different topic)
  • Using ssl
  • Securing cookies (httpOnly/secure)
  • Rate limiting
  • Authorizing (Use 3rd party auth, Credentials Storing and hashing)
  • Keeping system up to date
  • Use a firewall and only open specific ports
  • Crypto best practice

There are probably a few more but that's just from the top of my head.

from nodebestpractices.

lirantal avatar lirantal commented on May 5, 2024 2

@BrunoScheufler I'll begin pushing a PR soon with some changes and we can collaborate on it then with the relevant context, it should be easier.

@i0natan don't worry, there is going to be enough content :-)
the server fingerprinting advice for express is really generic and common sense. It's one of these things that is obvious and you would like to cover more important items instead of it.

Let's do this - I will add items on top of what we have today without making any changes, and then we can review what to group and how.

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024 1

Oh and if somebody is already working on it we could share some ideas here

from nodebestpractices.

j-f1 avatar j-f1 commented on May 5, 2024 1

How about a stern warning about new Buffer(...)?

from nodebestpractices.

pritammobisoft avatar pritammobisoft commented on May 5, 2024 1

Hi Guys, Here is one suggestion for NPM package: helmet. Helps with many topics which come up in tool based security reviews.

from nodebestpractices.

pritammobisoft avatar pritammobisoft commented on May 5, 2024 1

Also here is one blog post which goes into details on some topics listed by @yonjah. Hope this helps a bit in your research.

from nodebestpractices.

oshalygin avatar oshalygin commented on May 5, 2024 1

I have some suggestions, I'll probably have to find articles or write my own on SSL and crypto. Let me know if anyone already started.

Not a fan of helmet but I can cover why :)

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024 1

Just cover the things you want to πŸ‘ Also it would be good to mark what each one of us is working on and don't switch topics on the fly so we don't work on the same topic!

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024 1

@BrunoScheufler let's do both.

Let's share the current branch link (direct link to the security items) in few FB/reddit groups + Twitter?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

I've added a security guideline for comparing objects timing-safe using default Node.js functions

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@BrunoScheufler what ideas we have for other security bullets? can we fill a section of ~7-10 items? have friends with a security-related startup, maybe join forces and ask them to write come or consult?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan that would be awesome! I thought of maybe adding guidelines to prevent access tokens or db passwords to be pushed to the internet but rather using tools like dotenv. They can join and help out of course!

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

So although this is important, constructing Buffer objects is explicitly marked as deprecated in the Node.js docs for some time now. I am not entirely sure whether we would need this as a best practice, @i0natan what would you say?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

I also thought of maybe adding a description and possible solutions against directory/path traversal attacks for node web servers. Although this is against 5.11, so I'd like your opinions on this @i0natan @idori @refack before I start preparing the detailed section.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@BrunoScheufler take the lead on that list.

Time-wise we won't publish it the next 3 weeks as we just uploaded a mass content and should focus on improving it. Take your time to gather at least 7-10 items from multiple sources (blogs, youtuve, NPM packages) and once we're ready with a comprehensive list - let's push forward toward publication.

Makse sense?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan totally, also takes out some pressure πŸ‘ . I'll wait and look for good items internal (so in this repository through issues and other community interaction) and external by looking at some common risks

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

Yeah we could totally do this! I'll create a branch for us to work on and push to, later when I've got time!

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@yonjah I've also thought about these. So for the crypto best practices I've already prepared a section about timing safe equality comparison using the crypto core module. We could share the other ones and work on them together!

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

So I've created a branch for the initial security best practices. This will be merged and deleted later on when the most important content is integrated into the section. All security section updates via pull requests should be made into this branch.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@BrunoScheufler we shall publish improvements milestones soon with a timeline, 'security' seems beefy enough to be released soon

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan a timeline with milestones would be good, the question would be which points we could do in a timely manner, when do you plan on releasing the security section?

from nodebestpractices.

snypelife avatar snypelife commented on May 5, 2024

Perhaps some info on implementing a content security policy?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@snypelife that would be a good addition to the XSS prevention guideline for the top OWASP attacks!

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

I'll start off with the crypto best practices for now. Is anyone else already working on a point? Just for organizing this milestone.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

You may consider few items from this list as well:
https://blog.risingstack.com/node-js-security-checklist/

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan that's a really good resource! Some points mentioned in the post are already listed above, but we can try to add the other ones too.

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

βœ”οΈ Security-related headers are added to the security section

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

βœ”οΈ Best practice for using HTTPS with Node.js is added too

from nodebestpractices.

lirantal avatar lirantal commented on May 5, 2024

@BrunoScheufler about the content, I would like to make the following changes, let me know what you think:

  • Modify 6.12. Avoid eval statements with unsanitized inputs to avoiding eval statements with user input, or avoid all eval function invocations with any variable altogether.
  • Remove 6.6. Hide 'X-Powered-By=Express/Koa/etc' headers and push it to the generic 6.14. Using common methods to secure your application section

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@lirantal 6.12 - absolutely makes sense

6.6 - I just afraid that if we push any minor/cross-platform advice under the generic bullet will end up with very few tips. So I thought that (A) any advice that has Node interpretation (e.g. X-Powered-By=Express) where we can provide some insights how it should be implemented in Node -
should get its own bullet and (B) any advice that has no Node interpretation (e.g. use VPN) should be located in the generic bullet

These are just my thoughts, we can adjust this

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@lirantal I'd also agree to rephrase it to avoiding eval in general

We'd all have to agree which points we classify as generic advice and which we use as Node.js-specific points

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@lirantal awesome, I'm on a trip right now, will look into it occasionally though!

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@lirantal sounds great

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@lirantal @BrunoScheufler what do you think about sharing the current draft with the community (not a mass campaign, just share in few forums) to solicit feedback and ideas for other bullets?

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan We could at least create some links to the upcoming changes (for example link to the security-best-practices branch in the ToC) for users to get an impression of the new section. Would be the question whether we share the section on social media and places alike.

from nodebestpractices.

lirantal avatar lirantal commented on May 5, 2024

I'm good with a fast feedback loop πŸ‘
Adding more 'inner content' for the rest of the bullets would be a great enhancement.

from nodebestpractices.

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

@i0natan sounds good! This way we can pull in feedback from other readers and maybe excite new people about the project!

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@lirantal @BrunoScheufler to differentiate ourself from few security practices lists on the web, would be great to add 2-3 bullets more. Currently, our list contain ~2-3 items that don't exist in common list. Any ideas? scan base docker images? replace bcrypt with argoni (see link)? install NPM without sudo?

from nodebestpractices.

lirantal avatar lirantal commented on May 5, 2024

I'm not sure about those options as they are very generic and I think we already have variation of the sudo thing on the list already.

Hopefully will come up with some more soon.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@lirantal @BrunoScheufler see here:
https://www.reddit.com/r/node/comments/7xrpj8/20_node_security_best_practices_draft/

I would embrace the idea about error handling

from nodebestpractices.

lirantal avatar lirantal commented on May 5, 2024

Yep, saw it and that's indeed a good advice, but it again falls on the border of being true for every language and platform, not unique to Node.js. Maybe we can tie it up to express generic error handler and this way to connect it to the story.

from nodebestpractices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.