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

Adds a note to the engagement initial modal to have MFA device ready … #3845

Merged
merged 1 commit into from
Oct 4, 2023
Merged
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
32 changes: 27 additions & 5 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
@@ -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)