Skip to main content

Enterprise Server 3.20 ist derzeit als Release Candidate verfügbar.

Die REST-API ist jetzt versioniert. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

REST-API-Endpunkte für den Pushschutz für die Geheimnisüberprüfung

Verwende die REST-API, um den Pushschutz für die Geheimnisüberprüfung zu verwalten.

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.

Feingranulierte Zugriffstoken für "List enterprise pattern configurations"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „List enterprise pattern configurations“

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

HTTP-Antwortstatuscodes für „List enterprise pattern configurations“

StatuscodeBESCHREIBUNG
200

OK

403

Forbidden

404

Resource not found

Codebeispiele für „List enterprise pattern configurations“

Anforderungsbeispiel

get/enterprises/{enterprise}/secret-scanning/pattern-configurations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/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.

Feingranulierte Zugriffstoken für "Update enterprise pattern configurations"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „Update enterprise pattern configurations“

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

Körperparameter
Name, Typ, BESCHREIBUNG
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.

Name, Typ, BESCHREIBUNG
token_type string

The ID of the pattern to configure.

push_protection_setting string

Push protection setting to set for the pattern.

Kann eine der folgenden sein: not-set, disabled, enabled

custom_pattern_settings array of objects

Pattern settings for custom patterns.

Name, Typ, BESCHREIBUNG
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.

Kann eine der folgenden sein: disabled, enabled

HTTP-Antwortstatuscodes für „Update enterprise pattern configurations“

StatuscodeBESCHREIBUNG
200

OK

400

Bad Request

403

Forbidden

404

Resource not found

409

Conflict

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „Update enterprise pattern configurations“

Anforderungsbeispiel

patch/enterprises/{enterprise}/secret-scanning/pattern-configurations
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/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

Status: 200
{ "pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K" }

List organization pattern configurations

Lists the secret scanning pattern configurations for an organization.

Personal access tokens (classic) need the read:org scope to use this endpoint.

Feingranulierte Zugriffstoken für "List organization pattern configurations"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.:

  • "Administration" organization permissions (read)

Parameter für „List organization pattern configurations“

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP-Antwortstatuscodes für „List organization pattern configurations“

StatuscodeBESCHREIBUNG
200

OK

403

Forbidden

404

Resource not found

Codebeispiele für „List organization pattern configurations“

Anforderungsbeispiel

get/orgs/{org}/secret-scanning/pattern-configurations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/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.

Feingranulierte Zugriffstoken für "Update organization pattern configurations"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.:

  • "Administration" organization permissions (write)

Parameter für „Update organization pattern configurations“

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Körperparameter
Name, Typ, BESCHREIBUNG
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.

Name, Typ, BESCHREIBUNG
token_type string

The ID of the pattern to configure.

push_protection_setting string

Push protection setting to set for the pattern.

Kann eine der folgenden sein: not-set, disabled, enabled

custom_pattern_settings array of objects

Pattern settings for custom patterns.

Name, Typ, BESCHREIBUNG
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.

Kann eine der folgenden sein: disabled, enabled

HTTP-Antwortstatuscodes für „Update organization pattern configurations“

StatuscodeBESCHREIBUNG
200

OK

400

Bad Request

403

Forbidden

404

Resource not found

409

Conflict

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „Update organization pattern configurations“

Anforderungsbeispiel

patch/orgs/{org}/secret-scanning/pattern-configurations
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/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

Status: 200
{ "pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K" }