Swissbit SecureBoot SDK RPi User Manual v2.0
Swissbit SecureBoot SDK RPi User Manual v2.0
Version: 2.0
Copyright 2020 by Swissbit AG
This document as well as the information or material contained is copyrighted. Any use not explicitly permitted by
copyright law requires prior consent of Swissbit AG. This applies to any reproduction, revision, translation, storage
on microfilm as well as its import and processing in electronic systems, in particular.
The information or material contained in this document is property of Swissbit AG and any recipient of this document
shall not disclose or divulge, directly or indirectly, this document or the information or material contained herein
without the prior written consent of Swissbit AG.
All copyrights, trademarks, patents and other rights in connection herewith are expressly reserved to Swissbit AG
and no license is created hereby.
Subject to technical changes.
All brand or product names mentioned are trademarks or registered trademarks of their respective holders.
Page 2 of 21
Table of Contents
TABLE OF CONTENTS ................................................................................................................. 3
1.1 GLOSSARY & SDK CONTENTS....................................................................................................... 4
Glossary ....................................................................................................................................................... 4
Contents of the SDK ................................................................................................................................... 5
U-Boot Binary Files ................................................................................................................................... 5
Applications for Managing DP-Devices .................................................................................................. 5
2. SWISSBIT SECURE BOOT SOLUTION FOR PROTECTING THE SYSTEM INTEGRITY OF A RASPBERRY PI BOOT MEDIA .... 5
3. QUICKSTART GUIDE ............................................................................................................ 6
STEP 1: CHECK PREREQUISITES ......................................................................................................... 6
STEP 2: GET SWISSBIT SECURE BOOT SOLUTION FOR RASPBERRY PI..................................................................... 6
STEP 3: CONFIGURE THE SWISSBIT MICRO SD CARD BY CHOOSING YOUR SECURITY POLICY (CF. CHAPTER 0) .............................. 6
STEP 4: INSTALL U-BOOT (CF. CHAPTER 5)............................................................................................ 6
STEP 5: ACTIVATE DP CARD DATA PROTECTION (CF. CHAPTER 6) ....................................................................... 6
STEP 6: SECURELY BOOT THE RASPBERRY PI (CF. CHAPTER 0) .......................................................................... 6
4. SWISSBIT MICRO SD CARD CONFIGURATION ................................................................................. 7
4.1 INSERT MICROSD CARD INTO YOUR WINDOWS-BASED SYSTEM ...................................................................... 7
4.2 RUN SWISSBIT DEVICE MANAGER ................................................................................................. 7
4.3 SET SECURITY FLAGS .............................................................................................................. 7
4.4 PREPARE A SECURITY POLICY ...................................................................................................... 7
4.5 SET A SECURITY POLICY ........................................................................................................... 8
Set a “PIN” policy ..................................................................................................................................... 8
Set a “USB” policy .................................................................................................................................... 9
Set a NET policy ...................................................................................................................................... 11
4.6 INSTALL THE RASPBERRY PI OPERATING SYSTEM.................................................................................. 13
4.7 SET A PROTECTION PROFILE....................................................................................................... 13
5. U-BOOT INSTALLATION ....................................................................................................... 14
6. ACTIVATION OF CARD DATA PROTECTION .................................................................................... 15
7. BOOTING THE RASPBERRY PI WITH ACTIVATED SECURITY ................................................................. 17
8. APPENDIX ..................................................................................................................... 20
8.1 DEACTIVATING DP CARD DATA PROTECTION ....................................................................................... 20
8.2 REFERENCE MATERIAL ........................................................................................................... 20
Swissbit .................................................................................................................................................... 20
U-Boot ..................................................................................................................................................... 20
Raspberry Pi ............................................................................................................................................ 20
9. DOCUMENT HISTORY .......................................................................................................... 21
Page 3 of 21
1.1 Glossary & SDK Contents
Glossary
Abbreviation Description
DP Data Protection
SO Security Officer
Page 4 of 21
Contents of the SDK
The Swissbit Secure Boot for Raspberry Pi solution provides an SDK with U-Boot binaries and configuration files
for Raspberry 2 and 3 boards, and managing applications tools to configure a Swissbit DP products. Prebuilt U-
Boot binaries are available for Raspberry Pi 2 and 3 boards, configuration tools for Microsoft Windows (Windows
7 and higher). This chapter describes where to find the particular components.
The Swissbit Secure Boot SDK is packed in the file Swissbit_SecureBoot_SDK_RPi.zip. After unpacking in a directory,
the SDK has the following directory structure:
RPI 2
U-Boot binary: <sdkroot>\Raspberry\ RPI2\u-bootRPI2.bin
Binary U-Boot boot script: <sdkroot>\Raspberry\ RPI2\boot.scr.uimg
RPI 3 B Plus
U-Boot binary: <sdkroot>\Raspberry\ RPI3B+\u-bootRPI3.bin
Binary U-Boot boot script: <sdkroot>\Raspberry\ RPI3B+\boot.scr.uimg
U-Boot DTB file <sdkroot>\Raspberry\ RPI3B+\bcm2837-rpi-3-b-plus.dtb
Page 5 of 21
- USB policy: an authorization dongle is plugged into the Raspberry Pi (requiring a Swissbit USB PU-50n
DP “Raspberry Edition”)
- NET policy: authorization through a network server
In the herein described setup, all files and data in the boot partition are read only and cannot be modified. The
root file system of the Operating System can only be read after authentication. Thus, an authentication failure
during boot will prevent the kernel from reading the OS root file system resulting in a boot failure.
Please check www.swissbit.com/secure-boot-rpi ( Downloads) for the latest version of the Secure Boot SDK and
documentation.
3. Quickstart Guide
The Swissbit Secure Boot Solution for Raspberry Pi allows encryption and access protection of data stored on the
card. The DP card safeguards a data policy that is enforced with minimum interaction of the host system Raspberry
Pi.
Swissbit provides a Secure Boot SDK to integrate a Swissbit Data Protection (DP) micro SD card into a U-Boot boot
environment.
Step 3: Configure the Swissbit micro SD Card by choosing your security policy (cf.
Chapter 0)
Authorization is performed in the Swissbit customized pre-boot phase to unlock access for further
boot.
Swissbit offers the following security policy methods:
1. PIN policy (cf. chapter 4.5.1 ): PIN input by the user
2. USB policy (cf. chapter 4.5.2 ): an authorization dongle is plugged into the Raspberry Pi (requiring a
separate Swissbit DP device: PU-50n DP „Raspberry Edition“ )
3. NET policy (cf. chapter 4.5.3 ): authorization through a network server (requiring an additional
Raspberry Pi board running the NET policy server)
Page 6 of 21
4. Swissbit micro SD Card Configuration
4.1 Insert microSD card into your Windows-based system
You can use an adapter to insert the Swissbit microSD card into your Windows-based system, e.g. PC or Notebook.
Page 7 of 21
Prepare a security policy with following steps:
1. Start the Swissbit Device Manager
2. Go to menu “NVRAM > Configure”
3. Select for booth “Size” fields the value “1” and check the column for Read and Write access rights
as shown below in Fig. 2.
4. Click “Configure” to confirm your choices.
Page 8 of 21
Set the PIN policy with the following steps:
1. Start the Swissbit Device Manager
2. Go to menu “NVRAM > Read/Write Random Access Memory”
3. Enter “0” as the value for the block and click on “Select”
4. Write “PIN” into the text field
5. Click “Commit”
6. Click “Quit” to leave dialog
3 4
Set the USB policy in the Swissbit microSD card with the following steps:
1. Start the Swissbit Device Manager
2. Go to menu “NVRAM > Read/Write Random Access Memory”
3. Enter “0” as the value for the block and click on “Select”
4. Write “USB” into the text field
Page 9 of 21
5. Click “Commit”
6. Click “Quit” to leave dialog
3 4
Set the USB policy in the authentication dongle (= additional Swissbit USB stick PU-50n DP „Raspberry Edition“)
with the following steps:
1. Unplug the microSD card
2. Insert the additional Swissbit USB stick PU-50n Raspberry Pi Edition
3. Start the Swissbit Device Manager for USB at <sdkroot>\Apps\USB\Windows\bin\cardManager.exe
4. Go to menu “Manage > Set Authenticity Secret”
5. Enter a PIN as an Authenticity Secret, re-type the Authenticity Secret
6. Click on “Set Authenticity Secret”
Note: Please remember the entered PIN (= Authenticity Secret) as you need to set the same value as the
Authenticity Secret later on in the microSD card DP Activation Dialog.
Page 10 of 21
1
Fig. 5 Configuring the additional USB device as an authentication dongle when using an USB policy
In General:
The NET policy has this format: NET#<ipaddr>#<port>.
<ipaddr>: the IPv4 address or the name of the authentication server (Net policy server).
<port>: the UDP port on which the Net policy server is listening. Default port is 12375.
Thus a properly formatted NET policy string would look like this:
Example: NET#192.168.178.75#12375
indicating an authentication server with the IP address 192.168.178.75 listening on port 12375.
Set the NET policy in the Swissbit microSD card with following steps:
1. Start the Swissbit Device Manager
2. Go to menu “NVRAM > Read/Write Random Access Memory”
3. Enter “0” as the value for the block and click on “Select”
4. Write the “NET#<ipaddr>#<port>” string into the text field (example shown below in Fig. 6)
5. Click “Commit”
6. Click “Quit” to leave dialog
Page 11 of 21
1
3 4
Page 12 of 21
Next, it is required to get the Unique ID of the Swissbit microSD card for for the later configuration of the NET
policy server:
1. Start the Swissbit Device Manager
2. Go to menu “Information > Device Status” or press “CTRL-S”
3. Write down the UniqueID of the Swissbit microSD card (or copy it to clipboard and save it digitally)
3. After you installed the Operating System onto the microSD card verify you can boot your Raspberry PI
from this card and apply all OS updates.
A Protection Profile has to be set only in case “Multiple Partition Protection” has been selected in step 4.3
Note: If Multiple Partition Support has not been activated, this step cannot be applied since the protection profile
is applied implicitly.
The Protection Profile determines which kind of protection is in force after security has been activated on the
card. Protection profiles are assigned to partitions. Each partition can have exactly one profile type assigned.
It is strongly recommended to check "Protect MBR". With this setting, the card's MBR can be read but not be
modified. Even in unlocked state, the MBR is immutable and the card cannot be repartitioned.
Page 13 of 21
Note: Repartitioning of the MBR is possible by the Admin and requires deactivation of the card's security first.
See 8.1 .
The OS integrity use case (e.g. for the Raspberry Pi) assumes two partitions. A boot partition that shall be readable
at any time and a root file system partition that shall be accessible only after authentication.
Set a protection profile with following steps:
1. Start the Swissbit Device Manager
2. Go to menu “Manage > Manage Protection Profiles”
3. If a popup window titled “Profiles not matching partitions” appears, asking whether you “want to
reset all protection profiles?”, click “Yes”.
4. For Partition 1 choose value “Public CD-ROM”
5. For Partition 2 choose value “Private RW”
6. Check “Protect MBR”
7. Click “OK”
2
3
ⓘ If you see more than 2 partitions (e.g. 4 partitions) under “manage protection profiles”, please make sure
that this is what you want. More than 2 partitions also appear if the “installing Operating System” step has been
skipped by mistake. If so, please go back to Chapter 4.6 .
ⓘ Please note that the “Public CD-ROM” partition becomes read-only after the DP Card protection has been
activated (see Ch. 6). Even in read-only mode the partition appears to be writable, but all changes will be
reverted after removing & re-inserting the memory card.
When the protection is not activated like described in Chapter 6. (Card is in “transparent mode”), regular
read/write operation is possible on the partition.
5. U-Boot Installation
The U-Boot files required for the Swissbit U-Boot implementation on Raspberry Pi consists of a U-Boot binary
and a U-Boot configuration script.
1. Insert the microSD-Card into a Windows-based machine and depending on your Raspberry Pi model,
please follow the according steps as stated below:
Page 14 of 21
3. If your Raspberry Pi model is a Raspberry PI 3 B Plus:
a. Copy the file <sdkroot>\Raspberry\RPI3\u-bootRPI3.bin onto the first partition of your microSD
card.
b. Copy the file <sdkroot>\Raspberry\RPI3\BPlus\boot.scr.uimg onto the first partition of your
microSD card.
c. Copy the file <sdkroot>\Raspberry\RPI3\BPlus\bcm2837-rpi-3-b-plus.dtb onto the first partition
of your microSD card
d. On the first partition of your microSD card please open the file “config.txt” and add the
following line at the end:
kernel=u-bootRPI3.bin
3. Set a Password (min. 4 characters), which will be your user PIN, and set the Security Officer Password
(min. 8 characters)
NOTE: If you have chosen “USB policy”, the password must match the authenticity secret of the
authentication dongle (USB stick PU-50n “Raspberry Pi Edition”), which has been set in Chapter 4.5.2 .
Page 15 of 21
1
Page 16 of 21
7. Booting the Raspberry Pi with activated security
Now you can insert the prepared microSD Card Raspberry Pi Edition into your Raspberry Pi and securely boot up
your Raspberry Pi.
When using …
1. PIN policy: you will be asked to enter the Password in order to boot up the Raspberry PI
Page 17 of 21
2.USB policy: please make sure that the Authenticity dongle (= USB stick PU-50n) is inserted into your
Raspberry PI before you power up your Raspberry PI
The boot up of your Raspberry PI will look similar to the screenshot shown below:
Page 18 of 21
3. NET Policy: Please make sure, that your Raspberry PI is connected to the network and the net policy
server is up and running.
The boot up of your Raspberry PI will look similar to shown below:
Page 19 of 21
8. Appendix
8.1 Deactivating DP Card Data Protection
If you want to make changes to the boot partition of the Swissbit DP card (PS-45u Raspberry Pi Edition), you can
do this only when the card has data protection deactivated (transparent mode).
Deactivate DP card following steps:
1. Start the Swissbit Device Manager
2. Go to menu “Manage > Deactivate Data Protection”
3. Enter the Security Officer Password
4. Click on “Deactivate Data Protection”
2
Fig. 15 Deactivating Data Protection
Swissbit
Swissbit Net Policy Server User Manual
U-Boot
https://www.denx.de/wiki/view/DULG/UBoot
http://www.denx.de/wiki/DULG/Faq
Raspberry Pi
https://elinux.org/RPi_U-Boot
Page 20 of 21
9. Document History
Version Updated on Updated by Short description
Page 21 of 21