github.com/ethanhsieh/snapd@v0.0.0-20210615102523-3db9b8e4edc5/interfaces/builtin/tee.go (about) 1 // -*- Mode: Go; indent-tabs-mode: t -*- 2 3 /* 4 * Copyright (C) 2021 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 teeSummary = `allows access to Trusted Execution Environment devices` 23 24 const teeBaseDeclarationSlots = ` 25 tee: 26 allow-installation: 27 slot-snap-type: 28 - core 29 deny-auto-connection: true 30 ` 31 32 const teeBaseDeclarationPlugs = ` 33 tee: 34 allow-installation: false 35 deny-auto-connection: true 36 ` 37 38 const teeConnectedPlugAppArmor = ` 39 # Description: for those who need to talk to the TEE subsystem over 40 # /dev/tee[0-9]* and/or /dev/teepriv[0-0]* 41 42 /dev/tee[0-9]* rw, 43 /dev/teepriv[0-9]* rw, 44 ` 45 46 var teeConnectedPlugUDev = []string{ 47 `KERNEL=="tee[0-9]*"`, 48 `KERNEL=="teepriv[0-9]*"`, 49 } 50 51 func init() { 52 registerIface(&commonInterface{ 53 name: "tee", 54 summary: teeSummary, 55 implicitOnCore: true, 56 implicitOnClassic: true, 57 baseDeclarationSlots: teeBaseDeclarationSlots, 58 baseDeclarationPlugs: teeBaseDeclarationPlugs, 59 connectedPlugAppArmor: teeConnectedPlugAppArmor, 60 connectedPlugUDev: teeConnectedPlugUDev, 61 }) 62 }