What are the recommended methods or approaches to check NodeJs application (hosted on Linux server) files integrity check for security check?

There are usually huge number of files in node_modules/, so what approach should be followed to perform the required security check?

closed as too broad by Xiong Chiamiov, David, Steffen Ullrich, Jeff Ferland Feb 11 '18 at 0:53

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What's your threat model here? Attacker gaining access to the server and modifying node module files? – Polynomial Feb 8 '18 at 17:17
  • Very good question, there could be two types of threats. (1) We used an insecure module/library, which could be any 'X' module from inside the node_modules/ folder. Which may infect or change any files. (2) Someone from inside the organization tries to change the specific files, in this case we are concerned with fewer file but not node_modules/ folder. – Muhammad Hannan Feb 8 '18 at 18:41
  • for #2 i like git status; simple. quick. reliable. #1 just needs vigilance. – dandavis Feb 9 '18 at 7:23
  • :) like your simple approach for #2 – Muhammad Hannan Feb 9 '18 at 8:05

What you're probably looking for is a Host Intrusion Detection System, or HIDS for short. These monitor the filesystem for changes and allow you to send alerts when something is modified, often either by email or by logging into a centralised system like Nagios.

The most common open-source HIDS I come across is OSSEC, and on the commercial side is Tripwire. There's also Verisys. As far as I know all three of these are cross-platform.

Not the answer you're looking for? Browse other questions tagged or ask your own question.