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

Global task hooks - remove case references #3

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion iris_webhooks_module/IrisWebHooksConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
module_name = "IrisWebHooks"
module_description = "Provides webhooks for IRIS. See https://docs.dfir-iris.org/operations/modules/natives/IrisWebHooks/"
interface_version = "1.2.0"
module_version = "1.0.2"
module_version = "1.0.3"
pipeline_support = False
pipeline_info = {}

Expand Down
16 changes: 13 additions & 3 deletions iris_webhooks_module/IrisWebHooksInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,22 +260,32 @@ def _do_web_hook(self, hook_name, data, hook, server_url) -> InterfaceStatus.IIS
case_id = data[0].case_id
object_url = f"{server_url}/case/evidences?cid={case_id}&shared={data[0].id}"

elif hook_object == 'task' or hook_object == 'global_task':
elif hook_object == 'task':
user_name = data[0].user_update.name
object_name = data[0].task_title
case_name = data[0].case.name
case_id = data[0].task_case_id
object_url = f"{server_url}/case/task?cid={case_id}&shared={data[0].id}"

elif hook_object == 'global_task':
user_name = data[0].user_update.name
object_name = data[0].task_title
case_name = 'Global'
case_id = None
object_url = f"{server_url}/dashboard?cid=1#gtasks_table_wrapper"

elif hook_object == 'report':
object_name = 'a report'

if object_url:
object_name = self._render_url(object_url, object_name, request_rendering)

if case_id:
case_info = "on case {rendered_url}".format(rendered_url=self._render_url(f"{server_url}/case?cid={case_id}",
f"#{case_id}", request_rendering))
case_info = "on case {rendered_url}".format(
rendered_url=self._render_url(f"{server_url}/case?cid={case_id}",
f"#{case_id}", request_rendering))
else:
case_info = ""

description = f"{user_name} {hook_type}d {hook_object} {object_name} {case_info}"
title = f"[{case_name}] {hook_object.capitalize()} {hook_type}d"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

setuptools.setup(
name='iris_webhooks_module',
version='1.0.2',
version='1.0.3',
packages=['iris_webhooks_module'],
author="DFIR-IRIS",
author_email="[email protected]",
Expand Down