mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:59:25 +00:00
Forward executor network policy decisions for auditing (#38670)
## What changed - Add a best-effort `network/policyDecision` notification for final domain and non-domain policy decisions made by executor-local proxies. - Validate notifications against the active process on the controller and emit audit events with controller-trusted session and execution metadata. - Reserve outbound RPC capacity so audit notifications cannot block control messages, and expose valid `chatgpt-account-id` header values for audit attribution. ## Testing - Cover notification serialization, proxy decision capture, executor-to-controller delivery, trusted metadata handling, and reserved RPC capacity. GitOrigin-RevId: a39f96a6b3d9401c03d54eaef5b9a6d3fe0da78b
This commit is contained in:
1 parent
a186f5484d
commit
15fde8c1f2
15 files changed
+655
-19
No files matched your search
@@ -4,6 +4,7 @@ use serde::Serialize;
|
||||
use crate::ProcessId;
|
||||
|
||||
pub const NETWORK_POLICY_REQUEST_METHOD: &str = "network/policyRequest";
|
||||
pub const NETWORK_POLICY_DECISION_METHOD: &str = "network/policyDecision";
|
||||
pub const MAX_NETWORK_POLICY_HOST_BYTES: usize = 253;
|
||||
pub const MAX_NETWORK_POLICY_PROCESS_ID_BYTES: usize = 256;
|
||||
pub const MAX_NETWORK_POLICY_REASON_BYTES: usize = 1024;
|
||||
@@ -23,6 +24,27 @@ pub struct ExecServerNetworkPolicyRequest {
|
||||
pub port: u16,
|
||||
}
|
||||
|
||||
/// Reports an executor-local network policy decision to its authenticated controller.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NetworkPolicyDecisionNotification {
|
||||
pub process_id: ProcessId,
|
||||
pub timestamp: String,
|
||||
pub scope: String,
|
||||
pub decision: String,
|
||||
pub source: String,
|
||||
pub reason: String,
|
||||
pub protocol: ExecServerNetworkProtocol,
|
||||
pub host: String,
|
||||
pub port: u16,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub method: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub client: Option<String>,
|
||||
#[serde(default)]
|
||||
pub policy_override: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ExecServerNetworkProtocol {
|
||||
|
||||
Reference in new issue
Block a user