-
Notifications
You must be signed in to change notification settings - Fork 696
Expand file tree
/
Copy pathdevlxd.go
More file actions
67 lines (57 loc) · 1.97 KB
/
Copy pathdevlxd.go
File metadata and controls
67 lines (57 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2025 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package builtin
const devlxdSummary = `allows access to the LXD devlxd socket`
const devlxdBaseDeclarationPlugs = `
devlxd:
allow-installation: false
deny-auto-connection: true
`
const devlxdBaseDeclarationSlots = `
devlxd:
allow-installation:
slot-snap-type:
- core
deny-auto-connection: true
`
const devlxdConnectedPlugAppArmor = `
# Description: This gives access to the devlxd API for use by snaps running
# inside LXD instances (VMs and containers).
# Socket path used inside VM instances
/dev/lxd/sock rw,
# Socket path used inside container instances (bind-mounted to /dev/lxd/sock);
# AppArmor resolves through the bind mount so both paths are required.
/var/snap/lxd/common/lxd/devlxd/sock rw,
`
const devlxdConnectedPlugSecComp = `
# Description: This gives access to the devlxd API for use by snaps running
# inside LXD instances (VMs and containers).
socket AF_NETLINK - NETLINK_GENERIC
`
func init() {
registerIface(&commonInterface{
name: "devlxd",
summary: devlxdSummary,
implicitOnCore: true,
implicitOnClassic: true,
baseDeclarationPlugs: devlxdBaseDeclarationPlugs,
baseDeclarationSlots: devlxdBaseDeclarationSlots,
connectedPlugAppArmor: devlxdConnectedPlugAppArmor,
connectedPlugSecComp: devlxdConnectedPlugSecComp,
})
}