Skip to content

Commit

Permalink
chore: Deprecate create_alert_route in general_alert.py and update pr…
Browse files Browse the repository at this point in the history
…ocess_image handling (#239)
  • Loading branch information
taylorwalton authored Jun 11, 2024
1 parent 57ef215 commit 90c2b58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
response_model=CreateAlertResponse,
description="Manually create an alert in IRIS from Copilot WebUI",
dependencies=[Security(AuthHandler().require_any_scope("admin", "analyst"))],
deprecated=True,
)
async def create_alert_route(
create_alert_request: CreateAlertRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ def get_process_image(source_dict: dict) -> str:
str: The process image.
"""
process_image = source_dict.get("process_image")
if not process_image:
process_image = source_dict.get("data_win_eventdata_image")
if not process_image:
process_image = source_dict.get("data_event_Image")
logger.info(f"Process image: {process_image}")
return process_image if process_image else source_dict.get("data_win_eventdata_image")
return process_image


def get_process_name_from_image(process_image: str) -> str:
Expand Down
2 changes: 2 additions & 0 deletions backend/app/integrations/monitoring_alert/services/wazuh.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ async def get_process_name(source_dict: dict) -> List[str]:
process_image = source.get("process_image")
if process_image is None:
process_image = source.get("data_win_eventdata_image")
if process_image is None:
process_image = source.get("data_event_Image")

process_name = os.path.basename(process_image) if process_image else None
return [process_name] if process_name else ["No process name found"]
Expand Down

0 comments on commit 90c2b58

Please sign in to comment.