Skip to content

[BUG] Exchange Online module returning "Bad Request", failing with TypeError #499

@jocelynjyl

Description

@jocelynjyl

Describe the bug
Exchange module failing Out of Office check when Out of Office is set with a specified time range. This might be fixed by explicitly casting results['scheduledStartDateTime']['dateTime'] and results['scheduledEndDateTime']['dateTime'] as datetime objects in exchange.py.

Module Name
Exchange Online Module

To Reproduce
Steps to reproduce the behavior:

  1. Identify an incident or use a testing incident with a user entity
  2. Enable automatic replies for user, check "Only send during this time range" and select a time range.
  3. Run the STAT triage playbook with Exchange module on the incident.

Expected behavior
Module should return the user is Out of Office.

Additional context
Error log from a failing STAT triage playbook run:

"Error": "Module processing failed, an unknown exception has occurred.",
"InvocationId": -redacted-,
"STATVersion": "2.2.0",
"Traceback": [
"Traceback (most recent call last):\n",
" File "/home/site/wwwroot/modules/init.py", line 19, in main\n return_data = coordinator.initiate_module(module_name=module_name, req_body=req_body)\n",
" File "/home/site/wwwroot/shared/coordinator.py", line 35, in initiate_module\n return_data = exchange.execute_exchange_module(req_body)\n",
" File "/home/site/wwwroot/modules/exchange.py", line 27, in execute_exchange_module\n oof_check(base_object, exch, upn)\n",
" File "/home/site/wwwroot/modules/exchange.py", line 122, in oof_check\n elif results['status'].lower() == 'scheduled' and current_time >= results['scheduledStartDateTime']['dateTime'] \\n",
"TypeError: '>=' not supported between instances of 'datetime.datetime' and 'str'\n"
]

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmodule/oofOut of Office Module

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions