You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across the diataxis approach and used it to get a better understanding
of this page. Additionnaly, I did this:
* move instructions to edit a policy and to enable a service qube to the
related pages
* clean the structure of the server options and make them
cross-referenceable using `:confval:` role
Split GPG-2 allows less trusted qubes to delegate GPG operations to another trusted qube (i.e. a network-isolated qube). The encryption, decryption and signing operations are handled by the trusted qube.
5
+
Qubes OS allows you to split the management and usage of GPG keys. You can store your secret keys in one trusted qube and use them in another less trusted qube.
6
6
7
-
With Split GPG-2, you can use the Thunderbird mail client in one qube, and hold your GPG secret keys in another qube. This way the compromise of your qube where Thunderbird is running does not allow the attacker to automatically also steal all your keys.
7
+
This way the compromise of your less trusted qube does not allow the attacker to automatically also steal all your keys.
8
8
9
-
.. figure:: /attachment/doc/split-gpg-diagram.png
10
-
:alt:
11
-
12
-
Example of the Split GPG-2 architecture
13
-
14
-
In a qube called *work-email* (with a green level of trust), ``qubes-gpg-client`` pretends to be a standard ``/usr/bin/gpg`` to other apps, here with Thunderbird.
15
-
16
-
In the *work-email* qube, ``qubes-gpg-client`` is communicating with ``qubes-gpg-server`` located in the *work-gpg* qube (with a black level of trust). The communication is made through the ``qubes.Gpg2`` remote procedure call using the ``qrexec`` protocol.
9
+
How-to split your GPG keys between two qubes
10
+
--------------------------------------------
17
11
18
-
Inside the *work-gpg* qube, ``qubes-gpg-server`` has access to the GPG key, through ``/usr/bin/gpg``.
19
-
20
-
The following page will setup Split GPG-2 with two qubes:
21
-
22
-
* one qube holding the private keys, called **server-qube** (in the previous example, it is the role of *work-gpg*)
23
-
* the other qube using the keys, called **client-qube** (in the previous example, it *work-email*, where Thunderbird is used)
24
-
25
-
Installation of Split GPG-2
26
-
---------------------------
27
-
28
-
In the template(s) qube(s) used by *server-qube* and *client-qube*, install ``split-gpg2``:
29
-
30
-
* **with Fedora**:
31
-
32
-
.. code:: console
12
+
The following how-to will setup Split GPG-2 with two qubes:
33
13
34
-
[root@fedora-template] # dnf install split-gpg2
14
+
* one qube holding the private keys, called **server-qube**. This qube is offline and should be trusted.
15
+
* the other qube using the keys, called **client-qube**. This qube doesn't have to be trusted as much as the server.
35
16
36
-
* **with Debian**:
17
+
Each time you want to do something with a GPG key, the *client-qube* will delegate the operation to the *server-qube*. This qube will ask you to confirm the operation.
37
18
38
-
.. code:: console
19
+
Install Split GPG-2
20
+
^^^^^^^^^^^^^^^^^^^
39
21
40
-
[root@debian-template] # apt install split-gpg2
22
+
In the template(s) qube(s) used by *server-qube* and *client-qube*, :ref:`install the split-gpg2 package <user/how-to-guides/how-to-install-software:installing software from default repositories>`.
41
23
42
24
.. note:: If you use a minimal template, make sure to install ``zenity``
43
25
44
-
Configuration of Split GPG-2
45
-
----------------------------
46
-
47
-
Create a new policy in dom0
48
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
+
Create a policy for Split GPG-2
27
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
28
50
-
**In dom0**, create or edit a RPC policy. Use either the *Qubes OS Policy Editor* program or the ``qubes-policy-editor`` command. You can call is :file:`{30-user-gpg2}.policy` or something else. Add a line like the following and make sure to replace :samp:`{client-qube}` and :samp:`{server-qube}` by the appropriate values.
29
+
**In dom0**, :doc:`create or edit a RPC policy</user/how-to-guides/how-to-edit-a-policy>`. Add a line like the following and make sure to replace :samp:`{client-qube}` and :samp:`{server-qube}` by the appropriate values.
* or import your secret keys, like the following example. Make sure to replace :file:`/path/to/my/{name-of-the-file}` by the path of the expected file:
46
+
* or, if you want to use some old keys, previously generated in an other qube, import them and the ownertrust. Make sure to replace :file:`/home/user/QubesIncoming/{<SOME_OTHER_QUBE>}/{[...]}` by the path of the expected file:
The first step is to enable the ``split-gpg2-client`` service. There is two options to do it, with the client qube's settings or with the ``qvm-service`` command.
88
-
89
-
Enable ``split-gpg2-client`` with the qube's settings
The first step is to :doc:`enable the qube service </user/how-to-guides/how-to-enable-a-service>` called ``split-gpg2-client``.
122
70
123
71
Import the public keys and ownertrust
124
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
+
"""""""""""""""""""""""""""""""""""""
125
73
126
-
You have previously exported the public keys and the "ownertrust" values from *server-qube*. Now, you have to import them in the client qube. Replace the following paths by the correct values.
74
+
If you have previously exported the public keys and the "ownertrust" values from *server-qube*. Now, you have to import them in the client qube. Replace the following paths by the correct values.
127
75
128
76
.. code:: console
129
77
@@ -133,7 +81,7 @@ You have previously exported the public keys and the "ownertrust" values from *s
133
81
Check that Split GPG-2 works
134
82
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135
83
136
-
This should be enough to have it running:
84
+
You should be able to run ``gpg -K`` in the *client qube*:
137
85
138
86
.. code:: console
139
87
@@ -146,24 +94,24 @@ This should be enough to have it running:
146
94
ssb# rsa2048 2019-12-18 [E]
147
95
148
96
Troubleshooting
149
-
---------------
97
+
^^^^^^^^^^^^^^^
150
98
151
99
``gpg-agent`` only shows the "keygrip"
152
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
+
""""""""""""""""""""""""""""""""""""""
153
101
154
102
If you have a passphrase on your keys and ``gpg-agent`` only shows the “keygrip” (something like the fingerprint of the private key) when asking for the passphrase, then make sure that you have imported the public key part in the server domain.
155
103
156
104
Subkeys vs primary keys
157
-
^^^^^^^^^^^^^^^^^^^^^^^
105
+
"""""""""""""""""""""""
158
106
159
107
Split GPG-2 only knows a hash of the data being signed. Therefore, it cannot differentiate between e.g. signatures of a piece of data or signatures of another key. This means that a client can use Split GPG-2 to sign other keys, which :doc:`split-gpg` did not allow.
160
108
161
109
To prevent this, Split GPG-2 creates a new GnuPG home directory and imports the secret subkeys (**not** the primary key!) to it. Clients will be able to use the secret parts of the subkeys, but not of the primary key. If your primary key is able to sign data and certify other keys, and your only subkey can only perform encryption, this means that all signing will fail. To make signing work again, generate a subkey that is capable of signing but **not** certification. Split GPG-2 does not generate this key for you, so you need to generate it yourself. If you want to generate a key in software, use the ``addkey`` command of ``gpg2 --edit-key``. If you want to generate a key on a smartcard or other hardware token, use ``addcardkey`` instead. You will need to import your public keys again.
162
110
163
-
Advanced usage
111
+
Server options
164
112
--------------
165
113
166
-
If you want change some server option copy :file:`/usr/share/doc/split-gpg2/examples/qubes-split-gpg2.conf.example` to :file:`/home/user/.config/qubes-split-gpg2/qubes-split-gpg2.conf` and change it as desired, it will take precedence over other loaded files, such as the drop-in configuration files with the suffix ``.conf`` in `/home/user/.config/qubes-split-gpg2/conf.d/`.
114
+
If you want change some server option, copy :file:`/usr/share/doc/split-gpg2/examples/qubes-split-gpg2.conf.example` to :file:`/home/user/.config/qubes-split-gpg2/qubes-split-gpg2.conf` and change it as desired, it will take precedence over other loaded files, such as the drop-in configuration files with the suffix ``.conf`` in `/home/user/.config/qubes-split-gpg2/conf.d/`.
167
115
168
116
By setting up some values in the configuration file, you can change some parameters. The configurations files are INI files, you can set global options in the ``DEFAULT`` section, or provide some client specific options in their own :samp:`client:{QUBE_NAME}` section (where ``QUBE_NAME`` is the name of the client). The following configuration is an example where no qube is automatically accepted besides *personal* qube:
169
117
@@ -175,52 +123,88 @@ By setting up some values in the configuration file, you can change some paramet
175
123
[client:personal]
176
124
autoaccept = yes
177
125
178
-
Automatically accept requests
179
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126
+
.. confval:: autoaccept
180
127
181
-
By default, all requests made to the *server-qube* need to be confirmed. If you already use a RPC policy to ask confirmation, you can tell Split GPG-2 to automatically accept all requests, always or during a period of time after a successful request. You have to put something like this in you configuration file:
128
+
:type: text
129
+
:default: ``no``
130
+
:allowed values: ``no``, ``yes`` or any integer
182
131
183
-
.. code:: ini
132
+
By default, all requests made to the *server-qube* need to be confirmed. You can tell Split GPG-2 to accept requests: never (``no``), always (``yes``) or during a period of time after a successful request. To accept all requests following a successful one during one minute, use a value of ``60`` seconds.
184
133
185
-
autoaccept = yes
134
+
This option has two alternatives:
186
135
187
-
To accept all requests following a successful one during one minute (60 seconds), use this:
136
+
.. confval:: pksign_autoaccept
188
137
189
-
.. code:: ini
138
+
:type: boolean or integer
139
+
:default: ``no``
140
+
:allowed values: ``no``, ``yes`` or any integer
190
141
191
-
autoaccept = 60
142
+
same as :confval:`autoaccept` but only for signing requests
192
143
193
-
This option has two alternatives:
144
+
.. confval:: pkdecrypt_autoaccept
194
145
195
-
``pksign_autoaccept``
196
-
same as ``autoaccept`` but only for signing requests
146
+
:type: boolean or integer
147
+
:default: ``no``
148
+
:allowed values: ``no``, ``yes`` or any integer
197
149
198
-
``pkdecrypt_autoaccept``
199
-
same as ``autoaccept`` but only for decrypt requests
150
+
same as :confval:`autoaccept` but only for decrypt requests
200
151
201
-
Notifications
202
-
^^^^^^^^^^^^^
152
+
.. confval:: verbose_notifications
203
153
204
-
Setting ``verbose_notifications`` to ``yes`` will provide more notifications.
154
+
:type: boolean
155
+
:default: ``no``
156
+
:allowed values: ``no`` or ``yes``
205
157
206
-
Edit GnuPG home
207
-
^^^^^^^^^^^^^^^
158
+
Setting ``verbose_notifications`` to ``yes`` will provide more notifications.
159
+
160
+
.. confval:: allow_keygen
161
+
162
+
:type: boolean
163
+
:default: ``no``
164
+
:allowed values: ``no`` or ``yes``
165
+
166
+
.. warning:: This feature is new and not much tested. Therefore it’s not security supported!
167
+
168
+
By setting :confval:`allow_keygen` to ``yes``, you can allow the client to generate new keys. Normal usage should not need this.
169
+
170
+
.. confval:: gnupghome
208
171
209
-
You can set up a different GnuPG home from the default :file:`/home/user/gpg-home`, using ``gnupghome``.
172
+
:type: full path
173
+
:default: empty
210
174
211
-
If you store different keys for different client qubes in the same server qube, you can isolate each GnuPG home, by setting ``isolated_gnupghome``. The value points at a directory where each client will get its own subdirectory. For example when this option is set to :file:`/home/user/gpg-home`, then the qube *personal* will use :file:`/home/user/gpg-home/{personal}` as GnuPG home.
175
+
You can set up a different GnuPG home from the default :file:`/home/user/gpg-home`, using :confval:`gnupghome`.
212
176
213
-
If you do this, don't forget to use the option ``--gnupg-home`` or the environment variable ``GNUPGHOME`` when using ``gpg`` commands.
177
+
.. confval:: isolated_gnupghome
214
178
215
-
Allow key generation
216
-
^^^^^^^^^^^^^^^^^^^^
179
+
:type: full path
180
+
:default: empty
217
181
218
-
.. warning:: This feature is new and not much tested. Therefore it’s not security supported!
182
+
If you store different keys for different client qubes in the same server qube, you can isolate each GnuPG home, by setting :confval:`isolated_gnupghome`. The value points at a directory where each client will get its own subdirectory. For example, when this option is set to :file:`/home/user/gpg-home`, then the qube *personal* will use :file:`/home/user/gpg-home/{personal}` as GnuPG home.
219
183
220
-
By setting ``allow_keygen = yes`` in ``qubes-split-gpg2.conf`` you can allow the client to generate new keys. Normal usage should not need this.
184
+
If you do this, don't forget to use the option ``--gnupg-home`` or the environment variable ``GNUPGHOME`` when using :program:`gpg` commands.
221
185
222
-
Notes
223
-
-----
186
+
.. confval:: debug_log
187
+
188
+
:type: path
189
+
:default: empty
190
+
191
+
Enable debug logging and set the debug log path.
192
+
193
+
.. warning:: This is for debugging purpose only, **everything will be logged** including potentially confidential data/keys/etc
194
+
195
+
Notes about Split GPG-2
196
+
-----------------------
197
+
198
+
.. figure:: /attachment/doc/split-gpg-diagram.png
199
+
:alt:
200
+
201
+
Example of the Split GPG-2 architecture
202
+
203
+
In a qube called *work-email* (with a green level of trust), ``qubes-gpg-client`` pretends to be a standard ``/usr/bin/gpg`` to other apps, here with Thunderbird.
204
+
205
+
In the *work-email* qube, ``qubes-gpg-client`` is communicating with ``qubes-gpg-server`` located in the *work-gpg* qube (with a black level of trust). The communication is made through the ``qubes.Gpg2`` remote procedure call using the ``qrexec`` protocol.
206
+
207
+
Inside the *work-gpg* qube, ``qubes-gpg-server`` has access to the GPG key, through ``/usr/bin/gpg``.
224
208
225
209
Using Split GPG-2 with Split GPG-1
226
210
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -230,7 +214,7 @@ Using Split GPG-2 as the “backend” for :doc:`split-gpg` is known to work.
230
214
Advanced usage: checking what is signed, etc.
231
215
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232
216
233
-
Similar to a smartcard, Split GPG-2 only tries to protect the private key. For advanced usages, consider if a specialized RPC service would be better. It could do things like checking what data is singed, detailed logging, exposing the encrypted content only to a VM without network, etc.
217
+
Similar to a smartcard, Split GPG-2 only tries to protect the private key. For advanced usages, consider if a specialized RPC service would be better. It could do things like checking what data is signed, detailed logging, exposing the encrypted content only to a VM without network, etc.
234
218
235
219
Advantages of Split GPG vs. traditional GPG with a smart card
0 commit comments