Skip to main content

Slack

Slack is a messaging application used by many organizations to share messages, tools and files.

The Forward platform can be configured to integrate with Slack to:

  • Provide access to network information from a platform that all the users in the organization are familiar with no additional login required
  • Provide access to network information to users outside the network teams (e.g. application, security, cloud teams) that might not have access to or deep knowledge of the Forward platform
  • Encourages collaboration. Users can discuss a particular result within the same Slack channel.
note

The current Slack integration allows you to run a path analysis on a selected Forward Network from Slack. More capabilities (e.g. networks, inventory, verification checks) as well as support for custom command based on NQE Queries will be added in future releases

General Steps to Enable Slack Integrations

  • Create Slack App
  • Retrieve User OAuth and App-level Tokens
  • Configure Slack integration
  • Configure Slack Custom commands

Slack App Setup

Follow these simple steps to create a Forward Slack App that can be shared by all members in your organization to integrate with the Forward Enterprise platform.

Create Slack App

  1. Navigate to https://api.slack.com/apps page, login and click on Create an App Slack Create App
  2. You have two options to configure app’s scopes and settings, From scratch and From an app manifest.
    To make it easy to create the App, we provide an app manifest with a set of permissions for the App as well as the events that the App is registered to listen to.
    Select From an app manifest. Slack Create App Options
  3. Select a Slack Workspace that the app should be on from the drop-down menu and click on Next: Slack Create App Workspace
    warning

    You can’t change the app’s workspace later.
    If you leave the workspace, you won’t be able to manage any apps you’ve built for it.

  4. Copy the following app manifest and paste it in the Enter app manifest below window, making sure that the selected format is YAML, and click on Next:
display_information:
name: fwd
features:
app_home:
messages_tab_enabled: true
messages_tab_read_only_enabled: false
bot_user:
display_name: fwd
always_online: true
oauth_config:
scopes:
bot:
- app_mentions:read
- chat:write
- im:history
settings:
event_subscriptions:
bot_events:
- app_mention
- message.im
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false

Slack Create App Manifest

tip

If you want to make the Forward App automatically available from all channels you need to add the chat:write.public permission to the oauth_config section. In this case the app manifest you need to use is the following:

display_information:
name: fwd
features:
app_home:
messages_tab_enabled: true
messages_tab_read_only_enabled: false
bot_user:
display_name: fwd
always_online: true
oauth_config:
scopes:
bot:
- app_mentions:read
- chat:write
- chat:write.public
- im:history
settings:
event_subscriptions:
bot_events:
- app_mention
- message.im
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false
  1. Review OAuth, Features and Settings, and finally, click on Create. Slack Create App Review

  2. Install the app by clicking on Install to Workspace Slack Create App Install

  3. Click on Allow to allow the app to access the workspace Slack Create App Permissions

You should see the app Basic Information page Slack Create App Info

Now the Slack app is installed, and you can view the app in the Slack workspace in the Apps section Slack Forward App

or you can look for the app by clicking on the + sign in the Apps section and type the app name fwd in the search bar Slack Browse Apps

The final step is to add the fwd app to the Slack channel you want to use for inbound and outbound messages.

Select the Slack channel, type @fwd in the message window and press enter.

Slack Add App to Channel

note

You can skip the final step if you have created the app using the app manifest that includes the chat:write.public permission. If you have used the app manifest without the chat:write.public permission, and you miss the final step, you will receive a Not in channel message when testing the inbound messages in the setup process.

User OAuth Token

The User OAuth Token is required in the Fwd app for setting up the slack integration.
Navigate to the OAuth and Permissions page and copy the Bot User OAuth Token token.
Slack Create App Token

App-level Token

To generate an app-level token, navigate to the Basic Information page, scroll down to the App-Level Tokens section and

  • click on Generate Token and Scopes . Slack Create App Level Token Generate
  • Provide a Token Name (e.g. FwdAppToken)
  • Add both connections:write and authorizations:read scopes
  • click on Generate Slack Create App Level Token Generate

Copy the token. It'll be used in the setup process. Slack Create App Level Token Generate

Add Slack Integration

To add the Slack integration, navigate to Settings, System, Integrations, click on the Add button in the Slack section

Add Slack Integration

Outbound messaging

Provide the Bot token. It's the OAuth access token for the bot associated with your Forward Slack app. Bot token strings begin with xoxb-. For more info, see User OAuth Token

Add Slack Integration

Click on Send test message to make sure the outbound communication is working as expected.

Provide the Channel ID and a Test Message. The Channel ID can be found in the About section of the Slack channel information page Configure Slack Channel ID

Click on Send message. You should see a green Message sent confirmation Configure Slack Test Outbound Messaging

and the message should show in the Slack chanel Configure Slack test message

Inbound messaging

Socket Mode must be enabled to allow your Forward Slack app to send messages to your Forward Enterprise instance. An app-level access token is required to secure the socket connection. App-level token strings begin with xapp-. For more info, see App-level Token

Provide the App-level token in the Inbound messaging section and click on Receive test message to make sure the inbound communication is working as expected.

Configure Slack connection

Now, go to Slack, select the fwd App and send a test message. Configure Slack connection

You should see the message in Forward along with a green Message sent confirmation.

Configure Slack connection

Finally, close the window and click on Add to finish the setup process.

The Slack integration will be shown as Enabled in the Integrations page: Slack Connection Enabled

note

The Missing custom commands message is expected. See the Add Slack Custom Commands section.

Add Slack Custom Commands

Custom commands allow you to run a path analysis on a selected Forward Network from Slack.

Click on add commands in the Slack Integration page to start the process.

The Manage Slack app command page shows the built-in help command.

Click on Add a command, provide a Command name, select a Network on which this command would be applied on, and click on Add Slack Add Custom Command

Notes
  • Command would be applied on the latest processed snapshot of that network
  • Command name can be any name, except help which is reserved.

Repeat the same process to add other commands Slack Custom Command List

Now you can issue the custom commands from any Slack channel by mentioning the @fwd app.

The following screenshot shows an example of help command Slack Help Example

while this one shows an example of a path command Slack Path Example

The path command provides hop-by-hop information for the requested path analysis and a direct link to perform the analysis via the Forward user interface. Slack Path Example UI

Editing Slack Connection Settings

To edit the Slack connection settings, click on the Connection gear icon, edit the settings, test the connections as described in the Add Slack Integration section and finally click on Update.

Edit Slack Connection

Enabling/Disabling Slack Integration

To enable or disable the Slack integration, simply enable the toggle button in the Slack section of the Integrations page.

Enable/Disable Slack Connection

Deleting Slack Integration

To delete the Slack integration, disable it, click on Delete and confirm the deletion to delete all slack custom commands for the organization and delete the Slack integration. Delete Slack Connection