helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Change Openshift scc seLinuxContext to RunAsAny

Open AlbertoPimpo opened this issue 1 year ago • 8 comments

When creating a securityContextContraint for Openshift, the helm chart currently set the selinux strategy to MustRunAs, but this might lead to permission errors if you are using selinux in the node and you want to mount an host folder with an HostPath.

I think there is no reason for disallowing selinux context to be changed for the fluentbit deployment. Also, this is the same behavior used by red hat for their cluster logging operator that deploys fluentd. https://github.com/openshift/cluster-logging-operator/blob/master/internal/auth/securitycontextconstraint.go#L46

AlbertoPimpo avatar Aug 06 '24 11:08 AlbertoPimpo

Sorry for all the pushes but I had to fix the verification of the commit :sweat_smile:

AlbertoPimpo avatar Aug 06 '24 12:08 AlbertoPimpo

@stevehipwell @naseemkullah @edsiper could you please take a look?

AlbertoPimpo avatar Aug 15 '24 08:08 AlbertoPimpo

@AlbertoPimpo I'm not familiar enough with OpenShift to make a call on this change.

FYI you need to rebase and bump your chart version.

stevehipwell avatar Aug 15 '24 11:08 stevehipwell

Maybe we need to ask to take a look this change @patrick-stephens ? He sometimes do some stuffs of his technology interests of Openshift.

cosmo0920 avatar Aug 15 '24 11:08 cosmo0920

FYI you need to rebase and bump your chart version

@stevehipwell done :+1:

AlbertoPimpo avatar Aug 15 '24 12:08 AlbertoPimpo

If it can help, in the PodSecurityPolicy you indeed allow to change the selinux context https://github.com/fluent/helm-charts/blob/main/charts/fluent-bit/templates/psp.yaml#L28

AlbertoPimpo avatar Aug 15 '24 12:08 AlbertoPimpo

I would not be a fan of changing it from one hardcoded value to another, let's make it configurable with a default.

patrick-stephens avatar Aug 16 '24 10:08 patrick-stephens

I would not be a fan of changing it from one hardcoded value to another, let's make it configurable with a default.

@patrick-stephens I like the idea, maybe we should do the same for psp? I can take care of that.

AlbertoPimpo avatar Aug 16 '24 13:08 AlbertoPimpo

@patrick-stephens sorry for taking so long, it's done now. Feel free to merge it.

AlbertoPimpo avatar Nov 10 '24 13:11 AlbertoPimpo

@stevehipwell @naseemkullah @edsiper this is ready to be merged.

AlbertoPimpo avatar Nov 11 '24 09:11 AlbertoPimpo

@AlbertoPimpo PSPs have not been supported in Kubernetes since 1.26 so I don't see any value in making changes there?

@stevehipwell It's a non-breaking change and a nice to have for the few users who are still stuck with old versions of kubernetes. Anyway, if this has to became a blocker for the PR, then I'll remove this part.

AlbertoPimpo avatar Nov 18 '24 18:11 AlbertoPimpo

@AlbertoPimpo could you please rebase, look at the comments I just made and also update the chart changelog annotations? As the PSP resource is still in the chart I can't see an issue with making this change.

stevehipwell avatar Nov 22 '24 16:11 stevehipwell

@AlbertoPimpo could you please rebase, look at the comments I just made and also update the chart changelog annotations? As the PSP resource is still in the chart I can't see an issue with making this change.

Thanks for the review @stevehipwell . I accepted your suggested changes, rebased and squashed everything in a single commit. We should be ready to merge.

AlbertoPimpo avatar Nov 23 '24 14:11 AlbertoPimpo

@AlbertoPimpo I can't see why the tests on your branch are failing.

stevehipwell avatar Nov 25 '24 12:11 stevehipwell