logo

Slack App

Slack integration let you act on connections that has review or jit plugin enabled, it sends notification letting you approve sessions directly from a channel in slack.
Image without caption

Requirements

  • Privileges to install the new app in a workspace
  • Admin user on hoop

App Installation - Slack

  1. Create a slack app from an app manifest
  1. Select the workspace and click next and paste the manifest below
slack-manifest.json
  1. Follow the guide and click on Install to Workspace
  1. Scroll below and create an App-Level Token and copy the token
      • Token Name: hoop
      • Scopes: connections:write, app_configurations:write
  1. Go to Install App on the left side bar and copy the Bot User Oauth Token

Lastly, invite the bot in the slack channel that you wish to receive notifications typing the name of the bot @hoop
Image without caption

App Installation - Hoop

In this step the slack bot and app level tokens are required to configure the plugin, you can then them at:
  • SLACK_BOT_TOKEN: Oauth & Permissions > OAuth Tokens for Your Workspace This is the token created in the app installation process
  • SLACK_APP_TOKEN: Basic Information > App-Level Tokens
Then configure the Slack App:
  1. Login to your hoop instance: hoop login
  1. Create the slack plugin
shell
hoop admin create plugin slack \ --overwrite \ --config SLACK_BOT_TOKEN=xoxb-... \ --config SLACK_APP_TOKEN=xapp-...
Now it’s possible to associate connections to the slack plugin in the webapp

Subscribing to Slack channels

We need to go to the Slack plugin page, accessing the menu → Manage plugins → Slack.
Then, just click on settings and add all the channels (separated by commas) that you would like to receive the review from that connection.
Image without caption

Subscribe to Notifications

To subscribe and signup to receive notifications from the Hoop Bot, type /hoop subscribe and access the generated link. After sign in the user will start to receive notification when there’s a review approved and ready to be executed.

Subscribing Manually [Optional]

To add approvers that are allowed to review sessions, fetch the slack id of the user and update it using the command line.
shell
hoop admin create user <approver@domain.tld> --overwrite \ --groups admin,sre \ --slackid <SLACK-USER-ID>

Copy the Slack ID

  • In the slack app, click on the top right corner in your profile photo
  • Select Profile
  • Click on the more options button (see image below) and copy the member’s ID
Image without caption
💡
You can copy the id of other members too on slack.

Usage

To be able to use it, the review plugins must be enabled for a connection. When trying to interacting with it, it will send a message to the configured slack channel.
Associate the connection with the review and slack plugin
shell
hoop admin create conn bash \ --overwrite \ --agent default \ --reviewers 'admin,sre' \ --plugin slack \ -- bash
Then, interacting with the connection will send a message on your slack channel. After it’s approved it will send a message to the creator.
shell
hoop connect bash
jit notification
shell
hoop exec bash 'ls'
exec notification

Powered by Notaku