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

etcd stuck in crash loop on selinux-enabled rhel 7.9 #20

Open
dajester2013 opened this issue Sep 24, 2021 · 4 comments
Open

etcd stuck in crash loop on selinux-enabled rhel 7.9 #20

dajester2013 opened this issue Sep 24, 2021 · 4 comments

Comments

@dajester2013
Copy link

dajester2013 commented Sep 24, 2021

There seems to be a problem with SELinux on STIG'd RHEL 7.9 servers, such that prevents etcd from starting. This is what I've been dealing with:
rancher/rke2#1494

TL;DR;
With selinux in enforcing mode, I cannot start rke2 with selinux=true OR profile=cis-.... With selinux in permissive mode, I can.

A requirement not noted in the above issue is that I will eventually need to relocate the rke2 data dir outside of /var (due to disk partition issues). I just need to get it started first.

@dweomer
Copy link
Contributor

dweomer commented Sep 27, 2021

A requirement not noted in the above issue is that I will eventually need to relocate the rke2 data dir outside of /var (due to disk partition issues). I just need to get it started first.

This will require custom policy and/or an adaptation of #11

@dajester2013
Copy link
Author

We had some success in the following

  • Install rke2/rke2-selinux and configure
  • mkdir /path/to/data/dir
  • semanage fcontext -a -e /var/lib/rancher/rke2 /path/to/data/dir

The first server we tried it on was still having difficulty (likely due to artifacts of all our other failed attempts), so we just used audit2allow to correct the remaining issues there. However, it worked flawlessly on the second server. The third server we tried it on did not seem to have permissions issues, but was still having a hard time connecting to the etcd cluster. We're going to try to get a fourth server running today.

@dweomer
Copy link
Contributor

dweomer commented Oct 4, 2021

We had some success in the following

  • Install rke2/rke2-selinux and configure
  • mkdir /path/to/data/dir
  • semanage fcontext -a -e /var/lib/rancher/rke2 /path/to/data/dir

Is there a missing transition?

@dajester2013
Copy link
Author

Is there a missing transition?

I did forget to write that we did a restorecon on the new data dir, if that's what you are asking? I do know that this RKE did not seem to attempt making those selinux changes for the custom data directory.

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

No branches or pull requests

2 participants