Closed razvan closed 3 months ago
Manifests created, operator deployed (π ) and Openshift test suite run (π’) for the following operators with no custom SCC:
stackable-secret-operator-scc
)stackable-listener-operator-scc
)upgrade_zookeeper-3.9.2_upgrade_old-3.6.1_upgrade_new-3.7.1_use-client-tls-true_use-client-auth-tls-true_openshift-true
(works when corrected locally, but this has been fixed in stackable-utils and so should work for future releases)
stackable.tech/vendor: Stackable
everywhere it should be for secret/listener?stackable-secret-operator-scc
and stackable-listener-operator-scc
needed: does this undermine the solution to this issue? Try privileged
for listener and ~nonroot-v2
~ privileged
for secret @adwk67 - hdfs/secret/listener/zookeeper tests successfulstackable-listener-operator.v24.7.0.clusterserviceversion.yaml
back to the helm templates? (e.g. an extra "delete"). Yes, then we stay consistent. @razvan replaces
property is used in the 24.7 channel.stackable-utils changes for this issue: https://github.com/stackabletech/stackable-utils/pull/86
This issue addresses the security context part described here.
This issue can now be considered done.
This issue can now be considered done.
@razvan can we move this to "Development Done"? I'm not sure what to review here to be honest π
Yes, closing this as outstanding work will be addressed in separate tickets.
@adwk67 will this also be fixed for the airflow-operator? We also need it there/
Description
Currently, our OLM packages deploy a custom
SecurityContextConstraint
based on thehostmount-anyuid
SCC. This issue is about getting rid of that custom SCC and move to thenonroot-v2
SCC.Background / Research
Using the
SecurityContext.RunAsUser
functionality users can, in theory, set the user that an image is being run as to an arbitrary uid. Our operators currently (as of 2024-07-16) hardcode this to 1000:For this to work (read: to be allowed) at least on OpenShift we need to set a
SecurityContextConstraint
that allows us to run as an arbitrary (non-root) UID.In the past we deployed our own SCC derived from the hostmount-anyuid (this looked different back then) SCC because the default SCCs didn't allow ephemeral volumes. This has changed in September 2022 without us noticing and all default SCCs now include the ephemeral permission. The hostmount-anyuid SCC allows (as the name implies) Pods to run as any user including root. This is not good and we can probably (we ran some tests and it looks good) switch to
nonroot-v2
which is slightly less strict than restricted-v2.This is a change we can do immediately and should not require any code changes, it should only require changes in the bundling of our OLM packages and it needs to be documented/in the release notes.
Our final goal should be to move to
restricted-v2
wherever possible but that is out-of-scope for this issue and will be part of a follow-up.Value
Dependencies
Tasks
stackable-24.7-prep-temp
Acceptance Criteria
nonroot-v2
SCC but another less restrictive SCC would also work if there are good reasons for itrestricted-v2
SCC is out of scope for this issue as we know there is more work to do before we can achieve that(Information Security) Risk Assessment
This will improve our security of our product as it will allow us to run on default settings of OpenShift without our customers having to audit a custom SCC. It will also allow us to move to a more restrictive SCC going forward.
Quality
We need to run all integration tests (and maybe even demos) across all our products.
Release Notes
Historically our Operator Lifecycle Manager packaging (OLM) for OpenShift would deploy a custom
SecurityContextConstraint
. This used to be required for us to be able to create ephemeral volumes. All default SCCs in OpenShift in all our supported OpenShift versions now allow this by default. This allows us to switch to use thenonroot-v2
SCC by default.