비밀 검사 푸시 보호를 위한 REST API 엔드포인트
REST API를 사용하여 비밀 검사 푸시 보호를 관리합니다.
List enterprise pattern configurations
Lists the secret scanning pattern configurations for an enterprise.
Personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
"List enterprise pattern configurations"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"List enterprise pattern configurations"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"List enterprise pattern configurations"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"List enterprise pattern configurations"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/secret-scanning/pattern-configurations
Response
Status: 200
{
"pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
"provider_pattern_overrides": [
{
"token_type": "GITHUB_PERSONAL_ACCESS_TOKEN",
"slug": "github_personal_access_token_legacy_v2",
"display_name": "GitHub Personal Access Token (Legacy v2)",
"alert_total": 15,
"alert_total_percentage": 36,
"false_positives": 2,
"false_positive_rate": 13,
"bypass_rate": 13,
"default_setting": "enabled",
"setting": "enabled",
"enterprise_setting": "enabled"
}
],
"custom_pattern_overrides": [
{
"token_type": "cp_2",
"custom_pattern_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
"slug": "custom-api-key",
"display_name": "Custom API Key",
"alert_total": 15,
"alert_total_percentage": 36,
"false_positives": 3,
"false_positive_rate": 20,
"bypass_rate": 20,
"default_setting": "disabled",
"setting": "enabled"
}
]
}
Update enterprise pattern configurations
Updates the secret scanning pattern configurations for an enterprise.
Personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
"Update enterprise pattern configurations"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Update enterprise pattern configurations"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
속성, 형식, 설명 | ||||
---|---|---|---|---|
pattern_config_version string or null The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. | ||||
provider_pattern_settings array of objects Pattern settings for provider patterns. | ||||
Properties of |
속성, 형식, 설명 |
---|
token_type string The ID of the pattern to configure. |
push_protection_setting string Push protection setting to set for the pattern. 다음 중 하나일 수 있습니다.: |
custom_pattern_settings
array of objects Pattern settings for custom patterns.
Properties of custom_pattern_settings
속성, 형식, 설명 |
---|
token_type string The ID of the pattern to configure. |
custom_pattern_version string or null The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. |
push_protection_setting string Push protection setting to set for the pattern. 다음 중 하나일 수 있습니다.: |
"Update enterprise pattern configurations"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
400 | Bad Request |
403 | Forbidden |
404 | Resource not found |
409 | Conflict |
422 | Validation failed, or the endpoint has been spammed. |
"Update enterprise pattern configurations"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/secret-scanning/pattern-configurations \
-d '{"pattern_config_version":"0ujsswThIGTUYm2K8FjOOfXtY1K","provider_pattern_settings":[{"token_type":"GITHUB_PERSONAL_ACCESS_TOKEN","push_protection_setting":"enabled"}],"custom_pattern_settings":[{"token_type":"cp_2","custom_pattern_version":"0ujsswThIGTUYm2K8FjOOfXtY1K","push_protection_setting":"enabled"}]}'
Response
List organization pattern configurations
Lists the secret scanning pattern configurations for an organization.
Personal access tokens (classic) need the write:org
scope to use this endpoint.
"List organization pattern configurations"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" organization permissions (write)
"List organization pattern configurations"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization name. The name is not case sensitive. |
"List organization pattern configurations"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"List organization pattern configurations"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/secret-scanning/pattern-configurations
Response
Status: 200
{
"pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
"provider_pattern_overrides": [
{
"token_type": "GITHUB_PERSONAL_ACCESS_TOKEN",
"slug": "github_personal_access_token_legacy_v2",
"display_name": "GitHub Personal Access Token (Legacy v2)",
"alert_total": 15,
"alert_total_percentage": 36,
"false_positives": 2,
"false_positive_rate": 13,
"bypass_rate": 13,
"default_setting": "enabled",
"setting": "enabled",
"enterprise_setting": "enabled"
}
],
"custom_pattern_overrides": [
{
"token_type": "cp_2",
"custom_pattern_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
"slug": "custom-api-key",
"display_name": "Custom API Key",
"alert_total": 15,
"alert_total_percentage": 36,
"false_positives": 3,
"false_positive_rate": 20,
"bypass_rate": 20,
"default_setting": "disabled",
"setting": "enabled"
}
]
}
Update organization pattern configurations
Updates the secret scanning pattern configurations for an organization.
Personal access tokens (classic) need the write:org
scope to use this endpoint.
"Update organization pattern configurations"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Administration" organization permissions (write)
"Update organization pattern configurations"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization name. The name is not case sensitive. |
속성, 형식, 설명 | ||||
---|---|---|---|---|
pattern_config_version string or null The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. | ||||
provider_pattern_settings array of objects Pattern settings for provider patterns. | ||||
Properties of |
속성, 형식, 설명 |
---|
token_type string The ID of the pattern to configure. |
push_protection_setting string Push protection setting to set for the pattern. 다음 중 하나일 수 있습니다.: |
custom_pattern_settings
array of objects Pattern settings for custom patterns.
Properties of custom_pattern_settings
속성, 형식, 설명 |
---|
token_type string The ID of the pattern to configure. |
custom_pattern_version string or null The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. |
push_protection_setting string Push protection setting to set for the pattern. 다음 중 하나일 수 있습니다.: |
"Update organization pattern configurations"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
400 | Bad Request |
403 | Forbidden |
404 | Resource not found |
409 | Conflict |
422 | Validation failed, or the endpoint has been spammed. |
"Update organization pattern configurations"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/secret-scanning/pattern-configurations \
-d '{"pattern_config_version":"0ujsswThIGTUYm2K8FjOOfXtY1K","provider_pattern_settings":[{"token_type":"GITHUB_PERSONAL_ACCESS_TOKEN","push_protection_setting":"enabled"}],"custom_pattern_settings":[{"token_type":"cp_2","custom_pattern_version":"0ujsswThIGTUYm2K8FjOOfXtY1K","push_protection_setting":"enabled"}]}'
Response