Skip to content

Commit 509946c

Browse files
Mariamgreysteilskedwards88myarb
authored
[Shipping April 4, 2022] Expand secret scanning webhooks to include alert locations (github#26394)
Co-authored-by: Grey Baker <[email protected]> Co-authored-by: Sarah Edwards <[email protected]> Co-authored-by: Melanie Yarbrough <[email protected]>
1 parent e9e9dd1 commit 509946c

File tree

5 files changed

+164
-1
lines changed

5 files changed

+164
-1
lines changed

Diff for: content/developers/webhooks-and-events/webhooks/webhook-events-and-payloads.md

+23
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,29 @@ Key | Type | Description
12391239
{{ webhookPayloadsForCurrentVersion.secret_scanning_alert.reopened }}
12401240
{% endif %}
12411241
1242+
{% ifversion fpt or ghes > 3.4 or ghec or ghae-issue-6581 %}
1243+
## secret_scanning_alert_location
1244+
1245+
{% data reusables.webhooks.secret_scanning_alert_location_event_short_desc %}
1246+
1247+
### Availability
1248+
1249+
- Repository webhooks
1250+
- Organization webhooks
1251+
- {% data variables.product.prodname_github_apps %} with the `secret_scanning_alerts:read` permission
1252+
1253+
### Webhook payload object
1254+
1255+
{% data reusables.webhooks.secret_scanning_alert_location_event_properties %}
1256+
{% data reusables.webhooks.repo_desc %}
1257+
{% data reusables.webhooks.org_desc %}
1258+
{% data reusables.webhooks.app_desc %}
1259+
1260+
### Webhook payload example
1261+
1262+
{{ webhookPayloadsForCurrentVersion.secret_scanning_alert_location.created }}
1263+
{% endif %}
1264+
12421265
{% ifversion fpt or ghes or ghec %}
12431266
## security_advisory
12441267
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Activity related to secret scanning alerts in a repository. The type of activity is specified in the action property of the payload object. For more information, see "[About secret scanning](/github/administering-a-repository/about-secret-scanning)."
1+
Activity related to secret scanning alerts in a repository. The type of activity is specified in the action property of the payload object. For more information, see the "[secret scanning API](rest/reference/secret-scanning)."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Key | Type | Description
2+
----|------|-------------
3+
`action` |`string` | The action that was performed. Currently, can only be `created`.
4+
`location` |`object` | The location involved in the event.
5+
`alert` |`object` | The [`secret scanning alert`](/rest/reference/secret-scanning#get-a-secret-scanning-alert) involved in the event.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Activity related to secret scanning alert locations in a repository. The type of activity is specified in the action property of the payload object. For more information, see the "[secret scanning](rest/reference/secret-scanning)" REST API.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"action": "created",
3+
"location": {
4+
"type": "commit",
5+
"details": {
6+
"path": "/example/secrets.txt",
7+
"start_line": 1,
8+
"end_line": 1,
9+
"start_column": 1,
10+
"end_column": 64,
11+
"blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b",
12+
"blob_url": "https://api.github.com/repos/octocat/hello-world/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b",
13+
"commit_sha": "f14d7debf9775f957cf4f1e8176da0786431f72b",
14+
"commit_url": "https://api.github.com/repos/octocat/hello-world/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b"
15+
}
16+
},
17+
"alert": {
18+
"number": 191,
19+
"secret_type": "adafruit_io_key",
20+
"resolution": null,
21+
"created_at": "2022-04-01T11:01:10Z",
22+
"updated_at": "2022-04-01T12:04:28Z",
23+
"resolved_by": null,
24+
"resolved_at": null
25+
},
26+
"repository": {
27+
"id": 257423561,
28+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTc0MjM1NjE=",
29+
"name": "Hello-World",
30+
"full_name": "Codertocat/Hello-World",
31+
"private": true,
32+
"owner": {
33+
"login": "Codertocat",
34+
"id": 30846345,
35+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjMwODQ2MzQ1",
36+
"avatar_url": "https://avatars0.githubusercontent.com/u/30846345?v=4",
37+
"gravatar_id": "",
38+
"url": "https://api.github.com/users/Codertocat",
39+
"html_url": "https://github.com/Codertocat",
40+
"followers_url": "https://api.github.com/users/Codertocat/followers",
41+
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
42+
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
43+
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
44+
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
45+
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
46+
"repos_url": "https://api.github.com/users/Codertocat/repos",
47+
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
48+
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
49+
"type": "Organization",
50+
"site_admin": false
51+
},
52+
"html_url": "https://github.com/Codertocat/Hello-World",
53+
"description": null,
54+
"fork": false,
55+
"url": "https://api.github.com/repos/Codertocat/Hello-World",
56+
"forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
57+
"keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
58+
"collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
59+
"teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
60+
"hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
61+
"issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
62+
"events_url": "https://api.github.com/repos/Codertocat/Hello-World/events",
63+
"assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
64+
"branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
65+
"tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
66+
"blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
67+
"git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
68+
"git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
69+
"trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
70+
"statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
71+
"languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
72+
"stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
73+
"contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
74+
"subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
75+
"subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
76+
"commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
77+
"git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
78+
"comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
79+
"issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
80+
"contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
81+
"compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
82+
"merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
83+
"archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
84+
"downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
85+
"issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
86+
"pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
87+
"milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
88+
"notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
89+
"labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
90+
"releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
91+
"deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
92+
"created_at": "2020-04-20T22:59:11Z",
93+
"updated_at": "2020-11-24T01:37:33Z",
94+
"pushed_at": "2020-11-24T01:37:31Z",
95+
"git_url": "git://github.com/Codertocat/Hello-World.git",
96+
"ssh_url": "[email protected]:Codertocat/Hello-World.git",
97+
"clone_url": "https://github.com/Codertocat/Hello-World.git",
98+
"svn_url": "https://github.com/Codertocat/Hello-World",
99+
"homepage": null,
100+
"size": 1156,
101+
"stargazers_count": 0,
102+
"watchers_count": 0,
103+
"language": "JavaScript",
104+
"has_issues": false,
105+
"has_projects": false,
106+
"has_downloads": true,
107+
"has_wiki": false,
108+
"has_pages": true,
109+
"forks_count": 0,
110+
"mirror_url": null,
111+
"archived": false,
112+
"disabled": false,
113+
"open_issues_count": 3,
114+
"license": null,
115+
"forks": 0,
116+
"open_issues": 3,
117+
"watchers": 0,
118+
"default_branch": "master"
119+
},
120+
"organization": {
121+
"login": "Codertocat",
122+
"id": 30846345,
123+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjMwODQ2MzQ1",
124+
"url": "https://api.github.com/orgs/Codertocat",
125+
"repos_url": "https://api.github.com/orgs/Codertocat/repos",
126+
"events_url": "https://api.github.com/orgs/Codertocat/events",
127+
"hooks_url": "https://api.github.com/orgs/Codertocat/hooks",
128+
"issues_url": "https://api.github.com/orgs/Codertocat/issues",
129+
"members_url": "https://api.github.com/orgs/Codertocat/members{/member}",
130+
"public_members_url": "https://api.github.com/orgs/Codertocat/public_members{/member}",
131+
"avatar_url": "https://avatars0.githubusercontent.com/u/30846345?v=4",
132+
"description": "Demos and testing of GitHub security products"
133+
}
134+
}

0 commit comments

Comments
 (0)