Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-5824

system:openshift:controller:template-service-broker referencing non existing serviceAccount

XMLWordPrintable

    • Low
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      $ oc get clusterversion
      NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.11.20   True        False         43h     Cluster version is 4.11.20
      
      $ oc get clusterrolebinding system:openshift:controller:template-service-broker -o yaml
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRoleBinding
      metadata:
        annotations:
          rbac.authorization.kubernetes.io/autoupdate: "true"
        creationTimestamp: "2023-01-11T13:19:24Z"
        name: system:openshift:controller:template-service-broker
        resourceVersion: "11423"
        uid: bee18421-143b-4677-afab-8ce54258399f
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: system:openshift:controller:template-service-broker
      subjects:
      - kind: ServiceAccount
        name: template-service-broker
        namespace: openshift-infra
      
      $ oc get sa -A | grep template-service-broker
      
      $ oc get sa template-service-broker -n openshift-infra
      Error from server (NotFound): serviceaccounts "template-service-broker" not found
      
      The serviceAccount template-service-broker does not exist. Neither in openshift-infra nor in any other namespace.
      
      It's therefore not clear what this ClusterRoleBinding does, what use-case it does fulfill and why it references non existing serviceAccount.
      
      From Security point of view, it's recommended to remove non serviceAccounts from ClusterRoleBindings as a potential attacker could abuse the current state by creating the necessary serviceAccount and gain undesired permissions.

      Version-Release number of selected component (if applicable):

      OpenShift Container Platform 4 (all version from what we have found)

      How reproducible:

      Always

      Steps to Reproduce:

      1. Install OpenShift Container Platform 4
      2. Run oc get clusterrolebinding system:openshift:controller:template-service-broker -o yaml

      Actual results:

      $ oc get clusterrolebinding system:openshift:controller:template-service-broker -o yaml
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRoleBinding
      metadata:
        annotations:
          rbac.authorization.kubernetes.io/autoupdate: "true"
        creationTimestamp: "2023-01-11T13:19:24Z"
        name: system:openshift:controller:template-service-broker
        resourceVersion: "11423"
        uid: bee18421-143b-4677-afab-8ce54258399f
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: system:openshift:controller:template-service-broker
      subjects:
      - kind: ServiceAccount
        name: template-service-broker
        namespace: openshift-infra
      
      $ oc get sa template-service-broker -n openshift-infra
      Error from server (NotFound): serviceaccounts "template-service-broker" not found

      Expected results:

      The serviceAccount called template-service-broker to exist or otherwise the ClusterRoleBinding to be removed.

      Additional info:

      Finding related to a Security review done on the OpenShift Container Platform 4 - Platform

              dperaza@redhat.com David Peraza
              rhn-support-sreber Simon Reber
              Jia Fan Jia Fan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: