kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[BUG] mongodb cluster container lorry logs contain secret password

Open JashBook opened this issue 7 months ago • 0 comments

Describe the bug

kbcli version
Kubernetes: v1.30.0
KubeBlocks: 0.9.1-beta.5
kbcli: 0.9.0

2024-07-22T02:18:55Z INFO MongoDB Create user: root, passwd: ffsl47b8, roles: map[db:admin role:root]

To Reproduce Steps to reproduce the behavior:

  1. create cluster
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: mongo-mbfidc
  namespace: default
spec:
  clusterDefinitionRef: mongodb
  clusterVersionRef: mongodb-5.0
  terminationPolicy: Halt
  componentSpecs:
    - name: mongodb
      componentDefRef: mongodb
      replicas: 3
      resources:
        requests:
          cpu: 100m
          memory: 0.5Gi
        limits:
          cpu: 100m
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 3Gi
kubectl get pod -l app.kubernetes.io/instance=mongo-mbfidc                     
NAME                     READY   STATUS    RESTARTS   AGE
mongo-mbfidc-mongodb-0   3/3     Running   0          6m43s
mongo-mbfidc-mongodb-1   3/3     Running   0          6m43s
mongo-mbfidc-mongodb-2   3/3     Running   0          6m43s

kubectl get secrets  mongo-mbfidc-conn-credential -o jsonpath="{.data.password}"| base64 -d  
ffsl47b8
  1. see error
kubectl logs mongo-mbfidc-mongodb-0  -c lorry | grep "ffsl47b8"

2024-07-22T02:18:55Z	INFO	MongoDB	Create user: root, passwd: ffsl47b8, roles: map[db:admin role:root]
2024-07-22T02:19:00Z	INFO	MongoDB	Create user: root, passwd: ffsl47b8, roles: map[db:admin role:root]

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

JashBook avatar Jul 22 '24 02:07 JashBook