Set-GitHubCodeSecurityEnterpriseConfiguration

SYNOPSIS

Update a custom code security configuration for an enterprise

SYNTAX

__AllParameterSets

Set-GitHubCodeSecurityEnterpriseConfiguration [-Enterprise] <string> [-ConfigurationId] <long>
 [-Name <string>] [-Description <string>] [-AdvancedSecurity <string>] [-CodeSecurity <string>]
 [-DependencyGraph <string>] [-DependencyGraphAutosubmitAction <string>]
 [-DependencyGraphAutosubmitActionOptions <Object>] [-DependabotAlerts <string>]
 [-DependabotReachability <string>] [-DependabotSecurityUpdates <string>]
 [-CodeScanningDefaultSetup <string>] [-CodeScanningDefaultSetupOptions <Object>]
 [-CodeScanningOptions <Object>] [-CodeScanningDelegatedAlertDismissal <string>]
 [-SecretProtection <string>] [-SecretScanning <string>] [-SecretScanningPushProtection <string>]
 [-SecretScanningValidityChecks <string>] [-SecretScanningNonProviderPatterns <string>]
 [-SecretScanningGenericSecrets <string>] [-SecretScanningGenericSecretsPushProtection <string>]
 [-SecretScanningDelegatedAlertDismissal <string>] [-SecretScanningExtendedMetadata <string>]
 [-PrivateVulnerabilityReporting <string>] [-Enforcement <string>] [-Body <Object>]
 [-Accept <string>] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHSetCodeSecurityEnterpriseConfiguration

DESCRIPTION

The Set-GitHubCodeSecurityEnterpriseConfiguration cmdlet invokes the PATCH method of the /enterprises/{enterprise}/code-security/configurations/{configuration_id} endpoint (Update a custom code security configuration for an enterprise)

Updates a code security configuration in an 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 ‘admin:enterprise’ scope to use this endpoint.

Endpoint: PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} API version: 2026-03-10

EXAMPLES

EXAMPLE 1

' -ConfigurationId 1

Invokes PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}

EXAMPLE 2

' -ConfigurationId 1 -Body @{ name = 'octo-enterprise recommended settings v2' }

Sends the request body from a hashtable, parameters override the keys of -Body

PARAMETERS

-Accept

The Accept header (media type) of the request Default value: application/vnd.github+json

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AdvancedSecurity

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.

Body property [ advanced_security ]

Allowed values: ‘enabled’, ‘disabled’, ‘code_security’, ‘secret_protection’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Body

The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CodeScanningDefaultSetup

The enablement status of code scanning default setup

Body property [ code_scanning_default_setup ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CodeScanningDefaultSetupOptions

Feature options for code scanning default setup

Body property [ code_scanning_default_setup_options ]

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CodeScanningDelegatedAlertDismissal

The enablement status of code scanning delegated alert dismissal

Body property [ code_scanning_delegated_alert_dismissal ]

Default value: disabled

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CodeScanningOptions

Security Configuration feature options for code scanning

Body property [ code_scanning_options ]

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CodeSecurity

The enablement status of GitHub Code Security features.

Body property [ code_security ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ConfigurationId

The unique identifier of the code security configuration.

Path parameter [ configuration_id ]

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependabotAlerts

The enablement status of Dependabot alerts

Body property [ dependabot_alerts ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependabotReachability

The enablement status of reachability analysis for Dependabot. Only available for enterprises with access to reachability analysis. Requires Dependabot alerts to be enabled when set to ‘enabled’. Must be ‘disabled’ when Dependabot alerts is ‘disabled’. ‘not_set’ leaves existing repository settings unchanged. Omit this field to preserve the configuration’s current value.

Body property [ dependabot_reachability ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependabotSecurityUpdates

The enablement status of Dependabot security updates

Body property [ dependabot_security_updates ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependencyGraph

The enablement status of Dependency Graph

Body property [ dependency_graph ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependencyGraphAutosubmitAction

The enablement status of Automatic dependency submission

Body property [ dependency_graph_autosubmit_action ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DependencyGraphAutosubmitActionOptions

Feature options for Automatic dependency submission

Body property [ dependency_graph_autosubmit_action_options ]

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Description

A description of the code security configuration

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Enforcement

The enforcement status for a security configuration

Allowed values: ‘enforced’, ‘unenforced’, ‘enterprise_enforced’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Enterprise

The slug version of the enterprise name.

Path parameter [ enterprise ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

The name of the code security configuration. Must be unique across the enterprise.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PrivateVulnerabilityReporting

The enablement status of private vulnerability reporting

Body property [ private_vulnerability_reporting ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretProtection

The enablement status of GitHub Secret Protection features.

Body property [ secret_protection ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanning

The enablement status of secret scanning

Body property [ secret_scanning ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningDelegatedAlertDismissal

The enablement status of secret scanning delegated alert dismissal

Body property [ secret_scanning_delegated_alert_dismissal ]

Default value: disabled

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningExtendedMetadata

The enablement status of secret scanning extended metadata

Body property [ secret_scanning_extended_metadata ]

Default value: disabled

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningGenericSecrets

The enablement status of Copilot secret scanning

Body property [ secret_scanning_generic_secrets ]

Default value: disabled

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningGenericSecretsPushProtection

The enablement status of generic secrets push protection

Body property [ secret_scanning_generic_secrets_push_protection ]

Default value: disabled

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningNonProviderPatterns

The enablement status of secret scanning non-provider patterns

Body property [ secret_scanning_non_provider_patterns ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningPushProtection

The enablement status of secret scanning push protection

Body property [ secret_scanning_push_protection ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretScanningValidityChecks

The enablement status of secret scanning validity checks

Body property [ secret_scanning_validity_checks ]

Allowed values: ‘enabled’, ‘disabled’, ‘not_set’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Objects with properties named like the path parameters can be piped to this function

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

System.Int64

{{ Fill in the Description }}

OUTPUTS

The response of the GitHub API (objects

{{ Fill in the Description }}

NOTES

OperationId: code-security/update-enterprise-configuration Category: code-security / configurations Not enabled for GitHub Apps