mirror of
https://github.com/docker/cli.git
synced 2026-01-15 07:40:57 +03:00
Merge pull request #21176 from cyphar/fix-apparmor-profile-execpath
profiles: apparmor: remove unused fields Upstream-commit: 1f40cc15c7776d40e743cc62bf9b1c1dd23ce86e Component: engine
This commit is contained in:
@@ -24,8 +24,6 @@ var (
|
||||
type profileData struct {
|
||||
// Name is profile name.
|
||||
Name string
|
||||
// ExecPath is the path to the docker binary.
|
||||
ExecPath string
|
||||
// Imports defines the apparmor functions to import, before defining the profile.
|
||||
Imports []string
|
||||
// InnerImports defines the apparmor functions to import in the profile.
|
||||
@@ -40,14 +38,23 @@ func (p *profileData) generateDefault(out io.Writer) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if macroExists("tunables/global") {
|
||||
p.Imports = append(p.Imports, "#include <tunables/global>")
|
||||
} else {
|
||||
p.Imports = append(p.Imports, "@{PROC}=/proc/")
|
||||
}
|
||||
|
||||
if macroExists("abstractions/base") {
|
||||
p.InnerImports = append(p.InnerImports, "#include <abstractions/base>")
|
||||
}
|
||||
|
||||
ver, err := aaparser.GetVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.Version = ver
|
||||
|
||||
if err := compiled.Execute(out, p); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -42,9 +42,5 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
|
||||
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
||||
ptrace (trace,read) peer=docker-default,
|
||||
{{end}}
|
||||
{{if ge .Version 209000}}
|
||||
# docker daemon confinement requires explict allow rule for signal
|
||||
signal (receive) set=(kill,term) peer={{.ExecPath}},
|
||||
{{end}}
|
||||
}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user