-
Notifications
You must be signed in to change notification settings - Fork 462
WIP: Add FIPS to MachineConfig #800
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -432,6 +432,26 @@ func (dn *Daemon) updateKernelArguments(oldConfig, newConfig *mcfgv1.MachineConf | |
| return exec.Command("rpm-ostree", args...).Run() | ||
| } | ||
|
|
||
| // updateFIPS handles changes in FIPS | ||
| func (dn *Daemon) updateFIPS(oldConfig, newConfig *mcfgv1.MachineConfig) error { | ||
| if oldConfig.Spec.FIPS != newConfig.Spec.FIPS { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait, shouldn't this be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is wip, just leaving also a comment that we still miss a call to |
||
| return nil | ||
| } | ||
| if dn.OperatingSystem != machineConfigDaemonOSRHCOS { | ||
| return fmt.Errorf("Updating FIPS on non-RHCOS nodes is not supported") | ||
| } | ||
|
|
||
| arg := "enable" | ||
| if !newConfig.Spec.FIPS { | ||
| arg = "disable" | ||
| } | ||
|
|
||
| cmd := "/usr/libexec/rhcos-tools/coreos-fips" | ||
| args := []string{arg} | ||
| dn.logSystem("Running %s %v", cmd, args) | ||
| return exec.Command(cmd, args...).Run() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like the right command to me. One thing to keep in mind is that, within OCP, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's debate that in openshift/rhcos-tools#2 since...it seems to me doing it that way would make everything unnecessarily more complex.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I closed the PR which would offload kernel args to the MCO. This call should be good as is. |
||
| } | ||
|
|
||
| // updateFiles writes files specified by the nodeconfig to disk. it also writes | ||
| // systemd units. there is no support for multiple filesystems at this point. | ||
| // | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be confusing for users, especially because unset values will decode into
false. Like, the following would have FIPS mode OFF:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to go pointer then to differentiate between set/unset as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably. Another option would be to fail closed, i.e. if ANY configs have FIPS=true, it will be turned on.