sandbox/seccomp: rename flag type and constants
All checks were successful
Test / Create distribution (push) Successful in 27s
Test / Sandbox (push) Successful in 1m38s
Test / Fortify (push) Successful in 2m39s
Test / Sandbox (race detector) (push) Successful in 2m55s
Test / Fpkg (push) Successful in 3m26s
Test / Fortify (race detector) (push) Successful in 4m5s
Test / Flake checks (push) Successful in 56s

The names are ambiguous. Rename them to make more sense.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-04-08 01:59:45 +09:00
parent 50127ed5f9
commit 584405f7cc
14 changed files with 64 additions and 62 deletions

View File

@@ -27,18 +27,18 @@ const (
FAllowNet
)
func (flags HardeningFlags) seccomp(opts seccomp.SyscallOpts) seccomp.SyscallOpts {
func (flags HardeningFlags) seccomp(opts seccomp.FilterOpts) seccomp.FilterOpts {
if flags&FSyscallCompat == 0 {
opts |= seccomp.FlagExt
opts |= seccomp.FilterExt
}
if flags&FAllowDevel == 0 {
opts |= seccomp.FlagDenyDevel
opts |= seccomp.FilterDenyDevel
}
if flags&FAllowUserns == 0 {
opts |= seccomp.FlagDenyNS
opts |= seccomp.FilterDenyNS
}
if flags&FAllowTTY == 0 {
opts |= seccomp.FlagDenyTTY
opts |= seccomp.FilterDenyTTY
}
return opts
}
@@ -95,7 +95,7 @@ type (
// Sequential container setup ops.
*Ops
// Extra seccomp options.
Seccomp seccomp.SyscallOpts
Seccomp seccomp.FilterOpts
// Permission bits of newly created parent directories.
// The zero value is interpreted as 0755.
ParentPerm os.FileMode