diff --git a/pkg/aa/profile.go b/pkg/aa/profile.go index eb56ec7e..2d74f7d0 100644 --- a/pkg/aa/profile.go +++ b/pkg/aa/profile.go @@ -91,15 +91,19 @@ func (p *AppArmorProfile) AddRule(log map[string]string) { p.Rules = append(p.Rules, NetworkFromLog(log)) } case "mount": - switch log["operation"] { - case "mount": - p.Rules = append(p.Rules, MountFromLog(log)) - case "umount": - p.Rules = append(p.Rules, UmountFromLog(log)) - case "remount": + if strings.Contains(log["flags"], "remount") { p.Rules = append(p.Rules, RemountFromLog(log)) - case "pivotroot": - p.Rules = append(p.Rules, PivotRootFromLog(log)) + } else { + 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": p.Rules = append(p.Rules, MqueueFromLog(log)) diff --git a/pkg/aa/templates/profile.j2 b/pkg/aa/templates/profile.j2 index f275a1d0..da406e86 100644 --- a/pkg/aa/templates/profile.j2 +++ b/pkg/aa/templates/profile.j2 @@ -124,7 +124,7 @@ {{- with .Options -}} {{ " options=(" }}{{ join . }}{{ ")" }} {{- end -}} - {{- with .Remount -}} + {{- with .MountPoint -}} {{ " " }}{{ . }} {{- end -}} {{- "," -}}