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?

  • 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.

| improve this answer | |

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