Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Support LUKS encryption using IBM CEX secure keys on s390x #536

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

madhu-pillai
Copy link
Contributor

@madhu-pillai madhu-pillai commented May 29, 2024

fcos/1.6.0-exp: Fix context for boot_device.layout errors

  • Use "layout" in the context path for errors related to the layout
    entry in the boot_device configuration.
  • Add tests for those error cases.
  • Refactor mirror boot_device check for s390x.

Fixes: #484


vendor: Update ignition/v2 v2.19.0 & aws-sdk-go v1.53.5


Support LUKS encryption using IBM CEX secure keys on s390x

For fcos 1.6.0-exp & openshift 4.18.0-exp specs, expected to be based on
stable 3.5.0 spec.

See: coreos/ignition#1693
See: coreos/fedora-coreos-tracker#1708

internal/doc/butane.yaml Outdated Show resolved Hide resolved
@madhu-pillai
Copy link
Contributor Author

Hi @travier ,
Can i've a review on this?

@madhu-pillai
Copy link
Contributor Author

Hi @travier ,
I've changed the schema part to Cex. Kindly review it.

@madhu-pillai
Copy link
Contributor Author

$ butane % cat bin/arm64/openshift.bu 
variant: openshift
version: 4.17.0-experimental
metadata:
  name: MachineConfig
  labels:
    machineconfiguration.openshift.io/role: master1
boot_device:
  layout: s390x-eckd
  luks:
    device: /dev/dasda
    cex:
      enabled: true
 $ ./butane openshift.bu -o openshift.ign --pretty && cat openshift.ign
# Generated by Butane; do not edit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: master1
  name: MachineConfig
spec:
  config:
    ignition:
      version: 3.5.0-experimental
    storage:
      filesystems:
        - device: /dev/mapper/root
          format: xfs
          label: root
          wipeFilesystem: true
      luks:
        - cex:
            enabled: true
          device: /dev/dasda2
          label: luks-root
          name: root
          wipeVolume: true

Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's coming along! a few nits;

Thank you for doing this.

config/common/errors.go Outdated Show resolved Hide resolved
config/fcos/v1_6_exp/translate.go Show resolved Hide resolved
config/flatcar/v1_2_exp/translate.go Show resolved Hide resolved
internal/doc/butane.yaml Outdated Show resolved Hide resolved
docs/examples.md Show resolved Hide resolved
@madhu-pillai
Copy link
Contributor Author

Hi @prestist ,
Could you please review the updated comment?.

Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gennerally lgtm I have like one nit; otherwise I think its gtg.

config/common/errors.go Outdated Show resolved Hide resolved
docs/examples.md Show resolved Hide resolved
madhu-pillai added a commit to madhu-pillai/ignition that referenced this pull request Aug 30, 2024
madhu-pillai added a commit to madhu-pillai/ignition that referenced this pull request Aug 30, 2024
madhu-pillai added a commit to madhu-pillai/ignition that referenced this pull request Sep 16, 2024
@madhu-pillai
Copy link
Contributor Author

[root@a3elp53 s390x]# ./butane boot.bu -o boot.ign --pretty
[root@a3elp53 s390x]# cat boot.bu
variant: fcos
version: 1.6.0-experimental
boot_device:
  layout: s390x-zfcp
  luks:
    device: /dev/sdb
    cex:
      enabled: true
[root@a3elp53 s390x]# cat boot.ign
{
  "ignition": {
    "version": "3.5.0-experimental"
  },
  "storage": {
    "filesystems": [
      {
        "device": "/dev/mapper/root",
        "format": "xfs",
        "label": "root",
        "wipeFilesystem": true
      }
    ],
    "luks": [
      {
        "cex": {
          "enabled": true
        },
        "device": "/dev/sdb4",
        "label": "luks-root",
        "name": "root",
        "wipeVolume": true
      }
    ]
  }
}

@madhu-pillai
Copy link
Contributor Author

Hi, Is this pr ok to approve? or anything pending from my side?

@prestist
Copy link
Collaborator

prestist commented Nov 11, 2024

@madhu-pillai , I am going to run through and review from my perspective, but will not be merging until I hear from @travier since he had a lot of feedback, and I want to ensure his concerns are resolved.

Note: the now latest version of ignition is 2.20.0 which has the functionality this sugar uses in stable, I would prefer to get this in before we update butane with that version and its new specs.

Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that you have resolved, and fixed any review comments, there seems to be one which has gramar issues still here, and more importantly a question about structure here

@prestist prestist mentioned this pull request Nov 11, 2024
40 tasks
@madhu-pillai
Copy link
Contributor Author

Please make sure that you have resolved, and fixed any review comments, there seems to be one which has gramar issues still here, and more importantly a question about structure here

Hi @prestist ,
These reviews were already updated in the last commit. Sorry i missed to update the review message. Now done.

@madhu-pillai
Copy link
Contributor Author

Hi @travier , Could you review the PR please?

docs/release-notes.md Outdated Show resolved Hide resolved
docs/release-notes.md Outdated Show resolved Hide resolved
internal/doc/butane.yaml Outdated Show resolved Hide resolved
@travier
Copy link
Member

travier commented Nov 20, 2024

OK, we need to split this in at least two commits:

  • vendor code update
  • addition of CEX support

@travier
Copy link
Member

travier commented Nov 20, 2024

OK, we can not update to 2.20 until we do #558

@travier
Copy link
Member

travier commented Nov 20, 2024

#550 (comment)

@travier
Copy link
Member

travier commented Nov 20, 2024

Hold on, I'm doing the rebase / resplit.

@travier
Copy link
Member

travier commented Nov 20, 2024

This should be good now. I'll do another pass tomorrow. Then we need to stabilize all of that.

Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest changes, lgtm.

@prestist
Copy link
Collaborator

prestist commented Nov 20, 2024

This should be good now. I'll do another pass tomorrow. Then we need to stabilize all of that.

@travier Makes sense, so to be clear, we land this pr then separately stabilize? (preferred) I don't want to stabilize in this pr.

@travier
Copy link
Member

travier commented Nov 20, 2024

Yes, if I'm not mistaken, we should follow this order (#550 (comment)):

travier and others added 2 commits November 21, 2024 17:20
- Use "layout" in the context path for errors related to the layout
  entry in the boot_device  configuration.
- Add tests for those error cases.
- Refactor mirror boot_device check for s390x.

Fixes: coreos#484
@travier
Copy link
Member

travier commented Nov 21, 2024

Alright, I've added more tests and fixed the case where they failed so this should be ready now.

For fcos 1.6.0-exp & openshift 4.18.0-exp specs, expected to be based on
stable 3.5.0 spec.

See: coreos/ignition#1693
See: coreos/fedora-coreos-tracker#1708
Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching that/fixing it, and then adding tests. LGTM

@prestist prestist merged commit da4b8a1 into coreos:main Nov 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants