This repository was archived by the owner on May 30, 2023. It is now read-only.
sec-policy/selinux-virt: add rules to run flannel with SELinux enforced mode#1181
Merged
sec-policy/selinux-virt: add rules to run flannel with SELinux enforced mode#1181
flannel with SELinux enforced mode#1181Conversation
added 3 commits
August 11, 2021 16:24
flannel uses an init container to pull CNI from container to the host system in `/etc/cni`. With SELinux, the permission is denied because `/etc/cni` is labelled with `etc_t` so it can't be access by Docker since it expects `svirt_lxc_file_t`. Using `filetrans_pattern` we can define a mechanism to create `/etc/cni` with the correct labels even if it's not yet created - which avoid to run `restorecon` on `/etc/cni`. Signed-off-by: Mathieu Tortuyaux <mathieu@kinvolk.io>
Signed-off-by: Mathieu Tortuyaux <mathieu@kinvolk.io>
flannel will write into /run/flannel/... so we need to provide correct labelling for dir created by docker daemon Signed-off-by: Mathieu Tortuyaux <mathieu@kinvolk.io>
This was referenced Aug 11, 2021
flannel with SELinux enforced modeflannel with SELinux enforced mode
jepio
reviewed
Aug 12, 2021
Contributor
jepio
left a comment
There was a problem hiding this comment.
I'm not super familiar with selinux but it fixes the test and doesn't look suspicious to me 👍
I would keep it as different commits that way each "diff" has a matching description.
Maybe someone could take a second look?
Contributor
Author
|
@jepio I thought the same - but when we will upgrade in a couple of months SELinux we will need to chase the "flatcar changes commit" for this package. 🤔 Otherwise I can squash all into one commit |
pothos
approved these changes
Aug 12, 2021
Contributor
Author
|
cherry-picked to:
|
This was referenced Aug 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR, we provide another
virtrules to haveflannelcorrectly running with enforced SELinux.How to use
Testing done
Closes: flatcar/Flatcar#476
Also related to: flannel-io/flannel#945, flannel-io/flannel#709
Note
@kinvolk/flatcar-maintainers how should we proceed with the following commits ? Should I squash them into one single commit
sec-policy/selinux-virt: apply flatcar changeswith a merge of the bodies ?