Bug 1868122 - SELinux pod settings alter the behavior of SELinux categories
Summary: SELinux pod settings alter the behavior of SELinux categories
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Giuseppe Scrivano
QA Contact: MinLi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-11 18:10 UTC by Jed Lejosne
Modified: 2020-10-27 16:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:27:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:27:56 UTC

Comment 1 Giuseppe Scrivano 2020-08-12 09:59:35 UTC
I am not sure this is an issue, if you want a specific level you can do it with:

apiVersion: v1
kind: Pod
metadata:
  name: pod
spec:
  securityContext:
    seLinuxOptions:
      user: system_u
      level: s0:c683,c783
  containers:
    - name: c1
      image: fedora
      command: [ "/bin/sleep", "1d" ]
    - name: c2
      image: fedora
      command: [ "/bin/sleep", "1d" ]

As Dan Walsh suggested on the upstream issue, it is better to not specify any and let the runtime pick the correct setting

Comment 2 Jed Lejosne 2020-08-12 12:22:42 UTC
To me, the fact that an option unrelated to categories changes the core way categories are managed is an issue.

Manually specifying a level is a non-starter. I don't know which categories are available, I don't even know which node my pod will run on!

Finally, if these options are not meant to be used, they should probably be removed...

Comment 3 Giuseppe Scrivano 2020-08-12 14:07:40 UTC
PR here: https://github.com/cri-o/cri-o/pull/4071

Comment 4 Jed Lejosne 2020-08-12 14:49:34 UTC
Thank you! I reviewed the PR and left a comment.

Comment 7 MinLi 2020-08-20 03:34:48 UTC
verified in version : 4.6.0-0.nightly-2020-08-18-165040

$ oc exec -it pod -c c1 -- /bin/ls -Zd /
system_u:object_r:container_file_t:s0:c200,c907 /

$ oc exec -it pod -c c2 -- /bin/ls -Zd /
system_u:object_r:container_file_t:s0:c200,c907 /

Comment 9 errata-xmlrpc 2020-10-27 16:27:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.