summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/security.go
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@suse.com>2020-08-10 10:16:28 +0200
committerSascha Grunert <sgrunert@suse.com>2020-08-11 11:18:52 +0200
commit97a2c86aab36f4d931371e4ac80d45d70aa575d2 (patch)
tree5556fab1ee3df6b6ce9cf41d684016a9dd0127a4 /pkg/specgen/generate/security.go
parent68fd9aa2cf67a749258ccdc6fa8fd89c2557ebfc (diff)
downloadpodman-97a2c86aab36f4d931371e4ac80d45d70aa575d2.tar.gz
podman-97a2c86aab36f4d931371e4ac80d45d70aa575d2.tar.bz2
podman-97a2c86aab36f4d931371e4ac80d45d70aa575d2.zip
Allow specifying seccomp profiles for privileged containers
To sync the behavior between AppArmor and seccomp it is now possible to also specify seccomp profiles for privileged containers. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'pkg/specgen/generate/security.go')
-rw-r--r--pkg/specgen/generate/security.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/specgen/generate/security.go b/pkg/specgen/generate/security.go
index 4352ef718..5e4cc3399 100644
--- a/pkg/specgen/generate/security.go
+++ b/pkg/specgen/generate/security.go
@@ -158,8 +158,9 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator,
configSpec.Linux.Seccomp = seccompConfig
}
- // Clear default Seccomp profile from Generator for privileged containers
- if s.SeccompProfilePath == "unconfined" || s.Privileged {
+ // Clear default Seccomp profile from Generator for unconfined containers
+ // and privileged containers which do not specify a seccomp profile.
+ if s.SeccompProfilePath == "unconfined" || (s.Privileged && (s.SeccompProfilePath == config.SeccompOverridePath || s.SeccompProfilePath == config.SeccompDefaultPath)) {
configSpec.Linux.Seccomp = nil
}