2024-04-23 22:27:35 +02:00
|
|
|
{{- /* apparmor.d - Full set of apparmor profiles */ -}}
|
|
|
|
{{- /* Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io> */ -}}
|
|
|
|
{{- /* SPDX-License-Identifier: GPL-2.0-only */ -}}
|
|
|
|
|
|
|
|
{{- define "rules" -}}
|
|
|
|
|
|
|
|
{{- $oldtype := "" -}}
|
|
|
|
{{- range . -}}
|
|
|
|
{{- $type := typeof . -}}
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- if eq $type "" -}}
|
|
|
|
{{- "\n" -}}
|
|
|
|
{{- continue -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if eq $type "Comment" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "comment" . -}}
|
|
|
|
{{- "\n" -}}
|
|
|
|
{{- continue -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if and (ne $type $oldtype) (ne $oldtype "") -}}
|
|
|
|
{{- "\n" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- indent "" -}}
|
|
|
|
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- if eq $type "Abi" -}}
|
|
|
|
{{- template "abi" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Alias" -}}
|
|
|
|
{{- template "alias" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- if eq $type "Include" -}}
|
|
|
|
{{- template "include" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- if eq $type "Variable" -}}
|
|
|
|
{{- template "variable" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-25 15:01:04 +02:00
|
|
|
{{- if eq $type "All" -}}
|
|
|
|
{{- template "all" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- if eq $type "Rlimit" -}}
|
|
|
|
{{- template "rlimit" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Userns" -}}
|
|
|
|
{{- template "userns" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Capability" -}}
|
|
|
|
{{- template "capability" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Network" -}}
|
|
|
|
{{- template "network" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Mount" -}}
|
|
|
|
{{- template "mount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Remount" -}}
|
|
|
|
{{- template "remount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Umount" -}}
|
|
|
|
{{- template "umount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "PivotRoot" -}}
|
|
|
|
{{- template "pivot_root" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "ChangeProfile" -}}
|
|
|
|
{{- template "change_profile" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Mqueue" -}}
|
|
|
|
{{- template "mqueue" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-25 15:01:04 +02:00
|
|
|
{{- if eq $type "IOUring" -}}
|
|
|
|
{{- template "io_uring" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- if eq $type "Unix" -}}
|
|
|
|
{{- template "unix" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Ptrace" -}}
|
|
|
|
{{- template "ptrace" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Signal" -}}
|
|
|
|
{{- template "signal" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Dbus" -}}
|
|
|
|
{{- template "dbus" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "File" -}}
|
|
|
|
{{- template "file" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $type "Profile" -}}
|
|
|
|
{{- template "profile" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- "\n" -}}
|
|
|
|
{{- $oldtype = $type -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- end -}}
|