The AWS provider for the Secrets Store CSI Driver allows you to fetch secrets from AWS Secrets Manager and AWS Systems Manager Parameter Store, and mount them into Kubernetes pods.
Go
596
201 commits
updated Oct 16, 2026
AWS offers two services to manage secrets and parameters conveniently in your code. AWS Secrets Manager allows you to easily rotate, manage, and retrieve database credentials, API keys, certificates, and other secrets throughout their lifecycle. AWS Systems Manager Parameter Store provides hierarchical storage for configuration data. The AWS provider for the Secrets Store CSI Driver allows you to make secrets stored in Secrets Manager and parameters stored in Parameter Store appear as files mounted in Kubernetes pods.
helm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts
helm install -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver
Note that older versions of the driver may require the --set grpcSupportedProviders="aws" flag on the install step.secrets-store-csi-driver.install=false.helm repo add aws-secrets-manager https://aws.github.io/secrets-store-csi-driver-provider-aws
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/deployment/aws-provider-installer.yaml
If you install the secrets-store-csi-driver separately (not via this Helm chart), you must configure tokenRequests in the CSI driver for the AWS provider to authenticate with AWS services:
helm upgrade csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver \
--set tokenRequests[0].audience="sts.amazonaws.com" \
--set tokenRequests[1].audience="pods.eks.amazonaws.com"
Or if using kubectl, add the following to your CSIDriver manifest:
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: secrets-store.csi.k8s.io
spec:
tokenRequests:
- audience: "sts.amazonaws.com"
- audience: "pods.eks.amazonaws.com"
Set the region name and name of your cluster to use in the bash commands that follow:
REGION=<REGION>
CLUSTERNAME=<CLUSTERNAME>
Where <REGION> is the region in which your Kubernetes cluster is running and <CLUSTERNAME> is the name of your cluster.
Create a test secret:
aws --region "$REGION" secretsmanager create-secret --name MySecret --secret-string '{"username":"memeuser", "password":"hunter2"}'
Create an access policy for the pod scoped down to just the secrets it should have and save the policy ARN in a shell variable:
POLICY_ARN=$(aws --region "$REGION" --query Policy.Arn --output text iam create-policy --policy-name nginx-deployment-policy --policy-document '{
"Version": "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"],
"Resource": ["arn:*:secretsmanager:*:*:secret:MySecret-??????"]
} ]
}')
Note, when using SSM parameters the permission "ssm:GetParameters" is needed in the policy. To simplify this example we use wild card matches above but you could lock this down further using the full ARN from the output of create-secret above.
eksctl utils associate-iam-oidc-provider --region="$REGION" --cluster="$CLUSTERNAME" --approve # Only run this once
eksctl create iamserviceaccount --name nginx-irsa-deployment-sa --region="$REGION" --cluster "$CLUSTERNAME" --attach-policy-arn "$POLICY_ARN" --approve --override-existing-serviceaccounts
For a private cluster, ensure that the VPC the cluster is in has an AWS STS endpoint. For more information, see Interface VPC endpoints in the AWS IAM User Guide.
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleSecretProviderClass-IRSA.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleDeployment-IRSA.yaml
To verify the secret has been mounted properly, See the example below:
kubectl exec -it $(kubectl get pods | awk '/nginx-irsa-deployment/{print $1}' | head -1) -- cat /mnt/secrets-store/MySecret; echo
Note: EKS Pod Identity option is only supported for EKS in the Cloud. It's not supported for Amazon EKS Anywhere, Red Hat Openshift Service on AWS (ROSA) and self-managed Kubernetes clusters on Amazon Elastic Compute Cloud (Amazon EC2) instances.
eksctl create addon --name eks-pod-identity-agent --cluster "$CLUSTERNAME" --region "$REGION"
ROLE_ARN=$(aws --region "$REGION" --query Role.Arn --output text iam create-role --role-name nginx-deployment-role --assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "pods.eks.amazonaws.com"
},
"Action": [
"sts:AssumeRole",
"sts:TagSession"
]
}
]
}')
aws iam attach-role-policy \
--role-name nginx-deployment-role \
--policy-arn $POLICY_ARN
eksctl create podidentityassociation \
--cluster "$CLUSTERNAME" \
--namespace default \
--region "$REGION" \
--service-account-name nginx-pod-identity-deployment-sa \
--role-arn $ROLE_ARN \
--create-service-account true
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleSecretProviderClass-PodIdentity.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleDeployment-PodIdentity.yaml
To verify the secret has been mounted properly, See the example below:
kubectl exec -it $(kubectl get pods | awk '/nginx-pod-identity-deployment/{print $1}' | head -1) -- cat /mnt/secrets-store/MySecret; echo
Most errors can be viewed by describing the pod deployment. For the deployment, find the pod names using get pods (use -n <NAMESPACE> if you are not using the default namespace):
kubectl get pods
Then describe the pod (substitute the pod ID from above for <PODID>, as before use -n if you are not using the default namespace):
kubectl describe pod/<PODID>
Additional information may be available in the provider logs:
kubectl -n kube-system get pods
kubectl -n kube-system logs pod/<PODID>
Where <PODID> in this case is the id of the csi-secrets-store-provider-aws pod.
The SecretProviderClass has the following format:
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: <NAME>
spec:
provider: aws
parameters:
The parameters section contains the details of the mount request and contain one of the three fields:
parameters:
objects: |
- objectName: "MySecret"
objectType: "secretsmanager"
topology.kubernetes.io/region label on the node. This lookup adds overhead to mount requests so clusters using large numbers of pods will benefit from providing the region here.The primary objects field of the SecretProviderClass can contain the following sub-fields:
objectName: This field is required. It specifies the name of the secret or parameter to be fetched. For Secrets Manager this is the SecretId parameter and can be either the friendly name or full ARN of the secret. For SSM Parameter Store, this is the Name of the parameter and can be either the name or full ARN of the parameter.
objectType: This field is optional when using a Secrets Manager ARN for objectName, otherwise it is required. This field can be either "secretsmanager" or "ssmparameter".
objectAlias: This optional field specifies the file name under which the secret will be mounted. When not specified the file name defaults to objectName.
filePermission: This optional field expects a 4 digit string which specifies the file permission for the secret that will be mounted. When not specified this will default to "0644" permisions. Ensure the 4 digit string is a valid octal file permission.
objectVersion: This field is optional, and generally not recommended since updates to the secret require updating this field. For Secrets Manager this is the VersionId. For SSM Parameter Store, this is the optional version number.
objectVersionLabel: This optional field specifies the alias used for the version. Most applications should not use this field since the most recent version of the secret is used by default. For Secrets Manager this is the VersionStage. For SSM Parameter Store this is the optional Parameter Label.
failoverObject: An optional field when using the failoverRegion feature. See the Automated Failover Regions section in this readme for more information. The failover object can contain the following sub-fields:
jmesPath: This optional field specifies the specific key-value pairs to extract from a JSON-formatted secret. You can use this field to mount key-value pairs from a properly formatted secret value as individual secrets. For example: Consider a secret "MySecret" with JSON content as follows:
{
"username": "testuser"
"password": "testpassword"
}
To mount the username and password key pairs of this secret as individual secrets, use the jmesPath field as follows:
objects: |
- objectName: "MySecret"
objectType: "secretsmanager"
jmesPath:
- path: "username"
objectAlias: "MySecretUsername"
- path: "password"
objectAlias: "MySecretPassword"
If either the 'path' or the 'objectAlias' fields contain a hyphen, then they must be escaped with a single quote:
- path: '"hyphenated-path"'
objectAlias: '"hyphenated-alias"'
If you use the jmesPath field, you must provide the following two sub-fields:
You may pass an additional sub-field to specify the file permission:
When using the optional alpha rotation reconciler feature of the Secrets Store CSI driver the driver will periodically remount the secrets in the SecretProviderClass. This will cause additional API calls which results in additional charges. Applications should use a reasonable poll interval that works with their rotation strategy. A one hour poll interval is recommended as a default to reduce excessive API costs.
Anyone wishing to test out the rotation reconciler feature can enable it using helm:
helm upgrade -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --set enableSecretRotation=true --set rotationPollInterval=3600s
In order to provide availability during connectivity outages or for disaster recovery configurations, this provider supports an automated failover feature to fetch secrets or parameters from a secondary region. To define an automated failover region, define the failoverRegion in the SecretProviderClass.yaml file:
spec:
provider: aws
parameters:
region: us-east-1
failoverRegion: us-east-2
When the failoverRegion is defined, the driver will attempt to get the secret value from both regions.
It is possible to use different secrets or parameters between the primary and failover regions. This example will use different ARNs depending on which region it is pulling from:
- objectName: "arn:aws:secretsmanager:us-east-1:123456789012:secret:PrimarySecret-12345"
failoverObject:
objectName: "arn:aws:secretsmanager:us-east-2:123456789012:secret:FailoverSecret-12345"
objectAlias: testArn
If 'failoverObject' is defined, then objectAlias is required.
EKS Pod Identity CreatePodIdentityAssociation requires the IAM role to reside in the same AWS account as the EKS cluster.
To mount AWS Secrets Manager secrets from a different AWS account than your EKS cluster, follow cross-account access to set up resource policy for the secret, key policy for the KMS key, and IAM role used in Pod Identity association. Fetching cross-account parameters from SSM Parameter Store is only supported for parameters in the advanced parameter tier. See Working with Shared Parameters for details.
You can pull down this git repository and build and install this plugin into your account's AWS ECR registry using the following steps. First clone the repository:
git clone https://github.com/aws/secrets-store-csi-driver-provider-aws
cd secrets-store-csi-driver-provider-aws
Next, set your region and repository name in bash shell variables to be used later:
export REGION=<REGION>
export PRIVREPO=<ACCOUNT>.dkr.ecr.$REGION.amazonaws.com/secrets-store-csi-driver-provider-aws
Where <REGION> is the AWS region in which your Kubernetes cluster is running, and <ACCOUNT> is your AWS account Id. Next create your ECR repository if you have not already done so:
aws --region $REGION ecr create-repository --repository-name secrets-store-csi-driver-provider-aws # Only do this once
Now run make to build the plugin and push it into your account's repo:
make
Once the image is in your repo you can install it into your cluster from your repo rather than the public repo:
envsubst < deployment/private-installer.yaml | kubectl apply -f -
If you use Helm chart to install the provider, append the --set useFipsEndpoint=true flag on the install step. Your install command would be something like
helm repo add aws-secrets-manager https://aws.github.io/secrets-store-csi-driver-provider-aws
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws --set useFipsEndpoint=true
To mount each secret on each pod, the AWS CSI provider lookups the region of the pod and the role ARN associated with the service account by calling the Kubernetes APIs. You can increase the value of qps and burst if you notice the provider is throttled by client-side limit to the API server.
If you use Helm chart to install the provider, append the --set-json 'k8sThrottlingParams={"qps": "<custom qps>", "burst": "<custom qps>"}' flag in the install step.
In order to configure the HTTP timeout for Pod Identity authentication, pass the pod-identity-http-timeout flag during the install step:
helm install ... --pod-identity-http-timeout=250ms
The timeout value must be a valid Go duration string (e.g. 2s, 500ms). The timeout value uses the AWS SDK default by default.
By default, the AWS provider is responsible for writing secret files to the pods. In order to instead make the Secrets Store CSI Driver perform the file writing, set the driver-writes-secrets flag to true during the install step.
Helm installation example:
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws --set driverWritesSecrets=true
Note: When driverWritesSecrets is enabled, the Secrets Store CSI Driver uses atomic writer to write the secret files. Atomic writer relies on symlinks to update file content. This means that reading file metadata (such as last updated timestamps) when the secret gets auto-rotated requires following symlinks (e.g., stat -L instead of stat). Applications that check file timestamps without following symlinks will see stale values. For more information, refer to the relevant Secrets Store CSI Driver documentation section.
The AWS Secrets Manager and Config Provider provides compatibility for legacy applications that access secrets as mounted files in the pod. Security conscious applications should use the native AWS APIs to fetch secrets and optionally cache them in memory rather than storing them in the file system.
For cluster hardening guidance, refer to the Kubernetes Pod Security Standards documentation.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
The CSI Secret Store driver runs as a DaemonSet, and as described in the AWS documentation, DaemonSet is not supported on Fargate. ↩
959 followers · starred Oct 2024
120 followers · starred Feb 2023
29 followers · starred May 2022
77 followers · starred Nov 2021
The AWS provider for the Secrets Store CSI Driver allows you to fetch secrets from AWS Secrets Manager and AWS Systems Manager Parameter Store, and mount them into Kubernetes pods.
Go
596
201 commits
updated Oct 16, 2026
AWS offers two services to manage secrets and parameters conveniently in your code. AWS Secrets Manager allows you to easily rotate, manage, and retrieve database credentials, API keys, certificates, and other secrets throughout their lifecycle. AWS Systems Manager Parameter Store provides hierarchical storage for configuration data. The AWS provider for the Secrets Store CSI Driver allows you to make secrets stored in Secrets Manager and parameters stored in Parameter Store appear as files mounted in Kubernetes pods.
helm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts
helm install -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver
Note that older versions of the driver may require the --set grpcSupportedProviders="aws" flag on the install step.secrets-store-csi-driver.install=false.helm repo add aws-secrets-manager https://aws.github.io/secrets-store-csi-driver-provider-aws
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/deployment/aws-provider-installer.yaml
If you install the secrets-store-csi-driver separately (not via this Helm chart), you must configure tokenRequests in the CSI driver for the AWS provider to authenticate with AWS services:
helm upgrade csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver \
--set tokenRequests[0].audience="sts.amazonaws.com" \
--set tokenRequests[1].audience="pods.eks.amazonaws.com"
Or if using kubectl, add the following to your CSIDriver manifest:
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: secrets-store.csi.k8s.io
spec:
tokenRequests:
- audience: "sts.amazonaws.com"
- audience: "pods.eks.amazonaws.com"
Set the region name and name of your cluster to use in the bash commands that follow:
REGION=<REGION>
CLUSTERNAME=<CLUSTERNAME>
Where <REGION> is the region in which your Kubernetes cluster is running and <CLUSTERNAME> is the name of your cluster.
Create a test secret:
aws --region "$REGION" secretsmanager create-secret --name MySecret --secret-string '{"username":"memeuser", "password":"hunter2"}'
Create an access policy for the pod scoped down to just the secrets it should have and save the policy ARN in a shell variable:
POLICY_ARN=$(aws --region "$REGION" --query Policy.Arn --output text iam create-policy --policy-name nginx-deployment-policy --policy-document '{
"Version": "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"],
"Resource": ["arn:*:secretsmanager:*:*:secret:MySecret-??????"]
} ]
}')
Note, when using SSM parameters the permission "ssm:GetParameters" is needed in the policy. To simplify this example we use wild card matches above but you could lock this down further using the full ARN from the output of create-secret above.
eksctl utils associate-iam-oidc-provider --region="$REGION" --cluster="$CLUSTERNAME" --approve # Only run this once
eksctl create iamserviceaccount --name nginx-irsa-deployment-sa --region="$REGION" --cluster "$CLUSTERNAME" --attach-policy-arn "$POLICY_ARN" --approve --override-existing-serviceaccounts
For a private cluster, ensure that the VPC the cluster is in has an AWS STS endpoint. For more information, see Interface VPC endpoints in the AWS IAM User Guide.
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleSecretProviderClass-IRSA.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleDeployment-IRSA.yaml
To verify the secret has been mounted properly, See the example below:
kubectl exec -it $(kubectl get pods | awk '/nginx-irsa-deployment/{print $1}' | head -1) -- cat /mnt/secrets-store/MySecret; echo
Note: EKS Pod Identity option is only supported for EKS in the Cloud. It's not supported for Amazon EKS Anywhere, Red Hat Openshift Service on AWS (ROSA) and self-managed Kubernetes clusters on Amazon Elastic Compute Cloud (Amazon EC2) instances.
eksctl create addon --name eks-pod-identity-agent --cluster "$CLUSTERNAME" --region "$REGION"
ROLE_ARN=$(aws --region "$REGION" --query Role.Arn --output text iam create-role --role-name nginx-deployment-role --assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "pods.eks.amazonaws.com"
},
"Action": [
"sts:AssumeRole",
"sts:TagSession"
]
}
]
}')
aws iam attach-role-policy \
--role-name nginx-deployment-role \
--policy-arn $POLICY_ARN
eksctl create podidentityassociation \
--cluster "$CLUSTERNAME" \
--namespace default \
--region "$REGION" \
--service-account-name nginx-pod-identity-deployment-sa \
--role-arn $ROLE_ARN \
--create-service-account true
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleSecretProviderClass-PodIdentity.yaml
kubectl apply -f https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/examples/ExampleDeployment-PodIdentity.yaml
To verify the secret has been mounted properly, See the example below:
kubectl exec -it $(kubectl get pods | awk '/nginx-pod-identity-deployment/{print $1}' | head -1) -- cat /mnt/secrets-store/MySecret; echo
Most errors can be viewed by describing the pod deployment. For the deployment, find the pod names using get pods (use -n <NAMESPACE> if you are not using the default namespace):
kubectl get pods
Then describe the pod (substitute the pod ID from above for <PODID>, as before use -n if you are not using the default namespace):
kubectl describe pod/<PODID>
Additional information may be available in the provider logs:
kubectl -n kube-system get pods
kubectl -n kube-system logs pod/<PODID>
Where <PODID> in this case is the id of the csi-secrets-store-provider-aws pod.
The SecretProviderClass has the following format:
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: <NAME>
spec:
provider: aws
parameters:
The parameters section contains the details of the mount request and contain one of the three fields:
parameters:
objects: |
- objectName: "MySecret"
objectType: "secretsmanager"
topology.kubernetes.io/region label on the node. This lookup adds overhead to mount requests so clusters using large numbers of pods will benefit from providing the region here.The primary objects field of the SecretProviderClass can contain the following sub-fields:
objectName: This field is required. It specifies the name of the secret or parameter to be fetched. For Secrets Manager this is the SecretId parameter and can be either the friendly name or full ARN of the secret. For SSM Parameter Store, this is the Name of the parameter and can be either the name or full ARN of the parameter.
objectType: This field is optional when using a Secrets Manager ARN for objectName, otherwise it is required. This field can be either "secretsmanager" or "ssmparameter".
objectAlias: This optional field specifies the file name under which the secret will be mounted. When not specified the file name defaults to objectName.
filePermission: This optional field expects a 4 digit string which specifies the file permission for the secret that will be mounted. When not specified this will default to "0644" permisions. Ensure the 4 digit string is a valid octal file permission.
objectVersion: This field is optional, and generally not recommended since updates to the secret require updating this field. For Secrets Manager this is the VersionId. For SSM Parameter Store, this is the optional version number.
objectVersionLabel: This optional field specifies the alias used for the version. Most applications should not use this field since the most recent version of the secret is used by default. For Secrets Manager this is the VersionStage. For SSM Parameter Store this is the optional Parameter Label.
failoverObject: An optional field when using the failoverRegion feature. See the Automated Failover Regions section in this readme for more information. The failover object can contain the following sub-fields:
jmesPath: This optional field specifies the specific key-value pairs to extract from a JSON-formatted secret. You can use this field to mount key-value pairs from a properly formatted secret value as individual secrets. For example: Consider a secret "MySecret" with JSON content as follows:
{
"username": "testuser"
"password": "testpassword"
}
To mount the username and password key pairs of this secret as individual secrets, use the jmesPath field as follows:
objects: |
- objectName: "MySecret"
objectType: "secretsmanager"
jmesPath:
- path: "username"
objectAlias: "MySecretUsername"
- path: "password"
objectAlias: "MySecretPassword"
If either the 'path' or the 'objectAlias' fields contain a hyphen, then they must be escaped with a single quote:
- path: '"hyphenated-path"'
objectAlias: '"hyphenated-alias"'
If you use the jmesPath field, you must provide the following two sub-fields:
You may pass an additional sub-field to specify the file permission:
When using the optional alpha rotation reconciler feature of the Secrets Store CSI driver the driver will periodically remount the secrets in the SecretProviderClass. This will cause additional API calls which results in additional charges. Applications should use a reasonable poll interval that works with their rotation strategy. A one hour poll interval is recommended as a default to reduce excessive API costs.
Anyone wishing to test out the rotation reconciler feature can enable it using helm:
helm upgrade -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --set enableSecretRotation=true --set rotationPollInterval=3600s
In order to provide availability during connectivity outages or for disaster recovery configurations, this provider supports an automated failover feature to fetch secrets or parameters from a secondary region. To define an automated failover region, define the failoverRegion in the SecretProviderClass.yaml file:
spec:
provider: aws
parameters:
region: us-east-1
failoverRegion: us-east-2
When the failoverRegion is defined, the driver will attempt to get the secret value from both regions.
It is possible to use different secrets or parameters between the primary and failover regions. This example will use different ARNs depending on which region it is pulling from:
- objectName: "arn:aws:secretsmanager:us-east-1:123456789012:secret:PrimarySecret-12345"
failoverObject:
objectName: "arn:aws:secretsmanager:us-east-2:123456789012:secret:FailoverSecret-12345"
objectAlias: testArn
If 'failoverObject' is defined, then objectAlias is required.
EKS Pod Identity CreatePodIdentityAssociation requires the IAM role to reside in the same AWS account as the EKS cluster.
To mount AWS Secrets Manager secrets from a different AWS account than your EKS cluster, follow cross-account access to set up resource policy for the secret, key policy for the KMS key, and IAM role used in Pod Identity association. Fetching cross-account parameters from SSM Parameter Store is only supported for parameters in the advanced parameter tier. See Working with Shared Parameters for details.
You can pull down this git repository and build and install this plugin into your account's AWS ECR registry using the following steps. First clone the repository:
git clone https://github.com/aws/secrets-store-csi-driver-provider-aws
cd secrets-store-csi-driver-provider-aws
Next, set your region and repository name in bash shell variables to be used later:
export REGION=<REGION>
export PRIVREPO=<ACCOUNT>.dkr.ecr.$REGION.amazonaws.com/secrets-store-csi-driver-provider-aws
Where <REGION> is the AWS region in which your Kubernetes cluster is running, and <ACCOUNT> is your AWS account Id. Next create your ECR repository if you have not already done so:
aws --region $REGION ecr create-repository --repository-name secrets-store-csi-driver-provider-aws # Only do this once
Now run make to build the plugin and push it into your account's repo:
make
Once the image is in your repo you can install it into your cluster from your repo rather than the public repo:
envsubst < deployment/private-installer.yaml | kubectl apply -f -
If you use Helm chart to install the provider, append the --set useFipsEndpoint=true flag on the install step. Your install command would be something like
helm repo add aws-secrets-manager https://aws.github.io/secrets-store-csi-driver-provider-aws
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws --set useFipsEndpoint=true
To mount each secret on each pod, the AWS CSI provider lookups the region of the pod and the role ARN associated with the service account by calling the Kubernetes APIs. You can increase the value of qps and burst if you notice the provider is throttled by client-side limit to the API server.
If you use Helm chart to install the provider, append the --set-json 'k8sThrottlingParams={"qps": "<custom qps>", "burst": "<custom qps>"}' flag in the install step.
In order to configure the HTTP timeout for Pod Identity authentication, pass the pod-identity-http-timeout flag during the install step:
helm install ... --pod-identity-http-timeout=250ms
The timeout value must be a valid Go duration string (e.g. 2s, 500ms). The timeout value uses the AWS SDK default by default.
By default, the AWS provider is responsible for writing secret files to the pods. In order to instead make the Secrets Store CSI Driver perform the file writing, set the driver-writes-secrets flag to true during the install step.
Helm installation example:
helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws --set driverWritesSecrets=true
Note: When driverWritesSecrets is enabled, the Secrets Store CSI Driver uses atomic writer to write the secret files. Atomic writer relies on symlinks to update file content. This means that reading file metadata (such as last updated timestamps) when the secret gets auto-rotated requires following symlinks (e.g., stat -L instead of stat). Applications that check file timestamps without following symlinks will see stale values. For more information, refer to the relevant Secrets Store CSI Driver documentation section.
The AWS Secrets Manager and Config Provider provides compatibility for legacy applications that access secrets as mounted files in the pod. Security conscious applications should use the native AWS APIs to fetch secrets and optionally cache them in memory rather than storing them in the file system.
For cluster hardening guidance, refer to the Kubernetes Pod Security Standards documentation.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
The CSI Secret Store driver runs as a DaemonSet, and as described in the AWS documentation, DaemonSet is not supported on Fargate. ↩
959 followers · starred Oct 2024
120 followers · starred Feb 2023
29 followers · starred May 2022
77 followers · starred Nov 2021