Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to troubleshoot "direct" email alerts? #25

Closed
7MinSec opened this issue Nov 19, 2016 · 3 comments
Closed

How to troubleshoot "direct" email alerts? #25

7MinSec opened this issue Nov 19, 2016 · 3 comments

Comments

@7MinSec
Copy link

7MinSec commented Nov 19, 2016

Hi there,

I've got my canary up and running and used the readthedocs PDF to setup authenticated email alerts similar to your example:

[..] # Services configuration
"logger": {
"class" : "PyLogger",
"kwargs" : {
"handlers": {
"SMTP": {
"class": "logging.handlers.SMTPHandler",
"mailhost": ["authenticated.mail.server", 25],
"fromaddr": "canary@yourdomain.com",
"toaddrs" : ["youraddress@yourdomain.com"],
"subject" : "OpenCanary Alert",
"credentials" : ["myusername", "password1"]
}
}
}
}

At this point, should connection attempts that get logged in /var/tmp/opencanary.log send alerts to me? The FTP/telnet/etc. attempts are definitely getting logged, but I wasn't understanding if I also needed Correlator to actually send the alerts, or if the alerts should be sending "direct" now?

Thanks,
Brian

@thinkst
Copy link
Collaborator

thinkst commented Nov 21, 2016

Hi Brian,

You've got it right: the OC daemon isn't intended to send the emails (or even alerts) directly. It logs events to the Correlator which condenses multiple events into an single alert that it can send off. The default OC config file includes a directive log to the Correlator, which will be able to send off an email.

https://github.com/thinkst/opencanary/blob/master/opencanary/data/settings.json#L57

@7MinSec
Copy link
Author

7MinSec commented Nov 22, 2016

Ok thanks much, I can make email alerts work pretty well with inotify-tools so I think I'm good to go, just wanted to check on the "right" way to do this. Have a great day.

@thinkst thinkst closed this as completed Feb 15, 2017
@kjacobsen
Copy link
Contributor

kjacobsen commented Mar 5, 2017

Hi,

Just looking at OpenCanary, sorry to comment on a closed issue, but email alerts do seem to work from the OC daemon as @braimee was attempting to do.

"SMTP": {
                    "class": "logging.handlers.SMTPHandler",
                    "mailhost": ["smtp.sendgrid.net", 25],
                    "fromaddr": "from@myemail.com",
                    "toaddrs" : ["myemail@myemail.com"],
                    "subject" : "OpenCanary Alert",
                    "credentials" : ["username","password"]
               }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants