Some quick-and-dirty bash to monitor string patterns within the commits to a git repo. Designed to be run via cron - see Usage.
* plain old bash
* cd
* git
* printf
* cut
* date
* hostname
* basename
* grep
* sendmail (as an env var)
n.b. built and tested against Debian Stretch - tools like date and hostname may differ across platforms.
git clone "https://gerrit.wikimedia.org/r/wikimedia/security/gitmonitor"- Configure various environment variables - see comments within
GitMonitor.shheader or sample file provided. Note that GM_env* is a default pattern in .gitignore - Set proper execute perms and go!
- Simply configure the relevant environment variables and run
./GitMonitor.sh - Set up as a cron (e.g. every 2 minutes):
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
SHELL=/bin/bash
*/2 * * * * cd /path/to/wikimedia/security/tooling/gitmonitor && source GM_env.sh && ./GitMonitor.sh- Scott Bassett [sbassett@wikimedia.org]
This project is licensed under the Apache 2.0 License - see the (LICENSE](LICENSE) file for details.