feat: add golang support
This commit is contained in:
parent
ae91f2c3f5
commit
355619e85d
25
rules/lang_go.c
Normal file
25
rules/lang_go.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include "rules.h"
|
||||||
|
|
||||||
|
#include <seccomp.h>
|
||||||
|
|
||||||
|
void setup_lang_go(scmp_filter_ctx ctx) {
|
||||||
|
int white[] = {
|
||||||
|
SCMP_SYS(rt_sigaction), // 13
|
||||||
|
SCMP_SYS(rt_sigprocmask), // 14
|
||||||
|
SCMP_SYS(madvise), // 28
|
||||||
|
SCMP_SYS(clone), // 56
|
||||||
|
SCMP_SYS(sigaltstack), // 131
|
||||||
|
SCMP_SYS(arch_prctl), // 158
|
||||||
|
SCMP_SYS(gettid), // 186
|
||||||
|
SCMP_SYS(sched_getaffinity), // 204
|
||||||
|
SCMP_SYS(exit_group), // 231
|
||||||
|
};
|
||||||
|
ADD_RULE_LIST(white, SCMP_ACT_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct rule lang_go_rule = {
|
||||||
|
.name = "go",
|
||||||
|
.setup = setup_lang_go,
|
||||||
|
};
|
||||||
|
|
||||||
|
void __attribute__((constructor(101))) register_lang_go(void) { register_rule(&lang_go_rule); }
|
Loading…
Reference in New Issue
Block a user