Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 157008b

Browse files
Make changes on the PagerDuty integration
Based on the new PD functionality, updating the guidelines on how to set this up.
1 parent 0f94ae3 commit 157008b

File tree

1 file changed

+5
-47
lines changed

1 file changed

+5
-47
lines changed

docs/programs/pagerduty-integration.md

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,15 @@ The PagerDuty integration enables incidents to be created each time a new (high
1515
To set up the integration between PagerDuty and each time a high or critical report is created on HackerOne:
1616

1717
1. Navigate to **Configuration > Services** on PagerDuty.
18-
2. [Create a new service](https://support.pagerduty.com/docs/services-and-integrations#section-events-api-v2) or add an integration to an existing service on PagerDuty by clicking **+Add New Services** on your services page.
19-
3. Select **Custom Event Transformer** for the *Integration Type*.
18+
2. Click on **New Service** or add an integration to an existing service on PagerDuty by clicking **+Add New Services** on your services page.
19+
3. Select **HackerOne** for the *Integration Type* and click on **Add Service**.
2020
4. Go to the **Integrations** tab on the **Services** page.
21-
5. Click the settings gear next to the integration and select **Edit**.
22-
6. Edit the code that gets executed when the integration gets triggered by pasting the code below
23-
24-
```
25-
var webhook = PD.inputRequest;
26-
var event_type = PD.Trigger;
27-
var severity = webhook.body.data.report.relationships.severity;
28-
var severity_rating = severity ? severity.data.attributes.rating : null;
29-
30-
if (severity_rating == "high" || severity_rating == "critical") {
31-
var normalized_event = {
32-
event_type: event_type,
33-
incident_key: webhook.body.data.report.id,
34-
client: 'HackerOne',
35-
client_url: 'https://hackerone.com/reports/' + webhook.body.data.report.id,
36-
description: 'A ' + severity_rating + ' vulnerability was reported to HackerOne!',
37-
details: 'The ' + severity_rating + ' report title is ' + webhook.body.data.report.attributes.title
38-
};
39-
40-
PD.emitGenericEvents([normalized_event]);
41-
}
42-
```
43-
44-
If you want to be notified for all reports that get created or triaged (regardless of severity) you can use the following code instead:
45-
46-
```
47-
var webhook = PD.inputRequest;
48-
var event_type = PD.Trigger;
49-
var severity = webhook.body.data.report.relationships.severity;
50-
var severity_rating = severity ? severity.data.attributes.rating : null;
51-
52-
var normalized_event = {
53-
event_type: event_type,
54-
incident_key: webhook.body.data.report.id,
55-
client: 'HackerOne',
56-
client_url: 'https://hackerone.com/reports/' + webhook.body.data.report.id,
57-
description: 'A ' + severity_rating + ' vulnerability was reported to HackerOne!',
58-
details: 'The ' + severity_rating + ' report title is ' + webhook.body.data.report.attributes.title
59-
};
60-
61-
PD.emitGenericEvents([normalized_event]);
62-
```
63-
7. Click **Save Changes**. You’ll be redirected to the *View* page of the integration.
64-
8. Copy the *Integration URL* on the view page.
21+
5. Click the settings gear next to the integration and select **View**.
22+
6. Copy the **Integration URL** and store that for later.
6523
9. Log in to your account on hackerone.com.
6624
10. Navigate to your webhooks settings on **Program Settings > Program > Webhooks**.
6725
11. Click **New Webhook**.
68-
12. Paste the URL that was copied from the Pagerduty integration page in step 8.
26+
12. Paste the URL that was copied from the Pagerduty integration page in step 6.
6927
13. Select **Report created** and **Report triaged** as the events you want to trigger the webhook on.
7028
14. *(Optional)* Select any other events you want to trigger the webhook on.
7129
15. Click **Add webhook** to save the webhook.

0 commit comments

Comments
 (0)