Add Seatbelt-based macOS sandboxing for the browser service processes. The shared profile builder grants only the filesystem, network, Mach, and process execution permissions each service needs, with fatal sandbox violation reporting enabled so denials are visible during development. Wire sandbox profiles into WebContent, WebWorker, RequestServer, ImageDecoder, and Compositor. Keep Landlock and Seatbelt APIs visible only on the platforms that use them. Allow RequestServer resource substitution files explicitly, preserve read access for read-write cache paths, and only grant renderer process execution for an existing Cranelift helper.
20 lines
406 B
C++
20 lines
406 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <ImageDecoder/Sandbox.h>
|
|
#include <LibSandbox/Sandbox.h>
|
|
|
|
namespace ImageDecoder {
|
|
|
|
ErrorOr<void> apply_sandbox()
|
|
{
|
|
TRY(Sandbox::configure_runtime());
|
|
|
|
Vector<Sandbox::SeatbeltPath> paths;
|
|
return Sandbox::apply_macos_sandbox(paths.span(), Sandbox::NetworkAccess::Denied);
|
|
}
|
|
|
|
}
|