Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
311ad21
sandbox2 and deps licenses
valeriy42 Oct 28, 2025
7382f3b
build integration
valeriy42 Oct 28, 2025
2c5775e
Enhance Sandbox2 integration tests and policy handling
valeriy42 Oct 28, 2025
9b8da0f
Refactor Sandbox2 handling in CDetachedProcessSpawner_Linux
valeriy42 Oct 28, 2025
ac67539
Implement Sandbox2 syscall policy for ML processes
valeriy42 Oct 28, 2025
b43e999
formatting
valeriy42 Nov 5, 2025
5cd22f9
fix header
valeriy42 Nov 5, 2025
5c5a2a0
sandbox2 library correctly linked
valeriy42 Nov 6, 2025
0fe86f5
Refactor Sandbox2 policy handling in unit tests
valeriy42 Nov 6, 2025
9dadd42
test 1 passes without sandbox2
valeriy42 Nov 6, 2025
404c6b5
benign model passes. policy very permissive.
valeriy42 Nov 6, 2025
878fadf
evil model generator
valeriy42 Nov 6, 2025
d4adb62
restrict policies.
valeriy42 Nov 6, 2025
d60ba2f
Refactor syscall definitions in CDetachedProcessSpawner_Linux
valeriy42 Nov 6, 2025
fbc3c00
formatting
valeriy42 Nov 6, 2025
9d5d2ba
changelog
valeriy42 Nov 6, 2025
7506aab
patch SAPI cmake file to make Python3 dependency optional
valeriy42 Nov 6, 2025
6f49269
Merge branch 'enhancement/sandbox2' of https://github.com/valeriy42/m…
valeriy42 Nov 6, 2025
ac26ca6
fix python checks on CI
valeriy42 Nov 7, 2025
ec5cde2
Remove Sandbox2 security tests and add CDetachedProcessSpawner tests …
valeriy42 Nov 7, 2025
03b1ee4
Add syscall allowance for prlimit64 in sandbox policy
valeriy42 Nov 20, 2025
b93dfec
formatting
valeriy42 Nov 21, 2025
0594140
adjust for arm64
valeriy42 Nov 21, 2025
c77ebb6
python integration test simulation works
valeriy42 Nov 27, 2025
fa8f99d
java IT works again
valeriy42 Dec 3, 2025
8dc9905
formatting
valeriy42 Dec 9, 2025
d853920
Fix CI build failures
valeriy42 Dec 9, 2025
4f69cd9
Merge remote-tracking branch 'upstream/main' into enhancement/sandbox2
valeriy42 Jul 17, 2026
ec7d3ed
[ML] Allow legacy file-system syscalls in pytorch_inference sandbox p…
valeriy42 Jul 17, 2026
a6a7ecd
Update docs/changelog/2873.yaml
valeriy42 Jul 17, 2026
ee0bcb3
[ML] Disable unity build for vendored Abseil / Sandboxed API
valeriy42 Jul 17, 2026
f5d6fc2
[ML] Fix sandboxed pytorch_inference named-pipe setup on long CI paths
valeriy42 Jul 17, 2026
62ea65b
[ML] Add Sandbox2 diagnostics for pytorch_inference pipe-visibility f…
valeriy42 Jul 18, 2026
cce88ce
[ML] Fix diagnostics: stop redirecting the controller's stderr
valeriy42 Jul 18, 2026
e15a5e1
[ML] Log Sandbox2 AwaitResult for pytorch_inference diagnosis
valeriy42 Jul 18, 2026
27b8d73
[ML] TEMP: narrow multi-node ES ITs to *PyTorchModelIT for faster San…
valeriy42 Jul 18, 2026
e582cd9
[ML] TEMP: force minimal x86_64 PR pipeline for Sandbox2 debugging
valeriy42 Jul 18, 2026
57f00ed
[ML] Allow clone3 by number so pytorch_inference threads on CI
valeriy42 Jul 18, 2026
a190c3e
[ML] Remove Sandbox2 debugging scaffolding and restore full CI
valeriy42 Jul 18, 2026
0a56df5
[ML] Fix Sandbox2 spawner allowlist, PID tracking, and termination lo…
valeriy42 Jul 19, 2026
d9a856d
[ML] Allow glibc futex ops needed for concurrent pytorch_inference
valeriy42 Jul 20, 2026
569f8cc
[ML] Disarm Sandbox2 wall-time/CPU limits for the long-lived pytorch_…
valeriy42 Jul 21, 2026
0d89fc4
[ML] Fix clang-format violations in Sandbox2 spawner and test
valeriy42 Jul 21, 2026
facd362
formatting
valeriy42 Jul 21, 2026
39940cb
[ML] Fix Sandbox2 spawner tracking, seccomp gate, and attack tests
valeriy42 Jul 22, 2026
ff0349c
formatting
valeriy42 Jul 22, 2026
339d3f5
[ML] Remove Sandbox2 attack-defense test from Docker CI
valeriy42 Jul 22, 2026
69dea1b
[ML] Harden Sandbox2 spawner after code review follow-ups
valeriy42 Jul 22, 2026
786cdeb
[ML] Improve Sandbox2 production observability and logging
valeriy42 Jul 23, 2026
ef21959
[ML] Honour --disableSandbox kill switch in pytorch_inference spawner
valeriy42 Jul 23, 2026
63d8850
[ML] Correct Main.cc comment about pytorch_inference sandbox routing
valeriy42 Jul 23, 2026
634182f
[ML] Strip --disableSandbox on non-Linux spawners
valeriy42 Jul 23, 2026
f153159
[ML] Point Sandbox2 startup failures at sandbox_enabled kill switch
valeriy42 Jul 23, 2026
7c9623c
formatting
valeriy42 Jul 23, 2026
6fcdecd
[ML] Fix unit test failures from spawn failure reason and seccomp tes…
valeriy42 Jul 27, 2026
ab46fc8
Merge branch 'main' of https://github.com/elastic/ml-cpp into enhance…
valeriy42 Jul 28, 2026
3dc4a56
[ML] Relocate Sandbox2 to MlSandbox and address PR #2873 review
valeriy42 Aug 19, 2026
3d96e50
formatting
valeriy42 Aug 19, 2026
6f57661
[ML] Address Jan's PR #2873 review nits
valeriy42 Aug 19, 2026
bf83cda
formatting
valeriy42 Aug 19, 2026
f0bdcf6
[ML] Fix Sandbox2 CI: set ML_SANDBOX2_EXPECT, link zlib, add Windows …
valeriy42 Aug 19, 2026
eeb52ab
[ML] Fix Sandbox2 CI regressions from MlSandbox restructure
valeriy42 Aug 19, 2026
45c1dae
[ML] Fix Sandbox2 zlib link without touching sandbox2 ALIAS
valeriy42 Aug 19, 2026
730933d
[ML] Fix Sandbox2 CI: zlib link order, probe mount, test bundle
valeriy42 Aug 20, 2026
f8b0a53
[ML] Fix aarch64 host sandbox re-run missing Boost SONAMEs
valeriy42 Aug 20, 2026
f1c938a
[ML] Fix aarch64 host sandbox re-run missing GCC 13 libstdc++
valeriy42 Aug 20, 2026
92016a5
[ML] Remove dead build_and_test.sh CI script
valeriy42 Aug 20, 2026
90dd9ca
[ML] Run aarch64 enforced Sandbox2 tests inside build image
valeriy42 Aug 20, 2026
fec7e1e
[ML] Escalate aarch64 enforced Sandbox2 docker run to --privileged
valeriy42 Aug 20, 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
10 changes: 8 additions & 2 deletions .buildkite/scripts/steps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ if [[ "$HARDWARE_ARCH" = aarch64 && -z "${CPP_CROSS_COMPILE:-}" && "$(uname)" =
docker run --rm --workdir=/ml-cpp $TEMP_TAG bash -c '
{
find cmake-build-docker/test -name "ml_test_*" -type f -executable 2>/dev/null
find cmake-build-docker/lib -name "*.so" 2>/dev/null
find build/distribution -name "*.so" -not -path "*.debug*" 2>/dev/null
find cmake-build-docker/lib \( -name "*.so" -o -name "*.so.*" \) 2>/dev/null
find build/distribution \( -name "*.so" -o -name "*.so.*" \) -not -path "*.debug*" 2>/dev/null
# Sandbox2 spawn tests need the installed pytorch_inference binary.
find build/distribution -type f -path "*/bin/pytorch_inference" 2>/dev/null
} | sort -u > /tmp/bundle-files.txt
echo "Files in bundle: $(wc -l < /tmp/bundle-files.txt)" >&2
tar czf - -T /tmp/bundle-files.txt
Expand Down Expand Up @@ -109,6 +111,8 @@ elif [[ "$(uname)" = "Linux" ]]; then
find ${BUILD_DIR}/lib -name "*.so" -o -name "*.dylib" 2>/dev/null
if [ -d "build/distribution" ]; then
find build/distribution -type f \( -name "*.so" -o -name "*.dylib" \) -not -path "*.dSYM*" 2>/dev/null
# Sandbox2 spawn tests need the installed pytorch_inference binary.
find build/distribution -type f -path "*/bin/pytorch_inference" 2>/dev/null
fi
} | sort -u > /tmp/test-bundle-files.txt

Expand Down Expand Up @@ -151,6 +155,8 @@ else
find ${BUILD_DIR}/lib -name "*.so" -o -name "*.dylib" 2>/dev/null
if [ -d "build/distribution" ]; then
find build/distribution -type f \( -name "*.so" -o -name "*.dylib" \) -not -path "*.dSYM*" 2>/dev/null
# Sandbox2 spawn tests need the installed pytorch_inference binary.
find build/distribution -type f -path "*/bin/pytorch_inference" 2>/dev/null
fi
} | sort -u > /tmp/test-bundle-files.txt

Expand Down
131 changes: 0 additions & 131 deletions .buildkite/scripts/steps/build_and_test.sh

This file was deleted.

34 changes: 34 additions & 0 deletions .buildkite/scripts/steps/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if [[ "$HARDWARE_ARCH" = aarch64 && -z "${CPP_CROSS_COMPILE:-}" && "$(uname)" =
-v "$(pwd)/set_env.sh:/ml-cpp/set_env.sh:ro" \
-v "$(pwd)/gradle.properties:/ml-cpp/gradle.properties:ro" \
-e BOOST_TEST_OUTPUT_FORMAT_FLAGS="${BOOST_TEST_OUTPUT_FORMAT_FLAGS:-}" \
-e ML_SANDBOX2_EXPECT=fail_closed \
${TEST_TIMEOUT:+-e TEST_TIMEOUT="${TEST_TIMEOUT}"} \
-w /ml-cpp \
$BASE_IMAGE bash -c '
Expand All @@ -82,6 +83,30 @@ if [[ "$HARDWARE_ARCH" = aarch64 && -z "${CPP_CROSS_COMPILE:-}" && "$(uname)" =
# kernel, so the kernel's seccomp filters are exercised without needing
# a separate outside-Docker run.

# The 'enforced' Sandbox2 path requires unshare(CLONE_NEWUSER) + mount(/proc).
# SYS_ADMIN + unconfined seccomp/apparmor is still not enough on aarch64 CI
# agents (probe: "user namespaces are unavailable"). Nested Docker needs a
# full privileged container to create user namespaces. Stay inside the SAME
# build image so the binary always runs against the toolchain it was compiled
# with (GCC13/Boost 1.86) — no host-side LD_LIBRARY_PATH bundling.
if [[ $TEST_OUTCOME -eq 0 ]]; then
echo "--- Re-running sandbox unit tests (Docker, enforced)"
docker run --rm \
--privileged \
-v "$(pwd)/${BUILD_DIR}:/ml-cpp/${BUILD_DIR}" \
-v "$(pwd)/build:/ml-cpp/build" \
-e ML_SANDBOX2_EXPECT=enforced \
-w /ml-cpp \
$BASE_IMAGE bash -c '
LIB_DIRS=$(find /ml-cpp/cmake-build-docker/lib /ml-cpp/build/distribution \
-name "*.so" -exec dirname {} \; 2>/dev/null | sort -u | tr "\n" ":")
export LD_LIBRARY_PATH="${LIB_DIRS}/usr/local/gcc133/lib64:/usr/local/gcc133/lib"
chmod -R +x cmake-build-docker/test/lib/sandbox/unittest 2>/dev/null
cd cmake-build-docker/test/lib/sandbox/unittest
./ml_test_sandbox
' || TEST_OUTCOME=$?
fi

else
# --- Linux x86_64 / macOS: run tests directly ---
. ./set_env.sh
Expand All @@ -98,6 +123,15 @@ else
export DYLD_LIBRARY_PATH="${LIB_DIRS}${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}"
fi

# Linux x86_64 PR agents are Buildkite k8s pods: user namespaces often work
# but Sandbox2's mount("", "/proc", "proc", ...) returns EPERM. The probe in
# CSandboxedProcessSpawnerTest_Linux requires that mount, so expect fail_closed.
# aarch64 enforced sandbox re-run above uses a privileged container.
# macOS has no CSandboxedProcessSpawnerTest_Linux.cc.
if [[ "$(uname)" = "Linux" ]]; then
export ML_SANDBOX2_EXPECT=fail_closed
fi

echo "--- Running tests"
cmake \
-DSOURCE_DIR="$(pwd)" \
Expand Down
Loading