GithubHelp home page GithubHelp logo

neztore / tls-rpt-monitor Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 48 KB

Stupid. Simple. TLS Report monitoring. Intended to be used with MTA-STS or DANE, for simplified reporting.

License: MIT License

JavaScript 67.93% HTML 31.03% Dockerfile 1.04%
mta-sts rfc8460 tls-rpt

tls-rpt-monitor's Introduction

tls-rpt-monitor

Simple. Stupid. TLS Report monitoring.

Find out when something goes wrong. Don't find out when it doesn't. Simple.

This tool listens for TLS RPT reports over HTTPS POST, and if it receives one indicating an error, sends an email to the configured email address.

I created it because who has time to waste reading reports every day?

RFC8460.

Installation

  1. Clone or download this repository
  2. Navigate into the folder and npm install
  3. Configure environment variables as below
  4. npm start (using your preferred process manager...)

Environment Variables (& Configuration)

Env variables (All required)

Variable Type Notes
from_address String From address to use when sending alerts. May be ignored by your provider. Can be specified as "Sender name" <[email protected]> too.
smtp_host String SMTP server hostname to use to send emails. Will connect on 587.
smtp_password String SMTP Password to use for auth
smtp_username String SMTP username to use for auth

Confg.json

Most of these values have defaults that can be left. Recipients must be populated, or alerts won't be sent.

Variable Type Notes
emailCooldown Number Basic cooldown to prevent spam. Will not send an alert if it has been less than emailCooldown seconds since the last one.
ignoredSenders Array Senders to ignore. Matched against report organisation name
recipients Object Recipient mappings. More information below.

Setting up recipients

The recipients object must be key-value pairs of domain: receivers. Receivers can be either a single string (email address), an array of email addresses, or a comma seperated list of email addresses which will get alerts for that domain. A catch-all can also be specified, using otherwise as the key. All alerts without a domain entry will be sent to those receivers.

To have all emails sent to a given email address, use the below:

{
  "recipients": {
    "otherwise": "[email protected]"
  }
}

tls-rpt-monitor's People

Contributors

dependabot[bot] avatar neztore avatar pl4nty avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tls-rpt-monitor's Issues

Does it store the messages in json format?

Hi,

I am yet to implement the docker and wondering since its a POST message. Does it even store the messages as well? So that I can parse it later on and see those counts?

todo: Add direct https support

The project is intended to be used behind a reverse proxy, but for flexibility I'd like to add support to use https certificates directly too. This is reasonably straightforward.

SyntaxError: Unexpected reserved word: "await"

tdmarchetta@yellowfish:~/docker/tls-rpt-monitor/tls-rpt-monitor$ npm start

> [email protected] start
> node index.mjs

file:///home/tdmarchetta/docker/tls-rpt-monitor/tls-rpt-monitor/config.mjs:6
  const contents = await readFile(filePath, {encoding: 'utf8'});
                   ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

I do apologize if this is an easy solution. I am just not able to figure this out. I do appreciate any assistance.

Configuration Example.

I'm at a complete loss of how this configuration file is supposed to look. This is what I've been able to put together so far. Please let me know if this looks correct.

{
  "from_admin": "[email protected]",
  "smtp_host": "smtp.domain.com",
  "smtp_username": "username",
  "smtp_password": "passord",
  "recipients": [
    "[email protected]"
  ],
  "ignoredSenders": [],
  "emailCooldown": 60
}

Todo: Add engine statements to specify minimum node version

  • A few issues related to using old node versions.
  • Specify Engine in package.json. Not actually sure what the minimum is (likely depends on dependencies & version for const/async await) - but will likely put whatever the oldest LTS is these days, since none of the code in here is using cutting edge features.

Reporting server

Does that mean it starts web server on port 80 or port 443 and accepts a request?

I am not able to install

Since I am not pro in npm; I tried installing using the method given however getting below error

oot@mta-sts-testing-reporting:/opt/tls-rpt-monitor# npm install

up to date, audited 62 packages in 804ms

8 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
root@mta-sts-testing-reporting:/opt/tls-rpt-monitor# npm start

[email protected] start
node index.mjs

file:///opt/tls-rpt-monitor/config.mjs:6
const contents = await readFile(filePath, {encoding: 'utf8'});
^^^^^

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
root@mta-sts-testing-reporting:/opt/tls-rpt-monitor# npm fund
[email protected]
├── https://github.com/sponsors/ljharb
│ └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
└── https://github.com/sponsors/feross
└── [email protected]

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.