Date   

Re: CIP IRC weekly meeting today

Chris Paterson
 

Hello Kudo-san,

Please accept my apologies; I can't babe the meeting this week.

Kind regards, Chris


From: cip-dev@... <cip-dev@...> on behalf of masashi.kudo@... via lists.cip-project.org <masashi.kudo=cybertrust.co.jp@...>
Sent: Wednesday, July 1, 2020 11:53:32 PM
To: cip-dev@... <cip-dev@...>
Subject: [cip-dev] CIP IRC weekly meeting today
 
Hi all,

Kindly be reminded to attend the weekly meeting through IRC to discuss technical topics with CIP kernel today.

*Please note that the IRC meeting was rescheduled to UTC (GMT) 09:00 starting from the first week of Apr. according to TSC meeting*
https://www.timeanddate.com/worldclock/meetingdetails.html?year=2020&month=7&day=2&hour=9&min=0&sec=0&p1=224&p2=179&p3=136&p4=37&p5=241&p6=248

USWest  USEast  UK      DE      TW      JP
02:00   05:00   10:00   11:00   17:00   18:00

Channel:
* irc:chat.freenode.net:6667/cip

Last meeting minutes:
https://irclogs.baserock.org/meetings/cip/2020/06/cip.2020-06-25-09.00.log.html

Agenda:

* Action item
  1. Combine root filesystem with kselftest binary - iwamatsu
  2. Post LTP results to KernelCI - patersonc
  3. Issues to be fixed for swupdate "copyright correction and salsa CI testing" - iwamatsu

* Kernel maintenance updates
* Kernel testing
* Software update
* CIP Security
* AOB

The meeting will take 30 min, although it can be extended to an hour if it makes sense and those involved in the topics can stay. Otherwise, the topic will be taken offline or in the next meeting.

Best regards,
--
M. Kudo
Cybertrust Japan Co., Ltd.


Re: Working on HTTPS connection

Quirin Gylstorff
 

On 6/29/20 6:57 PM, Mohammed Billoo wrote:
Hello!
I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8
I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).
Is there any update on this task that should I be aware of?
Hi,

if you add the following elements to the swupdate build config. HTTPS works more or less. I did not test it in all configurations, only for a short demo. And some of the options may not be necessary.

...
CONFIG_CURL=y
CONFIG_CURL_SSL=y
CONFIG_SSL_IMPL_OPENSSL=y
CONFIG_DOWNLOAD=y
CONFIG_DOWNLOAD_SSL=y
CONFIG_CHANNEL_CURL=y
CONFIG_CHANNEL_CURL_SSL=y
CONFIG_SURICATTA=y
CONFIG_SURICATTA_STATE_CHOICE_NONE=y
CONFIG_SURICATTA_HAWKBIT=y
CONFIG_SURICATTA_SSL=y
CONFIG_HASH_VERIFY=y
CONFIG_JSON=y
...

Quirin

Looking forward to contributing to this project!
--
Mohammed A Billoo
Founder
MAB Labs, LLC
www.mab-labs.com <http://www.mab-labs.com>
201-338-2022
--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com
--
Quirin


Re: Setting up SWUpdate

Akihiro Suzuki
 

Hi Mohammed,

 

If you work on this issue, you will be able to learn about our software update mechanism well, I think.

Can I assign you to work on this issue?

 

Thanks,

Suzuki

 

From: Mohammed Billoo <mab@...>
Sent: Wednesday, July 1, 2020 8:57 PM
To: suzuki akihiro(
鈴木 章浩SWCACT) <akihiro27.suzuki@...>
Cc: cip-dev@...
Subject: Re: [cip-dev] Setting up SWUpdate

 

Suzuki,

 

I can look into this issue as well (when my BBB comes in). It's focused enough that I can learn enough about SWUpdate and how it fits into CIP.

 

Let me know what you think.

 

Mohammed

 

On Wed, Jul 1, 2020 at 5:40 AM <akihiro27.suzuki@...> wrote:

Hi Mohammed,

 

> NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

Ive made the issue about it: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/14

It might be better to wait for trying cip-sw-updates-demo until the issue is resolved.

 

Thanks,
Suzuki

 

From: suzuki akihiro(鈴木 章浩SWCACT)
Sent: Wednesday, July 1, 2020 2:09 PM
To: Mohammed Billoo <mab@...>
Cc: cip-dev@...
Subject: RE: [cip-dev] Setting up SWUpdate

 

Hi Mohammed,

 

> Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

Yes, you can verify a basic update process via README.md in cip-sw-updates-demo repository.

It uses BBB and hawkBit.

Please let me know if you have a problem about the instructions written in the README.md.

NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

 

> Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

The patchset is for x86 with UEFI to provide updatable secure boot for UEFI.

It uses EFI Boot Guard (https://github.com/siemens/efibootguard) instead of u-boot.

It will be able to cover the main use cases for software update on devices.

Although cip-sw-updates-demo repository doesnt include the demo for x86 with UEFI at the moment,

you can try basic update features using BBB.

 

Thanks,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Wednesday, July 1, 2020 7:49 AM
To: cip-dev@...
Subject: [cip-dev] Setting up SWUpdate

 

Hello,

 

Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

 

Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

 

--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com



--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


CIP IRC weekly meeting today

masashi.kudo@cybertrust.co.jp <masashi.kudo@...>
 

Hi all,

Kindly be reminded to attend the weekly meeting through IRC to discuss technical topics with CIP kernel today.

*Please note that the IRC meeting was rescheduled to UTC (GMT) 09:00 starting from the first week of Apr. according to TSC meeting*
https://www.timeanddate.com/worldclock/meetingdetails.html?year=2020&month=7&day=2&hour=9&min=0&sec=0&p1=224&p2=179&p3=136&p4=37&p5=241&p6=248

USWest USEast UK DE TW JP
02:00 05:00 10:00 11:00 17:00 18:00

Channel:
* irc:chat.freenode.net:6667/cip

Last meeting minutes:
https://irclogs.baserock.org/meetings/cip/2020/06/cip.2020-06-25-09.00.log.html

Agenda:

* Action item
1. Combine root filesystem with kselftest binary - iwamatsu
2. Post LTP results to KernelCI - patersonc
3. Issues to be fixed for swupdate "copyright correction and salsa CI testing" - iwamatsu

* Kernel maintenance updates
* Kernel testing
* Software update
* CIP Security
* AOB

The meeting will take 30 min, although it can be extended to an hour if it makes sense and those involved in the topics can stay. Otherwise, the topic will be taken offline or in the next meeting.

Best regards,
--
M. Kudo
Cybertrust Japan Co., Ltd.


Building generic initramfs for the various testing

Zoran
 

Hello list,

Long time no see... ;-)

Just for the sake of Reality: the generic initramfs building from the:
https://wiki.linuxfoundation.org/civilinfrastructureplatform/cipsystembuildhowto

Does not work (for me, at least) anymore.

Here is the new minimalistic script, since I needed it (and reworked
it, to be much more efficient):
https://github.com/ZoranStojsavljevic/BBB_Workshop_Examples/blob/master/Generic_Initrd_Porting_Guide/initramfs/create_initramfs.sh

Enjoy!
Zoran Stojsavljevic


Re: Setting up SWUpdate

Mohammed Billoo <mab@...>
 

Suzuki,

I can look into this issue as well (when my BBB comes in). It's focused enough that I can learn enough about SWUpdate and how it fits into CIP.

Let me know what you think.

Mohammed


On Wed, Jul 1, 2020 at 5:40 AM <akihiro27.suzuki@...> wrote:

Hi Mohammed,

 

> NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

I’ve made the issue about it: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/14

It might be better to wait for trying cip-sw-updates-demo until the issue is resolved.

 

Thanks,
Suzuki

 

From: suzuki akihiro(鈴木 章浩SWCACT)
Sent: Wednesday, July 1, 2020 2:09 PM
To: Mohammed Billoo <mab@...>
Cc: cip-dev@...
Subject: RE: [cip-dev] Setting up SWUpdate

 

Hi Mohammed,

 

> Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

Yes, you can verify a basic update process via README.md in cip-sw-updates-demo repository.

It uses BBB and hawkBit.

Please let me know if you have a problem about the instructions written in the README.md.

NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

 

> Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

The patchset is for x86 with UEFI to provide updatable secure boot for UEFI.

It uses EFI Boot Guard (https://github.com/siemens/efibootguard) instead of u-boot.

It will be able to cover the main use cases for software update on devices.

Although cip-sw-updates-demo repository doesnt include the demo for x86 with UEFI at the moment,

you can try basic update features using BBB.

 

Thanks,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Wednesday, July 1, 2020 7:49 AM
To: cip-dev@...
Subject: [cip-dev] Setting up SWUpdate

 

Hello,

 

Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

 

Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

 

--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com



--
Mohammed A Billoo
Founder
MAB Labs, LLC
201-338-2022

--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: Setting up SWUpdate

Akihiro Suzuki
 

Hi Mohammed,

 

> NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

I’ve made the issue about it: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/14

It might be better to wait for trying cip-sw-updates-demo until the issue is resolved.

 

Thanks,
Suzuki

 

From: suzuki akihiro(鈴木 章浩SWCACT)
Sent: Wednesday, July 1, 2020 2:09 PM
To: Mohammed Billoo <mab@...>
Cc: cip-dev@...
Subject: RE: [cip-dev] Setting up SWUpdate

 

Hi Mohammed,

 

> Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

Yes, you can verify a basic update process via README.md in cip-sw-updates-demo repository.

It uses BBB and hawkBit.

Please let me know if you have a problem about the instructions written in the README.md.

NOTE: Now I have a problem with the demo. Ill make the issue about it in cip-sw-updates-tasks repository later.

 

> Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

The patchset is for x86 with UEFI to provide updatable secure boot for UEFI.

It uses EFI Boot Guard (https://github.com/siemens/efibootguard) instead of u-boot.

It will be able to cover the main use cases for software update on devices.

Although cip-sw-updates-demo repository doesnt include the demo for x86 with UEFI at the moment,

you can try basic update features using BBB.

 

Thanks,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Wednesday, July 1, 2020 7:49 AM
To: cip-dev@...
Subject: [cip-dev] Setting up SWUpdate

 

Hello,

 

Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

 

Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

 

--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: Setting up SWUpdate

Akihiro Suzuki
 

Hi Mohammed,

 

> Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

Yes, you can verify a basic update process via README.md in cip-sw-updates-demo repository.

It uses BBB and hawkBit.

Please let me know if you have a problem about the instructions written in the README.md.

NOTE: Now I have a problem with the demo. I’ll make the issue about it in cip-sw-updates-tasks repository later.

 

> Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

The patchset is for x86 with UEFI to provide updatable secure boot for UEFI.

It uses EFI Boot Guard (https://github.com/siemens/efibootguard) instead of u-boot.

It will be able to cover the main use cases for software update on devices.

Although cip-sw-updates-demo repository doesn’t include the demo for x86 with UEFI at the moment,

you can try basic update features using BBB.

 

Thanks,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Wednesday, July 1, 2020 7:49 AM
To: cip-dev@...
Subject: [cip-dev] Setting up SWUpdate

 

Hello,

 

Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

 

Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

 

--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Setting up SWUpdate

Mohammed Billoo <mab@...>
 

Hello,

Should I be using the instructions outlined in https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-demo to run a basic update of the CIP image on a BBB from hawkBit? Can the update process be verified using hawkbit and/or the BBB?

Also, there looks to be a patchset to bring in swupdate to cip-core (https://patchwork.kernel.org/project/cip-dev/list/?series=309741). Should I wait for this patchset to be approved?

--
Mohammed A Billoo
Founder
MAB Labs, LLC
201-338-2022

--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: Working on HTTPS connection

masashi.kudo@cybertrust.co.jp <masashi.kudo@...>
 

Hi, Mohammed-san,

 

No worries. Meeting minutes will be produced at every meeting.

So, you can check them out to see what is going on afterwards.

 

FYI, last meeting minutes are the following:

https://irclogs.baserock.org/meetings/cip/2020/06/cip.2020-06-25-09.00.log.html

 

Best regards,

--

M. Kudo

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Tuesday, June 30, 2020 8:16 PM
To: akihiro27.suzuki@...
Cc: cip-dev@...
Subject: Re: [cip-dev] Working on HTTPS connection

 

Suzuki, M. Kudo:

Thank you for getting back to me. I'll order the BBB, and start navigating the codebase until it arrives. I will try my best to make the meetings on Thursday, but it may be difficult since I'm in NYC and it will be 5AM. Is it OK if I post updates to the IRC channel when I'm up in the morning (in case I can't make it to the meeting) ?

 

Best,

Mohammed

 

On Tue, Jun 30, 2020 at 3:40 AM <akihiro27.suzuki@...> wrote:

Hi Mohammed,

 

Thank you very much for your offer!

Im Akihiro Suzuki, a chair of SW Updates WG.

 

Currently, we are using BeagleBone Black (BBB) for developing our initial software update mechanism.

Of course we plan to port it to other reference hardware, but it is not done at the moment.

So, could you prepare BBB for the development?

 

Even if you cant prepare it, you may work on the task you are interested in because it is not a hardware-specific.

The task aims to connect between client (SWUpdate) and server (hawkBit) via HTTPS.

 

Best regards,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of masashi.kudo@...
Sent: Tuesday, June 30, 2020 7:32 AM
To: cip-dev@...
Subject: Re: [cip-dev] Working on HTTPS connection

 

Hi, Mohammed-san,

 

Thanks very much for watching the talk, and welcome to cip-dev!

 

Regarding SW Update WG, the followings are the their wiki pages.

 

https://wiki.linuxfoundation.org/civilinfrastructureplatform/start#cip_software_updates

https://wiki.linuxfoundation.org/civilinfrastructureplatform/cip-sw-updates

 

Also, SW Update WG reports the latest status at IRC meetings which start at UTC (GMT) 09:00 every Thursday. Notifications of the meetings are sent 6-9 hours before the meetings.

 

Hope it helps.

 

Best regards,

--

M. Kudo

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Tuesday, June 30, 2020 1:57 AM
To: cip-dev@...
Subject: [cip-dev] Working on HTTPS connection

 

Hello!

 

I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8

 

I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).

 

Is there any update on this task that should I be aware of?

 

Looking forward to contributing to this project!


--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com



--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: Working on HTTPS connection

Mohammed Billoo <mab@...>
 

Suzuki, M. Kudo:

Thank you for getting back to me. I'll order the BBB, and start navigating the codebase until it arrives. I will try my best to make the meetings on Thursday, but it may be difficult since I'm in NYC and it will be 5AM. Is it OK if I post updates to the IRC channel when I'm up in the morning (in case I can't make it to the meeting) ?

Best,
Mohammed


On Tue, Jun 30, 2020 at 3:40 AM <akihiro27.suzuki@...> wrote:

Hi Mohammed,

 

Thank you very much for your offer!

I’m Akihiro Suzuki, a chair of SW Updates WG.

 

Currently, we are using BeagleBone Black (BBB) for developing our initial software update mechanism.

Of course we plan to port it to other reference hardware, but it is not done at the moment.

So, could you prepare BBB for the development?

 

Even if you can’t prepare it, you may work on the task you are interested in because it is not a hardware-specific.

The task aims to connect between client (SWUpdate) and server (hawkBit) via HTTPS.

 

Best regards,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of masashi.kudo@...
Sent: Tuesday, June 30, 2020 7:32 AM
To: cip-dev@...
Subject: Re: [cip-dev] Working on HTTPS connection

 

Hi, Mohammed-san,

 

Thanks very much for watching the talk, and welcome to cip-dev!

 

Regarding SW Update WG, the followings are the their wiki pages.

 

https://wiki.linuxfoundation.org/civilinfrastructureplatform/start#cip_software_updates

https://wiki.linuxfoundation.org/civilinfrastructureplatform/cip-sw-updates

 

Also, SW Update WG reports the latest status at IRC meetings which start at UTC (GMT) 09:00 every Thursday. Notifications of the meetings are sent 6-9 hours before the meetings.

 

Hope it helps.

 

Best regards,

--

M. Kudo

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Tuesday, June 30, 2020 1:57 AM
To: cip-dev@...
Subject: [cip-dev] Working on HTTPS connection

 

Hello!

 

I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8

 

I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).

 

Is there any update on this task that should I be aware of?

 

Looking forward to contributing to this project!


--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com



--
Mohammed A Billoo
Founder
MAB Labs, LLC
201-338-2022

--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: [isar-cip-core PATCH 1/6] opt-security.yml: Sample settings to install security

Venkata Pyla
 

On Mon, Jun 29, 2020 at 05:26 PM, Daniel Sangorrin wrote:
-----Original Message-----
From: cip-dev@... [mailto:cip-dev@...] On Behalf Of Jan Kiszka
Sent: Friday, June 26, 2020 7:41 PM
To: cip-dev@...; pyla venkata(TSIP) <Venkata.Pyla@...>
Cc: cip-security@...
Subject: Re: [cip-dev][isar-cip-core PATCH 1/6] opt-security.yml: Sample settings to install security

On 26.06.20 08:44, venkata wrote:
From: Kazuhiro Hayashi
kazuhiro3.hayashi@...<mailto:kazuhiro3.hayashi@...
This line seems to have been mangled. It should be in line with the Signed-off-by.

opt-security.yml: Sample settings to install security packages

Signed-off-by: Kazuhiro Hayashi <kazuhiro3.hayashi@...>
---
SECURITY.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
opt-security.yml | 34 +++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 SECURITY.md
create mode 100644 opt-security.yml

diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index
0000000..a8bccc7
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,52 @@
+How to customize images for security features
+=============================================
+
+This is the "temporal" document about how to create and use the CIP
+Core generic profile images for security feature evaluation.
+
+Official manuals
+----------------
+
+* isar-cip-core:
+https://gitlab.com/zuka0828/isar-cip-core/-/blob/master/README.md
+* ISAR User Manual:
+https://github.com/ilbers/isar/blob/master/doc/user_manual.md
+
+Assumed environment
+-------------------
+
+* isar-cip-core: master branch
+* Host: Debian 10 buster amd64
+ * Installed packages: `docker-ce`, `qemu-system`
+ * Users who does the following actions must be in the groups
+`docker` and `kvm`
+
+Create kas file
+---------------
+
+Create a kas file named `opt-security.yml` to add security settings.
That file is added by this patch already.

+
+Add security packages to rootfs
+-------------------------------
+
+Set `IMAGE_PREINSTALL` to the list of packages required to enable the
+security features. This variable can be set through the kas file.
+
+Example:
+
+```
+local_conf_header:
+ security: |
+ IMAGE_PREINSTALL = "openssl"
+```
+
+Build images
+------------
+
+Build images for QEMU x86 64bit machine:
+
+ $ ./kas-docker --isar build
+ kas.yml:board-qemu-amd64.yml:opt-security.yml
+
+Run on QEMU
+-----------
+
+Run the generated images on QEMU (x86 64bit).
+
+ $ ./start-qemu.sh amd64
diff --git a/opt-security.yml b/opt-security.yml new file mode 100644
index 0000000..7c6b39c
--- /dev/null
+++ b/opt-security.yml
@@ -0,0 +1,34 @@
+#
+# KAS configuration for CIP Core generic profile to enable security
+features # # Copyright (c) Toshiba Corporation, 2020 # # Authors:
+# Kazuhiro Hayashi <kazuhiro3.hayashi@...> # #
+SPDX-License-Identifier: MIT #
+
+header:
+ version: 8
+
+local_conf_header:
+ security: |
+ # TODO: Add sudo or sudo-ldap
+ IMAGE_PREINSTALL = "\
+ openssl libssl1.1 \
+ fail2ban \
+ openssh-server openssh-sftp-server openssh-client \
+ syslog-ng-core syslog-ng-mod-journal \
+ aide aide-common \
+ libnftables0 nftables \
+ libpam-pkcs11 \
+ chrony \
+ tpm2-tools \
+ tpm2-abrmd \
+ libtss2-esys0 libtss2-udev \
+ libpam-cracklib \
+ acl \
+ libauparse0 audispd-plugins auditd \
+ uuid-runtime \
+ "
Shouldn't we target for a security image (recipe) instead?

General question: What is this series targeting? Seems patch 2 and 3 are left-overs from the development. Is this an RFC series only?

Jan
It seems that opt-security.yaml was already removed in the security branch:
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/tree/security/iec-evaluation

Venkata-san: could you rebase your patches for the master branch?


For example, instead of sending one patch where you add opt-security.yaml and then another patch where you remove it (which may have happened in your branch, but we don't care), just send the patch that uses core-image-security. That will make things easier to review.
I understood now, i will rebase the patches with master branch and i will resend the patches for review, sorry for the confusion
Also, as we have talked in the meetings, it looks like the security layer at the moment is just adding some packages but don't you need to add configuration files to harden the final file system? For example, you may want to change the configuration of the ssh server so that passwords are not accepted (only ssh keys). And the same for the rest of packages. In that case, you probably want to create a new kas-security.yaml.
Currently we don't have such configuration changes, but most probably in the future may be after discussion with Certification Body we may need to include configurations to fullfill the security requirement, we will keep this point in security WG discussions and get some consensus.
Thanks,
Daniel


Re: Working on HTTPS connection

Akihiro Suzuki
 

Hi Mohammed,

 

Thank you very much for your offer!

I’m Akihiro Suzuki, a chair of SW Updates WG.

 

Currently, we are using BeagleBone Black (BBB) for developing our initial software update mechanism.

Of course we plan to port it to other reference hardware, but it is not done at the moment.

So, could you prepare BBB for the development?

 

Even if you can’t prepare it, you may work on the task you are interested in because it is not a hardware-specific.

The task aims to connect between client (SWUpdate) and server (hawkBit) via HTTPS.

 

Best regards,

Suzuki

 

From: cip-dev@... <cip-dev@...> On Behalf Of masashi.kudo@...
Sent: Tuesday, June 30, 2020 7:32 AM
To: cip-dev@...
Subject: Re: [cip-dev] Working on HTTPS connection

 

Hi, Mohammed-san,

 

Thanks very much for watching the talk, and welcome to cip-dev!

 

Regarding SW Update WG, the followings are the their wiki pages.

 

https://wiki.linuxfoundation.org/civilinfrastructureplatform/start#cip_software_updates

https://wiki.linuxfoundation.org/civilinfrastructureplatform/cip-sw-updates

 

Also, SW Update WG reports the latest status at IRC meetings which start at UTC (GMT) 09:00 every Thursday. Notifications of the meetings are sent 6-9 hours before the meetings.

 

Hope it helps.

 

Best regards,

--

M. Kudo

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Tuesday, June 30, 2020 1:57 AM
To: cip-dev@...
Subject: [cip-dev] Working on HTTPS connection

 

Hello!

 

I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8

 

I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).

 

Is there any update on this task that should I be aware of?

 

Looking forward to contributing to this project!


--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: [isar-cip-core PATCH 1/6] opt-security.yml: Sample settings to install security

Daniel Sangorrin
 

-----Original Message-----
From: cip-dev@lists.cip-project.org [mailto:cip-dev@lists.cip-project.org] On Behalf Of Jan Kiszka
Sent: Friday, June 26, 2020 7:41 PM
To: cip-dev@lists.cip-project.org; pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>
Cc: cip-security@lists.cip-project.org
Subject: Re: [cip-dev][isar-cip-core PATCH 1/6] opt-security.yml: Sample settings to install security

On 26.06.20 08:44, venkata wrote:
From: Kazuhiro Hayashi
kazuhiro3.hayashi@toshiba.co.jp<mailto:kazuhiro3.hayashi@toshiba.co.jp
This line seems to have been mangled. It should be in line with the Signed-off-by.

opt-security.yml: Sample settings to install security packages

Signed-off-by: Kazuhiro Hayashi <kazuhiro3.hayashi@toshiba.co.jp>
---
SECURITY.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
opt-security.yml | 34 +++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 SECURITY.md
create mode 100644 opt-security.yml

diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index
0000000..a8bccc7
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,52 @@
+How to customize images for security features
+=============================================
+
+This is the "temporal" document about how to create and use the CIP
+Core generic profile images for security feature evaluation.
+
+Official manuals
+----------------
+
+* isar-cip-core:
+https://gitlab.com/zuka0828/isar-cip-core/-/blob/master/README.md
+* ISAR User Manual:
+https://github.com/ilbers/isar/blob/master/doc/user_manual.md
+
+Assumed environment
+-------------------
+
+* isar-cip-core: master branch
+* Host: Debian 10 buster amd64
+ * Installed packages: `docker-ce`, `qemu-system`
+ * Users who does the following actions must be in the groups
+`docker` and `kvm`
+
+Create kas file
+---------------
+
+Create a kas file named `opt-security.yml` to add security settings.
That file is added by this patch already.

+
+Add security packages to rootfs
+-------------------------------
+
+Set `IMAGE_PREINSTALL` to the list of packages required to enable the
+security features. This variable can be set through the kas file.
+
+Example:
+
+```
+local_conf_header:
+ security: |
+ IMAGE_PREINSTALL = "openssl"
+```
+
+Build images
+------------
+
+Build images for QEMU x86 64bit machine:
+
+ $ ./kas-docker --isar build
+ kas.yml:board-qemu-amd64.yml:opt-security.yml
+
+Run on QEMU
+-----------
+
+Run the generated images on QEMU (x86 64bit).
+
+ $ ./start-qemu.sh amd64
diff --git a/opt-security.yml b/opt-security.yml new file mode 100644
index 0000000..7c6b39c
--- /dev/null
+++ b/opt-security.yml
@@ -0,0 +1,34 @@
+#
+# KAS configuration for CIP Core generic profile to enable security
+features # # Copyright (c) Toshiba Corporation, 2020 # # Authors:
+# Kazuhiro Hayashi <kazuhiro3.hayashi@toshiba.co.jp> # #
+SPDX-License-Identifier: MIT #
+
+header:
+ version: 8
+
+local_conf_header:
+ security: |
+ # TODO: Add sudo or sudo-ldap
+ IMAGE_PREINSTALL = "\
+ openssl libssl1.1 \
+ fail2ban \
+ openssh-server openssh-sftp-server openssh-client \
+ syslog-ng-core syslog-ng-mod-journal \
+ aide aide-common \
+ libnftables0 nftables \
+ libpam-pkcs11 \
+ chrony \
+ tpm2-tools \
+ tpm2-abrmd \
+ libtss2-esys0 libtss2-udev \
+ libpam-cracklib \
+ acl \
+ libauparse0 audispd-plugins auditd \
+ uuid-runtime \
+ "
Shouldn't we target for a security image (recipe) instead?

General question: What is this series targeting? Seems patch 2 and 3 are left-overs from the development. Is this an RFC series only?

Jan
It seems that opt-security.yaml was already removed in the security branch:
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/tree/security/iec-evaluation

Venkata-san: could you rebase your patches for the master branch?

For example, instead of sending one patch where you add opt-security.yaml and then another patch where you remove it (which may have happened in your branch, but we don't care), just send the patch that uses core-image-security. That will make things easier to review.

Also, as we have talked in the meetings, it looks like the security layer at the moment is just adding some packages but don't you need to add configuration files to harden the final file system? For example, you may want to change the configuration of the ssh server so that passwords are not accepted (only ssh keys). And the same for the rest of packages. In that case, you probably want to create a new kas-security.yaml.

Thanks,
Daniel


Re: Working on HTTPS connection

masashi.kudo@cybertrust.co.jp <masashi.kudo@...>
 

Hi, Mohammed-san,

 

Thanks very much for watching the talk, and welcome to cip-dev!

 

Regarding SW Update WG, the followings are the their wiki pages.

 

https://wiki.linuxfoundation.org/civilinfrastructureplatform/start#cip_software_updates

https://wiki.linuxfoundation.org/civilinfrastructureplatform/cip-sw-updates

 

Also, SW Update WG reports the latest status at IRC meetings which start at UTC (GMT) 09:00 every Thursday. Notifications of the meetings are sent 6-9 hours before the meetings.

 

Hope it helps.

 

Best regards,

--

M. Kudo

 

From: cip-dev@... <cip-dev@...> On Behalf Of Mohammed Billoo
Sent: Tuesday, June 30, 2020 1:57 AM
To: cip-dev@...
Subject: [cip-dev] Working on HTTPS connection

 

Hello!

 

I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8

 

I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).

 

Is there any update on this task that should I be aware of?

 

Looking forward to contributing to this project!


--

Mohammed A Billoo

Founder

MAB Labs, LLC

201-338-2022


--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


VulnerableCode

Jan Kiszka
 

Hi all,

just a note after watching https://sched.co/c46p, https://github.com/nexB/vulnerablecode: Still early, but might be worth looking at if we can benefit from it for vulnerability management.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


Working on HTTPS connection

mab@...
 

Hello!

I joined the mailing list from the recommendation on the IRC channel (after viewing the CIP talk at ELC). I'd like to work on the following issue: https://gitlab.com/cip-project/cip-sw-updates/cip-sw-updates-tasks/-/issues/8

I've written applications + drivers for u-boot, have worked on SSL (albeit for Amazon FreeRTOS), and have HW handy to hit the ground running (I have a DE1-SoC).

Is there any update on this task that should I be aware of?

Looking forward to contributing to this project!

--
Mohammed A Billoo
Founder
MAB Labs, LLC
201-338-2022

--
Mohammed Billoo
MAB Labs, LLC
www.mab-labs.com


Re: [isar-cip-core PATCH v2 6/6] doc: Add README for secureboot

Jan Kiszka
 

On 29.06.20 14:54, Q. Gylstorff wrote:
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
doc/README.secureboot.md | 188 +++++++++++++++++++++++++++++++++++++++
kas/opt/ebg-swu.yml | 2 +-
...

diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml
index 5b39730..81d90ad 100644
--- a/kas/opt/ebg-swu.yml
+++ b/kas/opt/ebg-swu.yml
@@ -22,5 +22,5 @@ local_conf_header:
WICVARS += "WDOG_TIMEOUT"
wic: |
- IMAGE_TYPE = "wic-img"
+ IMAGE_TYPE = "wic-swu-img"
WKS_FILE = "${MACHINE}-${BOOTLOADER}.wks"
You are trying to sneak in more than a README ;)

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


[isar-cip-core PATCH v2 5/6] secure-boot: Add Debian snakeoil keys for ease-of-use

Quirin Gylstorff
 

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Use the Debian snakeoil keys to have a demo case available without
the OVMF setup. Copy the used keys from the build to the deploy
directory to allow usage in non-Debian distributions.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
conf/distro/debian-buster-backports.list | 1 +
conf/distro/preferences.ovmf-snakeoil.conf | 3 ++
kas/opt/ebg-secure-boot-snakeoil.yml | 27 ++++++++++++++
.../ebg-secure-boot-snakeoil_0.1.bb | 35 ++++++++++++++++++
.../files/control.tmpl | 12 +++++++
.../files/sign_secure_image.sh | 36 +++++++++++++++++++
.../ovmf-binaries/files/control.tmpl | 11 ++++++
.../ovmf-binaries/ovmf-binaries_0.1.bb | 30 ++++++++++++++++
start-qemu.sh | 4 +--
9 files changed, 157 insertions(+), 2 deletions(-)
create mode 100644 conf/distro/debian-buster-backports.list
create mode 100644 conf/distro/preferences.ovmf-snakeoil.conf
create mode 100644 kas/opt/ebg-secure-boot-snakeoil.yml
create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/ebg-secure-boot-snakeoil_0.1.bb
create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/files/control.tmpl
create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/files/sign_secure_image.sh
create mode 100644 recipes-devtools/ovmf-binaries/files/control.tmpl
create mode 100644 recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb

diff --git a/conf/distro/debian-buster-backports.list b/conf/distro/debian-buster-backports.list
new file mode 100644
index 0000000..f2dd104
--- /dev/null
+++ b/conf/distro/debian-buster-backports.list
@@ -0,0 +1 @@
+deb http://ftp.us.debian.org/debian buster-backports main contrib non-free
diff --git a/conf/distro/preferences.ovmf-snakeoil.conf b/conf/distro/preferences.ovmf-snakeoil.conf
new file mode 100644
index 0000000..b51d1d4
--- /dev/null
+++ b/conf/distro/preferences.ovmf-snakeoil.conf
@@ -0,0 +1,3 @@
+Package: ovmf
+Pin: release n=buster-backports
+Pin-Priority: 801
diff --git a/kas/opt/ebg-secure-boot-snakeoil.yml b/kas/opt/ebg-secure-boot-snakeoil.yml
new file mode 100644
index 0000000..a43ddb5
--- /dev/null
+++ b/kas/opt/ebg-secure-boot-snakeoil.yml
@@ -0,0 +1,27 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2020
+#
+# Authors:
+# Quirin Gylstorff <quirin.gylstorff@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+header:
+ version: 8
+ includes:
+ - ebg-secure-boot-base.yml
+
+
+local_conf_header:
+ secure-boot: |
+ # Add snakeoil and ovmf binaries for qemu
+ IMAGER_BUILD_DEPS += "ebg-secure-boot-snakeoil ovmf-binaries"
+ IMAGER_INSTALL += "ebg-secure-boot-snakeoil"
+
+ ovmf: |
+ # snakeoil certs are only part of backports
+ DISTRO_APT_SOURCES_append = " conf/distro/debian-buster-backports.list"
+ DISTRO_APT_PREFERENCES_append = " conf/distro/preferences.ovmf-snakeoil.conf"
diff --git a/recipes-devtools/ebg-secure-boot-snakeoil/ebg-secure-boot-snakeoil_0.1.bb b/recipes-devtools/ebg-secure-boot-snakeoil/ebg-secure-boot-snakeoil_0.1.bb
new file mode 100644
index 0000000..89abbcf
--- /dev/null
+++ b/recipes-devtools/ebg-secure-boot-snakeoil/ebg-secure-boot-snakeoil_0.1.bb
@@ -0,0 +1,35 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2020
+#
+# Authors:
+# Quirin Gylstorff <quirin.gylstorff@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+DESCRIPTION = "Add script to sign for secure boot with the debian snakeoil keys"
+# used to sign the image
+DEBIAN_DEPENDS = "pesign, sbsigntool, ovmf, openssl, libnss3-tools"
+
+
+# this package cannot be install together with:
+DEBIAN_CONFLICTS = "ebg-secure-boot-secrets"
+
+SRC_URI = "file://sign_secure_image.sh \
+ file://control.tmpl"
+
+TEMPLATE_FILES = "control.tmpl"
+TEMPLATE_VARS += "PN MAINTAINER DPKG_ARCH DEBIAN_DEPENDS DESCRIPTION DEBIAN_CONFLICTS"
+
+do_install() {
+ TARGET=${D}/usr/bin
+ install -d ${TARGET}
+ install -m 755 ${WORKDIR}/sign_secure_image.sh ${TARGET}/sign_secure_image.sh
+}
+
+addtask do_install after do_transform_template
+
diff --git a/recipes-devtools/ebg-secure-boot-snakeoil/files/control.tmpl b/recipes-devtools/ebg-secure-boot-snakeoil/files/control.tmpl
new file mode 100644
index 0000000..8361a49
--- /dev/null
+++ b/recipes-devtools/ebg-secure-boot-snakeoil/files/control.tmpl
@@ -0,0 +1,12 @@
+Source: ${PN}
+Section: misc
+Priority: optional
+Standards-Version: 3.9.6
+Maintainer: ${MAINTAINER}
+Build-Depends: debhelper (>= 9)
+
+Package: ${PN}
+Architecture: ${DPKG_ARCH}
+Depends: ${DEBIAN_DEPENDS}
+Description: ${DESCRIPTION}
+Conflicts: ${DEBIAN_CONFLICTS}
diff --git a/recipes-devtools/ebg-secure-boot-snakeoil/files/sign_secure_image.sh b/recipes-devtools/ebg-secure-boot-snakeoil/files/sign_secure_image.sh
new file mode 100644
index 0000000..081dbe9
--- /dev/null
+++ b/recipes-devtools/ebg-secure-boot-snakeoil/files/sign_secure_image.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+set -x
+signee=$1
+signed=$2
+
+usage(){
+ echo "sign with debian snakeoil"
+ echo "$0 signee signed"
+ echo "signee: path to the image to be signed"
+ echo "signed: path to store the signed image"
+}
+
+
+if [ -z "$signee" ] || [ -z "$signed" ]; then
+ usage
+ exit 1
+fi
+
+name=snakeoil
+keydir=$(mktemp -d)
+inkey=/usr/share/ovmf/PkKek-1-snakeoil.key
+incert=/usr/share/ovmf/PkKek-1-snakeoil.pem
+nick_name=snakeoil
+TMP=$(mktemp -d)
+mkdir -p ${keydir}/${name}certdb
+certutil -N --empty-password -d ${keydir}/${name}certdb
+openssl pkcs12 -export -passin pass:"snakeoil" -passout pass: -out ${TMP}/foo_key.p12 -inkey $inkey -in $incert -name $nick_name
+pk12util -W "" -i ${TMP}/foo_key.p12 -d ${keydir}/${name}certdb
+cp $incert ${keydir}/$(basename $incert)
+rm -rf $TMP
+
+pesign --force --verbose --padding -n ${keydir}/${name}certdb -c "$nick_name" -s -i $signee -o $signed
+sbverify --cert $incert $signed
+rm -rf $keydir
+exit 0
diff --git a/recipes-devtools/ovmf-binaries/files/control.tmpl b/recipes-devtools/ovmf-binaries/files/control.tmpl
new file mode 100644
index 0000000..54641d6
--- /dev/null
+++ b/recipes-devtools/ovmf-binaries/files/control.tmpl
@@ -0,0 +1,11 @@
+Source: ${PN}
+Section: misc
+Priority: optional
+Standards-Version: 3.9.6
+Maintainer: ${MAINTAINER}
+Build-Depends: debhelper (>= 9), ${DEBIAN_BUILD_DEPENDS}
+
+Package: ${PN}
+Architecture: ${DPKG_ARCH}
+Depends: ${DEBIAN_DEPENDS}
+Description: ${DESCRIPTION}
diff --git a/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb b/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
new file mode 100644
index 0000000..025b970
--- /dev/null
+++ b/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
@@ -0,0 +1,30 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2020
+#
+# Authors:
+# Quirin Gylstorff <quirin.gylstorff@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+DESCRIPTION = "Copy the OVMF biniaries from the build changeroot to the deploy dir"
+
+# this is a empty debian package
+SRC_URI = "file://control.tmpl"
+
+DEBIAN_BUILD_DEPENDS = "ovmf"
+TEMPLATE_FILES = "control.tmpl"
+TEMPLATE_VARS += "PN DEBIAN_DEPENDS MAINTAINER DESCRIPTION DPKG_ARCH DEBIAN_BUILD_DEPENDS"
+
+
+do_extract_ovmf() {
+ install -m 0755 -d ${DEPLOY_DIR_IMAGE}
+ cp -r ${BUILDCHROOT_DIR}/usr/share/OVMF ${DEPLOY_DIR_IMAGE}
+ chown $(id -u):$(id -g) ${DEPLOY_DIR_IMAGE}/OVMF
+}
+
+addtask do_extract_ovmf after do_install_builddeps before do_dpkg_build
diff --git a/start-qemu.sh b/start-qemu.sh
index 74d1b54..3a3b2f7 100755
--- a/start-qemu.sh
+++ b/start-qemu.sh
@@ -94,8 +94,8 @@ fi


if [ -n "SECURE_BOOT" ]; then
- ovmf_code=${OVMF_CODE:-/usr/share/OVMF/OVMF_CODE.secboot.fd}
- ovmf_vars=${OVMF_VARS:-./OVMF_VARS.fd}
+ ovmf_code=${OVMF_CODE:-./build/tmp/deploy/images/qemu-amd64/OVMF/OVMF_CODE.secboot.fd}
+ ovmf_vars=${OVMF_VARS:-./build/tmp/deploy/images/qemu-amd64/OVMF/OVMF_VARS.snakeoil.fd}
QEMU_EXTRA_ARGS=" \
${QEMU_EXTRA_ARGS} \
-global ICH9-LPC.disable_s3=1 \
--
2.20.1


[isar-cip-core PATCH v2 6/6] doc: Add README for secureboot

Quirin Gylstorff
 

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
doc/README.secureboot.md | 188 +++++++++++++++++++++++++++++++++++++++
kas/opt/ebg-swu.yml | 2 +-
2 files changed, 189 insertions(+), 1 deletion(-)
create mode 100644 doc/README.secureboot.md

diff --git a/doc/README.secureboot.md b/doc/README.secureboot.md
new file mode 100644
index 0000000..5cbbc23
--- /dev/null
+++ b/doc/README.secureboot.md
@@ -0,0 +1,188 @@
+# Efibootguard Secure boot
+
+This document describes how to generate a secure boot capable image with
+[efibootguard](https://github.com/siemens/efibootguard).
+
+## Description
+
+The image build signs the efibootguard bootloader (bootx64.efi) and generates
+a signed [unified kernel image](https://systemd.io/BOOT_LOADER_SPECIFICATION/).
+A unified kernel image packs the kernel, initramfs and the kernel command-line
+in one binary object. As the kernel command-line is immutable after the build
+process, the previous selection of the root file system with a command-line parameter is no longer
+possible. Therefore the selection of the root file-system occurs now in the initramfs.
+
+The image uses an A/B partition layout to update the root file system. The sample implementation to
+select the root file system generates a uuid and stores the id in /etc/os-release and in the initramfs.
+During boot the initramfs compares its own uuid with the uuid stored in /etc/os-release of each rootfs.
+If a match is found the rootfs is used for the boot.
+
+## Adaptation for Images
+
+### WIC
+The following elements must be present in a wks file to create a secure boot capable image.
+
+```
+part --source efibootguard-efi --sourceparams "signwith=<script or executable to sign the image>"
+part --source efibootguard-boot --sourceparams "uefikernel=<name of the unified kernel>,signwith=<script or executable to sign the image>"
+```
+
+#### Script or executable to sign the image
+
+The wic plugins for the [bootloader](./scripts/lib/wic/plugins/source/efibootguard-efi.py)
+and [boot partition](./scripts/lib/wic/plugins/source/efibootguard-boot.py) require an
+executable or script with the following interface:
+```
+<script_name> <inputfile> <outputfile>
+```
+- script name: name and path of the script added with
+`--sourceparams "signwith=/usr/bin/sign_secure_image.sh"` to the wic image
+- inputfile: path and name of the file to be signed
+- outputfile: path and name of the signed input
+
+Supply the script name and path to wic by adding
+`signwith=<path and name of the script to sign>"` to sourceparams of the partition.
+
+
+### Existing packages to sign an image
+
+#### ebg-secure-boot-snakeoil
+
+This package uses the snakeoil key and certificate from the ovmf package(0.0~20200229-2)
+backported from Debian bullseye and signs the image.
+
+#### ebg-secure-boot-secrets
+This package takes a user-generated certificate and adds it to the build system.
+The following variable and steps are necessary to build a secure boot capable image:
+- Set certification information to sign and verify the image with:
+ - SB_CERTDB: The directory containing the certificate database create with certutil
+ - SB_VERIFY_CERT: The certificate to verify the signing process
+ - SB_KEY_NAME: Name of the key in the certificate database
+- if necessary change the script to select the boot partition after an update
+ - recipes-support/initramfs-config/files/initramfs.selectrootfs.script
+
+The files referred by SB_CERTDB and SB_VERIFY_CERT must be store in `recipes-devtools/ebg-secure-boot-secrets/files/`
+
+## QEMU
+
+Set up a secure boot test environment with [QEMU](https://www.qemu.org/)
+
+### Prerequisites
+
+- OVMF from edk2 release edk2-stable201911 or newer
+ - This documentation was tested under Debian 10 with OVMF (0.0~20200229-2) backported from Debian
+ bullseye
+- efitools for KeyTool.efi
+ - This documentation was tested under Debian 10 with efitools (1.9.2-1) backported from Debian bullseye
+- libnss3-tools
+
+### Debian Snakeoil keys
+
+The build copies the Debian Snakeoil keys to the directory `./build/tmp/deploy/images/<machine>/OVMF. Y
+u can use them as described in section [Start Image](### Start the image).
+
+### Generate Keys
+
+#### Reuse exiting keys
+
+It is possible to use exiting keys like /usr/share/ovmf/PkKek-1-snakeoil.pem' from Debian
+by executing the script `scripts/generate-sb-db-from-existing-certificate.sh`, e.g.:
+```
+export SB_NAME=<name for the secureboot config>
+export SB_KEYDIR=<location to store the database>
+export INKEY=<secret key of the certificate>
+export INCERT=<certificate>
+export INNICK=<name of the certificate in the database>
+scripts/generate-sb-db-from-existing-certificate.sh
+```
+This will create the directory `SB_KEYDIR` and will store the `${SB_NAME}certdb` with the given name.
+
+Copy the used certificate and database to `recipes-devtools/ebg-secure-boot-secrets/files/`
+
+#### Generate keys
+
+To generate the necessary keys and information to test secure-boot with QEMU
+execute the script `scripts/generate_secure_boot_keys.sh`
+
+##### Add Keys to OVMF
+1. Create a folder and copy the generated keys and KeyTool.efi
+(in Debian the file can be found at: /lib/efitools/x86_64-linux-gnu/KeyTool.efi) to the folder
+```
+mkdir secureboot-tools
+cp -r keys secureboot-tools
+cp /lib/efitools/x86_64-linux-gnu/KeyTool.efi secureboot-tools
+```
+2. Copy the file OVMF_VARS.fd (in Debian the file can be found at /usr/share/OVMF/OVMF_VARS.fd)
+to the current directory. OVMF_VARS.fd contains no keys can be instrumented for secureboot.
+3. Start QEMU with the script scripts/start-efishell.sh
+```
+scripts/start-efishell.sh secureboot-tools
+```
+4. Start the KeyTool.efi FS0:\KeyTool.efi and execute the the following steps:
+ -> "Edit Keys"
+ -> "The Allowed Signatures Database (db)"
+ -> "Add New Key"
+ -> Change/Confirm device
+ -> Select "DB.esl" file
+ -> "The Key Exchange Key Database (KEK)"
+ -> "Add New Key"
+ -> Change/Confirm device
+ -> Select "KEK.esl" file
+ -> "The Platform Key (PK)
+ -> "Replace Key(s)"
+ -> Change/Confirm device
+ -> Select "PK.auth" file
+5. quit QEMU
+
+### Build image
+
+Build the image with a signed efibootguard and unified kernel image
+with the snakeoil keys by executing:
+```
+kas-docker --isar build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/ebg-secure-boot-snakeoil.yml
+```
+
+For user-generated keys, create a new option file. This option file could look like this:
+```
+header:
+ version: 8
+ includes:
+ - opt/ebg-swu.yml
+ - opt/ebg-secure-boot-initramfs.yml
+
+local_conf_header:
+ secure-boot: |
+ IMAGER_BUILD_DEPS += "ebg-secure-boot-secrets"
+ IMAGER_INSTALL += "ebg-secure-boot-secrets"
+ user-keys:
+ SB_CERTDB = "democertdb"
+ SB_VERIFY_CERT = "demo.crt"
+ SB_KEY_NAME = "demo"
+```
+
+Replace `demo` with the name of the user-generated certificates.
+
+### Start the image
+
+#### Debian snakeoil
+
+Start the image with the following command:
+```
+SECURE_BOOT=y \
+./start-qemu.sh amd64
+```
+
+The default `OVMF_VARS.snakeoil.fd` boot to the EFI shell. To boot Linux enter the following command:
+```
+FS0:\EFI\BOOT\bootx64.efi
+```
+To change the boot behavior, enter `exit` in the shell to enter the bios and change the boot order.
+
+#### User-generated keys
+Start the image with the following command:
+```
+SECURE_BOOT=y \
+OVMF_CODE=./build/tmp/deploy/images/qemu-amd64/OVMF/OVMF_CODE.secboot.fd \
+OVMF_VARS=<path to the modified OVMF_VARS.fd> \
+./start-qemu.sh amd64
+```
diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml
index 5b39730..81d90ad 100644
--- a/kas/opt/ebg-swu.yml
+++ b/kas/opt/ebg-swu.yml
@@ -22,5 +22,5 @@ local_conf_header:
WICVARS += "WDOG_TIMEOUT"

wic: |
- IMAGE_TYPE = "wic-img"
+ IMAGE_TYPE = "wic-swu-img"
WKS_FILE = "${MACHINE}-${BOOTLOADER}.wks"
--
2.20.1

2181 - 2200 of 7061