You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: devlog/2025-03-sandboxing-3.md
+30-14Lines changed: 30 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,16 @@ This error occurs because gVisor requires user namespace support for rootless co
16
16
The key changes in this implementation:
17
17
18
18
1.**Update OCI Configuration**:
19
-
- Add `umask` setting to the user configuration
20
-
- Ensure proper user namespace mapping
19
+
- Add proper user namespace configuration to the Linux namespaces section
20
+
- Ensure proper user configuration
21
21
22
-
2.**Modify gVisor Wrapper Script**:
23
-
-Add `--network=host` flag to the runsc command
24
-
-Maintain the fallback mechanism to direct execution if runsc fails
22
+
2.**Remove Fallback Mechanism**:
23
+
-Remove the fallback to direct execution to ensure proper sandboxing
24
+
-Focus on making gVisor work properly in production environments
25
25
26
26
3.**Update Dockerfile**:
27
27
- Configure kernel parameters to allow unprivileged user namespace cloning
28
-
-Maintain existing directory permissions
28
+
-Set appropriate permissions for directories
29
29
30
30
## Technical Approach
31
31
@@ -38,8 +38,8 @@ gVisor requires user namespace support for rootless containers. This is a fundam
38
38
The solution addresses these issues by:
39
39
40
40
1. Configuring the OCI bundle with proper user namespace settings
41
-
2.Adding network host mode to the runsc command
42
-
3.Setting kernel parameters to allow unprivileged user namespace cloning
41
+
2.Setting kernel parameters to allow unprivileged user namespace cloning
42
+
3.Removing the fallback mechanism to ensure proper sandboxing
43
43
44
44
## Testing Results
45
45
@@ -61,14 +61,30 @@ docker run --rm --privileged airbyte/source-declarative-manifest-gvisor spec
61
61
docker run --rm --userns=host airbyte/source-declarative-manifest-gvisor spec
62
62
```
63
63
64
-
While the user namespace error may still occur in some environments due to host-level restrictions, the fallback mechanism ensures the connector still functions by executing the command directly.
64
+
The implementation now requires proper user namespace support to function, as the fallback mechanism has been removed to ensure proper sandboxing.
65
65
66
-
## Considerations for Future Work
66
+
## Production Deployment Requirements
67
67
68
-
1.**Docker Runtime Configuration**: For production use, consider configuring the Docker daemon with user namespace remapping using the `userns-remap` option.
69
-
2.**Host-Level Configuration**: Some environments may require additional host-level configuration to enable user namespaces.
70
-
3.**Alternative Sandboxing Approaches**: If user namespace support cannot be enabled in the target environment, consider alternative sandboxing approaches like Firejail.
68
+
For gVisor to work properly in production environments:
69
+
70
+
1.**Docker Runtime Configuration**: Configure the Docker daemon with user namespace remapping using the `userns-remap` option in `/etc/docker/daemon.json`:
71
+
```json
72
+
{
73
+
"userns-remap": "default"
74
+
}
75
+
```
76
+
77
+
2.**Host-Level Configuration**: Enable user namespaces at the host level:
3.**Container Runtime Flags**: Run containers with the appropriate flags:
84
+
```bash
85
+
docker run --security-opt seccomp=unconfined --security-opt apparmor=unconfined --userns=host
86
+
```
71
87
72
88
## Conclusion
73
89
74
-
This implementation addresses the user namespace issue in the gVisor sandboxing implementation by properly configuring the OCI bundle and adding necessary flags to the runsc command. The fallback mechanism ensures the connector still functions in environments without proper user namespace support.
90
+
This implementation addresses the user namespace issue in the gVisor sandboxing implementation by properly configuring the OCI bundle and adding necessary kernel parameters. The removal of the fallback mechanism ensures that the connector will only run with proper sandboxing, which is essential for production use.
0 commit comments