|
156 | 156 | <step>
|
157 | 157 | <para>
|
158 | 158 | After switching to a different policy level restart the system to
|
159 |
| - apply the changes. |
| 159 | + apply the changes to the applications. |
160 | 160 | </para>
|
161 | 161 | </step>
|
162 | 162 | </procedure>
|
|
169 | 169 | algorithms or protocols. This way, you create a subpolicy (or policy
|
170 | 170 | modifier module), stored in text files that include the modifications.
|
171 | 171 | After creation, one or multiple subpolicies can be applied on the command
|
172 |
| - line to one of the predefined policies. For details, see example ????. |
| 172 | + line to one of the predefined policies. For details, see |
| 173 | + <xref linkend="ex-crypto-policy-subpolicy"></xref>. |
173 | 174 | </para>
|
174 | 175 |
|
175 | 176 | <para>
|
176 |
| - Subpolicies need to be stored in |
177 |
| - <filename>/usr/share/crypto-policies/policies/modules/</filename>. You |
178 |
| - can also find example subpolicies in this directory. The name of the |
179 |
| - subpolicy file must be <replaceable>MODULE</replaceable>.pmod, where |
180 |
| - <replaceable>MODULE</replaceable> is the name of the modifier in |
181 |
| - uppercase and without spaces. |
| 177 | + You can find example subpolicies in |
| 178 | + <filename>/usr/share/crypto-policies/policies/modules</filename>. |
| 179 | + However, your own subpolicies need to be stored in |
| 180 | + <filename>/etc/crypto-policies/policies/modules</filename> (unless they |
| 181 | + are packaged) . The name of the subpolicy file must be |
| 182 | + <replaceable>MODULE</replaceable>.pmod, where |
| 183 | + <replaceable>MODULE</replaceable> is the name of the subpolicy. It needs |
| 184 | + to be spelled in uppercase letters and without spaces. |
182 | 185 | </para>
|
183 | 186 |
|
184 |
| - <!--todo: add example and how to apply it, e.g. with update-crypto-policies -/-set DEFAULT:NO-SHA1--> |
| 187 | + <example xml:id="ex-crypto-policy-subpolicy"> |
| 188 | + <title>Removing support for RSA and PSK key exchanges</title> |
| 189 | + <para> |
| 190 | + The following example shows you how to create a subpolicy which removes |
| 191 | + support for RSA and PSK key exchanges from the |
| 192 | + <literal>DEFAULT</literal> policy. Both key exchanges do not provide |
| 193 | + forward secrecy, which means they cannot make sure that session keys |
| 194 | + are not compromised in case long-term secrets used in the key exchange |
| 195 | + session are compromised. |
| 196 | + </para> |
| 197 | + <procedure> |
| 198 | + <step> |
| 199 | + <para> |
| 200 | + In <filename>/etc/crypto-policies/policies/modules/</filename> |
| 201 | + create a new file, named <filename>NO-RSA-PSK.pmod</filename>. |
| 202 | + </para> |
| 203 | + </step> |
| 204 | + <step> |
| 205 | + <para> |
| 206 | + Add the following line and save the file afterwards: |
| 207 | + </para> |
| 208 | +<screen>key_exchange = -RSA -PSK</screen> |
| 209 | + <para> |
| 210 | + Now you can apply the newly created subpolicy to one of the |
| 211 | + predefined policies. |
| 212 | + </para> |
| 213 | + </step> |
| 214 | + <step> |
| 215 | + <para> |
| 216 | + Assuming the current system-wide policy is |
| 217 | + <literal>DEFAULT</literal> and you want to apply the newly created |
| 218 | + subpolicy to <literal>DEFAULT</literal>: |
| 219 | + command: |
| 220 | + </para> |
| 221 | +<screen>&prompt.root;<command>update-crypto-policies --set DEFAULT:NO-RSA-PSK</command></screen> |
| 222 | + </step> |
| 223 | + <step> |
| 224 | + <para> |
| 225 | + Double-check if the subpolicy has been added to |
| 226 | + <literal>DEFAULT</literal>: |
| 227 | + </para> |
| 228 | +<screen><command>update-crypto-policies --show</command> |
| 229 | + DEFAULT:NO-RSA-PSK</screen> |
| 230 | + </step> |
| 231 | + <step> |
| 232 | + <para> |
| 233 | + Reboot the system to apply the system-wide policy adjustment to the |
| 234 | + applications. |
| 235 | + </para> |
| 236 | + </step> |
| 237 | + </procedure> |
| 238 | + </example> |
| 239 | + |
185 | 240 | <!--todo: add another section how to create a new policy from scratch-->
|
186 | 241 | </sect1>
|
187 | 242 | </chapter>
|
0 commit comments