2024-03-26 00:34:14 +01:00
|
|
|
// apparmor.d - Full set of apparmor profiles
|
|
|
|
// Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
|
|
|
|
package prepare
|
|
|
|
|
|
|
|
import (
|
2024-10-12 16:40:17 +02:00
|
|
|
"github.com/roddhjav/apparmor.d/pkg/paths"
|
2024-10-02 17:22:46 +02:00
|
|
|
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
2024-03-26 00:34:14 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type SystemdDefault struct {
|
2024-10-02 17:22:46 +02:00
|
|
|
prebuild.Base
|
2024-03-26 00:34:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type SystemdEarly struct {
|
2024-10-02 17:22:46 +02:00
|
|
|
prebuild.Base
|
2024-03-26 00:34:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RegisterTask(&SystemdDefault{
|
2024-10-02 17:22:46 +02:00
|
|
|
Base: prebuild.Base{
|
2024-03-26 00:34:14 +01:00
|
|
|
Keyword: "systemd-default",
|
|
|
|
Msg: "Configure systemd unit drop in files to a profile for some units",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
RegisterTask(&SystemdEarly{
|
2024-10-02 17:22:46 +02:00
|
|
|
Base: prebuild.Base{
|
2024-03-26 00:34:14 +01:00
|
|
|
Keyword: "systemd-early",
|
|
|
|
Msg: "Configure systemd unit drop in files to ensure some service start after apparmor",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p SystemdDefault) Apply() ([]string, error) {
|
2024-10-12 16:40:17 +02:00
|
|
|
return []string{}, paths.CopyTo(prebuild.SystemdDir.Join("default"), prebuild.Root.Join("systemd"))
|
2024-03-26 00:34:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p SystemdEarly) Apply() ([]string, error) {
|
2024-10-12 16:40:17 +02:00
|
|
|
return []string{}, paths.CopyTo(prebuild.SystemdDir.Join("early"), prebuild.Root.Join("systemd"))
|
2024-03-26 00:34:14 +01:00
|
|
|
}
|