Skip to content

Cannot deploy rabbitmq using OpenShift restricted SCC #4884

Description

@namloc2001

Which chart:
I'm using rabbitmq-8.0.2.tar, which is specified as a requirement of OWASP DefectDojo Helm chart (https://github.com/DefectDojo/django-DefectDojo/blob/master/helm/defectdojo/requirements.yaml).

Describe the bug
I was previously using rabbit-6.18.2.tar and was able to set a value in the parent chart (DefectDojo) to override the security Context being set in the rabbitmq sub-chart. I could set securityContext.enabled=false in the parent chart and thus not use fsGroup: 1001 nor runAsUser: 1001 when deploying the chart:

securityContext:
  enabled: false
  fsGroup: 1001
  runAsUser: 1001
  extra: {}

This allows me to deploy in OpenShift, using the restricted SCC which automatically assigns an arbitrary (and non-root) UID to the container.

Since trying the deployment with 8.0.2 (and I've checked this still applies to the latest rabbit chart (8.6.1)) I cannot override this setting from the parent chart, as the rabbit values.yaml has been updated to:

podSecurityContext:
  fsGroup: 1001
  runAsUser: 1001

To Reproduce
Steps to reproduce the behavior:

  1. Deploy chart to OpenShift, using a serviceAccount that is only permitted to use the restricted SCC
  2. View the stateful set: oc describe sts <name> and see following event:
create Pod defect-dojo-rabbitmq-0 in StatefulSet defect-dojo-rabbitmq failed error: pods "defect-dojo-rabbitmq-0" is forbidden: unable to validate against any security context constraint: [fsGroup: Invalid value: []int64{1001}: 1001 is not an allowed group spec.containers[0].securityContext.securityContext.runAsUser: Invalid value: 1001: must be in the ranges: [1000640000, 1000649999]]

Expected behavior
I expect to be able to enable/disable the securityContext of rabbitmq both within rabbitMQ chart, and parent chart.

Version of Helm and Kubernetes:

  • Output of helm version:
version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"clean", GoVersion:"go1.14.10"}
  • Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4", GitCommit:"d360454c9bcd1634cf4cc52d1867af5491dc9c5f", GitTreeState:"clean", BuildDate:"2020-11-11T13:17:17Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.3+ac53d20", GitCommit:"ac53d20", GitTreeState:"clean", BuildDate:"2020-10-31T17:54:45Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
  • Output of oc version:
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server
kubernetes v1.18.3+ac53d20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions