kubernetes-sigs / secrets-store-csi-driver

Secrets Store CSI driver for Kubernetes secrets - Integrates secrets stores with Kubernetes via a CSI volume.
https://secrets-store-csi-driver.sigs.k8s.io/
Apache License 2.0
1.26k stars 291 forks source link

Secret fails to mount if objectName contains file path separator (`/`) #1329

Open jcogilvie opened 1 year ago

jcogilvie commented 1 year ago

What steps did you take and what happened: Created a secret in AWS with a valid ARN, of the form "arn:aws:secretsmanager:us-east-1:...:secret:api-key/foobar"

Like so:

Broken:

spec:
  parameters:
    objects: >
      - objectName:
      "arn:aws:secretsmanager:us-east-1:...:secret:api-key/foobar"
  provider: aws
  secretObjects:
    - data:
        - key: authsharedkeylocal-key
          objectName:"arn:aws:secretsmanager:us-east-1:...:secret:api-key/foobar"
      secretName: authsharedkeylocal
      type: Opaque

Working:

spec:
  parameters:
    objects: >
      - objectName:
      "arn:aws:secretsmanager:us-east-1:...:secret:api-key/foobar"
        objectAlias: myAlias
  provider: aws
  secretObjects:
    - data:
        - key: authsharedkeylocal-key
          objectName:"myAlias"
      secretName: authsharedkeylocal
      type: Opaque

Received errors:

file matching objectName arn:aws:secretsmanager:us-east-1:...:secret:api-key/foobar not found in the pod

What did you expect to happen: Secret is mounted successfully.

Anything else you would like to add: This works if the secret is renamed to not include a / or if an objectAlias is used.

Which provider are you using: AWS

Environment: EKS 1.26

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

jcogilvie commented 8 months ago

/remove-lifecycle stale

k8s-triage-robot commented 5 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

aramase commented 5 months ago

/remove-lifecycle stale /lifecycle frozen