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

Manage sebooleans in MachineConfig #852

Open
runcom opened this issue Jun 13, 2019 · 14 comments
Open

Manage sebooleans in MachineConfig #852

runcom opened this issue Jun 13, 2019 · 14 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@runcom
Copy link
Member

runcom commented Jun 13, 2019

As for Kargs,FIPS and osImageURL, we would need a way to set selinux booleans through an MC (and maybe later on with a dedicated controller+CRD).

Acceptance criteria:

  • Verify the MachineConfig object as a field to sebooleans
  • Verify the MCD knows how to apply and reconcile them
  • Verify sebooleans are applied at early pivot as well
@runcom runcom added the jira label Jun 13, 2019
@miminar
Copy link

miminar commented Jun 13, 2019

Also some applications like SAP Data Hub need to turn on booleans like virt_use_nfs to enable its own NFS server on top of k8s/OCP.

@runcom
Copy link
Member Author

runcom commented Jun 13, 2019

diff --git a/pkg/apis/machineconfiguration.openshift.io/v1/types.go b/pkg/apis/machineconfiguration.openshift.io/v1/types.go
index 1cc2482e..b7f2ae8b 100644
--- a/pkg/apis/machineconfiguration.openshift.io/v1/types.go
+++ b/pkg/apis/machineconfiguration.openshift.io/v1/types.go
@@ -231,6 +231,14 @@ type MachineConfigSpec struct {
        Config igntypes.Config `json:"config"`
 
        KernelArguments []string `json:"kernelArguments"`
+
+       Sebooleans []Sebool `json:"sebooleans"`
+}
+
+type Sebool struct {
+       Name       string
+       Persistent bool
+       State      bool
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

The MCD will know how to set those (need to play with rhcos with these) using get|setsebool [-P]

@cgwalters
Copy link
Member

Note this will also really require fixing ostreedev/ostree#1026

@runcom
Copy link
Member Author

runcom commented Jun 13, 2019

Note this will also really require fixing ostreedev/ostree#1026

oh nice

(need to play with rhcos with these)

:D

@ashcrow
Copy link
Member

ashcrow commented Jun 13, 2019

Also some applications like SAP Data Hub need to turn on booleans like virt_use_nfs to enable its own NFS server on top of k8s/OCP.

FWIW we turn this on today in RHCOS. Though I'm 👍 on having MCO be able to configure thins on the host.

@cgwalters
Copy link
Member

Related to this, we should probably offer:

selinux: permissive|disabled (default enforcing)

And the MCD should watch for audit notifications of enforcement changes and reconcile (someone doing setenforce 0 would quickly get overruled).

@dustymabe dustymabe removed the jira label Sep 5, 2019
@tylerauerbeck
Copy link

Has there been any movement on this?

@cgwalters
Copy link
Member

If you want to do this today, the workaround is to ship a systemd unit that does ExecStart=/usr/sbin/setsebool and is Before=kubelet.service etc.

@cgwalters
Copy link
Member

Also, if going the systemd route a recommendation is to not use -P so that dropping the unit from the MC will naturally revert the system. This will also avoid triggering ostreedev/ostree#1026

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 21, 2020
@avisiedo
Copy link

+1 We were investigating how to enable some sebool by using a MachineConfig, and the way we found was using a MachineConfig with a systemd unit; this feature would make sebool management easier and more intuitive.

@JAORMX
Copy link
Contributor

JAORMX commented Sep 21, 2020

We did a demo on exposing SELinux policies to kubernetes via an operator. While that won't be worked on this release, it could start making sense to bring in this functionality to that operator. With the work that's going on about letting the MCO do certain updates without requiring reboots, I'm thinking it would then be possible to just base the operator on top of MCO.

@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 22, 2020
@travier
Copy link
Member

travier commented Nov 16, 2020

/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests