Merge pull request #21176 from cyphar/fix-apparmor-profile-execpath
profiles: apparmor: remove unused fields
This commit is contained in:
commit
1f40cc15c7
|
|
@ -24,8 +24,6 @@ var (
|
||||||
type profileData struct {
|
type profileData struct {
|
||||||
// Name is profile name.
|
// Name is profile name.
|
||||||
Name string
|
Name string
|
||||||
// ExecPath is the path to the docker binary.
|
|
||||||
ExecPath string
|
|
||||||
// Imports defines the apparmor functions to import, before defining the profile.
|
// Imports defines the apparmor functions to import, before defining the profile.
|
||||||
Imports []string
|
Imports []string
|
||||||
// InnerImports defines the apparmor functions to import in the profile.
|
// 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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if macroExists("tunables/global") {
|
if macroExists("tunables/global") {
|
||||||
p.Imports = append(p.Imports, "#include <tunables/global>")
|
p.Imports = append(p.Imports, "#include <tunables/global>")
|
||||||
} else {
|
} else {
|
||||||
p.Imports = append(p.Imports, "@{PROC}=/proc/")
|
p.Imports = append(p.Imports, "@{PROC}=/proc/")
|
||||||
}
|
}
|
||||||
|
|
||||||
if macroExists("abstractions/base") {
|
if macroExists("abstractions/base") {
|
||||||
p.InnerImports = append(p.InnerImports, "#include <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 {
|
if err := compiled.Execute(out, p); err != nil {
|
||||||
return err
|
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
|
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
||||||
ptrace (trace,read) peer=docker-default,
|
ptrace (trace,read) peer=docker-default,
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if ge .Version 209000}}
|
|
||||||
# docker daemon confinement requires explict allow rule for signal
|
|
||||||
signal (receive) set=(kill,term) peer={{.ExecPath}},
|
|
||||||
{{end}}
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue