Signed-off-by: Jessica Frazelle <acidburn@docker.com>
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,64 @@ |
| 0 |
+<!-- [metadata]> |
|
| 1 |
+title = "Seccomp security profiles for Docker" |
|
| 2 |
+description = "Enabling seccomp in Docker" |
|
| 3 |
+keywords = ["seccomp, security, docker, documentation"] |
|
| 4 |
+<![end-metadata]--> |
|
| 5 |
+ |
|
| 6 |
+Seccomp security profiles for Docker |
|
| 7 |
+------------------------------------ |
|
| 8 |
+ |
|
| 9 |
+The seccomp() system call operates on the Secure Computing (seccomp) |
|
| 10 |
+state of the calling process. |
|
| 11 |
+ |
|
| 12 |
+This operation is available only if the kernel is configured |
|
| 13 |
+with `CONFIG_SECCOMP` enabled. |
|
| 14 |
+ |
|
| 15 |
+This allows for allowing or denying of certain syscalls in a container. |
|
| 16 |
+ |
|
| 17 |
+Passing a profile for a container |
|
| 18 |
+--------------------------------- |
|
| 19 |
+ |
|
| 20 |
+Users may pass a seccomp profile using the `security-opt` option |
|
| 21 |
+(per-container). |
|
| 22 |
+ |
|
| 23 |
+The profile has layout in the following form: |
|
| 24 |
+ |
|
| 25 |
+``` |
|
| 26 |
+{
|
|
| 27 |
+ "defaultAction": "SCMP_ACT_ALLOW", |
|
| 28 |
+ "syscalls": [ |
|
| 29 |
+ {
|
|
| 30 |
+ "name": "getcwd", |
|
| 31 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 32 |
+ }, |
|
| 33 |
+ {
|
|
| 34 |
+ "name": "mount", |
|
| 35 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 36 |
+ }, |
|
| 37 |
+ {
|
|
| 38 |
+ "name": "setns", |
|
| 39 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 40 |
+ }, |
|
| 41 |
+ {
|
|
| 42 |
+ "name": "create_module", |
|
| 43 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 44 |
+ }, |
|
| 45 |
+ {
|
|
| 46 |
+ "name": "chown", |
|
| 47 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 48 |
+ }, |
|
| 49 |
+ {
|
|
| 50 |
+ "name": "chmod", |
|
| 51 |
+ "action": "SCMP_ACT_ERRNO" |
|
| 52 |
+ } |
|
| 53 |
+ ] |
|
| 54 |
+} |
|
| 55 |
+``` |
|
| 56 |
+ |
|
| 57 |
+Then you can run with: |
|
| 58 |
+ |
|
| 59 |
+``` |
|
| 60 |
+$ docker run --rm -it --security-opt seccomp:/path/to/seccomp/profile.json hello-world |
|
| 61 |
+``` |