xref: /aosp_15_r20/external/sandboxed-api/sandboxed_api/sandbox2/forkserver.proto (revision ec63e07ab9515d95e79c211197c445ef84cefa6a)
1// Copyright 2019 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// A proto for the sandbox2::Forkserver class
16
17syntax = "proto3";
18
19package sandbox2;
20
21import "sandboxed_api/sandbox2/mount_tree.proto";
22
23enum Mode {
24  // Default value
25  FORKSERVER_FORK_UNSPECIFIED = 0;
26  // Fork, execve and sandbox
27  FORKSERVER_FORK_EXECVE_SANDBOX = 1;
28  // Fork and execve, but no sandboxing
29  FORKSERVER_FORK_EXECVE = 2;
30  // Just fork
31  FORKSERVER_FORK = 3;
32  reserved 4;
33}
34
35enum MonitorType {
36  // Default value
37  FORKSERVER_MONITOR_UNSPECIFIED = 0;
38  // Ptrace based monitor
39  FORKSERVER_MONITOR_PTRACE = 1;
40  // Seccomp_unotify based monitor
41  FORKSERVER_MONITOR_UNOTIFY = 2;
42}
43
44message ForkRequest {
45  // List of arguments, starting with argv[0]
46  repeated bytes args = 1;
47  // List of environment variables which will be passed to the child
48  repeated bytes envs = 2;
49
50  // How to interpret the request
51  optional Mode mode = 3;
52
53  // Clone flags for the new process
54  optional int32 clone_flags = 4;
55
56  // Capabilities to keep when starting the sandboxee
57  repeated int32 capabilities = 5;
58
59  // The mount tree used for namespace initialization
60  optional MountTree mount_tree = 6;
61
62  // Hostname in the network namespace
63  optional bytes hostname = 7;
64
65  // Changes mount propagation from MS_PRIVATE to MS_SLAVE if set
66  optional bool allow_mount_propagation = 8;
67
68  // Monitor type used by the sandbox
69  optional MonitorType monitor_type = 9;
70}
71