File site/docs/linux/grub_hardening.md changed (mode: 100644) (index 18afe0f..6469e98) |
... |
... |
to verify all files that it accesses. |
16 |
16 |
|
|
17 |
17 |
Let's begin. |
Let's begin. |
18 |
18 |
|
|
|
19 |
|
**Disable security before flashing** |
|
20 |
|
================================ |
|
21 |
|
|
|
22 |
|
**Before internal flashing, you must first disable `/dev/mem` protections. Make |
|
23 |
|
sure to re-enable them after you're finished.** |
|
24 |
|
|
|
25 |
|
**See: [Disabling /dev/mem protection](../install/devmem.md)** |
|
26 |
|
|
|
27 |
|
This only applies if you're following these instructions via internal |
|
28 |
|
flashing, from an existing installation. |
|
29 |
|
|
|
30 |
|
Back up your flash first! |
|
31 |
|
========================= |
|
32 |
|
|
|
33 |
|
Make sure you also back up the current flash contents, before you proceed with |
|
34 |
|
this guide. See: [Libreboot flashing guides](../install/) (it also says how |
|
35 |
|
to read the flash, in addition to writing it) |
|
36 |
|
|
19 |
37 |
Build dependencies |
Build dependencies |
20 |
38 |
================== |
================== |
21 |
39 |
|
|
|
... |
... |
Enable `CONFIG_STRICT_DEVMEM` in your Linux kernel, or set `securelevel` above |
338 |
356 |
zero on your BSD setup (but BSD cannot be booted with GRUB very easily so |
zero on your BSD setup (but BSD cannot be booted with GRUB very easily so |
339 |
357 |
it's a moot point). |
it's a moot point). |
340 |
358 |
|
|
|
359 |
|
Other write-protect methods |
|
360 |
|
--------------------------- |
|
361 |
|
|
|
362 |
|
The steps above do not require recompilation of the Libreboot images. However, |
|
363 |
|
coreboot offers additional security at build time, which you can select if you |
|
364 |
|
wish. |
|
365 |
|
|
|
366 |
|
Let's assume your board is `x200_8mb`, do: |
|
367 |
|
|
|
368 |
|
./mk -m coreboot x200_8mb |
|
369 |
|
|
|
370 |
|
Find this section: Security -> Boot media protection mechanism |
|
371 |
|
|
|
372 |
|
In the above example, I found: |
|
373 |
|
|
|
374 |
|
* Lock boot media using the controller |
|
375 |
|
* Lock boot media using the chip |
|
376 |
|
|
|
377 |
|
Which one to pick depends on your board. Let's pick "controller". |
|
378 |
|
|
|
379 |
|
Now we can see: Security -> Boot media protected regions |
|
380 |
|
|
|
381 |
|
In there, there is the option to ban writes, or to ban both reads and writes. |
|
382 |
|
Banning reads may be desirable, for example if you have a salt hashed password |
|
383 |
|
stored in `grub.cfg`! (as this guide told you to do) |
|
384 |
|
|
|
385 |
|
You'll have to play around with this yourself. These options are not enabled |
|
386 |
|
by default, because Libreboot images are supposed to allow writes by default, |
|
387 |
|
when booted. You have to enable such security yourself, because the design of |
|
388 |
|
Libreboot is to be as easy to use as possible by defalut, which include updates, |
|
389 |
|
thus implying read-write flash permissions. |
|
390 |
|
|
|
391 |
|
This example was for `x200_8mb`, but other boards may look different in config. |
|
392 |
|
Anyway, when you're done, save the config and then build it from source in lbmk. |
|
393 |
|
|
|
394 |
|
See: [build from source](../build/) |
|
395 |
|
|
341 |
396 |
Install the new image |
Install the new image |
342 |
397 |
===================== |
===================== |
343 |
398 |
|
|