How can I configure Octopus Deploy to send an alert to MS Teams/Slack etc for a specific security event?

My team and I need to get notified of any security events that occur, is there a way to do this in Octopus Deploy?

Within Octopus Deploy you can configure Subscriptions. These can subscribe to certain Events that occur within Octopus.

Let’s take an example of a User Role being amended.

First, we’ll create a Subscription that will fire when any change occurs on the User or User Role documents:

  • Go to the Configuration menu then select Subscriptions

  • Click Add Subscription

  • Select the Event Filters of

    • Event Group - Document Events
    • Document Types - User, User Role, Scoped User Role
  • At this point, you can select whether you’d like to be notified by email and/or send a Webhook. For this example I’ll be using a Webhook.

    There are a huge number of ways that the Webhook can be consumed to then notify onwards to trigger further events. A few cloud offering examples are:

    • AWS Lambda
    • Azure Function
    • Microsoft Flow
    • Google Cloud Functions
    • Zapier
  • One of the quickest and simplest ways to automate a notification is to use Zapier, and that’s the example I’m going to look at here.

    Create a new Zap and choose Webhook - Catch Hook

  • Then take the URL supplied in the next step and save it to enter into the Octopus Subscription page:

    Zapier:

    Octopus:

  • Save the Subscription in Octopus and in Zapier click Test and Continue.

  • I am going to configure the notification to go to Slack, so the next step is to choose that in Zapier.
    Details of to configure this for your Slack can be found here: https://zapier.com/apps/slack/help

  • Now, in order to test this I can go into Octopus and create a new test User Role and have that message come through to Slack!

    image

And that’s it! :nerd_face: You can transform the Webhook payload to format the message you wish to notify people with and you could add multiple actions that should occur however in order to get the notification in its simplest form these straight forward steps should help get you moving!