11
11
import Foundation
12
12
import TSCBasic
13
13
14
- /// A sandbox profile representing the desired restrictions. The implementation can vary between platforms.
14
+ /// A sandbox profile representing the desired restrictions. The implementation can vary between platforms. Currently
15
+ /// the only control a client has is in the path rules, but in the future there should also be options for controlling
16
+ /// blocking of network access and process launching.
15
17
public struct SandboxProfile : Equatable {
16
18
/// An ordered list of path rules, where the last rule to cover a particular path "wins". These will be resolved
17
19
/// to absolute paths at the time the profile is applied. They are applied after any of the implicit directories
@@ -25,14 +27,10 @@ public struct SandboxProfile: Equatable {
25
27
case writable( AbsolutePath )
26
28
}
27
29
28
- /// Whether to allow outbound and inbound network access.
29
- public var allowNetwork : Bool
30
-
31
30
/// Configures a SandboxProfile for blocking network access and writing to the file system except to specifically
32
31
/// permitted locations.
33
- public init ( _ pathAccessRules: [ PathAccessRule ] = [ ] , allowNetwork : Bool = false ) {
32
+ public init ( _ pathAccessRules: [ PathAccessRule ] = [ ] ) {
34
33
self . pathAccessRules = pathAccessRules
35
- self . allowNetwork = allowNetwork
36
34
}
37
35
}
38
36
@@ -66,12 +64,6 @@ fileprivate extension SandboxProfile {
66
64
// Allow operations on subprocesses.
67
65
contents += " (allow process*) \n "
68
66
69
- // Optionally allow network access (inbound and outbound).
70
- if allowNetwork {
71
- contents += " (system-network) \n "
72
- contents += " (allow network*) \n "
73
- }
74
-
75
67
// Allow reading any file that isn't protected by TCC or permissions (ideally we'd only allow a specific set
76
68
// of readable locations, and can maybe tighten this in the future).
77
69
contents += " (allow file-read*) \n "
0 commit comments