엔터프라이즈 코드 보안 및 분석을 위한 REST API 엔드포인트
REST API를 사용하여 엔터프라이즈의 코드 보안 및 분석 기능을 관리합니다.
이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 "개인용 액세스 토큰 관리"을(를) 참조하세요.
Get code security and analysis features for an enterprise
Warning
Closing down notice: The ability to fetch code security and analysis settings for an enterprise is closing down. Please use code security configurations instead. For more information, see the changelog.
Gets code security and analysis settings for the specified enterprise.
The authenticated user must be an administrator of the enterprise in order to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the read:enterprise
scope to use this endpoint.
"Get code security and analysis features for an enterprise"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get code security and analysis features for an enterprise"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"Get code security and analysis features for an enterprise"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
404 | Resource not found |
"Get code security and analysis features for an enterprise"에 대한 코드 샘플
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/code_security_and_analysis
Response
Status: 200
{
"advanced_security_enabled_for_new_repositories": true,
"dependabot_alerts_enabled_for_new_repositories": true,
"secret_scanning_enabled_for_new_repositories": true,
"secret_scanning_push_protection_enabled_for_new_repositories": true,
"secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md",
"secret_scanning_non_provider_patterns_enabled_for_new_repositories": true,
"secret_scanning_validity_checks_enabled": true
}
Update code security and analysis features for an enterprise
Warning
Closing down notice: The ability to update code security and analysis settings for an enterprise is closing down. Please use code security configurations instead. For more information, see the changelog.
Updates the settings for advanced security, Dependabot alerts, secret scanning, and push protection for new repositories in an enterprise.
The authenticated user must be an administrator of the enterprise to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
"Update code security and analysis features for an enterprise"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Update code security and analysis features for an enterprise"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
속성, 형식, 설명 |
---|
advanced_security_enabled_for_new_repositories boolean Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see "About GitHub Advanced Security." |
advanced_security_enabled_new_user_namespace_repos boolean Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. For more information, see "About GitHub Advanced Security." |
dependabot_alerts_enabled_for_new_repositories boolean Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "About Dependabot alerts." |
secret_scanning_enabled_for_new_repositories boolean Whether secret scanning is automatically enabled for new repositories. For more information, see "About secret scanning." |
secret_scanning_push_protection_enabled_for_new_repositories boolean Whether secret scanning push protection is automatically enabled for new repositories. For more information, see "Protecting pushes with secret scanning." |
secret_scanning_push_protection_custom_link string or null The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see "Protecting pushes with secret scanning."
To disable this functionality, set this field to |
secret_scanning_non_provider_patterns_enabled_for_new_repositories boolean or null Whether secret scanning of non-provider patterns is enabled for new repositories under this enterprise. |
"Update code security and analysis features for an enterprise"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
204 | Action started |
404 | Resource not found |
422 | The action could not be taken due to an in progress enablement, or a policy is preventing enablement |
"Update code security and analysis features for an enterprise"에 대한 코드 샘플
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/code_security_and_analysis \
-d '{"advanced_security_enabled_for_new_repositories":true,"advanced_security_enabled_new_user_namespace_repos":true,"dependabot_alerts_enabled_for_new_repositories":true,"secret_scanning_enabled_for_new_repositories":true,"secret_scanning_push_protection_enabled_for_new_repositories":true,"secret_scanning_push_protection_custom_link":"https://github.com/test-org/test-repo/blob/main/README.md","secret_scanning_non_provider_patterns_enabled_for_new_repositories":true}'
Action started
Status: 204
Enable or disable a security feature
Warning
Closing down notice: The ability to enable or disable a security feature for an enterprise is closing down. Please use code security configurations instead. For more information, see the changelog.
Enables or disables the specified security feature for all repositories in an enterprise.
The authenticated user must be an administrator of the enterprise to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
"Enable or disable a security feature"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Enable or disable a security feature"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
security_product string RequiredThe security feature to enable or disable. 다음 중 하나일 수 있습니다.: |
enablement string RequiredThe action to take.
다음 중 하나일 수 있습니다.: |
"Enable or disable a security feature"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
204 | Action started |
404 | Resource not found |
422 | The action could not be taken due to an in progress enablement, or a policy is preventing enablement |
"Enable or disable a security feature"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-X POST \
-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/SECURITY_PRODUCT/ENABLEMENT
Action started
Status: 204