mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-31 07:17:22 +01:00
feat(aa-log): correctly handle remount rule from mount log.
This commit is contained in:
parent
06abeac2ee
commit
3d4dd5c91a
2 changed files with 13 additions and 9 deletions
|
@ -91,15 +91,19 @@ func (p *AppArmorProfile) AddRule(log map[string]string) {
|
||||||
p.Rules = append(p.Rules, NetworkFromLog(log))
|
p.Rules = append(p.Rules, NetworkFromLog(log))
|
||||||
}
|
}
|
||||||
case "mount":
|
case "mount":
|
||||||
switch log["operation"] {
|
if strings.Contains(log["flags"], "remount") {
|
||||||
case "mount":
|
|
||||||
p.Rules = append(p.Rules, MountFromLog(log))
|
|
||||||
case "umount":
|
|
||||||
p.Rules = append(p.Rules, UmountFromLog(log))
|
|
||||||
case "remount":
|
|
||||||
p.Rules = append(p.Rules, RemountFromLog(log))
|
p.Rules = append(p.Rules, RemountFromLog(log))
|
||||||
case "pivotroot":
|
} else {
|
||||||
p.Rules = append(p.Rules, PivotRootFromLog(log))
|
switch log["operation"] {
|
||||||
|
case "mount":
|
||||||
|
p.Rules = append(p.Rules, MountFromLog(log))
|
||||||
|
case "umount":
|
||||||
|
p.Rules = append(p.Rules, UmountFromLog(log))
|
||||||
|
case "remount":
|
||||||
|
p.Rules = append(p.Rules, RemountFromLog(log))
|
||||||
|
case "pivotroot":
|
||||||
|
p.Rules = append(p.Rules, PivotRootFromLog(log))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case "posix_mqueue", "sysv_mqueue":
|
case "posix_mqueue", "sysv_mqueue":
|
||||||
p.Rules = append(p.Rules, MqueueFromLog(log))
|
p.Rules = append(p.Rules, MqueueFromLog(log))
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
{{- with .Options -}}
|
{{- with .Options -}}
|
||||||
{{ " options=(" }}{{ join . }}{{ ")" }}
|
{{ " options=(" }}{{ join . }}{{ ")" }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with .Remount -}}
|
{{- with .MountPoint -}}
|
||||||
{{ " " }}{{ . }}
|
{{ " " }}{{ . }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- "," -}}
|
{{- "," -}}
|
||||||
|
|
Loading…
Reference in a new issue