Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/openshell-driver-kubernetes/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ impl KubernetesComputeDriver {
enable_user_namespaces: self.config.enable_user_namespaces,
workspace_default_storage_size: &self.config.workspace_default_storage_size,
sa_token_ttl_secs: self.config.effective_sa_token_ttl_secs(),
is_platform_mode: sandbox
.spec
.as_ref()
.is_some_and(|s| s.network_enforcement == 1),
is_platform_mode: sandbox.spec.as_ref().is_some_and(|s| {
use openshell_core::proto::NetworkEnforcementMode;
s.network_enforcement() == NetworkEnforcementMode::NetworkEnforcementPlatform
}),
};
obj.data = sandbox_to_k8s_spec(sandbox.spec.as_ref(), &params);
let api = self.api();
Expand Down
1 change: 1 addition & 0 deletions crates/openshell-sandbox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub mod procfs;
mod provider_credentials;
pub mod proxy;
mod sandbox;
pub mod seccomp_notify;
mod secrets;
mod skills;
mod ssh;
Expand Down
9 changes: 5 additions & 4 deletions crates/openshell-sandbox/src/sandbox/linux/landlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,11 @@ pub fn prepare(policy: &SandboxPolicy, workdir: Option<&str>) -> Result<Option<P
rules_applied += 1;
}
Err(e) => {
debug!(
tracing::warn!(
error = %e,
"Landlock TCP port restriction unavailable (ABI v4 required), \
falling back to cooperative proxy enforcement"
"Landlock TCP port restriction unavailable (ABI v4 required). \
Network enforcement degraded: agent can bypass proxy via direct \
connect(). Upgrade to RHEL 9.6+ for kernel-enforced TCP port restriction."
);
}
}
Expand All @@ -255,7 +256,7 @@ pub fn prepare(policy: &SandboxPolicy, workdir: Option<&str>) -> Result<Option<P
));
}

let skipped = total_paths - rules_applied;
let skipped = total_paths.saturating_sub(rules_applied);
openshell_ocsf::ocsf_emit!(
openshell_ocsf::ConfigStateChangeBuilder::new(crate::ocsf_ctx())
.severity(openshell_ocsf::SeverityId::Informational)
Expand Down
Loading