Skip to content

Commit

Permalink
Adds a note to the engagement initial modal to have MFA device ready …
Browse files Browse the repository at this point in the history
…to avoid timeout (#3845)
  • Loading branch information
wssheldon authored Oct 4, 2023
1 parent 1693c58 commit 2dfc3aa
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,17 +1519,39 @@ def engagement_button_approve_click(
).build()
return client.views_open(trigger_id=body["trigger_id"], view=modal)

engagement = signal_service.get_signal_engagement(
db_session=db_session,
signal_engagement_id=context["subject"].engagement_id,
)

mfa_plugin = plugin_service.get_active_instance(
db_session=db_session, project_id=context["subject"].project_id, plugin_type="auth-mfa"
)
mfa_enabled = True if mfa_plugin and engagement.require_mfa else False

blocks = [
Section(text="Confirm that this is expected and that it is not suspicious behavior."),
Divider(),
description_input(label="Additional Context", optional=False),
]

if mfa_enabled:
blocks.append(Section(text=" "))
blocks.append(
Context(
elements=[
"After submission, you will be asked to confirm a Multi-Factor Authentication (MFA) prompt, please have your MFA device ready."
]
),
)

modal = Modal(
submit="Submit",
close="Cancel",
title="Confirmation",
callback_id=SignalEngagementActions.approve_submit,
private_metadata=context["subject"].json(),
blocks=[
Section(text="Confirm that this is expected and that it is not suspicious behavior."),
Divider(),
description_input(label="Additional Context", optional=False),
],
blocks=blocks,
).build()
client.views_open(trigger_id=body["trigger_id"], view=modal)

Expand Down

0 comments on commit 2dfc3aa

Please sign in to comment.