From 28611da602f6088892d88d3203a9f8df7a15b347 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Tue, 26 Dec 2023 15:46:20 -0500 Subject: [PATCH] Add seccomp (merge 441) --- docker-compose.yml | 2 + seccomp-libreddit.json | 125 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 seccomp-libreddit.json diff --git a/docker-compose.yml b/docker-compose.yml index ad0fd1f..2a5e69d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,8 @@ services: - ALL networks: - libreddit + security_opt: + - seccomp="seccomp-libreddit.json" healthcheck: test: ["CMD", "wget", "--spider", "-q", "--tries=1", "http://localhost:8080/settings"] interval: 5m diff --git a/seccomp-libreddit.json b/seccomp-libreddit.json new file mode 100644 index 0000000..264c9b7 --- /dev/null +++ b/seccomp-libreddit.json @@ -0,0 +1,125 @@ +{ + "defaultAction": "SCMP_ACT_ERRNO", + "archMap": [ + { + "architecture": "SCMP_ARCH_X86_64", + "subArchitectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ] + }, + { + "architecture": "SCMP_ARCH_AARCH64", + "subArchitectures": [ + "SCMP_ARCH_ARM" + ] + }, + { + "architecture": "SCMP_ARCH_MIPS64", + "subArchitectures": [ + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64N32" + ] + }, + { + "architecture": "SCMP_ARCH_MIPS64N32", + "subArchitectures": [ + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64" + ] + }, + { + "architecture": "SCMP_ARCH_MIPSEL64", + "subArchitectures": [ + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64N32" + ] + }, + { + "architecture": "SCMP_ARCH_MIPSEL64N32", + "subArchitectures": [ + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64" + ] + }, + { + "architecture": "SCMP_ARCH_S390X", + "subArchitectures": [ + "SCMP_ARCH_S390" + ] + } + ], + "syscalls": [ + { + "names": [ + "accept4", + "arch_prctl", + "bind", + "brk", + "clock_gettime", + "clone", + "close", + "connect", + "epoll_create1", + "epoll_ctl", + "epoll_pwait", + "eventfd2", + "execve", + "exit", + "exit_group", + "fcntl", + "flock", + "fork", + "fstat", + "futex", + "getcwd", + "getpeername", + "getpid", + "getrandom", + "getsockname", + "getsockopt", + "getgid", + "getppid", + "gettid", + "getuid", + "ioctl", + "listen", + "lseek", + "madvise", + "mmap", + "mprotect", + "mremap", + "munmap", + "newfstatat", + "open", + "openat", + "prctl", + "poll", + "read", + "recvfrom", + "rt_sigaction", + "rt_sigprocmask", + "rt_sigreturn", + "sched_getaffinity", + "sched_yield", + "sendto", + "setitimer", + "setsockopt", + "set_tid_address", + "shutdown", + "sigaltstack", + "socket", + "socketpair", + "stat", + "wait4", + "write", + "writev" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": {}, + "excludes": {} + } + ] +}