Skip to content

Update a code security configuration

PATCH
/orgs/{org}/code-security/configurations/{configuration_id}

Updates a code security configuration in an organization.

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 write:org scope to use this endpoint.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

configuration_id
required
integer

The unique identifier of the code security configuration.

Media type application/json
object
name

The name of the code security configuration. Must be unique within the organization.

string
description

A description of the code security configuration

string
<= 255 characters
advanced_security

The enablement status of GitHub Advanced Security features. enabled will enable both Code Security and Secret Protection features.

[!WARNING] code_security and secret_protection are deprecated values for this field. Prefer the individual code_security and secret_protection fields to set the status of these features.

string
Allowed values: enabled disabled code_security secret_protection
code_security

The enablement status of GitHub Code Security features.

string
Allowed values: enabled disabled not_set
dependency_graph

The enablement status of Dependency Graph

string
Allowed values: enabled disabled not_set
dependency_graph_autosubmit_action

The enablement status of Automatic dependency submission

string
Allowed values: enabled disabled not_set
dependency_graph_autosubmit_action_options

Feature options for Automatic dependency submission

object
labeled_runners

Whether to use runners labeled with ‘dependency-submission’ or standard GitHub runners.

boolean
dependabot_alerts

The enablement status of Dependabot alerts

string
Allowed values: enabled disabled not_set
dependabot_security_updates

The enablement status of Dependabot security updates

string
Allowed values: enabled disabled not_set
dependabot_delegated_alert_dismissal

The enablement status of Dependabot delegated alert dismissal. Requires Dependabot alerts to be enabled.

string
Allowed values: enabled disabled not_set
code_scanning_default_setup

The enablement status of code scanning default setup

string
Allowed values: enabled disabled not_set
code_scanning_default_setup_options

Feature options for code scanning default setup

object
runner_type

Whether to use labeled runners or standard GitHub runners.

string
Allowed values: standard labeled not_set
runner_label

The label of the runner to use for code scanning default setup when runner_type is ‘labeled’.

string
nullable
code_scanning_options

Security Configuration feature options for code scanning

object
allow_advanced

Whether to allow repos which use advanced setup

boolean
nullable
code_scanning_delegated_alert_dismissal

The enablement status of code scanning delegated alert dismissal

string
default: disabled
Allowed values: enabled disabled not_set
secret_protection

The enablement status of GitHub Secret Protection features.

string
Allowed values: enabled disabled not_set
secret_scanning

The enablement status of secret scanning

string
Allowed values: enabled disabled not_set
secret_scanning_push_protection

The enablement status of secret scanning push protection

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_bypass

The enablement status of secret scanning delegated bypass

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_bypass_options

Feature options for secret scanning delegated bypass

object
reviewers

The bypass reviewers for secret scanning delegated bypass

Array<object>
object
reviewer_id
required

The ID of the team or role selected as a bypass reviewer

integer
reviewer_type
required

The type of the bypass reviewer

string
Allowed values: TEAM ROLE
mode

The bypass mode for the reviewer

string
default: ALWAYS
Allowed values: ALWAYS EXEMPT
secret_scanning_validity_checks

The enablement status of secret scanning validity checks

string
Allowed values: enabled disabled not_set
secret_scanning_non_provider_patterns

The enablement status of secret scanning non-provider patterns

string
Allowed values: enabled disabled not_set
secret_scanning_generic_secrets

The enablement status of Copilot secret scanning

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_alert_dismissal

The enablement status of secret scanning delegated alert dismissal

string
Allowed values: enabled disabled not_set
secret_scanning_extended_metadata

The enablement status of secret scanning extended metadata

string
Allowed values: enabled disabled not_set
private_vulnerability_reporting

The enablement status of private vulnerability reporting

string
Allowed values: enabled disabled not_set
enforcement

The enforcement status for a security configuration

string
Allowed values: enforced unenforced
Examples
Example default

Example for updating a code security configuration

{
"name": "octo-org recommended settings v2",
"secret_scanning": "disabled",
"code_scanning_default_setup": "enabled"
}

Response when a configuration is updated

Media type application/json

A code security configuration

object
id

The ID of the code security configuration

integer
name

The name of the code security configuration. Must be unique within the organization.

string
target_type

The type of the code security configuration.

string
Allowed values: global organization enterprise
description

A description of the code security configuration

string
nullable
advanced_security

The enablement status of GitHub Advanced Security

string
Allowed values: enabled disabled code_security secret_protection
dependency_graph

The enablement status of Dependency Graph

string
Allowed values: enabled disabled not_set
dependency_graph_autosubmit_action

The enablement status of Automatic dependency submission

string
Allowed values: enabled disabled not_set
dependency_graph_autosubmit_action_options

Feature options for Automatic dependency submission

object
labeled_runners

Whether to use runners labeled with ‘dependency-submission’ or standard GitHub runners.

boolean
dependabot_alerts

The enablement status of Dependabot alerts

string
Allowed values: enabled disabled not_set
dependabot_security_updates

The enablement status of Dependabot security updates

string
Allowed values: enabled disabled not_set
dependabot_delegated_alert_dismissal

The enablement status of Dependabot delegated alert dismissal

string
nullable
Allowed values: enabled disabled not_set
code_scanning_options

Feature options for code scanning

object
allow_advanced

Whether to allow repos which use advanced setup

boolean
nullable
code_scanning_default_setup

The enablement status of code scanning default setup

string
Allowed values: enabled disabled not_set
code_scanning_default_setup_options

Feature options for code scanning default setup

object
runner_type

Whether to use labeled runners or standard GitHub runners.

string
nullable
Allowed values: standard labeled not_set
runner_label

The label of the runner to use for code scanning when runner_type is ‘labeled’.

string
nullable
code_scanning_delegated_alert_dismissal

The enablement status of code scanning delegated alert dismissal

string
Allowed values: enabled disabled not_set
secret_scanning

The enablement status of secret scanning

string
Allowed values: enabled disabled not_set
secret_scanning_push_protection

The enablement status of secret scanning push protection

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_bypass

The enablement status of secret scanning delegated bypass

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_bypass_options

Feature options for secret scanning delegated bypass

object
reviewers

The bypass reviewers for secret scanning delegated bypass

Array<object>
object
reviewer_id
required

The ID of the team or role selected as a bypass reviewer

integer
reviewer_type
required

The type of the bypass reviewer

string
Allowed values: TEAM ROLE
mode

The bypass mode for the reviewer

string
default: ALWAYS
Allowed values: ALWAYS EXEMPT
security_configuration_id

The ID of the security configuration associated with this bypass reviewer

integer
secret_scanning_validity_checks

The enablement status of secret scanning validity checks

string
Allowed values: enabled disabled not_set
secret_scanning_non_provider_patterns

The enablement status of secret scanning non-provider patterns

string
Allowed values: enabled disabled not_set
secret_scanning_generic_secrets

The enablement status of Copilot secret scanning

string
Allowed values: enabled disabled not_set
secret_scanning_delegated_alert_dismissal

The enablement status of secret scanning delegated alert dismissal

string
Allowed values: enabled disabled not_set
secret_scanning_extended_metadata

The enablement status of secret scanning extended metadata

string
Allowed values: enabled disabled not_set
private_vulnerability_reporting

The enablement status of private vulnerability reporting

string
Allowed values: enabled disabled not_set
enforcement

The enforcement status for a security configuration

string
Allowed values: enforced unenforced
url

The URL of the configuration

string format: uri
html_url

The URL of the configuration

string format: uri
created_at
string format: date-time
updated_at
string format: date-time
Examples
Example default
{
"id": 1325,
"target_type": "organization",
"name": "octo-org recommended settings v2",
"description": "This is a code security configuration for octo-org",
"advanced_security": "enabled",
"dependency_graph": "enabled",
"dependency_graph_autosubmit_action": "enabled",
"dependency_graph_autosubmit_action_options": {
"labeled_runners": false
},
"dependabot_alerts": "enabled",
"dependabot_security_updates": "not_set",
"code_scanning_default_setup": "enabled",
"code_scanning_default_setup_options": {
"runner_type": "not_set",
"runner_label": null
},
"code_scanning_options": {
"allow_advanced": false
},
"code_scanning_delegated_alert_dismissal": "disabled",
"secret_scanning": "disabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_delegated_bypass": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"secret_scanning_generic_secrets": "disabled",
"secret_scanning_delegated_alert_dismissal": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
"html_url": "https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325",
"created_at": "2024-05-01T00:00:00Z",
"updated_at": "2024-05-01T00:00:00Z"
}

Response when no new updates are made