Skip to content

Commit

Permalink
WIP: ship minimal seccomp profile
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hunt <pehunt@redhat.com>
  • Loading branch information
haircommander committed Feb 2, 2022
1 parent f545f4d commit 8fe261a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/config/seccomp/seccomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ func (c *Config) LoadProfile(profilePath string) error {
c.profile = seccomp.DefaultProfile()
logrus.Info("No seccomp profile specified, using the internal default")

c.profile.DefaultAction = seccomp.ActAllow
c.profile.DefaultErrnoRet = nil
c.profile.Syscalls = []*seccomp.Syscall{
&seccomp.Syscall{
Names: []string{
"unshare",
},
Action: seccomp.ActErrno,
Excludes: seccomp.Filter{
Caps: []string{
"CAP_SYS_ADMIN",
},
},
},
}

if logrus.IsLevelEnabled(logrus.TraceLevel) {
profileString, err := json.MarshalToString(c.profile)
if err != nil {
Expand Down

0 comments on commit 8fe261a

Please sign in to comment.