Skip to content

Instantly share code, notes, and snippets.

@matthew-harper
Created February 18, 2020 23:44
Show Gist options
  • Save matthew-harper/c6b9d2078732af8db46ec87d533f0667 to your computer and use it in GitHub Desktop.
Save matthew-harper/c6b9d2078732af8db46ec87d533f0667 to your computer and use it in GitHub Desktop.
filter_user_events
def filter_user_events(event) -> bool:
is_match = match_user_agent(event['userAgent'])
is_read_only = match_readonly_event_name(event['eventName'])
is_ignored_event = match_ignored_events(event['eventName'])
is_in_event = 'invokedBy' in event['userIdentity'] and event['userIdentity']['invokedBy'] == 'AWS Internal'
status = is_match and not is_read_only and not is_ignored_event and not is_in_event
return status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment