mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-15 07:54:17 +01:00
35 lines
773 B
Go
35 lines
773 B
Go
// apparmor.d - Full set of apparmor profiles
|
|
// Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
package aa
|
|
|
|
const (
|
|
tokALLOW = "allow"
|
|
tokAUDIT = "audit"
|
|
tokDENY = "deny"
|
|
)
|
|
|
|
type constraint uint
|
|
|
|
const (
|
|
anyKind constraint = iota // The rule can be found in either preamble or profile
|
|
preambleKind // The rule can only be found in the preamble
|
|
blockKind // The rule can only be found in a profile
|
|
)
|
|
|
|
// Rule generic interface for all AppArmor rules
|
|
type Rule interface {
|
|
Less(other any) bool
|
|
Equals(other any) bool
|
|
String() string
|
|
Constraint() constraint
|
|
Kind() string
|
|
}
|
|
|
|
type Rules []Rule
|
|
|
|
func (r Rules) String() string {
|
|
return renderTemplate("rules", r)
|
|
}
|