Documentation ¶
Overview ¶
Package dbus implements interaction between snappy and dbus.
Snappy creates dbus configuration files that describe how various services on the system bus can communicate with other peers.
Each configuration is an XML file containing <busconfig>...</busconfig>. Particular security snippets define whole <policy>...</policy> entires. This is explained in detail in https://dbus.freedesktop.org/doc/dbus-daemon.1.html
Package dbus implements interaction between snappy and dbus.
Snappy creates dbus configuration files that describe how various services on the system bus can communicate with other peers.
Each configuration is an XML file containing <busconfig>...</busconfig>. Particular security snippets define whole <policy>...</policy> entires.
NOTE: This interacts with systemd. TODO: Explain how this works (security).
Index ¶
- func SafePath(s string) string
- type Backend
- func (b *Backend) Initialize() error
- func (b *Backend) Name() interfaces.SecuritySystem
- func (b *Backend) NewSpecification() interfaces.Specification
- func (b *Backend) Remove(snapName string) error
- func (b *Backend) SandboxFeatures() []string
- func (b *Backend) Setup(snapInfo *snap.Info, opts interfaces.ConfinementOptions, ...) error
- type Specification
- func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
- func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
- func (spec *Specification) AddSnippet(snippet string)
- func (spec *Specification) SecurityTags() []string
- func (spec *Specification) SnippetForTag(tag string) string
- func (spec *Specification) Snippets() map[string][]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct{}
Backend is responsible for maintaining DBus policy files.
func (*Backend) Name ¶
func (b *Backend) Name() interfaces.SecuritySystem
Name returns the name of the backend.
func (*Backend) NewSpecification ¶
func (b *Backend) NewSpecification() interfaces.Specification
func (*Backend) Remove ¶
Remove removes dbus configuration files of a given snap.
This method should be called after removing a snap.
func (*Backend) SandboxFeatures ¶
SandboxFeatures returns list of features supported by snapd for dbus communication.
func (*Backend) Setup ¶
func (b *Backend) Setup(snapInfo *snap.Info, opts interfaces.ConfinementOptions, repo *interfaces.Repository, tm timings.Measurer) error
Setup creates dbus configuration files specific to a given snap.
DBus has no concept of a complain mode so confinment type is ignored.
type Specification ¶
type Specification struct {
// contains filtered or unexported fields
}
Specification keeps all the dbus snippets.
func (*Specification) AddConnectedPlug ¶
func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedPlug records dbus-specific side-effects of having a connected plug.
func (*Specification) AddConnectedSlot ¶
func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedSlot records dbus-specific side-effects of having a connected slot.
func (*Specification) AddPermanentPlug ¶
func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
AddPermanentPlug records dbus-specific side-effects of having a plug.
func (*Specification) AddPermanentSlot ¶
func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
AddPermanentSlot records dbus-specific side-effects of having a slot.
func (*Specification) AddSnippet ¶
func (spec *Specification) AddSnippet(snippet string)
AddSnippet adds a new dbus snippet.
func (*Specification) SecurityTags ¶
func (spec *Specification) SecurityTags() []string
SecurityTags returns a list of security tags which have a snippet.
func (*Specification) SnippetForTag ¶
func (spec *Specification) SnippetForTag(tag string) string
SnippetForTag returns a combined snippet for given security tag with individual snippets joined with newline character. Empty string is returned for non-existing security tag.
func (*Specification) Snippets ¶
func (spec *Specification) Snippets() map[string][]string
Snippets returns a deep copy of all the added snippets.