Add endpoint protection checks to codex doctor (#38827)

## Why

Endpoint protection products can interfere with Codex, but existing doctor reports do not identify them or explain which Codex exclusions need verification.

## What changed

- Detect supported endpoint protection products on macOS and Windows and add the results to the doctor environment report.
- Warn when detected products have unverified Codex exclusions, with product-specific remediation for CrowdStrike Falcon, BeyondTrust Privilege Management, Microsoft Defender, SentinelOne, and Jamf Protect.
- Distinguish complete, partial, and unavailable inspection results without requiring remediation when no product is detected.

## Testing

- Cover empty, unavailable, partial, single-product, and multi-product inspection results.
- Verify the structured JSON contract and human-readable report output.

GitOrigin-RevId: 684c69684ed73235d92d398f5294cc1b274278df
This commit is contained in:
chess authored and copyberry committed 2026-08-16 02:35:50 +00:00
1 parent 49db349ffd
commit c7a95f84b3
5 files changed
+459 -3

No files matched your search

+12 -2
View File
@@ -26,8 +26,8 @@ const GROUPS: &[OutputGroup] = &[
OutputGroup {
title: "Environment",
keys: &[
"system", "disk", "runtime", "install", "search", "git", "terminal", "title", "state",
"threads",
"system", "disk", "security", "runtime", "install", "search", "git", "terminal",
"title", "state", "threads",
],
},
OutputGroup {
@@ -1319,6 +1319,16 @@ Background Server
"create a trusted Windows Dev Drive: https://learn.microsoft.com/en-us/windows/dev-drive/",
),
);
let mut security = super::super::security::endpoint_check(
super::super::security::EndpointInspection::Complete(vec!["Microsoft Defender"]),
);
let targets = security
.details
.iter_mut()
.find(|detail| detail.starts_with("exclusion targets: "))
.expect("endpoint security check should include exclusion targets");
*targets = "exclusion targets: verified Codex app and required helpers".into();
report.checks.push(security);
insta::assert_snapshot!(
"doctor_human_report_environment_rows",
render_human_report(&report, detailed_no_color_unicode_options())