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" -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- $oldkind := "" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- range . -}}
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- $kind := kindof . -}}
|
|
|
|
{{- if eq $kind "" -}}
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- "\n" -}}
|
|
|
|
{{- continue -}}
|
|
|
|
{{- end -}}
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "comment" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "comment" . -}}
|
|
|
|
{{- "\n" -}}
|
|
|
|
{{- continue -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if and (ne $kind $oldkind) (ne $oldkind "") -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- "\n" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- indent "" -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "abi" -}}
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- template "abi" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "alias" -}}
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- template "alias" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "include" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "include" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "variable" -}}
|
2024-05-05 00:25:55 +02:00
|
|
|
{{- template "variable" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "all" -}}
|
2024-04-25 15:01:04 +02:00
|
|
|
{{- template "all" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "rlimit" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "rlimit" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "userns" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "userns" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "capability" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "capability" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "network" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "network" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "mount" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "mount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "remount" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "remount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "umount" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "umount" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "pivot_root" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "pivot_root" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "change_profile" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "change_profile" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "mqueue" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "mqueue" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "io_uring" -}}
|
2024-04-25 15:01:04 +02:00
|
|
|
{{- template "io_uring" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "unix" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "unix" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "ptrace" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "ptrace" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "signal" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "signal" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "dbus" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "dbus" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "file" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "file" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "link" -}}
|
2024-05-25 22:56:28 +02:00
|
|
|
{{- template "link" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- if eq $kind "profile" -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- template "profile" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-05-28 19:16:21 +02:00
|
|
|
{{- if eq $kind "hat" -}}
|
|
|
|
{{- template "hat" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- "\n" -}}
|
2024-05-28 19:15:22 +02:00
|
|
|
{{- $oldkind = $kind -}}
|
2024-04-23 22:27:35 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- end -}}
|