if a company uses generic names like "apple" or "teams" for their brands, any confusion is on them. maybe something more specific like "ms-teams" should be used.
I've copied a project that basically sends a message to telegram with informations when someone connects on a linux server.
But this time it's for MS Teams channels, which is possible through Webhooks.
I thought that might be interesting for other persons so I share :) It can probably be adapted to any other webhooks, as soon as webhook urls accepts the JSON sent.
I think, going off the auth log is better, or just logs in general. Build one script that matches regex patterns and sends alerts and you can monitor for a lot more than just logins.
This script is so nice because it's so simple: it follows the journalctl output of sshd.service and then sends a push notification to me through Gotify's CLI when journalctl's output matches what I set $grep_regex_pattern to (I just need to remember to setup gotify when I setup my server). The best part is that it's so easy to modify this script for ANY systemd service that is using journalctl.
I alert on all successful and failed attempts, because in my home lab, I should be the only one logging in -- so I don't really get notifications unless I'm working on something. It's helped me a few times when I've accidentally left port 22 exposed to the world on some VPS' -- reminding me to add firewall rules to reduce access.
EDIT: clarified that sshd-montior sends alerts when matching regex pattern
May want to add a proxy config to pass proxy information to the curl command. I would expect that some of the more important servers to get alerted about are those NOT able to access the internet directly.
I understood just as incorrectly as you :), but finally got what it does from others' comments. Clearly some editorial work could be used to disambiguate the title...
blueflow|2 years ago
Ajunne|2 years ago
> ssh host -t "bash --noprofile"
e12e|2 years ago
https://askubuntu.com/questions/179889/how-do-i-set-up-an-em...
zokier|2 years ago
pimlottc|2 years ago
taskforcegemini|2 years ago
Mooty|2 years ago
But this time it's for MS Teams channels, which is possible through Webhooks.
I thought that might be interesting for other persons so I share :) It can probably be adapted to any other webhooks, as soon as webhook urls accepts the JSON sent.
calvinmorrison|2 years ago
heywoodlh|2 years ago
https://github.com/heywoodlh/nixos-configs/blob/d5b0ffbcc4cb...
This script is so nice because it's so simple: it follows the journalctl output of sshd.service and then sends a push notification to me through Gotify's CLI when journalctl's output matches what I set $grep_regex_pattern to (I just need to remember to setup gotify when I setup my server). The best part is that it's so easy to modify this script for ANY systemd service that is using journalctl.
I alert on all successful and failed attempts, because in my home lab, I should be the only one logging in -- so I don't really get notifications unless I'm working on something. It's helped me a few times when I've accidentally left port 22 exposed to the world on some VPS' -- reminding me to add firewall rules to reduce access.
EDIT: clarified that sshd-montior sends alerts when matching regex pattern
ca_tech|2 years ago
ta1243|2 years ago
hoppla|2 years ago
high_priest|2 years ago
tetris11|2 years ago
heyoni|2 years ago
petemir|2 years ago
woopwoop24|2 years ago
bandrami|2 years ago
bombolo|2 years ago