Skip to content

mia-platform/Sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentinel Agent

Logo

Introduction

What is Sentinel?

Sentinel is a project that aims to provide a simple and easy-to-use tool for monitoring the status of your servers and processes. It is designed to be used with the integration-connector-agent.

How does it work?

Configuration

The configuration is done through environment variables and a configuration file. The configuration file is a JSON file that contains the configuration for the services that you want to monitor and some other settings.

Configuration file

Here is an example of a configuration file:

{
  "output": [
    {
      "type": "stdout",         // 3 type of output: stdout, file, webhook
      "file": {                 // ONLY if type is file
        "path": "./eventsFile/file.log"
      },
      {                         // ONLY if type is webhook - NOT IMPLEMENTED
        "url": "http://localhost:8080/webhook",
        "authentication": {
          // ...
        } 
      }
    },
  ],
  "monitor": {
    "interval": 30,
    "filters": {                // Optional 
      "whitelist": [
        "go"                    // filter only this processes 
      ],
      "users": [
        "<process_username>"    // filter only processes with this username
      ],
      "blacklist": [            // remove this processes from the list
        "system"
      ]
    }
  },
  "server": {
    "port": 8080                // Port for the server - NOT IMPLEMENTED
  },
  "advanced": {
    "debug": true,              // Enable debug mode - NOT IMPLEMENTED
    "omitScanning": [           // Omit output fields - NOT IMPLEMENTED
      "process.command",
      "process.user"
    ]
  }
}

Filters

Actually only this pairs of filters are supported:

  • NONE
  • whitelist
  • blacklist
  • users
  • whitelist + users
  • blacklist + users

NB: whitelist and blacklist are mutually exclusive

Environment variables

CONFIGURATION_PATH=<path_to_configuration_file>
LOG_LEVEL=<log_level> # Default: info
HTTP_PORT=<port> # Default: 8080
HTTP_ADDRESS=<address> # Default: 0.0.0.0

Local Development

To develop the service locally you need:

Go 1.23+ To start the application locally

  1. Export the environment variables
export CONFIGURATION_PATH=<path_to_configuration_file>

i.e. you can use one of the example configuration files in the /example folder

  1. Run the service
go run ./cmd/agent/main.go

By default the service will run on port 8080

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages