2023-09-25 01:22:41 +02:00
|
|
|
// apparmor.d - Full set of apparmor profiles
|
|
|
|
// Copyright (C) 2021-2023 Alexandre Pujol <alexandre@pujol.io>
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
|
|
|
|
package aa
|
|
|
|
|
|
|
|
var (
|
2023-09-30 14:55:56 +02:00
|
|
|
// Include
|
|
|
|
includeLocal1 = &Include{
|
|
|
|
IfExists: true,
|
|
|
|
IsMagic: true,
|
|
|
|
Path: "local/foo",
|
|
|
|
}
|
|
|
|
|
2023-09-25 01:22:41 +02:00
|
|
|
// Capability
|
|
|
|
capability1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "cap",
|
|
|
|
"operation": "capable",
|
|
|
|
"capname": "net_admin",
|
|
|
|
"capability": "12",
|
|
|
|
"profile": "pkexec",
|
|
|
|
"comm": "pkexec",
|
|
|
|
}
|
2023-09-29 21:10:38 +02:00
|
|
|
capability1 = &Capability{Name: "net_admin"}
|
|
|
|
capability2 = &Capability{Name: "sys_ptrace"}
|
2023-09-25 01:22:41 +02:00
|
|
|
|
|
|
|
// Network
|
|
|
|
network1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "net",
|
|
|
|
"operation": "create",
|
|
|
|
"family": "netlink",
|
|
|
|
"profile": "sddm-greeter",
|
|
|
|
"sock_type": "raw",
|
|
|
|
"protocol": "15",
|
|
|
|
"requested_mask": "create",
|
|
|
|
"denied_mask": "create",
|
|
|
|
"comm": "sddm-greeter",
|
|
|
|
}
|
|
|
|
network1 = &Network{
|
2023-09-29 21:10:38 +02:00
|
|
|
Domain: "netlink",
|
|
|
|
Type: "raw",
|
|
|
|
Protocol: "15",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
network2 = &Network{
|
2023-09-29 21:10:38 +02:00
|
|
|
Domain: "inet",
|
|
|
|
Type: "dgram",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Mount
|
|
|
|
mount1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "mount",
|
|
|
|
"operation": "mount",
|
|
|
|
"info": "failed perms check",
|
|
|
|
"error": "-13",
|
|
|
|
"profile": "dockerd",
|
|
|
|
"name": "/var/lib/docker/overlay2/opaque-bug-check1209538631/merged/",
|
|
|
|
"comm": "dockerd",
|
|
|
|
"fstype": "overlay",
|
|
|
|
"srcname": "overlay",
|
|
|
|
}
|
|
|
|
mount2Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "mount",
|
|
|
|
"operation": "mount",
|
2023-09-29 21:10:38 +02:00
|
|
|
"info": "failed perms check", // TODO: not attach_disconnected
|
2023-09-25 01:22:41 +02:00
|
|
|
"error": "-13",
|
|
|
|
"profile": "dockerd",
|
|
|
|
"name": "/var/lib/docker/overlay2/metacopy-check906831159/merged/",
|
|
|
|
"comm": "dockerd",
|
|
|
|
"fstype": "overlay",
|
|
|
|
"srcname": "overlay",
|
|
|
|
}
|
|
|
|
mount1 = &Mount{
|
2023-09-29 21:10:38 +02:00
|
|
|
MountConditions: MountConditions{FsType: "overlay", Options: []string{}},
|
|
|
|
Source: "overlay",
|
|
|
|
MountPoint: "/var/lib/docker/overlay2/opaque-bug-check1209538631/merged/",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
mount2 = &Mount{
|
2023-09-29 21:10:38 +02:00
|
|
|
MountConditions: MountConditions{FsType: "overlay", Options: []string{}},
|
|
|
|
Source: "overlay",
|
|
|
|
MountPoint: "/var/lib/docker/overlay2/metacopy-check906831159/merged/",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Signal
|
|
|
|
signal1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "signal",
|
|
|
|
"profile": "firefox",
|
|
|
|
"operation": "signal",
|
|
|
|
"comm": "49504320492F4F20506172656E74",
|
|
|
|
"requested_mask": "receive",
|
|
|
|
"denied_mask": "receive",
|
|
|
|
"signal": "kill",
|
|
|
|
"peer": "firefox//&firejail-default",
|
|
|
|
}
|
|
|
|
signal1 = &Signal{
|
2023-09-29 21:10:38 +02:00
|
|
|
Access: "receive",
|
|
|
|
Set: "kill",
|
|
|
|
Peer: "firefox//&firejail-default",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
signal2 = &Signal{
|
2023-09-29 21:10:38 +02:00
|
|
|
Access: "receive",
|
|
|
|
Set: "up",
|
|
|
|
Peer: "firefox//&firejail-default",
|
2023-09-25 01:22:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Ptrace
|
|
|
|
ptrace1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"class": "ptrace",
|
|
|
|
"profile": "xdg-document-portal",
|
|
|
|
"operation": "ptrace",
|
|
|
|
"comm": "pool-/usr/lib/x",
|
|
|
|
"requested_mask": "read",
|
|
|
|
"denied_mask": "read",
|
|
|
|
"peer": "nautilus",
|
|
|
|
}
|
|
|
|
ptrace2Log = map[string]string{
|
|
|
|
"apparmor": "DENIED",
|
|
|
|
"class": "ptrace",
|
|
|
|
"operation": "ptrace",
|
|
|
|
"comm": "systemd-journal",
|
|
|
|
"requested_mask": "readby",
|
|
|
|
"denied_mask": "readby",
|
|
|
|
"peer": "systemd-journald",
|
|
|
|
}
|
|
|
|
ptrace1 = &Ptrace{
|
|
|
|
Qualifier: Qualifier{},
|
|
|
|
Access: "read",
|
|
|
|
Peer: "nautilus",
|
|
|
|
}
|
|
|
|
ptrace2 = &Ptrace{
|
|
|
|
Qualifier: Qualifier{},
|
|
|
|
Access: "readby",
|
|
|
|
Peer: "systemd-journald",
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unix
|
|
|
|
unix1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
2023-09-29 21:01:30 +02:00
|
|
|
"class": "unix",
|
2023-09-25 01:22:41 +02:00
|
|
|
"family": "unix",
|
|
|
|
"operation": "file_perm",
|
|
|
|
"profile": "gsettings",
|
|
|
|
"comm": "dbus-daemon",
|
|
|
|
"requested_mask": "send receive",
|
|
|
|
"addr": "none",
|
|
|
|
"peer_addr": "@/tmp/dbus-AaKMpxzC4k",
|
|
|
|
"peer": "dbus-daemon",
|
|
|
|
"denied_mask": "send receive",
|
|
|
|
"sock_type": "stream",
|
|
|
|
"protocol": "0",
|
|
|
|
}
|
|
|
|
unix1 = &Unix{
|
|
|
|
Access: "send receive",
|
|
|
|
Type: "stream",
|
|
|
|
Protocol: "0",
|
|
|
|
Address: "none",
|
|
|
|
Peer: "dbus-daemon",
|
|
|
|
PeerAddr: "@/tmp/dbus-AaKMpxzC4k",
|
|
|
|
}
|
|
|
|
unix2 = &Unix{
|
|
|
|
Qualifier: Qualifier{FileInherit: true},
|
|
|
|
Access: "receive",
|
|
|
|
Type: "stream",
|
|
|
|
}
|
|
|
|
|
|
|
|
// Dbus
|
|
|
|
dbus1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"operation": "dbus_method_call",
|
|
|
|
"bus": "session",
|
|
|
|
"path": "/org/gtk/vfs/metadata",
|
|
|
|
"interface": "org.gtk.vfs.Metadata",
|
|
|
|
"member": "Remove",
|
|
|
|
"name": ":1.15",
|
|
|
|
"mask": "receive",
|
|
|
|
"label": "gvfsd-metadata",
|
|
|
|
"peer_pid": "3888",
|
|
|
|
"peer_label": "tracker-extract",
|
|
|
|
}
|
|
|
|
dbus2Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"operation": "dbus_bind",
|
|
|
|
"bus": "session",
|
|
|
|
"name": "org.gnome.evolution.dataserver.Sources5",
|
|
|
|
"mask": "bind",
|
|
|
|
"pid": "3442",
|
|
|
|
"label": "evolution-source-registry",
|
|
|
|
}
|
|
|
|
dbus1 = &Dbus{
|
|
|
|
Access: "receive",
|
|
|
|
Bus: "session",
|
|
|
|
Name: ":1.15",
|
|
|
|
Path: "/org/gtk/vfs/metadata",
|
|
|
|
Interface: "org.gtk.vfs.Metadata",
|
|
|
|
Member: "Remove",
|
|
|
|
Label: "tracker-extract",
|
|
|
|
}
|
|
|
|
dbus2 = &Dbus{
|
|
|
|
Access: "bind",
|
|
|
|
Bus: "session",
|
|
|
|
Name: "org.gnome.evolution.dataserver.Sources5",
|
|
|
|
}
|
|
|
|
|
|
|
|
// File
|
|
|
|
file1Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"operation": "open",
|
|
|
|
"class": "file",
|
|
|
|
"profile": "cupsd",
|
|
|
|
"name": "/usr/share/poppler/cMap/Identity-H",
|
|
|
|
"comm": "gs",
|
|
|
|
"requested_mask": "r",
|
|
|
|
"denied_mask": "r",
|
|
|
|
"fsuid": "209",
|
|
|
|
"FSUID": "cups",
|
|
|
|
"ouid": "0",
|
|
|
|
"OUID": "root",
|
|
|
|
}
|
|
|
|
file2Log = map[string]string{
|
|
|
|
"apparmor": "ALLOWED",
|
|
|
|
"operation": "open",
|
|
|
|
"class": "file",
|
|
|
|
"profile": "gsd-print-notifications",
|
2023-09-30 14:54:04 +02:00
|
|
|
"name": "@{PROC}/4163/cgroup",
|
2023-09-25 01:22:41 +02:00
|
|
|
"comm": "gsd-print-notif",
|
|
|
|
"requested_mask": "r",
|
|
|
|
"denied_mask": "r",
|
|
|
|
"fsuid": "1000",
|
|
|
|
"FSUID": "user",
|
|
|
|
"ouid": "1000",
|
|
|
|
"OUID": "user",
|
|
|
|
"error": "-1",
|
|
|
|
}
|
|
|
|
file1 = &File{
|
|
|
|
Path: "/usr/share/poppler/cMap/Identity-H",
|
|
|
|
Access: "r",
|
|
|
|
Target: "",
|
|
|
|
}
|
|
|
|
file2 = &File{
|
|
|
|
Qualifier: Qualifier{Owner: true, NoNewPrivs: true},
|
2023-09-30 14:54:04 +02:00
|
|
|
Path: "@{PROC}/4163/cgroup",
|
2023-09-25 01:22:41 +02:00
|
|
|
Access: "r",
|
|
|
|
Target: "",
|
|
|
|
}
|
|
|
|
)
|