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

The permissions on the "/etc/passwd" files differ on ansible automation platform image that is 664

XMLWordPrintable

    • Important
    • No
    • 2
    • OSDOCS Sprint 251
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      whoami command fails in openshift 4.12 pod

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

      4.12

      How reproducible:

      deploy a pod with given steps

      Steps to Reproduce:

      1. Create a new project
      2. # pod with this image does NOT print uid successfully
      apiVersion: v1
      kind: Pod
      metadata:
        name: testsshiso
        namespace: jmorenas-dev
        annotations:
          seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
      spec:
        containers:
        - name: testssh
          image: registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:1.0.0-274
          command: ["whoami"]
          securityContext:
            allowPrivilegeEscalation: false
            runAsNonRoot: true
            capabilities:
              drop:
              - ALL
       3. Then check the logs for the newly spawned pods, and you will see it does not returns the uid.
      
      4 whereas, if you use another image like registry.access.redhat.com/ubi9/ubi it will return UID.  

      Actual results:

      registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:1.0.0-274 not returning userid in /etc/passwd

      Expected results:

      registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:1.0.0-274 should return userid in /etc/passwd as its permission is differ from other images (correct one is 644, but its permission is 664)

      Additional info:

      The permissions on the "/etc/passwd" files differ on both images. The AAP image has 664 whereas the UBI image has 644.
      AAP pod:
      sh-4.4$ ls -l /etc/passwd;
      -rw-rw-r--. 1 root root 533 Mar  7 00:15 /etc/passwdubi9 pod:
      sh-5.1$ ls -l /etc/passwd;
      -rw-r--r--. 1 root root 837 Jul  6 10:57 /etc/passwd

            dan_chadwick Dan Chadwick
            rhn-support-hjaiswal Himanshu Jaiswal
            David Darrah David Darrah
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: