kubernetes-sigs / aws-ebs-csi-driver

CSI driver for Amazon EBS https://aws.amazon.com/ebs/
Apache License 2.0
987 stars 792 forks source link

Environment Variable AWS_USE_FIPS_ENDPOINT does not use AWS Fips Endpoint as expected #2206

Open repl-richard-puth opened 4 hours ago

repl-richard-puth commented 4 hours ago

/kind bug

What happened? First off, I'm not sure if this would qualify as a bug or not, but nonetheless the following does not appear to function as expected. To give a bit of context, our EKS cluster runs the ebs-csi-driver as a daemonset. It coordinates three ebs-csi-driver pods. We've added the AWS_USE_FIPS_ENDPOINT environment variable to the Daemonset's configuration. After testing the new pods with the added environment variable, we were unable to see the AWS Fips endpoint in the logs. Instead, it was the regular AWS Endpoint that got used.

What you expected to happen? We expected Cloudtrail logs to display the AWS FIPS endpoint instead of the regular endpoint. We made sure that the version aws-ebs-csi-driver is using uses the correct go SDK version supporting the AWS_USE_FIPS_ENDPOINT env variable.

How to reproduce it (as minimally and precisely as possible)?

  1. Deploy aws-ebs-driver with the following environment variable.
"env": [
          {
            .....
          },
          {
            "name": "AWS_USE_FIPS_ENDPOINT",
            "value": "true"
          }
        ],
  1. Then start a test container that uses the ebs-csi-driver. We tested with https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/examples/kubernetes/block-volume.
  2. Once that is done, Cloudtrail logs should've logged an event called AttachVolume. This event shows what was endpoint is used.
    "tlsDetails": {
        "tlsVersion": "TLSv1.3",
        "cipherSuite": "TLS_AES_128_GCM_SHA256",
        "clientProvidedHostHeader": "ec2.us-west-2.amazonaws.com"
    }

Anything else we need to know?:

Environment

torredil commented 3 hours ago

Hi @repl-richard-puth, the AWS_USE_FIPS_ENDPOINT env var needs to be set in the controller's configuration, not in the DaemonSet configuration (the controller pod exercises the API calls).