Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apps] update gsuite apps for changes to google-api-python-client #1046

Merged
merged 8 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions streamalert/apps/_apps/gsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ def _sleep_seconds(self):
return 0


@StreamAlertApp
class GSuiteAccessTransparencyReports(GSuiteReportsApp):
"""G Suite Access Transparency Report app integration"""

@classmethod
def _type(cls):
return 'access_transparency'


@StreamAlertApp
class GSuiteAdminReports(GSuiteReportsApp):
"""G Suite Admin Activity Report app integration"""
Expand Down Expand Up @@ -257,12 +266,21 @@ def _type(cls):


@StreamAlertApp
class GSuiteGroupsReports(GSuiteReportsApp):
"""G Suite Groups Activity Report app integration"""
class GSuiteGroupReports(GSuiteReportsApp):
"""G Suite Group Activity Report app integration"""

@classmethod
def _type(cls):
return 'group'


@StreamAlertApp
class GSuiteGroupEnterpriseReports(GSuiteReportsApp):
"""G Suite Groups Enterprise Activity Report app integration"""

@classmethod
def _type(cls):
return 'groups'
return 'groups_enterprise'


@StreamAlertApp
Expand Down Expand Up @@ -302,18 +320,18 @@ def _type(cls):


@StreamAlertApp
class GSuiteSAMLReports(GSuiteReportsApp):
"""G Suite SAML Activity Report app integration"""
class GSuiteTokenReports(GSuiteReportsApp):
"""G Suite Token Activity Report app integration"""

@classmethod
def _type(cls):
return 'saml'
return 'token'


@StreamAlertApp
class GSuiteTokenReports(GSuiteReportsApp):
"""G Suite Token Activity Report app integration"""
class GSuiteUserAccountsReports(GSuiteReportsApp):
"""G Suite User Accounts Activity Report app integration"""

@classmethod
def _type(cls):
return 'token'
return 'user_accounts'
9 changes: 5 additions & 4 deletions tests/unit/streamalert/apps/test_apps/test_app_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from mock import call, Mock, patch
from moto import mock_ssm
from nose.tools import (
assert_count_equal,
assert_equal,
assert_false,
assert_is_instance,
Expand Down Expand Up @@ -49,16 +48,18 @@ def test_get_all_apps(self):
'box_admin_events',
'duo_admin',
'duo_auth',
'gsuite_access_transparency',
'gsuite_admin',
'gsuite_calendar',
'gsuite_drive',
'gsuite_gplus',
'gsuite_groups',
'gsuite_group',
'gsuite_groups_enterprise',
'gsuite_login',
'gsuite_mobile',
'gsuite_rules',
'gsuite_saml',
'gsuite_token',
'gsuite_user_accounts',
'intercom_admin_activity_logs',
'onelogin_events',
'salesforce_console',
Expand All @@ -71,7 +72,7 @@ def test_get_all_apps(self):
'aliyun_actiontrail'
}

assert_count_equal(expected_apps, StreamAlertApp.get_all_apps())
assert_equal(expected_apps, set(StreamAlertApp.get_all_apps()))

@patch('streamalert.apps.app_base.Batcher', Mock())
def test_get_app(self):
Expand Down