OpenCanary


Spent some time setting up OpenCanary https://github.com/thinkst/opencanary and was impressed with how easy it was to set up.

I wanted to add pushover notification support, and luckily someone shared their setup https://jasonmurray.org/posts/2022/install-tcanary-ubuntu/

For preservation purposes, I’m copying the entire loggerconfig section that worked for me:

"logger": {
    "class": "PyLogger",
    "kwargs": {
        "formatters": {
            "plain": {
                "format": "%(message)s"
            },
            "syslog_rfc": {
                "format": "opencanaryd[%(process)-5s:%(thread)d]: %(name)s %(levelname)-5s %(message)s"
            }
        },
        "handlers": {
            "console": {
                "class": "logging.StreamHandler",
                "stream": "ext://sys.stdout"
            },
            "file": {
                "class": "logging.FileHandler",
                "filename": "/var/tmp/opencanary.log"
            }
            "webhook": {
                "class": "opencanary.logger.WebhookHandler",
                "url": "https://api.pushover.net/1/messages.json",
                "method": "POST",
                "data": {
                  "message": "%(message)s",
                  "retry": "30",
                  "expire": "60",
                  "priority": "2",
                  "token": "TokenGoesHere",
                  "user": "PushoverUserGoesHere"
                  },
                "status_code": 200,
                "ignore": ["\"dst_port\": -1"]
            }
        }
    }
},

Leave a Reply

Your email address will not be published. Required fields are marked *