Skip to content

Commit fdea75d

Browse files
authored
Merge pull request sonic-net#1 from mikelazar/dbus-container--to-host-doc
Dbus container to host doc
2 parents 4ad6c54 + e3fe0cf commit fdea75d

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

doc/mgmt/Docker to Host communication.md

+35-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Docker to Host communication
1818
| Rev | Date | Author | Change Description |
1919
|:---:|:-----------:|:------------------:|-----------------------------------|
2020
| 0.1 | 10/28/2019 | Nirenjan Krishnan | Initial version |
21+
|:---:|:-----------:|:------------------:|-----------------------------------|
22+
| 0.2 | 12/16/2019 | Mike Lazar | Add details about architecture |
23+
2124

2225
# About this Manual
2326
This document provides general information about the Docker to Host
@@ -31,9 +34,9 @@ however, it does not describe the individual host-specific features.
3134
# Definition/Abbreviation
3235

3336
### Table 1: Abbreviations
34-
| **Term** | **Meaning** |
35-
|--------------------------|-------------------------------------|
36-
| XYZ | Term description |
37+
| **Term** | **Meaning** |
38+
|--------------------------|---------------------------------------------------|
39+
| D-Bus | Desktop Bus: https://en.wikipedia.org/wiki/D-Bus |
3740

3841
# 1 Feature Overview
3942

@@ -56,6 +59,9 @@ the Docker container and the host.
5659
host.
5760
* The host communication API shall be available in Translib, and shall provide
5861
both synchronous and asynchronous communication methods.
62+
* It shall be possible to configure the identity of the Linux user accounts who have access to a D-Bus socket.
63+
* It shall be possible to configure containers in such a way that only certain containers (e.g. SONiC Mgmt.)
64+
have access to the D-Bus socket.
5965

6066
### 1.1.2 Configuration and Management Requirements
6167

@@ -94,9 +100,13 @@ All deployments
94100

95101
## 2.2 Functional Description
96102

97-
This feature enables applications such as image management, ZTP, etc. to issue
98-
requests to the host to perform actions such as image install, ZTP
99-
enable/disable, etc.
103+
This feature enables management applications to issue
104+
requests to the host to perform actions such as:
105+
* image install / upgrade
106+
* ZTP enable/disable
107+
* initiate reboot and warm reboot using existing scripts
108+
* create show-tech tar file using existing show-tech script
109+
* config save/reload using existing scripts
100110

101111
# 3 Design
102112
## 3.1 Overview
@@ -110,6 +120,25 @@ the host, and either wait for the response (if the request was synchronous), or
110120
receive a channel and wait for the request to return the response on the
111121
channel (asynchronous request).
112122

123+
The architecture of a D-Bus host service in a SONiC environment is illustrated in the diagram below:
124+
![](images/docker-to-host-services-architecture.jpg)
125+
126+
Note. The Linux D-Bus implementation uses Unix domain sockets for client to D-Bus service communications.
127+
All containers that use D-Bus services will bind mount
128+
(-v /var/run/dbus:/var/run/dbus:rw) the host directory where D-Bus service sockets are created.
129+
This ensures that only the desired containers access the D-Bus host services.
130+
131+
D-Bus provides a reliable communication channel between client (SONiC management container) and service (native host OS) – all actions are acknowledged and can provide return values. It should be noted that acknowledgements are important for operations such as “image upgrade” or “config-save”. In addition, D-Bus methods can return values of many types – not just ACKs. For instance, they can return strings, useful to return the output of a command.
132+
133+
### 3.1.1 Security of D-Bus Communications
134+
In addition to standard Linux security mechanisms for file/Unix socket access rights (read/write), D-Bus provides a separate security layer, using the D-Bus service configuration files.
135+
This allows finer grain access control to D-Bus objects and methods - D-Bus can restrict access only to certain Linux users.
136+
137+
### 3.1.2 Command Logging
138+
139+
It is possible to track and log the user name and the command that the user has requested.
140+
The log record is created in the system log.
141+
113142
## 3.2 DB Changes
114143
### 3.2.1 CONFIG DB
115144
N/A
Loading

0 commit comments

Comments
 (0)