Add telemetry for the Windows system config namespace (#44284)

## What changed

Probe the default Windows system config namespace at session start and record `codex.windows_system_config.namespace_squatting_probe` once per process when metrics are available.

When `config.toml` or `requirements.toml` exists, check the containing directories for expected ownership and broad standard-user mutation allow ACEs, including permissions inherited by child files. Report coarse results for missing files, expected directories, unexpected types or owners, mutation permissions, and check errors.

The probe is observational: it does not change configuration loading or enforce a trust decision.

GitOrigin-RevId: e1c79dca5548e16e83c7b84b44ab0de4e2643d0d
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-09 19:31:12 +00:00
1 parent c1840dc55e
commit bb71d758cd
11 files changed
+254 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
//! Metrics derived from loaded configuration at session start.
use super::Config;
use codex_otel::SessionTelemetry;
pub(crate) fn emit_session_start_metrics(config: &Config, telemetry: &SessionTelemetry) {
config.features.emit_metrics(telemetry);
#[cfg(windows)]
crate::windows_system_config::emit_namespace_squatting_probe();
}
+2
View File
@@ -164,6 +164,7 @@ use toml_edit::DocumentMut;
mod auth_keyring;
pub mod edit;
mod managed_features;
mod metrics;
mod network_proxy_spec;
mod otel;
mod permission_profile_catalog;
@@ -186,6 +187,7 @@ pub use codex_network_proxy::NetworkProxyAuditMetadata;
use codex_sandboxing::compatibility_sandbox_policy_for_permission_profile;
pub use codex_sandboxing::system_bwrap_warning;
pub use managed_features::ManagedFeatures;
pub(crate) use metrics::emit_session_start_metrics;
pub use network_proxy_spec::NetworkProxySpec;
pub use network_proxy_spec::StartedNetworkProxy;
pub use permission_profile_catalog::PermissionProfileCatalogEntry;