Skip to content

Code42/update py42 dep #34

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

Merged
merged 7 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 18 additions & 16 deletions Packs/Code42/Integrations/Code42/Code42.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import py42.sdk
import py42.settings
from datetime import datetime
from py42.services.detectionlists.departing_employee import DepartingEmployeeFilters
from py42.services.detectionlists.high_risk_employee import HighRiskEmployeeFilters
from py42.sdk.queries.fileevents.file_event_query import FileEventQuery
from py42.sdk.queries.fileevents.filters import (
MD5,
Expand Down Expand Up @@ -87,18 +89,18 @@
}

CODE42_FILE_CATEGORY_MAPPER = {
"SourceCode": "SOURCE_CODE",
"Audio": "AUDIO",
"Executable": "EXECUTABLE",
"Document": "DOCUMENT",
"Image": "IMAGE",
"PDF": "PDF",
"Presentation": "PRESENTATION",
"Script": "SCRIPT",
"Spreadsheet": "SPREADSHEET",
"Video": "VIDEO",
"VirtualDiskImage": "VIRTUAL_DISK_IMAGE",
"Archive": "ARCHIVE",
"SourceCode": FileCategory.SOURCE_CODE,
"Audio": FileCategory.AUDIO,
"Executable": FileCategory.EXECUTABLE,
"Document": FileCategory.DOCUMENT,
"Image": FileCategory.IMAGE,
"PDF": FileCategory.PDF,
"Presentation": FileCategory.PRESENTATION,
"Script": FileCategory.SCRIPT,
"Spreadsheet": FileCategory.SPREADSHEET,
"Video": FileCategory.VIDEO,
"VirtualDiskImage": FileCategory.VIRTUAL_DISK_IMAGE,
"Archive": FileCategory.ZIP,
}

SECURITY_EVENT_HEADERS = [
Expand Down Expand Up @@ -198,7 +200,7 @@ def remove_user_from_departing_employee(self, username):
def get_all_departing_employees(self, results, filter_type):
res = []
results = int(results) if results else 50
filter_type = filter_type if filter_type else "OPEN"
filter_type = filter_type if filter_type else DepartingEmployeeFilters.OPEN
pages = self._get_sdk().detectionlists.departing_employee.get_all(filter_type=filter_type)
for page in pages:
page_json = json.loads(page.text)
Expand Down Expand Up @@ -236,7 +238,7 @@ def remove_user_risk_tags(self, username, risk_tags):
def get_all_high_risk_employees(self, risk_tags, results, filter_type):
risk_tags = argToList(risk_tags)
results = int(results) if results else 50
filter_type = filter_type if filter_type else "OPEN"
filter_type = filter_type if filter_type else HighRiskEmployeeFilters.OPEN
res = []
pages = self._get_sdk().detectionlists.high_risk_employee.get_all(filter_type=filter_type)
for page in pages:
Expand Down Expand Up @@ -801,7 +803,7 @@ def departingemployee_remove_command(client, args):
@logger
def departingemployee_get_all_command(client, args):
results = args.get("results", 50)
filter_type = args.get("filtertype", "OPEN")
filter_type = args.get("filtertype", DepartingEmployeeFilters.OPEN)
employees = client.get_all_departing_employees(results, filter_type)
if not employees:
return CommandResults(
Expand Down Expand Up @@ -905,7 +907,7 @@ def highriskemployee_remove_command(client, args):
def highriskemployee_get_all_command(client, args):
tags = args.get("risktags")
results = args.get("results", 50)
filter_type = args.get("filtertype", "OPEN")
filter_type = args.get("filtertype", HighRiskEmployeeFilters.OPEN)
employees = client.get_all_high_risk_employees(tags, results, filter_type)
if not employees:
return CommandResults(
Expand Down
2 changes: 1 addition & 1 deletion Packs/Code42/Integrations/Code42/Code42.yml
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ script:
- contextPath: Code42.DepartingEmployee.DepartureDate
description: The departure date for the Departing Employee.
type: Unknown
dockerimage: demisto/py42:1.0.0.10664
dockerimage: demisto/py42:1.0.0.11140
feed: false
isfetch: true
longRunning: false
Expand Down
Loading