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

Commit

Permalink
Don't fire the ldap_group alert when the LDAP operation involved remo…
Browse files Browse the repository at this point in the history
…ving a user from a group (#1640)
  • Loading branch information
arcrose committed Jun 4, 2020
1 parent 0b10f83 commit 6a1ae1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions alerts/ldap_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def main(self):
# ignore test accounts and attempts to create accounts that already exist.
search_query.add_must_not([
WildcardMatch('details.actor', '*bind*'),
WildcardMatch('details.changepairs', '*delete:member*')
])

self.filtersManual(search_query)
Expand Down
14 changes: 14 additions & 0 deletions tests/alerts/test_ldap_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,17 @@ class TestldapGroupModify(AlertTestSuite):
events=[event],
)
)

event = AlertTestSuite.create_event(default_event)
event['_source']['details']['changepairs'] = [
[
'delete:member',
'cn=test@mozilla.com,ou=distribution_lists,dc=mozilla'
]
]
test_cases.append(
NegativeAlertTestCase(
description='Negative test case that describes a user being deleted from a group',
events=[event],
)
)

0 comments on commit 6a1ae1e

Please sign in to comment.