gitee.com/mysnapcore/mysnapd@v0.1.0/interfaces/builtin/microceph.go (about) 1 // -*- Mode: Go; indent-tabs-mode: t -*- 2 3 /* 4 * Copyright (C) 2022 Canonical Ltd 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 3 as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 package builtin 21 22 const microcephSummary = `allows access to the MicroCeph socket` 23 24 const microcephBaseDeclarationSlots = ` 25 microceph: 26 allow-installation: false 27 deny-connection: true 28 deny-auto-connection: true 29 ` 30 31 const microcephConnectedPlugAppArmor = ` 32 # Description: allow access to the MicroCeph control socket. 33 34 /var/snap/microceph/common/state/control.socket rw, 35 ` 36 37 const microcephConnectedPlugSecComp = ` 38 # Description: allow access to the MicroCeph control socket. 39 40 socket AF_NETLINK - NETLINK_GENERIC 41 ` 42 43 func init() { 44 registerIface(&commonInterface{ 45 name: "microceph", 46 summary: microcephSummary, 47 baseDeclarationSlots: microcephBaseDeclarationSlots, 48 connectedPlugAppArmor: microcephConnectedPlugAppArmor, 49 connectedPlugSecComp: microcephConnectedPlugSecComp, 50 }) 51 }