Configuration

Oncall integration

Iris communicates with Oncall primarily through its role_lookup plugins, which allow it to determine a message recipient given a role:target pair. To use Oncall with Iris:

  1. Configure Iris to communicate with Oncall by setting the “oncall-api” key in the config to the URL where Oncall is hosted
  2. In the “role_lookups” key, include “oncall” in the list and remove “dummy”
  3. Import targets from Oncall by running the following command:
./iris-sync-targets /home/iris/config/config.yaml

Slack integration

Adding Slack bot

Iris can send Slack messages by integrating with a Slack bot.

  1. Create a Slack App
    1. Go to https://api.slack.com/apps.
    2. Click “Create New App” button on the upper right.
    3. Provide an App Name (example - iris)
    4. Choose your Slack team
    5. Click “Create App”
  2. Go to “Bot Users” under “Features” and do the following:
    1. Click “Add a Bot User”
    2. Choose a default username for the bot (example - iris)
    3. Click “Add Bot User”
    4. Click “Save Changes”
  3. To enable Interactive Message, click “Interactive Messages” under “Features” and do the following:
    1. Click “Enable Interactive Messages”
    2. Add a HTTPS endpoint: “https://YOUR_PUBLIC_IRIS_RELAY_URL/api/v0/slack/messages/relay
    3. Click “Enable Interactive Messages” button
  4. Click “OAuth & Permissions” under “Features” and do the folling:
    1. Under Permission Scopes, add the following:
      • incoming-webhook
      • commands
      • bot
      • channels:read
      • chat:write:bot
    2. Click “Save Changes”
    3. Under “OAuth Tokens & Redirect URLs” section:
      1. Click “Install App to Team”
      2. Redirected to a confirmation page that has all the details about the bot
      3. Choose “Slackbot” in the Post to dropdown
      4. Click “Authorize”

After completing the above steps, you should be able to find the following two secrets:

Bot User OAuth Token
Found under “Features” -> “OAuth & Permissions” -> “OAuth Tokens & Redirect Urls” -> “Bot User OAuth Access Token”
Verification Token
Found under “Settings” -> “Basic Information” -> “App Credentials”

Updating Iris configs

The last step is to create the slack config section with those secrets for Iris and Iris relay.

In Iris config, add the following section under venders block with Bot User OAuth Token:

vendors:
- type: iris_slack
  name: slack
  auth_token: BOT_USER_OAUTH_TOKEN
  base_url: 'https://slack.com/api/chat.postMessage'
  # this url config is for constructing url link for the message title
  iris_incident_url: 'https://YOUR_IRIS_URL/incidents'
  # we also support an optional proxy key here
  message_attachments:
    fallback: 'New Iris notification!'

In Iris relay config, add the following top level section with Verification Token:

slack:
  auth_token: VERIFICATION_TOKEN

Known issues

For message button integration, your relay should be getting POST request from Slack every time a button is clicked. If your relay is getting GET instead of POST, then you are running into a known bug in Slack. You will need to reset the relay webhook state by doing the following:

  1. Go to “Interactive Messages” under “Features”
  2. Set HTTPS endpont to a URL under another domain. For example, you can use https://www.google.comw
  3. Click “Save changes” button
  4. Set HTTPS endpoint back to your relay: “https://YOUR_PUBLIC_IRIS_RELAY_URL/api/v0/slack/messages/relay
  5. Click “Save changes” button again