-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit permissions for Android images.
Remove the use of the `--privileged` flag for Android images and instead use an seccomp permissions. The provided profile is derived from the docker documentation, with slight modifications to allow `clone` and `clone3`. The documentation is [docker seccomp](https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile), which details the syscalls blocked by docker. The same is true for podman. We merely modified these settings to allow `personality` syscall, which then allows us to use our Android images. On Windows with Docker Desktop, we currently have an issue where Docker tries to read the seccomp profile, and then interpret that as the path, rather than load the profile from the path, which is tracked by the following issue: docker/for-win#12760 On Podman (not inside WSL2), we have a separate issue where it expects a WSL path to be provided for the seccomp profile, despite the path being provided for the host.
- Loading branch information
1 parent
0b3abed
commit 13f4497
Showing
5 changed files
with
235 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
{ | ||
"defaultAction": "SCMP_ACT_ALLOW", | ||
"syscalls": [ | ||
{ | ||
"names": [ | ||
"add_key", | ||
"get_kernel_syms", | ||
"keyctl", | ||
"move_pages", | ||
"nfsservctl", | ||
"perf_event_open", | ||
"pivot_root", | ||
"query_module", | ||
"request_key", | ||
"sysfs", | ||
"_sysctl", | ||
"uselib", | ||
"userfaultfd", | ||
"ustat" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1 | ||
}, | ||
{ | ||
"names": [ | ||
"acct" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_PACCT" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"bpf", | ||
"lookup_dcookie", | ||
"mount", | ||
"quotactl", | ||
"quotactl_fd", | ||
"setns", | ||
"swapon", | ||
"swapoff", | ||
"umount", | ||
"umount2", | ||
"unshare", | ||
"vm86", | ||
"vm86old", | ||
"pciconfig_read", | ||
"pciconfig_write", | ||
"salinfo_log_open", | ||
"salinfo_event_open", | ||
"sys_cacheflush", | ||
"rtas" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_ADMIN" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"clock_adjtime", | ||
"clock_settime", | ||
"settimeofday", | ||
"stime" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_TIME" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"create_module", | ||
"delete_module", | ||
"finit_module", | ||
"init_module" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_MODULE" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"get_mempolicy", | ||
"mbind", | ||
"set_mempolicy" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_NICE" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"ioperm", | ||
"iopl" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_RAWIO" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"kcmp", | ||
"process_vm_readv", | ||
"process_vm_writev", | ||
"ptrace" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_PTRACE" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"kexec_file_load", | ||
"kexec_load", | ||
"reboot" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_SYS_BOOT" | ||
] | ||
} | ||
}, | ||
{ | ||
"names": [ | ||
"name_to_handle_at", | ||
"open_by_handle_at" | ||
], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 1, | ||
"excludes": { | ||
"caps": [ | ||
"CAP_DAC_READ_SEARCH" | ||
] | ||
} | ||
} | ||
] | ||
} |