Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions runsc/fsgofer/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ type Options struct {
CgoEnabled bool
}

// Install installs seccomp filters.
func Install(opt Options) error {
s := allowedSyscalls
// Rules returns the seccomp rules for a gofer process without installing
// them. Callers can merge additional rules before building and installing
// the seccomp program. This is useful for custom gofer implementations
// that need the stock gofer's baseline syscall allowlist but also require
// additional syscalls (e.g. for networking or namespace switching).
func Rules(opt Options) seccomp.SyscallRules {
s := allowedSyscalls.Copy()

if opt.ProfileEnabled {
report("profile enabled: syscall filters less restrictive!")
Expand Down Expand Up @@ -65,6 +69,13 @@ func Install(opt Options) error {
s.Merge(lisafsFilters)
}

return s
}

// Install installs seccomp filters.
func Install(opt Options) error {
s := Rules(opt)

program := &seccomp.Program{
RuleSets: []seccomp.RuleSet{
{
Expand Down
Loading