Git Product home page Git Product logo

file-integrity-monitoring's Introduction

File Integrity Monitoring

Overview

Node-M2M has a built-in file integrity monitoring (FIM) feature.

When enabled, your main application and system files from all of your remote devices and clients will be monitored by Node-M2M in real-time for any unauthorized changes.

There are two methods you can take advantage of this feature.

1. Let Node-M2M manage the file monitoring for you.

2. Manage the file monitoring yourself that will provide you more flexibility.


Node-M2M Managed File Monitoring


1. Set the file or directory you want to monitor for changes.

You can monitor any files from any of your clients and devices.

const m2m = require('m2m');

let device = new m2m.Device(100);

device.connect(() => {

  // set the file you want to monitor
  // monitor 'myFile.txt' file for unauthorized changes
  device.monFile('myFile.txt', (result) => console.log(result));

});

Start your application.

$ node device.js

2. Login to Node-M2M website and enable FIM


FIM Test

Before you enable FIM, you can test it first.

You can enable FIM temporarily for test only for each clients or devices available on your account.

  1. Select the client or device where the file will be monitored from the main window when you login.
  2. Click the access client/device button or the client/device Id. You will need to enter your security code.
  3. You will now be directed to the selected client or device window.
  4. Click Enable FIM from the Manage Application section. Select email alert and active response as well to test if they are working.
  5. Now, try editing or make changes to the file you are monitoring from one of your remote client or device. In this example make a change on 'myFile.txt' file from device 100.

You should see an alert message from the Manage Application section on your browser in real-time. You should also receive an email alert from your account email. All these indicate that FIM is working.

If you have enabled active response, your remote client or device will be disabled also for any unauthorized changes on the file. Once disabled, it will be inaccessible from any controlling clients or devices. Login to your account to re-enable it.


Enable FIM

Finally to enable FIM, just navigate to the Manage Security section from the main window and select enable FIM.

When FIM is enabled, it will also monitor the main application and system files automatically in all your clients and devices in addition to the selected files you want to monitor from a specific client or device.

Disable FIM

At anytime, you can disable FIM by selecting disable FIM from the Manage Security section of the main window.


Self-Managed File Monitoring


In this example, we will monitor a file in the remote device using a client application.

You do not need to enable FIM from the browser interface for self-managed file monitoring.

However as additional protection, you can enable it to make your system more resilient from any malicious attacks.


Device setup

1. Set the file or directory you want to monitor for changes.

Save the code below as device.js.

const m2m = require('m2m');

let server = new m2m.Device(100);

server.connect(() => {

  device.setData('monitor-file', (data) => {
    // set the file you want to monitor
    // monitor 'myFile.txt' for unauthorized changes
    let v = device.monFileSync('myFile.txt');
    data.send(v);
  });

});

Start your device application.

$ node device.js

Client setup

1. Watch the data from the remote device.

Save the code below as client.js.

const m2m = require('m2m');

let client = new m2m.Client();

client.connect(() => {

  // use the regular .watchData() method from channel api.
  client.watchData({id:100, channel:'monitor-file'}, (data) => {
    console.log('monitor-file', data); // 1654331542210 myFile.txt
    // add here any custom actions you want to perform
  });

});

Start your client application.

$ node client.js

Everytime someone attempts to change the file 'myFile.txt' from the remote device, the client will receive an alert in real-time.

file-integrity-monitoring's People

Contributors

edalegrid avatar

Watchers

 avatar

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.