PagerDuty Zero Trust Alert to Event Integration
- Overview
- Support Statement
- Limitations
- Solution Overview
- Advanced Zero Trust Capabilities
- What is PagerDuty?
- Integration Architecture
- Solution Configuration in PagerDuty and Data Security Edition Zero Trust
- Prerequisites
- Configuration in PagerDuty
- Configuration Steps on Eyeglass Virtual Machine
- High Level steps
- Configuration Step by Step
- Configure the Service start and python integration files
- Configure the python packages and customize the PagerDuty integration python code
- Configure Defender Zero Trust Webhooks
- How to test the Integration with PagerDuty
- PagerDuty SecOps administrators Integration Experience
Overview
PagerDuty a digital operation platform that provides reliable notifications, on-call, scheduling automatic escalations, and other functionality to help teams detect and fix problems quickly
Support Statement
-
NOTE: This documentation is provided "as is" without support for 3rd party software. The level of support for this integration guide is best effort without any SLA on response time. No 3rd party product support can be provided by Superna directly. 3rd party components require support contracts
Limitations
- None
Solution Overview
Superna Defender Zero Trust API receives webhook alerts and parses the key data into a HTTPS API payload events that are sent to PagerDuty endpoint url. PagerDuty is a modular architecture that provides real-time visibility of your IT infrastructure, which you can use for threat detection and prioritization.
Advanced Zero Trust Capabilities
- Webhook to native HTTPS collector API case creation
- Supports dedupe key and Service routing integration with Events v2 api
What is PagerDuty?
Integration Architecture
Solution Configuration in PagerDuty and Data Security Edition Zero Trust
Prerequisites
- Installed Security Edition
- Eyeglass OS appliance version 15.5
- cat /etc/os-release
- License key for the Zero Trust API
- PagerDuty
- Service Created with Events v2 api integration
Configuration in PagerDuty
The steps below create a collector endpoint,
Steps to enable Service integration
- Login to the PagerDuty console
- Create a new Service
- Click the next and set up the service with the defaults
- On the Integrations tab add the Events v2 api
- Once completed create the service and get the Integration key from the Integrations tab of the new service
- Record the Integration key for use in the code below.
- Done
Configuration Steps on Eyeglass Virtual Machine
High Level steps
- Create python location to run the application on the Eyeglass vm
- Create python main application script
- Create linux systemd service and set to auto start
- Create Zero Trust configuration in Data Security Edition
- Update the main script to customize with PagerDuty python code
- Test the script is running as a service
- Create a test event in Defender to validate the alerts appear as indexed parsed events in PagerDuty
Configuration Step by Step
Configure the Service start and python integration files
-
Login to the Eyeglass VM via SSH as the admin userssh admin@<your-vm-ip># Become rootsudo -s
mkdir -p /opt/superna/cgi-bin
chown -R sca:users /opt/superna/cgi-binchmod -R u+rwX,g+rwX /opt/superna/cgi-bin# become SCA user
sudo -u sca -s
cd /opt/superna/cgi-bin
python3 -m venv venv-pagerduty
source venv-pagerduty/bin/activate
pip install flask requests
deactivate
# Create required filestouch pagerduty.pytouch pagerduty.sh# Make scripts executablechmod +x pagerduty.pychmod +x pagerduty.sh# Create the pagerduty.sh launch scriptnano /opt/superna/cgi-bin/pagerduty.sh# past contents below into the file
#!/bin/bashexport PATH="/opt/.pyenv/bin:$PATH"source /opt/superna/cgi-bin/venv-pagerduty/bin/activateexec python /opt/superna/cgi-bin/pagerduty.py# Make the launch script executablechmod +x /opt/superna/cgi-bin/pagerduty.sh## exit from being SCA user
exit
whoami
### make sure you are the root user again for these steps
# Create the systemd service unit filenano /etc/systemd/system/pagerduty.service#Paste the contents below into the file
[Unit]Description=Webhook listener for Zero Trust API translations and integrationsAfter=network.target[Service]Type=simpleUser=scaGroup=usersWorkingDirectory=/opt/superna/cgi-binExecStart=/bin/bash /opt/superna/cgi-bin/pagerduty.shRestart=alwaysRestartSec=5[Install]WantedBy=multi-user.target# Reload systemd to recognize the new servicesystemctl daemon-reload# Enable the service to start on boot (do NOT start it yet)systemctl enable pagerduty
Configure the python packages and customize the PagerDuty integration python code
- Customize the application code by downloading the python code from this link to download
- Open the python template file in a text editor. NOTE: make sure to only replace the values and do not delete any of the commas
- Locate this section in the file and replace the yellow sections to match your PagerDuty endpoint URL. The endpoint url is unique and can be copied from the console into the variable below.
- # PagerDuty HTTP Collector EndpointPAGERDUTY_ROUTING_KEY = "xxxxxxxxxxxx"PAGERDUTY_API_URL = "https://events.pagerduty.com/v2/enqueue"
- nano /opt/superna/cgi-bin/pagerduty.py
- Open the file locally in Windows OS notepad and use control-A or select all the text in the python template
- Paste the clipboard into the ssh terminal session with the open nano editor file
- save the file
- press control+x
- Answer yes to save and exit the nano editor
- Start the service and verify it is running
- systemctl start pagerduty.py
- systemctl status -l pagerduty.py
- Verify the service is started successfully and returns "active and running".
- If the service does not start do not proceed and double check the steps above are completed.
Configure Defender Zero Trust Webhooks
- The next step creates an Zero Trust Webhook URL.
- Configure Zero Trust endpoint in Ransomware Defender Zero Trust tab.
- Recommended Configuration: Only Critical and Major events and only the webhooks that set lockout or delayed lockout. Customers can customize based on specific requirements. The goal is to send findings versus a list of alarms that do not pinpoint a security incident.
-
- The endpoint url above will use localhost and will send Webhooks to the application service listening on port 5000. URL to use in the configuration
- http://localhost:5000/webhook
- Add the Content-Type header with value of application/json and the content-encoding with value gzip as shown above to complete the webhook configuration.
- Click save to commit the configuration.
- Click save on the main Webhook configuration page
- Recommended Configuration: Only Critical and Major events and only the webhooks that set lockout or delayed lockout. Customers can customize based on specific requirements. The goal is to send findings versus a list of alarms that do not pinpoint a security incident.
- Configure Zero Trust endpoint in Ransomware Defender Zero Trust tab.
- Test the configuration is working following the next section
How to test the Integration with PagerDuty
- To test the integration follow these steps
- Prerequisites In PagerDuty and Eyeglass:
- Get the ip address of the Eyeglass vm
- download this curl command template and open with a text editor and locate the ip address of eyeglass at the very end of text and replace the ip address with the IP address of your eyeglass vm.
- Copy all the text in the text editor
- ssh to the eyeglass vm as the admin user
- Paste the entire cli command text to the ssh prompt to send sample data to the running Zero Trust application. This will send test data directly to the application to be processed and sent to PagerDuty SIEM Integration service that is running on the Eyeglass VM.
- The output of a successfully processed webhook test will return this text in the ssh terminal
- done sending event to PagerDuty and check for http 200 and success count in response
- How to review the process logs from the web application
- sudo -s
- journalctl -f -u pagerduty
- This allows you to view the logs generated by the application.
- To log to a file and review with nano showing only the most recent 250 lines.
- journalctl -f -n 250 -u thehive > /tmp/pagerduty.py.log
- nano /tmp/thehive
- In the log below the response code from the PagerDuty api call should show http 200 status code and successCount 1 to indicate the Finding was successfully created.
- You can also view PagerDuty.log for specific error messages.
- Done
PagerDuty SecOps administrators Integration Experience
Example case created by the integration.
- Events will be sent and filed mapped from Superna payload to CEF PagerDuty