MSP Sentry Open Source repository. Integrate Sentinel One with ConnectWise (Or whatever you want)

Overview

MSPSentry-FOSS

Integrate Sentinel One with ConnectWise Manage.

Requirements

  • Docker
  • Node.js if you don't want to use a container (Not recommended)
  • Some other container runtime if you want to adapt to it

This has never been tested in Windows. Though, containers shouldn't care at all. I've always run them in Docker on GNU/Linux or Kubernetes. If you encounter some platform-related problem running this container in Windows, I won't have much up-front knowledge aside from, "Run it in a better host."

3rd Party Dependencies

I've created the Sentinel One and Logging libraries herein from scratch using native Node.Js components. There are no 3rd party web request libraries used for accessing the Sentinel One API. Connectwise-Rest uses the Axios request library.

Summary

Sentinel One incidents that don't require action are created with the default priority. Incidents that are unmitigated and unresolved are created with a high priority in ConnectWise Manage.

It will only check back to the beginning of the current month. If you have incidents dating back to before the start of the current month, MSP Sentry will not create tickets for them.

MSP Sentry updates the incidents in Sentinel One with the Ticket ID for every ticket made in ConnectWise Manage for that incident. If an incident has a ticket ID attached to it in Sentinel One, MSP Sentry will ignore it.

The hosted MSP Sentry service acted as a closed-loop service and closed/completed tickets in ConnectWise Manage once the corresponding incidents were resolved in Sentinel One. This does not do that because there is no database functionality here. If you're comfortable with Node.Js and MongoDb (or whatever you choose), then it shouldn't be much work to add that functionality. The functions for doing that are present and commented out in ./index.js. If you're comfortable with this language, it won't be too difficult to make that work. Reach out if you need help with that bit.

Usage

Node.Js

If you want to run the Node.Js portion directly on your machine, you'll need to install Node 12.18.1+. If you're good with that then you probably know how to handle the rest.

Docker

Clone this repository:

git clone https://github.com/twilcomgistix/MSPSentry-FOSS.git

Enter the cloned directory:

cd MSPSentry-FOSS

Have the following pieces of information handy:

  • Sentinel One API Token
  • Sentinel One FQDN Hostname (e.g. usea-vendor.sentinelone.com)
  • ConnectWise Manage Public Key
  • ConnectWise Manage Private Key
  • ConnectWise Client ID
  • ConectWise Manage Hostname (e.g. manage.domain.com)
  • ConectWise Company Id
  • ConnectWise Catchall Company Id
  • The name of the board where tickets should go
  • The status that tickets should have when created

Logging

The container is configured to log actions and failures into a file in /app/logs so use a docker volume to mount a folder location on your host so you can read those logs:

-v /var/logs/S1alerts:/app/logs

Build and Run

  1. Build the image:

    docker build -t mspsentry-foss:latest .

  2. Run the container:

    docker run --rm --env cwCompanyId="Your-Company-Id" --env apiToken="Sentinel-One-Api-Key" --env hostname="Sentinel-One-Hostname" --env wPubKey="CW-Public-Key" --env cwPrivKey="CW-Private-Key" --env cwClientId="Your-CW-Client-ID" --env cwHostname="CW-Hostname" --env cwCompanyId="CW-Company-Name" --env cwCatchAllId="CW-Catchall-Company-Id" --env cwHighPriorityId="CW-High-Priority-Id" --env cwBoardName="CW-Board-Name" --env cwNewStatus="CW-New-Status-Name" --network="host" -v /mnt/logs/alerts:/app/logs --name SentinelOne mspsentry-foss:latest

The above docker run command will spin up the container, inject your secrets as environment variables, then execute the code which will create tickets in ConnectWise Manage for incidents. When it's done, it will destroy the container leaving no trace except for the log entries.

You can optionally fill in your secrets in env.txt before you build the container image so they're hard-coded inside there. Your Sentinel One API Token will expire in 6 months so you'll have to replace that and rebuild the container. If you want to do that, you'll need to delete .env from the .dockerignore and rename env.txt to .env file before you build.

There is a function in the Sentinel One package that can be used to generate a new API token named getToken. Call it like this:

sentinelOne.getToken(process.env.apiToken).then(d => {
    results = JSON.parse(d);
    // This assumes you have some kind of encryption function to encrypt the token before storing it.
    var encryptedToken = encrypt(`${results.data.token}`);
    // This assumes you have a database function of some kind to store the token
    db.storeAPIKey(encryptedToken).catch(e=>{console.error(e);});
}).catch(e => {
    console.error(e);
});

If you know what you're doing with Node.Js, then this should be straightforward. If not, set the token in the --env argument on your Docker run command and be sure to update it once every 6 months.

I have not included any of the database or secrets encryption source code used by the MSP Sentry hosted service in this repository.

You might also like...

Marquee is a VS Code extension designed to naturally integrate with your development flow, so that you will no longer lose track of your thoughts while you're coding

Marquee Stay organized with minimal context switching, all inside your Visual Studio Code. Marquee is a VS Code extension designed to naturally integr

Dec 13, 2022

If you want to know more about your favorite TV show then you've come to the right place!

If you want to know more about your favorite TV show then you've come to the right place!

Ultimate Show Guide We want to introduce you this web page that will help you to manage all your favourite TV series from place. 🖥️ Desktop version H

Jun 23, 2022

SafeCycle—a tool that keeps cyclists safe. Gone are days of weaving through busy city streets, SafeCycle finds all the bike routes for you to ensure a smooth ride wherever you want to go.

Inspiration Biking—an everyday form of travel for students and professionals across the globe. On-campus, back home, and with the people that we know

May 2, 2022

Foot Locker is an online store specialized in selling shoes of all kinds, where you can find all the shoes you want

Foot Locker is an online store specialized in selling shoes of all kinds, where you can find all the shoes you want

Foot Locker Links 🖇 Heroku link Adobe XD link Description Foot Locker is an online store specialized in selling shoes of all kinds, where you can fin

Apr 16, 2022

📈 AI powered web scraper that let's you scrape anything you want from the web including google search results

AI powered web scraper that let's you scrape anything you want from the web including google web search results from your terminal. And at the same ti

Dec 27, 2022

This is a website for you to write what you want to do after or done befor and manage it.

This is a website for you to write what you want to do after or done befor and manage it.

Todo List Website This is a website for you to write what you want to do after or done befor and manage it. LogIn SignUp Main Abilities Able To Run Se

Dec 21, 2022

A cool tool that saves you time if you want to remove node_modules before running 'npm i'

rmnpm A cool tool that saves you time if you want to remove your node_modules folder before running the npm install command. How does it do it? By fir

Jul 16, 2022

The Basement SDK has sensible defaults and flexibility to allow you to get the data you want efficiently and effortlessly.

Basement SDK The Basement SDK has sensible defaults and flexibility to allow you to get the data you want efficiently and effortlessly. Installation B

Dec 6, 2022

Reference for How to Write an Open Source JavaScript Library - https://egghead.io/series/how-to-write-an-open-source-javascript-library

Reference for How to Write an Open Source JavaScript Library The purpose of this document is to serve as a reference for: How to Write an Open Source

Dec 24, 2022
Owner
Ted Williams
Full stack dev for Comgistix. Creator of MSP Sentry.
Ted Williams
This is a project for open source enthusiast who want to contribute to open source in this hacktoberfest 2022. 💻 🎯🚀

HACKTOBERFEST-2022-GDSC-IET-LUCKNOW Beginner-Hacktoberfest Need Your first pr for hacktoberfest 2k22 ? come on in About Participate in Hacktoberfest b

null 8 Oct 29, 2022
An utility library for Encoding and Compressing whatever you give him into a small string.

?? ORBIT ENCODER ⚙️ ??️ ORBIT-ENCODER is an utility library for Data Compression and Encoding. It can take whatever object you give him as argument an

Orbit Turner 7 Nov 16, 2022
Grayce Muthui 8 Jun 16, 2022
⚡️ A collection of open-source solution templates to integrate within Buildable Flows.

Buildable ⚡️ Buildable is an instant backend tool that makes a software developer’s day more delightful. We’re helping engineers breeze through featur

Buildable 161 Dec 15, 2022
This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service

This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service. Integrating your service allows you to take actions based on end-user expressions and send dynamic responses back to the end-user.

ddayto 10 Jul 21, 2022
Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Native Overleaf Overleaf is a fantastic webtool for writing and cooperating on LaTeX documents. However, would it not be even better if it were to beh

Floris-Jan Willemsen 40 Dec 18, 2022
Want to *contribute* to *open source*? Participate in **HacktoberFest 2022** *Beginner friendly* *First Timer*

# HacktoberFest 2022 (No Longer Participating in hacktoberfest) THIS REPO IS NO LONGER CONSIDERED IN HACKTOBERFEST. YOU CAN STILL USE THIS REPOSITORY

Jitender Singh Chhapola 5 Nov 12, 2022
Download all Moodle files with one click. This is a Chrome extension built to save time and effort from downloading files manually one by one!

Moodle Downloader Extension Moodle downloader extension for Chrome. The extension is tested with both the TUM moodle and the official moodle demo. Not

Zhongpin Wang 8 Nov 15, 2022
Want to preserve your loved one's voices for eternity? Narrate anything using the a voice imprint that can be made in as little as 10 minutes of audio samples. Easy as pie.

Want to preserve your loved one's voices for eternity? Narrate anything using the a voice imprint that can be made in as little as 10 minutes of audio samples. Easy as pie.

Ari 15 Nov 29, 2022