How the attack works
GitHub checks the code of a repository in several ways. Code scanning analyzes the code for security vulnerabilities and errors and shows an alert for each finding. The dependency graph lists the packages a repository depends on, Dependabot alerts report dependencies with known vulnerabilities, Dependabot security updates open pull requests that fix them, and dependency review shows vulnerable versions before a pull request is merged. Code scanning and dependency review for private repositories belong to GitHub Code Security, one of the Advanced Security products. Each feature can be switched for one repository, for all or for new repositories of an organization and for an enterprise, or through a security configuration that applies a set of features to many repositories.
An attacker who wants to change code or add a dependency without an alert turns these checks off first. GitHub states that when Secret Protection and Code Security are disabled for a repository, dependency review, secret scanning alerts for users and code scanning are disabled, and that workflows, uploads and API calls for code scanning then fail. Dependabot alerts depend on the dependency graph, so disabling the graph silences them as well. Deleting a code scanning configuration has a quieter effect: alerts are closed as outdated once all configurations they were detected in are deleted. GitHub records each of these changes with its own audit log action, for example repo.codeql_disabled, repo.advanced_security_disabled, repository_vulnerability_alerts.disable, dependabot_alerts.disable and security_configuration.update. Secret scanning and push protection have their own page.
What an attacker needs
- Admin access to a repository for its security and analysis settings.
- An organization owner, a security manager or an organization member with the admin role for the organization settings and for security configurations.
- An enterprise owner for the enterprise settings.
- No enforced security configuration on the repository, where the change is made at repository level.
Impact
New vulnerabilities in the code and vulnerable or malicious dependencies are no longer reported in the affected repositories, and pull requests are merged without the checks that would have flagged them. Open alerts can disappear from view when the feature or its configuration is removed. At organization or enterprise level one change takes the checks away from every repository, and the gap lasts until someone compares the settings with what they should be.
Detection rules
GitHub Advanced Security or Code Security Disabled
Detects GitHub Advanced Security or Code Security being disabled for a repository, for all or for new repositories of an organization, or for an enterprise. GitHub states that when Secret Protection and Code Security are disabled for a repository, dependency review, secret scanning alerts for users and code scanning are disabled, and that workflows, uploads and API calls for code scanning fail. The scope is in the action name: repo. and repository_code_security. concern one repository, org. the organization and business_advanced_security. the enterprise.
title: GitHub Advanced Security or Code Security Disabled
id: 18e868c4-9c34-4efd-94f4-1ed299649909
status: experimental
description: >-
Detects GitHub Advanced Security or Code Security being disabled for a
repository, for all or for new repositories of an organization, or for an
enterprise. GitHub states that when Secret Protection and Code Security
are disabled for a repository, dependency review, secret scanning alerts
for users and code scanning are disabled, and that workflows, uploads and
API calls for code scanning fail. The scope is in the action name: repo.
and repository_code_security. concern one repository, org. the
organization and business_advanced_security. the enterprise.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- repo.advanced_security_disabled
- repository_code_security.disable
- org.advanced_security_disabled_on_all_repos
- org.advanced_security_disabled_for_new_repos
- business_advanced_security.disabled
- business_advanced_security.disabled_for_new_repos
- business_advanced_security.user_namespace_repos_disabled
- business_advanced_security.disabled_for_new_user_namespace_repos
condition: selection
falsepositives:
- A licence decision that removes the product from repositories that do not need it, and the retirement of a repository. Confirm the decision with the security team, and treat an organization or enterprise wide change without one as urgent.
level: medium
False positives
- A licence decision that removes the product from repositories that do not need it, and the retirement of a repository. Confirm the decision with the security team, and treat an organization or enterprise wide change without one as urgent.
GitHub Code Scanning Analysis or Configuration Deleted
Detects the deletion of code scanning results. repo.code_scanning_analysis_deleted is written when a code scanning analysis for a repository is deleted and repo.code_scanning_configuration_for_branch_deleted when a code scanning configuration for a branch is deleted. GitHub closes alerts as outdated once all configurations they were detected in are deleted, so deleting configurations is a way to make open alerts disappear without fixing or dismissing them. The events name the scanner in tool and its category in category, and the second one the branch in branch.
title: GitHub Code Scanning Analysis or Configuration Deleted
id: 6add83a8-e7a7-4b31-9b25-2e9e048347d4
status: experimental
description: >-
Detects the deletion of code scanning results.
repo.code_scanning_analysis_deleted is written when a code scanning
analysis for a repository is deleted and
repo.code_scanning_configuration_for_branch_deleted when a code scanning
configuration for a branch is deleted. GitHub closes alerts as outdated
once all configurations they were detected in are deleted, so deleting
configurations is a way to make open alerts disappear without fixing or
dismissing them. The events name the scanner in tool and its category in
category, and the second one the branch in branch.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/resolve-alerts
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- repo.code_scanning_analysis_deleted
- repo.code_scanning_configuration_for_branch_deleted
condition: selection
falsepositives:
- Maintainers who remove a stale configuration after a scanner or a language was dropped, which GitHub documents as normal cleanup. Check whether alerts were closed as outdated afterwards and whether the code they pointed to was fixed.
level: low
False positives
- Maintainers who remove a stale configuration after a scanner or a language was dropped, which GitHub documents as normal cleanup. Check whether alerts were closed as outdated afterwards and whether the code they pointed to was fixed.
GitHub Code Scanning Default Setup Disabled
Detects code scanning with the default setup being disabled. repo.codeql_disabled is written when code scanning using the default setup is disabled for a repository and org.codeql_disabled when it is disabled for an organization. After the change the code of the affected repositories is no longer analyzed by the default CodeQL configuration, so a vulnerability introduced afterwards raises no alert. The organization action removes the analysis from many repositories in one step.
title: GitHub Code Scanning Default Setup Disabled
id: ff54f970-f584-4734-b402-1297ab11d57e
status: experimental
description: >-
Detects code scanning with the default setup being disabled.
repo.codeql_disabled is written when code scanning using the default
setup is disabled for a repository and org.codeql_disabled when it is
disabled for an organization. After the change the code of the affected
repositories is no longer analyzed by the default CodeQL configuration,
so a vulnerability introduced afterwards raises no alert. The organization
action removes the analysis from many repositories in one step.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/code-scanning/code-scanning
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- repo.codeql_disabled
- org.codeql_disabled
condition: selection
falsepositives:
- A repository that moves from the default setup to an advanced setup or to another scanner, and a repository that is retired. Confirm that another analysis replaces the one that was switched off.
level: medium
False positives
- A repository that moves from the default setup to an advanced setup or to another scanner, and a repository that is retired. Confirm that another analysis replaces the one that was switched off.
GitHub Dependabot Alerts, Security Updates or Dependency Graph Disabled
Detects the features that report vulnerable dependencies being switched off: Dependabot alerts for a repository (repository_vulnerability_alerts.disable), for all existing or new repositories of an organization (dependabot_alerts.disable, dependabot_alerts_new_repos.disable) and for an enterprise (business_dependabot_alerts.disable and its new_repos action), Dependabot malware alerts, Dependabot security updates, and the dependency graph. GitHub states that Dependabot alerts require the dependency graph, so disabling the graph stops the alerts as well. Afterwards a vulnerable or malicious dependency that is added to the repository is not reported.
title: GitHub Dependabot Alerts, Security Updates or Dependency Graph Disabled
id: 55d6bc7f-4e3e-429b-b2f6-f604edd5a521
status: experimental
description: >-
Detects the features that report vulnerable dependencies being switched
off: Dependabot alerts for a repository
(repository_vulnerability_alerts.disable), for all existing or new
repositories of an organization (dependabot_alerts.disable,
dependabot_alerts_new_repos.disable) and for an enterprise
(business_dependabot_alerts.disable and its new_repos action), Dependabot
malware alerts, Dependabot security updates, and the dependency graph.
GitHub states that Dependabot alerts require the dependency graph, so
disabling the graph stops the alerts as well. Afterwards a vulnerable or
malicious dependency that is added to the repository is not reported.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/supply-chain-security/dependabot-alerts
- https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- repository_vulnerability_alerts.disable
- repository_malware_alerts.disable
- dependabot_alerts.disable
- dependabot_alerts_new_repos.disable
- business_dependabot_alerts.disable
- business_dependabot_alerts_new_repos.disable
- dependabot_security_updates.disable
- dependabot_security_updates_new_repos.disable
- repository_dependency_graph.disable
- dependency_graph.disable
- dependency_graph_new_repos.disable
condition: selection
falsepositives:
- Teams that switch off Dependabot security updates because they manage dependency updates with another tool. Confirm that alerts stay enabled.
- Archived and retired repositories whose alerts nobody will act on. Exclude them by repo.
level: medium
False positives
- Teams that switch off Dependabot security updates because they manage dependency updates with another tool. Confirm that alerts stay enabled.
- Archived and retired repositories whose alerts nobody will act on. Exclude them by repo.
GitHub Security Configuration Detached From a Repository or Deleted
Detects a security configuration being removed from a repository (repository_security_configuration.removed), a configuration being deleted (security_configuration.delete) and a default configuration for new repositories being removed (security_configuration_default.delete). GitHub states that detaching or deleting a configuration leaves the existing security settings of the repositories unchanged. What ends is the management and the enforcement, so repository administrators can change the settings afterwards, and new repositories no longer receive the default. The rule is context for the disable actions that may follow.
title: GitHub Security Configuration Detached From a Repository or Deleted
id: 42a70b45-afc9-420b-aa70-97fc4c542571
status: experimental
description: >-
Detects a security configuration being removed from a repository
(repository_security_configuration.removed), a configuration being
deleted (security_configuration.delete) and a default configuration for
new repositories being removed (security_configuration_default.delete).
GitHub states that detaching or deleting a configuration leaves the
existing security settings of the repositories unchanged. What ends is
the management and the enforcement, so repository administrators can
change the settings afterwards, and new repositories no longer receive
the default. The rule is context for the disable actions that may follow.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/code-security/how-tos/secure-at-scale/configure-organization-security/manage-your-coverage/detach-security-configuration
- https://docs.github.com/en/enterprise-cloud@latest/code-security/how-tos/secure-at-scale/configure-organization-security/manage-your-coverage/delete-custom-configuration
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- repository_security_configuration.removed
- security_configuration.delete
- security_configuration_default.delete
condition: selection
falsepositives:
- A configuration that is replaced by a new one, and repositories that are moved to individual settings on purpose. Check that the repositories are attached to another configuration afterwards.
level: low
False positives
- A configuration that is replaced by a new one, and repositories that are moved to individual settings on purpose. Check that the repositories are attached to another configuration afterwards.
GitHub Security Configuration Edited
Detects a security configuration being updated (security_configuration.update) and the default configuration for new repositories being changed (security_configuration_default.update). A security configuration is a collection of enablement settings for GitHub's security features that is applied to many repositories, so one edit can switch a feature off for all of them without any of the per-feature disable actions that the other rules on this page read. The rule matches on the action only. The event carries the state of each feature in fields such as security_configuration_code_scanning and security_configuration_dependabot_alerts, whose values GitHub does not describe, so compare them with the configuration you expect.
title: GitHub Security Configuration Edited
id: d4583b2f-49fb-41be-93ab-56720fb42813
status: experimental
description: >-
Detects a security configuration being updated
(security_configuration.update) and the default configuration for new
repositories being changed (security_configuration_default.update). A
security configuration is a collection of enablement settings for
GitHub's security features that is applied to many repositories, so one
edit can switch a feature off for all of them without any of the
per-feature disable actions that the other rules on this page read. The
rule matches on the action only. The event carries the state of each
feature in fields such as security_configuration_code_scanning and
security_configuration_dependabot_alerts, whose values GitHub does not
describe, so compare them with the configuration you expect.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/security-at-scale/organization-security
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: github
service: audit
detection:
selection:
action:
- security_configuration.update
- security_configuration_default.update
condition: selection
falsepositives:
- Security teams that extend a configuration with a new feature or change its name and description, which writes the same action. Confirm the edit with the team that owns the configuration.
level: medium
False positives
- Security teams that extend a configuration with a new feature or change its name and description, which writes the same action. Confirm the edit with the team that owns the configuration.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Code security feature disabled and a dependency or workflow change merged soon after
Turning a scanner off is only useful to an attacker when a change follows that the scanner would have reported. A disable action that is followed within hours by a push to the same repository from the same account ties the two together, while a deliberate licence or tooling decision is not followed by a hurried change from the person who made it.
- A feature is disabled for a repository, for example
repo.codeql_disabled,repo.advanced_security_disabledorrepository_vulnerability_alerts.disable. Keepactor,repoand the time. - Within 24 hours the same
actorpushes to the samerepo:git.push. GitHub delivers this event through the REST API, audit log streaming and exports only. - Raise the priority when the feature is enabled again shortly after the push, which the matching enable action such as
repo.codeql_enabledorrepository_vulnerability_alerts.enableshows.
Eventsrepo.codeql_disabledrepo.advanced_security_disabledrepository_vulnerability_alerts.disablegit.pushrepo.codeql_enabled
LimitsA repository administrator who also develops in the repository pushes every day, so the pair needs a look at what the push changed. The audit log does not say which files a push touched. Git events are kept for seven days and do not appear in the web interface. The 24 hours are a starting point.
Triage
- Identify who made the change (
actor) and read the scope from the action name, which is one repository (repo), all existing repositories of the organization, new repositories or the enterprise. - For a security configuration, read
security_configuration_nameand compare the feature fields of the event, such assecurity_configuration_code_scanningandsecurity_configuration_dependabot_alerts, with the settings the configuration should have. - Confirm the change with the actor through a separate channel. A deliberate change has a reason, for example a licence decision, a migration to another scanner or the retirement of a repository.
- List the pushes and merged pull requests of the affected repositories since the change, with attention to dependency manifests, lock files and workflow files.
- Check whether the same actor also changed secret scanning, branch protection or rulesets around the same time.
Response
Once the attack is confirmed:
- Turn the features back on at the scope where they were disabled, or apply the security configuration again, and enforce it.
- Run the code scanning analysis again and review the alerts that return, together with the Dependabot alerts that appear once the dependency graph is rebuilt.
- Review every change that was merged in the affected repositories while the checks were off, starting with new and updated dependencies.
- Secure the account that made the change. Reset its credentials and second factor, end its sessions and revoke its tokens.
- Check the repositories that depend on the affected ones, when a release was published from them during the gap.
Mitigation
- Apply the features through a security configuration and enforce it, so that repository administrators cannot change the features the configuration sets.
- Keep repository admin access, the security manager role and owner accounts to the people who need them.
- Add the ruleset rule "Require code scanning results" to protected branches. GitHub then prevents a pull request from being merged when a required tool is not configured for the repository, so a disabled scanner blocks the merge instead of passing unnoticed.
- Stream the audit log to a SIEM and alert on every action that disables a code security feature or edits a security configuration.
Frequently asked questions
Does disabling Advanced Security remove the code scanning alerts for good?
GitHub states that if Secret Protection and Code Security are disabled, dependency review, secret scanning alerts for users and code scanning are disabled, and that code scanning returns to its previous state when Code Security is enabled again. The findings are therefore not lost, but nothing new is reported while the product is off.
Does removing a security configuration switch the features off?
Not by itself. GitHub states that detaching a repository from a security configuration does not change its existing security settings, and that deleting a configuration detaches all repositories linked to it with their settings unchanged. What is lost is the management and the enforcement, so repository administrators can change the settings afterwards. Editing a configuration is different, because the edit applies to the repositories it is attached to.
Why is the dependency graph part of this page?
GitHub states that Dependabot alerts require the dependency graph to be enabled first, and that it uses the dependency graph for dependency review on pull requests. Turning the graph off is therefore another way to stop alerts about dependencies, and the rule for Dependabot covers the actions that disable it.
Is there an incident report that shows this step in an audit log?
No public incident report describes these changes at the audit event level. The page is built on what GitHub documents the features and the settings to do. The actions are rare administrative changes, which is what makes them usable as alerts.
References
- MITRE ATT&CK T1685: Disable or Modify Tools
- Audit log events for your enterprise
- Managing security and analysis settings for your repository
- Code scanning
- Dependabot alerts
- Dependabot security updates
- Dependency graph
- About GitHub Advanced Security
- Organization security with security configurations
- Detaching repositories from their security configurations
- Deleting a custom security configuration
- Available rules for rulesets
- Managing security managers in your organization