feat(aa): add some missing rule template.

This commit is contained in:
Alexandre Pujol 2024-04-25 14:01:04 +01:00
parent 978daa446b
commit 068373405f
Failed to generate hash of commit
4 changed files with 36 additions and 2 deletions

View file

@ -53,7 +53,9 @@ var (
// The order the apparmor rules should be sorted // The order the apparmor rules should be sorted
ruleAlphabet = []string{ ruleAlphabet = []string{
"include", "include",
"all",
"rlimit", "rlimit",
"userns",
"capability", "capability",
"network", "network",
"mount", "mount",
@ -62,11 +64,10 @@ var (
"pivotroot", "pivotroot",
"changeprofile", "changeprofile",
"mqueue", "mqueue",
"iouring",
"signal", "signal",
"ptrace", "ptrace",
"unix", "unix",
"userns",
"iouring",
"dbus", "dbus",
"file", "file",
"profile", "profile",

View file

@ -0,0 +1,9 @@
{{- /* apparmor.d - Full set of apparmor profiles */ -}}
{{- /* Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io> */ -}}
{{- /* SPDX-License-Identifier: GPL-2.0-only */ -}}
{{- define "all" -}}
{{- "all" -}}
{{- "," -}}
{{- template "comment" . -}}
{{- end -}}

View file

@ -0,0 +1,16 @@
{{- /* apparmor.d - Full set of apparmor profiles */ -}}
{{- /* Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io> */ -}}
{{- /* SPDX-License-Identifier: GPL-2.0-only */ -}}
{{- define "io_uring" -}}
{{- template "qualifier" . -}}
{{- "io_uring" -}}
{{- range .Access -}}
{{ " " }}{{ . }}
{{- end -}}
{{- with .Label -}}
{{ " label=" }}{{ . }}
{{- end -}}
{{- "," -}}
{{- template "comment" . -}}
{{- end -}}

View file

@ -22,6 +22,10 @@
{{- template "include" . -}} {{- template "include" . -}}
{{- end -}} {{- end -}}
{{- if eq $type "All" -}}
{{- template "all" . -}}
{{- end -}}
{{- if eq $type "Rlimit" -}} {{- if eq $type "Rlimit" -}}
{{- template "rlimit" . -}} {{- template "rlimit" . -}}
{{- end -}} {{- end -}}
@ -62,6 +66,10 @@
{{- template "mqueue" . -}} {{- template "mqueue" . -}}
{{- end -}} {{- end -}}
{{- if eq $type "IOUring" -}}
{{- template "io_uring" . -}}
{{- end -}}
{{- if eq $type "Unix" -}} {{- if eq $type "Unix" -}}
{{- template "unix" . -}} {{- template "unix" . -}}
{{- end -}} {{- end -}}