build: separate the base-strict abs from the re-attach builder.

Enable the use of the base-strict abs on all setup.
This commit is contained in:
Alexandre Pujol 2025-09-01 15:07:01 +02:00
parent a1ba00bec3
commit 4f9d2703d4
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 37 additions and 7 deletions

View file

@ -0,0 +1,32 @@
// apparmor.d - Full set of apparmor profiles
// Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
// SPDX-License-Identifier: GPL-2.0-only
package builder
import (
"strings"
"github.com/roddhjav/apparmor.d/pkg/prebuild"
)
type BaseStrict struct {
prebuild.Base
}
func init() {
RegisterBuilder(&BaseStrict{
Base: prebuild.Base{
Keyword: "base-strict",
Msg: "Feat: use 'base-strict' as base abstraction",
},
})
}
func (b BaseStrict) Apply(opt *Option, profile string) (string, error) {
profile = strings.ReplaceAll(profile,
"include <abstractions/base>",
"include <abstractions/base-strict>",
)
return profile, nil
}