Connects to Elasticsearch, parses heartbeat writes, and creates the following host-oriented alerts:
- New Priviledge Escalation
- Failed file change attempt
- Failed file access attempt
- File permissions change
- New SSH connection
- Failed SSH connection attempt (password, invalid user)
ElastAlert was too heavyweight, carrying too many alerting features. Also, ElastAlert's enhancement modules did not play well with query_keys.
Furthermore it's more feasible to create machine-oriented event data by redoing ElastAlert's necessary work from the ground up.
- Set
ES_ADDRto your ElasticSearch address,ESEC_SLACK_WEBHOOKto your slack webhook, andSTMP_SEND_ADDRto the email you would like to notify. ESEC_AGG_DURATIONandESEC_EMAIL_DURATIONcan be optionally set (e.g.2hr,24h). It is recommended to add a couple extra more seconds for email as it will capture the aggregation events.- Add
-w /etc/ -p wato your auditbeat.yml - Use the following auditbeat configuration:
- module: audit
metricsets: [kernel]
kernel.audit_rules: |
# Identity changes.
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/gshadow -p wa -k identity
-w /etc/ -p wa
# Unauthorized access attempts.
-a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EACCES -k access
-a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EPERM -k access
- module: audit
metricsets: [file]
file.paths:
- /bin
- /usr/bin
- /sbin
- /usr/sbin
- /etc
- In filebeat.yml, under
filebeat.prospectors, add:scan_frequency: 1s make && ./elastsec
- Elasticsearch
- Filebeat
- Auditbeat
sendmailconfigured viassmtp(including revaliases) or another SMTP utility.
You will need a version of Go relatively recent to 1.9.3 to build the binary yourself. A glide configuration and lock-file is included.