Giter VIP home page Giter VIP logo

mail-blocklist-monitor's Introduction

mail-blocklist-monitor

GitHub License pre-commit CircleCI codecov semantic-release

Monitor the reputation of your mail server IPs with ease.

Features

  • Monitor your server IP reputation on common block lists
  • Specify the IPs with AWS SES or env variable
  • Export findings to PagerDuty alerts and more
  • Easily extendable plugin architecture
  • Ready to use terraform modules for AWS

Usage

Terraform

# Create lambda resources
module "monitor" {
  source = "github.com/trustedshops-public/mail-blocklist-monitor//terraform/modules/lambda?ref=<version>"

  environment_variables = {
    LOG_LEVEL                          = "INFO"
    MAX_CLASSIFICATION                 = "yellow"
    EXPORTER_PAGERDUTY_ENABLED         = "true"
    EXPORTER_PAGERDUTY_INTEGRATION_KEY = local.pagerduty_integration_key
    # just pull ips from ses in the example
    IP_PROVIDER_SES_REGIONS            = "eu-central-1,eu-west-1"
  }

  create_cloudwatch_alarm = true
}

# Execute lambda every day
module "cron" {
  source               = "github.com/trustedshops-public/mail-blocklist-monitor//terraform/modules/cron?ref=<version>"
  lambda_arn           = module.monitor.lambda_arn
  lambda_function_name = module.monitor.lambda_function_name
}

See monitor/README.md for all configuration environment variables

Standalone

  1. Download the latest binary for your supported platform from GitHub releases
  2. Configure the monitor using environment variables (see monitor/README.md) for more details
    1. Make sure ENVIRONMENT is set to standalone
  3. Execute the binary with crontab, manually etc

Motivation

There are some paid tools out there or even some board resources for some providers. But none satisfied our needs so we built a small customizable solution to make monitoring easy and effortless. It integrates well with PagerDuty and requires no maintenance.

Components

This project consists of two parts:

  • monitor: Go application (to be run in AWS Lambda or standalone) with plugin architecture that checks again block lists, getting IPs from sources and exporting to targets (e. g. PagerDuty incidents).
  • terraform modules: Terraform modules to easily deploy the monitor using AWS Serverless ecosystem.

The monitor is built using a plugin architecture. So if you need additional sources, targets and exporters feel free to create a PR or fork to customize to match your demands.

Development

Prerequisites

Required Tools

Name Version
Go 1.20+
terraform 1.3+
pre-commit *

mail-blocklist-monitor's People

Contributors

janritter avatar renovate[bot] avatar semantic-release-bot avatar

Watchers

 avatar  avatar  avatar

mail-blocklist-monitor's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • semantic-release 5.1.1
  • go 1.9.0
  • codecov 3.3.0
  • aws-cli 4.1.3
  • terraform-utils 3.0.0
  • cimg/go 1.21
gomod
monitor/go.mod
  • go 1.21
  • github.com/PagerDuty/go-pagerduty v1.8.0
  • github.com/aws/aws-lambda-go v1.47.0
  • github.com/aws/aws-sdk-go-v2/config v1.27.18
  • github.com/aws/aws-sdk-go-v2/service/sesv2 v1.29.6
  • github.com/gammazero/workerpool v1.1.3
  • github.com/sirupsen/logrus v1.9.3
terraform/tests/go.mod
  • go 1.21
  • github.com/aws/aws-sdk-go-v2 v1.27.2
  • github.com/aws/aws-sdk-go-v2/config v1.27.18
  • github.com/aws/aws-sdk-go-v2/service/lambda v1.54.6
  • github.com/gruntwork-io/terratest v0.46.15
  • github.com/stretchr/testify v1.9.0
pre-commit
.pre-commit-config.yaml
  • pre-commit/pre-commit-hooks v4.6.0
  • antonbabenko/pre-commit-terraform v1.96.1
  • aquasecurity/tfsec v1.28.10
  • syntaqx/git-hooks v0.0.18
  • dnephin/pre-commit-golang v0.5.1
terraform
terraform/examples/full/main.tf
  • pagerduty 3.1.1
  • hashicorp/terraform >= 1.3
terraform/examples/minimal/main.tf
  • pagerduty 3.1.1
  • hashicorp/terraform >= 1.3
terraform/modules/cron/main.tf
  • aws ~> 5.0
  • hashicorp/terraform >= 1.3
terraform/modules/lambda/main.tf
  • archive ~> 2.0
  • aws ~> 5.0
  • null ~> 3.0
  • hashicorp/terraform >= 1.3
terraform/modules/pagerduty_integration/main.tf
  • pagerduty 3.1.1
  • hashicorp/terraform >= 1.3
terraform/tests/lambda-cron/main.tf
  • aws ~> 5.0
  • hashicorp/terraform >= 1.3
terraform/tests/pagerduty_integration/main.tf
  • pagerduty 3.1.1
  • hashicorp/terraform >= 1.3
terraform-version
.terraform-version
terraform/tests/.terraform-version

  • Check this box to trigger a request for Renovate to run again on this repository

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.