Use a ChatOps Step

After adding workspaces to InsightConnect, you can configure the ChatOps action to include in your workflow.

To add a ChatOps step to a workflow:

  1. When choosing step type for a new step in the workflow builder, click the ChatOps button, then click the Continue button.
  2. Choose the workspace you want to post messages in and click Continue. If you have no workspaces set up or would like to add a new workspace, follow these instructions.
  3. Select the action you want to use. Learn more about ChatOps actions in the following sections. InsightConnect currently supports:
  1. Name the ChatOps action something descriptive, so you can easily refer to it later.
  2. Check the Continue workflow on step failure box if you want your workflow to continue to run even if the ChatOps step fails.
  3. Use the instructions in the following sections to configure the ChatOps action you chose.

Format ChatOps Step Input

When configuring a ChatOps step, make sure to follow these conventions for Slack content in InsightConnect input fields:

  • Channels must be prepended with #, like #channel
  • User mentions must be formatted with Slack's new <userID> syntax. Learn more about this change at Slack's API documentation: https://api.slack.com/changelog/2017-09-the-one-about-usernames
  • If using string variables from previous steps as ChatOps input, the variable must be first modified through an Artifact Step in order to prepend the # or @ symbols in front of each string of the variable

Private Channels in Step Input

If you'd like to conduct ChatOps actions in a private Slack Channel, you will need to first add the ChatOps slack bot to the private channel.

In the private channel:

  1. Type '@' to open a list of available users and bots to add to the channel.
  2. Start typing "InsightConnect" to filter the search.
  3. Select @Rapid7 InsightConnect.
  4. When prompted, click the Invite Them button.

If the slack bot is added successfully, you should see that the Rapid7 InsightConnect Slack app joined your private channel by invitation from your username.

Use the Post Message Action

Post messages directly into your Slack workspace in your preferred channels, private groups, or IM channels. You can include data from previous steps in your workflow, as well as Slack message attachments, URLs, and more.

To configure a Post Message ChatOps action:

  1. Provide the name of the message recipient, such as a channel or username. You can also ingest channel names as input variables from previous Slack steps in your workflow.
  2. Provide the message you would like to post into the Slack channel.
  • You can include variables from previous workflow step. Reference them with the {{[StepName].[VariableName]}} syntax.
  • You can also add URLs and tag people just as you would in Slack. Use the @ symbol to tag team members by username directly in the message.
  1. If you would like to include message attachments, format the attachment as a JSON array and paste into the attachment field. Visit Slack’s API documentation to learn more about JSON structure: https://api.slack.com/docs/message-attachments#attachment_structure.
  2. Click Continue to add more steps into your workflow as needed.

Use the Post Interactive Message Action

Interactive messages allow your team to respond directly to prompts from the Rapid7 InsightConnect Slackbot in Slack. Use the Post Interactive Message action to seamlessly incorporate your team’s expertise into your workflows, all from your preferred Slack channel or group.

To configure a Post Interactive Message ChatOps action:

  1. First configure the Interactive Message section. This will display the first part of the Slack message. We recommend using this section to provide as much information as possible for your team to make decisions.
  2. Enter the name of the message recipient, such as a channel or username. You can also ingest channel names as input variables from previous Slack steps in your workflow.
  3. In the “Message” field, provide the message you would like to post into the Slack channel before the prompt or question. You can include variables from previous steps as well as @ user or # channel mentions in your message.
  4. Enter the question or prompt you want the recipient to answer in the Response Question field.
  5. If you would like to include message attachments, format the attachment as a JSON array and paste it into the attachment field. Visit Slack’s API documentation to learn more about the JSON structure: https://api.slack.com/docs/message-attachments#attachment_structure.
  6. Format each response option you want to provide to your team. You should have two options at minimum, and you can add more as needed by clicking on the +Add Response Option button at the bottom of the configuration panel. To configure a response option:
  7. In the “Button Text” field, type the text you want the button in Slack to display.
  8. Choose a “Button Style” from Primary, ** Default**, or Danger. Primary buttons display in a green font and border, default buttons display in black, and danger buttons display in red. We recommend using primary buttons for preferred responses. Use danger buttons for responses that require your team to take caution, like in cases of permanent deletion or modification.
  9. Provide a confirmation message for the Slack bot to display when a user selects a response. You can include variables or Slack channels and usernames in these messages.
  10. Repeat the previous three steps for every response option you need.
  11. Click Continue to see a preview of the Slack message and buttons. Use the Previous button to return to the configuration panel and make more edits. Otherwise, click the Continue button .
  12. Configure the message’s timeout settings. Timeouts occur if none of your team members respond to the Slack message within a pre-configured length of time. Type in your desired number of minutes or seconds and set the unit of time in the “Time out after…” dropdown. Then choose a path from one of the three response options to be the default path in case of timeout.
  13. Click the Continue button to close the configuration panel.
  14. Add steps to each of the paths created by your ChatOps step response options.