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

scc in Openshift #277

Open
hanakric opened this issue Feb 19, 2025 · 6 comments
Open

scc in Openshift #277

hanakric opened this issue Feb 19, 2025 · 6 comments

Comments

@hanakric
Copy link

Hi,
 
there is a problem in scc on Openshift . In scc is setup:

runAsUser:
  type: MustRunAsRange

 
but without uidRange. In my opinion the better code is:

runAsUser:
  type: MustRunAsRange
  uidRangeMax: 4096
  uidRangeMin: 4096

 
without uidRange pods are not created, because user 4096 is not from namespace range
    openshift.io/sa.scc.uid-range: 1002...
 

@aandryashin
Copy link
Member

aandryashin commented Feb 19, 2025 via email

@bukovjanmic
Copy link

Openshift by default assigns a random range for UIDs (e.g. 10002001) for each namespace.

However, most browser images that we tested will not run under any other UID than 4096, because browser in the pods create some temporary data in overlay on the image file system and will fail if the directory in the image is not writable.

Therefore, we need to set user.id and group.id in Config object to 4096.

However, the moon SCC policy that is assigned will not allow to run the Pods under those UID, as hanakric points out, so we need to manually patch the Moon SCC with the above.

There are 3 solution to this:

  1. Do what hanakric suggests and specifiy uidrangeMin and uidRangeMax in moon SCC. These need not be new values in values.yaml, we can just use the values of user.id (and group.id) respectively
  2. Even better, we can use MustRunAs directly, as moon.aerokube.com/Config allows to specify only single value anyway (likewise for groupFS)
  3. Alternatively, we could use MustRunAsNonroot or MustRunAsAny, but this is presumably less secure. Maybe this could be a fallbcak if no user.id or group.id is specified in values.yaml when installing the Helm chart.

@aandryashin
Copy link
Member

aandryashin commented Feb 19, 2025 via email

@aandryashin
Copy link
Member

aandryashin commented Feb 20, 2025 via email

@bukovjanmic
Copy link

Yes, this should work for us;

  • there is a typo on l. 36 in scc.yaml - uidRangeMax should be uidRangeMin
  • maybe you could reuse .Values.configs.default.user.id, as it should be always the same value - if not, it will not work anyway.

@aandryashin
Copy link
Member

aandryashin commented Feb 20, 2025 via email

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

3 participants