| 1 |
'\" t |
| 2 |
.TH "SYSTEMD\-SBSIGN" "1" "" "systemd 261~rc3" "systemd-sbsign" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
systemd-sbsign \- Sign PE binaries for EFI Secure Boot |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.HP \w'\fBsystemd\-sbsign\fR\ 'u |
| 26 |
\fBsystemd\-sbsign\fR [OPTIONS...] {COMMAND} |
| 27 |
.SH "DESCRIPTION" |
| 28 |
.PP |
| 29 |
\fBsystemd\-sbsign\fR |
| 30 |
can be used to sign PE binaries for EFI Secure Boot\&. |
| 31 |
.SH "COMMANDS" |
| 32 |
.PP |
| 33 |
\fBsign\fR |
| 34 |
.RS 4 |
| 35 |
Signs the given PE binary for EFI Secure Boot\&. Takes a path to a PE binary as its argument\&. If the PE binary already has a certificate table, the new signature will be added to it\&. Otherwise, a new certificate table will be created\&. The signed PE binary will be written to the path specified with |
| 36 |
\fB\-\-output=\fR\&. |
| 37 |
.sp |
| 38 |
Added in version 257\&. |
| 39 |
.RE |
| 40 |
.SH "OPTIONS" |
| 41 |
.PP |
| 42 |
The following options are understood: |
| 43 |
.PP |
| 44 |
\fB\-\-output=\fR\fB\fIPATH\fR\fR |
| 45 |
.RS 4 |
| 46 |
Specifies the path where to write the signed PE binary or the data to be signed offline when using the |
| 47 |
\fB\-\-prepare\-offline\-signing\fR |
| 48 |
option\&. |
| 49 |
.sp |
| 50 |
Added in version 257\&. |
| 51 |
.RE |
| 52 |
.PP |
| 53 |
\fB\-\-private\-key=\fR\fB\fIPATH/URI\fR\fR, \fB\-\-private\-key\-source=\fR\fB\fITYPE\fR\fR\fB[:\fR\fB\fINAME\fR\fR\fB]\fR, \fB\-\-certificate=\fR\fB\fIPATH\fR\fR, \fB\-\-certificate\-source=\fR\fB\fITYPE\fR\fR\fB[:\fR\fB\fINAME\fR\fR\fB]\fR |
| 54 |
.RS 4 |
| 55 |
Set the Secure Boot private key and certificate for use with the |
| 56 |
\fBsign\fR |
| 57 |
verb\&. The |
| 58 |
\fB\-\-certificate=\fR |
| 59 |
option takes a path to a PEM\-encoded X\&.509 certificate or a URI that\*(Aqs passed to the OpenSSL provider configured with |
| 60 |
\fB\-\-certificate\-source\fR\&. The |
| 61 |
\fB\-\-certificate\-source\fR |
| 62 |
option takes one of |
| 63 |
"file" |
| 64 |
or |
| 65 |
"provider", with the latter being followed by a specific provider identifier, separated with a colon, e\&.g\&. |
| 66 |
"provider:pkcs11"\&. The |
| 67 |
\fB\-\-private\-key=\fR |
| 68 |
option takes a path or a URI that will be passed to the OpenSSL engine or provider, as specified by |
| 69 |
\fB\-\-private\-key\-source=\fR |
| 70 |
as a |
| 71 |
"type:name" |
| 72 |
tuple, such as |
| 73 |
"engine:pkcs11"\&. The specified OpenSSL signing engine or provider will be used to sign the PE binary\&. |
| 74 |
.sp |
| 75 |
Added in version 257\&. |
| 76 |
.RE |
| 77 |
.PP |
| 78 |
\fB\-\-prepare\-offline\-signing\fR |
| 79 |
.RS 4 |
| 80 |
When this option is specified, the |
| 81 |
\fBsign\fR |
| 82 |
command writes the data that should be signed to the path specified with |
| 83 |
\fB\-\-output=\fR |
| 84 |
instead of writing the signed PE binary\&. This data can then be signed out of band after which the signature can be attached to the PE binary using the |
| 85 |
\fB\-\-signed\-data=\fR |
| 86 |
and |
| 87 |
\fB\-\-signed\-data\-signature=\fR |
| 88 |
options\&. |
| 89 |
.sp |
| 90 |
Added in version 258\&. |
| 91 |
.RE |
| 92 |
.PP |
| 93 |
\fB\-\-signed\-data=\fR\fB\fIPATH\fR\fR, \fB\-\-signed\-data\-signature=\fR\fB\fIPATH\fR\fR |
| 94 |
.RS 4 |
| 95 |
Configure the signed data (as written to the path specified with |
| 96 |
\fB\-\-output=\fR |
| 97 |
when using the |
| 98 |
\fB\-\-prepare\-offline\-signing\fR |
| 99 |
option) and corresponding signature for the |
| 100 |
\fBsign\fR |
| 101 |
command\&. |
| 102 |
.sp |
| 103 |
Added in version 258\&. |
| 104 |
.RE |
| 105 |
.PP |
| 106 |
\fB\-h\fR, \fB\-\-help\fR |
| 107 |
.RS 4 |
| 108 |
Print a short help text and exit\&. |
| 109 |
.RE |
| 110 |
.PP |
| 111 |
\fB\-\-version\fR |
| 112 |
.RS 4 |
| 113 |
Print a short version string and exit\&. |
| 114 |
.RE |
| 115 |
.SH "EXAMPLES" |
| 116 |
.PP |
| 117 |
\fBExample\ \&1.\ \&Offline EFI secure boot signing of a PE binary\fR |
| 118 |
.PP |
| 119 |
The following does offline secure boot signing of systemd\-boot: |
| 120 |
.sp |
| 121 |
.if n \{\ |
| 122 |
.RS 4 |
| 123 |
.\} |
| 124 |
.nf |
| 125 |
SD_BOOT="$(find /usr/lib/systemd/boot/efi/ \-name "systemd\-boot*\&.efi" | head \-n1)" |
| 126 |
# Extract the data that should be signed offline\&. |
| 127 |
/usr/lib/systemd/systemd\-sbsign \e |
| 128 |
sign \e |
| 129 |
\-\-certificate=secure\-boot\-certificate\&.pem \e |
| 130 |
\-\-output=signed\-data\&.bin \e |
| 131 |
\-\-prepare\-offline\-signing \e |
| 132 |
"$SD_BOOT" |
| 133 |
# Sign the data out\-of\-band\&. This step usually happens out\-of\-band on a separate system\&. |
| 134 |
openssl dgst \-sha256 \-sign secure\-boot\-private\-key\&.pem \-out signed\-data\&.sig signed\-data\&.bin |
| 135 |
# Attach the signed data and its signature to the systemd\-boot PE binary\&. |
| 136 |
/usr/lib/systemd/systemd\-sbsign \e |
| 137 |
sign \e |
| 138 |
\-\-certificate=secure\-boot\-certificate\&.pem \e |
| 139 |
\-\-output="$SD_BOOT\&.signed" \e |
| 140 |
\-\-signed\-data=signed\-data\&.bin \e |
| 141 |
\-\-signed\-data\-signature=signed\-data\&.sig \e |
| 142 |
"$SD_BOOT" |
| 143 |
.fi |
| 144 |
.if n \{\ |
| 145 |
.RE |
| 146 |
.\} |
| 147 |
.SH "SEE ALSO" |
| 148 |
.PP |
| 149 |
\fBbootctl\fR(1) |