From e9fa0660f8663e1701782ef6961edeb2d71e6bf6 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Tue, 23 Apr 2024 21:18:44 +0100 Subject: [PATCH] feat(aa): add define parameter for variables. --- pkg/aa/apparmor_test.go | 2 +- pkg/aa/preamble.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/aa/apparmor_test.go b/pkg/aa/apparmor_test.go index 3c1bcaa1..ae39caef 100644 --- a/pkg/aa/apparmor_test.go +++ b/pkg/aa/apparmor_test.go @@ -47,7 +47,7 @@ func TestAppArmorProfile_String(t *testing.T) { Includes: []*Include{{IsMagic: true, Path: "tunables/global"}}, Aliases: []*Alias{{Path: "/mnt/usr", RewrittenPath: "/usr"}}, Variables: []*Variable{{ - Name: "exec_path", + Name: "exec_path", Define: true, Values: []string{"@{bin}/foo", "@{lib}/foo"}, }}, }, diff --git a/pkg/aa/preamble.go b/pkg/aa/preamble.go index 8b650629..d10b4dfb 100644 --- a/pkg/aa/preamble.go +++ b/pkg/aa/preamble.go @@ -73,6 +73,9 @@ type Variable struct { RuleBase Name string Values []string + Define bool +} + } func (r *Variable) Less(other any) bool {