비밀 검사를 위한 REST API 엔드포인트
API를 사용하여 다음을 수행할 수 있습니다.
- secret scanning 및 리포지토리에 대한 푸시 보호를 사용하거나 사용하지 않도록 설정합니다. 자세한 내용은 리포지토리에 대한 REST API 엔드포인트을(를) 참조하고 “
security_and_analysis
개체의 속성” 섹션을 확장하세요. - 리포지토리에서 비밀 검사 경고을(를) 검색하고 업데이트합니다. 자세한 내용은 아래 섹션을 참조하세요.
secret scanning에 대한 자세한 내용은 비밀 검사 정보을(를) 참조하세요.
Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo
scope or security_events
scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager, or for repositories owned by enterprise managed users.
"List secret scanning alerts for an enterprise"에 대한 세분화된 액세스 토큰
이 엔드포인트는 앱 사용자 액세스 토큰, 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"List secret scanning alerts for an enterprise"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
속성, 형식, 설명 |
---|
state stringSet to 다음 중 하나일 수 있습니다.: |
secret_type stringA comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "Supported secret scanning patterns" for a complete list of secret types. |
resolution stringA comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are |
sort stringThe property to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
direction stringThe direction to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
per_page integerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
before stringA cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after stringA cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
validity stringA comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are |
is_publicly_ booleanA boolean value representing whether or not to filter alerts by the publicly- tag being present. 기본값: |
is_multi_repo booleanA boolean value representing whether or not to filter alerts by the multi-repo tag being present. 기본값: |
hide_secret booleanA boolean value representing whether or not to hide literal secrets in the results. 기본값: |
"List secret scanning alerts for an enterprise"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Resource not found |
503 | Service unavailable |
"List secret scanning alerts for an enterprise"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/enterprises/ENTERPRISE/secret-scanning/alerts
Response
Status: 200
[ { "number": 2, "created_at": "2020-11-06T18:48:51Z", "url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2", "html_url": "https://.com/owner/private-repo/security/secret-scanning/2", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2/locations", "state": "resolved", "resolution": "false_positive", "resolved_at": "2020-11-07T02:47:13Z", "resolved_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "secret_type": "adafruit_io_key", "secret_type_display_name": "Adafruit IO Key", "secret": "aio_XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api..com/repos/octocat/Hello-World", "archive_url": "https://api..com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api..com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api..com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api..com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api..com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api..com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api..com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api..com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api..com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api..com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api..com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api..com/repos/octocat/Hello-World/downloads", "events_url": "https://api..com/repos/octocat/Hello-World/events", "forks_url": "https://api..com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api..com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api..com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api..com/repos/octocat/Hello-World/git/tags{/sha}", "issue_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api..com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api..com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api..com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api..com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api..com/repos/octocat/Hello-World/languages", "merges_url": "https://api..com/repos/octocat/Hello-World/merges", "milestones_url": "https://api..com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api..com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api..com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api..com/repos/octocat/Hello-World/releases{/id}", "stargazers_url": "https://api..com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api..com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api..com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api..com/repos/octocat/Hello-World/subscription", "tags_url": "https://api..com/repos/octocat/Hello-World/tags", "teams_url": "https://api..com/repos/octocat/Hello-World/teams", "trees_url": "https://api..com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "https://api..com/repos/octocat/Hello-World/hooks" }, "push_protection_bypassed_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "push_protection_bypassed": true, "push_protection_bypassed_at": "2020-11-06T21:48:51Z", "push_protection_bypass_request_reviewer": { "login": "octocat", "id": 3, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/3?", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": true }, "push_protection_bypass_request_reviewer_comment": "Example response", "push_protection_bypass_request_comment": "Example comment", "push_protection_bypass_request_html_url": "https://.com/owner/repo/secret_scanning_exemptions/1", "resolution_comment": "Example comment", "validity": "active", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "path": "/example/secrets.txt", "start_line": 1, "end_line": 1, "start_column": 1, "end_column": 64, "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b", "blob_url": "https://api..com/repos/octocat/hello-world/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b", "commit_sha": "f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_url": "https://api..com/repos/octocat/hello-world/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" }, "has_more_locations": true }, { "number": 1, "created_at": "2020-11-06T18:18:30Z", "url": "https://api..com/repos/owner/repo/secret-scanning/alerts/1", "html_url": "https://.com/owner/repo/security/secret-scanning/1", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/1/locations", "state": "open", "resolution": null, "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api..com/repos/octocat/Hello-World", "archive_url": "https://api..com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api..com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api..com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api..com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api..com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api..com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api..com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api..com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api..com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api..com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api..com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api..com/repos/octocat/Hello-World/downloads", "events_url": "https://api..com/repos/octocat/Hello-World/events", "forks_url": "https://api..com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api..com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api..com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api..com/repos/octocat/Hello-World/git/tags{/sha}", "issue_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api..com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api..com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api..com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api..com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api..com/repos/octocat/Hello-World/languages", "merges_url": "https://api..com/repos/octocat/Hello-World/merges", "milestones_url": "https://api..com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api..com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api..com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api..com/repos/octocat/Hello-World/releases{/id}", "stargazers_url": "https://api..com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api..com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api..com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api..com/repos/octocat/Hello-World/subscription", "tags_url": "https://api..com/repos/octocat/Hello-World/tags", "teams_url": "https://api..com/repos/octocat/Hello-World/teams", "trees_url": "https://api..com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "https://api..com/repos/octocat/Hello-World/hooks" }, "push_protection_bypassed_by": null, "push_protection_bypassed": false, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": null, "validity": "unknown", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "issue_title_url": "https://api..com/repos/octocat/Hello-World/issues/1347" }, "has_more_locations": false } ]
Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.
The authenticated user must be an administrator or security manager for the organization to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"List secret scanning alerts for an organization"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (read)
"List secret scanning alerts for an organization"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization name. The name is not case sensitive. |
속성, 형식, 설명 |
---|
state stringSet to 다음 중 하나일 수 있습니다.: |
secret_type stringA comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "Supported secret scanning patterns" for a complete list of secret types. |
resolution stringA comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are |
sort stringThe property to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
direction stringThe direction to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
page integerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
per_page integerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
before stringA cursor, as given in the Link header. If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. |
after stringA cursor, as given in the Link header. If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. |
validity stringA comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are |
is_publicly_ booleanA boolean value representing whether or not to filter alerts by the publicly- tag being present. 기본값: |
is_multi_repo booleanA boolean value representing whether or not to filter alerts by the multi-repo tag being present. 기본값: |
hide_secret booleanA boolean value representing whether or not to hide literal secrets in the results. 기본값: |
"List secret scanning alerts for an organization"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Resource not found |
503 | Service unavailable |
"List secret scanning alerts for an organization"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/orgs/ORG/secret-scanning/alerts
Response
Status: 200
[ { "number": 2, "created_at": "2020-11-06T18:48:51Z", "url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2", "html_url": "https://.com/owner/private-repo/security/secret-scanning/2", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2/locations", "state": "resolved", "resolution": "false_positive", "resolved_at": "2020-11-07T02:47:13Z", "resolved_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "secret_type": "adafruit_io_key", "secret_type_display_name": "Adafruit IO Key", "secret": "aio_XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api..com/repos/octocat/Hello-World", "archive_url": "https://api..com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api..com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api..com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api..com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api..com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api..com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api..com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api..com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api..com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api..com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api..com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api..com/repos/octocat/Hello-World/downloads", "events_url": "https://api..com/repos/octocat/Hello-World/events", "forks_url": "https://api..com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api..com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api..com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api..com/repos/octocat/Hello-World/git/tags{/sha}", "issue_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api..com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api..com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api..com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api..com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api..com/repos/octocat/Hello-World/languages", "merges_url": "https://api..com/repos/octocat/Hello-World/merges", "milestones_url": "https://api..com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api..com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api..com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api..com/repos/octocat/Hello-World/releases{/id}", "stargazers_url": "https://api..com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api..com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api..com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api..com/repos/octocat/Hello-World/subscription", "tags_url": "https://api..com/repos/octocat/Hello-World/tags", "teams_url": "https://api..com/repos/octocat/Hello-World/teams", "trees_url": "https://api..com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "https://api..com/repos/octocat/Hello-World/hooks" }, "push_protection_bypassed_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "push_protection_bypassed": true, "push_protection_bypassed_at": "2020-11-06T21:48:51Z", "push_protection_bypass_request_reviewer": { "login": "octocat", "id": 3, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/3?", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": true }, "push_protection_bypass_request_reviewer_comment": "Example response", "push_protection_bypass_request_comment": "Example comment", "push_protection_bypass_request_html_url": "https://.com/owner/repo/secret_scanning_exemptions/1", "resolution_comment": "Example comment", "validity": "active", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "path": "/example/secrets.txt", "start_line": 1, "end_line": 1, "start_column": 1, "end_column": 64, "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b", "blob_url": "https://api..com/repos/octocat/hello-world/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b", "commit_sha": "f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_url": "https://api..com/repos/octocat/hello-world/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" }, "has_more_locations": true }, { "number": 1, "created_at": "2020-11-06T18:18:30Z", "url": "https://api..com/repos/owner/repo/secret-scanning/alerts/1", "html_url": "https://.com/owner/repo/security/secret-scanning/1", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/1/locations", "state": "open", "resolution": null, "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api..com/repos/octocat/Hello-World", "archive_url": "https://api..com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api..com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api..com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api..com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api..com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api..com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api..com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api..com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api..com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api..com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api..com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api..com/repos/octocat/Hello-World/downloads", "events_url": "https://api..com/repos/octocat/Hello-World/events", "forks_url": "https://api..com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api..com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api..com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api..com/repos/octocat/Hello-World/git/tags{/sha}", "issue_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api..com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api..com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api..com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api..com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api..com/repos/octocat/Hello-World/languages", "merges_url": "https://api..com/repos/octocat/Hello-World/merges", "milestones_url": "https://api..com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api..com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api..com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api..com/repos/octocat/Hello-World/releases{/id}", "stargazers_url": "https://api..com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api..com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api..com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api..com/repos/octocat/Hello-World/subscription", "tags_url": "https://api..com/repos/octocat/Hello-World/tags", "teams_url": "https://api..com/repos/octocat/Hello-World/teams", "trees_url": "https://api..com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "https://api..com/repos/octocat/Hello-World/hooks" }, "push_protection_bypassed_by": null, "push_protection_bypassed": false, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": null, "validity": "unknown", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "issue_title_url": "https://api..com/repos/octocat/Hello-World/issues/1347" }, "has_more_locations": false } ]
Lists secret scanning alerts for an eligible repository, from newest to oldest.
The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"List secret scanning alerts for a repository"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (read)
"List secret scanning alerts for a repository"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
속성, 형식, 설명 |
---|
state stringSet to 다음 중 하나일 수 있습니다.: |
secret_type stringA comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "Supported secret scanning patterns" for a complete list of secret types. |
resolution stringA comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are |
sort stringThe property to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
direction stringThe direction to sort the results by. 기본값: 다음 중 하나일 수 있습니다.: |
page integerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
per_page integerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
before stringA cursor, as given in the Link header. If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. |
after stringA cursor, as given in the Link header. If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. |
validity stringA comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are |
is_publicly_ booleanA boolean value representing whether or not to filter alerts by the publicly- tag being present. 기본값: |
is_multi_repo booleanA boolean value representing whether or not to filter alerts by the multi-repo tag being present. 기본값: |
hide_secret booleanA boolean value representing whether or not to hide literal secrets in the results. 기본값: |
"List secret scanning alerts for a repository"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Repository is public or secret scanning is disabled for the repository |
503 | Service unavailable |
"List secret scanning alerts for a repository"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/alerts
Response
Status: 200
[ { "number": 2, "created_at": "2020-11-06T18:48:51Z", "url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2", "html_url": "https://.com/owner/private-repo/security/secret-scanning/2", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/2/locations", "state": "resolved", "resolution": "false_positive", "resolved_at": "2020-11-07T02:47:13Z", "resolved_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "secret_type": "adafruit_io_key", "secret_type_display_name": "Adafruit IO Key", "secret": "aio_XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "push_protection_bypassed_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "push_protection_bypassed": true, "push_protection_bypassed_at": "2020-11-06T21:48:51Z", "push_protection_bypass_request_reviewer": { "login": "octocat", "id": 3, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/3?", "gravatar_id": "", "url": "https://api..com/users/octocat", "html_url": "https://.com/octocat", "followers_url": "https://api..com/users/octocat/followers", "following_url": "https://api..com/users/octocat/following{/other_user}", "gists_url": "https://api..com/users/octocat/gists{/gist_id}", "starred_url": "https://api..com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/octocat/subscriptions", "organizations_url": "https://api..com/users/octocat/orgs", "repos_url": "https://api..com/users/octocat/repos", "events_url": "https://api..com/users/octocat/events{/privacy}", "received_events_url": "https://api..com/users/octocat/received_events", "type": "User", "site_admin": true }, "push_protection_bypass_request_reviewer_comment": "Example response", "push_protection_bypass_request_comment": "Example comment", "push_protection_bypass_request_html_url": "https://.com/owner/repo/secret_scanning_exemptions/1", "resolution_comment": "Example comment", "validity": "inactive", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "path": "/example/secrets.txt", "start_line": 1, "end_line": 1, "start_column": 1, "end_column": 64, "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b", "blob_url": "https://api..com/repos/octocat/hello-world/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b", "commit_sha": "f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_url": "https://api..com/repos/octocat/hello-world/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" }, "has_more_locations": true }, { "number": 1, "created_at": "2020-11-06T18:18:30Z", "url": "https://api..com/repos/owner/repo/secret-scanning/alerts/1", "html_url": "https://.com/owner/repo/security/secret-scanning/1", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/1/locations", "state": "open", "resolution": null, "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "push_protection_bypassed_by": null, "push_protection_bypassed": false, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": null, "validity": "unknown", "publicly_": false, "multi_repo": false, "is_base64_encoded": false, "first_location_detected": { "issue_title_url": "https://api..com/repos/octocat/Hello-World/issues/1347" }, "has_more_locations": false } ]
Gets a single secret scanning alert detected in an eligible repository.
The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"Get a secret scanning alert"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (read)
"Get a secret scanning alert"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
alert_number integer RequiredThe number that identifies an alert. You can find this at the end of the URL for a code scanning alert within , and in the |
속성, 형식, 설명 |
---|
hide_secret booleanA boolean value representing whether or not to hide literal secrets in the results. 기본값: |
"Get a secret scanning alert"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
304 | Not modified |
404 | Repository is public, or secret scanning is disabled for the repository, or the resource is not found |
503 | Service unavailable |
"Get a secret scanning alert"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/alerts/ALERT_NUMBER
Response
Status: 200
{ "number": 42, "created_at": "2020-11-06T18:18:30Z", "url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/42", "html_url": "https://.com/owner/private-repo/security/secret-scanning/42", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/42/locations", "state": "open", "resolution": null, "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "push_protection_bypassed_by": null, "push_protection_bypassed": false, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": null, "validity": "unknown", "publicly_": false, "multi_repo": false }
Updates the status of a secret scanning alert in an eligible repository.
The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"Update a secret scanning alert"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (write)
"Update a secret scanning alert"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
alert_number integer RequiredThe number that identifies an alert. You can find this at the end of the URL for a code scanning alert within , and in the |
속성, 형식, 설명 |
---|
state string RequiredSets the state of the secret scanning alert. You must provide 다음 중 하나일 수 있습니다.: |
resolution string or nullRequired when the 다음 중 하나일 수 있습니다.: |
resolution_comment string or nullAn optional comment when closing or reopening an alert. Cannot be updated or deleted. |
"Update a secret scanning alert"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
400 | Bad request, resolution comment is invalid or the resolution was not changed. |
404 | Repository is public, or secret scanning is disabled for the repository, or the resource is not found |
422 | State does not match the resolution or resolution comment |
503 | Service unavailable |
"Update a secret scanning alert"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -X \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/alerts/ALERT_NUMBER \ -d '{"state":"resolved","resolution":"false_positive"}'
Response
Status: 200
{ "number": 42, "created_at": "2020-11-06T18:18:30Z", "url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/42", "html_url": "https://.com/owner/private-repo/security/secret-scanning/42", "locations_url": "https://api..com/repos/owner/private-repo/secret-scanning/alerts/42/locations", "state": "resolved", "resolution": "used_in_tests", "resolved_at": "2020-11-16T22:42:07Z", "resolved_by": { "login": "monalisa", "id": 2, "node_id": "MDQ6VXNlcjI=", "avatar_url": "https://alambic..com/avatars/u/2?", "gravatar_id": "", "url": "https://api..com/users/monalisa", "html_url": "https://.com/monalisa", "followers_url": "https://api..com/users/monalisa/followers", "following_url": "https://api..com/users/monalisa/following{/other_user}", "gists_url": "https://api..com/users/monalisa/gists{/gist_id}", "starred_url": "https://api..com/users/monalisa/starred{/owner}{/repo}", "subscriptions_url": "https://api..com/users/monalisa/subscriptions", "organizations_url": "https://api..com/users/monalisa/orgs", "repos_url": "https://api..com/users/monalisa/repos", "events_url": "https://api..com/users/monalisa/events{/privacy}", "received_events_url": "https://api..com/users/monalisa/received_events", "type": "User", "site_admin": true }, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "push_protection_bypassed": false, "push_protection_bypassed_by": null, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": "Example comment", "validity": "unknown", "publicly_": false, "multi_repo": false }
Lists all locations for a given secret scanning alert for an eligible repository.
The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"List locations for a secret scanning alert"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (read)
"List locations for a secret scanning alert"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
alert_number integer RequiredThe number that identifies an alert. You can find this at the end of the URL for a code scanning alert within , and in the |
속성, 형식, 설명 |
---|
page integerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
per_page integerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
"List locations for a secret scanning alert"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Repository is public, or secret scanning is disabled for the repository, or the resource is not found |
503 | Service unavailable |
"List locations for a secret scanning alert"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/alerts/ALERT_NUMBER/locations
Response
Status: 200
[ { "type": "commit", "details": { "path": "/example/secrets.txt", "start_line": 1, "end_line": 1, "start_column": 1, "end_column": 64, "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b", "blob_url": "https://api..com/repos/octocat/hello-world/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b", "commit_sha": "f14d7debf9775f957cf4f1e8176da0786431f72b", "commit_url": "https://api..com/repos/octocat/hello-world/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b" } }, { "type": "wiki_commit", "details": { "path": "/example/Home.md", "start_line": 1, "end_line": 1, "start_column": 1, "end_column": 64, "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b", "page_url": "https://.com/octocat/Hello-World/wiki/Home/302c0b7e200761c9dd9b57e57db540ee0b4293a5", "commit_sha": "302c0b7e200761c9dd9b57e57db540ee0b4293a5", "commit_url": "https://.com/octocat/Hello-World/wiki/_compare/302c0b7e200761c9dd9b57e57db540ee0b4293a5" } }, { "type": "issue_title", "details": { "issue_title_url": "https://api..com/repos/octocat/Hello-World/issues/1347" } }, { "type": "issue_body", "details": { "issue_body_url": "https://api..com/repos/octocat/Hello-World/issues/1347" } }, { "type": "issue_comment", "details": { "issue_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments/1081119451" } }, { "type": "discussion_title", "details": { "discussion_title_url": "https://.com/community/community/discussions/39082" } }, { "type": "discussion_body", "details": { "discussion_body_url": "https://.com/community/community/discussions/39082#discussion-4566270" } }, { "type": "discussion_comment", "details": { "discussion_comment_url": "https://.com/community/community/discussions/39082#discussioncomment-4158232" } }, { "type": "pull_request_title", "details": { "pull_request_title_url": "https://api..com/repos/octocat/Hello-World/pulls/2846" } }, { "type": "pull_request_body", "details": { "pull_request_body_url": "https://api..com/repos/octocat/Hello-World/pulls/2846" } }, { "type": "pull_request_comment", "details": { "pull_request_comment_url": "https://api..com/repos/octocat/Hello-World/issues/comments/1825855898" } }, { "type": "pull_request_review", "details": { "pull_request_review_url": "https://api..com/repos/octocat/Hello-World/pulls/2846/reviews/80" } }, { "type": "pull_request_review_comment", "details": { "pull_request_review_comment_url": "https://api..com/repos/octocat/Hello-World/pulls/comments/12" } } ]
Creates a bypass for a previously push protected secret.
The authenticated user must be the original author of the committed secret.
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
"Create a push protection bypass"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Contents" repository permissions (write)
"Create a push protection bypass"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
속성, 형식, 설명 |
---|
reason string RequiredThe reason for bypassing push protection. 다음 중 하나일 수 있습니다.: |
placeholder_id string RequiredThe ID of the push protection bypass placeholder. This value is returned on any push protected routes. |
"Create a push protection bypass"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
403 | User does not have enough permissions to perform this action. |
404 | Placeholder ID not found, or push protection is disabled on this repository. |
422 | Bad request, input data missing or incorrect. |
503 | Service unavailable |
"Create a push protection bypass"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -X POST \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/push-protection-bypasses \ -d '{"reason":"will_fix_later","placeholder_id":"2k4dM4tseyC5lPIsjl5emX9sPNk"}'
Response
Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included.
OAuth app tokens and personal access tokens (classic) need the repo
or security_events
scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo
scope instead.
"Get secret scanning scan history for a repository"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Secret scanning alerts" repository permissions (read)
"Get secret scanning scan history for a repository"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept stringSetting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
"Get secret scanning scan history for a repository"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Repository does not have Advanced Security or secret scanning enabled |
503 | Service unavailable |
"Get secret scanning scan history for a repository"에 대한 코드 샘플
GHE.com에서 에 액세스하는 경우 api..com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \ -H "Accept: application/vnd.+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X--Api-Version: 2022-11-28" \ https://api..com/repos/OWNER/REPO/secret-scanning/scan-history
Response
Status: 200
{ "incremental_scans": [ { "type": "git", "status": "completed", "completed_at": "2024-10-07T02:47:00Z" } ], "backfill_scans": [ { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:50:00Z" }, { "type": "issue", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:49:00Z" }, { "type": "discussion", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:48:00Z" } ], "pattern_update_scans": [ { "type": "discussion", "status": "in_progress", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:51:00Z" } ], "custom_pattern_backfill_scans": [ { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:55:00Z", "pattern_slug": "my-custom-pattern", "pattern_scope": "enterprise" }, { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:55:00Z", "pattern_slug": "my-custom-pattern", "pattern_scope": "organization" } ] }