Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
fixup the selection criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbryner committed Jan 23, 2015
1 parent 1246b7d commit 69ee2e0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions alerts/duo_fail_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ def main(self):
date_timedelta = dict(minutes=15)
# Configure filters using pyes
must = [
pyes.TermFilter('_type', 'event'),
pyes.TermFilter('_source.tags', 'openvpn,duosecurity'),
pyes.QueryFilter(pyes.MatchQuery('summary','DuoAPI contact failed','phrase')),
pyes.QueryFilter(pyes.MatchQuery('summary','DuoAPI contact failed','phrase')),
pyes.ExistsFilter('details.hostname'),
pyes.QueryFilter(pyes.MatchQuery('summary','DuoAPI contact failed','phrase'))
]
self.filtersManual(date_timedelta, must=must)

# Search aggregations on field 'sourceipaddress', keep 50 samples of events at most
self.searchEventsAggreg('hostname', samplesLimit=1)
# Search aggregations on field 'sourceipaddress', keep X samples of events at most
self.searchEventsAggreg('hostname', samplesLimit=10)
# alert when >= X matching events in an aggregation
# in this case, always
self.walkAggregations(threshold=1)
Expand All @@ -43,7 +41,8 @@ def onAggreg(self, aggreg):
tags = ['openvpn', 'duosecurity']
severity = 'WARNING'

summary = ('DuoSecurity OpenVPN contact failed, fail open triggered on {0}'.aggreg['value']))
summary = ('DuoSecurity OpenVPN contact failed, fail open triggered on {0}'.aggreg['value'])

# Create the alert object based on these properties
return self.createAlertDict(summary, category, tags, aggreg['events'], severity)

0 comments on commit 69ee2e0

Please sign in to comment.