Commit Graph

183 Commits

Author SHA1 Message Date
Thierry Laurion
8ba3c33402
required changes to apply on top of osresearch/gpg2 for gpg2 to actually work, tools and libs updated to latest versions 2019-01-26 11:51:51 -05:00
Francis Lam
fd3d69cdac
update tails distro signing key 2018-11-18 10:49:37 -08:00
Trammell Hudson
af81e34292
Merge branch 'patch-2' of https://github.com/tlaurion/heads 2018-11-07 16:40:02 -05:00
Trammell Hudson
6eb214a3f1
Merge branch 'usb-scan_fix' of https://github.com/tlaurion/heads 2018-11-07 16:38:51 -05:00
Trammell Hudson
3f53cfe05b
Merge branch 'add_librem_key_support' of https://github.com/kylerankin/heads 2018-11-07 16:37:01 -05:00
Kyle Rankin
79a09e7424
Ignore PCR5 when sealing key when Librem Key is enabled
When the Librem Key is enabled, the kernel loads USB modules at boot,
this causes PCR5 to change and breaks unsealing the LUKS key (if set).
This change retains the protection of the PCR5 check unless Librem Key
is enabled.
2018-11-07 13:27:52 -08:00
Thierry Laurion
3755ddb47a $TMP_MENU_FILE is an unknown variable. Replaced with /tmp/iso_menu.txt so usb-scan works. 2018-10-22 11:01:05 -04:00
tlaurion
c0aeb614ec
Update .ash_history
mount-usb is better
2018-10-04 22:01:54 -04:00
tlaurion
95748a82d7
Typo correction in .ash_history 2018-09-03 12:03:19 -04:00
Trammell Hudson
770c696117
Merge branch 'x230-flash' of https://github.com/tlaurion/heads 2018-07-18 06:50:46 -04:00
Kyle Rankin
fd99d160e8
Improve status messages for Librem Key HOTP output 2018-07-03 12:40:52 -07:00
Kyle Rankin
acb2b34873
Show warning bg color in main menu when HOTP key not found 2018-06-21 16:30:35 -07:00
Kyle Rankin
be665ac4f9
Show red background when HOTP code is invalid
Granted the user should really be using the Librem Key/phone to check
for tampering (since an attacker could control the Heads background
color) but this provides another visual queue for the user with
the GUI menu to catch less sophisticated tampering.
2018-06-21 16:04:46 -07:00
Kyle Rankin
fe34aba719
Store HOTP counter directly in /boot instead of TPM
The HOTP counter isn't a secret but is just used to prevent replay
attacks (the time-based counter in TOTP isn't a secret either) so it
doesn't need to be protected in the TPM and storing it as a TPM
monotonic counter was causing conflicts with the Heads configuration
counter as TPM 1.2 can only increment one counter per reboot.

This change moves the HOTP counter into the file in /boot that was
previously keeping track of the TPM counter id.
2018-06-20 09:20:39 -07:00
Kyle Rankin
7dde5c2aca
Revert "Use HOTP TPM counter instead of Heads when signing, if present"
This reverts commit c42084406d.
2018-06-19 16:28:37 -07:00
Kyle Rankin
c42084406d
Use HOTP TPM counter instead of Heads when signing, if present
TPM v1.2 has a limitation in that only a single monotonic counter can be
incremented between reboots [1]. So in the event we are using HOTP
monotonic counters, we need to reference those for the Heads rollback
counter when we update file signatures in /boot, otherwise the increment
stage at kexec-sign-config will fail since at each boot, the HOTP
monotonic counter has already been incremented.

[1] https://projects.csail.mit.edu/tc/tpmj/UsersGuide.html#inccounter
2018-06-19 16:18:10 -07:00
Kyle Rankin
2cacb15729
Add back TPM config counter section to gui-init
The section in gui-init that modifies the Heads TPM counter when signing
config was accidentally removed. This change adds that section back.
2018-06-19 13:03:01 -07:00
Kyle Rankin
31cf85b707
Add Librem Key support to Heads
The Librem Key is a custom device USB-based security token Nitrokey is
producing for Purism and among other things it has custom firmware
created for use with Heads. In particular, when a board is configured
with CONFIG_LIBREMKEY, this custom firmware allows Heads to use the
sealed TOTP secret to also send an HOTP authentication to the Librem
Key. If the HOTP code is successful, the Librem Key will blink a green
LED, if unsuccessful it will blink red, thereby informing the user that
Heads has been tampered with without requiring them to use a phone to
validate the TOTP secret.

Heads will still use and show the TOTP secret, in case the user wants to
validate both codes (in case the Librem Key was lost or is no longer
trusted). It will also show the result of the HOTP verification (but not
the code itself), even though the user should trust only what the Librem
Key displays, so the user can confirm that both the device and Heads are
in sync. If HOTP is enabled, Heads will maintain a new TPM counter
separate from the Heads TPM counter that will increment each time HOTP
codes are checked.

This change also modifies the routines that update TOTP so that if
the Librem Key executables are present it will also update HOTP codes
and synchronize them with a Librem Key.
2018-06-19 12:27:27 -07:00
tlaurion
85eebd0487
Modify flash command to use generic flash.sh 2018-06-06 22:09:57 -04:00
Trammell hudson
584c07042e
Merge branch 'generic_flashrom_script' of https://github.com/kylerankin/heads 2018-06-01 12:40:16 -04:00
Trammell hudson
1d366546f1
Merge branch 'gpg' of https://github.com/flammit/heads 2018-06-01 12:39:41 -04:00
Kyle Rankin
8d50b6a1ab
Add option to flash cleaned ROM to GUI 2018-05-28 11:38:04 -07:00
Kyle Rankin
8dc2f8602f
Add trivial word-wrapping for long output line 2018-05-23 16:14:44 -07:00
Francis Lam
736538a8a2
Add additional kernel command line options for ISO boot
Allows Qubes/Ubuntu/Fedora ISO media to be used by default
without a custom kexec_iso_add.txt config
2018-05-19 10:52:49 -07:00
Kyle Rankin
cfa6c3a374
Make x230 board option a glob to match x230-flash option 2018-05-18 14:04:00 -07:00
Francis Lam
c1be56c5ad
Separate trusted ISO signers from trusted config signers 2018-05-17 19:52:11 -07:00
Kyle Rankin
258420d75d
Add BIOS ROM editing features to flash GUI
In addition to being able to flash a ROM from the GUI, it would also be
useful for a user to be able to add a GPG key to their keyring using the
flashing tool. This change adds the ability for a user to edit both a
ROM located on a USB key and also edit the running BIOS by using
flashrom to make a local copy of the running BIOS, edit it, then reflash
it. This also supports the upcoming delete feature in CBFS for
circumstances where keyring files already exist within CBFS.
2018-05-17 15:31:23 -07:00
Kyle Rankin
a9bf4eb874
Add read mode to flash.sh
If we want to modify a running BIOS we will need the ability to pull
down the current BIOS, modify it, and then reflash. This change adds a
read option to flash.sh and pulls down three versions of the BIOS and
only exists successfully if all three match.
2018-05-15 16:24:24 -07:00
Kyle Rankin
b276e355d9
Re-add the flashrom script for kgpe-d16-openbmc 2018-05-11 14:23:48 -07:00
Kyle Rankin
3c88bc5d86
Split flash GUI into separate script
To keep the flash logic simpler the GUI logic has been split into a
flash-gui.sh program so flash.sh behaves closer to the original flashrom
scripts it was based from. I've also removed the previous flashrom
scripts and incorporated their options into flash.sh. Finally I set
CONFIG_BOARD via the Makefile instead of setting a duplicate option in
each board's config.
2018-05-11 14:08:31 -07:00
Kyle Rankin
89b008a042
Use explicit path for flash.sh 2018-05-11 12:32:04 -07:00
Kyle Rankin
45ae20fc12
Add generic flash script
Based on the conversation for PR #406, we decided to go with a more
generic script for general-purpose flashing instead of having individual
(and therefore very similar) flash scripts for each board type. This
script currently handles flashrom on Librem and X230 board types and
introduces a new CONFIG_BOARD option that sets specific flashrom
arguments based on the board.

It also adds support to gui-init to call this flash script.
2018-05-11 12:27:50 -07:00
Kyle Rankin
fc72daa6e3
Fix tabbing 2018-05-09 14:28:36 -07:00
Kyle Rankin
ec2d7dfc2c
Make TPM counter label a variable
Currently the TPM counter label is hard-coded. By changing it to a
variable in this function we can reuse all of the TPM counter functions
to create other monotonic counters in the TPM (if the hardware supports
it) with custom labels.
2018-05-09 14:25:43 -07:00
Thierry Laurion
3d23cadd15 x230-flash depends on independent and minimal linux-x230-flash.config. ash_history content replaced with usefull commands. Everything is there to generate keys from Yubikey/Nitrokey, export armored versions to external media and cbfs them into reproducible rom and flash resulting rom with flashrom-x230.sh. 2018-05-07 16:45:47 -04:00
Trammell hudson
9c95b4ed58
Merge branch 'usb-scan-gui' of https://github.com/kylerankin/heads 2018-05-07 11:24:56 -04:00
Trammell hudson
2ab90623f9
Merge branch 'word_wrap_whiptail' of https://github.com/kylerankin/heads 2018-05-07 11:23:58 -04:00
Francis Lam
bb0e13c24f
Add back flashrom support for KGPE-D16
Also fix up flashrom-x230.sh command only read bios area
2018-05-05 18:59:43 -07:00
Kyle Rankin
4fdbe88560
Allow lines to be wrapped closer to the edge 2018-05-03 10:45:45 -07:00
Kyle Rankin
f70fabd187
Add a whiptail GUI to usb-scan 2018-05-02 14:29:27 -07:00
Kyle Rankin
745d843f0d
Extend whiptail window to 90 columns wide
Wrapping text to 80 characters works but due to font size and padding
the maximum 80 character lines start to get truncated. Extending the
window to 90 characters will resolve this.
2018-05-01 15:20:35 -07:00
Kyle Rankin
480b01c278
Wrap an additional line that was missed in the first pass 2018-05-01 15:10:14 -07:00
Kyle Rankin
f26a14c20d
Wrap whiptail text that's over 80 characters
While the whiptail program wraps text appropriately based on column
size, the fbwhiptail program doesn't, leading to text that scrolls off
the window where it can no longer be read. This change wraps the longer
text output so it all fits.
2018-05-01 14:23:56 -07:00
Trammell hudson
8108e419fe
remove unused flashrom 0.9.9 patch and use new --ifd feature in its place (pr #370) 2018-04-30 17:16:06 -04:00
Trammell hudson
03a0e39bce
Merge branch 'skip_sig_checks' of https://github.com/kylerankin/heads 2018-04-30 16:39:20 -04:00
Trammell hudson
cd2325781c
Merge branch 'colorized_warning_error' of https://github.com/kylerankin/heads 2018-04-30 16:31:45 -04:00
Trammell hudson
05a36ce3d9
Merge branch 'skip_confirmation_on_force' of https://github.com/kylerankin/heads 2018-04-30 16:31:05 -04:00
Trammell hudson
7372595a20
Merge branch 'red_background_on_insecure_boot' of https://github.com/kylerankin/heads 2018-04-30 16:30:29 -04:00
Francis Lam
c0f3a4bb79
Read and measure an EFI file into initrd during init 2018-04-29 19:58:44 -07:00
Kyle Rankin
22a8d6f603
Colorize warning and error messages in fbwhiptail
Since fbwhiptail allows us to customize the background colors, we should
colorize warnings and error messages to provide a user with an
additional subtle cue that there might be a problem. I have added two
additional configuration options:

CONFIG_WARNING_BG_COLOR
CONFIG_ERROR_BG_COLOR

and in the librem13v2.config file you can see an example for how to set
them to be yellow and red gradients, respectively. I've also updated the
main two scripts that use whiptail to include those background colors.

If you decide to use regular whiptail, just don't set these config
options and it should behave as expected.
2018-04-25 13:21:56 -07:00