Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-6092

False Forbidden error when a user with view access to loki logs in Aggregated Logs menu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • Logging 5.9.z
    • Log Console
    • False
    • None
    • False
    • NEW
    • NEW
    • Hide
      Before the fix, clicking on "more logs" from the pod detail view caused a false permission error due to missing namespace parameter required for authorization. After the fix, the namespace parameter is included the permission error is not shown and more logs are visible.
      Show
      Before the fix, clicking on "more logs" from the pod detail view caused a false permission error due to missing namespace parameter required for authorization. After the fix, the namespace parameter is included the permission error is not shown and more logs are visible.
    • Bug Fix
    • Proposed
    • Moderate
    • Customer Escalated

      Description of problem:

      "Aggregated Logs" streams false Forbidden error when a user with view access is viewing logs.

      The error appears only when the user clicks "More Data Available, Click to load" button which is available on the bottom of the page.

      The user is able to view logs in "Aggregated Logs" menu just fine, but after clicking "More Data Available, Click to load" button, the forbidden error appears on the top of screen.

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

      RHOL 5.9.5

      Loki Operator 5.9.5

      How reproducible:

      100%

      Steps to Reproduce:

      1. Install and configure RHOL 5.9.5 with LokiStack as log store.
      2. Create a user and assign a view/admin role for a project.
      kind: RoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: allow-read-logs
        namespace: test
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: view
      subjects:
      - kind: User
        apiGroup: rbac.authorization.k8s.io
        name: test 

           3. Create a rolebinding for the user using cluster-logging-application-view clusterrole:

      kind: RoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: allow-read-logs-loki
        namespace: dhruv
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: cluster-logging-application-view
      subjects:
      - kind: User
        apiGroup: rbac.authorization.k8s.io
        name: dhruv 

           4. Login to RHOCP cluster and select developer view -> Topology -> Select Application pod -> Aggregated Logs -> Wait for it stream the logs -> Scroll to the bottom and click "More Data Available, Click to load" button.

           5. Scroll to the top and forbidden error streams.

      Actual results:

      Even though the correct logs are visible in Aggregated Logs menu, it still shows Forbidden error when "More Data Available, Click to load" button is clicked.

      Expected results:

      There should not be any Forbidden error when the correct amount of access is in place.

      Additional info:

              gbernal@redhat.com Gabriel Bernal
              rhn-support-dgautam Dhruv Gautam
              Kabir Bharti Kabir Bharti
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: