machinery-tool 1.21.0 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +8 -0
  4. data/html/index.html.haml +8 -7
  5. data/html/partials/changed_config_files.html.haml +1 -1
  6. data/html/partials/changed_managed_files.html.haml +1 -1
  7. data/html/partials/unmanaged_files.html.haml +2 -2
  8. data/lib/cli.rb +26 -4
  9. data/lib/diff_widget.rb +73 -0
  10. data/lib/dpkg_database.rb +16 -1
  11. data/lib/haml_helpers.rb +60 -0
  12. data/lib/kiwi_config.rb +7 -0
  13. data/lib/machinery.rb +3 -0
  14. data/lib/man_task.rb +3 -2
  15. data/lib/move_task.rb +1 -0
  16. data/lib/remote_system.rb +4 -0
  17. data/lib/server.rb +2 -105
  18. data/lib/static_html.rb +75 -0
  19. data/lib/system.rb +2 -1
  20. data/lib/system_description.rb +10 -0
  21. data/lib/version.rb +1 -1
  22. data/machinery-helper/version.go +1 -1
  23. data/man/generated/machinery.1.gz +0 -0
  24. data/manual/docs/README.md +8 -16
  25. data/manual/docs/docs.md +42 -4
  26. data/manual/docs/index.html +6 -2
  27. data/manual/docs/machinery-analyze.1.md +6 -10
  28. data/manual/docs/machinery-build.1.md +7 -11
  29. data/manual/docs/machinery-compare.1.md +5 -10
  30. data/manual/docs/machinery-config.1.md +4 -7
  31. data/manual/docs/machinery-copy.1.md +5 -10
  32. data/manual/docs/machinery-deploy.1.md +8 -12
  33. data/manual/docs/machinery-export-autoyast.1.md +10 -17
  34. data/manual/docs/machinery-export-html.1.md +32 -0
  35. data/manual/docs/machinery-export-kiwi.1.md +7 -12
  36. data/manual/docs/{machinery-inspect-docker.1.md → machinery-inspect-container.1.md} +10 -15
  37. data/manual/docs/machinery-inspect.1.md +10 -15
  38. data/manual/docs/machinery-list.1.md +4 -8
  39. data/manual/docs/machinery-man.1.md +4 -6
  40. data/manual/docs/machinery-move.1.md +4 -8
  41. data/manual/docs/machinery-remove.1.md +5 -10
  42. data/manual/docs/machinery-serve.1.md +5 -9
  43. data/manual/docs/machinery-show.1.md +7 -11
  44. data/manual/docs/machinery-upgrade-format.1.md +5 -9
  45. data/manual/docs/machinery-validate.1.md +4 -8
  46. data/manual/docs/machinery_main_general.1.md +33 -51
  47. data/manual/docs/machinery_main_scopes.1.md +13 -14
  48. data/manual/docs/{machinery_security_implications.1.md → machinery_main_security_implications.1.md} +15 -15
  49. data/manual/docs/machinery_main_usecases.1.md +2 -30
  50. data/manual/mkdocs.yml +9 -9
  51. data/manual/site/docs/index.html +71 -25
  52. data/manual/site/index.html +6 -2
  53. data/manual/site/machinery-analyze.1/index.html +34 -27
  54. data/manual/site/machinery-build.1/index.html +35 -28
  55. data/manual/site/machinery-compare.1/index.html +33 -26
  56. data/manual/site/machinery-config.1/index.html +32 -25
  57. data/manual/site/machinery-copy.1/index.html +33 -27
  58. data/manual/site/machinery-deploy.1/index.html +36 -29
  59. data/manual/site/machinery-export-autoyast.1/index.html +38 -32
  60. data/manual/site/machinery-export-html.1/index.html +175 -0
  61. data/manual/site/machinery-export-kiwi.1/index.html +35 -28
  62. data/manual/site/machinery-inspect-container.1/index.html +249 -0
  63. data/manual/site/machinery-inspect.1/index.html +38 -31
  64. data/manual/site/machinery-list.1/index.html +32 -25
  65. data/manual/site/machinery-man.1/index.html +32 -26
  66. data/manual/site/machinery-move.1/index.html +32 -25
  67. data/manual/site/machinery-remove.1/index.html +33 -26
  68. data/manual/site/machinery-serve.1/index.html +33 -26
  69. data/manual/site/machinery-show.1/index.html +35 -28
  70. data/manual/site/machinery-upgrade-format.1/index.html +33 -26
  71. data/manual/site/machinery-validate.1/index.html +32 -25
  72. data/manual/site/machinery_main_general.1/index.html +63 -70
  73. data/manual/site/machinery_main_scopes.1/index.html +41 -36
  74. data/manual/site/machinery_main_security_implications.1/index.html +228 -0
  75. data/manual/site/machinery_main_usecases.1/index.html +30 -48
  76. data/manual/site/mkdocs/search_index.json +246 -201
  77. data/manual/site/sitemap.xml +40 -30
  78. data/plugins/os/os_inspector.rb +1 -1
  79. data/plugins/packages/packages.yml +1 -1
  80. data/plugins/patterns/patterns.yml +2 -5
  81. data/plugins/repositories/repositories.yml +2 -2
  82. data/plugins/unmanaged_files/unmanaged_files.yml +3 -3
  83. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +1 -1
  84. metadata +11 -5
  85. data/manual/docs/subcommand-template.1.md +0 -46
@@ -23,26 +23,29 @@
23
23
 
24
24
 
25
25
 
26
- <li>Home
27
- <ul>
28
-
29
- <li class="">
30
- <a href="../machinery_main_general.1/">General</a>
31
- </li>
32
-
33
- <li class="current">
34
- <a href="./">Scopes</a>
35
- </li>
36
-
37
- <li class="">
38
- <a href="../machinery_main_usecases.1/">Use cases</a>
39
- </li>
40
-
41
- <li class="">
42
- <a href="../machinery_security_implications.1/">Security Implications</a>
43
- </li>
44
-
45
- </ul>
26
+ <li class="">
27
+ <a href="../machinery_main_general.1/">General Overview</a>
28
+ </li>
29
+
30
+
31
+
32
+
33
+ <li class="current">
34
+ <a href="./">Scopes</a>
35
+ </li>
36
+
37
+
38
+
39
+
40
+ <li class="">
41
+ <a href="../machinery_main_usecases.1/">Use cases</a>
42
+ </li>
43
+
44
+
45
+
46
+
47
+ <li class="">
48
+ <a href="../machinery_main_security_implications.1/">Security Implications</a>
46
49
  </li>
47
50
 
48
51
 
@@ -83,12 +86,16 @@
83
86
  <a href="../machinery-export-kiwi.1/">Export Kiwi</a>
84
87
  </li>
85
88
 
89
+ <li class="">
90
+ <a href="../machinery-export-html.1/">Export HTML</a>
91
+ </li>
92
+
86
93
  <li class="">
87
94
  <a href="../machinery-inspect.1/">Inspect</a>
88
95
  </li>
89
96
 
90
97
  <li class="">
91
- <a href="../machinery-inspect-docker.1/">Inspect Docker</a>
98
+ <a href="../machinery-inspect-container.1/">Inspect Container</a>
92
99
  </li>
93
100
 
94
101
  <li class="">
@@ -131,7 +138,8 @@
131
138
  </ul>
132
139
  </div>
133
140
  <div class="content">
134
- <ul>
141
+ <h1 id="scopes">Scopes</h1>
142
+ <ul>
135
143
  <li>os</li>
136
144
  </ul>
137
145
  <p>Contains information about the operating system, name, version, and
@@ -139,25 +147,22 @@ architecture of the inspected system.</p>
139
147
  <ul>
140
148
  <li>packages</li>
141
149
  </ul>
142
- <p>Contains information on all installed RPM packages installed on the
150
+ <p>Contains information on all installed packages installed on the
143
151
  inspected system.</p>
144
152
  <ul>
145
153
  <li>patterns</li>
146
154
  </ul>
147
155
  <p>Contains all patterns or tasks installed on the inspected system. A pattern is a
148
156
  collection of software packages, similar to the idea of tasks on Debian/Ubuntu-
149
- like systems.
150
- The meaning of software patterns depends on the package manager of the
151
- distribution. Therefore, the pattern scope on SUSE based systems uses the
152
- <code>zypper</code> command to obtain the information about installed pattern names, whereas
153
- on Debian based systems the <code>tasksel</code> tool is necessary to list installed tasks.</p>
157
+ like systems. The meaning of software patterns depends on the package manager of the
158
+ distribution.</p>
154
159
  <ul>
155
160
  <li>repositories</li>
156
161
  </ul>
157
162
  <p>Contains all information about software repositories configured on the
158
163
  inspected system. The information about repositories depends on the package
159
- manager of the distribution. Thus on SUSE-based systems the <code>zypper</code> command
160
- is used. Machinery collects the following information from each configured repository:</p>
164
+ manager of the distribution. Machinery collects the following information
165
+ from each configured repository:</p>
161
166
  <ul>
162
167
  <li>
163
168
  <p>The alias name of the repository.</p>
@@ -208,7 +213,7 @@ runlevel. It uses the <code>chkconfig</code> command to obtain that information.
208
213
  The xinetd services that are also displayed by <code>chkconfig</code> are switched
209
214
  on/off by editing configuration files and are ignored in this context.</p>
210
215
  <ul>
211
- <li>changed_config_files</li>
216
+ <li>changed-config-files</li>
212
217
  </ul>
213
218
  <p>Contains all configuration files which have been changed since they were
214
219
  installed.
@@ -217,22 +222,22 @@ package which has installed them. A configuration file change is reported
217
222
  if its content or its attributes like Linux permission bits or ownership
218
223
  have changed.</p>
219
224
  <ul>
220
- <li>changed_managed_files</li>
225
+ <li>changed-managed-files</li>
221
226
  </ul>
222
227
  <p>Contains the names and contents of all non-configuration files which have
223
228
  been changed compared to the files in the package. A file change is reported
224
229
  if its content or its attributes like Linux permission bits or ownership
225
230
  have changed.</p>
226
231
  <ul>
227
- <li>unmanaged_files</li>
232
+ <li>unmanaged-files</li>
228
233
  </ul>
229
- <p>Contains the names and contents of all files which are not part of any RPM
230
- package. The list of unmanaged files contains only plain files and
234
+ <p>Contains the names and contents of all files which are not part of any package.
235
+ The list of unmanaged files contains only plain files and
231
236
  directories. Special files like device nodes, named pipes and Unix domain
232
237
  sockets are ignored. The directories <code>/tmp</code>, <code>/var/tmp</code>, <code>/.snapshots/</code>,
233
238
  <code>/var/run</code> and special mounts like procfs and sysfs are ignored, too.
234
239
  If a directory is in this list, no file or directory below it belongs to a
235
- RPM package.</p>
240
+ package.</p>
236
241
  <p>Meta data information of unmanaged files is only available if the files were
237
242
  extracted during inspection.</p>
238
243
  <p>Using the <code>--extract-unmanaged-files</code> option, the files are transferred from
@@ -0,0 +1,228 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <link href="../custom.css" rel="stylesheet">
6
+ </head>
7
+ <body id="manpage">
8
+ <div id="back">
9
+ <a href="..">
10
+ <img src="../hand3.png" class="hand3"/>
11
+ <div class="goback">Go back to the web site</div>
12
+ </a>
13
+ </div>
14
+ <div class="mp">
15
+ <div class="nav">
16
+ <ul>
17
+
18
+
19
+ <li class="">
20
+ <a href="../docs/">Welcome</a>
21
+ </li>
22
+
23
+
24
+
25
+
26
+ <li class="">
27
+ <a href="../machinery_main_general.1/">General Overview</a>
28
+ </li>
29
+
30
+
31
+
32
+
33
+ <li class="">
34
+ <a href="../machinery_main_scopes.1/">Scopes</a>
35
+ </li>
36
+
37
+
38
+
39
+
40
+ <li class="">
41
+ <a href="../machinery_main_usecases.1/">Use cases</a>
42
+ </li>
43
+
44
+
45
+
46
+
47
+ <li class="current">
48
+ <a href="./">Security Implications</a>
49
+ </li>
50
+
51
+
52
+
53
+
54
+ <li>Commands
55
+ <ul>
56
+
57
+ <li class="">
58
+ <a href="../machinery-analyze.1/">Analyze</a>
59
+ </li>
60
+
61
+ <li class="">
62
+ <a href="../machinery-build.1/">Build</a>
63
+ </li>
64
+
65
+ <li class="">
66
+ <a href="../machinery-compare.1/">Compare</a>
67
+ </li>
68
+
69
+ <li class="">
70
+ <a href="../machinery-config.1/">Config</a>
71
+ </li>
72
+
73
+ <li class="">
74
+ <a href="../machinery-copy.1/">Copy</a>
75
+ </li>
76
+
77
+ <li class="">
78
+ <a href="../machinery-deploy.1/">Deploy</a>
79
+ </li>
80
+
81
+ <li class="">
82
+ <a href="../machinery-export-autoyast.1/">Export AutoYaST</a>
83
+ </li>
84
+
85
+ <li class="">
86
+ <a href="../machinery-export-kiwi.1/">Export Kiwi</a>
87
+ </li>
88
+
89
+ <li class="">
90
+ <a href="../machinery-export-html.1/">Export HTML</a>
91
+ </li>
92
+
93
+ <li class="">
94
+ <a href="../machinery-inspect.1/">Inspect</a>
95
+ </li>
96
+
97
+ <li class="">
98
+ <a href="../machinery-inspect-container.1/">Inspect Container</a>
99
+ </li>
100
+
101
+ <li class="">
102
+ <a href="../machinery-list.1/">List</a>
103
+ </li>
104
+
105
+ <li class="">
106
+ <a href="../machinery-man.1/">Man</a>
107
+ </li>
108
+
109
+ <li class="">
110
+ <a href="../machinery-move.1/">Move</a>
111
+ </li>
112
+
113
+ <li class="">
114
+ <a href="../machinery-remove.1/">Remove</a>
115
+ </li>
116
+
117
+ <li class="">
118
+ <a href="../machinery-serve.1/">Serve</a>
119
+ </li>
120
+
121
+ <li class="">
122
+ <a href="../machinery-show.1/">Show</a>
123
+ </li>
124
+
125
+ <li class="">
126
+ <a href="../machinery-upgrade-format.1/">Upgrade Format</a>
127
+ </li>
128
+
129
+ <li class="">
130
+ <a href="../machinery-validate.1/">Validate</a>
131
+ </li>
132
+
133
+ </ul>
134
+ </li>
135
+
136
+
137
+
138
+ </ul>
139
+ </div>
140
+ <div class="content">
141
+ <h1 id="security-implications">Security Implications</h1>
142
+ <p>This document describes security related issues administrators need to be aware of when using
143
+ Machinery.</p>
144
+ <h2 id="inspection">Inspection</h2>
145
+ <p>Machinery inspects several parts of a system which are covered by Machinery's scopes.
146
+ Information about scopes is listed <a href="../machinery_main_scopes.1/">here</a>.</p>
147
+ <p>Users of Machinery who inspect systems need to be aware of the security implications
148
+ to take the right decisions on how to protect the retrieved data.</p>
149
+ <h2 id="retrieval-of-data">Retrieval of Data</h2>
150
+ <p>Machinery transfers data from one end point to another via SSH (Secure Shell, using public key authentication).</p>
151
+ <p>Depending on the scope, Machinery <a href="../machinery_main_scopes.1/">collects information</a>
152
+ about files on the system. Additionally, when the <code>--extract-files</code> option is given for the
153
+ <code>inspect</code> command, not only the meta data about the files (e.g. permission bits, owner, group etc
154
+ .) but also the file content is extracted. Machinery does not distinguish between sensitive
155
+ data (such as private keys or password files). That means that everyone with access to the system
156
+ description has automatically access to <strong>all</strong> extracted files and contained sensitive data.</p>
157
+ <h4 id="rootsudo-privileges">root/sudo Privileges</h4>
158
+ <p>An inspection can only be done, when the user on the inspected system is either root or has
159
+ sudo privileges. Information about the required sudo configuration can be found
160
+ <a href="../machinery-inspect.1/#prerequisites">here</a>.</p>
161
+ <h2 id="storage-of-data">Storage of Data</h2>
162
+ <h4 id="access-restrictions">Access Restrictions</h4>
163
+ <p>After an inspection has been completed, the directory where the description is stored is made
164
+ readable only for the user. The data is not encrypted by Machinery.</p>
165
+ <h4 id="used-permission-bits">Used Permission Bits</h4>
166
+ <p>When Machinery extracts data, it sets permission bits for files and directories as follows:</p>
167
+ <table>
168
+ <thead>
169
+ <tr>
170
+ <th>Permission Bits</th>
171
+ <th>Used for ...</th>
172
+ </tr>
173
+ </thead>
174
+ <tbody>
175
+ <tr>
176
+ <td>0700</td>
177
+ <td>... directories inside the description directory</td>
178
+ </tr>
179
+ <tr>
180
+ <td>0600</td>
181
+ <td>... for files inside the description directory</td>
182
+ </tr>
183
+ </tbody>
184
+ </table>
185
+ <h4 id="accessing-system-descriptions">Accessing System Descriptions</h4>
186
+ <p>By default, all system descriptions are stored in the directory <code>.machinery</code> in the home directory
187
+ of the user running Machinery. The directory can be redefined by the environment variable
188
+ <code>$MACHINERY_DIR</code>. Each description has its own subdirectory. There is a <code>manifest.json</code> file in
189
+ each description directory which contains the data of the inspection. Extracted files are stored in
190
+ separate subdirectories inside the same description directory.</p>
191
+ <h2 id="presentation-of-data">Presentation of Data</h2>
192
+ <p>There are several ways how data can be presented to one or more users. The user has the option to
193
+ either start a web server and view descriptions or view the descriptions only in the console.</p>
194
+ <p>The following commands are used to present data to users:</p>
195
+ <ul>
196
+ <li>show</li>
197
+ <li>compare</li>
198
+ <li>serve</li>
199
+ <li>list</li>
200
+ </ul>
201
+ <p>All of the commands listed above also have a <code>--html</code> option. When this option is used, Machinery
202
+ starts a web server what will listen on the IP address <code>127.0.0.1</code>. The <code>serve</code> command
203
+ offers also a <code>--public</code> option which makes the server listen on all configured IP addresses.</p>
204
+ <p><strong>WARNING:</strong> When making the server reachable from the outside, users can modify the link to
205
+ access also other descriptions. There is currently no way to restrict the access to only one
206
+ description.</p>
207
+ <p>The <code>serve</code> command also allows the user to specify a port via the <code>--port</code> option. When no port
208
+ is specified, the default port which is configured in the machinery config file in
209
+ <code>~/.machinery/machinery.config</code>) will be taken.</p>
210
+ <h2 id="export-of-data">Export of Data</h2>
211
+ <h4 id="export-autoyast">export-autoyast</h4>
212
+ <p>The <code>export-autoyast</code> command creates an AutoYaST profile for an automated installation. This will result
213
+ in tar balls containing the extracted files from the system description. These files
214
+ potentially contain sensitive data (e.g. passwords). This fact needs to be kept in mind, especially
215
+ if these files are copied to a web server for an AutoYaST installation via HTTP.</p>
216
+ <h4 id="export-kiwi">export-kiwi</h4>
217
+ <p>The program <strong>kiwi</strong> allows you to build OS images for deployment. Machinery gives
218
+ you the opportunity to export a KIWI description. This description can be used to build an image via Kiwi.
219
+ The <code>export-kiwi</code> command creates a directory, where it stores the Kiwi configuration and the files
220
+ of a system description. These files potentially contain sensitive data (e.g. passwords).</p>
221
+ <h4 id="build">build</h4>
222
+ <p>The created image potentially contains sensitive data (e.g. passwords) from extracted files.</p>
223
+ <h4 id="deploy">deploy</h4>
224
+ <p>The uploaded image potentially contains sensitive data (e.g. passwords) from extracted files.</p>
225
+ </div>
226
+ </div>
227
+ </body>
228
+ </html>
@@ -23,26 +23,29 @@
23
23
 
24
24
 
25
25
 
26
- <li>Home
27
- <ul>
28
-
29
- <li class="">
30
- <a href="../machinery_main_general.1/">General</a>
31
- </li>
32
-
33
- <li class="">
34
- <a href="../machinery_main_scopes.1/">Scopes</a>
35
- </li>
36
-
37
- <li class="current">
38
- <a href="./">Use cases</a>
39
- </li>
40
-
41
- <li class="">
42
- <a href="../machinery_security_implications.1/">Security Implications</a>
43
- </li>
44
-
45
- </ul>
26
+ <li class="">
27
+ <a href="../machinery_main_general.1/">General Overview</a>
28
+ </li>
29
+
30
+
31
+
32
+
33
+ <li class="">
34
+ <a href="../machinery_main_scopes.1/">Scopes</a>
35
+ </li>
36
+
37
+
38
+
39
+
40
+ <li class="current">
41
+ <a href="./">Use cases</a>
42
+ </li>
43
+
44
+
45
+
46
+
47
+ <li class="">
48
+ <a href="../machinery_main_security_implications.1/">Security Implications</a>
46
49
  </li>
47
50
 
48
51
 
@@ -83,12 +86,16 @@
83
86
  <a href="../machinery-export-kiwi.1/">Export Kiwi</a>
84
87
  </li>
85
88
 
89
+ <li class="">
90
+ <a href="../machinery-export-html.1/">Export HTML</a>
91
+ </li>
92
+
86
93
  <li class="">
87
94
  <a href="../machinery-inspect.1/">Inspect</a>
88
95
  </li>
89
96
 
90
97
  <li class="">
91
- <a href="../machinery-inspect-docker.1/">Inspect Docker</a>
98
+ <a href="../machinery-inspect-container.1/">Inspect Container</a>
92
99
  </li>
93
100
 
94
101
  <li class="">
@@ -131,18 +138,7 @@
131
138
  </ul>
132
139
  </div>
133
140
  <div class="content">
134
- <h2 id="system-description">System Description</h2>
135
- <p>The System Description format and file structure is documented in the machinery
136
- wiki: <a href="https://github.com/SUSE/machinery/wiki/System-Description-Format">https://github.com/SUSE/machinery/wiki/System-Description-Format</a></p>
137
- <p>Machinery validates descriptions on load. It checks that the JSON structure of
138
- the manifest file, which contains the primary and meta data of a description, is
139
- correct and it adheres to the schema. Validation errors are reported as warnings.
140
- It also checks that the information about extracted files is consistent. Missing
141
- files or extra files without reference in the manifest are treated also as
142
- warnings. All other issues are errors which need to be fixed so that Machinery
143
- can use the description</p>
144
- <p>To manually validate a description use the <code>machinery validate</code> command.</p>
145
- <h2 id="use-cases">Use Cases</h2>
141
+ <h1 id="use-cases">Use Cases</h1>
146
142
  <p>Some of the important use cases of Machinery are:</p>
147
143
  <ul>
148
144
  <li>Inspecting a System and Collecting Information</li>
@@ -161,21 +157,7 @@ can use the description</p>
161
157
  <p>An inspected system can be cloned. The inspection step returns a system
162
158
  description which is used as the basis for cloning physical or virtual
163
159
  instances. Machinery can build a system image from the description, which
164
- can then for example be deployed to a cloud.</p>
165
- <h1 id="options-for-all-subcommands">OPTIONS FOR ALL SUBCOMMANDS</h1>
166
- <!--- These are 'global' options of machinery -->
167
-
168
- <ul>
169
- <li>
170
- <p><code>--version</code>:
171
- Displays version of <code>machinery</code> tool. Exit when done.</p>
172
- </li>
173
- <li>
174
- <p><code>--debug</code>:
175
- Enable debug mode. Machinery writes additional information into the log
176
- file which can be useful to track down problems.</p>
177
- </li>
178
- </ul>
160
+ can then for example be deployed to a cloud environment.</p>
179
161
  </div>
180
162
  </div>
181
163
  </body>