8000 Merge pull request #177 from Hacker0x01/martijnrusschen-patch-12 · csit-github/docs.hackerone.com@9fda469 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fda469

Browse files
authored
Merge pull request Hacker0x01#177 from Hacker0x01/martijnrusschen-patch-12
Make changes on the PagerDuty integration
2 parents 43387dc + bb8834d commit 9fda469

File tree

1 file changed

+13
-54
lines changed

1 file changed

+13
-54
lines changed

docs/programs/pagerduty-integration.md

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,18 @@ 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*.
20-
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.
65-
9. Log in to your account on hackerone.com.
66-
10. Navigate to your webhooks settings on **Program Settings > Program > Webhooks**.
67-
11. Click **New Webhook**.
68-
12. Paste the URL that was copied from the Pagerduty integration page in step 8.
69-
13. Select **Report created** and **Report triaged** as the events you want to trigger the webhook on.
70-
14. *(Optional)* Select any other events you want to trigger the webhook on.
71-
15. Click **Add webhook** to save the webhook.
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*.
20+
4. Click **Add Service**.
21+
5. Go to the **Integrations** tab on the **Services** page.
22+
6. Click the settings gear next to the integration and select **View**.
23+
7. Copy the **Integration URL** and store that for later.
24+
8. Log in to your account on hackerone.com.
25+
9. Navigate to your webhooks settings on **Program Settings > Program > Webhooks**.
26+
10. Click **New Webhook**.
27+
11. Paste the URL that was copied from the Pagerduty integration page in step 7.
28+
12. Select **Report created** and **Report triaged** as the events you want to trigger the webhook on.
29+
13. *(Optional)* Select any other events you want to trigger the webhook on.
30+
14. Click **Add webhook** to save the webhook.
7231

7332
Each new and triaged report that has a high or critical severity will now create an incident on PagerDuty and page the appropriate teams based on your PagerDuty policies. You can tailor the configuration of your integration for different use cases by adjusting the events in step 13.

0 commit comments

Comments
 (0)
0