Pagerduty Slack

Take PagerDuty, which helps more than 12,000 companies around the world pinpoint and tackle incidents with its real-time operations platform. By combining PagerDuty with Slack, a new integration seamlessly connects stakeholders, enabling them to manage and track issues before they escalate. PagerDuty integrates seamlessly with Slack to make teams’ lives easier and keep everyone on the same page, which is even more important when an incident hits. Recently, PagerDuty was proud to be part of Slack’s biggest, annual global event, Slack Frontiers. There were a couple of Dutonian speakers on the agenda, including.

  1. Pagerduty Slack Webhook
  2. Pagerduty Log In

One of the new features that we open sourced and pushed to OSSEC is an “integrator” daemon that we have been using internally to connect OSSEC to external APIs and alerting tools. The first two APIs we officially added were for Slack and PagerDuty.

To get started, you have to download OSSEC from our fork, either from the development branch or from the our stable branch:

After you install (or update) OSSEC, you need to enable the integrator daemon with the following command:

If the right version of OSSEC is installed, no errors will be generated and you are ready to configure it.

Integrating with Slack

Slack is taking the world by storm and many companies are using it for internal communication. Most people are always connected to it, making it more practical to use for real-time alerts than to depend solely on email.

Additionally, Slack integration is very easy to configure. First, you have to go to Slack and enable a new integration under Settings > Custom Integrations > Incoming Webhooks.

You then choose a channel and a new hook will be created in the format of:
https://hooks.slack.com/services/RANDOMSTRING/RANDOMSTRING.

Save that URL and add it in with the following to your ossec.conf file:

Once you restart OSSEC, it will force all alerts with level above 10 to go to the OSSEC room you chose before, just like this:

You can also specify per alert category or rule id, by using the <group> or <rule_id> entries. So if you only want to receive all authentication related alerts via slack, you can add the following to your config:

Restart OSSEC and you are done.

Integrating with PagerDuty

PagerDuty is one of the best products out there to manage and notify network and security administrators (DevOps/SecOps) about issues that deserve immediate attention.

It is a powerful tool and one that can now be integrated with OSSEC. Be careful not to overdo it with this one. Only push to PagerDuty events that really matter.

IntegrationPagerduty incident management

For example, we have some rules that are categorized as “immediate_response_required” as they tend to be related to service availability; either a service went down or the system is running out of memory. An example would be the Nginx rule 31321 and the Syslog rule 1007:

As you can see, this triggers an alert if Nginx is unable to assign an address (likely down) or if a log file is generating an warning about no space left. These are generally pretty serious as they affect the availability of the server. So they can be a good one to push straight to Pagerduty for immediate attention.

To do that, you first need to get your API key from the Pagerduty site. Go to Configuration > Services and view the service you have your escalations integrated with. There, you will see the API key to use, like this:

Save the integration key and copy to the ossec.conf:

Slack

In this example we tied OSSEC to the immediate_response group, so any serious availability issue will be pushed straight to the Pagerduty escalation. Similar to the Slack integration, you can tie it to alert levels (using <level>) or to specific alert ids (using <rule_id>).

Adding More Integrations

That’s it for now, however, adding new integrations to OSSEC is very easy and we plan to add more very soon. Hipchat is the next one on our list.

Are there any other integrations you want to see? Let us know and we will make it happen.

Integration

Need Help with OSSEC?

Pagerduty Slack Webhook

We leverage OSSEC extensively across all our products to help monitor and protect our servers. If you are not familiar with OSSEC, it is an open source Intrusion Detection System (HIDS); with a powerful correlation and analysis engine that integrates log analysis, file integrity monitoring, rootkit detection, real-time alerting, and active response.

It provides complete coverage if you are looking for an endpoint (server) security solution.

  • If you have not used OSSEC before, I recommend reading my guide to get started: http://dcid.me/texts/my-ossec-setup-manual.html
  • If you need help with your OSSEC implementation, we provide professional consultation at ColdPath

Pagerduty Log In

Note that OSSEC requires root access to your servers and is meant for network / server administrators with Linux skills.