Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
103f955
feat(sandboxpolicy): add opt-in persistent exec enforcement
matthyx Oct 27, 2026
7362e7f
build(sandboxpolicy): pin reviewed enforce-exec revision
matthyx Oct 27, 2026
c695a72
fix(sandboxpolicy): address config review 5666688060 and refresh IG pin
matthyx Oct 27, 2026
1f11a40
build(sandboxpolicy): preserve upstream uprobe streaming in IG pin
matthyx Oct 27, 2026
d68af2d
build(sandboxpolicy): pin reviewed IG prefix and attachment fixes
matthyx Oct 27, 2026
eb5a409
fix(sandboxpolicy): cancel stats waits on busy backend
matthyx Oct 27, 2026
ed7151b
fix(sandboxpolicy): validate retained health and discovered cgroup me…
matthyx Oct 27, 2026
1d99df5
build(sandboxpolicy): pin reviewed exact Kubernetes kernel matrix
matthyx Oct 27, 2026
c19e804
fix(sandboxpolicy): keep service diagnostic logging readiness-neutral
matthyx Oct 27, 2026
3ca76d8
fix(sandboxpolicy): retain legacy binding metadata across lifecycle
matthyx Oct 27, 2026
e19c3c0
fix(watcher): treat stopped event queues as normal shutdown
matthyx Oct 27, 2026
1769ac1
refactor(sandbox): name exec authorization events explicitly
matthyx Oct 27, 2026
456c843
fix(sandboxpolicy): isolate binding operations and drain engine owner…
matthyx Oct 29, 2026
a7d2920
test(sandboxpolicy): cover re-enable after failed withdrawal
matthyx Oct 29, 2026
070e70f
fix(sandboxpolicy): isolate runtime evidence context ownership
matthyx Oct 30, 2026
335919a
fix(sandboxpolicy): bound runtime evidence before decoding
matthyx Oct 30, 2026
90be9f5
fix(sandboxpolicy): bound overlay components before splitting
matthyx Oct 30, 2026
0911501
feat(sandboxpolicy): expose retained shared container identity
matthyx Oct 30, 2026
6c8405a
test(sandboxpolicy): cover canonical identity rejection boundaries
matthyx Oct 30, 2026
0d58256
docs(sandboxpolicy): clarify role grants and evidence limits
matthyx Oct 30, 2026
9b6ab9a
test(sandboxpolicy): isolate kernel fixture initialization
matthyx Oct 30, 2026
55faa87
docs(sandboxpolicy): require explicit kernel-test build tag
matthyx Oct 30, 2026
d7834e4
docs(sandboxpolicy): clarify pinned backend and shared preparation
matthyx Oct 30, 2026
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
29 changes: 29 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import (
"github.com/kubescape/node-agent/pkg/rulemanager/rulecooldown"
"github.com/kubescape/node-agent/pkg/rulemanager/rulecreator"
"github.com/kubescape/node-agent/pkg/rulemanager/ruleswatcher"
sandboxintegration "github.com/kubescape/node-agent/pkg/sandboxpolicy/integration"
"github.com/kubescape/node-agent/pkg/sbommanager"
sbommanagerv1 "github.com/kubescape/node-agent/pkg/sbommanager/v1"
sbomscanner "github.com/kubescape/node-agent/pkg/sbomscanner/v1"
Expand Down Expand Up @@ -569,6 +570,34 @@ func main() {
defer mainHandler.Stop()
}

if cfg.EnableSandboxPolicy {
// Enforcement is independent of observer/runtime-detection switches. The
// service rejects unavailable predicates/bindings rather than weakening them.
sandboxService, sandboxErr := sandboxintegration.NewService(ctx, sandboxintegration.ServiceOptions{
Kubernetes: k8sClient.GetKubernetesClient(), Dynamic: k8sClient.GetDynamicClient(),
Containers: mainHandler.GetContainerCollection(), Tracers: mainHandler.GetTracerCollection(),
NodeName: cfg.NodeName, AgentNamespace: cfg.NamespaceName, ImageName: cfg.SandboxPolicyImage, ImageArchive: "tracers.tar",
ContainerdSocket: cfg.SandboxPolicyContainerdSocket, ControlRoot: cfg.SandboxPolicyControlRoot, MaxOwners: cfg.SandboxPolicyMaxOwners,
Sources: sandboxintegration.NewProfileResolver(storageClient.GetStorageClient()),
Receivers: thirdPartyTracers.ThirdPartyEventReceivers,
OnError: func(err error) { logger.L().Ctx(ctx).Error("sandbox policy service diagnostic", helpers.Error(err)) },
})
if sandboxErr != nil {
logger.L().Ctx(ctx).Fatal("creating sandbox policy service", helpers.Error(sandboxErr))
}
dWatcher.AddAdaptor(sandboxService)
if sandboxErr = sandboxService.Start(ctx); sandboxErr != nil {
logger.L().Ctx(ctx).Fatal("starting sandbox policy service", helpers.Error(sandboxErr))
}
defer func() {
cleanupCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := sandboxService.Close(cleanupCtx); err != nil {
logger.L().Error("sandbox policy cleanup incomplete", helpers.Error(err))
}
}()
}

// start watching
dWatcher.Start(ctx)
defer dWatcher.Stop(ctx)
Expand Down
353 changes: 353 additions & 0 deletions docs/features/sandbox-policy.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/cenkalti/backoff/v5 v5.0.3
github.com/cespare/xxhash/v2 v2.3.0
github.com/cilium/ebpf v0.22.0
github.com/containerd/containerd v1.7.36
github.com/crewjam/rfc5424 v0.1.0
github.com/cyphar/filepath-securejoin v0.6.1
github.com/deckarep/golang-set/v2 v2.8.0
Expand All @@ -35,12 +36,13 @@ require (
github.com/kubescape/backend v0.0.39
github.com/kubescape/go-logger v0.0.35
github.com/kubescape/k8s-interface v0.0.214
github.com/kubescape/storage v0.0.303
github.com/kubescape/storage v0.0.352-0.20261013133511-eb6406e01cb9
github.com/kubescape/workerpool v0.0.0-20250526074519-0e4a4e7f44cf
github.com/moby/sys/mountinfo v0.7.2
github.com/opcoder0/fanotify v0.4.2
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/opencontainers/runtime-spec v1.3.0
github.com/panjf2000/ants/v2 v2.11.3
github.com/picatz/xcel v0.0.0-20260226001349-6958ffac5706
github.com/prometheus/alertmanager v0.27.0
Expand Down Expand Up @@ -184,7 +186,6 @@ require (
github.com/cloudflare/circl v1.6.3 // indirect
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
github.com/containerd/cgroups/v3 v3.1.2 // indirect
github.com/containerd/containerd v1.7.36 // indirect
github.com/containerd/containerd/api v1.10.0 // indirect
github.com/containerd/continuity v0.4.5 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
Expand Down Expand Up @@ -352,7 +353,6 @@ require (
github.com/olekukonko/tablewriter v1.0.9 // indirect
github.com/olvrng/ujson v1.1.0 // indirect
github.com/opcoder0/capabilities v0.0.0-20221222060822-17fd73bffd2a // indirect
github.com/opencontainers/runtime-spec v1.3.0 // indirect
github.com/opencontainers/selinux v1.13.1 // indirect
github.com/packetcap/go-pcap v0.0.0-20250723190045-d00b185f30b7 // indirect
github.com/pborman/indent v1.2.1 // indirect
Expand Down Expand Up @@ -480,7 +480,7 @@ require (
zombiezen.com/go/sqlite v1.4.0 // indirect
)

replace github.com/inspektor-gadget/inspektor-gadget => github.com/kubescape/inspektor-gadget v0.0.0-20260826074832-06b0d12baca0
replace github.com/inspektor-gadget/inspektor-gadget => github.com/kubescape/inspektor-gadget v0.0.0-20261027133411-87a796fe9780

replace github.com/anchore/syft => github.com/kubescape/syft v1.32.0-ks.2

Expand Down
Loading
Loading